[
  {
    "path": ".env_template",
    "content": "# rename this file to .env\n\nAPPBUILDER_TOKEN=your-token\nAPPBUILDER_TOKEN_V2=your-token\nBAIDU_VDB_API_KEY=your-token\nINSTANCE_ID=your-token\nDATASET_ID=your-token\nAPPBUILDER_TOKEN_DOC_FORMAT=your-token\n"
  },
  {
    "path": ".github/workflows/python-package.yml",
    "content": "# This workflow will install Python dependencies, run tests and lint with a variety of Python versions\n# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python\n\nname: Python package\n\non:\n  workflow_dispatch:\n  push:\n    branches: [ \"master\" ]\n  pull_request:\n    branches: [ \"master\" ]\n\njobs:\n  Pylint:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        python-version: [\"3.12.5\"]\n\n    steps:\n    - uses: actions/checkout@v3\n    - name: Set up Python ${{ matrix.python-version }}\n      uses: actions/setup-python@v3\n      with:\n        python-version: ${{ matrix.python-version }}\n    - name: Install dependencies\n      run: |\n        python -m pip install --upgrade pip\n        python -m pip install flake8 pytest\n        python -m pip install chainlit~=1.0.200 flask~=2.3.2 flask-restful==0.3.9\n        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi\n    - name: Lint with flake8\n      run: |\n        # stop the build if there are Python syntax errors or undefined names\n        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics\n        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide\n        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics\n\n  Python312-CI-Tests:\n    runs-on: ubuntu-latest\n    env:\n      APPBUILDER_TOKEN: ${{ secrets.APPBUILDER_TOKEN }}\n      APPBUILDER_TOKEN_V2: ${{ secrets.APPBUILDER_TOKEN_V2 }}\n      BAIDU_VDB_API_KEY: ${{ secrets.BAIDU_VDB_API_KEY }}\n      INSTANCE_ID: ${{ secrets.INSTANCE_ID }}\n      DATASET_ID: ${{ secrets.DATASET_ID }}\n      APPBUILDER_TOKEN_DOC_FORMAT: ${{ secrets.APPBUILDER_TOKEN_DOC_FORMAT }}\n    strategy:\n      fail-fast: false\n      matrix:\n        python-version: [\"3.12\"]\n    \n    steps:\n    - uses: actions/checkout@v4\n      with:\n        ref: ${{ github.event.pull_request.head.sha }}\n    - name: Set up Python ${{ matrix.python-version }}\n      uses: actions/setup-python@v3\n      with:\n        python-version: ${{ matrix.python-version }}\n    - name: Print ENV\n      run: |\n        env\n        ls\n        pwd\n    - name: Git Clone And Checkout Branch\n      run: |\n        fork_repo=\"https://github.com/$GITHUB_ACTOR/app-builder.git\"\n        mkdir cicd\n        cd cicd\n        git clone $fork_repo\n        cd app-builder\n        git checkout $GITHUB_HEAD_REF\n        git remote add upstream https://github.com/baidubce/app-builder.git \n        git fetch upstream\n        git remote -v\n        git status\n\n        # 找到当前分支与 upstream/master 的共同祖先提交\n        merge_base=$(git merge-base HEAD upstream/master)\n        echo \"merge_base=$merge_base\"\n\n        # 比较当前分支与 merge_base 之间的差异\n        changed_files=$(git diff --name-only --diff-filter=ACMRT $merge_base)\n        changed_files_py_sh=$(git diff --name-only --diff-filter=ACMRT $merge_base -- $(find python -type f \\( -name '*.py' -o -name '*.sh' \\)))\n        \n        echo \"发生更改的文件为:\"\n        echo \"$changed_files\"\n\n        echo \"发生更改的py/sh文件为:\"\n\n        if [ -n \"$changed_files_py_sh\" ]; then\n          export APPBUILDER_PYTHON_TESTS=True\n          echo \"$changed_files_py_sh\"\n        else\n          export APPBUILDER_PYTHON_TESTS=False\n          echo \"没有检测到Python或Shell文件被更改\"\n        fi\n\n        echo \"APPBUILDER_PYTHON_TESTS=$APPBUILDER_PYTHON_TESTS\" >> $GITHUB_ENV\n        pwd\n    - name: Install dependencies\n      run: |\n        echo $APPBUILDER_PYTHON_TESTS\n        if [ \"$APPBUILDER_PYTHON_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_PYTHON_TESTS为False,没有检测到Python或Shell文件被更改,跳过Install dependencies部分。\"\n        else\n          echo \"检测到Python或Shell文件被更改(根据环境变量APPBUILDER_PYTHON_TESTS),准备启动单元测试Install dependencies部分...\"\n          cd cicd/app-builder\n          pwd\n          sudo apt-get update\n          sudo apt-get install ffmpeg libavcodec-extra\n          python3 -m ensurepip --upgrade\n          python3 -m pip install --upgrade pip\n          python3 -m pip install \"setuptools<=76.1.0\"\n          python3 -m pip install wheel\n          python3 -m pip install coverage\n          python3 -m pip install diff-cover\n          python3 -m pip install pydub\n          python3 -m pip install SQLAlchemy==2.0.31\n          python3 -m pip install chainlit~=1.0.200 flask~=2.3.2 flask-restful==0.3.9\n          python3 -m pip install opentelemetry-exporter-otlp==1.23.0 opentelemetry-instrumentation==0.44b0 opentelemetry-sdk==1.23.0 opentelemetry-api==1.23.0\n          python3 -m pip install pandas==2.2.2\n          python3 -m pip install mcp ; true\n        fi\n    - name: Build whl\n      run: |\n        echo $APPBUILDER_PYTHON_TESTS\n        if [ \"$APPBUILDER_PYTHON_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_PYTHON_TESTS为False,没有检测到Python或Shell文件被更改,跳过Build whl部分。\"\n        else\n          echo \"检测到Python或Shell文件被更改(根据环境变量APPBUILDER_PYTHON_TESTS),准备启动单元测试Build whl部分...\"\n          cd cicd/app-builder     \n          pwd\n          python3 setup.py bdist_wheel\n          python3 -m pip uninstall -y appbuilder-sdk\n          python3 -m pip install dist/*.whl\n        fi\n    - name: Test with unittest\n      run: |\n        echo $APPBUILDER_PYTHON_TESTS\n        if [ \"$APPBUILDER_PYTHON_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_PYTHON_TESTS为False,没有检测到Python或Shell文件被更改,跳过Test with unittest部分。\"\n        else\n          echo \"检测到Python或Shell文件被更改(根据环境变量APPBUILDER_PYTHON_TESTS),准备启动单元测试Test with unittest部分...\"\n          cd cicd/app-builder\n          pwd\n          sh python/tests/run_python_test.sh\n        fi\n\n  Python39-CI-Tests:\n    runs-on: ubuntu-latest\n    env:\n      APPBUILDER_TOKEN: ${{ secrets.APPBUILDER_TOKEN }}\n      APPBUILDER_TOKEN_V2: ${{ secrets.APPBUILDER_TOKEN_V2 }}\n      BAIDU_VDB_API_KEY: ${{ secrets.BAIDU_VDB_API_KEY }}\n      INSTANCE_ID: ${{ secrets.INSTANCE_ID }}\n      DATASET_ID: ${{ secrets.DATASET_ID }}\n      APPBUILDER_TOKEN_DOC_FORMAT: ${{ secrets.APPBUILDER_TOKEN_DOC_FORMAT }}\n    strategy:\n      fail-fast: false\n      matrix:\n        python-version: [\"3.9\"]\n    \n    steps:\n    - uses: actions/checkout@v4\n      with:\n        ref: ${{ github.event.pull_request.head.sha }}\n    - name: Set up Python ${{ matrix.python-version }}\n      uses: actions/setup-python@v3\n      with:\n        python-version: ${{ matrix.python-version }}\n    - name: Print ENV\n      run: |\n        env\n        ls\n        pwd\n    - name: Git Clone And Checkout Branch\n      run: |\n        fork_repo=\"https://github.com/$GITHUB_ACTOR/app-builder.git\"\n        mkdir cicd\n        cd cicd\n        git clone $fork_repo\n        cd app-builder\n        git checkout $GITHUB_HEAD_REF\n        git remote add upstream https://github.com/baidubce/app-builder.git \n        git fetch upstream\n        git remote -v\n        git status\n\n        # 找到当前分支与 upstream/master 的共同祖先提交\n        merge_base=$(git merge-base HEAD upstream/master)\n        echo \"merge_base=$merge_base\"\n\n        # 比较当前分支与 merge_base 之间的差异\n        changed_files=$(git diff --name-only --diff-filter=ACMRT $merge_base)\n        changed_files_py_sh=$(git diff --name-only --diff-filter=ACMRT $merge_base -- $(find python -type f \\( -name '*.py' -o -name '*.sh' \\)))\n        \n        echo \"发生更改的文件为:\"\n        echo \"$changed_files\"\n\n        echo \"发生更改的py/sh文件为:\"\n\n        if [ -n \"$changed_files_py_sh\" ]; then\n          export APPBUILDER_PYTHON_TESTS=True\n          echo \"$changed_files_py_sh\"\n        else\n          export APPBUILDER_PYTHON_TESTS=False\n          echo \"没有检测到Python或Shell文件被更改\"\n        fi\n\n        echo \"APPBUILDER_PYTHON_TESTS=$APPBUILDER_PYTHON_TESTS\" >> $GITHUB_ENV\n        pwd\n    - name: Install dependencies\n      run: |\n        echo $APPBUILDER_PYTHON_TESTS\n        if [ \"$APPBUILDER_PYTHON_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_PYTHON_TESTS为False,没有检测到Python或Shell文件被更改,跳过Install dependencies部分。\"\n        else\n          echo \"检测到Python或Shell文件被更改(根据环境变量APPBUILDER_PYTHON_TESTS),准备启动单元测试Install dependencies部分...\"\n          cd cicd/app-builder\n          pwd\n          sudo apt-get update\n          sudo apt-get install ffmpeg libavcodec-extra\n          python3 -m ensurepip --upgrade\n          python3 -m pip install --upgrade pip\n          python3 -m pip install \"setuptools<=76.1.0\"\n          python3 -m pip install wheel\n          python3 -m pip install coverage\n          python3 -m pip install diff-cover\n          python3 -m pip install pydub\n          python3 -m pip install SQLAlchemy==2.0.31\n          python3 -m pip install chainlit~=1.0.200 flask~=2.3.2 flask-restful==0.3.9\n          python3 -m pip install opentelemetry-exporter-otlp==1.23.0 opentelemetry-instrumentation==0.44b0 opentelemetry-sdk==1.23.0 opentelemetry-api==1.23.0\n          python3 -m pip install pandas==2.2.2\n        fi\n    - name: Build whl\n      run: |\n        echo $APPBUILDER_PYTHON_TESTS\n        if [ \"$APPBUILDER_PYTHON_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_PYTHON_TESTS为False,没有检测到Python或Shell文件被更改,跳过Build whl部分。\"\n        else\n          echo \"检测到Python或Shell文件被更改(根据环境变量APPBUILDER_PYTHON_TESTS),准备启动单元测试Build whl部分...\"\n          cd cicd/app-builder     \n          pwd\n          python3 setup.py bdist_wheel\n          python3 -m pip uninstall -y appbuilder-sdk\n          python3 -m pip install dist/*.whl\n        fi\n    - name: Test with unittest\n      run: |\n        echo $APPBUILDER_PYTHON_TESTS\n        if [ \"$APPBUILDER_PYTHON_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_PYTHON_TESTS为False,没有检测到Python或Shell文件被更改,跳过Test with unittest部分。\"\n        else\n          echo \"检测到Python或Shell文件被更改(根据环境变量APPBUILDER_PYTHON_TESTS),准备启动单元测试Test with unittest部分...\"\n          cd cicd/app-builder\n          pwd\n          sh python/tests/run_python_test.sh\n        fi\n        \n  Go-Test-CI:\n    runs-on: ubuntu-latest\n    env:\n      APPBUILDER_TOKEN: ${{ secrets.APPBUILDER_TOKEN }}\n      APPBUILDER_TOKEN_V2: ${{ secrets.APPBUILDER_TOKEN_V2 }}\n      BAIDU_VDB_API_KEY: ${{ secrets.BAIDU_VDB_API_KEY }}\n      INSTANCE_ID: ${{ secrets.INSTANCE_ID }}\n      DATASET_ID: ${{ secrets.DATASET_ID }}\n      APPBUILDER_TOKEN_DOC_FORMAT: ${{ secrets.APPBUILDER_TOKEN_DOC_FORMAT }}\n \n      APPBUILDER_TOKEN_V3: ${{ secrets.APPBUILDER_TOKEN_V3 }}\n      DATASET_ID_V3: ${{ secrets.DATASET_ID_V3 }}\n      DOCUMENT_ID_V3: ${{ secrets.DOCUMENT_ID_V3 }}\n    strategy:\n      fail-fast: false\n      matrix:\n        go-version: ['1.18']\n      max-parallel: 2\n\n    steps:\n    - name: Checkout code\n      uses: actions/checkout@v3\n      with:\n        ref: ${{ github.event.pull_request.head.sha }}\n    - name: Set up Go\n      uses: actions/setup-go@v3\n      with:\n        go-version: ${{ matrix.go-version }}\n    - name: Git Clone And Checkout Branch\n      run: |\n        fork_repo=\"https://github.com/$GITHUB_ACTOR/app-builder.git\"\n        mkdir cicd\n        cd cicd\n        git clone $fork_repo\n        cd app-builder\n        echo \"github_head的值为：\"\n        echo $GITHUB_HEAD_REF\n        git checkout $GITHUB_HEAD_REF\n        git remote add upstream https://github.com/baidubce/app-builder.git \n        git fetch upstream\n        git remote -v\n        git status\n\n        # 找到当前分支与 upstream/master 的共同祖先提交\n        merge_base=$(git merge-base HEAD upstream/master)\n        echo \"merge_base=$merge_base\"\n\n        # 比较当前分支与 merge_base 之间的差异\n        changed_files=$(git diff --name-only --diff-filter=ACMRT $merge_base)\n        changed_files_go=$(git diff --name-only --diff-filter=ACMRT $merge_base -- 'go/**')\n\n        echo \"发生更改的文件为:\"\n        echo \"$changed_files\"\n        echo \"发生更改的Go相关文件为:\"\n\n        if [ -n \"$changed_files_go\" ]; then\n          export APPBUILDER_GO_TESTS=True\n          echo \"$changed_files_go\"\n        else\n          export APPBUILDER_GO_TESTS=False\n          echo \"没有检测到Go或Shell文件被更改\"\n        fi\n\n        echo \"APPBUILDER_GO_TESTS=$APPBUILDER_GO_TESTS\" >> $GITHUB_ENV\n    - name: Install dependencies and tools\n      run: |\n        echo $APPBUILDER_GO_TESTS\n        if [ \"$APPBUILDER_GO_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_GO_TESTS为False,没有检测到Go文件被更改，跳过Install dependencies and tools部分。\"\n        else\n          echo \"检测到Go文件被更改，准备启动Install dependencies and tools部分...\"\n          cd cicd/app-builder/go/appbuilder\n          go mod tidy\n\n          go get github.com/axw/gocov/gocov  # 安装增量覆盖率工具\n\n          # 安装 golangci-lint\n          curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3\n          echo \"$GOPATH/bin\" >> $GITHUB_PATH\n\n        fi\n\n    - name: Run tests and calculate incremental coverage\n      run: |\n        echo $APPBUILDER_GO_TESTS\n        if [ \"$APPBUILDER_GO_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_GO_TESTS为False，没有检测到Go文件被更改，跳过Run tests部分。\"\n        else\n          echo \"检测到Go文件被更改，准备启动Run tests部分...\"\n          cd cicd/app-builder/go\n          # 运行测试并生成覆盖率报告\n          chmod +x run_go_test.sh\n          ./run_go_test.sh\n        fi\n      shell: bash\n  Java-CI-Tests:\n    runs-on: ubuntu-latest\n    env:\n      APPBUILDER_TOKEN: ${{ secrets.APPBUILDER_TOKEN }}\n      APPBUILDER_TOKEN_V2: ${{ secrets.APPBUILDER_TOKEN_V2 }}\n      BAIDU_VDB_API_KEY: ${{ secrets.BAIDU_VDB_API_KEY }}\n      INSTANCE_ID: ${{ secrets.INSTANCE_ID }}\n      DATASET_ID: ${{ secrets.DATASET_ID }}\n      APPBUILDER_TOKEN_DOC_FORMAT: ${{ secrets.APPBUILDER_TOKEN_DOC_FORMAT }}\n \n      APPBUILDER_TOKEN_V3: ${{ secrets.APPBUILDER_TOKEN_V3 }}\n      DATASET_ID_V3: ${{ secrets.DATASET_ID_V3 }}\n      DOCUMENT_ID_V3: ${{ secrets.DOCUMENT_ID_V3 }}\n    strategy:\n      fail-fast: false\n      matrix:\n        java-version: ['8']  # 使用 Java 11 和 17 作为示例\n\n    steps:\n    - name: Checkout code\n      uses: actions/checkout@v3\n      with:\n        ref: ${{ github.event.pull_request.head.sha }}\n    \n    - name: Set up JDK ${{ matrix.java-version }}\n      uses: actions/setup-java@v3\n      with:\n        java-version: ${{ matrix.java-version }}\n        distribution: 'temurin'\n\n    - name: Print ENV\n      run: |\n        env\n        ls\n        pwd\n\n    - name: Git Clone And Checkout Branch\n      run: |\n        fork_repo=\"https://github.com/$GITHUB_ACTOR/app-builder.git\"\n        mkdir cicd\n        cd cicd\n        git clone $fork_repo\n        cd app-builder\n        git checkout $GITHUB_HEAD_REF\n        git remote add upstream https://github.com/baidubce/app-builder.git \n        git fetch upstream\n        git remote -v\n        git status\n\n        # 找到当前分支与 upstream/master 的共同祖先提交\n        merge_base=$(git merge-base HEAD upstream/master)\n        echo \"merge_base=$merge_base\"\n\n        # 比较当前分支与 merge_base 之间的差异\n        changed_files=$(git diff --name-only --diff-filter=ACMRT $merge_base)\n        changed_files_java=$(git diff --name-only --diff-filter=ACMRT $merge_base -- 'java/**')\n        \n        echo \"发生更改的文件为:\"\n        echo \"$changed_files\"\n\n        echo \"发生更改的Java相关文件为:\"\n\n        if [ -n \"$changed_files_java\" ]; then\n          export APPBUILDER_JAVA_TESTS=True\n          echo \"$changed_files_java\"\n        else\n          export APPBUILDER_JAVA_TESTS=False\n          echo \"没有检测到Java文件被更改\"\n        fi\n\n        echo \"APPBUILDER_JAVA_TESTS=$APPBUILDER_JAVA_TESTS\" >> $GITHUB_ENV\n        pwd\n\n    - name: Install Python dependencies\n      run: |\n        python -m pip install --upgrade pip\n        pip install gitpython lxml\n    - name: Install dependencies\n      run: |\n        echo $APPBUILDER_JAVA_TESTS\n        if [ \"$APPBUILDER_JAVA_TESTS\" = \"False\" ]; then\n          echo \"环境变量APPBUILDER_JAVA_TESTS为False,没有检测到Java文件被更改,跳过Install dependencies部分。\"\n        else\n          echo \"检测到Java文件被更改(根据环境变量APPBUILDER_JAVA_TESTS),准备启动单元测试Install dependencies部分...\"\n          cd cicd/app-builder/java\n          mvn clean install -DskipTests\n        fi\n \n    - name: Run Java tests with Jacoco\n      if: env.APPBUILDER_JAVA_TESTS == 'True'\n      run: |\n        echo \"检测到Java文件被更改(根据环境变量APPBUILDER_JAVA_TESTS),准备启动Run Java tests with Jacoco部分...\"\n        cd cicd/app-builder/java\n        bash print_coverage.sh\n\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to AppBuilder\n\nThanks for your interest in contributing to AppBuilder!  Please follow these guidelines to make the contribution process easy and effective for everyone involved.\n\n\n## Contributing Guide for python SDK\n\n### Development\n\nClone the source code from Github\n\n```\ngit clone https://github.com/baidubce/app-builder.git\n```\n\nUse `pip` to install from source\n\n```shell\ncd appbuilder\npip install -e .\n```\n\n`-e` means \"editable mode\" in pip. With \"editable mode\" all changes to python code will immediately become effective in the current environment.\n\n### Testing\n\nWe highly recommend writing tests for new features or bug fixes and ensure all tests passing before submitting a PR.\n\nAppBuilder uses [unittest](https://docs.python.org/3/library/unittest.html) as the test framework, requires no 3rd party dependencies to install.\n\nBefore running tests, make sure add the following environment variables:\n\n```shell\nexport TEST_CASE=CPU_PARALLEL\nexport APPBUILDER_TOKEN=<your_token>\n```\n\n\nTo run all existing test cases together, run\n\n```\npip install -e .[all]\nsh appbuilder/tests/run_python_test.sh\n```\n\nIf you only want to run specific test file, e.g.:\n\n```\npython appbuilder/tests/test_playground.py\n```\n\n\nTo debug tests in vs code update .env file to roo folder of the project:\n```\nAPPBUILDER_TOKEN=<your-token>\nAPPBUILDER_TOKEN_V2=<your-token>\nTEST_CASE=CPU_SERIAL\n```\n\nand add/update `.vscode/settings.json` file with the following content:\n\n```\n{\n    \"python.testing.unittestArgs\": [\n        \"-v\",\n        \"-s\",\n        \"./python\",\n        \"-p\",\n        \"test*.py\"\n    ],\n    \"python.testing.unittestEnabled\": true,\n    \"python.envFile\": \"${workspaceFolder}/.env\"\n}\n```\n\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "NEW_README.md",
    "content": "<div align=\"center\">\n<img src='docs/image/logo.png' alt='logo' width='700' >\n<br>\n\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE)\n![Supported Python versions](https://img.shields.io/badge/python-3.9+-orange.svg)\n![Supported OSs](https://img.shields.io/badge/os-linux%2C%20win%2C%20mac-yellow.svg)\n</div>\n\n简体中文 | [English](./docs/README_en.md) | [日本語](./docs/README_ja.md)\n\n<br>\n\n## 🚀 欢迎使用 AppBuilder-SDK\n\nAppBuilder-SDK 是百度智能云千帆AppBuilder面向AI原生应用开发者提供的一站式开发平台客户端SDK。无论你是AI新手还是资深开发者，都能在这里找到适合你的AI应用开发方案。\n\n### ✨ 为什么选择 AppBuilder-SDK？\n\n| 特性 | 描述 | 优势 |\n|------|------|------|\n| 丰富的AI能力 | 40+个百度生态优质组件 | 开箱即用，无需重复开发 |\n| 灵活的部署方式 | 支持本地、云端、API等多种部署 | 适应不同场景需求 |\n| 完整的开发工具 | 提供监控、调试、追踪等工具 | 提升开发效率 |\n| 活跃的社区支持 | 微信交流群、Github社区 | 快速解决问题 |\n\n### 🎯 我能用 AppBuilder-SDK 做什么？\n\n#### 1. 构建智能应用\n- **RAG应用**：构建基于知识库的智能问答系统，支持文档解析、切片、向量化、检索等完整流程\n- **Agent应用**：开发具有自主决策能力的AI助手，支持工具调用、多轮对话、状态管理\n- **工作流应用**：通过可视化编排或代码方式构建复杂的AI处理流程\n\n#### 2. 调用AI能力\n- **大模型调用**：支持多种大模型，可自定义prompt\n- **组件调用**：40+个百度生态优质组件\n- **MCP组件**：支持将本地组件转换为MCP服务\n\n#### 3. 部署与监控\n- **多种部署方式**：支持Flask、Chainlit、公有云部署\n- **完整的监控工具**：提供可视化Tracing、DebugLog等\n\n### 🛠️ 快速开始\n\n#### 1. 环境要求\n- Python >= 3.9\n- 使用MCP组件功能需要 Python >= 3.12\n- 支持的操作系统：Linux、Windows、MacOS\n\n#### 2. 安装SDK\n```bash\npython3 -m pip install --upgrade appbuilder-sdk\n```\n\n#### 3. 选择你的开发路径\n\n<div align=\"center\">\n<img src='docs/image/quickstart-flow.png' alt='quickstart-flow' width='600' >\n</div>\n\n| 开发路径 | 适合人群 | 推荐文档 |\n|---------|---------|---------|\n| 新手入门 | 刚接触AI开发 | [快速开始指南](./docs/QuickStart/StartFirstAINativeApplication/README.md) |\n| 组件开发 | 想开发自定义组件 | [MCP组件开发指南](./cookbooks/mcp/server.ipynb) |\n| 应用开发 | 已有AI开发经验 | [应用开发指南](./docs/Application/README.md) |\n\n### 📚 学习资源\n\n#### 1. 基础教程\n- [组件使用示例](./cookbooks/components/README.md)\n- [工作流编排指南](./cookbooks/pipeline/README.md)\n- [端到端应用示例](./cookbooks/end2end_application/README.md)\n\n#### 2. 进阶教程\n- [MCP组件开发](./cookbooks/mcp/README.md)\n- [公有云部署](./cookbooks/advanced_application/cloud_deploy.ipynb)\n- [性能优化指南](./docs/DevelopGuide/AdvancedDevelopment/README.md)\n\n### 🔥 最新特性：MCP组件支持\n\nAppBuilder-SDK 最新版本支持将本地组件转换为MCP服务，实现端云组件联动。主要特性包括：\n\n| 特性 | 描述 | 文档链接 |\n|------|------|---------|\n| 组件服务化 | 将本地组件转换为MCP服务 | [MCP组件开发指南](./cookbooks/mcp/server.ipynb) |\n| 端云联动 | 实现本地组件与云端组件的联动 | [端云组件联动示例](./cookbooks/end2end_application/agent/tool_call.ipynb) |\n\n### 💡 快速示例\n\n#### 1. 调用大模型\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your-token-here\"\n\n# 定义prompt模板\ntemplate_str = \"你扮演{role}, 请回答我的问题。\\n\\n问题：{question}。\\n\\n回答：\"\n\n# 定义输入，调用playground组件\ninput = appbuilder.Message({\"role\": \"java工程师\", \"question\": \"请简要回答java语言的内存回收机制是什么，要求100字以内\"})\n\nplayground = appbuilder.Playground(prompt_template=template_str, model=\"DeepSeek-V3.1\")\n\n# 以打字机的方式，流式展示大模型回答内容\noutput = playground(input, stream=True, temperature=1e-10)\nfor stream_message in output.content:\n    print(stream_message)\n```\n\n#### 2. 调用能力组件\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your-token-here\"\n\n# 创建组件实例\nrag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model=\"DeepSeek-V3.1\")\n\n# 执行组件\ninput = appbuilder.Message(\"9.11和9.8哪个大\")\nresult = rag_with_baidu_search_pro.run(\n    message=input,\n    instruction=appbuilder.Message(\"你是专业知识助手\"))\n\n# 输出运行结果\nprint(result.model_dump_json(indent=4))\n```\n\n#### 3. 使用MCP组件\n```python\nimport os\nfrom appbuilder.mcp_server.server import MCPComponentServer\nfrom appbuilder.core.components.v2 import Translation, Text2Image\n\nos.environ['APPBUILDER_TOKEN'] = 'your-token-here'\n\n# 定义server\nserver = MCPComponentServer(name=\"AB Component Server\")\n\n# 初始化组件实例\ntranslation = Translation()\ntext2image = Text2Image()\n\n# 把组件作为tool添加到server\nserver.add_component(translation)\nserver.add_component(text2image)\n\n# 启动server\nserver.run()\n```\n\n### 🤝 加入社区\n\n<div align=\"center\">\n<h3>加入我们的微信交流群</h3>\n<img src='docs/image/wechat_group.png' alt='wechat' width='200' >\n</div>\n\n- [Github Issue](https://github.com/baidubce/app-builder/issues): 提交问题、报告bug、建议新特性\n- [百度智能云千帆社区](https://cloud.baidu.com/qianfandev): 参与社区活动、获取最新资讯\n\n### 📄 文档导航\n\n- [完整文档目录](./docs/README.md)\n- [API参考](./docs/API/README.md)\n- [更新日志](./docs/DevelopGuide/ChangeLog/changelog.md)\n- [常见问题](./docs/DevelopGuide/ErrorMessage/error_message.md)\n\n## License\n\nAppBuilder-SDK遵循Apache-2.0开源协议。 "
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n<img src='docs/image/logo.png' alt='logo' width='700' >\n<br>\n\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE)\n![Supported Python versions](https://img.shields.io/badge/python-3.9+-orange.svg)\n![Supported OSs](https://img.shields.io/badge/os-linux%2C%20win%2C%20mac-yellow.svg)\n</div>\n\n简体中文 | [English](./docs/README_en.md) | [日本語](./docs/README_ja.md)\n\n<br>\n\n\n## 什么是AppBuilder-SDK\n\n百度智能云千帆AppBuilder-SDK是[百度智能云千帆AppBuilder](https://appbuilder.cloud.baidu.com/)面向AI原生应用开发者提供的一站式开发平台的客户端SDK。\n\n### AppBuilder-SDK 有哪些功能？\n\n百度智能云千帆AppBuilder-SDK提供了以下AI应用开发者的必备功能：\n\n- **调用**\n    - 调用大模型，可自由调用您在[百度智能云千帆大模型平台](https://qianfan.cloud.baidu.com/)的模型，开发并调优prompt\n    - 调用能力组件，提供40+个源于百度生态的[优质组件](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz#3%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1)，赋能Agent应用\n    - 调用AI原生应用，通过[AppBuilderClient](/docs/BasisModule/Platform/Application/appbuilder_client.md)可访问并管理在百度智能云千帆AppBuilder[网页端](https://console.bce.baidu.com/ai_apaas/app)发布的AI原生应用，并可注册本地函数联动端云组件\n- **编排**\n    - 配置知识库，通过[KnowledgeBase](/docs/BasisModule/Platform/KnowledgeBase/knowledgebase.md)管理知识库，进行文档及知识切片的增删改查，配合[网页端](https://console.bce.baidu.com/ai_apaas/app)开发产业级的`RAG`应用\n    - 编排工作流，提供了`Message`、`Component`、`AgentRuntime`多级工作流抽象，实现工作流编排，并可与LangChain、OpenAI等业界生态能力打通\n- **监控**\n    - 提供了可视化Tracing、详细DebugLog等监控工具，助力开发者在生产环境应用\n- **部署**\n    - `AgentRuntime`支持部署为基于`Flask`与`gunicorn`的API服务\n    - `AgentRuntime`支持部署为基于`Chainlit`的对话框交互前端\n    - 提供了`appbuilder_bce_deploy`工具，可快速部署程序到百度云，提供公网API服务，联动AppBuilder工作流\n\n### 使用 AppBuilder-SDK 可以构建什么应用？\n\n#### **产业级RAG应用**\n\nAppBuilder-SDK提供多类型组件，覆盖以下构建产业级`RAG`应用的完整步骤：\n- 文档解析（Parser）\n- 文档切片（Chunker）\n- 切片向量化（Embedding）\n- 索引构建（Indexing）\n- 切片召回（Retrieval）\n- 答案生成（Answer Generation）\n\nAppBuilder-SDK不仅提供了百度智能云提供的基础能力组件，同时提供经过深度优化的大模型高级能力组件，可以组合下表提供的原子能力组件，构建个性化的RAG应用[RAG 原子能力 CookBook](./cookbooks/end2end_application/rag/rag.ipynb)：\n\n\n| 阶段 |组件名称 | 组件类型 |组件链接 |\n|--------|--------|--------|---|\n| 文档解析 | 文档矫正增强 (DocCropEnhance) | 基础能力组件 | [链接](./python/core/components/doc_crop_enhance/README.md) |\n| 文档解析 | 文档格式转换 (DocFormatConverter) | 基础能力组件 | [链接](./python/core/components/doc_format_converter/README.md)|\n| 文档解析 | 文档解析（DocParser）| 基础能力组件 | [链接](./python/core/components/doc_parser/README.md) |\n| 文档解析 | 表格抽取组件（ExtractTableFromDoc）| 基础能力组件 | [链接](./python/core/components/extract_table/README.md) |\n| 文档解析 | 通用文字识别-高精度版（GeneralOCR）| 基础能力组件 | [链接](./python/core/components/general_ocr/README.md) |\n| 文档切片 | 文档切分（DocSplitter）| 基础能力组件 | [链接](./python/core/components/doc_splitter/README.md) |\n| 切片向量化 | 向量计算（Embedding） | 基础能力组件 | [链接](./python/core/components/embeddings/README.md) |\n| 索引构建及切片召回 | 向量检索-VectorDB（BaiduVectorDBRetriever） | 基础能力组件 | [链接](./python/core/components/retriever/baidu_vdb/README.md) |\n| 索引构建及切片召回 | 向量检索-BES（BaiduElasticSearchRetriever） | 基础能力组件 | [链接](./python/core/components/retriever/bes/README.md) |\n| 文档切片及答案生成 | 问答对挖掘（QAPairMining）| 高级能力组件 | [链接](./python/core/components/llms/qa_pair_mining/README.md) |\n| 文档切片及答案生成 | 相似问生成（SimilarQuestion）| 高级能力组件 | [链接](./python/core/components/llms/similar_question/README.md) |\n| 答案生成| 标签抽取（TagExtraction）| 高级能力组件 | [链接](./python/core/components/llms/tag_extraction/README.md) |\n| 答案生成 | 复杂Query判定（IsComplexQuery）| 高级能力组件 | [链接](./python/core/components/llms/is_complex_query/README.md) |\n| 答案生成 | 复杂Query分解（QueryDecomposition）| 高级能力组件 | [链接](./python/core/components/llms/query_decomposition/README.md) |\n| 答案生成 | 多轮改写 (QueryRewrite)| 高级能力组件 | [链接](./python/core/components/llms/query_rewrite/README.md) |\n| 答案生成 | 阅读理解问答（MRC）| 高级能力组件 | [链接](./python/core/components/llms/mrc/README.md) |\n| 答案生成 | 幻觉检测（Hallucination Detection）| 高级能力组件 | [链接](./python/core/components/llms/hallucination_detection/README.md) |\n\n\n\n\n\n##  如何安装AppBuilder-SDK\n\n#### 百度智能云千帆AppBuilder-SDK 最新版本 1.1.0 (2025-06-20)\n\n百度智能云千帆AppBuilder-SDK 更新记录&最新特性请查阅我们的[版本说明](/docs/DevelopGuide/ChangeLog/changelog.md)\n\n- `Python`版本安装，要求Python版本 >= `3.9`\n\n```bash\npython3 -m pip install --upgrade appbuilder-sdk\n```\n- `Java` 及 `Go` 版本安装，以及通过`Docker`镜像使用，请查阅[安装说明](/docs/QuickStart/StartFirstAINativeApplication/install.md)\n\n\n## 快速开始你的AI原生应用开发之旅\n> - 请在`>=3.9`的Python环境安装`appbuilder-sdk`后使用该端到端应用示例\n> - 示例中使用请替换为您的个人Token\n\n\n### 1. 调用大模型\n- 使用`Playground`组件可自由调用，您在百度智能云千帆大模型平台有权限的任何模型，并可自定义`prompt`模板 与 模型参数\n\n#### 代码示例\n\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 定义prompt模板\ntemplate_str = \"你扮演{role}, 请回答我的问题。\\n\\n问题：{question}。\\n\\n回答：\"\n\n# 定义输入，调用playground组件\ninput = appbuilder.Message({\"role\": \"java工程师\", \"question\": \"请简要回答java语言的内存回收机制是什么，要求100字以内\"})\n\nplayground = appbuilder.Playground(prompt_template=template_str, model=\"DeepSeek-V3.1\")\n\n# 以打字机的方式，流式展示大模型回答内容\noutput = playground(input, stream=True, temperature=1e-10)\nfor stream_message in output.content:\n    print(stream_message)\n    \n# 流式输出结束后，可再次打印完整的大模型对话结果，除回答内容外，还包括token的用量情况\nprint(output.model_dump_json(indent=4))\n\n```\n#### 回答展示\n\n```shell\nJava语言的\n内存回收机制是通过垃圾回收器（Garbage Collector）来实现的。\n垃圾回收器会自动检测不再使用的对象，并释放其占用的内存空间，从而确保系统的内存不会被耗尽。\nJava提供了多种垃圾回收器，如串行回收器、并行回收器、CMS回收器和G1回收器等，以满足不同场景下的性能需求\n。\n\n{\n    \"content\": \"Java语言的内存回收机制是通过垃圾回收器（Garbage Collector）来实现的。垃圾回收器会自动检测不再使用的对象，并释放其占用的内存空间，从而确保系统的内存不会被耗尽。Java提供了多种垃圾回收器，如串行回收器、并行回收器、CMS回收器和G1回收器等，以满足不同场景下的性能需求。\",\n    \"name\": \"msg\",\n    \"mtype\": \"dict\",\n    \"id\": \"2bbee989-40e3-45e4-9802-e144cdc829a9\",\n    \"extra\": {},\n    \"token_usage\": {\n        \"prompt_tokens\": 35,\n        \"completion_tokens\": 70,\n        \"total_tokens\": 105\n    }\n}\n```\n\n### 2. 调用能力组件\n- SDK提供了40+个源于百度生态的优质组件，列表可见[组件列表](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz#3%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1), 调用前需要申领[免费试用额度](https://console.bce.baidu.com/ai-engine/old/#/ai/ocr/overview/resource/list)\n- 示例中的组件为`RAG with Baidu Search增强版`, 结合百度搜索的搜索引擎技术和ERNIE模型的语义理解能力，可以更准确地理解用户的搜索意图，并提供与搜索查询相关性更高的搜索结果\n\n#### 代码示例\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，使用请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\nrag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model=\"DeepSeek-V3.1\")\n\ninput = appbuilder.Message(\"9.11和9.8哪个大\")\nresult = rag_with_baidu_search_pro.run(\n    message=input,\n    instruction=appbuilder.Message(\"你是专业知识助手\"))\n\n# 输出运行结果\nprint(result.model_dump_json(indent=4))\n```\n\n#### 回答展示\n```shell\n{\n    \"content\": \"9.11小于9.8。在比较两个小数的大小时，需要逐位比较它们的数值，包括整数部分和小数部分。对于9.11和9.8，整数部分都是9，所以需要在小数部分进行比较。小数点后的第一位是1和8，显然1小于8，所以9.11小于9.8。\",\n    \"name\": \"msg\",\n    \"mtype\": \"dict\",\n    \"id\": \"eb31b7de-dd6a-485f-adb9-1f7921a6f4bf\",\n    \"extra\": {\n        \"search_baidu\": [\n            {\n                \"content\": \"大模型‘智商’受质疑:9.11 vs 9...\",\n                \"icon\": \"https://appbuilder.bj.bcebos.com/baidu-search-rag-pro/icon/souhu.ico\",\n                \"url\": \"https://m.sohu.com/a/793754123_121924584/\",\n                \"ref_id\": \"2\",\n                \"site_name\": \"搜狐网\",\n                \"title\": \"大模型‘智商’受质疑:9.11 vs 9.8的比较揭示AI理解能力的...\"\n            },\n            {\n                \"content\": \"究竟|9.11比9.8大?大模型们为何会...\",\n                \"icon\": \"https://appbuilder.bj.bcebos.com/baidu-search-rag-pro/icon/tencent.svg.png\",\n                \"url\": \"https://new.qq.com/rain/a/20240717A07JLV00\",\n                \"ref_id\": \"4\",\n                \"site_name\": \"腾讯网\",\n                \"title\": \"究竟|9.11比9.8大?大模型们为何会在小学数学题上集体...\"\n            },\n            ...\n        ]\n    },\n    \"token_usage\": {\n        \"completion_tokens\": 77,\n        \"prompt_tokens\": 2008,\n        \"total_tokens\": 2085\n    }\n}\n```\n\n\n### 3. 调用AI原生应用\n- 示例中的应用为：[说唱导师](https://appbuilder.baidu.com/s/3qfjXy7k)，点击该连接在网页端试用\n\n#### 代码示例\n\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 从AppBuilder网页获取并传入应用ID，以下为说唱导师应用ID\napp_id = \"4678492a-5864-472e-810a-654538d3503c\"\n\napp_builder_client = appbuilder.AppBuilderClient(app_id)\nconversation_id = app_builder_client.create_conversation()\n\nanswer = app_builder_client.run(conversation_id, \"以“上班狼狈却又追逐梦想“为主题进行一首说唱创作，保持押韵, 控制在200字以内\")\nprint(answer.content.answer)\n```\n\n#### 回答展示\n```shell\n好的，我们来以“上班狼狈却又追逐梦想”为主题，进行一段简短的说唱创作。这里是一个简单的示例，你可以根据自己的感觉进行调整：\n\nIntro:\n朝九晚五，生活重压，\n狼狈上班，却心怀梦想，\n每一天，都是新的挑战，\n为了那未来，我奋发向前。\n\nVerse 1:\n穿上西装，打好领带，\n步入人群，去追逐名利，\n虽然狼狈，却不曾言败，\n因为心中，有梦想在激励。\n\nHook:\n上班狼狈，却不曾放弃，\n追逐梦想，是我心中的火炬，\n照亮前路，指引我前行，\n无论多难，我都要坚持到底。\n\n这首小曲儿以“上班狼狈却又追逐梦想”为主题，通过押韵的方式表达了上班族虽然生活艰辛，但依然怀揣梦想，勇往直前的精神。希望你喜欢！\n```\n\n#### 更多示例\n\n- 更多AI原生应用示例，请浏览[应用广场](https://console.bce.baidu.com/ai_apaas/appCenter)\n- 更多代码Cookbook，请浏览 [Cookbooks](./cookbooks/README.md)，我们有以下cookbook推荐您优先阅读：\n\n| 应用类型 |应用链接 | 推荐理由 |\n|--|--|--|\n| 基础能力组件 | [通用文字识别](/cookbooks/components/general_ocr.ipynb) | 体验百度AI开放平台提供的通用文字识别-高精度版的精准识别结果 |\n| 基础能力组件 | [基础组件服务化](/cookbooks/components/agent_runtime.ipynb) | 基础组件可通过flask实现服务化部署 或 通过chainlit实现可交互的前端部署，集成到您的系统中 |\n| 流程编排 |  [Assistant SDK](/cookbooks/pipeline/assistant_function_call.ipynb) | 学习如何纯代码态搭建一个Agent应用，并实现自定义工作流程及FunctionCall |\n| 端到端应用 |  [AppBuilder Client SDK](/cookbooks/agent_builder.ipynb) | 使用AppBuilder网页端创建并发布一个Agent应用后，通过AppBuilderClient SDK集成到你的系统中 |\n| 端到端应用 |  [Agent应用-工作流Agent](/cookbooks/end2end_application/agent/chatflow.ipynb) | 使用AppBuilder网页端创建并发布一个工作流Agent应用后，通过AppBuilderClient SDK集成到你的系统中 |\n| 端到端应用 |  [通过AppBuilder-ToolCall功能实现端云组件联动的Agent](/cookbooks/end2end_application/agent/tool_call.ipynb) | 学习Agent、FunctionCall的知识，并构造调用本地组件的Agent |\n| 端到端应用 |  [简历筛选小助手](/cookbooks/end2end_application/rag/rag.ipynb) | 通过对本地简历库的简历进行解析、切片、创建索引，实现基于JD进行简历筛选，并对筛选的Top1简历进行总结 |\n| 端到端应用 |  [企业级问答系统](/cookbooks/end2end_application/rag/qa_system_2_dialogue.ipynb) | 学习如何通过SDK与网页平台搭配，实现离线知识库生产与在线问答 |\n| 进阶应用 |  [使用appbuilder_bce_deploy部署公有云服务](/cookbooks/advanced_application/cloud_deploy.ipynb) | 一键将自己的服务部署到百度智能云，部署后可以自动生成公网ip，联动工作流的API节点 |\n| 进阶应用 |  [使用appbuilder_trace_server实现对使用状态的跟踪](/cookbooks/appbuilder_trace/trace.ipynb) | 使用Appbuilder-SDK Trace功能实现对组件、应用调用情况的追踪|\n\n\n## 百度智能云千帆AppBuilder-SDK 能力全景图\n<div align=\"center\">\n<img src='docs/image/structure-cn.png' alt='wechat' width='800' >\n</div>\n\n\n## 用户文档\n\n## Github 文档\n- [首页](https://github.com/baidubce/app-builder/blob/master/docs/README.md)\n    - 快速上手: \n        - 开始你的第一个AI原生应用: \n            - [安装](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/install.md)\n            - [快速开始](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/README.md)\n        - 产业实践应用范例: \n            - [SDK使用示例](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/ExamplesOfIndustrialPracticeApplications/README.md)\n        - [SDK当前支持的编程语言](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/CurrentlySupportedProgrammingLanguages/README.md)\n    - 基础:\n        - 模型:\n            - [获取模型列表](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Model/get_model_list.md)\n        - [组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Components)\n        - 监控:\n            - [TRACE基础功能](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/basic.md)\n            - [TRACE拓展功能](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/phoenix_method.md)\n        - 部署:\n            - [交互式前端部署](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/AgentChainlit.md)\n            - [公有云部署](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/cloud.md)\n            - [API 访问](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/flask.md)\n            - [AgentRuntime](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/agentruntime.md)\n            - [UserSession](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/usersession.md)\n        - 平台:\n            - 应用:\n                - [AppBuilderClient组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/appbuilder_client.md)\n                - [获取AppBuilder已发布的应用列表](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/get_app_list.md)\n            - 知识库:\n                - [知识库组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/KnowledgeBase/knowledgebase.md)\n            - 自定义组件:\n                - [基础能力组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/CustomComponents/components.md)\n    - 应用:\n        - Agent:\n            - [基础知识](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/BasicKnowledge/agent.md)\n            - [使用官方组件](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/UseOfficialComponents/use_official_components.md)\n            - [ToolCall](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/ToolCall/tool_call.md)\n            - [ToolChoice](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/ToolChoice/tool_choice.md)\n            - [使用异步和流式加速客户端调用](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n        - RAG:\n            - [基础知识](https://github.com/baidubce/app-builder/blob/master/docs/Application/RAG/BasicKnowledge/rag.md)\n            - [知识库管理](https://github.com/baidubce/app-builder/blob/master/docs/Application/RAG/DatasetManage/dataset_manage.md)\n            - [Reference信息处理](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n        - Workflow:\n            - [基础知识](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [从零使用Workflow组装一个RAG应用](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [从零使用Workflow组装一个Agent应用](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n    - 开发者指南:\n        - [如何贡献代码](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/HowToContributeCode/README.md)\n        - [二次开发](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/AdvancedDevelopment/README.md)\n        - [版本升级日志](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ChangeLog/changelog.md)\n        - [错误信息](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ErrorMessage/error_message.md)\n        - [环境参数](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/EnvironmentalParameters/env.md)\n\n\n## 开源社区与活动\n<div align=\"center\">\n<h3>百度智能云千帆AppBuilder-SDK微信交流群</h3>\n<img src='docs/image/wechat_group.png' alt='wechat' width='200' >\n</div>\n\n- [Github Issue](https://github.com/baidubce/app-builder/issues):  提交安装/使用问题、报告bug、建议新特性、沟通开发计划等\n\n- [百度智能云千帆社区](https://cloud.baidu.com/qianfandev)\n\n## License\n\nAppBuilder-SDK遵循Apache-2.0开源协议。\n\n"
  },
  {
    "path": "cookbooks/README.md",
    "content": "# AppBuilder-SDK Cookbook\n\n## Cookbook目录\n\n### 基础组件\n- [短语音识别组件-asr](/cookbooks/components/asr.ipynb)\n- [gbi - 自动选表问表](/cookbooks/components/gbi.ipynb)\n- [general_ocr - 通用文字识别](/cookbooks/components/general_ocr.ipynb)\n- [object_recognize - 通用物体识别](/cookbooks/components/object_recognize.ipynb)\n- [rag_with_baidusearch - 百度搜索](/cookbooks/components/rag_with_baidusearch.ipynb)\n- [text_generation - 文本生成](/cookbooks/components/text_generation.ipynb)\n- [translate - 文本翻译](/cookbooks/components/translate.ipynb)\n- [vdb_retriever - VectorDB向量存储](/cookbooks/components/vdb_retriever.ipynb)\n\n\n### 流程编排\n- [基于AssistantSDK 实现FunctionCall](/cookbooks/pipeline/assistant_function_call.ipynb)\n- [AssistantSDK assistant函数演示](/cookbooks/pipeline/assistant.ipynb)\n- [AssistantSDK file函数演示](/cookbooks/pipeline/file.ipynb)\n- [AssistantSDK message函数演示](/cookbooks/pipeline/message.ipynb)\n- [AssistantSDK run函数演示](/cookbooks/pipeline/run.ipynb)\n- [AssistantSDK thread函数演示](/cookbooks/pipeline/thread.ipynb)\n\n\n### 端到端应用\n- [Agent应用](/cookbooks/end2end_application/agent/appbuilder_client.ipynb)\n- [Agent应用-工作流Agent](/cookbooks/end2end_application/agent/chatflow.ipynb)\n- [RAG应用-简历筛选小助手](/cookbooks/end2end_application/rag/rag.ipynb)\n- [RAG应用-问答助手](/cookbooks/end2end_application/rag/console_rag.ipynb)\n- [RAG应用-企业问答系统-离线知识生产](/cookbooks/end2end_application/rag/qa_system_1_dataset.ipynb)\n- [RAG应用-企业问答系统-在线问答流程](/cookbooks/end2end_application/rag/qa_system_2_dialogue.ipynb)\n- [知识库操作助手](/cookbooks/end2end_application/rag/console_dataset.ipynb)\n- [通过AppBuilder-ToolCall功能实现端云组件联动的Agent](/cookbooks/end2end_application/agent/tool_call.ipynb) \n\n### 进阶应用\n- [公有云部署](/cookbooks/advanced_application/cloud_deploy.ipynb)\n\n### 辅助工具\n- [Appbuilder-Trace工具](/cookbooks/appbuilder_trace/trace.ipynb)\n"
  },
  {
    "path": "cookbooks/advanced_application/agent_speech.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 实时语音对话能力\\n\",\n    \"**注意⚠️：实时语音功能目前处于内测阶段，使用过程中有任何问题，欢迎提issue或微信群反馈～**\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"实现一个实时语音对话功能，支持多种语音音色。用户可以参考cookbook代码，通过AppBuilder-SDK将实时语音功能很好地融入自己的平台、应用中。\\n\",\n    \"\\n\",\n    \"## 实现原理\\n\",\n    \"通过循环不断处理用户的语音，将语音转文本，然后进行对话，最后将对话结果通过TTS进行播报。。\\n\",\n    \"* 使用大模型的 ASR 进行语音转文本。\\n\",\n    \"* 使用用户自己创建的Agent进行对话，适配用户的应用场景，并具有上下文理解能力。\\n\",\n    \"* 使用大模型的 TTS 进行文本转语音并进行播报。\\n\",\n    \"\\n\",\n    \"## 前置条件\\n\",\n    \"* 使用内置ASR、TTS组件之前，请先开通组件服务并够买额度，可参考[开通组件服务](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz#3%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1)\\n\",\n    \"* pip安装pyaudio、webrtcvad依赖包\\n\",\n    \"* 给程序开放麦克风权限\\n\",\n    \"* 创建好自己的Agent应用\\n\",\n    \"\\n\",\n    \"## 示例代码\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\\n\",\n    \"#\\n\",\n    \"# Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n\",\n    \"# you may not use this file except in compliance with the License.\\n\",\n    \"# You may obtain a copy of the License at\\n\",\n    \"#\\n\",\n    \"#     http://www.apache.org/licenses/LICENSE-2.0\\n\",\n    \"#\\n\",\n    \"# Unless required by applicable law or agreed to in writing, software\\n\",\n    \"# distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n\",\n    \"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n\",\n    \"# See the License for the specific language governing permissions and\\n\",\n    \"# limitations under the License.\\n\",\n    \"\\n\",\n    \"import os\\n\",\n    \"import time\\n\",\n    \"import wave\\n\",\n    \"import sys\\n\",\n    \"import pyaudio\\n\",\n    \"import webrtcvad\\n\",\n    \"import appbuilder\\n\",\n    \"import re\\n\",\n    \"\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"# 设置环境变量\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = (\\n\",\n    \"    \\\"...\\\"\\n\",\n    \")\\n\",\n    \"# 已发布AppBuilder应用的ID\\n\",\n    \"app_id = \\\"...\\\"\\n\",\n    \"appbuilder.logger.setLoglevel(\\\"ERROR\\\")\\n\",\n    \"\\n\",\n    \"CHUNK = 1024\\n\",\n    \"FORMAT = pyaudio.paInt16\\n\",\n    \"CHANNELS = 1 if sys.platform == \\\"darwin\\\" else 2\\n\",\n    \"RATE = 16000\\n\",\n    \"DURATION = 30  # ms\\n\",\n    \"CHUNK = RATE // 1000 * DURATION\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"class Chatbot:\\n\",\n    \"    def __init__(self):\\n\",\n    \"        self.p = pyaudio.PyAudio()\\n\",\n    \"        self.tts = appbuilder.TTS()\\n\",\n    \"        self.asr = appbuilder.ASR()\\n\",\n    \"        self.agent = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"        self.conversation_id = self.agent.create_conversation()\\n\",\n    \"\\n\",\n    \"    def run(self):\\n\",\n    \"        self.run_tts_and_play_audio(\\n\",\n    \"            \\\"我是你的专属聊天机器人，如果你有什么问题，可以直接问我\\\"\\n\",\n    \"        )\\n\",\n    \"        while True:\\n\",\n    \"            # Record\\n\",\n    \"            audio_path = \\\"output.wav\\\"\\n\",\n    \"            print(\\\"开始记录音频...\\\")\\n\",\n    \"            if self.record_audio(audio_path) < 1000:\\n\",\n    \"                time.sleep(1)\\n\",\n    \"                continue\\n\",\n    \"            print(\\\"音频记录结束\\\")\\n\",\n    \"\\n\",\n    \"            # ASR\\n\",\n    \"            print(\\\"开始执行ASR...\\\")\\n\",\n    \"            query = self.run_asr(audio_path)\\n\",\n    \"            print(\\\"结束执行ASR\\\")\\n\",\n    \"\\n\",\n    \"            # Agent\\n\",\n    \"            print(\\\"query: \\\", query)\\n\",\n    \"            if len(query) == 0:\\n\",\n    \"                continue\\n\",\n    \"            answer = self.run_agent(query)\\n\",\n    \"            results = re.findall(r\\\"(https?://[^\\\\s]+)\\\", answer)\\n\",\n    \"            for result in results:\\n\",\n    \"                print(\\\"链接地址:\\\", result)\\n\",\n    \"                answer = answer.replace(result, \\\"\\\")\\n\",\n    \"            print(\\\"answer:\\\", answer)\\n\",\n    \"\\n\",\n    \"            # TTS\\n\",\n    \"            print(\\\"开始执行TTS并播报...\\\")\\n\",\n    \"            self.run_tts_and_play_audio(answer)\\n\",\n    \"            print(\\\"结束TTS并播报结束\\\")\\n\",\n    \"\\n\",\n    \"    def record_audio(self, path):\\n\",\n    \"        with wave.open(path, \\\"wb\\\") as wf:\\n\",\n    \"            wf.setnchannels(CHANNELS)\\n\",\n    \"            wf.setsampwidth(self.p.get_sample_size(FORMAT))\\n\",\n    \"            wf.setframerate(RATE)\\n\",\n    \"            stream = self.p.open(\\n\",\n    \"                format=FORMAT, channels=CHANNELS, rate=RATE, input=True\\n\",\n    \"            )\\n\",\n    \"            vad = webrtcvad.Vad(1)\\n\",\n    \"            not_speech_times = 0\\n\",\n    \"            speech_times = 0\\n\",\n    \"            total_times = 0\\n\",\n    \"            start_up_times = 33 * 5  # 初始时间设置为5秒\\n\",\n    \"            history_speech_times = 0\\n\",\n    \"            while True:\\n\",\n    \"                if history_speech_times > 33 * 10:\\n\",\n    \"                    break\\n\",\n    \"                data = stream.read(CHUNK, False)\\n\",\n    \"                if vad.is_speech(data, RATE):\\n\",\n    \"                    speech_times += 1\\n\",\n    \"                    wf.writeframes(data)\\n\",\n    \"                else:\\n\",\n    \"                    not_speech_times += 1\\n\",\n    \"                total_times += 1\\n\",\n    \"                if total_times >= start_up_times:\\n\",\n    \"                    history_speech_times += speech_times\\n\",\n    \"                    # 模拟滑窗重新开始计数\\n\",\n    \"                    if float(not_speech_times) / float(total_times) > 0.7:\\n\",\n    \"                        break\\n\",\n    \"                    not_speech_times = 0\\n\",\n    \"                    speech_times = 0\\n\",\n    \"                    total_times = 0\\n\",\n    \"                    start_up_times = start_up_times / 2\\n\",\n    \"                    if start_up_times < 33:\\n\",\n    \"                        start_up_times = 33\\n\",\n    \"            stream.close()\\n\",\n    \"            return history_speech_times * DURATION\\n\",\n    \"\\n\",\n    \"    def run_tts_and_play_audio(self, text: str):\\n\",\n    \"        # AppBuilder内置的TTS使用文档，用户可根据文档调整参数：https://github.com/baidubce/app-builder/tree/master/python/core/components/tts\\n\",\n    \"        msg = self.tts.run(\\n\",\n    \"            appbuilder.Message(content={\\\"text\\\": text}),\\n\",\n    \"            speed=5,\\n\",\n    \"            pitch=5,\\n\",\n    \"            volume=5,\\n\",\n    \"            person=0,\\n\",\n    \"            audio_type=\\\"pcm\\\",\\n\",\n    \"            model=\\\"paddlespeech-tts\\\",\\n\",\n    \"            stream=True,\\n\",\n    \"        )\\n\",\n    \"        stream = self.p.open(\\n\",\n    \"            format=self.p.get_format_from_width(2),\\n\",\n    \"            channels=1,\\n\",\n    \"            rate=24000,\\n\",\n    \"            output=True,\\n\",\n    \"            frames_per_buffer=2048,\\n\",\n    \"        )\\n\",\n    \"        for pcm in msg.content:\\n\",\n    \"            stream.write(pcm)\\n\",\n    \"        stream.stop_stream()\\n\",\n    \"        stream.close()\\n\",\n    \"\\n\",\n    \"    # AppBuilder内置的ASR使用文档，用户可根据文档调整参数：https://github.com/baidubce/app-builder/blob/master/python/core/components/asr/README.md\\n\",\n    \"    def run_asr(self, audio_path: str):\\n\",\n    \"        with open(audio_path, \\\"rb\\\") as f:\\n\",\n    \"            content_data = {\\\"audio_format\\\": \\\"wav\\\", \\\"raw_audio\\\": f.read(), \\\"rate\\\": 16000}\\n\",\n    \"            msg = appbuilder.Message(content_data)\\n\",\n    \"            out = self.asr.run(msg)\\n\",\n    \"            text = out.content[\\\"result\\\"][0]\\n\",\n    \"            return text\\n\",\n    \"\\n\",\n    \"    def run_agent(self, query):\\n\",\n    \"        msg = self.agent.run(self.conversation_id, query, stream=True)\\n\",\n    \"        answer = \\\"\\\"\\n\",\n    \"        for content in msg.content:\\n\",\n    \"            answer += content.answer\\n\",\n    \"        return answer\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    chatbot = Chatbot()\\n\",\n    \"    chatbot.run()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 使用方法\\n\",\n    \"\\n\",\n    \"直接运行程序即可。\\n\",\n    \"\\n\",\n    \"用户也可以将下面的功能模块替换成自己的其他实现或模型：\\n\",\n    \"* record_audio: 录音\\n\",\n    \"* run_asr: 语音识别语音识别，[AppBuilder ASR组件使用文档](https://github.com/baidubce/app-builder/blob/master/python/core/components/asr/README.md)\\n\",\n    \"* run_agent: Agent对话功能，[AppBuilder TTS组件使用文档](https://github.com/baidubce/app-builder/blob/master/python/core/components/tts/README.md)\\n\",\n    \"* run_tts_and_play_audio：回复的语音生成并播报\\n\",\n    \"\\n\",\n    \"**AppBuilder TTS组件参数**\\n\",\n    \"| 参数名称       | 参数类型    | 是否必须 | 描述                                                                                                                                                                                             | 示例值                                 |\\n\",\n    \"|------------|---------|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|\\n\",\n    \"| message    | String  | 是    | 待转成语音的文本                                                                                                                                                                                       | Message(content={\\\"text\\\": \\\"需合成的文本\\\"}) |\\n\",\n    \"| model      | String  | 否    | 默认是`baidu-tts`模型，可选值：`paddlespeech-tts`、`baidu-tts`                                                                                                                                            | paddlespeech-tts                    |\\n\",\n    \"| speed      | Integer | 否    | 语音语速，默认是5中等语速，取值范围在0~15之间，仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                  | 5                                   |\\n\",\n    \"| pitch      | Integer | 否    | 语音音调，默认是5中等音调，取值范围在0~15之间，仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                  | 5                                   |\\n\",\n    \"| volume     | Integer | 否    | 语音音量，默认是5中等音量，取值范围在0~15之间，,仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                 | 5                                   |\\n\",\n    \"| person     | Integer | 否    | 语音人物特征，默认是0(度小美),普通音库可选值包括: 0(度小美)、1(度小宇)、3(度逍遥-基础)、4(度丫丫)；精品音库包括：5003(度逍遥-精品)、5118(度小鹿)、106(度博文)、110(度小童)、111(度小萌)、103(度米朵)、5(度小娇)；臻品音库包括：4003(度逍遥-情感男声)、4106(度博文-专业男主播)、4115(度小贤-电台男主播)、4119(度小鹿-甜美女声)、4105(度灵儿-清激女声)、4117(度小乔-活泼女声)、4100(度小雯-活力女主播)、4103(度米朵-可爱女声)、4144(度姗姗-娱乐女声)、4278(度小贝-知识女主播)、4143(度清风-配音男声)、4140(度小新-专业女主播)、4129(度小彦-知识男主播)、4149(度星河-广告男声)、4254(度小清-广告女声)、4206(度博文-综艺男声)、4226(南方-电台女主播)。仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效 | 0                                   |\\n\",\n    \"| audio_type | String  | 否    | 音频文件格式，如果使用`baidu-tts`模型可选`mp3`, `wav`; 如果使用`paddlespeech-tts`模型非流式返回，参数只能设为`wav`;如果使用`paddlespeech-tts`模型流式返回，参数只能设为`pcm`                                                                     | wav                                 |\\n\",\n    \"| stream     | Bool    | 否    | 默认是False, 目前`paddlespeech-tts`模型支持流式返回，`baidu-tts`模型不支持流式返回                                                                                                                                    | False                               |\\n\",\n    \"| retry      | Integer | 否    | HTTP重试次数                                                                                                                                                                                       | 3                                   |\\n\",\n    \"| timeout    | Integer | 否    | HTTP超时时间                                                                                                                                                                                       | 5                                   |\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"language_info\": {\n   \"name\": \"python\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/advanced_application/cloud_deploy.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 公有云部署AppBuilderSDK\\n\",\n    \"**注意⚠️：部署上云功能目前处于内测阶段，使用过程中有任何问题，欢迎提issue或微信群反馈～**\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"一键将自己的服务部署到公有云上，目前支持百度智能云。部署后可以自动生成公网ip，无需额外配置。具体可以用来解决以下问题：\\n\",\n    \"* 在百度云部署的WebService，可以引入到AppBuilder工作流中的API节点，形成应用中嵌套应用，构建能够解决复杂业务问题的工作流。\\n\",\n    \"* 可将自己本地复杂的服务、组件、模型等，方便快捷地上云，并与AppBuilder形成联动。\\n\",\n    \"* 构建自己的公网对话服务。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"\\n\",\n    \"## 部署\\n\",\n    \"### 前置操作:\\n\",\n    \"* 在百度智能云完成实名认证，并开通bos服务：\\n\",\n    \"  * https://cloud.baidu.com/doc/BOS/s/Jk4xttg03#%E5%BC%80%E9%80%9Abos%E6%9C%8D%E5%8A%A1\\n\",\n    \"* 您需要在钱包中至少充值100元，用于bcc服务、bos服务费用\\n\",\n    \"  * 云服务费用标准：https://cloud.baidu.com/product-price/bcc.html\\n\",\n    \"  * 默认配置使用最便宜的bcc.e1.c2m2，并且使用按量付费\\n\",\n    \"  * bos存储服务费用标准：https://cloud.baidu.com/product-price/bos.html\\n\",\n    \"* 通过如下步骤获得您的AK/SK信息：\\n\",\n    \"  * https://cloud.baidu.com/doc/Reference/s/9jwvz2egb\\n\",\n    \"* 部署的AppBuilder >= 0.9.0\\n\",\n    \"\\n\",\n    \"### 部署流程：\\n\",\n    \"通过下面三步执行部署：\\n\",\n    \"* Step1 以下面的yaml文件为模板创建config.yaml，完善并创建配置文件\\n\",\n    \"  * 最小修改范围：ak、sk、admin_pass、run_cmd、local_dir、APPBUILDER_TOKEN\\n\",\n    \"```yaml\\n\",\n    \"bce_config:\\n\",\n    \"    host: \\\"http://bcc.bj.baidubce.com\\\"\\n\",\n    \"    bos_host: \\\"bj.bcebos.com\\\"\\n\",\n    \"    # 前置操作获取的ak、sk\\n\",\n    \"    ak: \\\"\\\"\\n\",\n    \"    sk: \\\"\\\"\\n\",\n    \"    spec: \\\"bcc.e1.c2m2\\\"\\n\",\n    \"    root_disk_size_in_gb: 20\\n\",\n    \"    # 服务器密码，根据实际使用设置\\n\",\n    \"    admin_pass: \\\"\\\"\\n\",\n    \"    security_group_id: \\\"\\\"\\n\",\n    \"    zone_name: cn-bj-d\\n\",\n    \"\\n\",\n    \"appbuilder_config:\\n\",\n    \"    # 本地用来打包的代码路径，根据实际使用修改\\n\",\n    \"    local_dir: \\\"./sample\\\"\\n\",\n    \"    workspace: \\\"/home/work/appbuilder\\\"\\n\",\n    \"\\n\",\n    \"    # 服务的运行命令，根据实际使用修改\\n\",\n    \"    run_cmd: \\\"python3 sample.py\\\"\\n\",\n    \"\\n\",\n    \"env:\\n\",\n    \"    APPBUILDER_LOGLEVEL: debug\\n\",\n    \"    APPBUILDER_TOKEN: \\\"\\\"\\n\",\n    \"```\\n\",\n    \"* Step2 编写自己的服务运行代码（以组件服务为例）\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"plaintext\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"# 创建配置中的local_dir目录\\n\",\n    \"mkdir sample\\n\",\n    \"touch sample/sample.py\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"plaintext\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"# 编写服务运行代码\\n\",\n    \"# sample/sample.py\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"component = appbuilder.Playground(prompt_template=\\\"{query}\\\", model=\\\"ERNIE-Bot\\\")\\n\",\n    \"agent = appbuilder.AgentRuntime(component=component)\\n\",\n    \"agent.serve(port=8091)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"* Step3 执行部署\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"plaintext\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"# ./config.yaml为第一步创建的config.yaml文件\\n\",\n    \"appbuilder_bce_deploy --conf ./config.yaml\\n\",\n    \"\\n\",\n    \"# 执行后取日志\\\"deployment finished! public ip:\\\"后的ip为部署实例的公网ip \\n\",\n    \"# 若部署结果不符合预期，使用自己配置的\\\"admin_pass\\\"登陆服务器进行调试，具体参考文档：https://cloud.baidu.com/doc/BCC/s/Hkbblll70\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 示例：Component服务，接入AppBuilder工作流\\n\",\n    \"示例代码\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"plaintext\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"component = appbuilder.Playground(prompt_template=\\\"{query}\\\", model=\\\"ERNIE-Bot\\\")\\n\",\n    \"agent = appbuilder.AgentRuntime(component=component)\\n\",\n    \"agent.serve(port=8091)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"示例请求\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"plaintext\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"# public_ip为部署获取的实例公网IP\\n\",\n    \"curl --location 'http://{public_ip}:8091/chat' \\\\\\n\",\n    \"--header 'Content-Type: application/json' \\\\\\n\",\n    \"--data '{\\n\",\n    \"    \\\"message\\\": \\\"海淀区的面积是多少\\\",\\n\",\n    \"    \\\"stream\\\": false\\n\",\n    \"}'\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"通过API节点接入Appbuilder工作流，用于创建组件\\n\",\n    \"* 操作参考：https://cloud.baidu.com/doc/AppBuilder/s/glv0f48qe\\n\",\n    \"* API接入调试成功\\n\",\n    \"\\n\",\n    \"<img src=\\\"../app_builder_resources/component_api_debug.png\\\" alt=\\\"drawing\\\" width=\\\"800\\\"/>\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 示例：随时随地的对话服务 \\n\",\n    \"**⚠️示例仅提供demo，实际业务需增加鉴权等能力**\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"示例代码\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"plaintext\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"component = appbuilder.Playground(prompt_template=\\\"{query}\\\", model=\\\"ERNIE-Bot\\\")\\n\",\n    \"\\n\",\n    \"agent = appbuilder.AgentRuntime(component=component)\\n\",\n    \"agent.chainlit_demo(port=8091)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"示例效果\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"<img src=\\\"../app_builder_resources/deploy_chainlit.png\\\" alt=\\\"drawing\\\" width=\\\"300\\\"/>\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"language_info\": {\n   \"name\": \"python\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/agent_builder.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"42eace26869295fb\",\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"source\": [\n    \"# Console AppBuilderClient使用示例\\n\",\n    \"\\n\",\n    \"整体使用流程包括以下两个环节：\\n\",\n    \"\\n\",\n    \"1. 在[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)创建并发布应用、获取应用ID、获取密钥\\n\",\n    \"2. 引用AppBuilderSDK代码，初始化AppBuilderClient实例、创建会话、上传文档（可选）、执行对话\\n\",\n    \"\\n\",\n    \"以下分别提供三个样例，快递查询小助手、植物识别小助手、篮球教练来说明使用流程，注意以下流程用到的密钥可在图示位置中获取：\\n\",\n    \"<img src=\\\"./app_builder_resources/secret.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"## 1. 快递查询小助手\\n\",\n    \"\\n\",\n    \"[<span style=\\\"font-size:1.3em;\\\"> 快递查询小助手</span>](https://appbuilder.baidu.com/s/KVSXK)一键体验\\n\",\n    \"\\n\",\n    \"### 1.1 Console端应用配置与发布\\n\",\n    \"1 进入[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)，配置智能体指令、选择相应的工具组件、发布应用\\n\",\n    \"\\n\",\n    \"<img src=\\\"./app_builder_resources/express_assistant.png\\\" alt=\\\"drawing\\\" width=\\\"1200\\\"/>\\n\",\n    \"\\n\",\n    \"2 获取应用ID\\n\",\n    \"<img src=\\\"./app_builder_resources/app_id.png\\\" alt=\\\"drawing\\\" width=\\\"1200\\\"/>\\n\",\n    \"\\n\",\n    \"### 1.2 SDK代码调用示例\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"a6a9e2ba6159a8e4\",\n   \"metadata\": {\n    \"collapsed\": false,\n    \"is_executing\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"import os\\n\",\n    \"# 注意以下示例正确运行依赖的条件包括：\\n\",\n    \"# 1. 在百度智能云千帆AppBuilder官网使用AppBuilderClient创建应用且应用已发布\\n\",\n    \"# 2. 密钥正确有效\\n\",\n    \"# 3. 密钥需要与发布应用正确对应，即需要使用发布应用的账户下的密钥\\n\",\n    \"\\n\",\n    \"# 配置密钥与应用ID\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] =\\\"secret_key\\\"\\n\",\n    \"app_id = \\\"35f4fed3-d530-4dad-bc8e-f2150a4450be\\\"\\n\",\n    \"\\n\",\n    \"# 初始化Agent\\n\",\n    \"builder = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"\\n\",\n    \"# 创建会话ID\\n\",\n    \"conversation_id = builder.create_conversation()\\n\",\n    \"\\n\",\n    \"# 执行对话\\n\",\n    \"msg = builder.run(conversation_id, \\\"我的快递单号是：9858485940100; 请查询下此快递的状态\\\")\\n\",\n    \"print(\\\"快递查询助理回答内容：\\\", msg.content.answer)\\n\",\n    \"\\n\",\n    \"# 执行流式对话\\n\",\n    \"msg = builder.run(conversation_id, \\\"使用语音播报快递当前状态\\\", stream=True)\\n\",\n    \"for content in msg.content:\\n\",\n    \"    for ev in content.events:\\n\",\n    \"        if ev.content_type == \\\"audio\\\":\\n\",\n    \"            print(\\\"快递查询助理生成的音频播放地址：\\\", ev.detail[\\\"audio\\\"])\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"3e462991dab3283d\",\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"source\": [\n    \"## 2. 植物识别小助手\\n\",\n    \"[<span style=\\\"font-size:1.3em;\\\">植物识别小助手</span>](https://appbuilder.baidu.com/s/50zyD)一键体验\\n\",\n    \"\\n\",\n    \"### 2.1 Console端应用配置与发布\\n\",\n    \"1 进入[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)，配置智能体指令、选择相应的工具组件、发布应用\\n\",\n    \"<img src=\\\"./app_builder_resources/plant_recog_assistant.png\\\" alt=\\\"drawing\\\" width=\\\"1200\\\"/>\\n\",\n    \"\\n\",\n    \"2 获取应用ID, 同1.1\\n\",\n    \"\\n\",\n    \"### 2.2 SDK代码调用示例\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"4d051395a2aa1d11\",\n   \"metadata\": {\n    \"collapsed\": false,\n    \"is_executing\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 注意以下示例正确运行依赖的条件包括：\\n\",\n    \"# 1. 在百度智能云千帆AppBuilder官网使用AppBuilderClient创建应用且应用已发布\\n\",\n    \"# 2. 密钥正确有效\\n\",\n    \"# 3. 密钥需要与发布的应用正确对应，即需要使用发布应用的账户下的密钥\\n\",\n    \"\\n\",\n    \"# 配置密钥与应用ID\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] =\\\"...\\\"\\n\",\n    \"app_id = \\\"7016e0d3-451b-4a47-a818-dc0a16d4b496\\\" \\n\",\n    \"\\n\",\n    \"# 初始化Agent实例\\n\",\n    \"builder = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"\\n\",\n    \"# 创建会话ID\\n\",\n    \"conversation_id = builder.create_conversation()\\n\",\n    \"\\n\",\n    \"# 上传植物图片\\n\",\n    \"file_id = builder.upload_local_file(conversation_id, \\\"./app_builder_resources/tree.png\\\" )\\n\",\n    \"\\n\",\n    \"# 植物识别\\n\",\n    \"msg = builder.run(conversation_id, \\\"请识别图中的植物类别\\\", file_ids=[file_id])\\n\",\n    \"print(\\\"植物识别助理回答内容：\\\", msg.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"c112f09d6ce35d10\",\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"source\": [\n    \"## 3. 篮球教练\\n\",\n    \"[<span style=\\\"font-size:1.3em;\\\">篮球教练知识增强检索</span>](https://appbuilder.baidu.com/s/RCVEn)一键体验\\n\",\n    \"\\n\",\n    \"### 3.1 Console端应用配置与发布\\n\",\n    \"1 进入[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)，配置智能体指令、上传文档并关联知识库、发布应用\\n\",\n    \"<img src=\\\"./app_builder_resources/agent_builder_rag.png\\\" alt=\\\"drawing\\\" width=\\\"1200\\\"/>\\n\",\n    \"\\n\",\n    \"2 获取应用ID, 同1.1\\n\",\n    \"\\n\",\n    \"### 3.2 SDK代码调用示例\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"65e488aa883cf94e\",\n   \"metadata\": {\n    \"collapsed\": false,\n    \"is_executing\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 注意以下示例正确运行依赖的条件包括：\\n\",\n    \"# 1. 在百度智能云千帆AppBuilder官网使用AppBuilderClient创建应用且应用已发布\\n\",\n    \"# 2. 密钥正确有效\\n\",\n    \"# 3. 密钥需要与发布的应用正确对应，即需要使用发布应用的账户下的密钥\\n\",\n    \"\\n\",\n    \"# 配置密钥与应用ID\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] =\\\"...\\\"\\n\",\n    \"app_id = \\\"4316a7cb-b6b2-4448-b6fa-ff131c484ec9\\\" \\n\",\n    \"\\n\",\n    \"# 初始化Agent实例\\n\",\n    \"builder = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"\\n\",\n    \"# 创建会话ID\\n\",\n    \"conversation_id = builder.create_conversation()\\n\",\n    \"\\n\",\n    \"# 执行对话\\n\",\n    \"msg = builder.run(conversation_id, \\\"突破技巧中如何运用胯下变向？\\\", )\\n\",\n    \"print(\\\"篮球教练回答内容：\\\", msg.content.answer)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.11.8\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/appbuilder_trace/trace.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 使用Appbuilder-SDK Trace框架实现对Client的跟踪\\n\",\n    \"\\n\",\n    \"- 如果没有安装phoenix，需要先安装phoenix，这里建议使用清华源镜像安装，推荐使用4.5.0版本\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"python3 -m pip install arize-phoenix==4.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 启动phoenix服务\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"appbuilder_trace_server\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- ctrl+鼠标左键点击http://localhost:8080/进入可视化界面,跟踪的信息将在这里可视化展示\\n\",\n    \"![phoenix可视化界面](https://bj.bcebos.com/v1/appbuilder-sdk-components/Phoenix%E5%8F%AF%E8%A7%86%E5%8C%96%E7%95%8C%E9%9D%A2%EF%BC%881%EF%BC%89.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A41%3A00Z%2F-1%2Fhost%2F19a246ca50757aa64a3ccabfac0c8cd93730a08599201dd81e9de9bb2f9bb2a3)\\n\",\n    \"- 使用ctrl+c停止phoenix服务\\n\",\n    \"\\n\",\n    \"### 启动Appbuilder-SDK TRACE\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-07-03 11:10:00,040.040] tracer.py [line:128] INFO [main-9857193014994891849] OTLPSpanExporter endpoint: http://localhost:8080/v1/traces\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"from appbuilder import AppBuilderTracer\\n\",\n    \"tracer=AppBuilderTracer(\\n\",\n    \"    enable_phoenix = True,\\n\",\n    \"    enable_console = False,\\n\",\n    \"    )\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- enable_phoenix:是否启动phoenix可视化跟踪\\n\",\n    \"- enable_console:是否将trace信息反馈到控制台\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-07-03 11:10:03,800.800] tracer.py [line:162] INFO [main-13600015437371441059] AppBuilder Starting trace...\\n\",\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {}, 'component_code': 'ChatAgent', 'component_name': '聊天助手'}}, usage=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='preparing', event_type='ChatAgent', content_type='status', detail={}, usage=None)]\\n\",\n      \"answer='作为植物' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '作为植物'}, usage=Usage(prompt_tokens=77, completion_tokens=0, total_tokens=77, name='ERNIE-4.0-8K'))]\\n\",\n      \"answer='识别专家，我可以帮助您识别各种植物种类。' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '识别专家，我可以帮助您识别各种植物种类。'}, usage=Usage(prompt_tokens=77, completion_tokens=0, total_tokens=77, name='ERNIE-4.0-8K'))]\\n\",\n      \"answer='如果您提供植物的图片或详细描述，我可以利用植物识别组件来分析并确定植物的种类，为您提供准确、专业的识别结果。' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '如果您提供植物的图片或详细描述，我可以利用植物识别组件来分析并确定植物的种类，为您提供准确、专业的识别结果。'}, usage=Usage(prompt_tokens=77, completion_tokens=0, total_tokens=77, name='ERNIE-4.0-8K'))]\\n\",\n      \"answer='无论是常见的花卉、树木，还是稀有的植物品种，我都可以尽力为您提供识别服务。' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '无论是常见的花卉、树木，还是稀有的植物品种，我都可以尽力为您提供识别服务。'}, usage=Usage(prompt_tokens=77, completion_tokens=0, total_tokens=77, name='ERNIE-4.0-8K'))]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='ChatAgent', content_type='text', detail={'text': ''}, usage=Usage(prompt_tokens=77, completion_tokens=60, total_tokens=137, name='ERNIE-4.0-8K'))]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='success', event_type='ChatAgent', content_type='status', detail={}, usage=None)]\\n\",\n      \"answer='' events=[]\\n\",\n      \"[2024-07-03 11:10:11,965.965] tracer.py [line:166] INFO [main-9471189008456186581] AppBuilder Ending trace...\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"INFO:appbuilder:AppBuilder Ending trace...\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 启动trace \\n\",\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"tracer.start_trace()\\n\",\n    \"\\n\",\n    \"# 这里将APPBUILDER_TOKEN与app_id更换为你的APPBUILDER_TOKEN和app_id\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"YOUR_APPBUILDER_TOKEN\\\"\\n\",\n    \"app_id = \\\"YOUR_APP_ID\\\"\\n\",\n    \"\\n\",\n    \"builder = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = builder.create_conversation()\\n\",\n    \"msg = builder.run(conversation_id=conversation_id, query=\\\"你可以做什么？\\\",stream=True)\\n\",\n    \"\\n\",\n    \"for m in msg.content:\\n\",\n    \"    print(m)\\n\",\n    \"\\n\",\n    \"# 结束trace\\n\",\n    \"tracer.end_trace()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### phoneix可视化跟踪界面展示\\n\",\n    \"![phoenix可视化页面展示结果](https://bj.bcebos.com/v1/appbuilder-sdk-components/Phoenix%E5%8F%AF%E8%A7%86%E5%8C%96%E7%95%8C%E9%9D%A2%EF%BC%882%EF%BC%89.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A41%3A31Z%2F-1%2Fhost%2F86460e40ecab90c50168da46ca0cf79f6179696943e1a1546f9a9ce6d34b8063)\\n\",\n    \"- 可以在可视化界面查看跟踪信息如Client组件的调用链路，输入输出、消耗token数等信息\\n\",\n    \"- 点击某个调用链路，可以查看该调用链路详细信息，流式运行过程，HTTP-POST节点展示curl命令\\n\",\n    \"![phoenix可视化页面节点展示结果](https://bj.bcebos.com/v1/appbuilder-sdk-components/Phoenix%E5%8F%AF%E8%A7%86%E5%8C%96%E7%95%8C%E9%9D%A2%EF%BC%883%EF%BC%89.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A41%3A46Z%2F-1%2Fhost%2F096835857c7de8714250a260a0373e69938c91d5452e3955d3f4b2ca298b8bcc)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.12\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/components/agent_runtime.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"f802e64d-4eaa-445d-a48a-1042a91bc394\",\n   \"metadata\": {\n    \"tags\": []\n   },\n   \"source\": [\n    \"# 基于AgentRuntime服务化组件\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"使用 AgentRuntime 对组件进行服务化。\\n\",\n    \"\\n\",\n    \"AgentRuntime 是对组件（Component）的服务化封装，具体有如下几个功能：\\n\",\n    \"- 一键服务化组件: 使得组件能够以服务的形式运行，支持 API 调用和对话框交互。\\n\",\n    \"- Session 数据管理: 提供 Session 数据的管理功能，允许跟踪和存储用户会话数据。\\n\",\n    \"- 请求时鉴权: 支持在请求时进行认证，确保安全性。\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 安装Python SDK\\n\",\n    \"\\n\",\n    \"appbuilder 支持使用 pip 安装（要求Python >= 3.8），并且 AgentRuntime 服务化组件依赖 `appbuilder-sdk[serve]`\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"2939356f-61c2-42e9-9e0c-fc6729c193f6\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"pip install appbuilder-sdk 'appbuilder-sdk[serve]'\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"aeb2fa55-075f-48df-a9fb-8b40d9900684\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 基本用法\\n\",\n    \"\\n\",\n    \"### 快速开始\\n\",\n    \"\\n\",\n    \"下面的示例会基于 Playground 组件，在 8091 端口部署 Web 服务: \"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"41559341-fd7a-478c-a08b-1477d79e9d41\",\n   \"metadata\": {\n    \"ExecuteTime\": {\n     \"end_time\": \"2023-12-18T06:24:26.982459Z\",\n     \"start_time\": \"2023-12-18T06:23:53.771345Z\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 使用组件之前，请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1、创建密钥\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = '...'\\n\",\n    \"\\n\",\n    \"component = appbuilder.Playground(\\n\",\n    \"    prompt_template=\\\"{query}\\\",\\n\",\n    \"    model=\\\"ERNIE-Bot\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"agent = appbuilder.AgentRuntime(component=component)\\n\",\n    \"agent.serve(port=8091)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"b71e24eb\",\n   \"metadata\": {},\n   \"source\": [\n    \"通过 Shell 命令测试启动的服务, 请求 Body 为组件 run 方法的入参：\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"12c71fa5\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"curl --location 'http://0.0.0.0:8091/chat' \\\\\\n\",\n    \"--header 'Content-Type: application/json' \\\\\\n\",\n    \"--data '{\\n\",\n    \"    \\\"message\\\": \\\"海淀区的面积是多少\\\",\\n\",\n    \"    \\\"stream\\\": false\\n\",\n    \"}'\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"5fc5bc38-6bc5-4187-a8fd-f802d77d89fa\",\n   \"metadata\": {},\n   \"source\": [\n    \"## AgentRuntime 参数说明\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"c2364c35\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 1. 类初始化参数说明\\n\",\n    \"\\n\",\n    \"AgentRuntime 初始化接受两个参数。\\n\",\n    \"\\n\",\n    \"| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\\n\",\n    \"|--|--|--|--|--|\\n\",\n    \"| component | Component | 是 | 可运行的 Component, 该 Component 需要实现 run(message, stream, **args) 方法。 | Playground(prompt_template=\\\"{query}\\\", model=\\\"ERNIE-Bot\\\") |\\n\",\n    \"| user_session_config | sqlalchemy.engine.URL\\\\|Str\\\\|None | 否 | 会话 Session 数据存储的数据库配置，遵循 sqlalchemy 后端定义，可参考[文档](https://docs.sqlalchemy.org/en/20/core/engines.html#backend-specific-urls)。默认使用 sqlite:///user_session.db，即本地的 SQLite 存储 | \\\"sqlite:///user_session.db\\\" |\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"62e1af06\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2. API 服务参数\\n\",\n    \"\\n\",\n    \"#### 2.1 请求参数\\n\",\n    \"\\n\",\n    \"**接口定义**\\n\",\n    \"\\n\",\n    \"| URL | Method |\\n\",\n    \"|--|--|\\n\",\n    \"| /chat | POST |\\n\",\n    \"\\n\",\n    \"**Header 参数**\\n\",\n    \"\\n\",\n    \"| 参数名称 | 是否必须 | 描述 | 示例值 |\\n\",\n    \"|--|--|--|--|\\n\",\n    \"| Content-Type | 是 | 必须设置为\\\"application/json\\\" | \\\"application/json\\\" |\\n\",\n    \"| X-Appbuilder-Token | 否 | 开启请求时认证能力时需要带入 APPBUILDER_TOKEN 进行鉴权 | 前往千帆AppBuilder官网创建密钥，流程详见[文档](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1、创建密钥) |\\n\",\n    \"\\n\",\n    \"**Body 参数**\\n\",\n    \"\\n\",\n    \"| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\\n\",\n    \"|--|--|--|--|--|\\n\",\n    \"| message | Any | 是 | 透传到 component 的 run 方法的 message 参数 | \\\"海淀区的面积是多少\\\" |\\n\",\n    \"| stream | Bool | 否 | 是否流式调用。透传到 component 的 run 方法的 stream 参数。默认为 false | false |\\n\",\n    \"| session_id | Str | 否 | 用于标示同一个会话（Session）。如果不传该值，后端会自动生成 session_id，在响应参数中返回 | \\\"99680089-5acb-4298-9ade-a1a3f6c28102\\\" |\\n\",\n    \"| 其他参数 | Any | 否 | 透传到 component 的 run 方法 | - |\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"#### 2.2 响应参数\\n\",\n    \"分为非流式响应和流式响应。\\n\",\n    \"\\n\",\n    \"**非流式响应**\\n\",\n    \"\\n\",\n    \"| 参数名称 | 参数类型 | 描述 | 示例值 |\\n\",\n    \"|--|--|--|--|\\n\",\n    \"| code | Int | 错误码。值为0表示成功，否则为失败。非0错误详见错误码部分描述 | 0 |\\n\",\n    \"| message | Str | 错误信息描述。 | \\\"Missing input variable query in message ['海淀区的面积是多少']\\\" |\\n\",\n    \"| result | Object | 请求结果 | - |\\n\",\n    \"| + answer_message | Object | 组件返回值，由返回的 Message 序列化得到 | {\\\"content\\\":\\\"海淀区是北京市的一个区，位于北京市主城区西部和西北部，东与西城区、朝阳区相邻，南与丰台区毗连，西与石景山区、门头沟区交界，北与昌平区接壤。海淀区的面积为**431平方千米**，约占北京市总面积的2.6%。\\\",\\\"extra\\\":{},\\\"id\\\":\\\"6b4e5019-a708-4bc5-a6ec-595fb4285677\\\",\\\"mtype\\\":\\\"dict\\\",\\\"name\\\":\\\"msg\\\"} |\\n\",\n    \"| + session_id | Str | 用于标示同一个会话（Session） | \\\"99680089-5acb-4298-9ade-a1a3f6c28102\\\" |\\n\",\n    \"\\n\",\n    \"**流式响应**\\n\",\n    \"\\n\",\n    \"流式数据以追加的形式返回。流式和非流式的数据结构一致，不再描述。\\n\",\n    \"\\n\",\n    \"#### 2.3 响应示例\\n\",\n    \"\\n\",\n    \"分为非流式响应和流式响应。\\n\",\n    \"\\n\",\n    \"**非流式响应**\\n\",\n    \"\\n\",\n    \"```shell\\n\",\n    \"{\\n\",\n    \"  \\\"code\\\": 0,\\n\",\n    \"  \\\"message\\\": \\\"\\\",\\n\",\n    \"  \\\"result\\\": {\\n\",\n    \"    \\\"answer_message\\\": {\\n\",\n    \"      \\\"content\\\": \\\"海淀区是北京市的一个区，位于北京市主城区西部和西北部，东与西城区、朝阳区相邻，南与丰台区毗连，西与石景山区、门头沟区交界，北与昌平区接壤。海淀区的面积为**431平方千米**，约占北京市总面积的2.6%。\\\",\\n\",\n    \"      \\\"extra\\\": {},\\n\",\n    \"      \\\"id\\\": \\\"6b4e5019-a708-4bc5-a6ec-595fb4285677\\\",\\n\",\n    \"      \\\"mtype\\\": \\\"dict\\\",\\n\",\n    \"      \\\"name\\\": \\\"msg\\\"\\n\",\n    \"    },\\n\",\n    \"    \\\"session_id\\\": \\\"99680089-5acb-4298-9ade-a1a3f6c28102\\\"\\n\",\n    \"  }\\n\",\n    \"}\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"**流式响应**\\n\",\n    \"\\n\",\n    \"```shell\\n\",\n    \"data: {\\\"code\\\": 0, \\\"message\\\": \\\"\\\", \\\"result\\\": {\\\"session_id\\\": \\\"663303a9-d83d-481f-a084-872ece87989c\\\", \\\"answer_message\\\": {\\\"content\\\": \\\"海淀区\\\", \\\"extra\\\": {}}}}\\n\",\n    \"\\n\",\n    \"data: {\\\"code\\\": 0, \\\"message\\\": \\\"\\\", \\\"result\\\": {\\\"session_id\\\": \\\"663303a9-d83d-481f-a084-872ece87989c\\\", \\\"answer_message\\\": {\\\"content\\\": \\\"，隶属于北京市，位于北京市主城区西部和西北部，东与西城区、朝阳区相邻，南与丰台区毗连，\\\", \\\"extra\\\": {}}}}\\n\",\n    \"\\n\",\n    \"data: {\\\"code\\\": 0, \\\"message\\\": \\\"\\\", \\\"result\\\": {\\\"session_id\\\": \\\"663303a9-d83d-481f-a084-872ece87989c\\\", \\\"answer_message\\\": {\\\"content\\\": \\\"西与石景山区、门头沟区交界，北与昌平区接壤，总面积**431平方千米**。\\\", \\\"extra\\\": {}}}}\\n\",\n    \"\\n\",\n    \"data: {\\\"code\\\": 0, \\\"message\\\": \\\"\\\", \\\"result\\\": {\\\"session_id\\\": \\\"663303a9-d83d-481f-a084-872ece87989c\\\", \\\"answer_message\\\": {\\\"content\\\": \\\"\\\", \\\"extra\\\": {}}}}\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"#### 2.4 错误码\\n\",\n    \"| 错误码 | 描述 |\\n\",\n    \"|--|--|\\n\",\n    \"| 400 | 客户端请求参数错误 |\\n\",\n    \"| 1000 | 服务端执行错误 |\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"61923b00\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 高级用法\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"a2303c76\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 1. 一键服务化组件 \\n\",\n    \"AgentRuntime 可以快速组件以服务的形式运行，支持 API 调用和对话框交互。\\n\",\n    \"\\n\",\n    \"**1.1 API调用**\\n\",\n    \"\\n\",\n    \"API 调用的基础用法在快速开始小结已经给出，这里不再赘述。\\n\",\n    \"\\n\",\n    \"下面介绍使用 `gunicorn` 启动生产级 Web 服务的方法，`gunicorn` 是一个适用于 UNIX 的 Python WSGI HTTP 服务器，详见[项目链接](https://github.com/benoitc/gunicorn)。\\n\",\n    \"\\n\",\n    \"首先创建 `app.py` 文件，暴露 Flask App：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"fde5cc94\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 使用组件之前，请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1、创建密钥\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = '...'\\n\",\n    \"\\n\",\n    \"def get_flask_app():\\n\",\n    \"    component = appbuilder.Playground(\\n\",\n    \"        prompt_template=\\\"{query}\\\",\\n\",\n    \"        model=\\\"ERNIE-Bot\\\"\\n\",\n    \"    )\\n\",\n    \"    agent = appbuilder.AgentRuntime(component=component)\\n\",\n    \"    return agent.create_flask_app()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"a41ef57b\",\n   \"metadata\": {},\n   \"source\": [\n    \"基于 `gunicorn` 启动生产级服务：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"2077833f\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"# 服务工作进程数\\n\",\n    \"SERVER_WORKER_AMOUNT=8\\n\",\n    \"# 服务工作进程启动方式\\n\",\n    \"SERVER_WORKER_CLASS=gevent\\n\",\n    \"# 服务超时时间\\n\",\n    \"GUNICORN_TIMEOUT=60\\n\",\n    \"\\n\",\n    \"gunicorn \\\\\\n\",\n    \"  --bind \\\"0.0.0.0:8091\\\" \\\\\\n\",\n    \"  --workers ${SERVER_WORKER_AMOUNT} \\\\\\n\",\n    \"  --worker-class ${SERVER_WORKER_CLASS} \\\\\\n\",\n    \"  --timeout ${GUNICORN_TIMEOUT} \\\\\\n\",\n    \"  \\\"app:get_flask_app()\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"673c7565\",\n   \"metadata\": {},\n   \"source\": [\n    \"**1.2 对话框交互**\\n\",\n    \"\\n\",\n    \"基于 chainlit 的对话框交互对被服务化的组件的 message 参数更加严格，要求能够接受 Str 的基础类型。\\n\",\n    \"\\n\",\n    \"执行下面的代码，会启动一个 chainlit 页面，页面地址：0.0.0.0:8091\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"e485544f\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 使用组件之前，请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1、创建密钥\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = '...'\\n\",\n    \"\\n\",\n    \"component = appbuilder.Playground(\\n\",\n    \"    prompt_template=\\\"{query}\\\",\\n\",\n    \"    model=\\\"ERNIE-Bot\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"agent = appbuilder.AgentRuntime(component=component)\\n\",\n    \"agent.chainlit_demo(port=8091)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"4d63bece\",\n   \"metadata\": {},\n   \"source\": [\n    \"Chainlit Demo页面示意图如下所示，\\n\",\n    \"\\n\",\n    \"![chainlit demo](image/agent_runtime_with_chainlit_demo.png)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"a074f367\",\n   \"metadata\": {},\n   \"source\": [\n    \"**1.3 对话框交互AppBuilderClient**\\n\",\n    \"\\n\",\n    \"基于 chainlit 的对话框交互AppBuilderClient，可实现对话交互。支持工作流Agent、自主规划Agent应用。\\n\",\n    \"\\n\",\n    \"执行下面的代码，会启动一个 chainlit 页面，页面地址：0.0.0.0:8091。可在页面上上传文档（可选）、执行对话。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"0a75e035\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 使用组件之前，请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1、创建密钥\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"# 使用之前，在官网个人空间获取应用ID，如下图\\n\",\n    \"app_id= \\\"...\\\"\\n\",\n    \"client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"agent = appbuilder.AgentRuntime(client)\\n\",\n    \"agent.chainlit_agent(port=8091)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"d5162e29\",\n   \"metadata\": {},\n   \"source\": [\n    \"在官网个人空间获取应用ID\\n\",\n    \"![get app_id](../app_builder_resources/app_id.png)\\n\",\n    \"\\n\",\n    \"使用服务上传文件并对话示例图如下所示\\n\",\n    \"![chainlit demo](./image/agent_runtime_with_chainlit_agent.png)\\n\",\n    \"\\n\",\n    \"使用工作流Agent应用对话示例如下图所示\\n\",\n    \"![chainlit demo](./image/agent_runtime_with_chainlit_chatflow.png)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"2392f46d\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2. Session 数据管理\\n\",\n    \"AgentRuntime 提供 Session 数据的管理功能，允许跟踪和存储用户会话数据。一般只有在二次开发的组件需要使用该能力。\\n\",\n    \"\\n\",\n    \"**2.1 二次开发组件**\\n\",\n    \"\\n\",\n    \"二次开发的组件需要重写组件的 run(message, stream, **args)方法，并且至少需要有 message 和 stream 两个参数。\\n\",\n    \"\\n\",\n    \"下面基于 QueryRewrite 和 Playground 两个组件，开发 PlaygroundWithHistory 组件，该组件需要对会话数据进行操作。\\n\",\n    \"\\n\",\n    \"当使用 Component 独立运行时，会话数据会被存储于内存。\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"079048e3\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import logging\\n\",\n    \"from appbuilder.core.component import Component\\n\",\n    \"from appbuilder import (\\n\",\n    \"    AgentRuntime, UserSession, Message, QueryRewrite, Playground,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 使用组件之前，请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1、创建密钥\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = '...'\\n\",\n    \"\\n\",\n    \"class PlaygroundWithHistory(Component):\\n\",\n    \"    def __init__(self):\\n\",\n    \"        super().__init__()\\n\",\n    \"        self.query_rewrite = QueryRewrite(model=\\\"DeepSeek-V3.1\\\")\\n\",\n    \"        self.playground = Playground(\\n\",\n    \"            prompt_template=\\\"{query}\\\",\\n\",\n    \"            model=\\\"ERNIE-Bot\\\"\\n\",\n    \"        )\\n\",\n    \"\\n\",\n    \"    def run(self, message: Message, stream: bool=False):\\n\",\n    \"        user_session = UserSession()\\n\",\n    \"        # 获取 Session 历史数据\\n\",\n    \"        history_queries = user_session.get_history(\\\"query\\\", limit=1)\\n\",\n    \"        history_answers = user_session.get_history(\\\"answer\\\", limit=1)\\n\",\n    \"\\n\",\n    \"        # query 改写\\n\",\n    \"        if history_queries and history_answers:\\n\",\n    \"            history = []\\n\",\n    \"            for query, answer in zip(history_queries, history_answers):\\n\",\n    \"                history.extend([query.content, answer.content])\\n\",\n    \"            logging.info(f\\\"history: {history}\\\")\\n\",\n    \"            message = self.query_rewrite(\\n\",\n    \"                Message(history + [message.content]), rewrite_type=\\\"带机器人回复\\\")\\n\",\n    \"        logging.info(f\\\"message: {message}\\\") \\n\",\n    \"\\n\",\n    \"        # 执行 playground\\n\",\n    \"        answer = self.playground.run(message, stream)\\n\",\n    \"\\n\",\n    \"        # 保存本轮数据\\n\",\n    \"        user_session.append({\\n\",\n    \"            \\\"query\\\": message,\\n\",\n    \"            \\\"answer\\\": answer,\\n\",\n    \"        }) \\n\",\n    \"        return answer\\n\",\n    \"\\n\",\n    \"# component 可以独立运行，session数据会被保存于内存\\n\",\n    \"playground_with_history_component = PlaygroundWithHistory()\\n\",\n    \"print(playground_with_history_component.run(Message(\\\"海淀区的面积是多少\\\"), stream=False))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"480fd56d\",\n   \"metadata\": {},\n   \"source\": [\n    \"**2.2 会话数据存储数据库**\\n\",\n    \"\\n\",\n    \"使用 AgentRuntime 对 Component 服务化，会话数据会被存储于数据库。\\n\",\n    \"下面的代码以 SQLite 为例展示该能力，更多数据库配置详见[文档](https://docs.sqlalchemy.org/en/20/core/engines.html#backend-specific-urls)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"111b11de\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"user_session_config = \\\"sqlite:///foo.db\\\"\\n\",\n    \"agent = appbuilder.AgentRuntime(\\n\",\n    \"    component=playground_with_history_component, \\n\",\n    \"    user_session_config=user_session_config)\\n\",\n    \"agent.serve(port=8091)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"e7dc38ec\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 3. 请求时鉴权\\n\",\n    \"AgentRuntime 支持在请求时进行认证，确保安全性。\\n\",\n    \"\\n\",\n    \"使用该能力，在初始化组件时需要设置 lazy 鉴权：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"2125bf4f\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 无需配置 APPBUILDER_TOKEN 环境变量\\n\",\n    \"\\n\",\n    \"component = appbuilder.Playground(\\n\",\n    \"    prompt_template=\\\"{query}\\\",\\n\",\n    \"    model=\\\"ERNIE-Bot\\\",\\n\",\n    \"    lazy_certification=True, # 设置 lazy 鉴权，在创建时不进行认证\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"agent = appbuilder.AgentRuntime(component=component)\\n\",\n    \"agent.serve(port=8091)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"bbf35a0a\",\n   \"metadata\": {},\n   \"source\": [\n    \"当初始化组件时进行了 lazy 鉴权，请求时请求头必须带上 `X-Appbuilder-Token` （即Appbuilder密钥，获取流程详见[千帆AppBuilder官网创建密钥](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1、创建密钥)）进行鉴权：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"60dcfa37\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"curl --location 'http://0.0.0.0:8091/chat' \\\\\\n\",\n    \"    --header 'Content-Type: application/json' \\\\\\n\",\n    \"    --header 'X-Appbuilder-Token: ...' \\\\\\n\",\n    \"    --data '{\\n\",\n    \"        \\\"message\\\": \\\"海淀区的面积是多少\\\",\\n\",\n    \"        \\\"stream\\\": false\\n\",\n    \"    }'\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"f8584416\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 4. 查看user_session.db储存信息\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"使用该能力，查看用户对话信息。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 83,\n   \"id\": \"9bbeb156\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import sqlite3  \\n\",\n    \"  \\n\",\n    \"# 连接到 SQLite 数据库  \\n\",\n    \"# 如果文件不存在，会自动在当前目录创建:  \\n\",\n    \"user_session_path = '本地user_session.db地址' \\n\",\n    \"conn = sqlite3.connect(user_session_path)  \\n\",\n    \"cursor = conn.cursor()  \"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"54cce03b\",\n   \"metadata\": {},\n   \"source\": [\n    \"执行 SQL 语句，列出SQLite数据库中的所有表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 85,\n   \"id\": \"f4ca2963\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[('appbuilder_session_messages',)]\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 执行一条 SQL 语句，列出所有表  \\n\",\n    \"cursor.execute(\\\"SELECT name FROM sqlite_master WHERE type='table';\\\")  \\n\",\n    \"print(cursor.fetchall())  \"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"e5b838f4\",\n   \"metadata\": {},\n   \"source\": [\n    \"查询appbuilder_session_messages表的列信息,appbuilder_session_messages表的列信息为:\\n\",\n    \"- id\\n\",\n    \"- session_id\\n\",\n    \"- request_id\\n\",\n    \"- message_key\\n\",\n    \"- message_value\\n\",\n    \"- created_at\\n\",\n    \"- updated_at\\n\",\n    \"- deleted\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 79,\n   \"id\": \"1ac388d7\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id\\n\",\n      \"session_id\\n\",\n      \"request_id\\n\",\n      \"message_key\\n\",\n      \"message_value\\n\",\n      \"created_at\\n\",\n      \"updated_at\\n\",\n      \"deleted\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"cursor.execute(\\\"PRAGMA table_info(appbuilder_session_messages);\\\")  \\n\",\n    \"columns_info = cursor.fetchall()  \\n\",\n    \"\\n\",\n    \"column_names = [info[1] for info in columns_info]  # info[1]是列名的位置  \\n\",\n    \"for column_name in column_names:  \\n\",\n    \"    print(column_name)   \"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"3965454f\",\n   \"metadata\": {},\n   \"source\": [\n    \"查询表中的特定数据【以message_value信息为例】\\n\",\n    \"输出content、id、token_usage等信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 80,\n   \"id\": \"2e6d9e45\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"{'content': '你好', 'name': 'msg', 'mtype': 'str', 'id': '90c8d150-c7b9-44a4-ac77-50dd61ee329a'}\\n\",\n      \"{'content': '你好，我是百度研发的知识增强大语言模型，中文名是文心一言，英文名是ERNIE Bot。我能够与人对话互动，回答问题，协助创作，高效便捷地帮助人们获取信息、知识和灵感。', 'name': 'msg', 'mtype': 'dict', 'id': '0fc6c5f7-23bf-4f25-8555-69b4155908b7', 'extra': {}, 'token_usage': {'prompt_tokens': 2, 'completion_tokens': 42, 'total_tokens': 44}}\\n\",\n      \"{'content': '请介绍一下你自己', 'name': 'msg', 'mtype': 'dict', 'id': '4f5cf6d1-976e-456e-a632-93c4b2550523', 'extra': {'search_db': [{'content': '带机器人回复：请你扮演一个智能搜索改写补全机器人，请根据User的搜索历史以及对应的搜索结果，对最后一句话先进行主语继承改写，然后进行上下文信息补全，注意：不要改变原文的意思，答案要尽可能简洁，不要直接回答该问题，不要输出多于的内容。\\\\\\\\n\\\\\\\\n例子：\\\\\\\\n搜索历史：\\\\\\\\nUser：今天上午你干嘛了\\\\\\\\nAssistant：去打篮球啦\\\\\\\\nUser：好玩吗？\\\\\\\\n答案：\\\\\\\\n打篮球好玩吗？', 'dataset_id': '1f777fa3-26db-4237-98d5-075abc07a84f', 'dataset_name': '多轮改写Prompt', 'document_id': '92e0f30d-1f30-46f0-8377-59ab0fb6eb93', 'document_name': '多轮改写prompt_带机器人回复.txt', 'id': '61657591-f610-44f0-84ec-67cedcb66447', 'mock_id': '1', 'position': 0, 'score': 0.511053, 'sentences': [{'content': '带机器人回复：请你扮演一个智能搜索改写补全机器人，请根据User的搜索历史以及对应的搜索结果，对最后一句话先进行主语继承改写，然后进行上下文信息补全，注意：不要改变原文的意思，答案要尽可能简洁，不要直接回答该问题，不要输出多于的内容。\\\\\\\\n\\\\\\\\n例子：\\\\\\\\n搜索历史：\\\\\\\\nUser：今天上午你干嘛了\\\\\\\\nAssistant：去打篮球啦\\\\\\\\nUser：好玩吗？', 'id': '1f777fa3-26db-4237-98d5-075abc07a84f-5992356ea8c0c05485388623218e134e-975ec17bbf8206762df7cfb24a5cd85e-97468bdaf0accef718118a2b742d5cc0', 'score': 0.628708, 'source': None}], 'title': '多轮改写prompt_带机器人回复.txt', 'tokens': 0, 'type': 'engine', 'word_count': 188}]}, 'token_usage': {'prompt_tokens': 321, 'completion_tokens': 3, 'total_tokens': 324}}\\n\",\n      \"{'content': '您好，我是文心一言，英文名是ERNIE Bot。我能够与人对话互动，回答问题，协助创作，高效便捷地帮助人们获取信息、知识和灵感。', 'name': 'msg', 'mtype': 'dict', 'id': 'f769c850-f4e5-4d02-a62a-766fd8c8132e', 'extra': {}, 'token_usage': {'prompt_tokens': 4, 'completion_tokens': 33, 'total_tokens': 37}}\\n\",\n      \"{'content': '介绍一下baidu公司', 'name': 'msg', 'mtype': 'dict', 'id': '0ff3b298-7f01-4036-927d-722e00afaf33', 'extra': {'search_db': [{'content': '带机器人回复：请你扮演一个智能搜索改写补全机器人，请根据User的搜索历史以及对应的搜索结果，对最后一句话先进行主语继承改写，然后进行上下文信息补全，注意：不要改变原文的意思，答案要尽可能简洁，不要直接回答该问题，不要输出多于的内容。\\\\\\\\n\\\\\\\\n例子：\\\\\\\\n搜索历史：\\\\\\\\nUser：今天上午你干嘛了\\\\\\\\nAssistant：去打篮球啦\\\\\\\\nUser：好玩吗？\\\\\\\\n答案：\\\\\\\\n打篮球好玩吗？', 'dataset_id': '1f777fa3-26db-4237-98d5-075abc07a84f', 'dataset_name': '多轮改写Prompt', 'document_id': '92e0f30d-1f30-46f0-8377-59ab0fb6eb93', 'document_name': '多轮改写prompt_带机器人回复.txt', 'id': '61657591-f610-44f0-84ec-67cedcb66447', 'mock_id': '1', 'position': 0, 'score': 0.511053, 'sentences': [{'content': '带机器人回复：请你扮演一个智能搜索改写补全机器人，请根据User的搜索历史以及对应的搜索结果，对最后一句话先进行主语继承改写，然后进行上下文信息补全，注意：不要改变原文的意思，答案要尽可能简洁，不要直接回答该问题，不要输出多于的内容。\\\\\\\\n\\\\\\\\n例子：\\\\\\\\n搜索历史：\\\\\\\\nUser：今天上午你干嘛了\\\\\\\\nAssistant：去打篮球啦\\\\\\\\nUser：好玩吗？', 'id': '1f777fa3-26db-4237-98d5-075abc07a84f-5992356ea8c0c05485388623218e134e-975ec17bbf8206762df7cfb24a5cd85e-97468bdaf0accef718118a2b742d5cc0', 'score': 0.628708, 'source': None}], 'title': '多轮改写prompt_带机器人回复.txt', 'tokens': 0, 'type': 'engine', 'word_count': 188}]}, 'token_usage': {'prompt_tokens': 910, 'completion_tokens': 3, 'total_tokens': 913}}\\n\",\n      \"{'content': '百度公司是中国最大的互联网搜索引擎提供商之一，也是全球领先的AI公司。以下是对百度的详细介绍：\\\\n\\\\n一、公司概况\\\\n\\\\n百度（BIDU）是一家提供中文搜索引擎的公司，由李彦宏于2000年1月在北京中关村创立。经过多年的发展，百度已经从单一的搜索引擎服务商成功转型为内容生态与人工智能（AI）融合的互联网公司。百度的使命是“用科技让复杂的世界更简单”，其核心价值观包括“简单可依赖”。\\\\n\\\\n二、主要业务与产品\\\\n\\\\n1. 搜索业务：百度搜索是中国最大的中文搜索引擎，每天响应来自全球各地的搜索请求。除了传统的网页、图片、视频等搜索结果外，还提供了知识图谱、语音搜索等创新功能。\\\\n2. 移动生态业务：百度APP是百度移动生态的核心产品，围绕看、搜、听、问、购等核心场景为用户提供服务。此外，百度还拥有信息流、智能小程序、百度知道、百度文库等一系列移动生态产品。\\\\n3. 智能云业务：百度智能云是百度提供的云计算服务平台，为企业提供计算、存储、网络等基础设施服务以及人工智能、大数据等中间件服务。\\\\n4. 智能驾驶业务：百度在自动驾驶领域具有领先地位，其Apollo自动驾驶平台已经发展出多种商业模式，包括自动驾驶技术解决方案、百度造车以及共享无人车等。\\\\n\\\\n三、财务状况与业绩表现\\\\n\\\\n根据百度发布的财报显示，其业绩表现亮眼。例如，在2023年，百度总营收达到了显著的水平，其中百度核心收入同比增长。这主要得益于公司在广告市场的持续领先地位以及非在线营销收入的增长。同时，百度在研发投入方面也保持了较高水平，以推动其AI技术的持续创新和发展。\\\\n\\\\n四、AI技术与创新\\\\n\\\\n百度在AI技术方面取得了显著成果。其文心大模型已经升级到4.0版本，用户规模超过了1亿。这一技术使得百度具备了与全球领先的AI产品相媲美的能力。此外，百度还在文字生成视频等领域进行了战略投资，以进一步拓展其业务范围并加强在AI领域的领先地位。\\\\n\\\\n综上所述，百度公司作为中国最大的互联网搜索引擎提供商和全球领先的AI公司之一，凭借其强大的技术实力和创新能力，在搜索、移动生态、智能云和智能驾驶等领域取得了显著的成果。', 'name': 'msg', 'mtype': 'dict', 'id': 'c4f02188-1206-4c02-be8e-1c5481428003', 'extra': {}, 'token_usage': {'prompt_tokens': 4, 'completion_tokens': 456, 'total_tokens': 460}}\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import json\\n\",\n    \"cursor.execute(\\\"SELECT message_value FROM appbuilder_session_messages;\\\")  \\n\",\n    \"for row in cursor.fetchall():  \\n\",\n    \"    print(json.loads(row[0]))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"5ff82880\",\n   \"metadata\": {},\n   \"source\": [\n    \"以id查询相关的agent_runtime信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 87,\n   \"id\": \"e79e2554\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"16010b88-d766-4524-81ee-37f96ceadb4d\\n\",\n      \"b2c9d058-4475-4258-ad90-4334f3d024d5\\n\",\n      \"0bdafb3d-f7e3-4187-bc1d-63cf51fbda29\\n\",\n      \"query\\n\",\n      \"{'content': '你好', 'name': 'msg', 'mtype': 'str', 'id': '90c8d150-c7b9-44a4-ac77-50dd61ee329a'}\\n\",\n      \"2024-07-30 15:01:10.949475\\n\",\n      \"2024-07-30 15:01:10.949485\\n\",\n      \"0\\n\",\n      \"4bd85fd0-2e5c-4de1-a47e-ea122f7e928c\\n\",\n      \"b2c9d058-4475-4258-ad90-4334f3d024d5\\n\",\n      \"0bdafb3d-f7e3-4187-bc1d-63cf51fbda29\\n\",\n      \"answer\\n\",\n      \"{'content': '你好，我是百度研发的知识增强大语言模型，中文名是文心一言，英文名是ERNIE Bot。我能够与人对话互动，回答问题，协助创作，高效便捷地帮助人们获取信息、知识和灵感。', 'name': 'msg', 'mtype': 'dict', 'id': '0fc6c5f7-23bf-4f25-8555-69b4155908b7', 'extra': {}, 'token_usage': {'prompt_tokens': 2, 'completion_tokens': 42, 'total_tokens': 44}}\\n\",\n      \"2024-07-30 15:01:10.955875\\n\",\n      \"2024-07-30 15:01:10.955884\\n\",\n      \"0\\n\",\n      \"d6e433fc-ef4d-4ade-9a63-fec600e95481\\n\",\n      \"b2c9d058-4475-4258-ad90-4334f3d024d5\\n\",\n      \"6300b76b-2307-4ed3-9f6d-e61dfc621ff8\\n\",\n      \"query\\n\",\n      \"{'content': '请介绍一下你自己', 'name': 'msg', 'mtype': 'dict', 'id': '4f5cf6d1-976e-456e-a632-93c4b2550523', 'extra': {'search_db': [{'content': '带机器人回复：请你扮演一个智能搜索改写补全机器人，请根据User的搜索历史以及对应的搜索结果，对最后一句话先进行主语继承改写，然后进行上下文信息补全，注意：不要改变原文的意思，答案要尽可能简洁，不要直接回答该问题，不要输出多于的内容。\\\\\\\\n\\\\\\\\n例子：\\\\\\\\n搜索历史：\\\\\\\\nUser：今天上午你干嘛了\\\\\\\\nAssistant：去打篮球啦\\\\\\\\nUser：好玩吗？\\\\\\\\n答案：\\\\\\\\n打篮球好玩吗？', 'dataset_id': '1f777fa3-26db-4237-98d5-075abc07a84f', 'dataset_name': '多轮改写Prompt', 'document_id': '92e0f30d-1f30-46f0-8377-59ab0fb6eb93', 'document_name': '多轮改写prompt_带机器人回复.txt', 'id': '61657591-f610-44f0-84ec-67cedcb66447', 'mock_id': '1', 'position': 0, 'score': 0.511053, 'sentences': [{'content': '带机器人回复：请你扮演一个智能搜索改写补全机器人，请根据User的搜索历史以及对应的搜索结果，对最后一句话先进行主语继承改写，然后进行上下文信息补全，注意：不要改变原文的意思，答案要尽可能简洁，不要直接回答该问题，不要输出多于的内容。\\\\\\\\n\\\\\\\\n例子：\\\\\\\\n搜索历史：\\\\\\\\nUser：今天上午你干嘛了\\\\\\\\nAssistant：去打篮球啦\\\\\\\\nUser：好玩吗？', 'id': '1f777fa3-26db-4237-98d5-075abc07a84f-5992356ea8c0c05485388623218e134e-975ec17bbf8206762df7cfb24a5cd85e-97468bdaf0accef718118a2b742d5cc0', 'score': 0.628708, 'source': None}], 'title': '多轮改写prompt_带机器人回复.txt', 'tokens': 0, 'type': 'engine', 'word_count': 188}]}, 'token_usage': {'prompt_tokens': 321, 'completion_tokens': 3, 'total_tokens': 324}}\\n\",\n      \"2024-07-30 15:01:19.161269\\n\",\n      \"2024-07-30 15:01:19.161272\\n\",\n      \"0\\n\",\n      \"f0d76f00-93be-4d7c-a6b3-a9583fd677ad\\n\",\n      \"b2c9d058-4475-4258-ad90-4334f3d024d5\\n\",\n      \"6300b76b-2307-4ed3-9f6d-e61dfc621ff8\\n\",\n      \"answer\\n\",\n      \"{'content': '您好，我是文心一言，英文名是ERNIE Bot。我能够与人对话互动，回答问题，协助创作，高效便捷地帮助人们获取信息、知识和灵感。', 'name': 'msg', 'mtype': 'dict', 'id': 'f769c850-f4e5-4d02-a62a-766fd8c8132e', 'extra': {}, 'token_usage': {'prompt_tokens': 4, 'completion_tokens': 33, 'total_tokens': 37}}\\n\",\n      \"2024-07-30 15:01:19.163405\\n\",\n      \"2024-07-30 15:01:19.163411\\n\",\n      \"0\\n\",\n      \"936c394a-a3fa-48fd-a72f-b1778ebc35e4\\n\",\n      \"b2c9d058-4475-4258-ad90-4334f3d024d5\\n\",\n      \"5eb09e91-6496-44d9-9303-a4790e97f61c\\n\",\n      \"query\\n\",\n      \"{'content': '介绍一下baidu公司', 'name': 'msg', 'mtype': 'dict', 'id': '0ff3b298-7f01-4036-927d-722e00afaf33', 'extra': {'search_db': [{'content': '带机器人回复：请你扮演一个智能搜索改写补全机器人，请根据User的搜索历史以及对应的搜索结果，对最后一句话先进行主语继承改写，然后进行上下文信息补全，注意：不要改变原文的意思，答案要尽可能简洁，不要直接回答该问题，不要输出多于的内容。\\\\\\\\n\\\\\\\\n例子：\\\\\\\\n搜索历史：\\\\\\\\nUser：今天上午你干嘛了\\\\\\\\nAssistant：去打篮球啦\\\\\\\\nUser：好玩吗？\\\\\\\\n答案：\\\\\\\\n打篮球好玩吗？', 'dataset_id': '1f777fa3-26db-4237-98d5-075abc07a84f', 'dataset_name': '多轮改写Prompt', 'document_id': '92e0f30d-1f30-46f0-8377-59ab0fb6eb93', 'document_name': '多轮改写prompt_带机器人回复.txt', 'id': '61657591-f610-44f0-84ec-67cedcb66447', 'mock_id': '1', 'position': 0, 'score': 0.511053, 'sentences': [{'content': '带机器人回复：请你扮演一个智能搜索改写补全机器人，请根据User的搜索历史以及对应的搜索结果，对最后一句话先进行主语继承改写，然后进行上下文信息补全，注意：不要改变原文的意思，答案要尽可能简洁，不要直接回答该问题，不要输出多于的内容。\\\\\\\\n\\\\\\\\n例子：\\\\\\\\n搜索历史：\\\\\\\\nUser：今天上午你干嘛了\\\\\\\\nAssistant：去打篮球啦\\\\\\\\nUser：好玩吗？', 'id': '1f777fa3-26db-4237-98d5-075abc07a84f-5992356ea8c0c05485388623218e134e-975ec17bbf8206762df7cfb24a5cd85e-97468bdaf0accef718118a2b742d5cc0', 'score': 0.628708, 'source': None}], 'title': '多轮改写prompt_带机器人回复.txt', 'tokens': 0, 'type': 'engine', 'word_count': 188}]}, 'token_usage': {'prompt_tokens': 910, 'completion_tokens': 3, 'total_tokens': 913}}\\n\",\n      \"2024-07-30 15:02:21.551493\\n\",\n      \"2024-07-30 15:02:21.551529\\n\",\n      \"0\\n\",\n      \"5cd9d7ef-e26f-48ca-bd55-de2861cd4e84\\n\",\n      \"b2c9d058-4475-4258-ad90-4334f3d024d5\\n\",\n      \"5eb09e91-6496-44d9-9303-a4790e97f61c\\n\",\n      \"answer\\n\",\n      \"{'content': '百度公司是中国最大的互联网搜索引擎提供商之一，也是全球领先的AI公司。以下是对百度的详细介绍：\\\\n\\\\n一、公司概况\\\\n\\\\n百度（BIDU）是一家提供中文搜索引擎的公司，由李彦宏于2000年1月在北京中关村创立。经过多年的发展，百度已经从单一的搜索引擎服务商成功转型为内容生态与人工智能（AI）融合的互联网公司。百度的使命是“用科技让复杂的世界更简单”，其核心价值观包括“简单可依赖”。\\\\n\\\\n二、主要业务与产品\\\\n\\\\n1. 搜索业务：百度搜索是中国最大的中文搜索引擎，每天响应来自全球各地的搜索请求。除了传统的网页、图片、视频等搜索结果外，还提供了知识图谱、语音搜索等创新功能。\\\\n2. 移动生态业务：百度APP是百度移动生态的核心产品，围绕看、搜、听、问、购等核心场景为用户提供服务。此外，百度还拥有信息流、智能小程序、百度知道、百度文库等一系列移动生态产品。\\\\n3. 智能云业务：百度智能云是百度提供的云计算服务平台，为企业提供计算、存储、网络等基础设施服务以及人工智能、大数据等中间件服务。\\\\n4. 智能驾驶业务：百度在自动驾驶领域具有领先地位，其Apollo自动驾驶平台已经发展出多种商业模式，包括自动驾驶技术解决方案、百度造车以及共享无人车等。\\\\n\\\\n三、财务状况与业绩表现\\\\n\\\\n根据百度发布的财报显示，其业绩表现亮眼。例如，在2023年，百度总营收达到了显著的水平，其中百度核心收入同比增长。这主要得益于公司在广告市场的持续领先地位以及非在线营销收入的增长。同时，百度在研发投入方面也保持了较高水平，以推动其AI技术的持续创新和发展。\\\\n\\\\n四、AI技术与创新\\\\n\\\\n百度在AI技术方面取得了显著成果。其文心大模型已经升级到4.0版本，用户规模超过了1亿。这一技术使得百度具备了与全球领先的AI产品相媲美的能力。此外，百度还在文字生成视频等领域进行了战略投资，以进一步拓展其业务范围并加强在AI领域的领先地位。\\\\n\\\\n综上所述，百度公司作为中国最大的互联网搜索引擎提供商和全球领先的AI公司之一，凭借其强大的技术实力和创新能力，在搜索、移动生态、智能云和智能驾驶等领域取得了显著的成果。', 'name': 'msg', 'mtype': 'dict', 'id': 'c4f02188-1206-4c02-be8e-1c5481428003', 'extra': {}, 'token_usage': {'prompt_tokens': 4, 'completion_tokens': 456, 'total_tokens': 460}}\\n\",\n      \"2024-07-30 15:02:21.557667\\n\",\n      \"2024-07-30 15:02:21.557671\\n\",\n      \"0\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"cursor.execute(\\\"SELECT * FROM appbuilder_session_messages WHERE session_id = 'b2c9d058-4475-4258-ad90-4334f3d024d5';\\\")  \\n\",\n    \"for tuple in cursor.fetchall():\\n\",\n    \"    for message in tuple:\\n\",\n    \"        try: \\n\",\n    \"            message = json.loads(message)\\n\",\n    \"            print(message)\\n\",\n    \"        except:\\n\",\n    \"            print(message)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.12\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/components/asr.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {\n    \"collapsed\": true,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   },\n   \"source\": [\n    \"# 短语音识别组件\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"使用短语音识别组件对输入的语音文件进行识别，返回识别的文字。\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"\\n\",\n    \"2.安装appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%%\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"## 基本用法\\n\",\n    \"\\n\",\n    \"### 快速开始\\n\",\n    \"\\n\",\n    \"下面是短语音识别的代码示例：\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false\n   }\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import requests\\n\",\n    \"import appbuilder\\n\",\n    \"# 设置环境变量和初始化\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"\\n\",\n    \"asr = appbuilder.ASR()\\n\",\n    \"\\n\",\n    \"audio_file_url = \\\"https://bj.bcebos.com/v1/appbuilder/asr_test.pcm?authorization=bce-auth-v1\\\" \\\\\\n\",\n    \"                   \\\"%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A56%3A41Z%2F-1%2Fhost\\\" \\\\\\n\",\n    \"                   \\\"%2Fa6c4d2ca8a3f0259f4cae8ae3fa98a9f75afde1a063eaec04847c99ab7d1e411\\\"\\n\",\n    \"audio_data = requests.get(audio_file_url).content\\n\",\n    \"content_data = {\\\"audio_format\\\": \\\"pcm\\\", \\\"raw_audio\\\": audio_data, \\\"rate\\\": 16000}\\n\",\n    \"msg = appbuilder.Message(content_data)\\n\",\n    \"out = asr.run(msg)\\n\",\n    \"print(out.content)\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%%\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"## 参数说明\\n\",\n    \"\\n\",\n    \"### 鉴权配置\\n\",\n    \"使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\\n\",\n    \"```python\\n\",\n    \"# 设置环境中的TOKEN，以下示例略\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"bce-YOURTOKEN\\\"\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"### 初始化参数\\n\",\n    \"\\n\",\n    \"无\\n\",\n    \"\\n\",\n    \"### 调用参数\\n\",\n    \"\\n\",\n    \"|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\\n\",\n    \"|--------|--------|--------|----|--------|\\n\",\n    \"|message |String  |是 |输入的消息，用于模型的主要输入内容。这是一个必需的参数| Message(content={\\\"raw_audio\\\": b\\\"...\\\"}) |\\n\",\n    \"|audio_format|String|是 |定义语言文件的格式，包括\\\"pcm\\\"、\\\"wav\\\"、\\\"amr\\\"、\\\"m4a\\\"，默认值为\\\"pcm\\\"| pcm    |\\n\",\n    \"|rate|Integer|是 |定义录音采样率，固定值16000| 16000  |\\n\",\n    \"|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1|\\n\",\n    \"|retry|Integer|是 |HTTP重试次数| 3      |\\n\",\n    \"\\n\",\n    \"### 响应参数\\n\",\n    \"|参数名称 | 参数类型         |描述 |示例值|\\n\",\n    \"|--------|--------------|----|------|\\n\",\n    \"|result  | List[String] |返回结果|[\\\"北京科技馆。\\\"]|\\n\",\n    \"\\n\",\n    \"### 响应示例\\n\",\n    \"```json\\n\",\n    \"{\\\"result\\\": [\\\"北京科技馆。\\\"]}\\n\",\n    \"```\\n\",\n    \"### 错误码\\n\",\n    \"| 错误码 |描述|\\n\",\n    \"|---|---|\\n\",\n    \"| 0 |success|\\n\",\n    \"| 2000  |data empty|\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   }\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 2\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython2\",\n   \"version\": \"2.7.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 0\n}\n"
  },
  {
    "path": "cookbooks/components/gbi.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"f802e64d-4eaa-445d-a48a-1042a91bc394\",\n   \"metadata\": {\n    \"tags\": []\n   },\n   \"source\": [\n    \"# GBI\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"通过 GBI sdk 接口完成选表和问表的能力。 \\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"2.安装appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"id\": \"2939356f-61c2-42e9-9e0c-fc6729c193f6\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# !pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 18,\n   \"id\": \"4ccff03b-1567-4e8b-8e1f-9a5032690406\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import logging\\n\",\n    \"import os\\n\",\n    \"\\n\",\n    \"#  设置环境变量\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"***\\\"\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"aeb2fa55-075f-48df-a9fb-8b40d9900684\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 开发过程\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"1c3c5cee\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 设置表的 schema\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"id\": \"d7d6440c\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"SUPER_MARKET_SCHEMA = \\\"\\\"\\\"\\n\",\n    \"```\\n\",\n    \"CREATE TABLE `supper_market_info` (\\n\",\n    \"  `订单编号` varchar(32) DEFAULT NULL,\\n\",\n    \"  `订单日期` date DEFAULT NULL,\\n\",\n    \"  `邮寄方式` varchar(32) DEFAULT NULL,\\n\",\n    \"  `地区` varchar(32) DEFAULT NULL,\\n\",\n    \"  `省份` varchar(32) DEFAULT NULL,\\n\",\n    \"  `客户类型` varchar(32) DEFAULT NULL,\\n\",\n    \"  `客户名称` varchar(32) DEFAULT NULL,\\n\",\n    \"  `商品类别` varchar(32) DEFAULT NULL,\\n\",\n    \"  `制造商` varchar(32) DEFAULT NULL,\\n\",\n    \"  `商品名称` varchar(32) DEFAULT NULL,\\n\",\n    \"  `数量` int(11) DEFAULT NULL,\\n\",\n    \"  `销售额` int(11) DEFAULT NULL,\\n\",\n    \"  `利润` int(11) DEFAULT NULL\\n\",\n    \") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\\n\",\n    \"```\\n\",\n    \"\\\"\\\"\\\"\\n\",\n    \"\\n\",\n    \"PRODUCT_SALES_INFO = \\\"\\\"\\\"\\n\",\n    \"现有 mysql 表 product_sales_info, \\n\",\n    \"该表的用途是: 产品收入表\\n\",\n    \"```\\n\",\n    \"CREATE TABLE `product_sales_info` (\\n\",\n    \"  `年` int,\\n\",\n    \"  `月` int,\\n\",\n    \"  `产品名称` varchar,\\n\",\n    \"  `收入` decimal,\\n\",\n    \"  `非交付成本` decimal,\\n\",\n    \"  `含交付毛利` decimal\\n\",\n    \")\\n\",\n    \"```\\n\",\n    \"\\\"\\\"\\\"\\n\",\n    \"\\n\",\n    \"# schema 和表名的映射\\n\",\n    \"SCHEMA_MAPPING = {\\n\",\n    \"    \\\"supper_market_info\\\": SUPER_MARKET_SCHEMA,\\n\",\n    \"    \\\"PRODUCT_SALES_INFO\\\": PRODUCT_SALES_INFO\\n\",\n    \"}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"463254a1\",\n   \"metadata\": {},\n   \"source\": [\n    \"设置表的描述用于选表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"id\": \"7fefcae1\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"table_descriptions = {\\n\",\n    \"    \\\"supper_market_info\\\": \\\"超市营收明细表，包含超市各种信息等\\\",\\n\",\n    \"    \\\"product_sales_info\\\": \\\"产品销售表\\\"\\n\",\n    \"}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"a0aff843\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 选表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 19,\n   \"id\": \"41559341-fd7a-478c-a08b-1477d79e9d41\",\n   \"metadata\": {\n    \"ExecuteTime\": {\n     \"end_time\": \"2023-12-18T06:24:26.982459Z\",\n     \"start_time\": \"2023-12-18T06:23:53.771345Z\"\n    }\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"选的表是: ['supper_market_info']\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"from appbuilder.core.message import Message\\n\",\n    \"from appbuilder.core.components.gbi.basic import SessionRecord\\n\",\n    \"\\n\",\n    \"# 生成问表对象\\n\",\n    \"select_table = appbuilder.SelectTable(model_name=\\\"ERNIE-Bot 4.0\\\", table_descriptions=table_descriptions)\\n\",\n    \"query = \\\"列出超市中的所有数据\\\"\\n\",\n    \"msg = Message({\\\"query\\\": query})\\n\",\n    \"select_table_result_message = select_table(msg)\\n\",\n    \"print(f\\\"选的表是: {select_table_result_message.content}\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"16a8aa38-7a33-4e27-bca4-00900cfe1641\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 问表\\n\",\n    \"基于上面选出的表，通过获取表的 schema 进行问表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"id\": \"9f45ef5f-6206-4b31-83c4-3c8eb2c86925\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"sql: SELECT * FROM supper_market_info;\\n\",\n      \"-----------------\\n\",\n      \"llm result: ```sql\\n\",\n      \"SELECT * FROM supper_market_info;\\n\",\n      \"```\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"table_schemas = [SCHEMA_MAPPING[table_name] for table_name in select_table_result_message.content]\\n\",\n    \"gbi_nl2sql = appbuilder.NL2Sql(model_name=\\\"ERNIE-Bot 4.0\\\", table_schemas=table_schemas)\\n\",\n    \"nl2sql_result_message = gbi_nl2sql(Message({\\\"query\\\": \\\"列出超市中的所有数据\\\"}))\\n\",\n    \"print(f\\\"sql: {nl2sql_result_message.content.sql}\\\")\\n\",\n    \"print(\\\"-----------------\\\")\\n\",\n    \"print(f\\\"llm result: {nl2sql_result_message.content.llm_result}\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"b0409c46-e8c7-403a-a827-fcdc8e717be6\",\n   \"metadata\": {},\n   \"source\": [\n    \"设置 session\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"id\": \"a23b8cad-f426-4074-9311-c2c33aaea07b\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"session = list()\\n\",\n    \"session.append(SessionRecord(query=query, answer=nl2sql_result_message.content))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"22b3d877-f61f-4958-a084-7507a3017e17\",\n   \"metadata\": {},\n   \"source\": [\n    \"再次问表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 8,\n   \"id\": \"2adcb091-fb53-4364-b4d8-20564439ff51\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"sql: SELECT * FROM supper_market_info WHERE 商品类别 = '水果'\\n\",\n      \"-----------------\\n\",\n      \"llm result: ```sql\\n\",\n      \"SELECT * FROM supper_market_info WHERE 商品类别 = '水果'\\n\",\n      \"```\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"nl2sql_result_message2 = gbi_nl2sql(Message({\\\"query\\\": \\\"查看商品类别是水果的所有数据\\\", \\n\",\n    \"                                             \\\"session\\\": session}))\\n\",\n    \"print(f\\\"sql: {nl2sql_result_message2.content.sql}\\\")\\n\",\n    \"print(\\\"-----------------\\\")\\n\",\n    \"print(f\\\"llm result: {nl2sql_result_message2.content.llm_result}\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"9e0609ae-f2bc-43d3-9023-14e9f8618158\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 增加列选优化\\n\",\n    \"实际上数据中 \\\"商品类别\\\" 存储的是 \\\"新鲜水果\\\", 那么就可以通过列选的限制来优化 sql.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 9,\n   \"id\": \"2a7c7923-019e-4660-9e36-4431e9d2f3a6\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"sql: SELECT * FROM supper_market_info WHERE 商品类别 = '新鲜水果'\\n\",\n      \"-----------------\\n\",\n      \"llm result: ```sql\\n\",\n      \"SELECT * FROM supper_market_info WHERE 商品类别 = '新鲜水果'\\n\",\n      \"```\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"from appbuilder.core.components.gbi.basic import ColumnItem\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"column_constraint = [ColumnItem(ori_value=\\\"水果\\\", \\n\",\n    \"                               column_name=\\\"商品类别\\\", \\n\",\n    \"                               column_value=\\\"新鲜水果\\\", \\n\",\n    \"                               table_name=\\\"supper_market_info\\\", \\n\",\n    \"                               is_like=False)]\\n\",\n    \"\\n\",\n    \"nl2sql_result_message2 = gbi_nl2sql(Message({\\\"query\\\": \\\"查看商品类别是水果的所有数据\\\",\\n\",\n    \"                                    \\\"column_constraint\\\": column_constraint}))\\n\",\n    \"\\n\",\n    \"print(f\\\"sql: {nl2sql_result_message2.content.sql}\\\")\\n\",\n    \"print(\\\"-----------------\\\")\\n\",\n    \"print(f\\\"llm result: {nl2sql_result_message2.content.llm_result}\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"8385312c-aea1-42cd-b61b-a8d36f4f0665\",\n   \"metadata\": {},\n   \"source\": [\n    \"从上面我们看到，商品类别不在是 \\\"水果\\\" 而是 修订为 \\\"新鲜水果\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"6e98c414-8b2b-4187-a270-3117a4f431ff\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 增加知识优化\\n\",\n    \"当计算某些特殊知识的时候，大模型是不知道的，所以需要告诉大模型具体的知识，比如:\\n\",\n    \"利润率的计算方式: 利润/销售额\\n\",\n    \"可以将该知识注入。具体示例如下:\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 10,\n   \"id\": \"cade4693-29dc-431c-bf84-c6dc09104294\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 注入知识\\n\",\n    \"gbi_nl2sql.knowledge[\\\"利润率\\\"] = \\\"计算方式: 利润/销售额\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 11,\n   \"id\": \"1dc181e8-47a1-4b82-8bb5-ce3339be53f6\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"sql: SELECT 商品类别, SUM(利润)/SUM(销售额) AS 利润率\\n\",\n      \"FROM supper_market_info\\n\",\n      \"WHERE 商品类别 = '日用品'\\n\",\n      \"GROUP BY 商品类别\\n\",\n      \"-----------------\\n\",\n      \"llm result: ```sql\\n\",\n      \"SELECT 商品类别, SUM(利润)/SUM(销售额) AS 利润率\\n\",\n      \"FROM supper_market_info\\n\",\n      \"WHERE 商品类别 = '日用品'\\n\",\n      \"GROUP BY 商品类别\\n\",\n      \"```\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"nl2sql_result_message3 = gbi_nl2sql(Message({\\\"query\\\": \\\"列出商品类别是日用品的利润率\\\"}))\\n\",\n    \"print(f\\\"sql: {nl2sql_result_message3.content.sql}\\\")\\n\",\n    \"print(\\\"-----------------\\\")\\n\",\n    \"print(f\\\"llm result: {nl2sql_result_message3.content.llm_result}\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"c5570cd9-dbaf-45cd-ab03-1a7f92e7d0d4\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 调整 prompt 模版\\n\",\n    \"有时候，我们希望定义自己的prompt, 选表和问表两个环节都支持 prompt 模版的定制化，但是必须遵循对应的 prompt 模版的格式。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"6e3d4967-2b4c-437d-9d72-fb1b94bdcf59\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 选表 prompt 调整\\n\",\n    \"选表的 prompt template, 必须包含 \\n\",\n    \"1. {num} - 表的数量， 注意 {num} 有两个地方出现\\n\",\n    \"2. {table_desc} - 表的描述\\n\",\n    \"3. {query} - query\\n\",\n    \"\\n\",\n    \"注意: {num}, {table_desc}, {query} 表示的是占位符，**用户不需要在自定义的 prompt template 中将这些值填充上**，gbi 系统会自动根据 SelectTable 构造函数中提交的参数进行填充这些占位符，从而产生最后的给大模型的 prompt。注意 prompt template 和 prompt 的区别。\\n\",\n    \"\\n\",\n    \"* prompt template - 是带有占位符的 prompt, gbi 会根据具体参数填充到这些占位符，形成最终的 prompt\\n\",\n    \"* promt - 是将 prompt template 填充完占位符的结果。\\n\",\n    \"\\n\",\n    \"用户可以使用这些占位符重新设置自己的 prompt 模版，从而达到修改 prompt 的目的。\\n\",\n    \"具体请参考下面的 prompt template 示例:\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 12,\n   \"id\": \"2ae6ffbc-4237-4fb2-8168-480b81bfd873\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"SELECT_TABLE_PROMPT_TEMPLATE = \\\"\\\"\\\"\\n\",\n    \"你是一个专业的业务人员，下面有{num}张表，具体表名如下:\\n\",\n    \"{table_desc}\\n\",\n    \"请根据问题帮我选择上述1-{num}种的其中相关表并返回，可以为多表，也可以为单表,\\n\",\n    \"返回多张表请用“,”隔开\\n\",\n    \"返回格式请参考如下示例：\\n\",\n    \"问题:有多少个审核通过的投运单？\\n\",\n    \"回答: ```DWD_MAT_OPERATION```\\n\",\n    \"请严格参考示例只不要返回无关内容，直接给出最终答案后面的内容，分析步骤不要输出\\n\",\n    \"问题:{query}\\n\",\n    \"回答:\\n\",\n    \"\\\"\\\"\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 13,\n   \"id\": \"2bbbb375-6659-4ef0-82ff-a4ace9fdd4f0\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"选的表是: ['supper_market_info']\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"select_table4 = appbuilder.SelectTable(model_name=\\\"ERNIE-Bot 4.0\\\", \\n\",\n    \"                                          table_descriptions=table_descriptions,\\n\",\n    \"                                          prompt_template=SELECT_TABLE_PROMPT_TEMPLATE)\\n\",\n    \"\\n\",\n    \"select_table_result_message4 = select_table4(Message({\\\"query\\\":\\\"列出超市中的所有数据\\\"}))\\n\",\n    \"print(f\\\"选的表是: {select_table_result_message4.content}\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"4f3fd089-613b-4bdd-95ac-c87f89c0fc61\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 问表 prompt 调整\\n\",\n    \"问表的 prompt template 必须包含:\\n\",\n    \"1. {schema} - 表的 schema 信息, gbi系统使用构建 NL2Sql 对象的 table_schemas 成员来填充该占位符，在构造函数中需要填充该参数。\\n\",\n    \"2. {instrument} - 列选限制的信息, gbi系统会使用 `NL2Sql.__call__` 函数的 Message 中的 column_constraint 参数来填充该占位符\\n\",\n    \"3. {kg} - 知识, gbi系统使用构建 NL2Sql 对象的 knowledge  成员来填充该占位符，在构造函数中需要填充该参数。\\n\",\n    \"4. {date} - 时间， gbi系统会自动填充该占位符, 用户不需要提供\\n\",\n    \"5. {history_prompt} - 历史, gbi系统会使用 `NL2Sql.__call__` 函数的  Message 中的 session 参数来填充该占位符\\n\",\n    \"6. {query} - 当前问题，  gbi系统会使用 `NL2Sql.__call__` 函数的 Message 中的 query 参数来填充该占位符\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"注意: {schema}, {instrument}, {kg}, {date}, {history_prompt}, {query} 表示的是占位符，**用户不需要在自定义的 prompt template 中将这些值填充上**，gbi 系统会自动根据 `NL2Sql.__call__` 函数中提交的参数 或者 Nl2sql 的成员变量 进行填充这些占位符，从而产生最后的给大模型的 prompt。注意 prompt template 和 prompt 的区别。\\n\",\n    \"\\n\",\n    \"* prompt template - 是带有占位符的 prompt, gbi 会根据具体参数填充到这些占位符，形成最终的 prompt\\n\",\n    \"* promt - 是将 prompt template 填充完占位符的结果。\\n\",\n    \"\\n\",\n    \"用户可以使用这些占位符重新设置自己的 prompt 模版，从而达到修改 prompt 的目的。\\n\",\n    \"具体请参考下面的 prompt template 示例:\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 14,\n   \"id\": \"323fbe75-62ca-44ab-9ca2-9f747939a2b5\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"NL2SQL_PROMPT_TEMPLATE = \\\"\\\"\\\"\\n\",\n    \"  MySql 表 Schema 如下:\\n\",\n    \"  {schema}\\n\",\n    \"  请根据用户当前问题，联系历史信息，仅编写1个sql，其中 sql 语句需要使用```sql ```这种 markdown 形式给出。\\n\",\n    \"  请参考列选信息：\\n\",\n    \"  {instrument}\\n\",\n    \"  请参考知识:\\n\",\n    \"  {kg}\\n\",\n    \"  当前时间：{date}\\n\",\n    \"  历史信息如下:\\n\",\n    \"  {history_prompt}\\n\",\n    \"  当前问题：\\\"{query}\\\"\\n\",\n    \"  回答：\\n\",\n    \"\\\"\\\"\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 15,\n   \"id\": \"52436f03-e01c-456a-aaa0-5a7f1afcd9d2\",\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"sql: SELECT * FROM supper_market_info WHERE 商品类别 = '水果'\\n\",\n      \"-----------------\\n\",\n      \"llm result: ```sql\\n\",\n      \"SELECT * FROM supper_market_info WHERE 商品类别 = '水果'\\n\",\n      \"```\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"\\n\",\n    \"gbi_nl2sql5 = appbuilder.NL2Sql(model_name=\\\"ERNIE-Bot 4.0\\\", table_schemas=table_schemas, prompt_template=NL2SQL_PROMPT_TEMPLATE)\\n\",\n    \"nl2sql_result_message5 = gbi_nl2sql5(Message({\\\"query\\\": \\\"查看商品类别是水果的所有数据\\\"}))\\n\",\n    \"print(f\\\"sql: {nl2sql_result_message5.content.sql}\\\")\\n\",\n    \"print(\\\"-----------------\\\")\\n\",\n    \"print(f\\\"llm result: {nl2sql_result_message5.content.llm_result}\\\")\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.10.11\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/components/general_ocr.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"# 通用文字识别-高精度版组件\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"使用通用文字识别-高精度版组件对图片上的全部文字内容进行检测识别。\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"\\n\",\n    \"2.安装appbuilder-sdk\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false\n   }\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%%\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"## 基本用法\\n\",\n    \"\\n\",\n    \"### 快速开始\\n\",\n    \"\\n\",\n    \"以下是一个简单的例子来演示如何开始使用GeneralOCR组件：\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"import requests\\n\",\n    \"\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = '...'\\n\",\n    \"# 从BOS读取样例图片\\n\",\n    \"image_url = \\\"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\\\"\\\\\\n\",\n    \"    \\\"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\\\"\\\\\\n\",\n    \"    \\\"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\\\"\\\\\\n\",\n    \"    \\\"857a27513734d765495f89ffa5f73\\\"\\n\",\n    \"raw_image = requests.get(image_url).content\\n\",\n    \"general_ocr = appbuilder.GeneralOCR()\\n\",\n    \"out = general_ocr.run(appbuilder.Message(content={\\\"raw_image\\\": raw_image}))\\n\",\n    \"print(out.content)\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%%\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"##  参数说明\\n\",\n    \"\\n\",\n    \"### 鉴权说明\\n\",\n    \"使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\\n\",\n    \"```python\\n\",\n    \"# 设置环境中的TOKEN，以下示例略\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"bce-YOURTOKEN\\\"\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"### 初始化参数\\n\",\n    \"\\n\",\n    \"无\\n\",\n    \"\\n\",\n    \"### 调用参数\\n\",\n    \"\\n\",\n    \"| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\\n\",\n    \"|---------|---------|------|-----------------------------|------------------------------------------------|\\n\",\n    \"| message | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\\\"raw_image\\\": b\\\"待识别的图片字节流数据\\\"}) |\\n\",\n    \"|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1|\\n\",\n    \"| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\\n\",\n    \"\\n\",\n    \"### 响应参数\\n\",\n    \"| 参数名称         | 参数类型    | 描述      | 示例值                                               |\\n\",\n    \"|--------------|---------|---------|---------------------------------------------------|\\n\",\n    \"| words_result | Array[] | 返回结果    | [{\\\"words\\\":\\\"一站式企业级大模型平台，提供先进的生成式AI生产及应用全流程开发工具链\\\"}] |\\n\",\n    \"| + words      | String  | 识别结果字符串 | \\\"百度智能云千帆大模型平台\\\"                                    |\\n\",\n    \"\\n\",\n    \"### 响应示例\\n\",\n    \"#### 示例图片\\n\",\n    \"![示例图片](./image/general_ocr示例.png)\\n\",\n    \"#### 识别结果\\n\",\n    \"```json\\n\",\n    \"{\\n\",\n    \"    \\\"words_result\\\":[\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"一站式企业级大模型平台，提供先进的生成式AI生产及应用全流程开发工具链\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"百度智能云千帆大模型平台\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"文心大模型4.0已正式发布，个人和企业客户可通过百度智能云千帆大模型平台接入使用\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"立即使用\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"在线体验\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"使用文档\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"定价说明\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"千帆社区\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"常见概念、使用指导\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"定价、计费方式、计量说明\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"words\\\":\\\"大模型开发学习、交流社区\\\"\\n\",\n    \"        }\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"```\\n\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   }\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 2\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython2\",\n   \"version\": \"2.7.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 0\n}\n"
  },
  {
    "path": "cookbooks/components/object_recognize.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {\n    \"collapsed\": true,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   },\n   \"source\": [\n    \"# 通用物体和场景识别-高级版组件\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"使用通用物体和场景识别-高级版组件对图片上的物品或场景进行识别。\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"\\n\",\n    \"2.安装appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%%\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"## 基本用法\\n\",\n    \"\\n\",\n    \"### 快速开始\\n\",\n    \"\\n\",\n    \"以下是一个简单的例子来演示如何开始使用ObjectRecognition组件：\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false\n   }\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"import requests\\n\",\n    \"\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = '...'\\n\",\n    \"\\n\",\n    \"# 从BOS读取样例图片\\n\",\n    \"image_url = \\\"https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?\\\"\\\\\\n\",\n    \"    \\\"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\\\"\\\\\\n\",\n    \"    \\\"11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc\\\"\\\\\\n\",\n    \"    \\\"1ba1de0a8f072bc5a87102bd32f9e3\\\"\\n\",\n    \"raw_image = requests.get(image_url).content\\n\",\n    \"# 创建物体识别组件实例\\n\",\n    \"object_recognition = appbuilder.ObjectRecognition()\\n\",\n    \"# 执行识别操作并获取结果\\n\",\n    \"out = object_recognition.run(appbuilder.Message(content={\\\"raw_image\\\": raw_image}))\\n\",\n    \"print(out.content)\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%%\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"## 参数说明\\n\",\n    \"\\n\",\n    \"### 鉴权说明\\n\",\n    \"使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\\n\",\n    \"```python\\n\",\n    \"# 设置环境中的TOKEN，以下示例略\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"bce-YOURTOKEN\\\"\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"### 初始化参数\\n\",\n    \"无\\n\",\n    \"\\n\",\n    \"### 调用参数\\n\",\n    \"\\n\",\n    \"| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\\n\",\n    \"|---------|---------|------|-----------------------------|------------------------------------------------|\\n\",\n    \"| message | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\\\"raw_image\\\": b\\\"待识别的图片字节流数据\\\"}) |\\n\",\n    \"|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1|\\n\",\n    \"| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\\n\",\n    \"\\n\",\n    \"### 响应参数\\n\",\n    \"| 参数名称     | 参数类型    | 描述          | 示例值                                                 |\\n\",\n    \"|----------|---------|-------------|-----------------------------------------------------|\\n\",\n    \"| result   | Array[] | 返回结果        | [{\\\"keyword\\\":\\\"苹果\\\",\\\"score\\\":0.961247,\\\"root\\\":\\\"植物-蔷薇科\\\"}] |\\n\",\n    \"| +keyword | String  | 图片中的物体或场景名称 | \\\"苹果\\\"                                                |\\n\",\n    \"| +score\\t  | Float   | 置信度         | 0.961247                                            |\\n\",\n    \"| +root\\t   | String  | 识别结果的上层标签   | \\\"植物-蔷薇科\\\"                                            |\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 响应示例\\n\",\n    \"#### 示例图片\\n\",\n    \"![示例图片](./image/object_recognize示例.png)\\n\",\n    \"#### 识别结果\\n\",\n    \"```json\\n\",\n    \"{\\n\",\n    \"    \\\"result\\\":[\\n\",\n    \"        {\\n\",\n    \"            \\\"keyword\\\":\\\"苹果\\\",\\n\",\n    \"            \\\"score\\\":0.961247,\\n\",\n    \"            \\\"root\\\":\\\"植物-蔷薇科\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"keyword\\\":\\\"姬娜果\\\",\\n\",\n    \"            \\\"score\\\":0.740838,\\n\",\n    \"            \\\"root\\\":\\\"植物-其它\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"keyword\\\":\\\"梨子\\\",\\n\",\n    \"            \\\"score\\\":0.392218,\\n\",\n    \"            \\\"root\\\":\\\"商品-水果\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"keyword\\\":\\\"车厘子\\\",\\n\",\n    \"            \\\"score\\\":0.193986,\\n\",\n    \"            \\\"root\\\":\\\"植物-其它\\\"\\n\",\n    \"        },\\n\",\n    \"        {\\n\",\n    \"            \\\"keyword\\\":\\\"石榴\\\",\\n\",\n    \"            \\\"score\\\":0.000239,\\n\",\n    \"            \\\"root\\\":\\\"植物-千屈菜科\\\"\\n\",\n    \"        }\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"\\n\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   }\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 2\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython2\",\n   \"version\": \"2.7.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 0\n}\n"
  },
  {
    "path": "cookbooks/components/rag_with_baidusearch.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"f802e64d-4eaa-445d-a48a-1042a91bc394\",\n   \"metadata\": {\n    \"tags\": []\n   },\n   \"source\": [\n    \"# 百度搜索通用问答机器人\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"使用百度搜索，无需自建知识库，对用户的请求进行回答。\\n\",\n    \"\\n\",\n    \"用户可通过自定义人设来创建自己的问答机器人服务，并可通过开关配置拒答、澄清反问、重点强调、友好度提升、溯源等能力。\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"\\n\",\n    \"2.安装appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"2939356f-61c2-42e9-9e0c-fc6729c193f6\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"4ccff03b-1567-4e8b-8e1f-9a5032690406\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"\\n\",\n    \"#  设置环境变量\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"\\n\",\n    \"print(\\\"init done\\\")\\n\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"aeb2fa55-075f-48df-a9fb-8b40d9900684\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 开发过程\\n\",\n    \"### 配置 RAGWithBaiduSearch 组件\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"41559341-fd7a-478c-a08b-1477d79e9d41\",\n   \"metadata\": {\n    \"ExecuteTime\": {\n     \"end_time\": \"2023-12-18T06:24:26.982459Z\",\n     \"start_time\": \"2023-12-18T06:23:53.771345Z\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 人设指令\\n\",\n    \"instruction = appbuilder.Message(\\\"你是问答助手，在回答问题前需要加上“很高兴为您解答“\\\")\\n\",\n    \"\\n\",\n    \"# 能力开关\\n\",\n    \"reject = False # 拒答\\n\",\n    \"clarify = False # 澄清反问\\n\",\n    \"highlight = True # 重点强调\\n\",\n    \"friendly = False # 友好度提升\\n\",\n    \"cite = True # 溯源\\n\",\n    \"\\n\",\n    \"# 使用 DeepSeek-V3.1 模型\\n\",\n    \"component = appbuilder.RAGWithBaiduSearch(model=\\\"DeepSeek-V3.1\\\")\\n\",\n    \"query = appbuilder.Message(\\\"海淀区的面积是多少\\\")\\n\",\n    \"\\n\",\n    \"answer = component.run(\\n\",\n    \"    query, instruction=instruction, reject=reject, clarify=clarify, highlight=highlight, friendly=friendly, cite=cite, stream=False)\\n\",\n    \"\\n\",\n    \"print(f\\\"问答结果: {answer.content}\\\")\\n\",\n    \"print(f\\\"检索返回: {answer.extra}\\\")\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"5fc5bc38-6bc5-4187-a8fd-f802d77d89fa\",\n   \"metadata\": {},\n   \"source\": [\n    \"### (可选) 使用 AgentRuntime 启动 chainlit 页面调试\\n\",\n    \"这部分代码依赖 `appbuilder-sdk[serve]`，如果没有安装，可以执行下面的命令安装：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"a10737ec\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install 'appbuilder-sdk[serve]'\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"16a3abb2\",\n   \"metadata\": {},\n   \"source\": [\n    \"执行下面的代码，会启动一个 chainlit 页面，页面地址：0.0.0.0:8091\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"d514a628-5ae3-4269-aada-eaf8b21c3793\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"agent = appbuilder.AgentRuntime(component=component)\\n\",\n    \"# 启动 chainlit 服务\\n\",\n    \"agent.chainlit_demo(port=8091)\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"16a8aa38-7a33-4e27-bca4-00900cfe1641\",\n   \"metadata\": {},\n   \"source\": [\n    \"### (可选) 使用 AgentRuntime 启动 HTTP 服务\\n\",\n    \"这部分代码依赖 `appbuilder-sdk[serve]`，如果没有安装，可以执行下面的命令安装：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"f449fcb6\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install 'appbuilder-sdk[serve]'\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"d795f905\",\n   \"metadata\": {},\n   \"source\": [\n    \"执行下面的代码，会启动一个 HTTP 服务\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"9f45ef5f-6206-4b31-83c4-3c8eb2c86925\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"agent.serve(port=8092)\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"ccd4c48f\",\n   \"metadata\": {},\n   \"source\": [\n    \"测试服务\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"7313e122-5199-4c90-bc6c-ad04e206ccc9\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"curl --location 'http://0.0.0.0:8092/chat' \\\\\\n\",\n    \"--header 'Content-Type: application/json' \\\\\\n\",\n    \"--data '{\\n\",\n    \"    \\\"message\\\": \\\"海淀区的面积是多少\\\",\\n\",\n    \"    \\\"stream\\\": false\\n\",\n    \"}'\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.8.9\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/components/text_generation.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 文本生成\\n\",\n    \"\\n\",\n    \"## 说明\\n\",\n    \"本文展示了如何使用appbuilder内置组件以及如何快速构建全新的文本生成组件。以下是一个在营销场景下生成各种文本内容的样例。\\n\",\n    \"\\n\",\n    \"## 概览\\n\",\n    \"具体地，本样例按照以下流程进行文本生成：\\n\",\n    \"1. 使用**空模板**构建一个全新的文本生成组件：商品信息生成组件。\\n\",\n    \"2. 输入一个商品，使用新构建的商品信息生成组件生成该商品的商品信息。\\n\",\n    \"3. 基于生成的商品信息，使用内置的**问答对挖掘**组件生成问答对。生成的问答对可用于客服等。\\n\",\n    \"4. 基于生成的商品信息，使用内置的**风格写作**组件为该商品生成一份【小红书】文案。\\n\",\n    \"5. 使用内置的**标签抽取**组件对生成的文案进行标签抽取。抽取出的标签可用于检索文案。\\n\",\n    \"\\n\",\n    \"以下我们会演示如何实现我们自己的定制化能力。\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 流程演示\\n\",\n    \"### Step 0: 安装Python SDK\\n\",\n    \"我们的appbuilder支持使用pip安装（要求Python >= 3.8）：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"代码中需要配置用户的`APPBUILDER_TOKEN`。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"\\n\",\n    \"# 设置环境变量\\n\",\n    \"os.environ['APPBUILDER_TOKEN'] = '...'\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"安装成功后，我们就可以搭建我们自己的能力了。\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Step 1: 商品信息生成\\n\",\n    \"基于appbuilder提供的**空模板**，用户可以自定义文本生成组件以解决多样化的需求。这里我们构建一个**商品信息生成**组件以生成商品信息：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from appbuilder import Message, Playground\\n\",\n    \"\\n\",\n    \"# 输入到大模型中的prompt的模板\\n\",\n    \"prompt_template = \\\\\\n\",\n    \"'''输入商品名，我需要你为我生成该商品的商品信息。\\n\",\n    \"\\n\",\n    \"要求：\\n\",\n    \"- 你生成的商品信息应该包含多方面信息。\\n\",\n    \"- 开头和结尾不需要有其他与商品信息无关的内容。\\n\",\n    \"\\n\",\n    \"商品名：{product_name}\\n\",\n    \"商品信息：\\n\",\n    \"'''\\n\",\n    \"# 创建商品信息生成组件\\n\",\n    \"product_information_generation = Playground(prompt_template=prompt_template, model='DeepSeek-V3.1')\\n\",\n    \"\\n\",\n    \"# 获取商品信息\\n\",\n    \"# 填充prompt_template参数的参数映射表，需要与prompt_template对应\\n\",\n    \"prompt_template_kwargs = {\\n\",\n    \"    'product_name': '特斯拉Model Y'\\n\",\n    \"}\\n\",\n    \"response = product_information_generation(Message(prompt_template_kwargs), stream=False, temperature=0.5)\\n\",\n    \"product_information = response.content\\n\",\n    \"print(f'商品信息：\\\\n{product_information}')\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"输出结果：\\n\",\n    \"\\n\",\n    \"```\\n\",\n    \"商品信息：\\n\",\n    \"特斯拉Model Y是一款电动汽车，它拥有许多独特的功能和特性。以下是它的主要特点和优势：\\n\",\n    \"\\n\",\n    \"特斯拉Model Y是一款电动汽车，它采用纯电力驱动，没有排放和噪音污染，具有零启动加速、零延迟、零维护的特性。\\n\",\n    \"特斯拉Model Y拥有先进的自动驾驶技术，可以自动识别交通状况并做出相应的反应，大大提高了驾驶安全性。\\n\",\n    \"特斯拉Model Y的电池寿命长，充电效率高，可以在短时间内将电池充满，同时支持快速充电和慢充两种方式。\\n\",\n    \"特斯拉Model Y的外观设计独特，线条流畅，充满未来感，内部空间宽敞，乘坐舒适。\\n\",\n    \"特斯拉Model Y的价格相对较高，但性价比高，是一款非常值得购买的汽车。\\n\",\n    \"\\n\",\n    \"总之，特斯拉Model Y是一款集未来科技、安全性、舒适性和实用性于一体的电动汽车。\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Step 2: 问答对生成\\n\",\n    \"基于Step 1生成的商品信息我们生成一些问答对，这里我们使用内置的**问答对生成**组件。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from appbuilder import QAPairMining\\n\",\n    \"\\n\",\n    \"# 初始化问答对生成组件\\n\",\n    \"qa_pair_mining = QAPairMining(model='DeepSeek-V3.1')\\n\",\n    \"\\n\",\n    \"# 获取问答对\\n\",\n    \"response = qa_pair_mining(Message(product_information), stream=False, temperature=1e-10)\\n\",\n    \"qa_pairs = response.content\\n\",\n    \"print(f'问答对：\\\\n{qa_pairs}')\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"输出结果：\\n\",\n    \"\\n\",\n    \"```\\n\",\n    \"问答对：\\n\",\n    \"问题：特斯拉Model Y有什么特点？\\n\",\n    \"答案：特斯拉Model Y是一款电动汽车，它采用纯电力驱动，没有排放和噪音污染，具有零启动加速、零延迟、零维护的特性。\\n\",\n    \"\\n\",\n    \"问题：特斯拉Model Y有什么优势？\\n\",\n    \"答案：特斯拉Model Y拥有先进的自动驾驶技术，可以自动识别交通状况并做出相应的反应，大大提高了驾驶安全性。\\n\",\n    \"\\n\",\n    \"问题：特斯拉Model Y的电池寿命如何？\\n\",\n    \"答案：特斯拉Model Y的电池寿命长，充电效率高，可以在短时间内将电池充满，同时支持快速充电和慢充两种方式。\\n\",\n    \"\\n\",\n    \"问题：特斯拉Model Y的外观设计如何？\\n\",\n    \"答案：特斯拉Model Y的外观设计独特，线条流畅，充满未来感，内部空间宽敞，乘坐舒适。\\n\",\n    \"\\n\",\n    \"问题：特斯拉Model Y的价格是多少？\\n\",\n    \"答案：特斯拉Model Y的价格相对较高，但性价比高，是一款非常值得购买的汽车。\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Step 3: 营销文案生成\\n\",\n    \"基于Step 1生成的商品信息生成【小红书】文案，这里我们使用内置的**风格写作**组件。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from appbuilder import StyleWriting\\n\",\n    \"\\n\",\n    \"# 构造query\\n\",\n    \"query = \\\\\\n\",\n    \"f'''请你基于以下商品信息生成文案：\\n\",\n    \"{product_information}\\n\",\n    \"'''\\n\",\n    \"\\n\",\n    \"# 初始化风格写作组件\\n\",\n    \"style_writing = StyleWriting(model='DeepSeek-V3.1')\\n\",\n    \"\\n\",\n    \"# 获取小红书文案\\n\",\n    \"response = style_writing(Message(query), style_query='小红书', length=300)\\n\",\n    \"copywriting = response.content\\n\",\n    \"print(f'文案：\\\\n{copywriting}')\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"输出结果：\\n\",\n    \"\\n\",\n    \"```\\n\",\n    \"【特斯拉Model Y，一款值得拥有的未来科技之车！🚀】\\n\",\n    \"\\n\",\n    \"🚗Model Y作为一款电动汽车，具有许多独特的功能和特性。它采用纯电力驱动，没有排放和噪音污染，具有零启动加速、零延迟、零维护的特性。在城市道路上行驶，它就像是一阵清风，让你轻松应对各种交通状况。💨\\n\",\n    \"\\n\",\n    \"🚗特斯拉Model Y还拥有先进的自动驾驶技术，可以自动识别交通状况并做出相应的反应，大大提高了驾驶安全性。在行驶过程中，它就像是一位智能助手，为你提供安全、舒适的驾驶体验。🛡️\\n\",\n    \"\\n\",\n    \"🚗Model Y的电池寿命长，充电效率高，可以在短时间内将电池充满，同时支持快速充电和慢充两种方式。无论是长途旅行还是城市代步，它都能满足你的需求。⚡\\n\",\n    \"\\n\",\n    \"🚗Model Y的外观设计独特，线条流畅，充满未来感，内部空间宽敞，乘坐舒适。无论是驾驶还是乘坐，都能感受到它的豪华与舒适。🌟\\n\",\n    \"\\n\",\n    \"💰虽然价格相对较高，但性价比高，是一款非常值得购买的汽车。它不仅是一款车，更是一种生活方式的体现。🚗\\n\",\n    \"\\n\",\n    \"#未来科技 #特斯拉 #安全性 #舒适性 #实用性 #电动汽车\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### Step 4: 标签抽取\\n\",\n    \"基于Step 3生成的文案进行标签抽取，这里我们使用内置的**标签抽取**组件。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from appbuilder import TagExtraction\\n\",\n    \"\\n\",\n    \"# 初始化标签抽取组件\\n\",\n    \"tag_extraction = TagExtraction(model='DeepSeek-V3.1')\\n\",\n    \"\\n\",\n    \"# 获取标签\\n\",\n    \"response = tag_extraction(Message(copywriting), stream=False, temperature=1e-10)\\n\",\n    \"tags = response.content\\n\",\n    \"print(f'标签：\\\\n{tags}')\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"输出结果：\\n\",\n    \"\\n\",\n    \"```\\n\",\n    \"标签：\\n\",\n    \"1.特斯拉\\n\",\n    \"2.Model Y\\n\",\n    \"3.未来科技\\n\",\n    \"4.纯电力驱动\\n\",\n    \"5.自动驾驶\\n\",\n    \"6.电池寿命\\n\",\n    \"7.充电效率\\n\",\n    \"8.外观设计\\n\",\n    \"9.内部空间\\n\",\n    \"10.性价比\\n\",\n    \"```\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"base\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.8.8\"\n  },\n  \"orig_nbformat\": 4,\n  \"vscode\": {\n   \"interpreter\": {\n    \"hash\": \"bf58028eab835c8b5fcb0ca40b311fc21e6cba5ccf47f1b42d31ca2545cde380\"\n   }\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/components/translate.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {\n    \"collapsed\": true,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   },\n   \"source\": [\n    \"# 文本翻译-通用版组件\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"使用文本翻译组件将文本翻译成目标语言。\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"\\n\",\n    \"2.安装appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%%\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"## 基本用法\\n\",\n    \"\\n\",\n    \"### 快速开始\\n\",\n    \"\\n\",\n    \"通过如下示例代码可以快速开始使用文本翻译组件：\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = '...'\\n\",\n    \"\\n\",\n    \"translate = appbuilder.Translation()\\n\",\n    \"resp = translate(appbuilder.Message(\\\"你好\\\\n中国\\\"), from_lang=\\\"zh\\\", to_lang=\\\"en\\\")\\n\",\n    \"# 输出{'from_lang': 'zh', 'to_lang': 'en', 'trans_result': [{'src': '你好', 'dst': 'hello'}, {'src': '中国', 'dst': 'China'}]}\\n\",\n    \"print(resp.content)\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%%\\n\"\n    }\n   }\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"## 参数说明\\n\",\n    \"\\n\",\n    \"### 鉴权配置\\n\",\n    \"\\n\",\n    \"使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"# 设置环境中的TOKEN，以下示例略\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"bce-YOURTOKEN\\\"\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"### 初始化参数说明\\n\",\n    \"\\n\",\n    \"无\\n\",\n    \"\\n\",\n    \"### 调用参数说明\\n\",\n    \"\\n\",\n    \"|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\\n\",\n    \"|--------|--------|--------|----|--------|\\n\",\n    \"|message |obj:Message  |是 |输入的请求翻译文本| Message(\\\"你好\\\") |\\n\",\n    \"|from_lang|String|否 |翻译的源语言，默认为`auto`，表示自动检测语言。| zh    |\\n\",\n    \"|to_lang|Integer|否 |需要翻译的目标语言，默认为`en`，表示英语。| en  |\\n\",\n    \"|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1|\\n\",\n    \"|retry|Integer|否 |HTTP重试次数| 3      |\\n\",\n    \"\\n\",\n    \"### 响应参数\\n\",\n    \"\\n\",\n    \"|参数名称 |参数类型 |描述 |示例值|\\n\",\n    \"|--------|--------|----|------|\\n\",\n    \"|from_lang  |String  |翻译源语言| zh|\\n\",\n    \"|to_lang  |String  |翻译目标语言|en|\\n\",\n    \"|trans_result  |List[Object]  |返回结果|[{'src': '你好', 'dst': 'hello'}]|\\n\",\n    \"|trans_result[0].src  |String  |源文本|你好|\\n\",\n    \"|trans_result[0].dst  |String  |目标文本|hello|\\n\",\n    \"\\n\",\n    \"### 响应示例\\n\",\n    \"\\n\",\n    \"```json\\n\",\n    \"{\\n\",\n    \"  \\\"from_lang\\\": \\\"zh\\\",\\n\",\n    \"  \\\"to_lang\\\": \\\"en\\\",\\n\",\n    \"  \\\"trans_result\\\": [\\n\",\n    \"    {\\n\",\n    \"      \\\"src\\\": \\\"你好\\\",\\n\",\n    \"      \\\"dst\\\": \\\"hello\\\"\\n\",\n    \"    }\\n\",\n    \"  ]\\n\",\n    \"}\\n\",\n    \"```\\n\",\n    \"## 语种列表\\n\",\n    \"\\n\",\n    \"|名称 |代码 |语种检测|\\n\",\n    \"|----|-----|------|\\n\",\n    \"| 阿拉伯语           | ara  | 是   |\\n\",\n    \"| 爱尔兰语           | gle  | 是   |\\n\",\n    \"| 奥克语             | oci  | 是   |\\n\",\n    \"| 阿尔巴尼亚语        | alb  | 是   |\\n\",\n    \"| 阿尔及利亚阿拉伯语   | arq  | 否   |\\n\",\n    \"| 阿肯语             | aka  | 否   |\\n\",\n    \"| 阿拉贡语           | arg  | 否   |\\n\",\n    \"| 阿姆哈拉语          | amh  | 是   |\\n\",\n    \"| 阿萨姆语           | asm  | 是   |\\n\",\n    \"| 艾马拉语           | aym  | 否   |\\n\",\n    \"| 阿塞拜疆语          | aze  | 是   |\\n\",\n    \"| 阿斯图里亚斯语       | ast  | 是   |\\n\",\n    \"| 奥塞梯语            | oss  | 否   |\\n\",\n    \"| 爱沙尼亚语          | est  | 是   |\\n\",\n    \"| 奥杰布瓦语          | oji  | 否   |\\n\",\n    \"| 奥里亚语            | ori  | 是   |\\n\",\n    \"| 奥罗莫语            | orm  | 否   |\\n\",\n    \"| 波兰语              | pl   | 是   |\\n\",\n    \"| 波斯语              | per  | 是   |\\n\",\n    \"| 布列塔尼语          | bre  | 是   |\\n\",\n    \"| 巴什基尔语          | bak  | 否   |\\n\",\n    \"| 巴斯克语            | baq  | 是   |\\n\",\n    \"| 巴西葡萄牙语        | pot  | 否   |\\n\",\n    \"| 白俄罗斯语          | bel  | 是   |\\n\",\n    \"| 柏柏尔语            | ber  | 是   |\\n\",\n    \"| 邦板牙语            | pam  | 否   |\\n\",\n    \"| 保加利亚语          | bul  | 是   |\\n\",\n    \"| 北方萨米语          | sme  | 否   |\\n\",\n    \"| 北索托语           | ped  | 否   |\\n\",\n    \"| 本巴语             | bem  | 否   |\\n\",\n    \"| 比林语             | bli  | 否   |\\n\",\n    \"| 比斯拉马语          | bis  | 否   |\\n\",\n    \"| 俾路支语            | bal  | 否   |\\n\",\n    \"| 冰岛语              | ice  | 是   |\\n\",\n    \"| 波斯尼亚语          | bos  | 是   |\\n\",\n    \"| 博杰普尔语          | bho  | 否   |\\n\",\n    \"| 楚瓦什语            | chv  | 否   |\\n\",\n    \"| 聪加语             | tso  | 否   |\\n\",\n    \"| 丹麦语             | dan  | 是   |\\n\",\n    \"| 德语               | de   | 是   |\\n\",\n    \"| 鞑靼语              | tat  | 是   |\\n\",\n    \"| 掸语               | sha  | 否   |\\n\",\n    \"| 德顿语              | tet  | 否   |\\n\",\n    \"| 迪维希语            | div  | 否   |\\n\",\n    \"| 低地德语            | log  | 是   |\\n\",\n    \"| 俄语               | ru   | 是   |\\n\",\n    \"| 法语               | fra  | 是   |\\n\",\n    \"| 菲律宾语            | fil  | 是   |\\n\",\n    \"| 芬兰语              | fin  | 是   |\\n\",\n    \"| 梵语               | san  | 否   |\\n\",\n    \"| 弗留利语            | fri  | 否   |\\n\",\n    \"| 富拉尼语            | ful  | 否   |\\n\",\n    \"| 法罗语              | fao  |   否   |\\n\",\n    \"| 盖尔语              | gla  | 否   |\\n\",\n    \"| 刚果语              | kon  | 否   |\\n\",\n    \"| 高地索布语          | ups  | 否   |\\n\",\n    \"| 高棉语             | hkm  | 是   |\\n\",\n    \"| 格陵兰语           | kal  | 否   |\\n\",\n    \"| 格鲁吉亚语         | geo  | 是   |\\n\",\n    \"| 古吉拉特语         | guj  | 是   |\\n\",\n    \"| 古希腊语           | gra  | 否   |\\n\",\n    \"| 古英语             | eno  | 否   |\\n\",\n    \"| 瓜拉尼语           | grn  | 否   |\\n\",\n    \"| 韩语               | kor  | 是   |\\n\",\n    \"| 荷兰语             | nl   | 是   |\\n\",\n    \"| 胡帕语             | hup  | 否   |\\n\",\n    \"| 哈卡钦语           | hak  | 否   |\\n\",\n    \"| 海地语             | ht   | 否   |\\n\",\n    \"| 豪萨语             | hau  | 否   |\\n\",\n    \"| 黑山语             | mot  | 否   |\\n\",\n    \"| 吉尔吉斯语          | kir  | 否   |\\n\",\n    \"| 加利西亚语          | glg  | 是   |\\n\",\n    \"| 加拿大法语          | frn  | 否   |\\n\",\n    \"| 加泰罗尼亚语        | cat  | 是   |\\n\",\n    \"| 捷克语             | cs   | 是   |\\n\",\n    \"| 卡拜尔语           | kab  | 是   |\\n\",\n    \"| 卡纳达语           | kan  | 是   |\\n\",\n    \"| 卡努里语           | kau  | 否   |\\n\",\n    \"| 卡舒比语           | kah  | 否   |\\n\",\n    \"| 康瓦尔语           | cor  | 否   |\\n\",\n    \"| 科萨语             | xho  | 是   |\\n\",\n    \"| 科西嘉语           | cos  | 否   |\\n\",\n    \"| 克里克语           | cre  | 否   |\\n\",\n    \"| 克里米亚鞑靼语      | cri  | 否   |\\n\",\n    \"| 克林贡语           | kli  | 否   |\\n\",\n    \"| 克罗地亚语         | hrv  | 是   |\\n\",\n    \"| 克丘亚语           | que  | 否   |\\n\",\n    \"| 克什米尔语         | kas  | 否   |\\n\",\n    \"| 孔卡尼语           | kok  | 否   |\\n\",\n    \"| 库尔德语           | kur  | 是   |\\n\",\n    \"| 拉丁语             | lat  | 是   |\\n\",\n    \"| 老挝语             | lao  | 否   |\\n\",\n    \"| 罗马尼亚语          | rom  | 是   |\\n\",\n    \"| 拉特加莱语          | lag  | 否   |\\n\",\n    \"| 拉脱维亚语          | lav  | 是   |\\n\",\n    \"| 林堡语             | lim  | 否   |\\n\",\n    \"| 林加拉语           | lin  | 否   |\\n\",\n    \"| 卢干达语           | lug  | 否   |\\n\",\n    \"| 卢森堡语           | ltz  | 否   |\\n\",\n    \"| 卢森尼亚语         | ruy  | 否   |\\n\",\n    \"| 卢旺达语           | kin  | 是   |\\n\",\n    \"| 立陶宛语           | lit  | 是   |\\n\",\n    \"| 罗曼什语           | roh  | 否   |\\n\",\n    \"| 罗姆语             | ro   | 否   |\\n\",\n    \"| 逻辑语             | loj  | 否   |\\n\",\n    \"| 马来语             | may  | 是   |\\n\",\n    \"| 缅甸语             | bur  | 是   |\\n\",\n    \"| 马拉地语           | mar  | 否   |\\n\",\n    \"| 马拉加斯语          | mg   | 是   |\\n\",\n    \"| 马拉雅拉姆语         | mal  | 是   |\\n\",\n    \"| 马其顿语            | mac  | 是   |\\n\",\n    \"| 马绍尔语            | mah  | 否   |\\n\",\n    \"| 迈蒂利语            | mai  | 是   |\\n\",\n    \"| 曼克斯语            | glv  | 否   |\\n\",\n    \"| 毛里求斯克里奥尔语    | mau  | 否   |\\n\",\n    \"| 毛利语              | mao  | 否   |\\n\",\n    \"| 孟加拉语            | ben  | 是   |\\n\",\n    \"| 马耳他语            | mlt  | 是   |\\n\",\n    \"| 苗语               | hmn  | 否   |\\n\",\n    \"| 挪威语              | nor  | 是   |\\n\",\n    \"| 那不勒斯语           | nea  | 否   |\\n\",\n    \"| 南恩德贝莱语         | nbl  | 否   |\\n\",\n    \"| 南非荷兰语           | afr  | 是   |\\n\",\n    \"| 南索托语             | sot  | 否   |\\n\",\n    \"| 尼泊尔语             | nep  | 是   |\\n\",\n    \"| 葡萄牙语             | pt   | 是   |\\n\",\n    \"| 旁遮普语             | pan  | 是   |\\n\",\n    \"| 帕皮阿门托语          | pap  | 否   |\\n\",\n    \"| 普什图语             | pus  | 否   |\\n\",\n    \"| 齐切瓦语             | nya  | 否   |\\n\",\n    \"| 契维语               | twi  | 否   |\\n\",\n    \"| 切罗基语             | chr  | 否   |\\n\",\n    \"| 日语                 | jp   | 是   |\\n\",\n    \"| 瑞典语               | swe  | 是   |\\n\",\n    \"| 萨丁尼亚语            | srd  | 否   |\\n\",\n    \"| 萨摩亚语              | sm   | 否   |\\n\",\n    \"| 塞尔维亚-克罗地亚语     | sec  | 否   |\\n\",\n    \"| 塞尔维亚语             | srp  | 是   |\\n\",\n    \"| 桑海语                | sol  | 否   |\\n\",\n    \"| 僧伽罗语              | sin  | 是   |\\n\",\n    \"| 世界语                | epo  | 是   |\\n\",\n    \"| 书面挪威语             | nob  | 是   |\\n\",\n    \"| 斯洛伐克语             | sk   | 是   |\\n\",\n    \"| 斯洛文尼亚语           | slo  | 是   |\\n\",\n    \"| 斯瓦希里语             | swa  | 是   |\\n\",\n    \"| 索马里语               | som  | 是   |\\n\",\n    \"| 塞尔维亚语（西里尔）     | src  | 否   |\\n\",\n    \"| 泰语                  | th   | 是   |\\n\",\n    \"| 土耳其语               | tr   | 是   |\\n\",\n    \"| 塔吉克语               | tgk  | 是   |\\n\",\n    \"| 泰米尔语               | tam  | 是   |\\n\",\n    \"| 他加禄语               | tgl  | 是   |\\n\",\n    \"| 提格利尼亚语            | tir  | 否   |\\n\",\n    \"| 泰卢固语               | tel  | 是   |\\n\",\n    \"| 突尼斯阿拉伯语          | tua  | 否   |\\n\",\n    \"| 土库曼语               | tuk  | 否   |\\n\",\n    \"| 乌克兰语               | ukr  | 是   |\\n\",\n    \"| 瓦隆语                 | wln  | 是   |\\n\",\n    \"| 威尔士语               | wel  | 是   |\\n\",\n    \"| 文达语                 | ven  | 否   |\\n\",\n    \"| 沃洛夫语               | wol  | 否   |\\n\",\n    \"| 乌尔都语               | urd  | 是   |\\n\",\n    \"| 西班牙语               | spa  | 是   |\\n\",\n    \"| 希伯来语               | heb  | 是   |\\n\",\n    \"| 希腊语                 | el   | 是   |\\n\",\n    \"| 匈牙利语               | hu   | 是   |\\n\",\n    \"| 西弗里斯语              | fry  | 是   |\\n\",\n    \"| 西里西亚语              | sil  | 否   |\\n\",\n    \"| 希利盖农语              | hil  | 否   |\\n\",\n    \"| 下索布语                | los  | 否   |\\n\",\n    \"| 夏威夷语                | haw  | 否   |\\n\",\n    \"| 新挪威语                | nno  | 是   |\\n\",\n    \"| 西非书面语              | nqo  | 否   |\\n\",\n    \"| 信德语                 | snd  | 否   |\\n\",\n    \"| 修纳语                 | sna  | 否   |\\n\",\n    \"| 宿务语                 | ceb  | 否   |\\n\",\n    \"| 叙利亚语               | syr  | 否   |\\n\",\n    \"| 巽他语                 | sun  | 否   |\\n\",\n    \"| 英语                   | en   | 是   |\\n\",\n    \"| 印地语                 | hi   | 是   |\\n\",\n    \"| 印尼语                 | id   | 是   |\\n\",\n    \"| 意大利语               | it   | 是   |\\n\",\n    \"| 越南语                 | vie  | 是   |\\n\",\n    \"| 意第绪语               | yid  | 否   |\\n\",\n    \"| 因特语                 | ina  | 否   |\\n\",\n    \"| 亚齐语                 | ach  | 否   |\\n\",\n    \"| 印古什语               | ing  | 否   |\\n\",\n    \"| 伊博语                 | ibo  | 否   |\\n\",\n    \"| 伊多语                 | ido  | 否   |\\n\",\n    \"| 约鲁巴语               | yor  | 否   |\\n\",\n    \"| 亚美尼亚语             | arm  | 是   |\\n\",\n    \"| 伊努克提图特语          | iku  | 否   |\\n\",\n    \"| 中文(简体)             | zh   | 是   |\\n\",\n    \"| 中文(繁体)             | cht  | 是   |\\n\",\n    \"| 中文(文言文)           | wyw  | 是   |\\n\",\n    \"| 中文(粤语)             | yue  | 是   |\\n\",\n    \"| 扎扎其语               | zaz  | 否   |\\n\",\n    \"| 中古法语               | frm  | 否   |\\n\",\n    \"| 祖鲁语                 | zul  | 否   |\\n\",\n    \"| 爪哇语                 | jav  | 否   |\\n\",\n    \"\\n\",\n    \"\\n\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false,\n    \"pycharm\": {\n     \"name\": \"#%% md\\n\"\n    }\n   }\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 2\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython2\",\n   \"version\": \"2.7.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 0\n}\n"
  },
  {
    "path": "cookbooks/components/vdb_retriever.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# VectorDB\\n\",\n    \"\\n\",\n    \"## 概述\\n\",\n    \"\\n\",\n    \"VectorDB产品基于百度自研的“莫愁”向量数据库内核构建，充分利用了百度内部在分布式存储&数据库领域的成熟经验，实现了高可靠、高可用、强扩展和大规模的能力。详细介绍可以参考文档 [VectorDB](https://cloud.baidu.com/doc/VDB/s/Llrsoaz3l)\\n\",\n    \"\\n\",\n    \"## 应用场景\\n\",\n    \"\\n\",\n    \"### 场景一：信息相似度检索\\n\",\n    \"\\n\",\n    \"在当今的信息时代，快速而准确地检索文本和图片数据成为了一个重要挑战。我们的向量数据库针对这一挑战，提供了一个高效、安全且智能的解决方案。\\n\",\n    \"\\n\",\n    \"### 场景二：大模型问答记忆\\n\",\n    \"\\n\",\n    \"在利用大型语言模型进行问答交互时，保持模型与用户之间的会话连贯性是提高回答质量和相关性的关键。我们的解决方案通过实时存储和检索会话数据，有效地降低了幻觉情况的发生，提升了问答的准确性和用户体验。\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 场景三：大模型私域知识库\\n\",\n    \"\\n\",\n    \"在私有云环境中，构建专属的私域知识库是提升业务决策效率和精确性的关键。我们的向量数据库解决方案充分利用大模型的推理能力，针对私域数据提供定制化、高效的知识管理和检索服务。\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 开发上手\\n\",\n    \"\\n\",\n    \"### 第一步：环境准备，安装依赖\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 第二步：平台注册，设置Token\\n\",\n    \"\\n\",\n    \"- 2.1、注册AppBuilder平台账户，并申请Token，可参考文档：[AppBuilder官网创建密钥](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# AppBuilder平台注册后获取密钥\\n\",\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = '...'\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 2.2、同时您需要申请并开通VectorDB，并创建实例，具体操作请参考[VectorDB文档](https://cloud.baidu.com/doc/VDB/s/hlrsoazuf)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 第三步：创建并运行VectorDB，初始化构建索引\\n\",\n    \"\\n\",\n    \"补充说明：\\n\",\n    \"- `you_vdb_instance_id` 为VectorDB 实例ID，请替换为您的实例ID，在VectorDB控制台界面上可以查看\\n\",\n    \"- `your_api_key` 为您在VectorDB上申请的账户密钥，请替换为您自己的root账户密钥，在VectorDB控制台界面上可以查看\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"segments = appbuilder.Message([\\\"文心一言大模型\\\", \\\"百度在线科技有限公司\\\"])\\n\",\n    \"# 初始化构建索引\\n\",\n    \"vector_index = appbuilder.BaiduVDBVectorStoreIndex.from_params(\\n\",\n    \"    instance_id=\\\"your_instance_id\\\",\\n\",\n    \"    api_key=\\\"your_api_key\\\",\\n\",\n    \"    drop_exists=True,\\n\",\n    \")\\n\",\n    \"vector_index.add_segments(segments)\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 第四步：构建完毕索引后，可以通过retriever进行检索\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"query = appbuilder.Message(\\\"文心一言\\\")\\n\",\n    \"retriever = vector_index.as_retriever()\\n\",\n    \"res = retriever(query)\\n\",\n    \"print(res)\\n\",\n    \"\\n\",\n    \"# Message(name=msg, content=[{'text': '文心一言大模型', 'meta': '', 'score': 1.0}], mtype=list)\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"\\n\",\n    \"以上，便完成了VDB作为检索工具参与Appbuilder运行的流程使用，更多的VDB使用方式，请参考[VDB官方文档](https://cloud.baidu.com/doc/VDB/index.html) 与 [AppBuilder-retriever-baidu_vdb 文档](../appbuilder/core/components/retriever/baidu_vdb/README.md)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  },\n  \"orig_nbformat\": 4,\n  \"vscode\": {\n   \"interpreter\": {\n    \"hash\": \"31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6\"\n   }\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/agent/appbuilder_client.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"42eace26869295fb\",\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"source\": [\n    \"# Console AppBuilderClient使用示例\\n\",\n    \"\\n\",\n    \"整体使用流程包括以下两个环节：\\n\",\n    \"\\n\",\n    \"1. 在[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)创建并发布应用、获取应用ID、获取密钥\\n\",\n    \"2. 引用AppBuilderSDK代码，初始化AppBuilderClient实例、创建会话、上传文档（可选）、执行对话\\n\",\n    \"\\n\",\n    \"以下分别提供三个样例，快递查询小助手、植物识别小助手、篮球教练来说明使用流程，并提供了一个异步调用示例加速调用流程。注意以下流程用到的密钥可在图示位置中获取：\\n\",\n    \"<img src=\\\"./app_builder_resources/secret.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"## 1. 快递查询小助手\\n\",\n    \"\\n\",\n    \"[<span style=\\\"font-size:1.3em;\\\"> 快递查询小助手</span>](https://appbuilder.baidu.com/s/KVSXK)一键体验\\n\",\n    \"\\n\",\n    \"### 1.1 Console端应用配置与发布\\n\",\n    \"1 进入[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)，配置智能体指令、选择相应的工具组件、发布应用\\n\",\n    \"\\n\",\n    \"<img src=\\\"./app_builder_resources/express_assistant.png\\\" alt=\\\"drawing\\\" width=\\\"1200\\\"/>\\n\",\n    \"\\n\",\n    \"2 获取应用ID\\n\",\n    \"<img src=\\\"./app_builder_resources/app_id.png\\\" alt=\\\"drawing\\\" width=\\\"1200\\\"/>\\n\",\n    \"\\n\",\n    \"### 1.2 SDK代码调用示例\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"a6a9e2ba6159a8e4\",\n   \"metadata\": {\n    \"collapsed\": false,\n    \"is_executing\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"import os\\n\",\n    \"# 注意以下示例正确运行依赖的条件包括：\\n\",\n    \"# 1. 在百度智能云千帆AppBuilder官网使用AppBuilderClient创建应用且应用已发布\\n\",\n    \"# 2. 密钥正确有效\\n\",\n    \"# 3. 密钥需要与发布应用正确对应，即需要使用发布应用的账户下的密钥\\n\",\n    \"\\n\",\n    \"# 配置密钥与应用ID\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] =\\\"secret_key\\\"\\n\",\n    \"app_id = \\\"35f4fed3-d530-4dad-bc8e-f2150a4450be\\\"\\n\",\n    \"\\n\",\n    \"# 初始化Agent\\n\",\n    \"builder = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"\\n\",\n    \"# 创建会话ID\\n\",\n    \"conversation_id = builder.create_conversation()\\n\",\n    \"\\n\",\n    \"# 执行对话\\n\",\n    \"msg = builder.run(conversation_id, \\\"我的快递单号是：9858485940100; 请查询下此快递的状态\\\")\\n\",\n    \"print(\\\"快递查询助理回答内容：\\\", msg.content.answer)\\n\",\n    \"\\n\",\n    \"# 执行流式对话\\n\",\n    \"msg = builder.run(conversation_id, \\\"使用语音播报快递当前状态\\\", stream=True)\\n\",\n    \"for content in msg.content:\\n\",\n    \"    for ev in content.events:\\n\",\n    \"        if ev.content_type == \\\"audio\\\":\\n\",\n    \"            print(\\\"快递查询助理生成的音频播放地址：\\\", ev.detail[\\\"audio\\\"])\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"3e462991dab3283d\",\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"source\": [\n    \"## 2. 植物识别小助手\\n\",\n    \"[<span style=\\\"font-size:1.3em;\\\">植物识别小助手</span>](https://appbuilder.baidu.com/s/50zyD)一键体验\\n\",\n    \"\\n\",\n    \"### 2.1 Console端应用配置与发布\\n\",\n    \"1 进入[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)，配置智能体指令、选择相应的工具组件、发布应用\\n\",\n    \"<img src=\\\"./app_builder_resources/plant_recog_assistant.png\\\" alt=\\\"drawing\\\" width=\\\"1200\\\"/>\\n\",\n    \"\\n\",\n    \"2 获取应用ID, 同1.1\\n\",\n    \"\\n\",\n    \"### 2.2 SDK代码调用示例\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"4d051395a2aa1d11\",\n   \"metadata\": {\n    \"collapsed\": false,\n    \"is_executing\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 注意以下示例正确运行依赖的条件包括：\\n\",\n    \"# 1. 在百度智能云千帆AppBuilder官网使用AppBuilderClient创建应用且应用已发布\\n\",\n    \"# 2. 密钥正确有效\\n\",\n    \"# 3. 密钥需要与发布的应用正确对应，即需要使用发布应用的账户下的密钥\\n\",\n    \"\\n\",\n    \"# 配置密钥与应用ID\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] =\\\"...\\\"\\n\",\n    \"app_id = \\\"7016e0d3-451b-4a47-a818-dc0a16d4b496\\\" \\n\",\n    \"\\n\",\n    \"# 初始化Agent实例\\n\",\n    \"builder = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"\\n\",\n    \"# 创建会话ID\\n\",\n    \"conversation_id = builder.create_conversation()\\n\",\n    \"\\n\",\n    \"# 上传植物图片\\n\",\n    \"file_id = builder.upload_local_file(conversation_id, \\\"./app_builder_resources/tree.png\\\" )\\n\",\n    \"\\n\",\n    \"# 植物识别\\n\",\n    \"msg = builder.run(conversation_id, \\\"请识别图中的植物类别\\\", file_ids=[file_id])\\n\",\n    \"print(\\\"植物识别助理回答内容：\\\", msg.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"c112f09d6ce35d10\",\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"source\": [\n    \"## 3. 篮球教练\\n\",\n    \"[<span style=\\\"font-size:1.3em;\\\">篮球教练知识增强检索</span>](https://appbuilder.baidu.com/s/RCVEn)一键体验\\n\",\n    \"\\n\",\n    \"### 3.1 Console端应用配置与发布\\n\",\n    \"1 进入[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)，配置智能体指令、上传文档并关联知识库、发布应用\\n\",\n    \"<img src=\\\"./app_builder_resources/agent_builder_rag.png\\\" alt=\\\"drawing\\\" width=\\\"1200\\\"/>\\n\",\n    \"\\n\",\n    \"2 获取应用ID, 同1.1\\n\",\n    \"\\n\",\n    \"### 3.2 SDK代码调用示例\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"65e488aa883cf94e\",\n   \"metadata\": {\n    \"collapsed\": false,\n    \"is_executing\": true\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 注意以下示例正确运行依赖的条件包括：\\n\",\n    \"# 1. 在百度智能云千帆AppBuilder官网使用AppBuilderClient创建应用且应用已发布\\n\",\n    \"# 2. 密钥正确有效\\n\",\n    \"# 3. 密钥需要与发布的应用正确对应，即需要使用发布应用的账户下的密钥\\n\",\n    \"\\n\",\n    \"# 配置密钥与应用ID\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] =\\\"...\\\"\\n\",\n    \"app_id = \\\"4316a7cb-b6b2-4448-b6fa-ff131c484ec9\\\" \\n\",\n    \"\\n\",\n    \"# 初始化Agent实例\\n\",\n    \"builder = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"\\n\",\n    \"# 创建会话ID\\n\",\n    \"conversation_id = builder.create_conversation()\\n\",\n    \"\\n\",\n    \"# 执行对话\\n\",\n    \"msg = builder.run(conversation_id, \\\"突破技巧中如何运用胯下变向？\\\", )\\n\",\n    \"print(\\\"篮球教练回答内容：\\\", msg.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"7acaf6bb\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 4. 使用异步调用加速AppBuilderClient并发执行\\n\",\n    \"SDK提供异步调用工作流Agent的接口。下面以3章节的“篮球教练”为例，演示如何使用异步调用加速AppBuilderClient并发执行。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"fa87ffcb\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"import asyncio\\n\",\n    \"\\n\",\n    \"# 注意以下示例正确运行依赖的条件包括：\\n\",\n    \"# 1. 在百度智能云千帆AppBuilder官网使用AppBuilderClient创建应用且应用已发布\\n\",\n    \"# 2. 密钥正确有效\\n\",\n    \"# 3. 密钥需要与发布的应用正确对应，即需要使用发布应用的账户下的密钥\\n\",\n    \"\\n\",\n    \"# 配置密钥与应用ID\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"app_id = \\\"4316a7cb-b6b2-4448-b6fa-ff131c484ec9\\\"\\n\",\n    \"\\n\",\n    \"async def agent_run(client, conversation_id, text):\\n\",\n    \"    ans = await client.run(conversation_id, text, stream=True)\\n\",\n    \"    async for data in ans.content:\\n\",\n    \"        print(data)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"async def agent_sample():\\n\",\n    \"    client = appbuilder.AsyncAppBuilderClient(app_id)\\n\",\n    \"    conversation_id = await client.create_conversation()\\n\",\n    \"    file_id = await client.upload_local_file(\\n\",\n    \"        conversation_id, \\\"./python/tests/data/qa_appbuilder_client_demo.pdf\\\"\\n\",\n    \"    )\\n\",\n    \"    print(\\\"file_id is {}\\\".format(file_id))\\n\",\n    \"    task1 = asyncio.create_task(\\n\",\n    \"        agent_run(client, conversation_id, \\\"篮球技巧中如何三步上篮？\\\")\\n\",\n    \"    )\\n\",\n    \"    task2 = asyncio.create_task(\\n\",\n    \"        agent_run(client, conversation_id, \\\"突破技巧中如何运用胯下变向？\\\")\\n\",\n    \"    )\\n\",\n    \"    await asyncio.gather(task1, task2)\\n\",\n    \"    await client.http_client.session.close()\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(agent_sample())\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.11.8\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/agent/chatflow.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 前言 - 学习本项目你可以获得什么\\n\",\n    \"- 入门百度智能云千帆AppBuilder，搭建一个工作流Agent应用\\n\",\n    \"- 使用AppBuilder-SDK进行工作流Agent对话\\n\",\n    \"- 了解如何使用AppBuilder-SDK简化多轮对话的开发\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 1. 项目背景\\n\",\n    \"\\n\",\n    \"### 1.1、 什么是AppBuilder\\n\",\n    \"[百度智能云千帆AppBuilder](https://appbuilder.cloud.baidu.com/)（以下简称AppBuilder）是基于大模型搭建AI原生应用的工作台，旨在降低AI原生应用的开发门槛，赋能开发者和企业快速实现应用搭建。\\n\",\n    \"\\n\",\n    \"平台提供了RAG（检索增强生成）、Agent（智能体）等应用框架，内置了文档问答、表格问答、多轮对话、生成创作等多种应用组件，还包括百度搜索和百度地图等特色组件，以及文本处理、图像处理和语音处理等传统AI组件，支持零代码、低代码、全代码三种开发方式，满足不同开发能力的开发者和企业的场景需求。\\n\",\n    \"\\n\",\n    \"### 1.2、 什么是AppBuilder-SDK\\n\",\n    \"\\n\",\n    \"[百度智能云千帆AppBuilder-SDK](https://github.com/baidubce/app-builder)(以下简称AB-SDK)，百度智能云千帆AppBuilder-SDK是百度智能云千帆AppBuilder面向AI原生应用开发者提供的一站式开发平台的客户端SDK。\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page2.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 2. 创建工作流Agent应用并对话\\n\",\n    \"\\n\",\n    \"## 2.1 什么是工作流Agent?\\n\",\n    \"通过工作流编排的形式还原业务流程，每轮对话均严格按照工作流执行，提高了AI应用的可控性，并可编排出复杂业务流程，适用于客服、营销、生成、办公等高可控及高复杂度等场景。\\n\",\n    \"\\n\",\n    \"**工作流Agent无需设置角色人设，通过工作流编排的形式实现应用功能。**\\n\",\n    \"\\n\",\n    \"用户的所有对话均会触发此工作流处理，适用于严格按照流程执行的任务，例如：\\n\",\n    \"\\n\",\n    \"* 客服对话智能体，判断终端用户的意图后严格按照任务分支自动执行，无需大模型思考选择。\\n\",\n    \"* MBTI小助手，根据开发者编排的问题逐个提问，严格按照任务分支和结果执行后续的流程。\\n\",\n    \"\\n\",\n    \"工作流Agent支持用户配置工作流完成整个应用的对话过程，通过开始节点的Rawquery传入首轮对话，利用信息收集节点可以进行一组工作流中的多轮对话，最后以结束节点作为整个工作流结束的标志。开始节点和结束节点之前的完整流程构成一组工作流，每个信息收集节点都可以支持终端用户和应用的一次交互。\\n\",\n    \"\\n\",\n    \"## 2.2 创建工作流Agent应用-飞行客服小助手\\n\",\n    \"\\n\",\n    \"参考产品文档[飞行客服小助手](https://cloud.baidu.com/doc/AppBuilder/s/cm38k8nqr)创建示例应用。通过阅读本篇最佳实践，读者可以深度理解问答节点、信息处理节点、全局跳转节点的功能点和使用方式，搭建自己的工作流agent。对话效果如下：\\n\",\n    \"\\n\",\n    \"<p float=\\\"left\\\">\\n\",\n    \"  <img src=\\\"https://bce.bdstatic.com/doc/ai-cloud-share/AppBuilder/image_f11055c.png\\\" width=\\\"33%\\\" />\\n\",\n    \"  <img src=\\\"https://bce.bdstatic.com/doc/ai-cloud-share/AppBuilder/image_a680834.png\\\" width=\\\"33%\\\" /> \\n\",\n    \"  <img src=\\\"https://bce.bdstatic.com/doc/ai-cloud-share/AppBuilder/image_b602fef.png\\\" width=\\\"33%\\\" />\\n\",\n    \"</p>\\n\",\n    \"\\n\",\n    \"## 2.3 使用AppBuilder-SDK进行对话\\n\",\n    \"### 2.3.1 方式一：使用SDK直接对话（不推荐）\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"import os\\n\",\n    \"from appbuilder.core.console.appbuilder_client import data_class\\n\",\n    \"\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"# 设置环境变量\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"appbuilder.logger.setLoglevel(\\\"ERROR\\\")\\n\",\n    \"\\n\",\n    \"# 飞行客服小助手的应用id\\n\",\n    \"app_id = \\\"...\\\"\\n\",\n    \"# 初始化智能体\\n\",\n    \"client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"# 创建会话\\n\",\n    \"conversation_id = client.create_conversation()\\n\",\n    \"interrupt_ids = []\\n\",\n    \"\\n\",\n    \"msg = client.run(conversation_id, \\\"查天气\\\", stream=True)\\n\",\n    \"interrupt_event_id = None\\n\",\n    \"for ans in msg.content:\\n\",\n    \"    for event in ans.events:\\n\",\n    \"        if event.content_type == \\\"publish_message\\\":\\n\",\n    \"            print(event.detail.get(\\\"message\\\"))\\n\",\n    \"        if event.content_type == \\\"chatflow_interrupt\\\":\\n\",\n    \"            interrupt_event_id = event.detail.get(\\\"interrupt_event_id\\\")\\n\",\n    \"            break\\n\",\n    \"interrupt_ids.append(interrupt_event_id)\\n\",\n    \"\\n\",\n    \"msg2 = client.run(\\n\",\n    \"    conversation_id,\\n\",\n    \"    \\\"查航班\\\",\\n\",\n    \"    stream=True,\\n\",\n    \"    action=data_class.Action.create_resume_action(interrupt_event_id),\\n\",\n    \")\\n\",\n    \"interrupt_event_id = None\\n\",\n    \"for ans in msg2.content:\\n\",\n    \"    for event in ans.events:\\n\",\n    \"        if event.content_type == \\\"publish_message\\\":\\n\",\n    \"            print(event.detail.get(\\\"message\\\"))\\n\",\n    \"        if event.content_type == \\\"chatflow_interrupt\\\":\\n\",\n    \"            interrupt_event_id = event.detail.get(\\\"interrupt_event_id\\\")\\n\",\n    \"            break\\n\",\n    \"        interrupt_ids.append(interrupt_event_id)\\n\",\n    \"\\n\",\n    \"msg3 = client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"CA1234\\\",\\n\",\n    \"    stream=True,\\n\",\n    \"    action=data_class.Action.create_resume_action(interrupt_ids.pop()),\\n\",\n    \")\\n\",\n    \"interrupt_event_id = None\\n\",\n    \"for ans in msg3.content:\\n\",\n    \"    for event in ans.events:\\n\",\n    \"        if event.content_type == \\\"text\\\":\\n\",\n    \"            print(event.detail.get(\\\"text\\\"))\\n\",\n    \"        if event.content_type == \\\"chatflow_interrupt\\\":\\n\",\n    \"            interrupt_event_id = event.detail.get(\\\"interrupt_event_id\\\")\\n\",\n    \"            break\\n\",\n    \"interrupt_ids.append(interrupt_event_id)\\n\",\n    \"\\n\",\n    \"msg4 = client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"北京的\\\",\\n\",\n    \"    stream=True,\\n\",\n    \"    action=data_class.Action.create_resume_action(interrupt_ids.pop()),\\n\",\n    \")\\n\",\n    \"has_multiple_dialog_event = False\\n\",\n    \"for ans in msg4.content:\\n\",\n    \"    for event in ans.events:\\n\",\n    \"        if event.content_type == \\\"text\\\":\\n\",\n    \"            print(event.detail.get(\\\"text\\\"))\\n\",\n    \"        if event.content_type == \\\"multiple_dialog_event\\\":\\n\",\n    \"            has_multiple_dialog_event = True\\n\",\n    \"            break\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.3.2 方式二 实现自己的EventHandler，更方便地进行对话(推荐)\\n\",\n    \"直接调用处理较为繁琐。SDK提供了使用AppBuilderEventHandler简化tool_call操作的功能。**继承AppBuilderEventHandler类，并实现针对各类型event的处理方法。**\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"from appbuilder.core.console.appbuilder_client.event_handler import (\\n\",\n    \"    AppBuilderEventHandler,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"class MyEventHandler(AppBuilderEventHandler):\\n\",\n    \"    def __init__(self):\\n\",\n    \"        super().__init__()\\n\",\n    \"        self.interrupt_ids = []\\n\",\n    \"\\n\",\n    \"    def handle_content_type(self, run_context, run_response):\\n\",\n    \"        interrupt_event_id = None\\n\",\n    \"        event = run_response.events[-1]\\n\",\n    \"        if event.content_type == \\\"chatflow_interrupt\\\":\\n\",\n    \"            interrupt_event_id = event.detail.get(\\\"interrupt_event_id\\\")\\n\",\n    \"        if interrupt_event_id is not None:\\n\",\n    \"            self.interrupt_ids.append(interrupt_event_id)\\n\",\n    \"\\n\",\n    \"    def _create_action(self):\\n\",\n    \"        if len(self.interrupt_ids) == 0:\\n\",\n    \"            return None\\n\",\n    \"        event_id = self.interrupt_ids.pop()\\n\",\n    \"        return {\\n\",\n    \"            \\\"action_type\\\": \\\"resume\\\",\\n\",\n    \"            \\\"parameters\\\": {\\\"interrupt_event\\\": {\\\"id\\\": event_id, \\\"type\\\": \\\"chat\\\"}},\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"    def run(self, query=None):\\n\",\n    \"        super().new_dialog(\\n\",\n    \"            query=query,\\n\",\n    \"            action=self._create_action(),\\n\",\n    \"        )\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def main():\\n\",\n    \"    # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"    # 设置环境变量\\n\",\n    \"    os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"    appbuilder.logger.setLoglevel(\\\"DEBUG\\\")\\n\",\n    \"\\n\",\n    \"    # 飞行客服小助手的应用id\\n\",\n    \"    app_id = \\\"...\\\"\\n\",\n    \"    # 初始化智能体\\n\",\n    \"    client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"    conversation_id = client.create_conversation()\\n\",\n    \"\\n\",\n    \"    event_handler = MyEventHandler()\\n\",\n    \"    event_handler.init(\\n\",\n    \"        appbuilder_client=client,\\n\",\n    \"        conversation_id=conversation_id,\\n\",\n    \"        stream=True,\\n\",\n    \"        query=\\\"查天气\\\",\\n\",\n    \"    )\\n\",\n    \"    for data in event_handler:\\n\",\n    \"        pass\\n\",\n    \"    event_handler.run(\\n\",\n    \"        query=\\\"查航班\\\",\\n\",\n    \"    )\\n\",\n    \"    for data in event_handler:\\n\",\n    \"        pass\\n\",\n    \"    event_handler.run(\\n\",\n    \"        query=\\\"CA1234\\\",\\n\",\n    \"    )\\n\",\n    \"    for data in event_handler:\\n\",\n    \"        pass\\n\",\n    \"    event_handler.run(\\n\",\n    \"        query=\\\"北京的\\\",\\n\",\n    \"    )\\n\",\n    \"    for data in event_handler:\\n\",\n    \"        pass\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    main()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.3.3 方式三、实现自己的EventHandler，更方便地进行多轮对话（推荐）\\n\",\n    \"SDK提供了run_multiple_dialog_with_handler方法来进行多轮对话，按需传入iterable对象(queries、actions等参数)，即可一次调用完成多轮对话。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"from appbuilder.core.console.appbuilder_client.event_handler import (\\n\",\n    \"    AppBuilderEventHandler,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"class MyEventHandler(AppBuilderEventHandler):\\n\",\n    \"    def __init__(self):\\n\",\n    \"        super().__init__()\\n\",\n    \"        self.interrupt_ids = []\\n\",\n    \"\\n\",\n    \"    def handle_content_type(self, run_context, run_response):\\n\",\n    \"        interrupt_event_id = None\\n\",\n    \"        event = run_response.events[-1]\\n\",\n    \"        if event.content_type == \\\"chatflow_interrupt\\\":\\n\",\n    \"            interrupt_event_id = event.detail.get(\\\"interrupt_event_id\\\")\\n\",\n    \"        if interrupt_event_id is not None:\\n\",\n    \"            self.interrupt_ids.append(interrupt_event_id)\\n\",\n    \"\\n\",\n    \"    def _create_action(self):\\n\",\n    \"        if len(self.interrupt_ids) == 0:\\n\",\n    \"            return None\\n\",\n    \"        event_id = self.interrupt_ids.pop()\\n\",\n    \"        return {\\n\",\n    \"            \\\"action_type\\\": \\\"resume\\\",\\n\",\n    \"            \\\"parameters\\\": {\\\"interrupt_event\\\": {\\\"id\\\": event_id, \\\"type\\\": \\\"chat\\\"}},\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"    def gen_action(self):\\n\",\n    \"        while True:\\n\",\n    \"            yield self._create_action()\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def main():\\n\",\n    \"    # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"    # 设置环境变量\\n\",\n    \"    os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"    appbuilder.logger.setLoglevel(\\\"DEBUG\\\")\\n\",\n    \"\\n\",\n    \"    # 飞行客服小助手的应用id\\n\",\n    \"    app_id = \\\"...\\\"\\n\",\n    \"    # 初始化智能体\\n\",\n    \"    client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"    conversation_id = client.create_conversation()\\n\",\n    \"\\n\",\n    \"    queries = [\\\"查天气\\\", \\\"查航班\\\", \\\"CA1234\\\", \\\"北京的\\\"]\\n\",\n    \"    event_handler = MyEventHandler()\\n\",\n    \"    event_handler = client.run_multiple_dialog_with_handler(\\n\",\n    \"        conversation_id=conversation_id,\\n\",\n    \"        queries=queries,\\n\",\n    \"        event_handler=event_handler,\\n\",\n    \"        stream=True,\\n\",\n    \"        actions=event_handler.gen_action(),\\n\",\n    \"    )\\n\",\n    \"    for data in event_handler:\\n\",\n    \"        for ans in data:\\n\",\n    \"            pass\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    main()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.3.4 异步调用工作流Agent\\n\",\n    \"SDK提供异步调用工作流Agent的接口，下面是一个异步调用工作流Agent的实例。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\\n\",\n    \"#\\n\",\n    \"# Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n\",\n    \"# you may not use this file except in compliance with the License.\\n\",\n    \"# You may obtain a copy of the License at\\n\",\n    \"#\\n\",\n    \"#     http://www.apache.org/licenses/LICENSE-2.0\\n\",\n    \"#\\n\",\n    \"# Unless required by applicable law or agreed to in writing, software\\n\",\n    \"# distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n\",\n    \"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n\",\n    \"# See the License for the specific language governing permissions and\\n\",\n    \"# limitations under the License.\\n\",\n    \"import os\\n\",\n    \"import asyncio\\n\",\n    \"import appbuilder\\n\",\n    \"from appbuilder.core.console.appbuilder_client.async_event_handler import (\\n\",\n    \"    AsyncAppBuilderEventHandler,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"class MyEventHandler(AsyncAppBuilderEventHandler):\\n\",\n    \"    def __init__(self):\\n\",\n    \"        super().__init__()\\n\",\n    \"        self.interrupt_ids = []\\n\",\n    \"\\n\",\n    \"    async def handle_content_type(self, run_context, run_response):\\n\",\n    \"        interrupt_event_id = None\\n\",\n    \"        event = run_response.events[-1]\\n\",\n    \"        if event.content_type == \\\"chatflow_interrupt\\\":\\n\",\n    \"            interrupt_event_id = event.detail.get(\\\"interrupt_event_id\\\")\\n\",\n    \"        if interrupt_event_id is not None:\\n\",\n    \"            self.interrupt_ids.append(interrupt_event_id)\\n\",\n    \"\\n\",\n    \"    def _create_action(self):\\n\",\n    \"        if len(self.interrupt_ids) == 0:\\n\",\n    \"            return None\\n\",\n    \"        event_id = self.interrupt_ids.pop()\\n\",\n    \"        return {\\n\",\n    \"            \\\"action_type\\\": \\\"resume\\\",\\n\",\n    \"            \\\"parameters\\\": {\\\"interrupt_event\\\": {\\\"id\\\": event_id, \\\"type\\\": \\\"chat\\\"}},\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"    async def run(self, query=None):\\n\",\n    \"        await super().new_dialog(\\n\",\n    \"            query=query,\\n\",\n    \"            action=self._create_action(),\\n\",\n    \"        )\\n\",\n    \"\\n\",\n    \"    def gen_action(self):\\n\",\n    \"        while True:\\n\",\n    \"            yield self._create_action()\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"async def agent_run():\\n\",\n    \"    # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"    # 设置环境变量\\n\",\n    \"    os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"    appbuilder.logger.setLoglevel(\\\"DEBUG\\\")\\n\",\n    \"\\n\",\n    \"    # 飞行客服小助手的应用id\\n\",\n    \"    app_id = \\\"...\\\"\\n\",\n    \"    client = appbuilder.AsyncAppBuilderClient(app_id)\\n\",\n    \"    conversation_id = await client.create_conversation()\\n\",\n    \"    event_handler = MyEventHandler()\\n\",\n    \"    queries = [\\\"查天气\\\", \\\"查航班\\\", \\\"CA1234\\\", \\\"北京的\\\"]\\n\",\n    \"    event_handler = client.run_multiple_dialog_with_handler(\\n\",\n    \"        conversation_id=conversation_id,\\n\",\n    \"        queries=queries,\\n\",\n    \"        event_handler=event_handler,\\n\",\n    \"        stream=False,\\n\",\n    \"        actions=event_handler.gen_action(),\\n\",\n    \"    )\\n\",\n    \"    async for data in event_handler:\\n\",\n    \"        async for answer in data:\\n\",\n    \"            print(answer)\\n\",\n    \"\\n\",\n    \"    await client.http_client.session.close()\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(agent_run())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 3、项目总结\\n\",\n    \"\\n\",\n    \"本项目最终完成了一个工作流Agent应用的创建，并使用Appbuilder-SDK进行对话功能。\\n\",\n    \"\\n\",\n    \"希望您可以不吝`Star`，给`AppBuilder-SDK`一些鼓励，期待您的`PR`，一起共建AIAgent生态。\\n\",\n    \"\\n\",\n    \"Github地址：https://github.com/baidubce/app-builder\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page10.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"最后，您也可以进入`AppBuilder-SDK`的WX交流群，和大家一起交流AppBuilder使用及开发心得。\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/wechat_group.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"testenv\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.20\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/agent/tool_call.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page1.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 前言 - 学习本项目你可以获得什么\\n\",\n    \"- 理论学习：了解AIAgent的基础知识\\n\",\n    \"- 上手实操：深入了解Agent中的FunctionCall运行流程\\n\",\n    \"- 上手实操：入门百度智能云千帆AppBuilder，在十分钟内打造一个个性化AIAgent\\n\",\n    \"- 上手实操：使用AppBuilder-SDK打造一个端云组件联动的进阶Agent\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 1. 项目背景\\n\",\n    \"\\n\",\n    \"### 1.1、 什么是AppBuilder\\n\",\n    \"[百度智能云千帆AppBuilder](https://appbuilder.cloud.baidu.com/)（以下简称AppBuilder）是基于大模型搭建AI原生应用的工作台，旨在降低AI原生应用的开发门槛，赋能开发者和企业快速实现应用搭建。\\n\",\n    \"\\n\",\n    \"平台提供了RAG（检索增强生成）、Agent（智能体）等应用框架，内置了文档问答、表格问答、多轮对话、生成创作等多种应用组件，还包括百度搜索和百度地图等特色组件，以及文本处理、图像处理和语音处理等传统AI组件，支持零代码、低代码、全代码三种开发方式，满足不同开发能力的开发者和企业的场景需求。\\n\",\n    \"\\n\",\n    \"### 1.2、 什么是AppBuilder-SDK\\n\",\n    \"\\n\",\n    \"[百度智能云千帆AppBuilder-SDK](https://github.com/baidubce/app-builder)(以下简称AB-SDK)，百度智能云千帆AppBuilder-SDK是百度智能云千帆AppBuilder面向AI原生应用开发者提供的一站式开发平台的客户端SDK。\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page2.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 2. 项目介绍 - 通过ToolCall实现端云组件联动的Agent\\n\",\n    \"### 2.1、 什么是Agent\\n\",\n    \"\\n\",\n    \"AIAgent是能够感知环境，基于目标进行决策并执行动作的智能化应用。不同于传统人工智能应用（主要指以规则引擎、机器学习、深度学习等技术为核心）和RPA机器人，AIAgent能够基于目标和对现状能力的认知，在环境约束中，依赖特定资源和现有工具，找到行动规则并将行动拆解为必要的步骤，自主执行步骤，达成目标。\\n\",\n    \"\\n\",\n    \"AIAgent具备三个核心能力：独立思考、自主执行、持续迭代。\\n\",\n    \"- 独立思考是指AlAgent能够根据给定任务目标和约束条件，进行任务规划和问题拆解，形成执行步骤（即工作流）；\\n\",\n    \"- 自主执行是指AlAgent能够调取各类组件和工具，按照执行步骤依次执行，实现任务目标；\\n\",\n    \"- 持续选代是指AlAgent能够自动记录任务目标、工作流和执行结果，基于结果反馈，沉淀专家知识和案例。\\n\",\n    \"\\n\",\n    \"AICopilot、AIAgent、大模型等名词在各类文章上经常混淆，此处简要说明下三者的区别。大模型一般是指大模型技术，AlAgent和Al Copilot是基于大模型技术的智能化应用，AlAgent和AlCopilot在功能和场景上存在差别。\\n\",\n    \"\\n\",\n    \"自主性是AIAgent和AI Copilot之间最大的区别。AI Copilot是“副驾驶”，只是提供建议而非决策，AIAgent是“主驾驶”，需要真正做出决策并开展行动。\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page3.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"### 2.2、 什么是ToolCall\\n\",\n    \"\\n\",\n    \"解释该问题，需要了解以下的知识点：`Agent工具` -> `FunctionCall` - `ToolCall`\\n\",\n    \"\\n\",\n    \"AIAgent 有四大核心组件：记忆、规划、工具和执行。其中工具部分，与我们的开发关系最密切，在各类Agent开发平台/工具中，常被称为“组件”、\\\"插件\\\"、\\\"能力\\\"等.\\n\",\n    \"\\n\",\n    \"关于Agent的工具的定义与分类，如下图~\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page4.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"Agent使用工具的流程，一般称为`FunctionCall`，最早由OpenAI提出，并在[Assistant API](https://platform.openai.com/docs/assistants/overview)中广泛应用。\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"ToolCall，则是AppBuilder平台提出的一种进阶的FunctionCall，本质与OpenAI的FunctionCall一致，但具有以下两个特点：\\n\",\n    \"\\n\",\n    \"- **端云组件联动**： Agent 调用工具时，可以同时调用云端和本地组件。\\n\",\n    \"\\n\",\n    \"- **组件类型泛化**： AppBuilder在未来会支持多种类型组件，已经超出了Function的含义，例如数据库、记忆库、工作流等等\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 2.3、 什么是端云组件联动，要解决什么问题\\n\",\n    \"\\n\",\n    \"我们首先从工具的执行位置出发展开~ 在使用如AppBuilder / Coze 等平台开发Agent时，我们可以使用很多平台组件广场中，官方提供的组件，这里组件开箱即用，非常方便。\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page5.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"但是存在一个问题，基于平台云端组件开发的应用，无法调用内网/局域网/私域的知识与能力，也无法与本地的工具进行联动，限制了Agent的灵活性。\\n\",\n    \"\\n\",\n    \"我们在解决实际业务问题时，常遇到需要访问内网链接API或本地/硬件功能的FunctionCall需求，AppBuilder ToolCall可以解决这个问题：\\n\",\n    \"\\n\",\n    \"* 1、用户可注册一个本地运行的组件到已发布的应用\\n\",\n    \"* 2、由AppBuilder-Agent的云端思考模型进行规划和参数生成\\n\",\n    \"* 3、用户基于生成的参数调用本地组件，并再上传运行结果\\n\",\n    \"* 4、以此实现将本地组件能力嵌入到应用整体流程\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page6.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 3、ToolCall（FunctionCall）基础知识介绍\\n\",\n    \"\\n\",\n    \"### 3.1、Agent是如何调用Tool的\\n\",\n    \"\\n\",\n    \"我们可以将Agent的黑箱拆解为以下几个部分：\\n\",\n    \"1. Agent的背景信息\\n\",\n    \"2. Agent的输入信息\\n\",\n    \"3. Agent的思考过程\\n\",\n    \"4. Agent触发组件调用\\n\",\n    \"5. Agent基于组件输出反思总结\\n\",\n    \"\\n\",\n    \"#### Agent的背景信息包含以下几个部分\\n\",\n    \"- 角色定义描述（Prompt）：定义Agent的角色\\n\",\n    \"- 能力描述（Prompt）：定义Agent可以干什么\\n\",\n    \"- 工具描述（JsonSchema/Str）：将工具的输入和输出，按照规范，定义为一段字符串，作为最终大模型Prompt的一部分\\n\",\n    \"\\n\",\n    \"#### Agent的输入信息包含以下几个部分\\n\",\n    \"- 用户输入（Query/Prompt）：用户输入的文本\\n\",\n    \"- 对话相关的文件（File/Url）：与本地对话相关的文件路径\\n\",\n    \"\\n\",\n    \"#### Agent的思考过程\\n\",\n    \"AppBuilder-Agent会将背景信息与输入信息，拼接为最终的Prompt，然后调用大模型推理。\\n\",\n    \"\\n\",\n    \"Prompt的一个简单且直观的例子是：\\n\",\n    \"\\n\",\n    \"你是`{角色定义描述}`，你可以做以下事情：`{能力描述}`，你可以使用这些工具：`{工具描述-description}`，工具依赖的输入是：`{工具描述-paramters-properties-name}`，这些输入的格式分别是`{工具描述-paramters-properties-type}`。现在用户的问题是`{用户输入}`，与该问题相关的文件是`{对话相关的文件}`，请你解决用户的这个问题。\\n\",\n    \"\\n\",\n    \"#### Agent触发组件调用\\n\",\n    \"\\n\",\n    \"如果用户的query和组件能够解决的问题匹配，那么大模型就会尝试根据prompt里给出的工具的描述，从query中提炼出该次调用工具所需的参数，生成一个ToolCall命令，交给执行组件的模块去执行。\\n\",\n    \"\\n\",\n    \"例如，我们给出的组件能力是\\\"查找公司内指定人员的信息\\\"，函数的参数名为\\\"name\\\"。当用户输入\\\"查找张三的信息\\\"，大模型会从query中提炼出参数\\\"name=张三\\\"这个信息。\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page7.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"#### Agent基于组件输出反思总结\\n\",\n    \"\\n\",\n    \"组件运行模块执行组件后，会给出字符串形式的结果给到Agent，Agent会再次将结果拼接为Prompt，然后调用大模型推理。判断用户的需求是否已经解决。如果解决了，则经过一个对话模块，总结用户的需求，并生成一个对话记录。如果未解决，则继续调用大模型推理，尝试调用更多的工具，直到用户的需求被解决。\\n\",\n    \"\\n\",\n    \"### 3.2、开发者如何命令Agent调用本地Tool\\n\",\n    \"\\n\",\n    \"我们以AppBuilder-SDK中的AppBuilder-Client的基础代码为例，介绍开发者应该如何使用ToolCall功能\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 实例化AppBuilderClient\\n\",\n    \"app_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_client.create_conversation()\\n\",\n    \"\\n\",\n    \"# 第一次对话，输入原始的query 和 工具描述\\n\",\n    \"message_1 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"请问张三同学的生日是哪天？\\\",\\n\",\n    \"    tools=tools\\n\",\n    \")\\n\",\n    \"tool_call = message_1.content.events[-1].tool_calls[-1]\\n\",\n    \"tool_call_id = tool_call.id\\n\",\n    \"\\n\",\n    \"# 第二次对话，在本地执行组件后，上传组件的运行结果\\n\",\n    \"tool_call_result = \\\"张三同学的生日是2008年8月8日\\\"\\n\",\n    \"message_2 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    tool_outputs=[{\\n\",\n    \"        \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"        \\\"output\\\": tool_call_result\\n\",\n    \"    }]\\n\",\n    \")\\n\",\n    \"print(message_2.content)\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"其中`AppBuilderClient`的`run`方法是核心，我们展开该函数的定义和参数介绍：\\n\",\n    \"\\n\",\n    \"`AppBuilderClient().run() -> Message`\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"def run(self, conversation_id: str,\\n\",\n    \"        query: str = \\\"\\\",\\n\",\n    \"        file_ids: list = [],\\n\",\n    \"        stream: bool = False,\\n\",\n    \"        tools: list[data_class.Tool] = None,\\n\",\n    \"        tool_outputs: list[data_class.ToolOutput] = None,\\n\",\n    \"        **kwargs\\n\",\n    \"        ) -> Message:\\n\",\n    \"    r\\\"\\\"\\\"\\n\",\n    \"        参数:\\n\",\n    \"            query (str: 必须): query内容\\n\",\n    \"            conversation_id (str, 必须): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\\n\",\n    \"            file_ids(list[str], 可选):\\n\",\n    \"            stream (bool, 可选): 为True时，流式返回，需要将message.content.answer拼接起来才是完整的回答；为False时，对应非流式返回\\n\",\n    \"            tools(list[data_class.Tools], 可选): 一个Tools组成的列表，其中每个Tools对应一个工具的配置, 默认为None\\n\",\n    \"            tool_outputs(list[data_class.ToolOutput], 可选): 工具输出列表，格式为list[ToolOutput], ToolOutputd内容为本地的工具执行结果，以自然语言/json dump str描述，默认为None\\n\",\n    \"        返回: message (obj: `Message`): 对话结果.\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    pass\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"| 参数名称        | 参数类型         | 是否必须 | 描述                                                         | 示例值            |\\n\",\n    \"| --------------- | ---------------- | -------- | ------------------------------------------------------------ | ----------------- |\\n\",\n    \"| conversation_id | String           | 是       | 会话ID                                                       |                   |\\n\",\n    \"| query           | String           | 否       | query问题内容                                                | \\\"今天天气怎么样?\\\" |\\n\",\n    \"| file_ids        | list[String]     | 否       | 对话可引用的文档ID                                           |                   |\\n\",\n    \"| stream          | Bool             | 否       | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 | False             |\\n\",\n    \"| tools           | List[Tool]       | 否       | 一个列表，其中每个字典对应一个工具的配置                     |                   |\\n\",\n    \"| tools[0]        | Tool             | 否       | 工具配置                                                     |                   |\\n\",\n    \"| +type           | String           | 否       | 枚举：<br/>**file_retrieval**: 知识库检索工具能够理解文档内容，支持用户针对文档内容的问答。<br/>**code_interpreter**: 代码解释器, 代码解释器能够生成并执行代码，从而协助用户解决复杂问题，涵盖科学计算（包括普通数学计算题）、数据可视化、文件编辑处理（图片、PDF文档、视频、音频等）、文件格式转换（如WAV、MP3、text、SRT、PNG、jpg、MP4、GIF、MP3等）、数据分析&清洗&处理（文件以excel、csv格式为主）、机器学习&深度学习建模&自然语言处理等多个领域。<br/>**function**: 支持fucntion call模式调用工具 |                   |\\n\",\n    \"| +function       | Function         | 否       | Function工具描述<br/>仅当**type为**`**function**` 时需要且必须填写 |                   |\\n\",\n    \"| ++name          | String           | 否       | 函数名<br/>只允许数字、大小写字母和中划线和下划线，最大长度为64个字符。一次运行中唯一。 |                   |\\n\",\n    \"| ++description   | String           | 否       | 工具描述                                                     |                   |\\n\",\n    \"| ++parameters    | Dict             | 否       | 工具参数, json_schema格式                                    |                   |\\n\",\n    \"| tool_outputs    | List[ToolOutput] | 否       | 内容为本地的工具执行结果，以自然语言/json dump str描述       |                   |\\n\",\n    \"| tool_outputs[0] | ToolOutput       | 否       | 工具执行结果                                                 |                   |\\n\",\n    \"| +tool_call_id   | String           | 否       | 工具调用ID                                                   |                   |\\n\",\n    \"| +output         | String           | 否       | 工具输出                                                     |                   |\\n\",\n    \"\\n\",\n    \"`Tool`与`Function`是本地组件的描述，类型为object，其定义如下：\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"class Tool(BaseModel):\\n\",\n    \"    type: str = \\\"function\\\"\\n\",\n    \"    function: Function = Field(..., description=\\\"工具信息\\\")\\n\",\n    \"\\n\",\n    \"class Function(BaseModel):\\n\",\n    \"    name: str = Field(..., description=\\\"工具名称\\\")\\n\",\n    \"    description: str = Field(..., description=\\\"工具描述\\\")\\n\",\n    \"    parameters: dict = Field(..., description=\\\"工具参数, json_schema格式\\\")\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"`ToolOutput`是本地组件的执行结果，需要再次上传到Agent，参与思考，类型为object，其定义如下：\\n\",\n    \"```python\\n\",\n    \"class ToolOutput(BaseModel):\\n\",\n    \"    tool_call_id: str = Field(..., description=\\\"工具调用ID\\\")\\n\",\n    \"    output: str = Field(..., description=\\\"工具输出\\\")\\n\",\n    \"\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 4、ToolCall的第一个例子\\n\",\n    \"\\n\",\n    \"我们继续以上文中提到的查找张三生日为例，看一下完整的流程是怎么样的\\n\",\n    \"\\n\",\n    \"### 前置工作，在AppBuilder平台上创建一个白板应用（可以跳过）\\n\",\n    \"\\n\",\n    \"网页链接：https://appbuilder.cloud.baidu.com/\\n\",\n    \"\\n\",\n    \"注册后，进入控制台：https://console.bce.baidu.com/ai_apaas/dialogHome\\n\",\n    \"\\n\",\n    \"点击左上角的【创建应用】-> 【AI自动配置】，我们输入以下Prompt，自动生成Agent：`你是智能问题解决者，自动集成多种工具组件，解决用户各类问题`\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page8.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"最终生成的Agent长这个样子：\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page9.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"而后点击【发布】，分别在控制台的左侧【个人空间】获取`app_id`，在【我的密钥】获取`APPBUILDER_TOEN`后，就可以开始后续的操作了。\\n\",\n    \"\\n\",\n    \"当然，下面的示例代码中，我们已经提供了可以直接运行的试用Token与App，你可以直接上手运行\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# AppBuilder Token，替换为您个人的Token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 应用为：智能问题解决者\\n\",\n    \"app_id = \\\"b9473e78-754b-463a-916b-f0a9097a8e5f\\\"\\n\",\n    \"app_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_client.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"首次提问一个问题，应用不具备该能力，通过回答可以印证\\n\",\n    \"\\n\",\n    \"- 由于并没有关于张三同学的信息，所以Agent无法实现查询\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 24,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"Agent第一次回答: 很抱歉，由于个人隐私保护的原则，我无法直接查询并告知您本公司张三同学的生日。如果您需要了解这个信息，建议您通过合法且正当的途径，比如直接询问张三同学本人，或者查阅公司内部的员工档案，但前提是您需要确保有合适的权限和授权。尊重和保护个人隐私是我们每个人的责任。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"message_1 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"请问本公司的张三同学的生日是哪天？\\\",\\n\",\n    \")\\n\",\n    \"print(\\\"Agent第一次回答: {}\\\".format(message_1.content.answer))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"Agent第一次回答: 为了回答这个问题，我们首先需要明确几个关键点：\\n\",\n    \"\\n\",\n    \"1. **问题理解**：\\n\",\n    \"   - 需要确定的是“张三同学的生日”。\\n\",\n    \"\\n\",\n    \"2. **工具选择**：\\n\",\n    \"   - 由于问题涉及的是特定个人的信息（张三的生日），这通常不是通过工具或系统查询能得到的，而是需要通过公司内部的人事记录或直接询问张三本人来获取。\\n\",\n    \"\\n\",\n    \"3. **解决方案生成**：\\n\",\n    \"   - **步骤一**：首先，尝试访问公司的人事系统或员工档案，看是否有张三的生日信息记录。\\n\",\n    \"   - **步骤二**：如果人事系统或员工档案中没有相关信息，或者你不具备访问权限，那么可以考虑直接询问张三本人或其同事，看是否有人知道他的生日。\\n\",\n    \"   - **步骤三**：如果以上方法都不可行，还可以尝试联系公司的人力资源部门，看他们是否能提供相关信息。\\n\",\n    \"\\n\",\n    \"4. **注意事项**：\\n\",\n    \"   - 在尝试获取张三的生日信息时，要确保遵守公司的隐私政策和相关法律法规，不要侵犯张三的隐私权。\\n\",\n    \"   - 如果张三不愿意透露他的生日信息，应尊重他的选择，并停止进一步询问。\\n\",\n    \"\\n\",\n    \"5. **可能遇到的问题**：\\n\",\n    \"   - 人事系统或员工档案中可能没有张三的生日信息。\\n\",\n    \"   - 张三或其同事可能不愿意透露生日信息。\\n\",\n    \"   - 人力资源部门可能因隐私政策而无法提供相关信息。\\n\",\n    \"\\n\",\n    \"综上所述，要确定张三的生日，最直接且尊重隐私的方法是直接询问张三本人，或者通过公司正式渠道（如人力资源部门）在遵守隐私政策的前提下进行查询。\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"##### 赋予应用一个本地查询组件能力\\n\",\n    \"\\n\",\n    \"以下示例展示了三种方式来使用 ToolCall 进行调用，并演示了如何在 AppBuilder 环境中配置和执行会话调用。\\n\",\n    \"\\n\",\n    \"**方式1：使用 JSONSchema 格式直接描述 tools 调用**\\n\",\n    \"\\n\",\n    \"- 这里我们使用info_dict模拟一个数据库查询的返回结果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 25,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"def get_person_infomation(name: str):\\n\",\n    \"    info_dict = {\\n\",\n    \"        \\\"张三\\\": \\\"1980年1月1日\\\",\\n\",\n    \"        \\\"李四\\\": \\\"1975年12月31日\\\",\\n\",\n    \"        \\\"刘伟\\\": \\\"1990年12月30日\\\"\\n\",\n    \"    }\\n\",\n    \"\\n\",\n    \"    if name in info_dict:\\n\",\n    \"        return f\\\"您要查找的{name}的生日是：{info_dict[name]}\\\"\\n\",\n    \"    else:\\n\",\n    \"        return f\\\"您要查找的{name}的信息我们暂未收录，请联系管理员添加。\\\"\\n\",\n    \"    \\n\",\n    \"# 创建工具的描述：json_schema格式\\n\",\n    \"tools = [\\n\",\n    \"    {\\n\",\n    \"        \\\"type\\\": \\\"function\\\",\\n\",\n    \"        \\\"function\\\": {\\n\",\n    \"            \\\"name\\\": \\\"get_person_infomation\\\",\\n\",\n    \"            \\\"description\\\": \\\"查找公司内指定人员的信息\\\",\\n\",\n    \"            \\\"parameters\\\": {\\n\",\n    \"                \\\"type\\\": \\\"object\\\",\\n\",\n    \"                \\\"properties\\\": {\\n\",\n    \"                    \\\"name\\\": {\\n\",\n    \"                        \\\"type\\\": \\\"string\\\",\\n\",\n    \"                        \\\"description\\\": \\\"人员名称，例如：张三、李四\\\",\\n\",\n    \"                    },\\n\",\n    \"                },\\n\",\n    \"                \\\"required\\\": [\\\"name\\\"],\\n\",\n    \"            },\\n\",\n    \"        },\\n\",\n    \"    }\\n\",\n    \"]\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 现在我们已经完成了本地tool组件的设计，接下来我们将tool的功能赋予Client应用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 26,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"Agent的中间思考过程：\\n\",\n      \"{\\n\",\n      \"    \\\"code\\\": 0,\\n\",\n      \"    \\\"message\\\": \\\"\\\",\\n\",\n      \"    \\\"status\\\": \\\"interrupt\\\",\\n\",\n      \"    \\\"event_type\\\": \\\"Interrupt\\\",\\n\",\n      \"    \\\"content_type\\\": \\\"contexts\\\",\\n\",\n      \"    \\\"detail\\\": {\\n\",\n      \"        \\\"text\\\": {\\n\",\n      \"            \\\"function_call\\\": {\\n\",\n      \"                \\\"thought\\\": \\\"用户想要查询公司内指定人员张三的生日信息，这是一个具有明确目的和关键信息的需求。根据我们可用的工具，get_person_infomation 工具能够查找公司内指定人员的信息，包括生日等。因此，通过调用这个工具并传入张三作为参数，我们可以获取到张三的生日信息，从而满足用户的需求。\\\",\\n\",\n      \"                \\\"name\\\": \\\"get_person_infomation\\\",\\n\",\n      \"                \\\"arguments\\\": {\\n\",\n      \"                    \\\"name\\\": \\\"张三\\\"\\n\",\n      \"                },\\n\",\n      \"                \\\"usage\\\": {\\n\",\n      \"                    \\\"prompt_tokens\\\": 564,\\n\",\n      \"                    \\\"completion_tokens\\\": 115,\\n\",\n      \"                    \\\"total_tokens\\\": 679,\\n\",\n      \"                    \\\"name\\\": \\\"ERNIE-4.0-8K\\\",\\n\",\n      \"                    \\\"type\\\": \\\"plan\\\"\\n\",\n      \"                },\\n\",\n      \"                \\\"tool_call_id\\\": \\\"baf86c61-6627-4229-bc81-a17eda1bce36\\\"\\n\",\n      \"            },\\n\",\n      \"            \\\"used_tool\\\": []\\n\",\n      \"        }\\n\",\n      \"    },\\n\",\n      \"    \\\"usage\\\": null,\\n\",\n      \"    \\\"tool_calls\\\": [\\n\",\n      \"        {\\n\",\n      \"            \\\"id\\\": \\\"baf86c61-6627-4229-bc81-a17eda1bce36\\\",\\n\",\n      \"            \\\"type\\\": \\\"function\\\",\\n\",\n      \"            \\\"function\\\": {\\n\",\n      \"                \\\"name\\\": \\\"get_person_infomation\\\",\\n\",\n      \"                \\\"arguments\\\": {\\n\",\n      \"                    \\\"name\\\": \\\"张三\\\"\\n\",\n      \"                }\\n\",\n      \"            }\\n\",\n      \"        }\\n\",\n      \"    ]\\n\",\n      \"}\\n\",\n      \"Agent思考结束，等待我们上传本地结果\\n\",\n      \"\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"message_2 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"请问本公司的张三同学的生日是哪天？\\\",\\n\",\n    \"    tools=tools\\n\",\n    \")\\n\",\n    \"print(\\\"Agent的中间思考过程：\\\")\\n\",\n    \"print(message_2.content.events[-1].model_dump_json(indent=4))\\n\",\n    \"print(\\\"Agent思考结束，等待我们上传本地结果\\\\n\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"这部分输出为Client应用的思考过程\\n\",\n    \"```\\n\",\n    \"Agent的中间思考过程：\\n\",\n    \"{\\n\",\n    \"    \\\"code\\\": 0,\\n\",\n    \"    \\\"message\\\": \\\"\\\",\\n\",\n    \"    \\\"status\\\": \\\"interrupt\\\",\\n\",\n    \"    \\\"event_type\\\": \\\"Interrupt\\\",\\n\",\n    \"    \\\"content_type\\\": \\\"contexts\\\",\\n\",\n    \"    \\\"detail\\\": {\\n\",\n    \"        \\\"text\\\": {\\n\",\n    \"            \\\"function_call\\\": {\\n\",\n    \"                \\\"thought\\\": \\\"用户想要查询公司内张三同学的生日信息，这个需求很明确，且背景信息也足够。我可以使用get_person_infomation工具来查找张三的生日信息。\\\",\\n\",\n    \"                \\\"name\\\": \\\"get_person_infomation\\\",\\n\",\n    \"                \\\"arguments\\\": {\\n\",\n    \"                    \\\"name\\\": \\\"张三\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"usage\\\": {\\n\",\n    \"                    \\\"prompt_tokens\\\": 697,\\n\",\n    \"                    \\\"completion_tokens\\\": 87,\\n\",\n    \"                    \\\"total_tokens\\\": 784,\\n\",\n    \"                    \\\"name\\\": \\\"ERNIE-4.0-Turbo-8K\\\",\\n\",\n    \"                    \\\"type\\\": \\\"plan\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"tool_call_id\\\": \\\"c23309f7-e24a-4476-85e2-3ef9cfd4f6ed\\\"\\n\",\n    \"            },\\n\",\n    \"            \\\"used_tool\\\": []\\n\",\n    \"...\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"Agent思考结束，等待我们上传本地结果\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 大模型下发了调用本地函数的参数，我们使用这个参数调用本地函数\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 27,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"local_func_result: 您要查找的张三的生日是：1980年1月1日\\n\",\n      \"\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"tool_call = message_2.content.events[-1].tool_calls[-1]\\n\",\n    \"tool_call_id = tool_call.id\\n\",\n    \"tool_call_argument = tool_call.function.arguments\\n\",\n    \"local_func_result = get_person_infomation(**tool_call_argument)\\n\",\n    \"print(\\\"local_func_result: {}\\\\n\\\".format(local_func_result))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"local_func_result: 您要查找的张三的生日是：1980年1月1日\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 向应用返回本地运行的结果，完成本地函数toolcall调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 28,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"Agent 拥有了本地函数调用能力后，回答是: 您要找的张三的生日是1980年1月1日。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"message_3 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    tool_outputs=[{\\n\",\n    \"        \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"        \\\"output\\\": local_func_result\\n\",\n    \"    }]\\n\",\n    \")\\n\",\n    \"print(\\\"Agent 拥有了本地函数调用能力后，回答是: {}\\\".format(message_3.content.answer))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"Agent的中间思考过程：\\n\",\n    \"{\\n\",\n    \"    \\\"code\\\": 0,\\n\",\n    \"    \\\"message\\\": \\\"\\\",\\n\",\n    \"    \\\"status\\\": \\\"interrupt\\\",\\n\",\n    \"    \\\"event_type\\\": \\\"Interrupt\\\",\\n\",\n    \"    \\\"content_type\\\": \\\"contexts\\\",\\n\",\n    \"    \\\"detail\\\": {\\n\",\n    \"        \\\"text\\\": {\\n\",\n    \"            \\\"function_call\\\": {\\n\",\n    \"                \\\"thought\\\": \\\"用户想要查询公司内张三同学的生日信息，这个需求很明确，且背景信息也足够。我可以使用get_person_infomation工具来查找张三的生日信息。\\\",\\n\",\n    \"                \\\"name\\\": \\\"get_person_infomation\\\",\\n\",\n    \"                \\\"arguments\\\": {\\n\",\n    \"                    \\\"name\\\": \\\"张三\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"usage\\\": {\\n\",\n    \"                    \\\"prompt_tokens\\\": 697,\\n\",\n    \"                    \\\"completion_tokens\\\": 87,\\n\",\n    \"                    \\\"total_tokens\\\": 784,\\n\",\n    \"                    \\\"name\\\": \\\"ERNIE-4.0-Turbo-8K\\\",\\n\",\n    \"                    \\\"type\\\": \\\"plan\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"tool_call_id\\\": \\\"c23309f7-e24a-4476-85e2-3ef9cfd4f6ed\\\"\\n\",\n    \"            },\\n\",\n    \"            \\\"used_tool\\\": []\\n\",\n    \"...\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"Agent思考结束，等待我们上传本地结果\\n\",\n    \"\\n\",\n    \"Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...\\n\",\n    \"\\n\",\n    \"local_func_result: 您要查找的张三的生日是：1980年1月1日\\n\",\n    \"\\n\",\n    \"Agent 拥有了本地函数调用能力后，回答是: # 解决方案\\n\",\n    \"\\n\",\n    \"## 问题分析\\n\",\n    \"\\n\",\n    \"用户想要查询公司内张三同学的生日信息。这是一个明确且具体的需求，我们可以通过`get_person_infomation`工具来获取这一信息。\\n\",\n    \"\\n\",\n    \"## 工具运用\\n\",\n    \"\\n\",\n    \"1. **工具选择**：`get_person_infomation`\\n\",\n    \"2. **参数设置**：\\n\",\n    \"\\n\",\n    \"\\t* `name`：张三\\n\",\n    \"\\n\",\n    \"3. **执行结果**：张三的生日是1980年1月1日。\\n\",\n    \"\\n\",\n    \"## 解决方案步骤\\n\",\n    \"\\n\",\n    \"1. 使用`get_person_infomation`工具，并设置参数`name`为“张三”。\\n\",\n    \"2. 等待工具执行，并获取张三的生日信息。\\n\",\n    \"3. 将获取到的生日信息（1980年1月1日）告知用户。\\n\",\n    \"\\n\",\n    \"## 注意事项\\n\",\n    \"\\n\",\n    \"* 确保在使用`get_person_infomation`工具时，输入的姓名与公司内部记录的姓名完全一致，以避免查询错误。\\n\",\n    \"* 如果工具返回“未找到”或类似结果，请检查姓名是否有误或联系公司人事部门确认信息。\\n\",\n    \"\\n\",\n    \"通过上述步骤，我们可以准确地回答用户的问题，并提供张三的生日信息。\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**方式2：使用 function_to_model 将函数对象传递为 ToolCall 的调用**\\n\",\n    \"\\n\",\n    \"- 前置步骤：设置环境变量和初始化操作\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"import os\\n\",\n    \"import json\\n\",\n    \"\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"# 设置环境变量\\n\",\n    \"# AppBuilder Token，替换为您个人的Token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 应用为：智能问题解决者\\n\",\n    \"app_id = \\\"b9473e78-754b-463a-916b-f0a9097a8e5f\\\"\\n\",\n    \"# 初始化智能体\\n\",\n    \"client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"# 创建会话\\n\",\n    \"conversation_id = client.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 定义函数和函数列表，按照谷歌规范写好注释\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"#定义示例函数\\n\",\n    \"def get_current_weather(location: str, unit: str) -> str:\\n\",\n    \"  \\\"\\\"\\\"获取指定中国城市的当前天气信息。\\n\",\n    \"\\n\",\n    \"  仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\\n\",\n    \"\\n\",\n    \"  Args:\\n\",\n    \"      location (str): 城市名，例如：\\\"北京\\\"。\\n\",\n    \"      unit (int): 温度单位，支持 \\\"celsius\\\" 或 \\\"fahrenheit\\\"。\\n\",\n    \"\\n\",\n    \"  Returns:\\n\",\n    \"      str: 天气情况描述\\n\",\n    \"  \\\"\\\"\\\"\\n\",\n    \"  return \\\"北京今天25度\\\"\\n\",\n    \"  \\n\",\n    \"#定义函数列表\\n\",\n    \"functions = [get_current_weather]\\n\",\n    \"function_map = {f.__name__: f for f in functions}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 查看一下function_to_model函数转化的结果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"{\\n\",\n      \"    \\\"type\\\": \\\"function\\\",\\n\",\n      \"    \\\"function\\\": {\\n\",\n      \"        \\\"name\\\": \\\"get_current_weather\\\",\\n\",\n      \"        \\\"description\\\": \\\"获取指定中国城市的当前天气信息。\\\\n\\\\n  仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\\\\n\\\\n  Args:\\\\n      location (str): 城市名，例如：\\\\\\\"北京\\\\\\\"。\\\\n      unit (int): 温度单位，支持 \\\\\\\"celsius\\\\\\\" 或 \\\\\\\"fahrenheit\\\\\\\"。\\\\n\\\\n  Returns:\\\\n      str: 天气情况描述\\\",\\n\",\n      \"        \\\"parameters\\\": {\\n\",\n      \"            \\\"type\\\": \\\"object\\\",\\n\",\n      \"            \\\"properties\\\": {\\n\",\n      \"                \\\"location\\\": {\\n\",\n      \"                    \\\"name\\\": \\\"location\\\",\\n\",\n      \"                    \\\"type\\\": \\\"str\\\",\\n\",\n      \"                    \\\"description\\\": null,\\n\",\n      \"                    \\\"required\\\": true\\n\",\n      \"                },\\n\",\n      \"                \\\"unit\\\": {\\n\",\n      \"                    \\\"name\\\": \\\"unit\\\",\\n\",\n      \"                    \\\"type\\\": \\\"str\\\",\\n\",\n      \"                    \\\"description\\\": null,\\n\",\n      \"                    \\\"required\\\": true\\n\",\n      \"                }\\n\",\n      \"            },\\n\",\n      \"            \\\"required\\\": [\\n\",\n      \"                \\\"location\\\",\\n\",\n      \"                \\\"unit\\\"\\n\",\n      \"            ]\\n\",\n      \"        },\\n\",\n      \"        \\\"returns\\\": {\\n\",\n      \"            \\\"type\\\": \\\"str\\\",\\n\",\n      \"            \\\"description\\\": null\\n\",\n      \"        }\\n\",\n      \"    }\\n\",\n      \"}\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"print(json.dumps(appbuilder.Manifest.from_function(get_current_weather), indent=4, ensure_ascii=False))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 调用大模型进行函数调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"ename\": \"BadRequestException\",\n     \"evalue\": \"request_id=928f30c6-d712-448b-a831-dc4cd15307b0 , http status code is 400, body is {\\\"code\\\": \\\"QuotaLimitExceeded\\\", \\\"message\\\": \\\"quota\\\\u8d44\\\\u6e90\\\\u5df2\\\\u8fbe\\\\u4e0a\\\\u9650\\\", \\\"request_id\\\": \\\"928f30c6-d712-448b-a831-dc4cd15307b0\\\"}\",\n     \"output_type\": \"error\",\n     \"traceback\": [\n      \"\\u001B[0;31m---------------------------------------------------------------------------\\u001B[0m\",\n      \"\\u001B[0;31mBadRequestException\\u001B[0m                       Traceback (most recent call last)\",\n      \"Cell \\u001B[0;32mIn[5], line 2\\u001B[0m\\n\\u001B[1;32m      1\\u001B[0m \\u001B[38;5;66;03m#调用大模型\\u001B[39;00m\\n\\u001B[0;32m----> 2\\u001B[0m msg \\u001B[38;5;241m=\\u001B[39m \\u001B[43mclient\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mrun\\u001B[49m\\u001B[43m(\\u001B[49m\\n\\u001B[1;32m      3\\u001B[0m \\u001B[43m  \\u001B[49m\\u001B[43mconversation_id\\u001B[49m\\u001B[38;5;241;43m=\\u001B[39;49m\\u001B[43mconversation_id\\u001B[49m\\u001B[43m,\\u001B[49m\\n\\u001B[1;32m      4\\u001B[0m \\u001B[43m  \\u001B[49m\\u001B[43mquery\\u001B[49m\\u001B[38;5;241;43m=\\u001B[39;49m\\u001B[38;5;124;43m\\\"\\u001B[39;49m\\u001B[38;5;124;43m今天北京的天气怎么样？\\u001B[39;49m\\u001B[38;5;124;43m\\\"\\u001B[39;49m\\u001B[43m,\\u001B[49m\\n\\u001B[1;32m      5\\u001B[0m \\u001B[43m  \\u001B[49m\\u001B[43mtools\\u001B[49m\\u001B[43m \\u001B[49m\\u001B[38;5;241;43m=\\u001B[39;49m\\u001B[43m \\u001B[49m\\u001B[43m[\\u001B[49m\\u001B[43mappbuilder\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mManifest\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mfrom_function\\u001B[49m\\u001B[43m(\\u001B[49m\\u001B[43mf\\u001B[49m\\u001B[43m)\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mmodel_dump\\u001B[49m\\u001B[43m(\\u001B[49m\\u001B[43m)\\u001B[49m\\u001B[43m \\u001B[49m\\u001B[38;5;28;43;01mfor\\u001B[39;49;00m\\u001B[43m \\u001B[49m\\u001B[43mf\\u001B[49m\\u001B[43m \\u001B[49m\\u001B[38;5;129;43;01min\\u001B[39;49;00m\\u001B[43m \\u001B[49m\\u001B[43mfunctions\\u001B[49m\\u001B[43m]\\u001B[49m\\n\\u001B[1;32m      6\\u001B[0m \\u001B[43m  \\u001B[49m\\u001B[43m)\\u001B[49m\\n\\u001B[1;32m      7\\u001B[0m \\u001B[38;5;28mprint\\u001B[39m(msg\\u001B[38;5;241m.\\u001B[39mmodel_dump_json(indent\\u001B[38;5;241m=\\u001B[39m\\u001B[38;5;241m4\\u001B[39m))\\n\\u001B[1;32m      8\\u001B[0m \\u001B[38;5;66;03m# 获取最后的事件和工具调用信息\\u001B[39;00m\\n\",\n      \"File \\u001B[0;32m/opt/anaconda3/envs/testenv/lib/python3.9/site-packages/appbuilder/core/console/appbuilder_client/appbuilder_client.py:306\\u001B[0m, in \\u001B[0;36mAppBuilderClient.run\\u001B[0;34m(self, conversation_id, query, file_ids, stream, tools, tool_outputs, tool_choice, end_user_id, action, **kwargs)\\u001B[0m\\n\\u001B[1;32m    302\\u001B[0m url \\u001B[38;5;241m=\\u001B[39m \\u001B[38;5;28mself\\u001B[39m\\u001B[38;5;241m.\\u001B[39mhttp_client\\u001B[38;5;241m.\\u001B[39mservice_url_v2(\\u001B[38;5;124m\\\"\\u001B[39m\\u001B[38;5;124m/app/conversation/runs\\u001B[39m\\u001B[38;5;124m\\\"\\u001B[39m)\\n\\u001B[1;32m    303\\u001B[0m response \\u001B[38;5;241m=\\u001B[39m \\u001B[38;5;28mself\\u001B[39m\\u001B[38;5;241m.\\u001B[39mhttp_client\\u001B[38;5;241m.\\u001B[39msession\\u001B[38;5;241m.\\u001B[39mpost(\\n\\u001B[1;32m    304\\u001B[0m     url, headers\\u001B[38;5;241m=\\u001B[39mheaders, json\\u001B[38;5;241m=\\u001B[39mreq\\u001B[38;5;241m.\\u001B[39mmodel_dump(), timeout\\u001B[38;5;241m=\\u001B[39m\\u001B[38;5;28;01mNone\\u001B[39;00m, stream\\u001B[38;5;241m=\\u001B[39m\\u001B[38;5;28;01mTrue\\u001B[39;00m\\n\\u001B[1;32m    305\\u001B[0m )\\n\\u001B[0;32m--> 306\\u001B[0m \\u001B[38;5;28;43mself\\u001B[39;49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mhttp_client\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mcheck_response_header\\u001B[49m\\u001B[43m(\\u001B[49m\\u001B[43mresponse\\u001B[49m\\u001B[43m)\\u001B[49m\\n\\u001B[1;32m    307\\u001B[0m request_id \\u001B[38;5;241m=\\u001B[39m \\u001B[38;5;28mself\\u001B[39m\\u001B[38;5;241m.\\u001B[39mhttp_client\\u001B[38;5;241m.\\u001B[39mresponse_request_id(response)\\n\\u001B[1;32m    308\\u001B[0m \\u001B[38;5;28;01mif\\u001B[39;00m stream:\\n\",\n      \"File \\u001B[0;32m/opt/anaconda3/envs/testenv/lib/python3.9/site-packages/appbuilder/core/_client.py:120\\u001B[0m, in \\u001B[0;36mHTTPClient.check_response_header\\u001B[0;34m(response)\\u001B[0m\\n\\u001B[1;32m    116\\u001B[0m message \\u001B[38;5;241m=\\u001B[39m \\u001B[38;5;124m\\\"\\u001B[39m\\u001B[38;5;124mrequest_id=\\u001B[39m\\u001B[38;5;132;01m{}\\u001B[39;00m\\u001B[38;5;124m , http status code is \\u001B[39m\\u001B[38;5;132;01m{}\\u001B[39;00m\\u001B[38;5;124m, body is \\u001B[39m\\u001B[38;5;132;01m{}\\u001B[39;00m\\u001B[38;5;124m\\\"\\u001B[39m\\u001B[38;5;241m.\\u001B[39mformat(\\n\\u001B[1;32m    117\\u001B[0m     \\u001B[38;5;18m__class__\\u001B[39m\\u001B[38;5;241m.\\u001B[39mresponse_request_id(response), status_code, response\\u001B[38;5;241m.\\u001B[39mtext\\n\\u001B[1;32m    118\\u001B[0m )\\n\\u001B[1;32m    119\\u001B[0m \\u001B[38;5;28;01mif\\u001B[39;00m status_code \\u001B[38;5;241m==\\u001B[39m requests\\u001B[38;5;241m.\\u001B[39mcodes\\u001B[38;5;241m.\\u001B[39mbad_request:\\n\\u001B[0;32m--> 120\\u001B[0m     \\u001B[38;5;28;01mraise\\u001B[39;00m BadRequestException(message)\\n\\u001B[1;32m    121\\u001B[0m \\u001B[38;5;28;01melif\\u001B[39;00m status_code \\u001B[38;5;241m==\\u001B[39m requests\\u001B[38;5;241m.\\u001B[39mcodes\\u001B[38;5;241m.\\u001B[39mforbidden:\\n\\u001B[1;32m    122\\u001B[0m     \\u001B[38;5;28;01mraise\\u001B[39;00m ForbiddenException(message)\\n\",\n      \"\\u001B[0;31mBadRequestException\\u001B[0m: request_id=928f30c6-d712-448b-a831-dc4cd15307b0 , http status code is 400, body is {\\\"code\\\": \\\"QuotaLimitExceeded\\\", \\\"message\\\": \\\"quota\\\\u8d44\\\\u6e90\\\\u5df2\\\\u8fbe\\\\u4e0a\\\\u9650\\\", \\\"request_id\\\": \\\"928f30c6-d712-448b-a831-dc4cd15307b0\\\"}\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"#调用大模型\\n\",\n    \"msg = client.run(\\n\",\n    \"  conversation_id=conversation_id,\\n\",\n    \"  query=\\\"今天北京的天气怎么样？\\\",\\n\",\n    \"  tools = [appbuilder.Manifest.from_function(f) for f in functions]\\n\",\n    \"  )\\n\",\n    \"print(msg.model_dump_json(indent=4))\\n\",\n    \"# 获取最后的事件和工具调用信息\\n\",\n    \"event = msg.content.events[-1]\\n\",\n    \"tool_call = event.tool_calls[-1]\\n\",\n    \"\\n\",\n    \"# 获取函数名称和参数\\n\",\n    \"name = tool_call.function.name\\n\",\n    \"args = tool_call.function.arguments\\n\",\n    \"\\n\",\n    \"# 将函数名称映射到具体的函数并执行\\n\",\n    \"raw_result = function_map[name](**args)\\n\",\n    \"\\n\",\n    \"# 传递工具的输出\\n\",\n    \"msg_2 = client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    tool_outputs=[{\\n\",\n    \"        \\\"tool_call_id\\\": tool_call.id,\\n\",\n    \"        \\\"output\\\": str(raw_result)\\n\",\n    \"    }],\\n\",\n    \")\\n\",\n    \"print(msg_2.model_dump_json(indent=4))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**方式3: 使用装饰器进行描述**\\n\",\n    \"\\n\",\n    \"- 前置步骤：设置环境变量和初始化操作\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import json\\n\",\n    \"import appbuilder\\n\",\n    \"from appbuilder import manifest, manifest_parameter\\n\",\n    \"\\n\",\n    \"# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"# 设置环境变量\\n\",\n    \"# AppBuilder Token，替换为您个人的Token\\n\",\n    \"#os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 应用为：智能问题解决者\\n\",\n    \"#app_id = \\\"b9473e78-754b-463a-916b-f0a9097a8e5f\\\"\\n\",\n    \"app_id = \\\"7cc4c21f-0e25-4a76-baf7-01a2b923a1a7\\\"\\n\",\n    \"# 初始化智能体\\n\",\n    \"client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"# 创建会话\\n\",\n    \"conversation_id = client.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 定义函数和函数列表，并用装饰器对函数进行进行描述.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"#使用function装饰描述函数，function_parameter装饰器描述参数，function_return装饰器描述函数返回值。\\n\",\n    \"@manifest(description=\\\"获取指定中国城市的当前天气信息。仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\\\")\\n\",\n    \"@manifest_parameter(name=\\\"location\\\", description=\\\"城市名，例如：北京。\\\")\\n\",\n    \"@manifest_parameter(name=\\\"unit\\\", description=\\\"温度单位，支持 'celsius' 或 'fahrenheit'\\\")\\n\",\n    \"#定义示例函数\\n\",\n    \"def get_current_weather(location: str, unit: str) -> str:\\n\",\n    \"  return \\\"北京今天25度\\\"\\n\",\n    \"\\n\",\n    \"#定义函数列表\\n\",\n    \"functions = [get_current_weather]\\n\",\n    \"function_map = {f.__name__: f for f in functions}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 查看一下装饰器的转化内容\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"{\\n\",\n      \"    \\\"type\\\": \\\"function\\\",\\n\",\n      \"    \\\"function\\\": {\\n\",\n      \"        \\\"name\\\": \\\"get_current_weather\\\",\\n\",\n      \"        \\\"description\\\": \\\"获取指定中国城市的当前天气信息。仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\\\",\\n\",\n      \"        \\\"parameters\\\": {\\n\",\n      \"            \\\"type\\\": \\\"object\\\",\\n\",\n      \"            \\\"properties\\\": {\\n\",\n      \"                \\\"location\\\": {\\n\",\n      \"                    \\\"name\\\": \\\"location\\\",\\n\",\n      \"                    \\\"type\\\": \\\"str\\\",\\n\",\n      \"                    \\\"description\\\": \\\"城市名，例如：北京。\\\",\\n\",\n      \"                    \\\"required\\\": true\\n\",\n      \"                },\\n\",\n      \"                \\\"unit\\\": {\\n\",\n      \"                    \\\"name\\\": \\\"unit\\\",\\n\",\n      \"                    \\\"type\\\": \\\"str\\\",\\n\",\n      \"                    \\\"description\\\": \\\"温度单位，支持 'celsius' 或 'fahrenheit'\\\",\\n\",\n      \"                    \\\"required\\\": true\\n\",\n      \"                }\\n\",\n      \"            },\\n\",\n      \"            \\\"required\\\": [\\n\",\n      \"                \\\"location\\\",\\n\",\n      \"                \\\"unit\\\"\\n\",\n      \"            ]\\n\",\n      \"        }\\n\",\n      \"    }\\n\",\n      \"}\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 将 model_dump() 的输出进行格式化打印\\n\",\n    \"print(\\n\",\n    \"    json.dumps(\\n\",\n    \"        appbuilder.Manifest.from_function(get_current_weather), indent=4, ensure_ascii=False\\n\",\n    \"    )\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"ename\": \"BadRequestException\",\n     \"evalue\": \"request_id=76224253-163f-46d3-a5eb-b22c6fcec2be , http status code is 400, body is {\\\"code\\\": \\\"QuotaLimitExceeded\\\", \\\"message\\\": \\\"quota\\\\u8d44\\\\u6e90\\\\u5df2\\\\u8fbe\\\\u4e0a\\\\u9650\\\", \\\"request_id\\\": \\\"76224253-163f-46d3-a5eb-b22c6fcec2be\\\"}\",\n     \"output_type\": \"error\",\n     \"traceback\": [\n      \"\\u001B[0;31m---------------------------------------------------------------------------\\u001B[0m\",\n      \"\\u001B[0;31mBadRequestException\\u001B[0m                       Traceback (most recent call last)\",\n      \"Cell \\u001B[0;32mIn[10], line 2\\u001B[0m\\n\\u001B[1;32m      1\\u001B[0m \\u001B[38;5;66;03m#调用大模型\\u001B[39;00m\\n\\u001B[0;32m----> 2\\u001B[0m msg \\u001B[38;5;241m=\\u001B[39m \\u001B[43mclient\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mrun\\u001B[49m\\u001B[43m(\\u001B[49m\\n\\u001B[1;32m      3\\u001B[0m \\u001B[43m  \\u001B[49m\\u001B[43mconversation_id\\u001B[49m\\u001B[38;5;241;43m=\\u001B[39;49m\\u001B[43mconversation_id\\u001B[49m\\u001B[43m,\\u001B[49m\\n\\u001B[1;32m      4\\u001B[0m \\u001B[43m  \\u001B[49m\\u001B[43mquery\\u001B[49m\\u001B[38;5;241;43m=\\u001B[39;49m\\u001B[38;5;124;43m\\\"\\u001B[39;49m\\u001B[38;5;124;43m今天北京的天气怎么样？\\u001B[39;49m\\u001B[38;5;124;43m\\\"\\u001B[39;49m\\u001B[43m,\\u001B[49m\\n\\u001B[1;32m      5\\u001B[0m \\u001B[43m  \\u001B[49m\\u001B[43mtools\\u001B[49m\\u001B[43m \\u001B[49m\\u001B[38;5;241;43m=\\u001B[39;49m\\u001B[43m \\u001B[49m\\u001B[43m[\\u001B[49m\\u001B[43mget_current_weather\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43m__ab_manifest__\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mmodel_dump\\u001B[49m\\u001B[43m(\\u001B[49m\\u001B[43m)\\u001B[49m\\u001B[43m]\\u001B[49m\\n\\u001B[1;32m      6\\u001B[0m \\u001B[43m  \\u001B[49m\\u001B[43m)\\u001B[49m\\n\\u001B[1;32m      7\\u001B[0m \\u001B[38;5;28mprint\\u001B[39m(msg\\u001B[38;5;241m.\\u001B[39mmodel_dump_json(indent\\u001B[38;5;241m=\\u001B[39m\\u001B[38;5;241m4\\u001B[39m))\\n\\u001B[1;32m      8\\u001B[0m \\u001B[38;5;66;03m# 获取最后的事件和工具调用信息\\u001B[39;00m\\n\",\n      \"File \\u001B[0;32m/opt/anaconda3/envs/testenv/lib/python3.9/site-packages/appbuilder/core/console/appbuilder_client/appbuilder_client.py:306\\u001B[0m, in \\u001B[0;36mAppBuilderClient.run\\u001B[0;34m(self, conversation_id, query, file_ids, stream, tools, tool_outputs, tool_choice, end_user_id, action, **kwargs)\\u001B[0m\\n\\u001B[1;32m    302\\u001B[0m url \\u001B[38;5;241m=\\u001B[39m \\u001B[38;5;28mself\\u001B[39m\\u001B[38;5;241m.\\u001B[39mhttp_client\\u001B[38;5;241m.\\u001B[39mservice_url_v2(\\u001B[38;5;124m\\\"\\u001B[39m\\u001B[38;5;124m/app/conversation/runs\\u001B[39m\\u001B[38;5;124m\\\"\\u001B[39m)\\n\\u001B[1;32m    303\\u001B[0m response \\u001B[38;5;241m=\\u001B[39m \\u001B[38;5;28mself\\u001B[39m\\u001B[38;5;241m.\\u001B[39mhttp_client\\u001B[38;5;241m.\\u001B[39msession\\u001B[38;5;241m.\\u001B[39mpost(\\n\\u001B[1;32m    304\\u001B[0m     url, headers\\u001B[38;5;241m=\\u001B[39mheaders, json\\u001B[38;5;241m=\\u001B[39mreq\\u001B[38;5;241m.\\u001B[39mmodel_dump(), timeout\\u001B[38;5;241m=\\u001B[39m\\u001B[38;5;28;01mNone\\u001B[39;00m, stream\\u001B[38;5;241m=\\u001B[39m\\u001B[38;5;28;01mTrue\\u001B[39;00m\\n\\u001B[1;32m    305\\u001B[0m )\\n\\u001B[0;32m--> 306\\u001B[0m \\u001B[38;5;28;43mself\\u001B[39;49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mhttp_client\\u001B[49m\\u001B[38;5;241;43m.\\u001B[39;49m\\u001B[43mcheck_response_header\\u001B[49m\\u001B[43m(\\u001B[49m\\u001B[43mresponse\\u001B[49m\\u001B[43m)\\u001B[49m\\n\\u001B[1;32m    307\\u001B[0m request_id \\u001B[38;5;241m=\\u001B[39m \\u001B[38;5;28mself\\u001B[39m\\u001B[38;5;241m.\\u001B[39mhttp_client\\u001B[38;5;241m.\\u001B[39mresponse_request_id(response)\\n\\u001B[1;32m    308\\u001B[0m \\u001B[38;5;28;01mif\\u001B[39;00m stream:\\n\",\n      \"File \\u001B[0;32m/opt/anaconda3/envs/testenv/lib/python3.9/site-packages/appbuilder/core/_client.py:120\\u001B[0m, in \\u001B[0;36mHTTPClient.check_response_header\\u001B[0;34m(response)\\u001B[0m\\n\\u001B[1;32m    116\\u001B[0m message \\u001B[38;5;241m=\\u001B[39m \\u001B[38;5;124m\\\"\\u001B[39m\\u001B[38;5;124mrequest_id=\\u001B[39m\\u001B[38;5;132;01m{}\\u001B[39;00m\\u001B[38;5;124m , http status code is \\u001B[39m\\u001B[38;5;132;01m{}\\u001B[39;00m\\u001B[38;5;124m, body is \\u001B[39m\\u001B[38;5;132;01m{}\\u001B[39;00m\\u001B[38;5;124m\\\"\\u001B[39m\\u001B[38;5;241m.\\u001B[39mformat(\\n\\u001B[1;32m    117\\u001B[0m     \\u001B[38;5;18m__class__\\u001B[39m\\u001B[38;5;241m.\\u001B[39mresponse_request_id(response), status_code, response\\u001B[38;5;241m.\\u001B[39mtext\\n\\u001B[1;32m    118\\u001B[0m )\\n\\u001B[1;32m    119\\u001B[0m \\u001B[38;5;28;01mif\\u001B[39;00m status_code \\u001B[38;5;241m==\\u001B[39m requests\\u001B[38;5;241m.\\u001B[39mcodes\\u001B[38;5;241m.\\u001B[39mbad_request:\\n\\u001B[0;32m--> 120\\u001B[0m     \\u001B[38;5;28;01mraise\\u001B[39;00m BadRequestException(message)\\n\\u001B[1;32m    121\\u001B[0m \\u001B[38;5;28;01melif\\u001B[39;00m status_code \\u001B[38;5;241m==\\u001B[39m requests\\u001B[38;5;241m.\\u001B[39mcodes\\u001B[38;5;241m.\\u001B[39mforbidden:\\n\\u001B[1;32m    122\\u001B[0m     \\u001B[38;5;28;01mraise\\u001B[39;00m ForbiddenException(message)\\n\",\n      \"\\u001B[0;31mBadRequestException\\u001B[0m: request_id=76224253-163f-46d3-a5eb-b22c6fcec2be , http status code is 400, body is {\\\"code\\\": \\\"QuotaLimitExceeded\\\", \\\"message\\\": \\\"quota\\\\u8d44\\\\u6e90\\\\u5df2\\\\u8fbe\\\\u4e0a\\\\u9650\\\", \\\"request_id\\\": \\\"76224253-163f-46d3-a5eb-b22c6fcec2be\\\"}\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 调用大模型\\n\",\n    \"msg = client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"今天北京的天气怎么样？\\\",\\n\",\n    \"    tools=[appbuilder.Manifest.from_function(get_current_weather)],\\n\",\n    \")\\n\",\n    \"print(msg.model_dump_json(indent=4))\\n\",\n    \"# 获取最后的事件和工具调用信息\\n\",\n    \"event = msg.content.events[-1]\\n\",\n    \"tool_call = event.tool_calls[-1]\\n\",\n    \"\\n\",\n    \"# 获取函数名称和参数\\n\",\n    \"name = tool_call.function.name\\n\",\n    \"args = tool_call.function.arguments\\n\",\n    \"\\n\",\n    \"# 将函数名称映射到具体的函数并执行\\n\",\n    \"raw_result = function_map[name](**args)\\n\",\n    \"\\n\",\n    \"# 传递工具的输出\\n\",\n    \"msg_2 = client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    tool_outputs=[{\\n\",\n    \"        \\\"tool_call_id\\\": tool_call.id,\\n\",\n    \"        \\\"output\\\": str(raw_result)\\n\",\n    \"    }],\\n\",\n    \")\\n\",\n    \"print(msg_2.model_dump_json(indent=4))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 5、ToolCal第二个例子-调用本地工具并且代码更简洁\\n\",\n    \"\\n\",\n    \"我们可以使用AppBuilderClient应用来执行tool_call操作，完成指定的命令，但是需要自己配置client的思考与运行流程，较为繁琐。SDK提供了使用AppBuilderEventHandler简化tool_call操作的功能\\n\",\n    \"\\n\",\n    \"##### 配置运行环境&导入Client应用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"# AppBuilder Token，替换为您个人的Token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 应用为：智能问题解决者\\n\",\n    \"app_id = \\\"b9473e78-754b-463a-916b-f0a9097a8e5f\\\"\\n\",\n    \"app_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_client.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 继承AppBuilderEventHandler类，并实现针对各类型event的处理方法\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from appbuilder.core.console.appbuilder_client.event_handler import AppBuilderEventHandler\\n\",\n    \"class MyEventHandler(AppBuilderEventHandler):\\n\",\n    \"    def execute_local_command(self, cmd: str):\\n\",\n    \"        import subprocess\\n\",\n    \"        try:\\n\",\n    \"            result = subprocess.check_output(cmd, shell=True).decode(\\\"utf-8\\\")\\n\",\n    \"            if result.strip() == \\\"\\\":\\n\",\n    \"                return \\\"命令执行成功，无返回值\\\"\\n\",\n    \"            return result\\n\",\n    \"        except Exception as e:\\n\",\n    \"            return str(e)\\n\",\n    \"    \\n\",\n    \"    def interrupt(self, run_context, run_response):\\n\",\n    \"        thought = run_context.current_thought\\n\",\n    \"        # 绿色打印\\n\",\n    \"        print(\\\"\\\\033[1;32m\\\", \\\"-> Agent 中间思考: \\\", thought, \\\"\\\\033[0m\\\")\\n\",\n    \"\\n\",\n    \"        tool_output = []\\n\",\n    \"        for tool_call in run_context.current_tool_calls:\\n\",\n    \"            tool_call_id = tool_call.id\\n\",\n    \"            tool_res = self.execute_local_command(\\n\",\n    \"                **tool_call.function.arguments)\\n\",\n    \"            # 蓝色打印\\n\",\n    \"            print(\\\"\\\\033[1;34m\\\", \\\"-> 本地ToolCall结果: \\\\n\\\", tool_res, \\\"\\\\033[0m\\\\n\\\")\\n\",\n    \"            tool_output.append(\\n\",\n    \"                {\\n\",\n    \"                    \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"                    \\\"output\\\": tool_res\\n\",\n    \"                }\\n\",\n    \"            )\\n\",\n    \"        return tool_output\\n\",\n    \"    \\n\",\n    \"    def success(self, run_context, run_response):\\n\",\n    \"        print(\\\"\\\\n\\\\033[1;31m\\\",\\\"-> Agent 非流式回答: \\\\n\\\", run_response.answer, \\\"\\\\033[0m\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 定义本地的tools工具\\n\",\n    \"\\n\",\n    \"通过`subprocess.check_output`方法，可以在终端中执行命令，并返回执行结果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"tools = [\\n\",\n    \"    {\\n\",\n    \"        \\\"type\\\": \\\"function\\\",\\n\",\n    \"        \\\"function\\\": {\\n\",\n    \"            \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"            \\\"description\\\": \\\"可以在bash环境中，执行输入的指令，注意，一次只能执行一个原子命令。例如：ls\\\",\\n\",\n    \"            \\\"parameters\\\": {\\n\",\n    \"                \\\"type\\\": \\\"object\\\",\\n\",\n    \"                \\\"properties\\\": {\\n\",\n    \"                    \\\"cmd\\\": {\\n\",\n    \"                        \\\"type\\\": \\\"string\\\",\\n\",\n    \"                        \\\"description\\\": \\\"需要执行的指令\\\",\\n\",\n    \"                    },\\n\",\n    \"                },\\n\",\n    \"                \\\"required\\\": [\\\"cmd\\\"],\\n\",\n    \"            },\\n\",\n    \"        },\\n\",\n    \"    }\\n\",\n    \"]\\n\",\n    \"\\n\",\n    \"with app_client.run_with_handler(\\n\",\n    \"        conversation_id = conversation_id,\\n\",\n    \"        query = \\\"请问当前文件夹下有哪些文件？如果没有test.txt文件，请新建一个test.txt文件，内容为：Hello World！\\\",\\n\",\n    \"        tools = tools,\\n\",\n    \"        event_handler = MyEventHandler(),\\n\",\n    \"    ) as run:\\n\",\n    \"        run.until_done()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \" -> Agent 中间思考:  首先，我需要使用execute_local_command工具来执行'ls'命令，列出当前文件夹下的所有文件。然后，我需要检查输出中是否存在test.txt文件。如果不存在，我将再次使用execute_local_command工具来执行'echo \\\"Hello World\\\" > test.txt'命令，以创建并写入test.txt文件。 \\n\",\n    \" -> 本地ToolCall结果: \\n\",\n    \" multi_tool_call.ipynb\\n\",\n    \"multi_tool_call.py\\n\",\n    \"multi_tool_call_with_handler.ipynb\\n\",\n    \"multi_tool_call_with_handler.py\\n\",\n    \"sdk_ knowledgebase.ipynb\\n\",\n    \"sdk_trace.ipynb\\n\",\n    \"simple_tool_call.ipynb\\n\",\n    \"simple_tool_call.py\\n\",\n    \"tmp.log\\n\",\n    \"黑神话(悟空).pdf\\n\",\n    \" \\n\",\n    \"\\n\",\n    \" -> Agent 中间思考:  根据execute_local_command工具的返回结果，当前文件夹下并没有test.txt文件。因此，我需要使用execute_local_command工具来执行'echo \\\"Hello World\\\" > test.txt'命令，以创建并写入test.txt文件。 \\n\",\n    \" -> 本地ToolCall结果: \\n\",\n    \" 命令执行成功，无返回值 \\n\",\n    \"\\n\",\n    \"\\n\",\n    \" -> Agent 非流式回答: \\n\",\n    \" 当前文件夹下的文件包括：\\n\",\n    \"\\n\",\n    \"- multi_tool_call.ipynb\\n\",\n    \"- multi_tool_call.py\\n\",\n    \"- multi_tool_call_with_handler.ipynb\\n\",\n    \"...\\n\",\n    \"- tmp.log\\n\",\n    \"- 黑神话(悟空).pdf\\n\",\n    \"\\n\",\n    \"经过检查，发现当前文件夹下**不存在**test.txt文件。因此，已经为您新建了一个test.txt文件，并写入了内容“Hello World！”。 \\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 使用AppBuilderEventHandler架构可以简化client的交互方式\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 6 使用异步调用优化toolcall并发执行效率\\n\",\n    \"SDK提供了异步调用接口，可以大幅提升并发执行效率。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\\n\",\n    \"#\\n\",\n    \"# Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n\",\n    \"# you may not use this file except in compliance with the License.\\n\",\n    \"# You may obtain a copy of the License at\\n\",\n    \"#\\n\",\n    \"#     http://www.apache.org/licenses/LICENSE-2.0\\n\",\n    \"#\\n\",\n    \"# Unless required by applicable law or agreed to in writing, software\\n\",\n    \"# distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n\",\n    \"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n\",\n    \"# See the License for the specific language governing permissions and\\n\",\n    \"# limitations under the License.\\n\",\n    \"\\n\",\n    \"import appbuilder\\n\",\n    \"import asyncio\\n\",\n    \"from appbuilder.core.console.appbuilder_client.async_event_handler import (\\n\",\n    \"    AsyncAppBuilderEventHandler,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"class MyEventHandler(AsyncAppBuilderEventHandler):\\n\",\n    \"    def get_current_weather(self, location=None, unit=\\\"摄氏度\\\"):\\n\",\n    \"        return \\\"{} 的温度是 {} {}\\\".format(location, 20, unit)\\n\",\n    \"\\n\",\n    \"    async def interrupt(self, run_context, run_response):\\n\",\n    \"        thought = run_context.current_thought\\n\",\n    \"        # 绿色打印\\n\",\n    \"        print(\\\"\\\\033[1;32m\\\", \\\"-> Agent 中间思考: \\\", thought, \\\"\\\\033[0m\\\")\\n\",\n    \"\\n\",\n    \"        tool_output = []\\n\",\n    \"        for tool_call in run_context.current_tool_calls:\\n\",\n    \"            tool_call_id = tool_call.id\\n\",\n    \"            tool_res = self.get_current_weather(**tool_call.function.arguments)\\n\",\n    \"            # 蓝色打印\\n\",\n    \"            print(\\\"\\\\033[1;34m\\\", \\\"-> 本地ToolCallId: \\\", tool_call_id, \\\"\\\\033[0m\\\")\\n\",\n    \"            print(\\\"\\\\033[1;34m\\\", \\\"-> ToolCall结果: \\\", tool_res, \\\"\\\\033[0m\\\\n\\\")\\n\",\n    \"            tool_output.append({\\\"tool_call_id\\\": tool_call_id, \\\"output\\\": tool_res})\\n\",\n    \"        return tool_output\\n\",\n    \"\\n\",\n    \"    async def success(self, run_context, run_response):\\n\",\n    \"        print(\\\"\\\\n\\\\033[1;31m\\\", \\\"-> Agent 非流式回答: \\\", run_response.answer, \\\"\\\\033[0m\\\")\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def main():\\n\",\n    \"    app_id = \\\"b2a972c5-e082-46e5-b313-acbf51792422\\\"\\n\",\n    \"    tools = [\\n\",\n    \"        {\\n\",\n    \"            \\\"type\\\": \\\"function\\\",\\n\",\n    \"            \\\"function\\\": {\\n\",\n    \"                \\\"name\\\": \\\"get_current_weather\\\",\\n\",\n    \"                \\\"description\\\": \\\"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\\\",\\n\",\n    \"                \\\"parameters\\\": {\\n\",\n    \"                    \\\"type\\\": \\\"object\\\",\\n\",\n    \"                    \\\"properties\\\": {\\n\",\n    \"                        \\\"location\\\": {\\n\",\n    \"                            \\\"type\\\": \\\"string\\\",\\n\",\n    \"                            \\\"description\\\": \\\"城市名，举例：北京\\\",\\n\",\n    \"                        },\\n\",\n    \"                        \\\"unit\\\": {\\\"type\\\": \\\"string\\\", \\\"enum\\\": [\\\"摄氏度\\\", \\\"华氏度\\\"]},\\n\",\n    \"                    },\\n\",\n    \"                    \\\"required\\\": [\\\"location\\\", \\\"unit\\\"],\\n\",\n    \"                },\\n\",\n    \"            },\\n\",\n    \"        }\\n\",\n    \"    ]\\n\",\n    \"\\n\",\n    \"    appbuilder.logger.setLoglevel(\\\"ERROR\\\")\\n\",\n    \"\\n\",\n    \"    async def agent_run(client, query):\\n\",\n    \"        conversation_id = await client.create_conversation()\\n\",\n    \"        with await client.run_with_handler(\\n\",\n    \"            conversation_id=conversation_id,\\n\",\n    \"            query=query,\\n\",\n    \"            tools=tools,\\n\",\n    \"            event_handler=MyEventHandler(),\\n\",\n    \"        ) as run:\\n\",\n    \"            await run.until_done()\\n\",\n    \"\\n\",\n    \"    async def agent_handle():\\n\",\n    \"        client = appbuilder.AsyncAppBuilderClient(app_id)\\n\",\n    \"        task1 = asyncio.create_task(agent_run(client, \\\"北京的天气怎么样\\\"))\\n\",\n    \"        task2 = asyncio.create_task(agent_run(client, \\\"上海的天气怎么样\\\"))\\n\",\n    \"        await asyncio.gather(task1, task2)\\n\",\n    \"        await client.http_client.session.close()\\n\",\n    \"\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(agent_handle())\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    main()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 7、项目总结\\n\",\n    \"\\n\",\n    \"本项目通过多个知识点的学习，以及两个使用AppBuilder-SDK的实操，最终完成了一个支持ToolCall AIAgent的构建。\\n\",\n    \"\\n\",\n    \"- 理论学习：了解AIAgent的基础知识\\n\",\n    \"- 上手实操：深入了解Agent中的FunctionCall运行流程\\n\",\n    \"- 上手实操：入门百度智能云千帆AppBuilder，在十分钟内打造一个个性化AIAgent\\n\",\n    \"- 上手实操：使用AppBuilder-SDK打造一个端云组件联动的进阶Agent\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"希望您可以不吝`Star`，给`AppBuilder-SDK`一些鼓励，期待您的`PR`，一起共建AIAgent生态。\\n\",\n    \"\\n\",\n    \"Github地址：https://github.com/baidubce/app-builder\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/page10.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"最后，您也可以进入`AppBuilder-SDK`的WX交流群，和大家一起交流AppBuilder使用及开发心得。\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://chengmo-dev1.bj.bcebos.com/wechat_group.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"testenv\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.20\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/agent/tool_choice.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# AppBuilder-SDK 指定工具调用使用实例\\n\",\n    \"\\n\",\n    \"* 注意：当前功能为试运行阶段，可能存在如下问题，如使用过程遇到其他问题，欢迎提issue或微信群讨论。\\n\",\n    \"\\n\",\n    \"  * 需开启\\\"组件/知识库结论可直接作为回复\\\"\\n\",\n    \"\\n\",\n    \"  * 组件名称不是界面上的原始名字，而是个人空间组件列表中的英文名\\n\",\n    \"\\n\",\n    \"  * 自定义组件的参数不能使用系统参数，可以使用用户添加的参数\\n\",\n    \"\\n\",\n    \"  * 部分官方组件使用的参数与界面上的参数不一致\\n\",\n    \"\\n\",\n    \"## 一、背景介绍\\n\",\n    \"\\n\",\n    \"指定工具调用是为了方便更多用户在AppBuilder官网创建应用之后，希望能直接调用自己定义的工作流或者官方的组件并应用于自己的业务中。具体的调用方法如下面的教程所示。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 二、实操流程\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 2.1 前置操作简述\\n\",\n    \"\\n\",\n    \"- 【必须】登录[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)创建账户。\\n\",\n    \"- 【必须】在[百度智能云千帆AppBuilder控制台](https://console.bce.baidu.com/ai_apaas/dialogHome)左侧菜单栏『我的密钥』页面获取密钥，并复制。\\n\",\n    \"- 【必须】在python3.9及以上的环境中安装`appbuilder-sdk`\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.2、创建应用\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"##### 2.2.1、点击创建应用界面\\n\",\n    \"点击[百度智能云千帆AppBuilder控制台](https://console.bce.baidu.com/ai_apaas/dialogHome)左侧菜单栏『创建应用』，开始我们的系统应用。\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"#### 2.2.2、填写应用信息，选择工具组件\\n\",\n    \"\\n\",\n    \"我们需要首先配置该应用的基本信息，包括 名称、描述、角色指令、开场白、推荐问、能力组件等。\\n\",\n    \"\\n\",\n    \"在这里我们首先选择一个组件工具，比如天气查询组件。\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://bj.bcebos.com/v1/test-tl/toolchoice_create.jpg?authorization=bce-auth-v1%2F6148abe36db84938886e533121ff9628%2F2024-09-23T02%3A47%3A19Z%2F-1%2Fhost%2F3d4b3940d22aa1090a1ffcd9d47e715b526b372b1e9fd4242f1d77ebdde633b6\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"点击图里组件上方\\\"应用回复设置\\\"，打开\\\"组件/知识库结论可直接作为回复\\\"。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.2.3、发布应用\\n\",\n    \"\\n\",\n    \"我们可以在页面右上角『发布』按钮发布该应用。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.2.4 获取已发布应用的ID\\n\",\n    \"\\n\",\n    \"在 [百度智能云千帆AppBuilder控制台-我的应用](https://console.bce.baidu.com/ai_apaas/app)页面中，可以查看已发布应用的ID，我们复制该ID，开始后续的代码态操作。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.3 使用Python SDK调用已发布App\\n\",\n    \"\\n\",\n    \"当应用已经发布后，我们可以通过SDK在代码态调用，方便用户集成到自己的系统中，通过自己的系统对外提供服务。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.1 引入AppBuilder-SDK，设置TOKEN，设置APPID\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"AppBuilder 模块导入成功！\\n\",\n      \"您的AppBuilder Token为：your_appbuilder_token\\n\",\n      \"您的AppBuilder App ID为：your_publish_app_id\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 引入os模块，引入appbuilder 模块\\n\",\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 设置appbuilder的token密钥，从页面上复制粘贴我的密钥，覆盖此处的 \\\"your_appbuilder_token\\\"\\n\",\n    \"os.environ['APPBUILDER_TOKEN'] = \\\"your_appbuilder_token\\\"\\n\",\n    \"# 设置需要调用的app，从页面上复制粘贴应用ID，覆盖此处的 \\\"your_publish_app_id\\\"\\n\",\n    \"app_id = \\\"your_publish_app_id\\\"\\n\",\n    \"\\n\",\n    \"print(\\\"AppBuilder 模块导入成功！\\\")\\n\",\n    \"print(\\\"您的AppBuilder Token为：{}\\\".format(os.environ['APPBUILDER_TOKEN']))\\n\",\n    \"print(\\\"您的AppBuilder App ID为：{}\\\".format(app_id))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.2 初始化Agent实例，创建会话并对话\\n\",\n    \"\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 基于app_id初始化Agent\\n\",\n    \"builder = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"# 创建会话ID\\n\",\n    \"conversation_id = builder.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.3 正常创建会话并对话\\n\",\n    \"\\n\",\n    \"- 正常对话下(不采用tool_choice模式)组件的调用受到大模型的控制，参数由大模型生成\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"#在不采用tool choice的情况下，正常对话APP应用依赖于应用的大模型选择调用组件，而不是直接与组件交互\\n\",\n    \"st = builder.run(conversation_id=conversation_id, query=\\\"北京今天的天气\\\", stream=True)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'city': '北京'}, 'component_code': 'WeatherQuery', 'component_name': '天气查询'}}, usage=Usage(prompt_tokens=513, completion_tokens=37, total_tokens=550, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# function_call路由到天气查询组件执行得到组件结果，最终经过总结得到最终结果\\n\",\n    \"#下面结果中天气组件的参数({'city': '北京'})由大模型生成\\n\",\n    \"for k in st.content:\\n\",\n    \"    print(k)\\n\",\n    \"    break\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.4 tool_choice方式指定工具参数\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"#导入指定工具参数类\\n\",\n    \"from appbuilder.core.console.appbuilder_client.data_class import ToolChoiceFunction, ToolChoice\\n\",\n    \"#建立基本的工具调用对象，包括工具名字与参数传递\\n\",\n    \"tool_choice_function = ToolChoiceFunction(name=\\\"WeatherQuery\\\", input={\\\"city\\\": \\\"北京天气\\\"})\\n\",\n    \"tool_choice = ToolChoice(type=\\\"function\\\", function=tool_choice_function)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.5 tool_choice方式实现对话应用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"#请求指定工具tool_choice\\n\",\n    \"st = builder.run(conversation_id=conversation_id, query=\\\"北京今天的天气\\\", tool_choice=tool_choice, stream=True)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.6 tool_choice工具调用展示\\n\",\n    \"\\n\",\n    \"- 当前模式下由于是直接调用组件，组件的输入参数由输入参数控制\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'city': '北京天气'}, 'component_code': 'WeatherQuery', 'component_name': '天气查询'}}, usage=None, tool_calls=None)]\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"#可以看出，当前天气查询组件的输入参数query({'city': '北京天气'})由tool_choice控制\\n\",\n    \"#此时直接调用天气调用组件而不是大模型function call选择天气组件提供参数\\n\",\n    \"for k in st.content:\\n\",\n    \"    print(k)\\n\",\n    \"    break\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.7 tool_choice完整结果展示\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 8,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'city': '北京天气'}, 'component_code': 'WeatherQuery', 'component_name': '天气查询'}}, usage=None, tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='preparing', event_type='WeatherQuery', content_type='status', detail={}, usage=None, tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='WeatherQuery', content_type='text', detail={'text': '北京  09月23日(星期一) 08:05更新  15.6 ℃  晴 24℃/12℃  东北风1级 | 湿度74%  未来2小时不会下雨 > 北京今明天云量逐渐增多 明夜有小雨 > 堪比台风降雨!冷空气“撞”上季风 华南暴雨大暴雨持续 局地特大暴雨 推荐 图集 昨天 9/22 23/11℃  今天 9/23 24/12℃  星期二 9/24 24/15℃  48小时预报 09:00 11:00 13:00 15:00 17:00 19:00 21:00 23:00 01:00 03:00 05:00 07:00 09:00 11:00 13:00 15:00 17:00 19:00 21:00 23:00 01:00 03:00 05:00 07:00 09:00 17℃20℃22℃23℃21℃20℃17℃16℃14℃13℃12℃13℃16℃21℃23℃23℃23℃21℃19℃18℃16℃15℃15℃16℃19℃ <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 <3级 15天预报 长期预报 历史天气  今天 9/23 周二 9/24 周三 9/25 周四 9/26 周五 9/27 周六 9/28 周日 9/29 周一 9/30 周二 10/1 周三 10/2 周四 10/3 周五 10/4 周六 10/5 周日 10/6 周一 10/7 晴 多云 多云 多云 多云 多云 小雨 雨 阴 晴 阴 晴 阴 阴 雨 24°24°25°24°25°24°23°16°21°24°23°24°24°25°24°  12°15°14°15°16°16°14°10°13°14°15°16°17°18°16°  多云 小雨 多云 多云 多云 小雨 小雨 晴 多云 阴 多云 阴 阴 阴 雨 查看详情 40天预报  温度趋势 温暖  降水趋势 8次降水  生活指数  穿衣 衬衫  跑步 适宜  钓鱼 适宜  洗车 较适宜  晾晒 适宜  污染扩散指数 中  感冒指数 少发  出行晴雨 沿途天气  我的天空  精彩推荐  堪比台风降雨!华南暴雨大暴雨持续  新闻联播天气预报 全国中秋假期出游天气地图出炉  北京蓝天白云“颜值”在线  秋分:暑退秋澄气转凉 日光夜色两均长  晨味时节之白露  风雨潮“三碰头”  堪比台风降雨!华南暴雨大暴雨持续  新闻联播天气预报 全国中秋假期出游天气地图出炉  北京蓝天白云“颜值”在线  秋分:暑退秋澄气转凉 日光夜色两均长  晨味时节之白露  风雨潮“三碰头”  堪比台风降雨!华南暴雨大暴雨持续  新闻联播天气预报 全国中秋假期出游天气地图出炉  北京蓝天白云“颜值”在线  秋分:暑退秋澄气转凉 日光夜色两均长  晨味时节之白露  风雨潮“三碰头”  未来3天公报 未来10天公报  推荐 直播 图集 短视频 生活  北京今明天云量逐渐增多 明夜有小雨2024-09-23 07:24'}, usage=None, tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='success', event_type='WeatherQuery', content_type='status', detail={}, usage=None, tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'origin_query': '北京今天的天气'}, 'component_code': 'ChatAgent', 'component_name': '聊天助手'}}, usage=None, tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='preparing', event_type='ChatAgent', content_type='status', detail={}, usage=None, tool_calls=None)]\\n\",\n      \"answer='北京今天的天气情况如下' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '北京今天的天气情况如下'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\\n\",\n      \"answer='：\\\\n\\\\n- **日期**：2024年9月23日(星期一)\\\\n- **天气**：晴\\\\n- **温度**：最高温度24℃，' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '：\\\\n\\\\n- **日期**：2024年9月23日(星期一)\\\\n- **天气**：晴\\\\n- **温度**：最高温度24℃，'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\\n\",\n      \"answer='最低温度12℃\\\\n- **风向**：东北风1级\\\\n- **湿度**：74%\\\\n- **未来2小时**：不会下雨\\\\n- **今天云量**：逐渐增多\\\\n- **明天天气**：明夜有小雨\\\\n\\\\n如果您需要更多详细信息或未来几天的天气预报，请告诉我！' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '最低温度12℃\\\\n- **风向**：东北风1级\\\\n- **湿度**：74%\\\\n- **未来2小时**：不会下雨\\\\n- **今天云量**：逐渐增多\\\\n- **明天天气**：明夜有小雨\\\\n\\\\n如果您需要更多详细信息或未来几天的天气预报，请告诉我！'}, usage=Usage(prompt_tokens=1105, completion_tokens=0, total_tokens=1105, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='ChatAgent', content_type='text', detail={'text': ''}, usage=Usage(prompt_tokens=1105, completion_tokens=114, total_tokens=1219, name='Qianfan-Appbuilder-Speed-8k'), tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='success', event_type='ChatAgent', content_type='status', detail={}, usage=None, tool_calls=None)]\\n\",\n      \"answer='' events=[]\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"st = builder.run(conversation_id=conversation_id, query=\\\"北京今天的天气\\\", tool_choice=tool_choice, stream=True)\\n\",\n    \"for k in st.content:\\n\",\n    \"    print(k)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.4 使用Java SDK调用已发布的App\\n\",\n    \"##### 2.4.1 ToolChoice强制命中组件\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"java\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"package org.example;\\n\",\n    \"\\n\",\n    \"import java.io.IOException;\\n\",\n    \"import java.util.*;\\n\",\n    \"\\n\",\n    \"import com.google.gson.annotations.SerializedName;\\n\",\n    \"\\n\",\n    \"import com.baidubce.appbuilder.base.exception.AppBuilderServerException;\\n\",\n    \"import com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\\n\",\n    \"import com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\\n\",\n    \"import com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\\n\",\n    \"import com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientRunRequest;\\n\",\n    \"import com.baidubce.appbuilder.model.appbuilderclient.Event;\\n\",\n    \"import com.baidubce.appbuilder.base.utils.json.JsonUtils;\\n\",\n    \"\\n\",\n    \"class AppBuilderClientDemo {\\n\",\n    \"\\n\",\n    \"    public static void main(String[] args) throws IOException, AppBuilderServerException {\\n\",\n    \"        System.setProperty(\\\"APPBUILDER_TOKEN\\\", \\\"请设置正确的应用密钥\\\");\\n\",\n    \"        String appId = \\\"请设置正确的应用ID\\\";\\n\",\n    \"        AppBuilderClient builder = new AppBuilderClient(appId);\\n\",\n    \"        String conversationId = builder.createConversation();\\n\",\n    \"\\n\",\n    \"        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest();\\n\",\n    \"        request.setAppId(appId);\\n\",\n    \"        request.setConversationID(conversationId);\\n\",\n    \"        request.setQuery(\\\"北京今天的天气\\\");\\n\",\n    \"        request.setStream(false);\\n\",\n    \"        request.setEndUserId(\\\"java_toolchoice_demo\\\");\\n\",\n    \"\\n\",\n    \"        // 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\\n\",\n    \"        Map<String, Object> input = new HashMap<>();\\n\",\n    \"        input.put(\\\"city\\\", \\\"北京\\\");\\n\",\n    \"        AppBuilderClientRunRequest.ToolChoice.Function func = new AppBuilderClientRunRequest.ToolChoice.Function(\\n\",\n    \"                \\\"WeatherQuery\\\", input);\\n\",\n    \"\\n\",\n    \"        AppBuilderClientRunRequest.ToolChoice choice = new AppBuilderClientRunRequest.ToolChoice(\\\"function\\\", func);\\n\",\n    \"        request.setToolChoice(choice);\\n\",\n    \"\\n\",\n    \"        AppBuilderClientIterator itor = builder.run(request);\\n\",\n    \"        while (itor.hasNext()) {\\n\",\n    \"            AppBuilderClientResult result = itor.next();\\n\",\n    \"            System.out.println(result);\\n\",\n    \"        }\\n\",\n    \"    }\\n\",\n    \"}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.5 使用Go SDK调用已发布的应用\\n\",\n    \"##### 2.5.1 ToolChoice强制命中组件\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"go\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"package main\\n\",\n    \"\\n\",\n    \"import (\\n\",\n    \"\\t\\\"errors\\\"\\n\",\n    \"\\t\\\"fmt\\\"\\n\",\n    \"\\t\\\"io\\\"\\n\",\n    \"\\t\\\"os\\\"\\n\",\n    \"\\n\",\n    \"\\t\\\"github.com/baidubce/app-builder/go/appbuilder\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"func main() {\\n\",\n    \"\\t// 设置APPBUILDER_TOKEN、GATEWAY_URL_V2环境变量\\n\",\n    \"\\tos.Setenv(\\\"APPBUILDER_TOKEN\\\", \\\"请设置正确的应用密钥\\\")\\n\",\n    \"\\t// 默认可不填，默认值是 https://qianfan.baidubce.com\\n\",\n    \"\\tos.Setenv(\\\"GATEWAY_URL_V2\\\", \\\"\\\")\\n\",\n    \"\\tconfig, err := appbuilder.NewSDKConfig(\\\"\\\", \\\"\\\")\\n\",\n    \"\\tif err != nil {\\n\",\n    \"\\t\\tfmt.Println(\\\"new config failed: \\\", err)\\n\",\n    \"\\t\\treturn\\n\",\n    \"\\t}\\n\",\n    \"\\t// 初始化实例\\n\",\n    \"\\tappID := \\\"请填写正确的应用ID\\\"\\n\",\n    \"\\tbuilder, err := appbuilder.NewAppBuilderClient(appID, config)\\n\",\n    \"\\tif err != nil {\\n\",\n    \"\\t\\tfmt.Println(\\\"new agent builder failed: \\\", err)\\n\",\n    \"\\t\\treturn\\n\",\n    \"\\t}\\n\",\n    \"\\t// 创建对话ID\\n\",\n    \"\\tconversationID, err := builder.CreateConversation()\\n\",\n    \"\\tif err != nil {\\n\",\n    \"\\t\\tfmt.Println(\\\"create conversation failed: \\\", err)\\n\",\n    \"\\t\\treturn\\n\",\n    \"\\t}\\n\",\n    \"\\n\",\n    \"  // 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\\n\",\n    \"\\tinput := make(map[string]any)\\n\",\n    \"\\tinput[\\\"city\\\"] = \\\"北京\\\"\\n\",\n    \"\\tend_user_id := \\\"go_toolchoice_demo\\\"\\n\",\n    \"\\ti, err := client.Run(AppBuilderClientRunRequest{\\n\",\n    \"\\t\\tConversationID: conversationID,\\n\",\n    \"\\t\\tAppID:          appID,\\n\",\n    \"\\t\\tQuery:          \\\"\\\",\\n\",\n    \"\\t\\tEndUserID:      &end_user_id,\\n\",\n    \"\\t\\tStream:         false,\\n\",\n    \"\\t\\tToolChoice: &ToolChoice{\\n\",\n    \"\\t\\t\\tType: \\\"function\\\",\\n\",\n    \"\\t\\t\\tFunction: ToolChoiceFunction{\\n\",\n    \"\\t\\t\\t\\tName:  \\\"WeatherQuery\\\",\\n\",\n    \"\\t\\t\\t\\tInput: input,\\n\",\n    \"\\t\\t\\t},\\n\",\n    \"\\t\\t},\\n\",\n    \"\\t})\\n\",\n    \"\\n\",\n    \"\\tif err != nil {\\n\",\n    \"\\t\\tfmt.Println(\\\"run failed: \\\", err)\\n\",\n    \"\\t\\treturn\\n\",\n    \"\\t}\\n\",\n    \"\\n\",\n    \"    for answer, err := i.Next(); err == nil; answer, err = i.Next() {\\n\",\n    \"\\t\\tfor _, ev := range answer.Events {\\n\",\n    \"\\t\\t\\tevJSON, _ := json.Marshal(ev)\\n\",\n    \"\\t\\t\\tfmt.Println(string(evJSON))\\n\",\n    \"\\t\\t}\\n\",\n    \"\\t}\\n\",\n    \"}\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.11.7\"\n  },\n  \"vscode\": {\n   \"interpreter\": {\n    \"hash\": \"31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6\"\n   }\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/rag/console_dataset.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"bd16bc4e-9e7a-4119-a9e8-55b1adb7b560\",\n   \"metadata\": {},\n   \"source\": [\n    \"# console端知识库操作助手\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"用户可通过SDK对console端知识库进行操作，实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作，可在平台console中查看结果。\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"\\n\",\n    \"2.安装appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"f66602fd-680d-4f28-8f2d-fb4b79845a70\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"id\": \"7fef1d24-0aa5-4697-b49e-9b087408e319\",\n   \"metadata\": {\n    \"ExecuteTime\": {\n     \"end_time\": \"2024-02-02T09:04:39.646010Z\",\n     \"start_time\": \"2024-02-02T09:04:39.638630Z\"\n    }\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"init done\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import os\\n\",\n    \"\\n\",\n    \"#  设置环境变量\\n\",\n    \"#  请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"\\n\",\n    \"print(\\\"init done\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"da65c0ca-c7b8-416d-be70-4b7f83f8376c\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 开发过程\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"source\": [\n    \"### 初始化已有知识库\\n\",\n    \"获取线上已有知识库的ID，可在[console](https://console.bce.baidu.com/ai_apaas/dataset)端查看，示例\\n\",\n    \"\\n\",\n    \"<img width=\\\"1536\\\" alt=\\\"image\\\" src=\\\"./image/dataset示例.png\\\">\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"id\": \"4fcce3379af01f31\"\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"# 初始化已有线上知识库, dataset_id 可在平台console中查看\\n\",\n    \"dataset_id = \\\"...\\\"\\n\",\n    \"dataset = appbuilder.console.Dataset(dataset_id)\"\n   ],\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"id\": \"e6512896d659d339\"\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"0b9e894c-9b1c-4d14-8fba-85607c07d091\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 创建全新知识库\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"cb554cf7-3f07-4a16-a760-57064f35f6cc\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 创建全新知识库\\n\",\n    \"dataset = appbuilder.console.Dataset.create_dataset(\\\"my_dataset\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"4305e336-67da-4aec-a807-d5ef1b66987c\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 上传文档到知识库\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"41fc3bd1-1a9d-4515-99d5-4704adaec508\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 设置文档路径，例如“./test.pdf”\\n\",\n    \"file_path1 = \\\"...\\\"\\n\",\n    \"file_path2 = \\\"...\\\"\\n\",\n    \"file_paths = [file_path1, file_path2]\\n\",\n    \"# 将文档上传到知识库\\n\",\n    \"document_infos = dataset.add_documents(file_paths)\\n\",\n    \"print(document_infos)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"7e4fc1bf-7af9-4a69-a409-e1f0c53b3651\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 获取知识库关联文档\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"fd628ef9-1f61-4350-81f6-9eaea5342400\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 获取第一页的文档列表, 每页10条\\n\",\n    \"document_list = dataset.get_documents(1, 10)\\n\",\n    \"print(document_list)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"6dc7f0ec-e556-4246-b7c6-92a7242c8194\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 删除知识库中的文档\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"17c50ea0-521d-42c2-82c8-34a70510be3d\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 删除第一个文档\\n\",\n    \"document_ids = [document_list.data[0].id]\\n\",\n    \"dataset.delete_documents(document_ids)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.11.5\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/rag/console_rag.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"f802e64d-4eaa-445d-a48a-1042a91bc394\",\n   \"metadata\": {\n    \"tags\": []\n   },\n   \"source\": [\n    \"# console端RAG问答助手\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"使用console端RAG应用，对用户的请求进行回答。\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"\\n\",\n    \"2.安装appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"2939356f-61c2-42e9-9e0c-fc6729c193f6\",\n   \"metadata\": {\n    \"tags\": []\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"id\": \"4ccff03b-1567-4e8b-8e1f-9a5032690406\",\n   \"metadata\": {\n    \"ExecuteTime\": {\n     \"end_time\": \"2024-01-29T08:53:09.839677Z\",\n     \"start_time\": \"2024-01-29T08:53:09.836602Z\"\n    }\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"init done\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import os\\n\",\n    \"\\n\",\n    \"#  设置环境变量\\n\",\n    \"#  请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"\\n\",\n    \"print(\\\"init done\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"aeb2fa55-075f-48df-a9fb-8b40d9900684\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 开发过程\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"id\": \"e77c402f3ec3e40\",\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"source\": [\n    \"### 获取线上已有RAG应用的ID\\n\",\n    \"线上已有RAG应用ID，可在[console](https://console.bce.baidu.com/ai_apaas/app)端查看，注意，完成应用的创建后，需要点击立即使用，发布应用后，才可被SDK调用，示例,\\n\",\n    \"\\n\",\n    \"<img width=\\\"1536\\\" alt=\\\"image\\\" src=\\\"./image/rag示例.png\\\">\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"41559341-fd7a-478c-a08b-1477d79e9d41\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 线上RAG应用ID，可在console端查看\\n\",\n    \"app_id = \\\"...\\\"\\n\",\n    \"conversation_id = \\\"...\\\" # 会话ID，可选参数，不传默认新建会话\\n\",\n    \"rag_app = appbuilder.console.RAG(app_id)\\n\",\n    \"query = \\\"中国的首都在哪里\\\"\\n\",\n    \"answer = rag_app.run(appbuilder.Message(query)) # 新建对话\\n\",\n    \"print(answer.content)\\n\",\n    \"conversation_id = answer.conversation_id # 获取会话ID，可用于下次会话\\n\",\n    \"print(conversation_id)\\n\",\n    \"query = \\\"它有哪些旅游景点\\\"\\n\",\n    \"answer = rag_app.run(appbuilder.Message(query), conversation_id) # 接上次对话\\n\",\n    \"print(answer.content)\\n\",\n    \"print(answer.extra)  # 获取结果来源\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.11.5\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/rag/qa_system_1_dataset.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 企业级问答系统 —— 离线知识生产流程\\n\",\n    \"\\n\",\n    \"## 一、背景介绍\\n\",\n    \"\\n\",\n    \"智能问答系统是当前应用范围最广，最容易落地的大模型应用。通常来说，智能问答系统包括以下五部分：\\n\",\n    \"1. Query理解\\n\",\n    \"2. 混合检索召回\\n\",\n    \"3. 语义排序\\n\",\n    \"4. 答案生成\\n\",\n    \"5. 追问生成\\n\",\n    \"\\n\",\n    \"AppBuilder在问答系统沉淀了最佳实践流程，并以极易用的组件化的方式对外开放，可以使用页面操作 + 低代码的方式快速搭建自己的问答系统。\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/qa_flow.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 二、实操流程\\n\",\n    \"\\n\",\n    \"整体使用流程包括以下三个环节：\\n\",\n    \"\\n\",\n    \"1. 登录[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)创建账户，\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/product.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"2. 在[百度智能云千帆AppBuilder控制台](https://console.bce.baidu.com/ai_apaas/dialogHome)右侧头像栏『API密钥』页面获取密钥，并复制。\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/token.jpg\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/get_token.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"3. 引用AppBuilder SDK代码，调用Dataset API相关接口，创建数据集，并增、查、删除文档。\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.1 环境准备\\n\",\n    \"\\n\",\n    \"首先需要安装AppBuilder-SDK代码库，若已在开发环境安装，则可跳过此步。\\n\",\n    \"\\n\",\n    \"**注意：**: appbuilder-sdk 的python版本要求 3.9+\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"Defaulting to user installation because normal site-packages is not writeable\\n\",\n      \"Collecting appbuilder-sdk\\n\",\n      \"  Using cached appbuilder_sdk-0.6.0-py3-none-any.whl.metadata (768 bytes)\\n\",\n      \"Requirement already satisfied: requests in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (2.31.0)\\n\",\n      \"Requirement already satisfied: proto-plus==1.22.3 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (1.22.3)\\n\",\n      \"Requirement already satisfied: pydantic==2.6.4 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (2.6.4)\\n\",\n      \"Requirement already satisfied: numpy in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (1.24.4)\\n\",\n      \"Requirement already satisfied: SQLAlchemy~=1.4.50 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (1.4.52)\\n\",\n      \"Requirement already satisfied: urllib3<2.0.0 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (1.26.18)\\n\",\n      \"Requirement already satisfied: tenacity in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (8.2.3)\\n\",\n      \"Requirement already satisfied: pandas in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (2.2.1)\\n\",\n      \"Requirement already satisfied: openpyxl in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (3.1.2)\\n\",\n      \"Requirement already satisfied: pymochow>=1.1.2 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (1.1.2)\\n\",\n      \"Requirement already satisfied: parameterized in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from appbuilder-sdk) (0.9.0)\\n\",\n      \"Requirement already satisfied: protobuf<5.0.0dev,>=3.19.0 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from proto-plus==1.22.3->appbuilder-sdk) (4.25.3)\\n\",\n      \"Requirement already satisfied: annotated-types>=0.4.0 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from pydantic==2.6.4->appbuilder-sdk) (0.6.0)\\n\",\n      \"Requirement already satisfied: pydantic-core==2.16.3 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from pydantic==2.6.4->appbuilder-sdk) (2.16.3)\\n\",\n      \"Requirement already satisfied: typing-extensions>=4.6.1 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from pydantic==2.6.4->appbuilder-sdk) (4.10.0)\\n\",\n      \"Requirement already satisfied: orjson in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from pymochow>=1.1.2->appbuilder-sdk) (3.9.15)\\n\",\n      \"Requirement already satisfied: future in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages (from pymochow>=1.1.2->appbuilder-sdk) (0.18.2)\\n\",\n      \"Requirement already satisfied: et-xmlfile in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from openpyxl->appbuilder-sdk) (1.1.0)\\n\",\n      \"Requirement already satisfied: python-dateutil>=2.8.2 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from pandas->appbuilder-sdk) (2.8.2)\\n\",\n      \"Requirement already satisfied: pytz>=2020.1 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from pandas->appbuilder-sdk) (2024.1)\\n\",\n      \"Requirement already satisfied: tzdata>=2022.7 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from pandas->appbuilder-sdk) (2024.1)\\n\",\n      \"Requirement already satisfied: charset-normalizer<4,>=2 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from requests->appbuilder-sdk) (3.3.2)\\n\",\n      \"Requirement already satisfied: idna<4,>=2.5 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from requests->appbuilder-sdk) (3.6)\\n\",\n      \"Requirement already satisfied: certifi>=2017.4.17 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from requests->appbuilder-sdk) (2024.2.2)\\n\",\n      \"Requirement already satisfied: six>=1.5 in /Users/chengmo/Library/Python/3.9/lib/python/site-packages (from python-dateutil>=2.8.2->pandas->appbuilder-sdk) (1.16.0)\\n\",\n      \"Using cached appbuilder_sdk-0.6.0-py3-none-any.whl (335 kB)\\n\",\n      \"Installing collected packages: appbuilder-sdk\\n\",\n      \"Successfully installed appbuilder-sdk-0.6.0\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.2 引入AppBuilder-SDK，并设置TOKEN\\n\",\n    \"\\n\",\n    \"**注意：** 请使用刚才在AppBuilder平台上新建的个人TOKEN\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 9,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"AppBuilder 模块导入成功！\\n\",\n      \"您的AppBuilder Token为：your_appbuilder_token\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 引入os模块，引入appbuilder 模块\\n\",\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 设置appbuilder的token密钥，从页面上复制粘贴token，覆盖此处的 \\\"your_appbuilder_token\\\"\\n\",\n    \"os.environ['APPBUILDER_TOKEN'] = \\\"your_appbuilder_token\\\"\\n\",\n    \"\\n\",\n    \"print(\\\"AppBuilder 模块导入成功！\\\")\\n\",\n    \"print(\\\"您的AppBuilder Token为：{}\\\".format(os.environ['APPBUILDER_TOKEN']))\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.3 创建全新知识库\\n\",\n    \"\\n\",\n    \"我们从零开始创建一个新的知识库，并使用它来支持问答系统。我们将其命名为**说明书知识库**\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"知识库创建成功！ 知识库的ID为：c368a982-699f-4114-9e9a-c08b76c07f92， 知识库的名称为： 说明书知识库\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 创建全新知识库\\n\",\n    \"dataset = appbuilder.console.Dataset.create_dataset(\\\"说明书知识库\\\")\\n\",\n    \"\\n\",\n    \"print(\\\"知识库创建成功！ 知识库的ID为：{}， 知识库的名称为： {}\\\".format(\\n\",\n    \"    dataset.dataset_id,\\n\",\n    \"    dataset.dataset_name))\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.4 上传文档到知识库\\n\",\n    \"\\n\",\n    \"在notebook的同级目录`./qa_system`下，我们提前准备了两篇文档：\\n\",\n    \"- `./qa_system/平板电脑说明书.pdf`\\n\",\n    \"- `./qa_system/显示器说明书.pdf`\\n\",\n    \"\\n\",\n    \"我们将这两篇文档上传到知识库中，用于后续问答应用的私域知识检索。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"文档上传到知识库成功！知识库中的文档ID为：['c396c715-66d8-49cb-af9d-af0bd08a16e2', '817d29bb-be72-420b-bee1-c1d9b1116826']\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"file_1 = \\\"./qa_system/平板电脑说明书.pdf\\\"\\n\",\n    \"file_2 = \\\"./qa_system/显示器说明书.pdf\\\"\\n\",\n    \"\\n\",\n    \"document_infos = dataset.add_documents([\\n\",\n    \"    file_1, file_2\\n\",\n    \"])\\n\",\n    \"\\n\",\n    \"print(\\\"文档上传到知识库成功！知识库中的文档ID为：{}\\\".format(document_infos.document_ids))\\n\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.5 查找知识库中的文档\\n\",\n    \"\\n\",\n    \"问答系统中的知识库，常用增、删、查操作，我们刚才演示了增加文档的方法，下面演示如何查找文档。\\n\",\n    \"\\n\",\n    \"我们获取[百度智能云千帆AppBuilder控制台-我的知识](https://console.bce.baidu.com/ai_apaas/dataset)页面中，我们刚才创建的知识库中的文档列表。\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/doc_list.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"文档列表获取成功！\\n\",\n      \"第二个的文档是: 平板电脑说明书.pdf, 文档ID是: c396c715-66d8-49cb-af9d-af0bd08a16e2, 文档字数是: 8568\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"doc_list = dataset.get_documents(page=1,limit=10)\\n\",\n    \"print(\\\"文档列表获取成功！\\\")\\n\",\n    \"print(\\\"第二个的文档是: {}, 文档ID是: {}, 文档字数是: {}\\\".format(\\n\",\n    \"    doc_list.data[1].name, doc_list.data[1].id, doc_list.data[1].word_count))\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.6 删除知识库中的文档\\n\",\n    \"\\n\",\n    \"下面我们演示如何删除知识库中的文档。我们尝试删除 『平板电脑说明书.pdf』 这篇文档\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"文档: 平板电脑说明书.pdf, 文档ID: c396c715-66d8-49cb-af9d-af0bd08a16e2 删除成功!\\n\",\n      \"文档删除成功，请刷新『知识库』前端页面，观察是否已无『平板电脑说明书.pdf』文档\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"need_delete_doc_name = \\\"平板电脑说明书.pdf\\\"\\n\",\n    \"need_delete_doc_id = \\\"\\\"\\n\",\n    \"\\n\",\n    \"doc_list = dataset.get_documents(page=1,limit=10)\\n\",\n    \"for doc in doc_list.data:\\n\",\n    \"    if doc.name == need_delete_doc_name:\\n\",\n    \"        need_delete_doc_id = doc.id\\n\",\n    \"        break\\n\",\n    \"\\n\",\n    \"if need_delete_doc_id == \\\"\\\":\\n\",\n    \"    print(\\\"未找到指定文档，请检查 2.4 步骤是否正确上传，以及2.5步骤中是否展示了正确的文档列表\\\")\\n\",\n    \"else:\\n\",\n    \"    dataset.delete_documents([need_delete_doc_id])\\n\",\n    \"    print(\\\"文档: {}, 文档ID: {} 删除成功!\\\".format(\\n\",\n    \"        need_delete_doc_name,\\n\",\n    \"        need_delete_doc_id\\n\",\n    \"    ))\\n\",\n    \"\\n\",\n    \"print(\\\"文档删除成功，请刷新『知识库』前端页面，观察是否已无『{}』文档\\\".format(need_delete_doc_name))\\n\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"执行完上述步骤后，前端页面刷新，指定文档已经被成功删除\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/delete_doc.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 8,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"当前创建的知识库的ID为：c368a982-699f-4114-9e9a-c08b76c07f92， 知识库的名称为： 说明书知识库\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 再一次确认当前知识库的 Name 与 ID，方便后续 企业级问答系统 —— 在线问答流程 的使用\\n\",\n    \"\\n\",\n    \"print(\\\"当前创建的知识库的ID为：{}， 知识库的名称为： {}\\\".format(\\n\",\n    \"    dataset.dataset_id,\\n\",\n    \"    dataset.dataset_name))\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 三、总结\\n\",\n    \"\\n\",\n    \"AppBuilder 为 基于RAG的 企业问答系统提供了 `appbuilder.console.dataset` API，可以方便的以代码态进行知识库的管理，实现基本的增删改查业务需求。\\n\",\n    \"\\n\",\n    \"本示例展示了如何从零创建知识库，并实现增、查、改的代码，并可以观察SDK与前端页面的联动。\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  },\n  \"orig_nbformat\": 4,\n  \"vscode\": {\n   \"interpreter\": {\n    \"hash\": \"31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6\"\n   }\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/rag/qa_system_2_dialogue.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 企业级问答系统 —— 在线问答流程\\n\",\n    \"\\n\",\n    \"## 一、背景介绍\\n\",\n    \"\\n\",\n    \"智能问答系统是当前应用范围最广，最容易落地的大模型应用。通常来说，智能问答系统包括以下五部分：\\n\",\n    \"1. Query理解\\n\",\n    \"2. 混合检索召回\\n\",\n    \"3. 语义排序\\n\",\n    \"4. 答案生成\\n\",\n    \"5. 追问生成\\n\",\n    \"\\n\",\n    \"AppBuilder在问答系统沉淀了最佳实践流程，并以极易用的组件化的方式对外开放，可以使用页面操作 + 低代码的方式快速搭建自己的问答系统。\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/qa_flow.png\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 二、实操流程\\n\",\n    \"\\n\",\n    \"推荐您先完成[企业级问答系统——离线知识生产流程](./qa_system_1_dataset.ipynb)的文档的学习，再进行本文的操作。\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 2.1 前置操作简述\\n\",\n    \"\\n\",\n    \"- 【必须】登录[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)创建账户。\\n\",\n    \"- 【必须】在[百度智能云千帆AppBuilder控制台](https://console.bce.baidu.com/ai_apaas/dialogHome)左侧菜单栏『我的密钥』页面获取密钥，并复制。\\n\",\n    \"- 【必须】在python3.9及以上的环境中安装`appbuilder-sdk`\\n\",\n    \"- 【非必须】(可以在创建应用时在页面操作)通过SDK代码态创建知识库，并上传文档，参考[企业级问答系统——离线知识生产流程](./qa_system_1_dataset.ipynb)，\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.2、创建应用\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"##### 2.2.1、点击创建应用界面\\n\",\n    \"点击[百度智能云千帆AppBuilder控制台](https://console.bce.baidu.com/ai_apaas/dialogHome)左侧菜单栏『创建应用』，开始我们的创建知识问答系统应用。\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/magic_create.jpg\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"#### 2.2.2、填写应用信息，使用魔法棒自动生成instruction\\n\",\n    \"\\n\",\n    \"我们需要首先配置该应用的基本信息，包括 名称、描述、角色指令、开场白、推荐问、能力组件等。\\n\",\n    \"\\n\",\n    \"这类信息比较繁杂，存在一些填写技巧，填写的质量决定了后续应用的使用体验。\\n\",\n    \"\\n\",\n    \"AppBuilder 提供了『魔法棒』功能，可以自动生成instruction。用户只需要提供简单的描述，即可自动生成instruction。\\n\",\n    \"\\n\",\n    \"示例描述：`你是一个尽职尽责的客服问答助手。你有多个产品使用说明书，根据说明书上的内容回答用户的使用问题。`\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/magic_instruction.jpg\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\\n\",\n    \"\\n\",\n    \"生成结果示例：\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/app_preview.jpg\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.2.3、添加知识库\\n\",\n    \"\\n\",\n    \"在 『能力扩展』-『知识库』的操作栏中，我们添加在 [企业级问答系统——离线知识生产流程](./qa_system_1_dataset.ipynb) 中创建的 『说明书知识库』\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/add_knowledge.jpg\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.2.4、页面对话并发布应用\\n\",\n    \"\\n\",\n    \"我们可以在页面右侧『预览与调试』对话栏中，通过对话进行快速调试，若符合预期，则点选右上角『发布』按钮发布该应用。\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/web_chat.jpg\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.2.5 获取已发布应用的ID\\n\",\n    \"\\n\",\n    \"在 [百度智能云千帆AppBuilder控制台-我的应用](https://console.bce.baidu.com/ai_apaas/app)页面中，可以查看已发布应用的ID，我们复制该ID，开始后续的代码态操作。\\n\",\n    \"\\n\",\n    \"<img src=\\\"./qa_system/get_app_id.jpg\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.3 使用SDK调用已发布App\\n\",\n    \"\\n\",\n    \"当应用已经发布后，我们可以通过SDK在代码态调用，方便用户集成到自己的系统中，通过自己的系统对外提供服务。\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.1 引入AppBuilder-SDK，设置TOKEN，设置APPID\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"AppBuilder 模块导入成功！\\n\",\n      \"您的AppBuilder Token为：your api key\\n\",\n      \"您的AppBuilder App ID为：3df6c11e-44ec-438a-86a9-47b590e7cef5\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 引入os模块，引入appbuilder 模块\\n\",\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 设置appbuilder的token密钥，从页面上复制粘贴我的密钥，覆盖此处的 \\\"your_appbuilder_token\\\"\\n\",\n    \"os.environ['APPBUILDER_TOKEN'] = \\\"your_appbuilder_token\\\"\\n\",\n    \"# 设置需要调用的app，从页面上复制粘贴应用ID，覆盖此处的 \\\"your_publish_app_id\\\"\\n\",\n    \"app_id = \\\"your_publish_app_id\\\"\\n\",\n    \"\\n\",\n    \"print(\\\"AppBuilder 模块导入成功！\\\")\\n\",\n    \"print(\\\"您的AppBuilder Token为：{}\\\".format(os.environ['APPBUILDER_TOKEN']))\\n\",\n    \"print(\\\"您的AppBuilder App ID为：{}\\\".format(app_id))\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.2 初始化Agent实例，创建会话并对话\\n\",\n    \"\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"智能客服问答助手的回复是：你好，作为客服问答助手，我可以为您解答关于多个产品的使用问题。如果您有任何疑问或需要帮助，请随时告诉我。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 初始化Agent实例\\n\",\n    \"agent = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"\\n\",\n    \"# 创建会话ID\\n\",\n    \"conversation_id = agent.create_conversation()\\n\",\n    \"\\n\",\n    \"# 发送并消息\\n\",\n    \"response_message = agent.run(\\n\",\n    \"    conversation_id = conversation_id,\\n\",\n    \"    query=\\\"你好，请问你可以为我做什么？\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"print(\\\"智能客服问答助手的回复是：{}\\\".format(response_message.content.answer))\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.3 使用Stream模式，更快的刷新回复结果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"流式输出回答：\\n\",\n      \"流式输出回答：\\n\",\n      \"流式输出回答：\\n\",\n      \"流式输出回答：显示器的放置\\n\",\n      \"流式输出回答：高度需要注意以下几点：\\n\",\n      \"\\n\",\n      \"1. **调整显示器高度以使眼睛和显示器中心的距离适合可视距离的习惯**^[1]^。\\n\",\n      \"流式输出回答：\\n\",\n      \"2. **如果您的显示器无法进行高度调整，则可能需要在显示器底座下放置几本书或其他坚固的物体以达到希望的高度**^[1]^。\\n\",\n      \"流式输出回答：\\n\",\n      \"3. **一般准则是调整显示器位置使屏幕顶部处于或略低于您在座位上感到舒适时视线的高度**^[1]^。\\n\",\n      \"流式输出回答：\\n\",\n      \"4. **务必优化您的显示器高度以使眼睛和显示器中心的距离适合可视距离的习惯，同时确保您在眼部肌肉处于放松状态时看屏幕感到\\n\",\n      \"流式输出回答：舒适**^[1]^。\\n\",\n      \"流式输出回答：\\n\",\n      \"流式输出回答：\\n\",\n      \"\\n\",\n      \"最终回答拼接结果：显示器的放置高度需要注意以下几点：\\n\",\n      \"\\n\",\n      \"1. **调整显示器高度以使眼睛和显示器中心的距离适合可视距离的习惯**^[1]^。\\n\",\n      \"2. **如果您的显示器无法进行高度调整，则可能需要在显示器底座下放置几本书或其他坚固的物体以达到希望的高度**^[1]^。\\n\",\n      \"3. **一般准则是调整显示器位置使屏幕顶部处于或略低于您在座位上感到舒适时视线的高度**^[1]^。\\n\",\n      \"4. **务必优化您的显示器高度以使眼睛和显示器中心的距离适合可视距离的习惯，同时确保您在眼部肌肉处于放松状态时看屏幕感到舒适**^[1]^。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 使用Steam模式发送并接受消息\\n\",\n    \"response_message = agent.run(\\n\",\n    \"    conversation_id = conversation_id,\\n\",\n    \"    query=\\\"显示器的放置高度需要注意什么\\\",\\n\",\n    \"    stream=True\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"final_answer = \\\"\\\"\\n\",\n    \"for content in response_message.content:\\n\",\n    \"    final_answer += content.answer\\n\",\n    \"    print(\\\"流式输出回答：{}\\\".format(content.answer))\\n\",\n    \"\\n\",\n    \"print(\\\"\\\\n最终回答拼接结果：{}\\\".format(final_answer))\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.4 多轮对话\\n\",\n    \"\\n\",\n    \"使用同一个conversation_id 即可进行多轮对话\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"当前的 ConversationID 为: 6c217eb2-d822-4b06-8f6c-d0e94f23dc09\\n\",\n      \"\\n\",\n      \"用户的第一轮问题是： 你好，请问电源指示灯未点亮是什么原因\\n\",\n      \"\\n\",\n      \"智能客服问答助手的回复是：你好，根据搜索结果，电源指示灯未点亮的可能原因包括：显示器的电源开关未打开、电源线松动或断开、插座没有电等^[1]^。\\n\",\n      \"\\n\",\n      \"用户的第二轮问题是： 我应该怎么操作解决该问题\\n\",\n      \"\\n\",\n      \"智能客服问答助手的回复是：如果显示器的电源指示灯未点亮，且没有图像，可能有以下几种原因：显示器的电源开关未打开、电源线松动或断开、插座没有电。因此，建议首先检查这些可能的原因，并采取相应的解决措施：确保电线正确连接、确保插座有电、打开显示器电源、尝试使用另一电源线、尝试使用另一电源插座^[1]^。\\n\",\n      \"\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"conversation_id = agent.create_conversation()\\n\",\n    \"print(\\\"当前的 ConversationID 为: {}\\\\n\\\".format(conversation_id))\\n\",\n    \"\\n\",\n    \"# 发送第一轮消息\\n\",\n    \"first_query = \\\"你好，请问电源指示灯未点亮是什么原因\\\"\\n\",\n    \"response_message = agent.run(\\n\",\n    \"    conversation_id = conversation_id,\\n\",\n    \"    query=first_query\\n\",\n    \")\\n\",\n    \"print(\\\"用户的第一轮问题是： {}\\\\n\\\".format(first_query))\\n\",\n    \"print(\\\"智能客服问答助手的回复是：{}\\\\n\\\".format(response_message.content.answer))\\n\",\n    \"\\n\",\n    \"# 发送第二轮消息\\n\",\n    \"second_query = \\\"我应该怎么操作解决该问题\\\"\\n\",\n    \"response_message = agent.run(\\n\",\n    \"    conversation_id = conversation_id, # 继续复用上一轮对话ID\\n\",\n    \"    query=second_query\\n\",\n    \")\\n\",\n    \"print(\\\"用户的第二轮问题是： {}\\\\n\\\".format(second_query))\\n\",\n    \"print(\\\"智能客服问答助手的回复是：{}\\\\n\\\".format(response_message.content.answer))\\n\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 2.3.5 展示回答中的引用的文档\\n\",\n    \"\\n\",\n    \"回答中若引用了知识库中的文档，可以提供展示文档名功能，更置信的回答用户问题。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 8,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"智能客服问答助手的回复是：在Windows系统中安装显示器驱动程序的步骤如下：\\n\",\n      \"\\n\",\n      \"1. 关闭计算机和所有已连接设备的电源，确保显示器连接正确^[1]^。\\n\",\n      \"2. 打开显示器的电源，然后打开系统单元的电源，让系统启动进入Windows系统^[1]^。\\n\",\n      \"3. 打开显示属性窗口，单击开始、控制面板、硬件和声音图标，然后单击显示图标^[1][2]^。\\n\",\n      \"4. 单击更改显示设置选项卡，然后单击高级设置图标^[1][2]^。\\n\",\n      \"5. 单击显示器选项卡，然后单击属性按钮^[1][2]^。\\n\",\n      \"6. 单击驱动程序选项卡，然后单击更新驱动程序，选择浏览计算机以查找驱动程序^[1][2]^。\\n\",\n      \"7. 选择从计算机上的设备驱动程序列表中选择，然后单击从磁盘安装按钮，浏览到X:Windows 8目录（其中X是CD-ROM驱动器的盘符），选择\\\"LENLS2014wA.inf\\\"文件，然后单击打开按钮^[1]^。\\n\",\n      \"8. 单击确定按钮，完成安装^[1]^。\\n\",\n      \"\\n\",\n      \"以上就是安装显示器驱动程序的步骤，希望对你有所帮助。\\n\",\n      \"\\n\",\n      \"智能客服问答助手的回复中，角标 2 对应参考文档是：显示器说明书.pdf\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"response_message = agent.run(\\n\",\n    \"    conversation_id = conversation_id,\\n\",\n    \"    query=\\\"如何在windows系统中安装显示器驱动\\\",\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"print(\\\"智能客服问答助手的回复是：{}\\\\n\\\".format(response_message.content.answer))\\n\",\n    \"\\n\",\n    \"reference_doc_id = '2'\\n\",\n    \"reference_doc_name = \\\"\\\"\\n\",\n    \"for event in response_message.content.events:\\n\",\n    \"    if event.event_type == \\\"RAGAgent\\\" and 'references' in event.detail:\\n\",\n    \"        references = event.detail.get('references')\\n\",\n    \"        for reference_doc in references:\\n\",\n    \"            if reference_doc.get('id', '0') == reference_doc_id:\\n\",\n    \"                reference_doc_name = reference_doc.get('document_name', '')\\n\",\n    \"        break\\n\",\n    \"\\n\",\n    \"print(\\\"智能客服问答助手的回复中，角标 {} 对应参考文档是：{}\\\".format(reference_doc_id, reference_doc_name))\"\n   ]\n  },\n  {\n   \"attachments\": {},\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 三、总结\\n\",\n    \"\\n\",\n    \"AppBuilder 为 基于RAG的 企业问答系统提供了 `appbuilder.console.agentbuilder` API，可以方便的以代码态调用已在平台发布的对话应用，方便的集成进用户自己的系统。\\n\",\n    \"\\n\",\n    \"本示例展示了如何创建应用，代码态调用应用，非流式对话，流式对话，以及基于对话结果展示引用文档。\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  },\n  \"orig_nbformat\": 4,\n  \"vscode\": {\n   \"interpreter\": {\n    \"hash\": \"31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6\"\n   }\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/end2end_application/rag/rag.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"f802e64d-4eaa-445d-a48a-1042a91bc394\",\n   \"metadata\": {\n    \"tags\": []\n   },\n   \"source\": [\n    \"# 智能问答机器人：简历筛选小助手\\n\",\n    \"\\n\",\n    \"## 目标\\n\",\n    \"通过对本地简历库的简历进行解析、切片、创建索引，实现基于JD进行简历筛选，并对筛选的Top1简历进行总结的功能\\n\",\n    \"\\n\",\n    \"## 准备工作\\n\",\n    \"### 平台注册\\n\",\n    \"1.先在appbuilder平台注册，获取token\\n\",\n    \"2.创建BES集群，详见(https://cloud.baidu.com/doc/BES/s/0jwvyk4tv)\\n\",\n    \"3.安装appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"2939356f-61c2-42e9-9e0c-fc6729c193f6\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"!pip install appbuilder-sdk\\n\",\n    \"!pip install elasticsearch==7.11.0\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 1,\n   \"id\": \"4ccff03b-1567-4e8b-8e1f-9a5032690406\",\n   \"metadata\": {\n    \"tags\": []\n   },\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"init done\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import logging\\n\",\n    \"import os\\n\",\n    \"\\n\",\n    \"#  设置环境变量\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"...\\\"\\n\",\n    \"\\n\",\n    \"# 创建BES集群后获得集群id、用户名、密码\\n\",\n    \"cluster_id = \\\"...\\\"\\n\",\n    \"username = \\\"...\\\"\\n\",\n    \"password = \\\"...\\\"\\n\",\n    \"\\n\",\n    \"print(\\\"init done\\\")\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"aeb2fa55-075f-48df-a9fb-8b40d9900684\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 开发过程\\n\",\n    \"### 对简历文档内容进行解析、切分\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"41559341-fd7a-478c-a08b-1477d79e9d41\",\n   \"metadata\": {\n    \"ExecuteTime\": {\n     \"end_time\": \"2023-12-18T06:24:26.982459Z\",\n     \"start_time\": \"2023-12-18T06:23:53.771345Z\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"from pathlib import Path\\n\",\n    \"\\n\",\n    \"# 基于doc_parser和doc_splitter解析file_path文件为若干个段落\\n\",\n    \"def parse_file(file_path, doc_parser, doc_splitter):\\n\",\n    \"    input_msg = appbuilder.Message(str(file_path))\\n\",\n    \"    doc_parser_result = doc_parser(input_msg, return_raw=True)\\n\",\n    \"    doc_splitter_result = doc_splitter(doc_parser_result)\\n\",\n    \"    return [f\\\"{file_path.name}+{para['text'][:384]}\\\" \\n\",\n    \"            for para in doc_splitter_result.content[\\\"paragraphs\\\"]]\\n\",\n    \"\\n\",\n    \"# 文档切分的分块大小，每个分块最大340个字符\\n\",\n    \"chunk_size = 340\\n\",\n    \"\\n\",\n    \"# 本地简历库地址\\n\",\n    \"file_dir = \\\"../简历\\\"\\n\",\n    \"\\n\",\n    \"# 声明文档解析和文档切分组件\\n\",\n    \"doc_parser = appbuilder.DocParser()\\n\",\n    \"doc_splitter = appbuilder.DocSplitter(splitter_type=\\\"split_by_chunk\\\", max_segment_length=chunk_size)       \\n\",\n    \"\\n\",\n    \"# 批量解析，形成段落切片列表\\n\",\n    \"resume_paragraphs = [para_text \\n\",\n    \"            for file in Path(file_dir).iterdir() if file.is_file()\\n\",\n    \"            for para_text in parse_file(file, doc_parser, doc_splitter)]\\n\",\n    \"\\n\",\n    \"print(f\\\"total length of splitted paragraphs {len(resume_paragraphs)}\\\")\\n\",\n    \"\\n\",\n    \"print(\\\"sample resume paragraphs\\\")\\n\",\n    \"for paras in resume_paragraphs[:3]:\\n\",\n    \"    print(paras)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"5fc5bc38-6bc5-4187-a8fd-f802d77d89fa\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 计算文档切片的语义向量并入库\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"d514a628-5ae3-4269-aada-eaf8b21c3793\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import time\\n\",\n    \"# 千帆Embedding\\n\",\n    \"embedding = appbuilder.Embedding()\\n\",\n    \"\\n\",\n    \"# 将段落切片列表入库到BESVectorStoreIndex，这里面用到的Baidu Elastic Search服务\\n\",\n    \"segments = appbuilder.Message(resume_paragraphs)\\n\",\n    \"vector_index = appbuilder.BESVectorStoreIndex.from_segments(\\n\",\n    \"    segments=segments, cluster_id=cluster_id, user_name=username, \\n\",\n    \"    password=password, embedding=embedding)\\n\",\n    \"\\n\",\n    \"# bes向量入库是异步操作，此处等待bes进行refresh\\n\",\n    \"time.sleep(5)\\n\",\n    \"print(\\\"index done.\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"16a8aa38-7a33-4e27-bca4-00900cfe1641\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 从工作职责描述中抽取关键词\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"9f45ef5f-6206-4b31-83c4-3c8eb2c86925\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 招聘jd\\n\",\n    \"from collections import Counter, defaultdict\\n\",\n    \"\\n\",\n    \"# 工作职责描述\\n\",\n    \"job_desc = '''拥有大语言模型领域的研究背景，发表过期刊会议论文者加分；\\n\",\n    \"具备深度学习平台开发或大模型开发经验，能够独立完成任务；\\n\",\n    \"具备优秀的编程能力，熟悉tensorflow、pytorch、paddlepaddle中的一种深度学习框架；\\n\",\n    \"对人工智能有浓厚兴趣，愿意投入时间和精力深入研究；\\n\",\n    \"具备团队协作精神，能够与团队成员有效沟通，共同推进项目进展。'''\\n\",\n    \"\\n\",\n    \"# 标签抽取的组件\\n\",\n    \"tagger = appbuilder.TagExtraction(model=\\\"DeepSeek-V3.1\\\")\\n\",\n    \"\\n\",\n    \"# 从JD抽取标签并打印\\n\",\n    \"tags = tagger(appbuilder.Message(job_desc))\\n\",\n    \"\\n\",\n    \"print(\\\"从JD抽取标签并打印\\\")\\n\",\n    \"print(tags.content)\\n\",\n    \"tag_list = [tag.split(\\\".\\\")[1] for tag in tags.content.split(\\\"\\\\n\\\")]\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"21ef57a9-46cf-4939-b375-68e21d4b3e90\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 基于工作描述的关键词从简历库中检索简历并排序\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"7313e122-5199-4c90-bc6c-ad04e206ccc9\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 基于JD抽取出来的标签，使用retriever对简历库进行检索，基于简历文件名称命中次数进行汇总和排序\\n\",\n    \"retriever = vector_index.as_retriever()\\n\",\n    \"\\n\",\n    \"resume_count = Counter()\\n\",\n    \"resume_content = defaultdict(set)\\n\",\n    \"\\n\",\n    \"for tag in tag_list:\\n\",\n    \"    print(\\\"Going to retrieve resumes for tag: \\\", tag, \\\"\\\\nGot Results\\\")\\n\",\n    \"    relevant_resumes = retriever(query=appbuilder.Message(tag), top_k=3)\\n\",\n    \"    for idx, res in enumerate(relevant_resumes.content):\\n\",\n    \"        name_and_content = res[\\\"text\\\"].split(\\\"+\\\")\\n\",\n    \"        print(f\\\"{idx+1}: {name_and_content[0]}, {name_and_content[1]}\\\")\\n\",\n    \"        resume_count[name_and_content[0]] += 1\\n\",\n    \"        resume_content[name_and_content[0]].add(name_and_content[1])\\n\",\n    \"    print()\\n\",\n    \"\\n\",\n    \"sorted_resumes = sorted(resume_count.items(), key=lambda x: x[1], reverse=True)\\n\",\n    \"print(sorted_resumes)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"36ba212a-774b-4f26-a860-988a872423ac\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 对检索得到的最优简历进行总结\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"e38701cd-9fbf-4da4-982b-a87a9b310427\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"\\n\",\n    \"play = appbuilder.Playground(\\n\",\n    \"    prompt_template=\\\"基于候选人姓名、职责描述和简历内容，概括一下{name}的推荐理由。\\\\n候选人姓名: {name}\\\\n职责描述: {JD}\\\\n简历内容: {resume}\\\\n推荐理由: \\\",\\n\",\n    \"    model=\\\"DeepSeek-V3.1\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"resume_summary = play(appbuilder.Message({\\\"JD\\\": job_desc, \\\"name\\\": sorted_resumes[0][0], \\\"resume\\\": \\\"\\\\n\\\".join(list(resume_content[sorted_resumes[0][0]]))}))\\n\",\n    \"print(resume_summary.content)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3 (ipykernel)\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.11.5\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_05_16/agent_run.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport time\n\nimport appbuilder\n\nos.environ[\"APPBUILDER_TOKEN\"] = \"密钥\"\napp_id = \"应用ID\"\n\nif __name__ == \"__main__\":\n    builder = appbuilder.AppBuilderClient(app_id)\n    stream = True  # 控制是否执行流式输出\n    not_stream = True  # 控制是否执行非流式输出\n\n    if not_stream:\n        conversation_id = builder.create_conversation()\n        start = time.time()\n        msg = builder.run(conversation_id, \"如何运用胯下变向进行突破？\", )\n        answer = msg.content.answer.replace(\"\\n\", \"\")\n        print(\"----------------非流式输出篮球教练回答内容----------------\")\n        i = 0\n        step = 30\n        while i + step < len(answer):\n            print(answer[i: i + step])\n            i += step\n        print(answer[i:len(answer)])\n        end = time.time()\n        print(\"-----------------非流式输出耗时------------------\")\n        print(\"%.2f秒\" % (end - start))\n\n    print(\"\\n\")\n\n    if stream:\n        conversation_id = builder.create_conversation()\n\n        start = time.time()\n        msg = builder.run(conversation_id, \"如何运用胯下变向进行突破？\", stream=True)\n        costs = []\n        print(\"----------------流式输出篮球教练回答内容----------------\")\n        i = 0\n        step = 30\n        answer = \"\"\n        for c in msg.content:\n            costs.append(\"%.2f秒\" % (time.time() - start))\n            answer += c.answer.replace(\"\\n\", \"\")\n            if len(answer) - i > step:\n                print(answer[i: i + step])\n                i += step\n        while i + step < len(answer):\n            print(answer[i: i + step])\n            i += step\n        print(answer[i:len(answer)])\n        print(\"------------流式输出耗时序列------------\")\n        print(costs)\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_05_16/chatbot.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport time\nimport wave\nimport sys\nimport pyaudio\nimport webrtcvad\nimport appbuilder\nimport re\n\nos.environ[\"APPBUILDER_TOKEN\"] = \"密钥\"\n\nCHUNK = 1024\nFORMAT = pyaudio.paInt16\nCHANNELS = 1 if sys.platform == 'darwin' else 2\nRATE = 16000\nDURATION = 30  # ms\nCHUNK = RATE // 1000 * DURATION\n\n\nclass Chatbot:\n    def __init__(self):\n        self.p = pyaudio.PyAudio()\n        self.tts = appbuilder.TTS()\n        self.asr = appbuilder.ASR()\n        self.agent = appbuilder.AppBuilderClient(\"应用iD\")\n\n    def run(self):\n        self.run_tts_and_play_audio(\"我是你的专属聊天机器人，小智，如果你有什么问题，可以直接问我\")\n        while True:\n            print(\"loop...\")\n            audio_path = \"output.wav\"\n            # 记录音频，如果语音时长小于1秒，则忽略本次对话\n            print(\"开始记录音频...\")\n            if self.record_audio(audio_path) < 1000:\n                time.sleep(1)\n                continue\n            print(\"音频记录结束\")\n            # 音频转文本\n            print(\"开始执行ASR...\")\n            query = self.run_asr(audio_path)\n            print(\"结束执行ASR\")\n            # 询问智能体\n            print(\"正在执行智能体...\")\n            if len(query) == 0:\n                continue\n            answer = self.run_agent(query)\n            results = re.findall(r'(https?://[^\\s]+)', answer)\n            for result in results:\n                print(\"链接地址:\", result)\n                answer = answer.replace(result, \"\")\n            print(\"answer:\", answer)\n            print(\"结束调用智能体\")\n            # 文本转语音\n            print(\"开始执行TTS并播报...\")\n            self.run_tts_and_play_audio(answer)\n            print(\"结束TTS并播报结束\")\n\n    def record_audio(self, path):\n        with (wave.open(path, 'wb') as wf):\n            wf.setnchannels(CHANNELS)\n            wf.setsampwidth(self.p.get_sample_size(FORMAT))\n            wf.setframerate(RATE)\n            stream = self.p.open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True)\n            vad = webrtcvad.Vad(1)\n            not_speech_times = 0\n            speech_times = 0\n            total_times = 0\n            start_up_times = 33 * 5  # 初始时间设置为5秒\n            history_speech_times = 0\n            while True:\n                if history_speech_times > 33 * 10:\n                    break\n                data = stream.read(CHUNK, False)\n                if vad.is_speech(data, RATE):\n                    speech_times += 1\n                    wf.writeframes(data)\n                else:\n                    not_speech_times += 1\n                total_times += 1\n                if total_times >= start_up_times:\n                    history_speech_times += speech_times\n                    # 模拟滑窗重新开始计数\n                    if float(not_speech_times) / float(total_times) > 0.7:\n                        break\n                    not_speech_times = 0\n                    speech_times = 0\n                    total_times = 0\n                    start_up_times = start_up_times / 2\n                    if start_up_times < 33:\n                        start_up_times = 33\n            stream.close()\n            return history_speech_times * DURATION\n\n    def run_tts_and_play_audio(self, text: str):\n        msg = self.tts.run(appbuilder.Message(content={\"text\": text}), audio_type=\"pcm\", model=\"paddlespeech-tts\",\n                           stream=True)\n        stream = self.p.open(format=self.p.get_format_from_width(2),\n                             channels=1,\n                             rate=24000,\n                             output=True,\n                             frames_per_buffer=2048)\n        for pcm in msg.content:\n            stream.write(pcm)\n        stream.stop_stream()\n        stream.close()\n\n    def run_asr(self, audio_path: str):\n        with open(audio_path, \"rb\") as f:\n            content_data = {\"audio_format\": \"wav\", \"raw_audio\": f.read(), \"rate\": 16000}\n            msg = appbuilder.Message(content_data)\n            out = self.asr.run(msg)\n            text = out.content[\"result\"][0]\n            return text\n\n    def run_agent(self, query):\n        conversation_id = self.agent.create_conversation()\n        msg = self.agent.run(conversation_id, query, stream=True)\n        answer = \"\"\n        for content in msg.content:\n            answer += content.answer\n        return answer\n\n\nif __name__ == \"__main__\":\n    chatbot = Chatbot()\n    chatbot.run()\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_05_16/service_deploy.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport appbuilder\n\nos.environ[\"APPBUILDER_TOKEN\"] = \"密钥\"\ncomponent = appbuilder.Playground(\n    prompt_template=\"{query}\",\n    model=\"ERNIE-Bot\"\n)\n\nagent = appbuilder.AgentRuntime(component=component)\nagent.serve(port=8091)\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_05_16/two_agent.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport appbuilder\n\nos.environ[\"APPBUILDER_TOKEN\"] = \"密钥\"\n\n\nclass IdiomSolitaire:\n    def __init__(self, real_player, app_id1, app_id2):\n        self.player1 = appbuilder.AppBuilderClient(app_id1)\n        self.player2 = appbuilder.AppBuilderClient(app_id2)\n        self.real_player = real_player\n\n    def run(self):\n        conversation_id1 = self.player1.create_conversation()\n        conversation_id2 = self.player2.create_conversation()\n        if self.real_player:\n            print(\"---------游戏开始，请输入一个成语---------\")\n            q = str(input(\"真实玩家: \"))\n        else:\n            q = \"龙年大吉\"\n        i = 1\n        while True:\n            print(\"----------第%d轮比拼----------\" % (i,))\n            msg = self.player1.run(conversation_id1, q)\n            answer = msg.content.answer\n            print(\"LLM玩家1: \", answer)\n            # answer作为下一个玩家的输入\n            q = answer\n\n            msg = self.player2.run(conversation_id2, q)\n            answer = msg.content.answer\n            print(\"LLM玩家2: \", msg.content.answer)\n            q = answer\n            if self.real_player:\n                q = str(input(\"真实玩家: \"))\n            i += 1\n\n\n# 无真实玩家\ndef main1():\n    idiom_solitaire = IdiomSolitaire(False, \"应用ID\",\n                                     \"应用ID\")\n    idiom_solitaire.run()\n\n\n# 真实玩家\ndef main2():\n    idiom_solitaire = IdiomSolitaire(True, \"应用ID\",\n                                     \"应用ID\")\n    idiom_solitaire.run()\n\n\nif __name__ == \"__main__\":\n    main1()\n    # main2()"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_08_22/README.md",
    "content": "- AppBuilderClient-Tool Call\n  - [本地调用内网tool工具](tool_call_1.ipynb)\n  - [调用Agent执行本地命令](tool_call_2.ipynb)\n  - [使用AppBuilderEventHandler简化tool_call操作](tool_call_3.ipynb)\n  - [使用AppBuilderEventHandler生成图片并下载到本地](tool_call_4.ipynb)\n- Appbuilder DEBUG&Trace\n  - [Appbuilder DEBUG&Trace](trace.ipynb)\n- Appbuilder knowledgebase\n  - [Appbuilder knowledgebase](knowledgebase.ipynb)"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_08_22/knowledgebase.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# AppBuilder-Knowledge：生产环境的知识库/文档/切片管理教学\\n\",\n    \"\\n\",\n    \"[知识库组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/KnowledgeBase/knowledgebase.md)\\n\",\n    \"\\n\",\n    \"知识库组件（KnowledgeBase）是对线上知识库操作的组件，可以通过SDK实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作，可在平台console中查看结果。对console端知识库进行操作，可以通过SDK实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作，可在平台console中查看结果\\n\",\n    \"\\n\",\n    \"应用场景：通过SDK代码实现console端知识库操作。\\n\",\n    \"\\n\",\n    \"#### AppBuilder-Knowledge代码态使用流程\\n\",\n    \"\\n\",\n    \"##### 新建一个知识库\\n\",\n    \"\\n\",\n    \"- 首先我们需要通过SDK新建一个知识库，新建知识库的代码示例如下：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 52,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"新建的知识库ID:  3cc48493-f9ff-48c8-a3ea-fcc17fdddded\\n\",\n      \"新建的知识库名称:  my_knowledge\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"knowledge = appbuilder.KnowledgeBase()\\n\",\n    \"resp = knowledge.create_knowledge_base(\\n\",\n    \"        name=\\\"my_knowledge\\\",\\n\",\n    \"        description=\\\"my_knowledge\\\",\\n\",\n    \"        type=\\\"public\\\",\\n\",\n    \"    )\\n\",\n    \"print(\\\"新建的知识库ID: \\\", resp.id)\\n\",\n    \"print(\\\"新建的知识库名称: \\\", resp.name)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 实例化已创建的知识库 \\n\",\n    \"- 接下来如果我们期望对知识库进行进一步操作,就需要实例化已创建的知识库 \"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 53,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"知识库ID:  3cc48493-f9ff-48c8-a3ea-fcc17fdddded\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"my_knowledge_base_id = resp.id # 传入知识库ID\\n\",\n    \"my_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\\n\",\n    \"print(\\\"知识库ID: \\\", my_knowledge.knowledge_id)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 我们就成功在Appbuilder平台创建了一个名为my_knowledge的知识库\\n\",\n    \"\\n\",\n    \"![创建知识库](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-08-22T02%3A02%3A57Z%2F-1%2Fhost%2F0134e32c4f9221cfd3cb8ff74737ea000079639342b05fe4649a07fd9b18c11c)\\n\",\n    \"\\n\",\n    \"##### 获取知识库详情\\n\",\n    \"- 如果我们想要获取知识库详情，可以调用 `get_knowledge_base_detail` 方法,返回的response将包含知识库的详情信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 54,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"查询的知识库ID:  3cc48493-f9ff-48c8-a3ea-fcc17fdddded\\n\",\n      \"查询的知识库名称:  my_knowledge\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"knowledge = appbuilder.KnowledgeBase()\\n\",\n    \"resp = knowledge.get_knowledge_base_detail(my_knowledge.knowledge_id)\\n\",\n    \"print(\\\"查询的知识库ID: \\\", resp.id)\\n\",\n    \"print(\\\"查询的知识库名称: \\\", resp.name)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 获取知识库列表\\n\",\n    \"- 当你想查看你的账号的知识库，SDK同样支持调用知识库列表接口，获取知识库列表。需要提供知识库id作为起始搜索位置，不提供则会默认从第一个知识库开始搜索\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 55,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"获取到的知识库列表:  requestId='8e6d9bd4-73c2-41b9-9813-de65a5ca01ec' data=[KnowledgeBaseDetailResponse(id='271bba8b-2c77-4b52-aaa2-2d95dde9184a', name='千帆大模型平台文档', description=None, config=KnowledgeBaseConfig(index=KnowledgeBaseConfigIndex(type='public', esUrl='', username=None, password=None)))] marker='3cc48493-f9ff-48c8-a3ea-fcc17fdddded' nextMarker='271bba8b-2c77-4b52-aaa2-2d95dde9184a' maxKeys=1 isTruncated=False\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"knowledge = appbuilder.KnowledgeBase()\\n\",\n    \"# 从my_knowledge知识库开始检索，检索10条\\n\",\n    \"resp = knowledge.get_knowledge_base_list(my_knowledge.knowledge_id,10)\\n\",\n    \"print(\\\"获取到的知识库列表: \\\", resp)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 修改知识库\\n\",\n    \"- 如果我们对我们创建的知识库不满意，想要对其修改，SDK提供`modify_knowledge_base`方法，可以修改知识库,在下面的示例中我们将展示如何修改知识库的名称，接着我们按照知识库的id，查询知识库，查询知识库的名称是否改变,当然我们也可以去appbuilder平台个人空间去查看知识库名称是否更新\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 56,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"查询的知识库ID:  3cc48493-f9ff-48c8-a3ea-fcc17fdddded\\n\",\n      \"查询的知识库名称:  new_test_knowledge\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"knowledge = appbuilder.KnowledgeBase()\\n\",\n    \"knowledge.modify_knowledge_base(my_knowledge.knowledge_id, name=\\\"new_test_knowledge\\\", description=\\\"测试\\\")\\n\",\n    \"\\n\",\n    \"# 接着我们按照知识库的id，查询知识库，查询知识库的名称是否改变\\n\",\n    \"resp = knowledge.get_knowledge_base_detail(my_knowledge.knowledge_id)\\n\",\n    \"print(\\\"查询的知识库ID: \\\", resp.id)\\n\",\n    \"print(\\\"查询的知识库名称: \\\", resp.name)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 上传文档到知识库\\n\",\n    \"上传文档到知识库共有以下三种方式：\\n\",\n    \"- 上传文档到知识库\\n\",\n    \"- 上传通用文档\\n\",\n    \"- 向知识库添加文档\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"获取目标文档的file_url\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 57,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"file_url = \\\"https://bj.bcebos.com/v1/appbuilder-sdk-components/%E3%80%8A%E9%BB%91%E7%A5%9E%E8%AF%9D%EF%BC%9A%E6%82%9F%E7%A9%BA%E3%80%8BIP%E4%BB%8B%E7%BB%8D%E6%89%8B%E5%86%8C2024.pdf?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-08-21T11%3A40%3A45Z%2F-1%2Fhost%2Ff387e2cd2db95c9da26247c5d6c45f6dc9a817fa2721f0a780dc1eba433d02b8\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"###### 上传文档到知识库\\n\",\n    \"- 主要提供自定义文档处理策略，向知识库添加文档\\n\",\n    \"  - 文档格式：rawText (允许配置后续分割策略)\\n\",\n    \"  - 文档处理策略\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 58,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"data\": {\n      \"text/plain\": [\n       \"{'requestId': 'f698099c-b533-4500-a1f8-6b9f2087d1ba'}\"\n      ]\n     },\n     \"execution_count\": 58,\n     \"metadata\": {},\n     \"output_type\": \"execute_result\"\n    }\n   ],\n   \"source\": [\n    \"knowledge_base_id = my_knowledge.knowledge_id\\n\",\n    \"knowledge.create_documents(\\n\",\n    \"\\tid=knowledge_base_id,\\n\",\n    \"\\tcontentFormat=\\\"rawText\\\",\\n\",\n    \"\\tsource=appbuilder.DocumentSource(\\n\",\n    \"\\t\\ttype=\\\"web\\\",\\n\",\n    \"\\t\\turls=[\\\"https://baike.baidu.com/item/%E9%BB%91%E7%A5%9E%E8%AF%9D%EF%BC%9A%E6%82%9F%E7%A9%BA/53303078?fr=ge_ala\\\"],\\n\",\n    \"\\t\\turlDepth=1,\\n\",\n    \"\\t),\\n\",\n    \"\\tprocessOption=appbuilder.DocumentProcessOption(\\n\",\n    \"\\t\\ttemplate=\\\"custom\\\",\\n\",\n    \"\\t\\tparser=appbuilder.DocumentChoices(\\n\",\n    \"\\t\\t\\tchoices=[\\\"layoutAnalysis\\\", \\\"ocr\\\"]\\n\",\n    \"\\t\\t),\\n\",\n    \"\\t\\tchunker=appbuilder.DocumentChunker(\\n\",\n    \"\\t\\t\\tchoices=[\\\"separator\\\"],\\n\",\n    \"\\t\\t\\tseparator=appbuilder.DocumentSeparator(\\n\",\n    \"\\t\\t\\t\\tseparators=[\\\"。\\\"],\\n\",\n    \"\\t\\t\\t\\ttargetLength=300,\\n\",\n    \"\\t\\t\\t\\toverlapRate=0.25,\\n\",\n    \"\\t\\t\\t),\\n\",\n    \"\\t\\t\\tprependInfo=[\\\"title\\\", \\\"filename\\\"],\\n\",\n    \"\\t\\t),\\n\",\n    \"\\t\\tknowledgeAugmentation=appbuilder.DocumentChoices(choices=[\\\"faq\\\"]),\\n\",\n    \"\\t),\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"###### 上传通用文档\\n\",\n    \"- SDK支持基于代码态的文档上传方法`upload_file`,以及包含文档的自定义切分逻辑的向知识库添加文档的方法``add_document`\\n\",\n    \"- 需要先将文档下载至本地\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 59,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"文件已成功保存到 黑神话(悟空).pdf\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import requests\\n\",\n    \"\\n\",\n    \"def download_file(url, file_path):\\n\",\n    \"    try:\\n\",\n    \"        response = requests.get(url, stream=True)\\n\",\n    \"        response.raise_for_status()\\n\",\n    \"        with open(file_path, 'wb') as file:\\n\",\n    \"            for chunk in response.iter_content(chunk_size=8192):\\n\",\n    \"                if chunk:\\n\",\n    \"                    file.write(chunk)\\n\",\n    \"        print(f\\\"文件已成功保存到 {file_path}\\\")\\n\",\n    \"    except requests.RequestException as e:\\n\",\n    \"        print(f\\\"下载失败: {e}\\\")\\n\",\n    \"\\n\",\n    \"file_url = \\\"https://bj.bcebos.com/v1/appbuilder-sdk-components/%E3%80%8A%E9%BB%91%E7%A5%9E%E8%AF%9D%EF%BC%9A%E6%82%9F%E7%A9%BA%E3%80%8BIP%E4%BB%8B%E7%BB%8D%E6%89%8B%E5%86%8C2024.pdf?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-08-21T11%3A40%3A45Z%2F-1%2Fhost%2Ff387e2cd2db95c9da26247c5d6c45f6dc9a817fa2721f0a780dc1eba433d02b8\\\"\\n\",\n    \"file_path = \\\"黑神话(悟空).pdf\\\"  # 替换为你想要的文件名\\n\",\n    \"\\n\",\n    \"# 调用函数下载文件\\n\",\n    \"download_file(file_url, file_path)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 60,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"upload_res = knowledge.upload_file(file_path)\\n\",\n    \"add_res = knowledge.add_document(\\n\",\n    \"    content_type=\\\"raw_text\\\",\\n\",\n    \"    file_ids=[upload_res.id],\\n\",\n    \"    custom_process_rule=appbuilder.CustomProcessRule(\\n\",\n    \"        separators=[\\\"?\\\"], target_length=400, overlap_rate=0.2\\n\",\n    \"    ),\\n\",\n    \"    knowledge_base_id=my_knowledge.knowledge_id\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 获取知识库的文档列表\\n\",\n    \"在完成添加文档之后，如果我们想获取知识库中的文档列表，可以使用下面的方法：\\n\",\n    \"- 获取知识库的文档列表:`get_documents_list` 单次请求列表获得的文档数量,最大100\\n\",\n    \"- 获取知识库全部文档:`get_all_documents`\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 61,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"知识库ID:  3cc48493-f9ff-48c8-a3ea-fcc17fdddded\\n\",\n      \"get_documents_list\\n\",\n      \"文档列表:  request_id='da7bc5a5-c42d-47cd-82e7-674ff3d65502' data=[Document(id='139be427-5024-4af7-b5ca-1f15efdfea86', name='黑神话(悟空).pdf', created_at=1724295950, word_count=0, enabled=True, meta=DocumentMeta(source='upload_file', file_id='fc170b9e-0876-4d82-903c-5976e9a58453')), Document(id='dfeb440e-dc5f-4d1a-b0d8-6561b9fb5786', name='https://baijiahao.baidu.com/s?id=1802527379394162441', created_at=1724295904, word_count=0, enabled=True, meta=DocumentMeta(source='url', file_id=None))]\\n\",\n      \"get_all_documents\\n\",\n      \"id='139be427-5024-4af7-b5ca-1f15efdfea86' name='黑神话(悟空).pdf' created_at=1724295950 word_count=0 enabled=True meta=DocumentMeta(source='upload_file', file_id='fc170b9e-0876-4d82-903c-5976e9a58453')\\n\",\n      \"id='dfeb440e-dc5f-4d1a-b0d8-6561b9fb5786' name='https://baijiahao.baidu.com/s?id=1802527379394162441' created_at=1724295904 word_count=0 enabled=True meta=DocumentMeta(source='url', file_id=None)\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"my_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\\n\",\n    \"print(\\\"知识库ID: \\\", my_knowledge.knowledge_id)\\n\",\n    \"\\n\",\n    \"# 获取知识库的文档列表:get_documents_list\\n\",\n    \"list_res = my_knowledge.get_documents_list()\\n\",\n    \"print(\\\"get_documents_list\\\")\\n\",\n    \"print(\\\"文档列表: \\\", list_res)\\n\",\n    \"\\n\",\n    \"# 获取知识库全部文档:get_all_documents\\n\",\n    \"doc_list = knowledge.get_all_documents(my_knowledge.knowledge_id)\\n\",\n    \"print(\\\"get_all_documents\\\")\\n\",\n    \"for message in doc_list:\\n\",\n    \"    print(message)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 现在我们可以在Appbuilder中查看我们的知识库\\n\",\n    \"\\n\",\n    \"![向知识库传入文档](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%90%91%E7%9F%A5%E8%AF%86%E5%BA%93%E4%BC%A0%E5%85%A5%E6%96%87%E6%A1%A3.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-08-22T10%3A56%3A50Z%2F-1%2Fhost%2Fe0a39a3fd3d2acd0f4b949d68b895b2943c63f94db7813fcace9674a11290681)\\n\",\n    \"\\n\",\n    \"# 现在我们基于new_test_knowledge知识库创建了Client应用\\n\",\n    \"\\n\",\n    \"![创建黑神话Client](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E9%BB%91%E7%A5%9E%E8%AF%9DClient.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-08-22T02%3A19%3A30Z%2F-1%2Fhost%2F93016fe0808f5460859d678d6b2095ee6624842db914e15c73bd31a476b42402)\\n\",\n    \"\\n\",\n    \"接下来我们调用Client应用，查看运行效果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 22,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"《黑神话：悟空》是一款充满文化底蕴的游戏，用现代方式讲述经典中国故事，引发全球用户的共鸣^[1]^。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 从AppBuilder控制台【个人空间】-【应用】网页获取已发布应用的ID\\n\",\n    \"app_id = \\\"236b3e57-3464-43b0-8556-f165193721ef\\\"\\n\",\n    \"\\n\",\n    \"app_builder_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_builder_client.create_conversation()\\n\",\n    \"\\n\",\n    \"resp = app_builder_client.run(conversation_id, \\\"请你用50字左右介绍一下《黑神话(悟空)》\\\")\\n\",\n    \"print(resp.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### KnowledgeBase 同样提供代码态的接口，可以对知识库文档进行切片\\n\",\n    \"\\n\",\n    \"* 创建切片\\n\",\n    \"* 修改切片信息\\n\",\n    \"* 获取切片信息\\n\",\n    \"* 获取切片列表\\n\",\n    \"* 删除切片\\n\",\n    \"\\n\",\n    \"- 首先我们尝试让Client回答KnowledgeBase中没有的信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 67,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"很抱歉，我没有找到关于《黑神话：悟空》中虎先锋的具体打法攻略。但是，一般来说，在动作冒险游戏中，打败敌人的关键通常在于熟练掌握角色的攻击方式、防御技巧和敌人的攻击模式。你可以尝试多次与虎先锋战斗，观察它的攻击方式和弱点，并结合孙悟空的技能和装备来制定相应的战斗策略。此外，你也可以在游戏的官方论坛或社区中寻找其他玩家分享的攻略和经验，这可能会对你有所帮助。\\n\",\n      \"\\n\",\n      \"请注意，不同玩家的游戏风格和策略可能有所不同，因此建议你在参考他人攻略的同时，结合自己的游戏情况进行调整和优化。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 从AppBuilder控制台【个人空间】-【应用】网页获取已发布应用的ID\\n\",\n    \"app_id = \\\"236b3e57-3464-43b0-8556-f165193721ef\\\"\\n\",\n    \"\\n\",\n    \"app_builder_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_builder_client.create_conversation()\\n\",\n    \"\\n\",\n    \"resp = app_builder_client.run(conversation_id, \\\"《黑神话：悟空》的‌虎先锋怎么打？能不能提供一下攻略？\\\")\\n\",\n    \"print(resp.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 这时候我们就需要使用为KnowledeBase添加切片为他增添知识点了\\n\",\n    \"###### 创建切片`create_chunk`\\n\",\n    \"\\n\",\n    \"- 为了增加对照，我们先为Client添加BaiduSearch组件，并运行它查看他能提供哪些信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 68,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"《黑神话：悟空》的‌虎先锋打法攻略如下^[2]^：\\n\",\n      \"\\n\",\n      \"1. 起手进行蓄力，第一次蓄力攻击和虎先锋换血。\\n\",\n      \"2. 闪身躲避虎先锋的两端攻击。\\n\",\n      \"3. 对其进行攻击，使用精魄将其打到硬直，接着使用定身术将其定住，然后再进行攻击。\\n\",\n      \"4. 注意虎先锋会开启石化技能，可以规避攻击，并且进行反击，玩家在其进入石化后应避免出招。\\n\",\n      \"5. 在其第二次石化之后拉开距离，观察情况，躲避其的突进。\\n\",\n      \"6. 当虎先锋掏出剑之后，注意躲避其攻击，等待其将剑收回去再进行攻击。\\n\",\n      \"7. 在虎先锋血量很少的情况下使用定身来进行输出，随后使用攒的棍势再次输出即可击败虎先锋。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 从AppBuilder控制台【个人空间】-【应用】网页获取已发布应用的ID\\n\",\n    \"app_id = \\\"236b3e57-3464-43b0-8556-f165193721ef\\\"\\n\",\n    \"\\n\",\n    \"app_builder_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_builder_client.create_conversation()\\n\",\n    \"\\n\",\n    \"resp = app_builder_client.run(conversation_id, \\\"《黑神话：悟空》的‌虎先锋怎么打？能不能提供一下攻略？\\\")\\n\",\n    \"print(resp.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 我们发现BaiduSearch提供的信息不一定符合我们预期，这个时候我们就需要对知识库增加新的切片，来为我们的知识库不断更新知识点，获取document_id,支持对文档进行切片操作\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"# 获取doc_list列表的第一个文档的document_id\\n\",\n    \"document_id = doc_list[0].id\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- content: 切片内容\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 69,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"知识库ID:  3cc48493-f9ff-48c8-a3ea-fcc17fdddded\\n\",\n      \"切片ID:  19e93596-a314-4ca3-81fa-d6c041433979\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 获取doc_list列表的第一个文档的document_id\\n\",\n    \"document_id = doc_list[0].id\\n\",\n    \"my_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\\n\",\n    \"print(\\\"知识库ID: \\\", my_knowledge.knowledge_id)\\n\",\n    \"# 传入了一个内容为\\\"content\\\"的切片\\n\",\n    \"content = \\\"\\\"\\\"\\n\",\n    \"虎先锋是黑神话悟空中的一个boss，很多的玩家都非常的好奇这个boss要怎么样打，这里小编就为大家对虎先锋这个boss的打法进行了整合，可以让你更好的去进行战斗，帮助你击败这个敌人，详细的内容就在这里，快来一起看看吧。\\n\",\n    \"1、进入战斗后注意躲避boss的坠击伤害，快速闪避即可。\\n\",\n    \"2、和BOSS保持一定的距离，如果距离过近，它会对玩家造成三段连击伤害。\\n\",\n    \"3、当BOSS释放吼叫后，直接远离它，在远程进行输出。\\n\",\n    \"4、然后使用闪避躲避它释放的三连剑气和黑色的气旋。\\n\",\n    \"5、最后当BOSS变的坚硬时不作攻击，等它技能结束后继续输出即可轻松过关。\\n\",\n    \"\\\"\\\"\\\"\\n\",\n    \"resp = my_knowledge.create_chunk(documentId=document_id, content=content)\\n\",\n    \"print(\\\"切片ID: \\\", resp.id)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 再次运行Client看看他能否输出我们预期的知识点\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 70,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"《黑神话：悟空》的‌虎先锋打法攻略如下^[1][3]^：\\n\",\n      \"\\n\",\n      \"1. 起手进行蓄力，第一次蓄力攻击和虎先锋换血。\\n\",\n      \"\\n\",\n      \"2. 随后闪身躲避起手的两端攻击。\\n\",\n      \"\\n\",\n      \"3. 对其进行攻击，使用精魄将其打到硬直，接着使用定身法将其定住，然后再进行攻击。\\n\",\n      \"\\n\",\n      \"4. 注意虎先锋会开启石化技能，可以规避攻击，并且进行反击，玩家在其进入石化后应尽可能避免出招。\\n\",\n      \"\\n\",\n      \"5. 在虎先锋血量很少的情况下使用定身法来进行输出，随后再输出即可击败虎先锋。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"app_id = \\\"236b3e57-3464-43b0-8556-f165193721ef\\\"\\n\",\n    \"\\n\",\n    \"app_builder_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_builder_client.create_conversation()\\n\",\n    \"\\n\",\n    \"resp = app_builder_client.run(conversation_id, \\\"《黑神话：悟空》的‌虎先锋怎么打？能不能提供一下攻略？\\\")\\n\",\n    \"print(resp.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 这次输出的信息就符合我们预期了。\\n\",\n    \"\\n\",\n    \"###### 修改切片信息`modify_chunk`\\n\",\n    \"\\n\",\n    \"- 如果我们对之前设置的切片信息不满意，可以通过`modify_chunk`方法进行修改。\\n\",\n    \"\\n\",\n    \"###### 获取切片信息`describe_chunk`\\n\",\n    \"\\n\",\n    \"- 我需要查看我刚才创建切片信息，可以使用`describe_chunk`方法\\n\",\n    \"\\n\",\n    \"###### 删除切片信息`delete_chunk`\\n\",\n    \"\\n\",\n    \"- 切片信息创建出来后，如果不需要了，可以通过`delete_chunk`方法进行删除。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 删除文档和知识库\\n\",\n    \"\\n\",\n    \"- 当你不再需要文档知识库时，可以删除它，SDK同样提供删除文档和知识库的方法\\n\",\n    \"  - 从知识库删除文档 `KnowledgeBase().delete_document`\\n\",\n    \"  - 删除知识库`delete_knowledge_base`\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"python-12\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"undefined.undefined.undefined\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_08_22/tool_call_1.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 本地调用内网tool工具\\n\",\n    \"\\n\",\n    \"在完成Client与知识库交互的需求时，存在客户不想把数据信息上传到云端，而是希望在本地完成数据交互的需求,下面将展示一个调用内网tool工具的简单示例。查询本地信息\\n\",\n    \"\\n\",\n    \"##### 配置运行环境&导入Client应用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# AppBuilder Token，替换为您个人的Token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 应用为：智能问题解决者\\n\",\n    \"app_id = \\\"b9473e78-754b-463a-916b-f0a9097a8e5f\\\"\\n\",\n    \"app_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_client.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 首次提问一个问题，应用不具备该能力，通过回答可以印证\\n\",\n    \"\\n\",\n    \"- 由于并没有关于张三同学的信息，所以Agent无法实现查询\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"message_1 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"请问本公司的张三同学的生日是哪天？\\\",\\n\",\n    \")\\n\",\n    \"print(\\\"Agent第一次回答: {}\\\".format(message_1.content.answer))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"Agent第一次回答: 为了回答这个问题，我们首先需要明确几个关键点：\\n\",\n    \"\\n\",\n    \"1. **问题理解**：\\n\",\n    \"   - 需要确定的是“张三同学的生日”。\\n\",\n    \"\\n\",\n    \"2. **工具选择**：\\n\",\n    \"   - 由于问题涉及的是特定个人的信息（张三的生日），这通常不是通过工具或系统查询能得到的，而是需要通过公司内部的人事记录或直接询问张三本人来获取。\\n\",\n    \"\\n\",\n    \"3. **解决方案生成**：\\n\",\n    \"   - **步骤一**：首先，尝试访问公司的人事系统或员工档案，看是否有张三的生日信息记录。\\n\",\n    \"   - **步骤二**：如果人事系统或员工档案中没有相关信息，或者你不具备访问权限，那么可以考虑直接询问张三本人或其同事，看是否有人知道他的生日。\\n\",\n    \"   - **步骤三**：如果以上方法都不可行，还可以尝试联系公司的人力资源部门，看他们是否能提供相关信息。\\n\",\n    \"\\n\",\n    \"4. **注意事项**：\\n\",\n    \"   - 在尝试获取张三的生日信息时，要确保遵守公司的隐私政策和相关法律法规，不要侵犯张三的隐私权。\\n\",\n    \"   - 如果张三不愿意透露他的生日信息，应尊重他的选择，并停止进一步询问。\\n\",\n    \"\\n\",\n    \"5. **可能遇到的问题**：\\n\",\n    \"   - 人事系统或员工档案中可能没有张三的生日信息。\\n\",\n    \"   - 张三或其同事可能不愿意透露生日信息。\\n\",\n    \"   - 人力资源部门可能因隐私政策而无法提供相关信息。\\n\",\n    \"\\n\",\n    \"综上所述，要确定张三的生日，最直接且尊重隐私的方法是直接询问张三本人，或者通过公司正式渠道（如人力资源部门）在遵守隐私政策的前提下进行查询。\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"##### 赋予应用一个本地查询组件能力\\n\",\n    \"\\n\",\n    \"- 这里我们使用info_dict模拟一个数据库查询的返回结果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"def get_person_infomation(name: str):\\n\",\n    \"    info_dict = {\\n\",\n    \"        \\\"张三\\\": \\\"1980年1月1日\\\",\\n\",\n    \"        \\\"李四\\\": \\\"1975年12月31日\\\",\\n\",\n    \"        \\\"刘伟\\\": \\\"1990年12月30日\\\"\\n\",\n    \"    }\\n\",\n    \"\\n\",\n    \"    if name in info_dict:\\n\",\n    \"        return f\\\"您要查找的{name}的生日是：{info_dict[name]}\\\"\\n\",\n    \"    else:\\n\",\n    \"        return f\\\"您要查找的{name}的信息我们暂未收录，请联系管理员添加。\\\"\\n\",\n    \"    \\n\",\n    \"# 创建工具的描述：json_schema格式\\n\",\n    \"tools = [\\n\",\n    \"    {\\n\",\n    \"        \\\"type\\\": \\\"function\\\",\\n\",\n    \"        \\\"function\\\": {\\n\",\n    \"            \\\"name\\\": \\\"get_person_infomation\\\",\\n\",\n    \"            \\\"description\\\": \\\"查找公司内指定人员的信息\\\",\\n\",\n    \"            \\\"parameters\\\": {\\n\",\n    \"                \\\"type\\\": \\\"object\\\",\\n\",\n    \"                \\\"properties\\\": {\\n\",\n    \"                    \\\"name\\\": {\\n\",\n    \"                        \\\"type\\\": \\\"string\\\",\\n\",\n    \"                        \\\"description\\\": \\\"人员名称，例如：张三、李四\\\",\\n\",\n    \"                    },\\n\",\n    \"                },\\n\",\n    \"                \\\"required\\\": [\\\"name\\\"],\\n\",\n    \"            },\\n\",\n    \"        },\\n\",\n    \"    }\\n\",\n    \"]\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 现在我们已经完成了本地tool组件的设计，接下来我们将tool的功能赋予Client应用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"message_2 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"请问本公司的张三同学的生日是哪天？\\\",\\n\",\n    \"    tools=tools\\n\",\n    \")\\n\",\n    \"print(\\\"Agent的中间思考过程：\\\")\\n\",\n    \"print(message_2.content.events[-1].model_dump_json(indent=4))\\n\",\n    \"print(\\\"Agent思考结束，等待我们上传本地结果\\\\n\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"这部分输出为Client应用的思考过程\\n\",\n    \"```\\n\",\n    \"Agent的中间思考过程：\\n\",\n    \"{\\n\",\n    \"    \\\"code\\\": 0,\\n\",\n    \"    \\\"message\\\": \\\"\\\",\\n\",\n    \"    \\\"status\\\": \\\"interrupt\\\",\\n\",\n    \"    \\\"event_type\\\": \\\"Interrupt\\\",\\n\",\n    \"    \\\"content_type\\\": \\\"contexts\\\",\\n\",\n    \"    \\\"detail\\\": {\\n\",\n    \"        \\\"text\\\": {\\n\",\n    \"            \\\"function_call\\\": {\\n\",\n    \"                \\\"thought\\\": \\\"用户想要查询公司内张三同学的生日信息，这个需求很明确，且背景信息也足够。我可以使用get_person_infomation工具来查找张三的生日信息。\\\",\\n\",\n    \"                \\\"name\\\": \\\"get_person_infomation\\\",\\n\",\n    \"                \\\"arguments\\\": {\\n\",\n    \"                    \\\"name\\\": \\\"张三\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"usage\\\": {\\n\",\n    \"                    \\\"prompt_tokens\\\": 697,\\n\",\n    \"                    \\\"completion_tokens\\\": 87,\\n\",\n    \"                    \\\"total_tokens\\\": 784,\\n\",\n    \"                    \\\"name\\\": \\\"ERNIE-4.0-Turbo-8K\\\",\\n\",\n    \"                    \\\"type\\\": \\\"plan\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"tool_call_id\\\": \\\"c23309f7-e24a-4476-85e2-3ef9cfd4f6ed\\\"\\n\",\n    \"            },\\n\",\n    \"            \\\"used_tool\\\": []\\n\",\n    \"...\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"Agent思考结束，等待我们上传本地结果\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 大模型下发了调用本地函数的参数，我们使用这个参数调用本地函数\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"tool_call = message_2.content.events[-1].tool_calls[-1]\\n\",\n    \"tool_call_id = tool_call.id\\n\",\n    \"tool_call_argument = tool_call.function.arguments\\n\",\n    \"local_func_result = get_person_infomation(**tool_call_argument)\\n\",\n    \"print(\\\"local_func_result: {}\\\\n\\\".format(local_func_result))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"local_func_result: 您要查找的张三的生日是：1980年1月1日\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 向应用返回本地运行的结果，完成本地函数toolcall调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"message_3 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    tool_outputs=[{\\n\",\n    \"        \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"        \\\"output\\\": local_func_result\\n\",\n    \"    }]\\n\",\n    \")\\n\",\n    \"print(\\\"Agent 拥有了本地函数调用能力后，回答是: {}\\\".format(message_3.content.answer))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"Agent的中间思考过程：\\n\",\n    \"{\\n\",\n    \"    \\\"code\\\": 0,\\n\",\n    \"    \\\"message\\\": \\\"\\\",\\n\",\n    \"    \\\"status\\\": \\\"interrupt\\\",\\n\",\n    \"    \\\"event_type\\\": \\\"Interrupt\\\",\\n\",\n    \"    \\\"content_type\\\": \\\"contexts\\\",\\n\",\n    \"    \\\"detail\\\": {\\n\",\n    \"        \\\"text\\\": {\\n\",\n    \"            \\\"function_call\\\": {\\n\",\n    \"                \\\"thought\\\": \\\"用户想要查询公司内张三同学的生日信息，这个需求很明确，且背景信息也足够。我可以使用get_person_infomation工具来查找张三的生日信息。\\\",\\n\",\n    \"                \\\"name\\\": \\\"get_person_infomation\\\",\\n\",\n    \"                \\\"arguments\\\": {\\n\",\n    \"                    \\\"name\\\": \\\"张三\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"usage\\\": {\\n\",\n    \"                    \\\"prompt_tokens\\\": 697,\\n\",\n    \"                    \\\"completion_tokens\\\": 87,\\n\",\n    \"                    \\\"total_tokens\\\": 784,\\n\",\n    \"                    \\\"name\\\": \\\"ERNIE-4.0-Turbo-8K\\\",\\n\",\n    \"                    \\\"type\\\": \\\"plan\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"tool_call_id\\\": \\\"c23309f7-e24a-4476-85e2-3ef9cfd4f6ed\\\"\\n\",\n    \"            },\\n\",\n    \"            \\\"used_tool\\\": []\\n\",\n    \"...\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"Agent思考结束，等待我们上传本地结果\\n\",\n    \"\\n\",\n    \"Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...\\n\",\n    \"\\n\",\n    \"local_func_result: 您要查找的张三的生日是：1980年1月1日\\n\",\n    \"\\n\",\n    \"Agent 拥有了本地函数调用能力后，回答是: # 解决方案\\n\",\n    \"\\n\",\n    \"## 问题分析\\n\",\n    \"\\n\",\n    \"用户想要查询公司内张三同学的生日信息。这是一个明确且具体的需求，我们可以通过`get_person_infomation`工具来获取这一信息。\\n\",\n    \"\\n\",\n    \"## 工具运用\\n\",\n    \"\\n\",\n    \"1. **工具选择**：`get_person_infomation`\\n\",\n    \"2. **参数设置**：\\n\",\n    \"\\n\",\n    \"\\t* `name`：张三\\n\",\n    \"\\n\",\n    \"3. **执行结果**：张三的生日是1980年1月1日。\\n\",\n    \"\\n\",\n    \"## 解决方案步骤\\n\",\n    \"\\n\",\n    \"1. 使用`get_person_infomation`工具，并设置参数`name`为“张三”。\\n\",\n    \"2. 等待工具执行，并获取张三的生日信息。\\n\",\n    \"3. 将获取到的生日信息（1980年1月1日）告知用户。\\n\",\n    \"\\n\",\n    \"## 注意事项\\n\",\n    \"\\n\",\n    \"* 确保在使用`get_person_infomation`工具时，输入的姓名与公司内部记录的姓名完全一致，以避免查询错误。\\n\",\n    \"* 如果工具返回“未找到”或类似结果，请检查姓名是否有误或联系公司人事部门确认信息。\\n\",\n    \"\\n\",\n    \"通过上述步骤，我们可以准确地回答用户的问题，并提供张三的生日信息。\\n\",\n    \"```\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"python-12\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.12.4\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_08_22/tool_call_2.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 本地调用tool工具-调用Agent执行本地命令\\n\",\n    \"\\n\",\n    \"部分开发者需要给Client应用提供与本地命令交互的能力，比如在Client应用中调用Agent执行本地命令。并实现数据或文件的处理\\n\",\n    \"\\n\",\n    \"##### 配置运行环境&导入Client应用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# AppBuilder Token，替换为您个人的Token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 应用为：智能问题解决者\\n\",\n    \"app_id = \\\"b9473e78-754b-463a-916b-f0a9097a8e5f\\\"\\n\",\n    \"app_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_client.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 创建一个能执行本地bash命令的tool工具\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 赋予应用一个执行本地命令的能力\\n\",\n    \"def execute_local_command(cmd: str):\\n\",\n    \"    import subprocess\\n\",\n    \"    try:\\n\",\n    \"        result = subprocess.check_output(cmd, shell=True).decode(\\\"utf-8\\\")\\n\",\n    \"        if result.strip() == \\\"\\\":\\n\",\n    \"            return \\\"命令执行成功，无返回值\\\"\\n\",\n    \"        return result\\n\",\n    \"    except Exception as e:\\n\",\n    \"        return str(e)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"# 创建工具的描述：json_schema格式\\n\",\n    \"tools = [\\n\",\n    \"    {\\n\",\n    \"        \\\"type\\\": \\\"function\\\",\\n\",\n    \"        \\\"function\\\": {\\n\",\n    \"            \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"            \\\"description\\\": \\\"可以在bash环境中，执行输入的指令，注意，一次只能执行一个原子命令。例如：ls\\\",\\n\",\n    \"            \\\"parameters\\\": {\\n\",\n    \"                \\\"type\\\": \\\"object\\\",\\n\",\n    \"                \\\"properties\\\": {\\n\",\n    \"                    \\\"cmd\\\": {\\n\",\n    \"                        \\\"type\\\": \\\"string\\\",\\n\",\n    \"                        \\\"description\\\": \\\"需要执行的指令\\\",\\n\",\n    \"                    },\\n\",\n    \"                },\\n\",\n    \"                \\\"required\\\": [\\\"cmd\\\"],\\n\",\n    \"            },\\n\",\n    \"        },\\n\",\n    \"    }\\n\",\n    \"]\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 我们再次询问应用，并给他赋予这个能力\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"message_1 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    query=\\\"请问当前文件夹下有哪些文件？如果没有test.txt文件，请新建一个test.txt文件，内容为：Hello World！\\\",\\n\",\n    \"    tools=tools\\n\",\n    \")\\n\",\n    \"print(\\\"Agent的中间思考过程：\\\")\\n\",\n    \"print(message_1.content.events[-1].model_dump_json(indent=4))\\n\",\n    \"print(\\\"Agent思考结束，等待我们上传本地结果\\\\n\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"\\n\",\n    \"- Agent的中间思考过程\\n\",\n    \"\\n\",\n    \"```\\n\",\n    \"Agent的中间思考过程：\\n\",\n    \"{\\n\",\n    \"    \\\"code\\\": 0,\\n\",\n    \"    \\\"message\\\": \\\"\\\",\\n\",\n    \"    \\\"status\\\": \\\"interrupt\\\",\\n\",\n    \"    \\\"event_type\\\": \\\"Interrupt\\\",\\n\",\n    \"    \\\"content_type\\\": \\\"contexts\\\",\\n\",\n    \"    \\\"detail\\\": {\\n\",\n    \"        \\\"text\\\": {\\n\",\n    \"            \\\"function_call\\\": {\\n\",\n    \"                \\\"thought\\\": \\\"首先，我需要使用execute_local_command工具来执行ls命令，列出当前文件夹下的所有文件。然后，我需要检查输出中是否存在test.txt文件。如果不存在，我将再次使用execute_local_command工具来执行echo命令，创建一个新的test.txt文件，并写入内容'Hello World！'。\\\",\\n\",\n    \"                \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"                \\\"arguments\\\": {\\n\",\n    \"                    \\\"cmd\\\": \\\"ls\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"usage\\\": {\\n\",\n    \"                    \\\"prompt_tokens\\\": 718,\\n\",\n    \"                    \\\"completion_tokens\\\": 111,\\n\",\n    \"                    \\\"total_tokens\\\": 829,\\n\",\n    \"                    \\\"name\\\": \\\"ERNIE-4.0-Turbo-8K\\\",\\n\",\n    \"                    \\\"type\\\": \\\"plan\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"tool_call_id\\\": \\\"f60b241c-ddda-46aa-a2a6-b8bf1da2a424\\\"\\n\",\n    \"            },\\n\",\n    \"            \\\"used_tool\\\": []\\n\",\n    \"...\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"Agent思考结束，等待我们上传本地结果\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 大模型下发了调用本地函数的参数，我们使用这个参数调用本地函数\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"tool_call = message_1.content.events[-1].tool_calls[-1]\\n\",\n    \"tool_call_id = tool_call.id\\n\",\n    \"tool_call_argument = tool_call.function.arguments\\n\",\n    \"local_func_result = execute_local_command(**tool_call_argument)\\n\",\n    \"print(\\\"No.1 local_func_result:\\\\n {}\\\\n\\\".format(local_func_result))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"No.1 local_func_result:\\n\",\n    \"multi_tool_call.ipynb\\n\",\n    \"multi_tool_call.py\\n\",\n    \"multi_tool_call_with_handler.py\\n\",\n    \"sdk_ knowledgebase.ipynb\\n\",\n    \"sdk_trace.ipynb\\n\",\n    \"simple_tool_call.ipynb\\n\",\n    \"simple_tool_call.py\\n\",\n    \"tmp.log\\n\",\n    \"黑神话(悟空).pdf\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 向应用返回本地运行的结果，继续等待Agent的思考\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"message_2 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    tool_outputs=[{\\n\",\n    \"        \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"        \\\"output\\\": local_func_result\\n\",\n    \"    }]\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"event_status = message_2.content.events[-1].status\\n\",\n    \"if event_status != \\\"interrupt\\\":\\n\",\n    \"    print(\\\"Agent 的回答是：\\\\n\\\")\\n\",\n    \"    print(message_2.content.answer)\\n\",\n    \"    quit()\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"print(\\\"Agent的中间思考过程：\\\")\\n\",\n    \"print(message_2.content.events[-1].model_dump_json(indent=4))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"Agent的中间思考过程：\\n\",\n    \"{\\n\",\n    \"    \\\"code\\\": 0,\\n\",\n    \"    \\\"message\\\": \\\"\\\",\\n\",\n    \"    \\\"status\\\": \\\"interrupt\\\",\\n\",\n    \"    \\\"event_type\\\": \\\"Interrupt\\\",\\n\",\n    \"    \\\"content_type\\\": \\\"contexts\\\",\\n\",\n    \"    \\\"detail\\\": {\\n\",\n    \"        \\\"text\\\": {\\n\",\n    \"            \\\"function_call\\\": {\\n\",\n    \"                \\\"thought\\\": \\\"根据execute_local_command工具的返回结果，当前文件夹下并没有'test.txt'文件。因此，我需要使用execute_local_command工具来执行'echo \\\\\\\"Hello World\\\\\\\" > test.txt'命令，以创建新的'test.txt'文件并写入内容'Hello World！'。\\\",\\n\",\n    \"                \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"                \\\"arguments\\\": {\\n\",\n    \"                    \\\"cmd\\\": \\\"echo \\\\\\\"Hello World\\\\\\\" > test.txt\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"usage\\\": {\\n\",\n    \"                    \\\"prompt_tokens\\\": 1040,\\n\",\n    \"                    \\\"completion_tokens\\\": 117,\\n\",\n    \"                    \\\"total_tokens\\\": 1157,\\n\",\n    \"                    \\\"name\\\": \\\"ERNIE-4.0-Turbo-8K\\\",\\n\",\n    \"                    \\\"type\\\": \\\"plan\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"tool_call_id\\\": \\\"9eaa3831-0d85-47eb-a39f-866ad2690c28\\\"\\n\",\n    \"            },\\n\",\n    \"            \\\"used_tool\\\": [\\n\",\n    \"...\\n\",\n    \"            }\\n\",\n    \"        }\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 大模型下发了调用本地函数的参数，我们使用这个参数调用本地函数\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"\\n\",\n    \"tool_call = message_2.content.events[-1].tool_calls[-1]\\n\",\n    \"tool_call_id = tool_call.id\\n\",\n    \"tool_call_argument = tool_call.function.arguments\\n\",\n    \"local_func_result = execute_local_command(**tool_call_argument)\\n\",\n    \"print(\\\"No.2 local_func_result: {}\\\\n\\\".format(local_func_result))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"No.2 local_func_result: 命令执行成功，无返回值\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 向应用返回本地运行的结果，完成应用的调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"message_3 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    tool_outputs=[{\\n\",\n    \"        \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"        \\\"output\\\": local_func_result\\n\",\n    \"    }]\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"event_status = message_3.content.events[-1].status\\n\",\n    \"if event_status != \\\"interrupt\\\":\\n\",\n    \"    print(\\\"Agent 的回答是：\\\\n\\\")\\n\",\n    \"    print(message_3.content.answer)\\n\",\n    \"    quit()\\n\",\n    \"\\n\",\n    \"print(\\\"Agent的中间思考过程：\\\")\\n\",\n    \"print(message_3.content.events[-1].model_dump_json(indent=4))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"Agent的中间思考过程：\\n\",\n    \"{\\n\",\n    \"    \\\"code\\\": 0,\\n\",\n    \"    \\\"message\\\": \\\"\\\",\\n\",\n    \"    \\\"status\\\": \\\"interrupt\\\",\\n\",\n    \"    \\\"event_type\\\": \\\"Interrupt\\\",\\n\",\n    \"    \\\"content_type\\\": \\\"contexts\\\",\\n\",\n    \"    \\\"detail\\\": {\\n\",\n    \"        \\\"text\\\": {\\n\",\n    \"            \\\"function_call\\\": {\\n\",\n    \"                \\\"thought\\\": \\\"用户的需求是列出当前文件夹下的所有文件，并在没有test.txt文件的情况下创建一个新的test.txt文件，内容为'Hello World！'。根据之前的执行结果，我们已经成功创建了test.txt文件并写入了内容。现在，我需要再次使用execute_local_command工具来执行ls命令，以确认test.txt文件已经成功创建，并且列出当前文件夹下的所有文件，以满足用户的完整需求。\\\",\\n\",\n    \"                \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"                \\\"arguments\\\": {\\n\",\n    \"                    \\\"cmd\\\": \\\"ls\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"usage\\\": {\\n\",\n    \"                    \\\"prompt_tokens\\\": 1115,\\n\",\n    \"                    \\\"completion_tokens\\\": 133,\\n\",\n    \"                    \\\"total_tokens\\\": 1248,\\n\",\n    \"                    \\\"name\\\": \\\"ERNIE-4.0-Turbo-8K\\\",\\n\",\n    \"                    \\\"type\\\": \\\"plan\\\"\\n\",\n    \"                },\\n\",\n    \"                \\\"tool_call_id\\\": \\\"eaf51384-b48c-41d2-965a-ca57efb4a6f1\\\"\\n\",\n    \"            },\\n\",\n    \"            \\\"used_tool\\\": [\\n\",\n    \"                {\\n\",\n    \"                    \\\"function_call\\\": {\\n\",\n    \"                        \\\"thought\\\": \\\"首先，我需要使用execute_local_command工具来执行ls命令，列出当前文件夹下的所有文件。然后，我需要检查输出中是否存在test.txt文件。如果不存在，我将再次使用execute_local_command工具来执行echo命令，创建一个新的test.txt文件，并写入内容'Hello World！'。\\\",\\n\",\n    \"                        \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"                        \\\"arguments\\\": {\\n\",\n    \"                            \\\"cmd\\\": \\\"ls\\\"\\n\",\n    \"                        }\\n\",\n    \"                    },\\n\",\n    \"                    \\\"function_resp\\\": \\\"multi_tool_call.ipynb\\\\nmulti_tool_call.py\\\\nmulti_tool_call_with_handler.py\\\\nsdk_ knowledgebase.ipynb\\\\nsdk_trace.ipynb\\\\nsimple_tool_call.ipynb\\\\nsimple_tool_call.py\\\\ntmp.log\\\\n黑神话(悟空).pdf\\\\n\\\"\\n\",\n    \"                },\\n\",\n    \"                {\\n\",\n    \"                    \\\"function_call\\\": {\\n\",\n    \"                        \\\"thought\\\": \\\"根据执行结果，当前文件夹下并没有test.txt文件，所以需要使用execute_local_command工具来执行echo命令，创建一个新的test.txt文件，并写入内容'Hello World！'。\\\",\\n\",\n    \"                        \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"                        \\\"arguments\\\": {\\n\",\n    \"                            \\\"cmd\\\": \\\"echo 'Hello World！' > test.txt\\\"\\n\",\n    \"                        },\\n\",\n    \"                        \\\"usage\\\": {\\n\",\n    \"                            \\\"prompt_tokens\\\": 1025,\\n\",\n    \"                            \\\"completion_tokens\\\": 96,\\n\",\n    \"                            \\\"total_tokens\\\": 1121,\\n\",\n    \"                            \\\"name\\\": \\\"ERNIE-4.0-Turbo-8K\\\",\\n\",\n    \"                            \\\"type\\\": \\\"plan\\\"\\n\",\n    \"                        },\\n\",\n    \"                        \\\"tool_call_id\\\": \\\"f43bac97-667d-40f0-a138-c6ade008bdef\\\"\\n\",\n    \"                    },\\n\",\n    \"                    \\\"function_resp\\\": \\\"命令执行成功，无返回值\\\"\\n\",\n    \"                }\\n\",\n    \"            ]\\n\",\n    \"        }\\n\",\n    \"    },\\n\",\n    \"    \\\"usage\\\": null,\\n\",\n    \"    \\\"tool_calls\\\": [\\n\",\n    \"        {\\n\",\n    \"            \\\"id\\\": \\\"eaf51384-b48c-41d2-965a-ca57efb4a6f1\\\",\\n\",\n    \"            \\\"type\\\": \\\"function\\\",\\n\",\n    \"            \\\"function\\\": {\\n\",\n    \"                \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"                \\\"arguments\\\": {\\n\",\n    \"                    \\\"cmd\\\": \\\"ls\\\"\\n\",\n    \"                }\\n\",\n    \"            }\\n\",\n    \"        }\\n\",\n    \"    ]\\n\",\n    \"}\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 大模型下发了调用本地函数的参数，我们使用这个参数调用本地函数\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"tool_call = message_3.content.events[-1].tool_calls[-1]\\n\",\n    \"tool_call_id = tool_call.id\\n\",\n    \"tool_call_argument = tool_call.function.arguments\\n\",\n    \"local_func_result = execute_local_command(**tool_call_argument)\\n\",\n    \"print(\\\"No.3 local_func_result: {}\\\\n\\\".format(local_func_result))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"No.3 local_func_result: multi_tool_call.ipynb\\n\",\n    \"multi_tool_call.py\\n\",\n    \"multi_tool_call_with_handler.py\\n\",\n    \"sdk_ knowledgebase.ipynb\\n\",\n    \"sdk_trace.ipynb\\n\",\n    \"simple_tool_call.ipynb\\n\",\n    \"simple_tool_call.py\\n\",\n    \"test.txt\\n\",\n    \"tmp.log\\n\",\n    \"黑神话(悟空).pdf\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 向应用返回本地运行的结果，完成应用的调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"message_4 = app_client.run(\\n\",\n    \"    conversation_id=conversation_id,\\n\",\n    \"    tool_outputs=[{\\n\",\n    \"        \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"        \\\"output\\\": local_func_result\\n\",\n    \"    }]\\n\",\n    \")\\n\",\n    \"print(\\\"Agent 的回答是：\\\\n\\\")\\n\",\n    \"print(message_4.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \"Agent 的回答是：\\n\",\n    \"\\n\",\n    \"当前文件夹下的文件包括：\\n\",\n    \"\\n\",\n    \"- multi_tool_call.ipynb\\n\",\n    \"- multi_tool_call.py\\n\",\n    \"- multi_tool_call_with_handler.py\\n\",\n    \"- sdk_knowledgebase.ipynb\\n\",\n    \"- sdk_trace.ipynb\\n\",\n    \"- simple_tool_call.ipynb\\n\",\n    \"- simple_tool_call.py\\n\",\n    \"- test.txt\\n\",\n    \"- tmp.log\\n\",\n    \"- 黑神话(悟空).pdf\\n\",\n    \"\\n\",\n    \"由于当前文件夹下没有test.txt文件，因此已经成功创建了一个新的test.txt文件，并写入了内容'Hello World！'。现在，test.txt文件已经出现在文件夹中。\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"我们就完成了一个基于Client与自定义tool工具完成了一个 \\\"请问当前文件夹下有哪些文件？如果没有test.txt文件，请新建一个test.txt文件，内容为：Hello World\\\" 的操作\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"python-12\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.12.4\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_08_22/tool_call_3.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 本地调用tool工具-使用AppBuilderEventHandler简化tool_call操作\\n\",\n    \"\\n\",\n    \"基于multi_tool_call的示例，我们可以使用Client应用来执行tool_call操作，完成指定的命令，但是需要自己配置client的思考与运行流程，较为繁琐。SDK提供了使用AppBuilderEventHandler简化tool_call操作的功能\\n\",\n    \"\\n\",\n    \"##### 配置运行环境&导入Client应用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"# AppBuilder Token，替换为您个人的Token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 应用为：智能问题解决者\\n\",\n    \"app_id = \\\"b9473e78-754b-463a-916b-f0a9097a8e5f\\\"\\n\",\n    \"app_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_client.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 继承AppBuilderEventHandler类实现一个Agent框架的定义\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from appbuilder.core.console.appbuilder_client.event_handler import AppBuilderEventHandler\\n\",\n    \"class MyEventHandler(AppBuilderEventHandler):\\n\",\n    \"    def execute_local_command(self, cmd: str):\\n\",\n    \"        import subprocess\\n\",\n    \"        try:\\n\",\n    \"            result = subprocess.check_output(cmd, shell=True).decode(\\\"utf-8\\\")\\n\",\n    \"            if result.strip() == \\\"\\\":\\n\",\n    \"                return \\\"命令执行成功，无返回值\\\"\\n\",\n    \"            return result\\n\",\n    \"        except Exception as e:\\n\",\n    \"            return str(e)\\n\",\n    \"    \\n\",\n    \"    def interrupt(self, run_context, run_response):\\n\",\n    \"        thought = run_context.current_thought\\n\",\n    \"        # 绿色打印\\n\",\n    \"        print(\\\"\\\\033[1;32m\\\", \\\"-> Agent 中间思考: \\\", thought, \\\"\\\\033[0m\\\")\\n\",\n    \"\\n\",\n    \"        tool_output = []\\n\",\n    \"        for tool_call in run_context.current_tool_calls:\\n\",\n    \"            tool_call_id = tool_call.id\\n\",\n    \"            tool_res = self.execute_local_command(\\n\",\n    \"                **tool_call.function.arguments)\\n\",\n    \"            # 蓝色打印\\n\",\n    \"            print(\\\"\\\\033[1;34m\\\", \\\"-> 本地ToolCall结果: \\\\n\\\", tool_res, \\\"\\\\033[0m\\\\n\\\")\\n\",\n    \"            tool_output.append(\\n\",\n    \"                {\\n\",\n    \"                    \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"                    \\\"output\\\": tool_res\\n\",\n    \"                }\\n\",\n    \"            )\\n\",\n    \"        return tool_output\\n\",\n    \"    \\n\",\n    \"    def success(self, run_context, run_response):\\n\",\n    \"        print(\\\"\\\\n\\\\033[1;31m\\\",\\\"-> Agent 非流式回答: \\\\n\\\", run_response.answer, \\\"\\\\033[0m\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 定义本地的tools工具\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"tools = [\\n\",\n    \"    {\\n\",\n    \"        \\\"type\\\": \\\"function\\\",\\n\",\n    \"        \\\"function\\\": {\\n\",\n    \"            \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"            \\\"description\\\": \\\"可以在bash环境中，执行输入的指令，注意，一次只能执行一个原子命令。例如：ls\\\",\\n\",\n    \"            \\\"parameters\\\": {\\n\",\n    \"                \\\"type\\\": \\\"object\\\",\\n\",\n    \"                \\\"properties\\\": {\\n\",\n    \"                    \\\"cmd\\\": {\\n\",\n    \"                        \\\"type\\\": \\\"string\\\",\\n\",\n    \"                        \\\"description\\\": \\\"需要执行的指令\\\",\\n\",\n    \"                    },\\n\",\n    \"                },\\n\",\n    \"                \\\"required\\\": [\\\"cmd\\\"],\\n\",\n    \"            },\\n\",\n    \"        },\\n\",\n    \"    }\\n\",\n    \"]\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 运行Client实现实现链路的调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"with app_client.run_with_handler(\\n\",\n    \"        conversation_id = conversation_id,\\n\",\n    \"        query = \\\"请问当前文件夹下有哪些文件？如果没有test.txt文件，请新建一个test.txt文件，内容为：Hello World！\\\",\\n\",\n    \"        tools = tools,\\n\",\n    \"        event_handler = MyEventHandler(),\\n\",\n    \"    ) as run:\\n\",\n    \"        run.until_done()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**output**\\n\",\n    \"```\\n\",\n    \" -> Agent 中间思考:  首先，我需要使用execute_local_command工具来执行'ls'命令，列出当前文件夹下的所有文件。然后，我需要检查输出中是否存在test.txt文件。如果不存在，我将再次使用execute_local_command工具来执行'echo \\\"Hello World\\\" > test.txt'命令，以创建并写入test.txt文件。 \\n\",\n    \" -> 本地ToolCall结果: \\n\",\n    \" multi_tool_call.ipynb\\n\",\n    \"multi_tool_call.py\\n\",\n    \"multi_tool_call_with_handler.ipynb\\n\",\n    \"multi_tool_call_with_handler.py\\n\",\n    \"sdk_ knowledgebase.ipynb\\n\",\n    \"sdk_trace.ipynb\\n\",\n    \"simple_tool_call.ipynb\\n\",\n    \"simple_tool_call.py\\n\",\n    \"tmp.log\\n\",\n    \"黑神话(悟空).pdf\\n\",\n    \" \\n\",\n    \"\\n\",\n    \" -> Agent 中间思考:  根据execute_local_command工具的返回结果，当前文件夹下并没有test.txt文件。因此，我需要使用execute_local_command工具来执行'echo \\\"Hello World\\\" > test.txt'命令，以创建并写入test.txt文件。 \\n\",\n    \" -> 本地ToolCall结果: \\n\",\n    \" 命令执行成功，无返回值 \\n\",\n    \"\\n\",\n    \"\\n\",\n    \" -> Agent 非流式回答: \\n\",\n    \" 当前文件夹下的文件包括：\\n\",\n    \"\\n\",\n    \"- multi_tool_call.ipynb\\n\",\n    \"- multi_tool_call.py\\n\",\n    \"- multi_tool_call_with_handler.ipynb\\n\",\n    \"...\\n\",\n    \"- tmp.log\\n\",\n    \"- 黑神话(悟空).pdf\\n\",\n    \"\\n\",\n    \"经过检查，发现当前文件夹下**不存在**test.txt文件。因此，已经为您新建了一个test.txt文件，并写入了内容“Hello World！”。 \\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"- 使用AppBuilderEventHandler架构可以简化client的交互方式\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"python-12\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.12.4\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_08_22/tool_call_4.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 本地调用tool工具-使用AppBuilderEventHandler简化tool_call操作\\n\",\n    \"\\n\",\n    \"基于multi_tool_call的示例，我们可以使用Client应用来执行tool_call操作，完成指定的命令，但是需要自己配置client的思考与运行流程，较为繁琐。SDK提供了使用AppBuilderEventHandler简化tool_call操作的功能,这里我们将调用Client应用，使其调用Text2Image工具生成图片，并将文件下载到本地\\n\",\n    \"\\n\",\n    \"##### 配置运行环境&导入Client应用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"# AppBuilder Token，替换为您个人的Token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 应用为：智能问题解决者\\n\",\n    \"app_id = \\\"e97865e7-e1be-45d3-ab8a-ea84ca6e0b9a\\\"\\n\",\n    \"app_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_client.create_conversation()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 继承AppBuilderEventHandler类实现一个Agent框架的定义\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"from appbuilder.core.console.appbuilder_client.event_handler import AppBuilderEventHandler\\n\",\n    \"class MyEventHandler(AppBuilderEventHandler):\\n\",\n    \"    def execute_local_command(self, cmd: str):\\n\",\n    \"        import subprocess\\n\",\n    \"        try:\\n\",\n    \"            result = subprocess.check_output(cmd, shell=True).decode(\\\"utf-8\\\")\\n\",\n    \"            if result.strip() == \\\"\\\":\\n\",\n    \"                return \\\"命令执行成功，无返回值\\\"\\n\",\n    \"            return result\\n\",\n    \"        except Exception as e:\\n\",\n    \"            return str(e)\\n\",\n    \"    \\n\",\n    \"    def interrupt(self, run_context, run_response):\\n\",\n    \"        thought = run_context.current_thought\\n\",\n    \"        # 绿色打印\\n\",\n    \"        print(\\\"\\\\033[1;32m\\\", \\\"-> Agent 中间思考: \\\", thought, \\\"\\\\033[0m\\\")\\n\",\n    \"\\n\",\n    \"        tool_output = []\\n\",\n    \"        for tool_call in run_context.current_tool_calls:\\n\",\n    \"            tool_call_id = tool_call.id\\n\",\n    \"            tool_res = self.execute_local_command(\\n\",\n    \"                **tool_call.function.arguments)\\n\",\n    \"            # 蓝色打印\\n\",\n    \"            print(\\\"\\\\033[1;34m\\\", \\\"-> 本地ToolCall结果: \\\\n\\\", tool_res, \\\"\\\\033[0m\\\\n\\\")\\n\",\n    \"            tool_output.append(\\n\",\n    \"                {\\n\",\n    \"                    \\\"tool_call_id\\\": tool_call_id,\\n\",\n    \"                    \\\"output\\\": tool_res\\n\",\n    \"                }\\n\",\n    \"            )\\n\",\n    \"        return tool_output\\n\",\n    \"    \\n\",\n    \"    def success(self, run_context, run_response):\\n\",\n    \"        print(\\\"\\\\n\\\\033[1;31m\\\",\\\"-> Agent 非流式回答: \\\\n\\\", run_response.answer, \\\"\\\\033[0m\\\")\\n\",\n    \"\\n\",\n    \"    def running(self, run_context, run_response):\\n\",\n    \"        print(\\\"\\\\n\\\\033[1;31m\\\",\\\"-> Agent 流式回答: \\\\n\\\", run_response.answer, \\\"\\\\033[0m\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 定义本地的tools工具\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"tools = [\\n\",\n    \"    {\\n\",\n    \"        \\\"type\\\": \\\"function\\\",\\n\",\n    \"        \\\"function\\\": {\\n\",\n    \"            \\\"name\\\": \\\"execute_local_command\\\",\\n\",\n    \"            \\\"description\\\": \\\"可以在bash环境中，执行输入的指令, 注意，一次只能执行一个完整的原子命令。并且下载文件使用curl命令，因为没有安装wget，例如：ls\\\",\\n\",\n    \"            \\\"parameters\\\": {\\n\",\n    \"                \\\"type\\\": \\\"object\\\",\\n\",\n    \"                \\\"properties\\\": {\\n\",\n    \"                    \\\"cmd\\\": {\\n\",\n    \"                        \\\"type\\\": \\\"string\\\",\\n\",\n    \"                        \\\"description\\\": \\\"需要执行的指令\\\",\\n\",\n    \"                    },\\n\",\n    \"                },\\n\",\n    \"                \\\"required\\\": [\\\"cmd\\\"],\\n\",\n    \"            },\\n\",\n    \"        },\\n\",\n    \"    }\\n\",\n    \"]\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"##### 运行Client实现实现链路的调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"with app_client.run_with_handler(\\n\",\n    \"        conversation_id = conversation_id,\\n\",\n    \"        query = \\\"请为我生成一张男生头像照片，并下载到本地\\\",\\n\",\n    \"        tools = tools,\\n\",\n    \"        event_handler = MyEventHandler(),\\n\",\n    \"    ) as run:\\n\",\n    \"        run.until_done()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- Agent运行流程及输出\\n\",\n    \"  \\n\",\n    \"![Agent运行流程及输出](https://bj.bcebos.com/v1/appbuilder-sdk-components/Agent%E8%BF%90%E8%A1%8C%E6%B5%81%E7%A8%8B.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-08-22T08%3A38%3A58Z%2F-1%2Fhost%2F25e5b0ac328376a048c919d16c8d6fab9044d09ea2bb4b8b7614b958bb40182f)\\n\",\n    \"\\n\",\n    \"- 查看下载至本地的图片\\n\",\n    \"\\n\",\n    \"![载至本地的图片](https://bj.bcebos.com/v1/appbuilder-sdk-components/boy_avatar.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-08-22T08%3A40%3A26Z%2F-1%2Fhost%2F5d6f2f482bc72b487f59f7bee18e68aacf0399b71210e11a16e99f59754c64c6)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"python-12\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.12.4\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_08_22/trace.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# AppBuilder-Trace:更友好易用的可视化Debug方法\\n\",\n    \"\\n\",\n    \"在使用AppBuilder-SDK完成代码态开发可能会出现BUG，同时在运行Agent的过程中的黑盒问题，给Appbuilder的代码态使用带来了极大的不便。因此Appbuilder-SDK提供了DEBUG功能与Trace功能，帮助用户更友好、易用的调试代码。\\n\",\n    \"\\n\",\n    \"## DEBUG功能\\n\",\n    \"\\n\",\n    \"[DEBUG功能](https://github.com/baidubce/app-builder/blob/master/docs/quick_start/README.md#%E6%89%93%E5%8D%B0debug%E6%97%A5%E5%BF%97)\\n\",\n    \"\\n\",\n    \"- 开启DEBUG日志，可以打印出更多的日志信息，方便调试，包括且不限于：请求URL、请求头、请求参数等。\\n\",\n    \"\\n\",\n    \"### 打印DEBUG日志\\n\",\n    \"\\n\",\n    \"设置环境变量\\n\",\n    \"- 开启DEBUG:`export APPBUILDER_LOGLEVEL=DEBUG`\\n\",\n    \"- 关闭DEBUG:`export APPBUILDER_LOGLEVEL=INFO`\\n\",\n    \"\\n\",\n    \"- 也可以在代码中设置，优先级高于环境变量。\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"# python\\n\",\n    \"appbuilder.logger.setLoglevel(\\\"DEBUG\\\")\\n\",\n    \"```\\n\",\n    \"```java\\n\",\n    \"//java\\n\",\n    \"System.setProperty(\\\"APPBUILDER_LOGLEVEL\\\", \\\"DEBUG\\\");\\n\",\n    \"```\\n\",\n    \"```go\\n\",\n    \"//golang\\n\",\n    \"os.Setenv(\\\"APPBUILDER_LOGLEVEL\\\", \\\"DEBUG\\\")\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"### 指定日志文件\\n\",\n    \"\\n\",\n    \"如果需要将日志输出到指定文件，方便落盘。默认输出为标准输出流。 可以设置环境变量APPBUILDER_LOGFILE,文件名及路径可以根据实际使用修改`export APPBUILDER_LOGFILE=/tmp/appbuilder.log`\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"# python\\n\",\n    \"appbuilder.logger.setFilename(\\\"/tmp/appbuilder.log\\\")\\n\",\n    \"```\\n\",\n    \"```java\\n\",\n    \"//java\\n\",\n    \"System.setProperty(\\\"APPBUILDER_LOGLFILE\\\", \\\"/tmp/appbuilder.log\\\");\\n\",\n    \"```\\n\",\n    \"```golang\\n\",\n    \"// golang\\n\",\n    \"os.Setenv(\\\"APPBUILDER_LOGLEVEL\\\", \\\"/tmp/appbuilder.log\\\")\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"### DEBUG功能应用与正常运行状态\\n\",\n    \"\\n\",\n    \"- 我们将使用Appbuilder-SDK调用已创建好的Client应用进行测试\\n\",\n    \"\\n\",\n    \"示例中的应用为：说唱导师\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:29:34,682.682] _client.py [line:105] DEBUG [main-10719753420054307843] AppBuilder Secret key: Bearer your api key\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"DEBUG:appbuilder:AppBuilder Secret key: Bearer your api key\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:29:34,686.686] _client.py [line:207] DEBUG [main-10048254465741365719] Request header: {'X-Appbuilder-Sdk-Config': '{\\\"appbuilder_sdk_version\\\":\\\"0.9.3\\\",\\\"appbuilder_sdk_language\\\":\\\"python\\\",\\\"appbuilder_sdk_platform\\\":\\\"unknown\\\"}', 'X-Appbuilder-Origin': 'appbuilder_sdk', 'X-Appbuilder-Request-Id': '68ab95ac-c503-4616-a094-50739292c3c1', 'X-Bce-Request-Id': '68ab95ac-c503-4616-a094-50739292c3c1', 'Authorization': 'Bearer your api key'}\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"DEBUG:appbuilder:Request header: {'X-Appbuilder-Sdk-Config': '{\\\"appbuilder_sdk_version\\\":\\\"0.9.3\\\",\\\"appbuilder_sdk_language\\\":\\\"python\\\",\\\"appbuilder_sdk_platform\\\":\\\"unknown\\\"}', 'X-Appbuilder-Origin': 'appbuilder_sdk', 'X-Appbuilder-Request-Id': '68ab95ac-c503-4616-a094-50739292c3c1', 'X-Bce-Request-Id': '68ab95ac-c503-4616-a094-50739292c3c1', 'Authorization': 'Bearer your api key'}\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:29:34,687.687] _client.py [line:161] DEBUG [main-11077088795128889416] Service url: https://qianfan.baidubce.com/v2/app/conversation\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"DEBUG:appbuilder:Service url: https://qianfan.baidubce.com/v2/app/conversation\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:29:34,690.690] _session.py [line:57] DEBUG [main-9588862210139017928] Curl Command:\\n\",\n      \"curl -X POST -L 'https://qianfan.baidubce.com/v2/app/conversation' \\\\\\n\",\n      \"-H 'User-Agent: python-requests/2.32.3' \\\\\\n\",\n      \"-H 'Accept-Encoding: gzip, deflate' \\\\\\n\",\n      \"-H 'Accept: */*' \\\\\\n\",\n      \"-H 'Connection: keep-alive' \\\\\\n\",\n      \"-H 'X-Appbuilder-Sdk-Config: {\\\"appbuilder_sdk_version\\\":\\\"0.9.3\\\",\\\"appbuilder_sdk_language\\\":\\\"python\\\",\\\"appbuilder_sdk_platform\\\":\\\"unknown\\\"}' \\\\\\n\",\n      \"-H 'X-Appbuilder-Origin: appbuilder_sdk' \\\\\\n\",\n      \"-H 'X-Appbuilder-Request-Id: 68ab95ac-c503-4616-a094-50739292c3c1' \\\\\\n\",\n      \"-H 'X-Bce-Request-Id: 68ab95ac-c503-4616-a094-50739292c3c1' \\\\\\n\",\n      \"-H 'Authorization: Bearer your api key' \\\\\\n\",\n      \"-H 'Content-Type: application/json' \\\\\\n\",\n      \"-d '{\\\"app_id\\\": \\\"4678492a-5864-472e-810a-654538d3503c\\\"}'\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"DEBUG:appbuilder:Curl Command:\\n\",\n      \"curl -X POST -L 'https://qianfan.baidubce.com/v2/app/conversation' \\\\\\n\",\n      \"-H 'User-Agent: python-requests/2.32.3' \\\\\\n\",\n      \"-H 'Accept-Encoding: gzip, deflate' \\\\\\n\",\n      \"-H 'Accept: */*' \\\\\\n\",\n      \"-H 'Connection: keep-alive' \\\\\\n\",\n      \"-H 'X-Appbuilder-Sdk-Config: {\\\"appbuilder_sdk_version\\\":\\\"0.9.3\\\",\\\"appbuilder_sdk_language\\\":\\\"python\\\",\\\"appbuilder_sdk_platform\\\":\\\"unknown\\\"}' \\\\\\n\",\n      \"-H 'X-Appbuilder-Origin: appbuilder_sdk' \\\\\\n\",\n      \"-H 'X-Appbuilder-Request-Id: 68ab95ac-c503-4616-a094-50739292c3c1' \\\\\\n\",\n      \"-H 'X-Bce-Request-Id: 68ab95ac-c503-4616-a094-50739292c3c1' \\\\\\n\",\n      \"-H 'Authorization: Bearer your api key' \\\\\\n\",\n      \"-H 'Content-Type: application/json' \\\\\\n\",\n      \"-d '{\\\"app_id\\\": \\\"4678492a-5864-472e-810a-654538d3503c\\\"}'\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:29:35,116.116] _client.py [line:207] DEBUG [main-10660544649237524198] Request header: {'X-Appbuilder-Sdk-Config': '{\\\"appbuilder_sdk_version\\\":\\\"0.9.3\\\",\\\"appbuilder_sdk_language\\\":\\\"python\\\",\\\"appbuilder_sdk_platform\\\":\\\"unknown\\\"}', 'X-Appbuilder-Origin': 'appbuilder_sdk', 'X-Appbuilder-Request-Id': '4e643ef9-e6f8-4b16-87db-81cda2cbb8de', 'X-Bce-Request-Id': '4e643ef9-e6f8-4b16-87db-81cda2cbb8de', 'Authorization': 'Bearer your api key'}\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"DEBUG:appbuilder:Request header: {'X-Appbuilder-Sdk-Config': '{\\\"appbuilder_sdk_version\\\":\\\"0.9.3\\\",\\\"appbuilder_sdk_language\\\":\\\"python\\\",\\\"appbuilder_sdk_platform\\\":\\\"unknown\\\"}', 'X-Appbuilder-Origin': 'appbuilder_sdk', 'X-Appbuilder-Request-Id': '4e643ef9-e6f8-4b16-87db-81cda2cbb8de', 'X-Bce-Request-Id': '4e643ef9-e6f8-4b16-87db-81cda2cbb8de', 'Authorization': 'your api key'}\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:29:35,117.117] _client.py [line:161] DEBUG [main-11717755258005238516] Service url: https://qianfan.baidubce.com/v2/app/conversation/runs\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"DEBUG:appbuilder:Service url: https://qianfan.baidubce.com/v2/app/conversation/runs\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:29:35,119.119] _session.py [line:57] DEBUG [main-11593268707085638034] Curl Command:\\n\",\n      \"curl -X POST -L 'https://qianfan.baidubce.com/v2/app/conversation/runs' \\\\\\n\",\n      \"-H 'User-Agent: python-requests/2.32.3' \\\\\\n\",\n      \"-H 'Accept-Encoding: gzip, deflate' \\\\\\n\",\n      \"-H 'Accept: */*' \\\\\\n\",\n      \"-H 'Connection: keep-alive' \\\\\\n\",\n      \"-H 'X-Appbuilder-Sdk-Config: {\\\"appbuilder_sdk_version\\\":\\\"0.9.3\\\",\\\"appbuilder_sdk_language\\\":\\\"python\\\",\\\"appbuilder_sdk_platform\\\":\\\"unknown\\\"}' \\\\\\n\",\n      \"-H 'X-Appbuilder-Origin: appbuilder_sdk' \\\\\\n\",\n      \"-H 'X-Appbuilder-Request-Id: 4e643ef9-e6f8-4b16-87db-81cda2cbb8de' \\\\\\n\",\n      \"-H 'X-Bce-Request-Id: 4e643ef9-e6f8-4b16-87db-81cda2cbb8de' \\\\\\n\",\n      \"-H 'Authorization: Bearer your api key' \\\\\\n\",\n      \"-H 'Content-Type: application/json' \\\\\\n\",\n      \"-d '{\\\"query\\\": \\\"以“上班狼狈却又追逐梦想“为主题进行一首说唱创作，保持押韵, 控制在50字以内\\\", \\\"stream\\\": false, \\\"conversation_id\\\": \\\"f7cd419c-d78c-4fbf-8ed4-c0b93c411381\\\", \\\"file_ids\\\": [], \\\"app_id\\\": \\\"4678492a-5864-472e-810a-654538d3503c\\\", \\\"tools\\\": null, \\\"tool_outputs\\\": null}'\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"DEBUG:appbuilder:Curl Command:\\n\",\n      \"curl -X POST -L 'https://qianfan.baidubce.com/v2/app/conversation/runs' \\\\\\n\",\n      \"-H 'User-Agent: python-requests/2.32.3' \\\\\\n\",\n      \"-H 'Accept-Encoding: gzip, deflate' \\\\\\n\",\n      \"-H 'Accept: */*' \\\\\\n\",\n      \"-H 'Connection: keep-alive' \\\\\\n\",\n      \"-H 'X-Appbuilder-Sdk-Config: {\\\"appbuilder_sdk_version\\\":\\\"0.9.3\\\",\\\"appbuilder_sdk_language\\\":\\\"python\\\",\\\"appbuilder_sdk_platform\\\":\\\"unknown\\\"}' \\\\\\n\",\n      \"-H 'X-Appbuilder-Origin: appbuilder_sdk' \\\\\\n\",\n      \"-H 'X-Appbuilder-Request-Id: 4e643ef9-e6f8-4b16-87db-81cda2cbb8de' \\\\\\n\",\n      \"-H 'X-Bce-Request-Id: 4e643ef9-e6f8-4b16-87db-81cda2cbb8de' \\\\\\n\",\n      \"-H 'Authorization: Bearer your api key' \\\\\\n\",\n      \"-H 'Content-Type: application/json' \\\\\\n\",\n      \"-d '{\\\"query\\\": \\\"以“上班狼狈却又追逐梦想“为主题进行一首说唱创作，保持押韵, 控制在50字以内\\\", \\\"stream\\\": false, \\\"conversation_id\\\": \\\"f7cd419c-d78c-4fbf-8ed4-c0b93c411381\\\", \\\"file_ids\\\": [], \\\"app_id\\\": \\\"4678492a-5864-472e-810a-654538d3503c\\\", \\\"tools\\\": null, \\\"tool_outputs\\\": null}'\\n\",\n      \"\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"上班路上忙追赶，狼狈模样也心甘。\\n\",\n      \"梦想照亮前方路，不畏艰辛往前看。\\n\",\n      \"脚步匆匆人憔悴，只为梦想能成真。\\n\",\n      \"努力奋斗不言弃，终有一天会翻身。\\n\",\n      \"\\n\",\n      \"这首简短的说唱以“上班狼狈却又追逐梦想”为主题，表达了追梦路上的艰辛与坚持，希望你喜欢。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"import os\\n\",\n    \"\\n\",\n    \"appbuilder.logger.setLoglevel(\\\"DEBUG\\\")\\n\",\n    \"# 设置环境中的TOKEN，请替换为您的个人TOKEN\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 从AppBuilder网页获取并传入应用ID，以下为说唱导师应用ID\\n\",\n    \"app_id = \\\"4678492a-5864-472e-810a-654538d3503c\\\"\\n\",\n    \"\\n\",\n    \"app_builder_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_builder_client.create_conversation()\\n\",\n    \"\\n\",\n    \"answer = app_builder_client.run(conversation_id, \\\"以“上班狼狈却又追逐梦想“为主题进行一首说唱创作，保持押韵, 控制在50字以内\\\")\\n\",\n    \"print(answer.content.answer)\\n\",\n    \"\\n\",\n    \"appbuilder.logger.setLoglevel(\\\"INFO\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"我们可以看到DEBUG模式会截获并在控制台输出相应的运行节点信息,同时可以生成curl,辅助开发者实现请求复现\\n\",\n    \"\\n\",\n    \"## Trace功能\\n\",\n    \"\\n\",\n    \"[Trace功能](https://github.com/baidubce/app-builder/blob/master/docs/trace/README.md)\\n\",\n    \"\\n\",\n    \"### Trace环境的安装与启动\\n\",\n    \"\\n\",\n    \"Appbuilder-SDK的可视化跟踪前端基于Phoenix可视化软件如果未安装phoenix，需要先安装phoenix软件(这里提供清华源下载途径)\\n\",\n    \"\\n\",\n    \"#### Trace环境的安装\\n\",\n    \"\\n\",\n    \"```bash\\n\",\n    \"python3 -m pip install arize-phoenix==4.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install arize-phoenix==4.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 启动phoenix服务\\n\",\n    \"\\n\",\n    \"控制台输入:`appbuilder_trace_server`,即可启动phoenix可视化软件,点击 http://localhost:8080/ 即可打开可视化界面\\n\",\n    \"\\n\",\n    \"- 要求 `appbuilder-sdk >= 0.9.1`\\n\",\n    \"\\n\",\n    \"### Trace框架功能展示\\n\",\n    \"\\n\",\n    \"Trace框架现阶段支持两种Trace信息展示方式\\n\",\n    \"\\n\",\n    \"- Phoenix可视化展示Trace到的Span信息\\n\",\n    \"  - `enable_phoenix = True`\\n\",\n    \"- 控制台输出Trace到的Span信息\\n\",\n    \"  - `enable_console = True`\\n\",\n    \"\\n\",\n    \"接下来流式运行Client应用，查看Phoenix效果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:30:10,683.683] tracer.py [line:293] INFO [main-11990101290407320544] OTLPSpanExporter endpoint: http://localhost:8080/v1/traces\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"INFO:appbuilder:OTLPSpanExporter endpoint: http://localhost:8080/v1/traces\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"[2024-08-21 20:30:10,684.684] tracer.py [line:351] INFO [main-10829791027654713596] AppBuilder Starting trace...\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"INFO:appbuilder:AppBuilder Starting trace...\\n\"\n     ]\n    },\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"answer='' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'origin_query': '以“上班狼狈却又追逐梦想“为主题进行一首说唱创作，保持押韵, 控制在50字以内'}, 'component_code': 'ChatAgent', 'component_name': '聊天助手'}}, usage=None, tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='preparing', event_type='ChatAgent', content_type='status', detail={}, usage=None, tool_calls=None)]\\n\",\n      \"answer='Intro:' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': 'Intro:'}, usage=Usage(prompt_tokens=398, completion_tokens=0, total_tokens=398, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='\\\\n追逐' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '\\\\n追逐'}, usage=Usage(prompt_tokens=398, completion_tokens=0, total_tokens=398, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='梦想的路上' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '梦想的路上'}, usage=Usage(prompt_tokens=398, completion_tokens=0, total_tokens=398, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='，上班' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '，上班'}, usage=Usage(prompt_tokens=398, completion_tokens=0, total_tokens=398, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='狼狈不' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '狼狈不'}, usage=Usage(prompt_tokens=398, completion_tokens=0, total_tokens=398, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='慌张。' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '慌张。'}, usage=Usage(prompt_tokens=398, completion_tokens=0, total_tokens=398, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='\\\\n\\\\n' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '\\\\n\\\\n'}, usage=Usage(prompt_tokens=398, completion_tokens=16, total_tokens=414, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='Verse:' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': 'Verse:'}, usage=Usage(prompt_tokens=398, completion_tokens=16, total_tokens=414, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='\\\\n朝九晚' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '\\\\n朝九晚'}, usage=Usage(prompt_tokens=398, completion_tokens=16, total_tokens=414, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='五忙' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '五忙'}, usage=Usage(prompt_tokens=398, completion_tokens=16, total_tokens=414, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='又忙' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '又忙'}, usage=Usage(prompt_tokens=398, completion_tokens=16, total_tokens=414, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='，为了' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '，为了'}, usage=Usage(prompt_tokens=398, completion_tokens=16, total_tokens=414, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='生活奔波' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '生活奔波'}, usage=Usage(prompt_tokens=398, completion_tokens=16, total_tokens=414, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='忙。' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '忙。'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='\\\\n心中' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '\\\\n心中'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='却有梦想' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '却有梦想'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='在，' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '在，'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='不曾放弃' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '不曾放弃'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='追逐航' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '追逐航'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='。\\\\n' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '。\\\\n'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='\\\\nHook' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '\\\\nHook'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer=':\\\\n' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': ':\\\\n'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='梦想照亮' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '梦想照亮'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='前方路' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '前方路'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='，坚持' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '，坚持'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='信念不' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '信念不'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='认输。' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '认输。'}, usage=Usage(prompt_tokens=398, completion_tokens=30, total_tokens=428, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='\\\\n哪怕' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '\\\\n哪怕'}, usage=Usage(prompt_tokens=398, completion_tokens=58, total_tokens=456, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='上班再' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '上班再'}, usage=Usage(prompt_tokens=398, completion_tokens=58, total_tokens=456, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='狼狈，' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '狼狈，'}, usage=Usage(prompt_tokens=398, completion_tokens=58, total_tokens=456, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='也要勇敢' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '也要勇敢'}, usage=Usage(prompt_tokens=398, completion_tokens=58, total_tokens=456, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='追梦想' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '追梦想'}, usage=Usage(prompt_tokens=398, completion_tokens=58, total_tokens=456, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='。\\\\n' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '。\\\\n'}, usage=Usage(prompt_tokens=398, completion_tokens=58, total_tokens=456, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='\\\\n这首' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '\\\\n这首'}, usage=Usage(prompt_tokens=398, completion_tokens=73, total_tokens=471, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='简短的' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '简短的'}, usage=Usage(prompt_tokens=398, completion_tokens=73, total_tokens=471, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='rap以' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': 'rap以'}, usage=Usage(prompt_tokens=398, completion_tokens=73, total_tokens=471, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='“上班' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '“上班'}, usage=Usage(prompt_tokens=398, completion_tokens=79, total_tokens=477, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='狼狈却又' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '狼狈却又'}, usage=Usage(prompt_tokens=398, completion_tokens=79, total_tokens=477, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='追逐梦想”' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '追逐梦想”'}, usage=Usage(prompt_tokens=398, completion_tokens=79, total_tokens=477, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='为主题，' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '为主题，'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='通过押韵' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '通过押韵'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='的方式表达了' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '的方式表达了'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='即使生活' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '即使生活'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='艰辛，' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '艰辛，'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='也要坚持' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '也要坚持'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='追逐梦想的' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '追逐梦想的'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='决心。' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '决心。'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='希望你喜欢' events=[Event(code=0, message='', status='running', event_type='ChatAgent', content_type='text', detail={'text': '希望你喜欢'}, usage=Usage(prompt_tokens=398, completion_tokens=88, total_tokens=486, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='！' events=[Event(code=0, message='', status='done', event_type='ChatAgent', content_type='text', detail={'text': '！'}, usage=Usage(prompt_tokens=398, completion_tokens=105, total_tokens=503, name='DeepSeek-V3.1-Preview'), tool_calls=None)]\\n\",\n      \"answer='' events=[Event(code=0, message='', status='success', event_type='ChatAgent', content_type='status', detail={}, usage=None, tool_calls=None)]\\n\",\n      \"answer='' events=[]\\n\",\n      \"[2024-08-21 20:30:19,396.396] tracer.py [line:355] INFO [main-11328972138384597399] AppBuilder Ending trace...\\n\"\n     ]\n    },\n    {\n     \"name\": \"stderr\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"INFO:appbuilder:AppBuilder Ending trace...\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 启动Appbuilder-SDK TRACE\\n\",\n    \"from appbuilder import AppBuilderTracer\\n\",\n    \"tracer=AppBuilderTracer(\\n\",\n    \"    enable_phoenix = True,\\n\",\n    \"    enable_console = False,\\n\",\n    \"    )\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"import appbuilder\\n\",\n    \"import os\\n\",\n    \"\\n\",\n    \"# 启动跟踪器\\n\",\n    \"tracer.start_trace()\\n\",\n    \"\\n\",\n    \"# 设置环境中的TOKEN，替换为您的个人TOKEN\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your api key\\\"\\n\",\n    \"\\n\",\n    \"# 从AppBuilder网页获取并传入应用ID，以下为说唱导师应用ID\\n\",\n    \"app_id = \\\"4678492a-5864-472e-810a-654538d3503c\\\"\\n\",\n    \"\\n\",\n    \"app_builder_client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = app_builder_client.create_conversation()\\n\",\n    \"\\n\",\n    \"answer = app_builder_client.run(conversation_id, \\\"以“上班狼狈却又追逐梦想“为主题进行一首说唱创作，保持押韵, 控制在50字以内\\\",stream = True)\\n\",\n    \"\\n\",\n    \"# 流式输出res\\n\",\n    \"for res in answer.content:\\n\",\n    \"    print(res)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"# 结束跟踪器\\n\",\n    \"tracer.end_trace()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 控制台输出跟踪到的Span节点信息\\n\",\n    \"- 可以在可视化界面查看跟踪信息如Client组件的调用链路，输入输出、消耗token数等信息\\n\",\n    \"- 点击某个调用链路，可以查看该调用链路详细信息，流式运行过程，HTTP-POST节点展示curl命令\\n\",\n    \"\\n\",\n    \"![Phoenix可视化界面展示](https://bj.bcebos.com/v1/appbuilder-sdk-components/cookbook-phoenix.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-08-21T07%3A36%3A31Z%2F-1%2Fhost%2Fd005f6e23bfc3f7439e0701baf497d1ff7afbd050343c650392569d83baa5ec6)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### Phoneix可视化软件的进阶用法\\n\",\n    \"\\n\",\n    \"#### 1. 选择可视化展示的选项\\n\",\n    \"\\n\",\n    \"- 点击Columns，选择需要可视化展示的字段\\n\",\n    \"\\n\",\n    \"![选择可视化展示的选项](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E4%BF%AE%E6%94%B9phoenix%E5%B1%95%E7%A4%BA%E5%8F%82%E6%95%B0.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T03%3A35%3A17Z%2F-1%2Fhost%2Ff9ff13fb2243ebbf1dd66008977a46def85aec56af5256be3f141fd36b6194c9)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"#### 2. 查看节点关键信息 \\n\",\n    \"\\n\",\n    \"- 点击需要查看的节点，查看节点关键信息，Info将展示input、ouput信息\\n\",\n    \"\\n\",\n    \"![查看节点关键信息 ](https://bj.bcebos.com/v1/appbuilder-sdk-components/Phoenix%E5%8F%AF%E8%A7%86%E5%8C%96%E7%95%8C%E9%9D%A2%EF%BC%883%EF%BC%89.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T03%3A36%3A11Z%2F-1%2Fhost%2Ffc471ccb9ecbc05eebf41f965e6df52132219f96bf688a46e6b6fa61f598088e)\\n\",\n    \"\\n\",\n    \"#### 3. 搜索目标节点 \\n\",\n    \"\\n\",\n    \"##### 依据节点类型搜索\\n\",\n    \"\\n\",\n    \"- 点击搜索框，输入节点类型，搜索目标节点(eg: span_kind == 'AGENT')\\n\",\n    \"- 在Traces界面，只能检索到根节点、在Spans界面，可以检索到所有节点\\n\",\n    \"\\n\",\n    \"![依据节点类型搜索](https://bj.bcebos.com/v1/appbuilder-sdk-components/span_kind_find.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A39%3A04Z%2F-1%2Fhost%2F5bb320731860407968af9693c43c5639611776d760769d29077bcb2e968b05d1)\\n\",\n    \"\\n\",\n    \"##### 依据节点信息检索\\n\",\n    \"\\n\",\n    \"- 依据节点信息检索可快速定位到目标节点\\n\",\n    \"\\n\",\n    \"![依据节点信息检索](https://bj.bcebos.com/v1/appbuilder-sdk-components/span_value_find.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A39%3A20Z%2F-1%2Fhost%2F43b20f9894586405e65195ebf6f86c21193812ab9ffd59f93287266e1a83ab03)\\n\",\n    \"\\n\",\n    \"##### 其他多种检索方式\\n\",\n    \"\\n\",\n    \"![其他多种检索方式](https://bj.bcebos.com/v1/appbuilder-sdk-components/every_span_find.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A39%3A35Z%2F-1%2Fhost%2Fa9b2dcf361416cf9a3727fc64d86bb370a5f24fc25286c53be15c5ecfd44e7e0)\\n\",\n    \"\\n\",\n    \"### Trace服务独立部署\\n\",\n    \"\\n\",\n    \"Phonenix可视化界面不但支持本地部署，还支持远程服务器部署\\n\",\n    \"\\n\",\n    \"#### 远程服务器启动Phoenix\\n\",\n    \"\\n\",\n    \"- 远程服务器部署Phoenix，需要提前安装好Docker环境\\n\",\n    \"运行`appbuilder_trace_server`命令，启动Phoenix服务\\n\",\n    \"\\n\",\n    \"- 本地运行Appbuilder Trace功能需要对`AppBuilderTracer`实例化时的参数进行修改,即可实现将Appbuilder-SDK的Trace信息发送到远程服务器\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"from appbuilder import AppBuilderTracer\\n\",\n    \"tracer=AppBuilderTracer(\\n\",\n    \"    enable_phoenix = True,\\n\",\n    \"    enable_console = True,\\n\",\n    \"    host = \\\"远程服务器的IP地址\\\",\\n\",\n    \"    port = 8080,\\n\",\n    \"    )\\n\",\n    \"```\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"python-10\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.12.4\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/live_broadcast_material/2024_12_18/rag_knowledgebase_01.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# AppBuilder-Knowledge：生产环境的知识库/文档/切片管理教学\\n\",\n    \"\\n\",\n    \"[知识库组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/KnowledgeBase/knowledgebase.md)\\n\",\n    \"\\n\",\n    \"知识库组件（KnowledgeBase）是对线上知识库操作的组件，可以通过SDK实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作，可在平台console中查看结果。对console端知识库进行操作，可以通过SDK实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作，可在平台console中查看结果\\n\",\n    \"\\n\",\n    \"## 1. 创建Agent应用\\n\",\n    \"\\n\",\n    \"### 1.1 平台Console创建Agent应用\\n\",\n    \"\\n\",\n    \"- 创建空应用并发布\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/console%E5%88%9B%E5%BB%BA%E6%B0%91%E6%B3%95%E5%85%B8.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-12-17T07%3A38%3A28Z%2F-1%2Fhost%2Ff497d9db3d8945859043fe24fcca4490c3e93a27042e42abc280d0fea7fd3305)\\n\",\n    \"\\n\",\n    \"### 1.2 使用SDK调用创建的民法典智能问答Agent\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"民法典第二编第一章的内容是关于物权编通则的一般规定，主要包括以下几个方面：\\n\",\n      \"\\n\",\n      \"### 一、物权编的调整范围\\n\",\n      \"\\n\",\n      \"* **第二百零五条**：本编调整因物的归属和利用产生的民事关系。\\n\",\n      \"\\n\",\n      \"### 二、国家基本经济制度\\n\",\n      \"\\n\",\n      \"* **第二百零六条**：国家坚持和完善公有制为主体、多种所有制经济共同发展，按劳分配为主体、多种分配方式并存，社会主义市场经济体制等社会主义基本经济制度。国家巩固和发展公有制经济，鼓励、支持和引导非公有制经济的发展。国家实行社会主义市场经济，保障一切市场主体的平等法律地位和发展权利。\\n\",\n      \"\\n\",\n      \"### 三、物权保护原则\\n\",\n      \"\\n\",\n      \"* **第二百零七条**：国家、集体、私人的物权和其他权利人的物权受法律平等保护，任何组织或者个人不得侵犯。\\n\",\n      \"\\n\",\n      \"### 四、物权设立、变更、转让和消灭的基本原则\\n\",\n      \"\\n\",\n      \"* **第二百零八条**：不动产物权的设立、变更、转让和消灭，应当依照法律规定登记。动产物权的设立和转让，应当依照法律规定交付。\\n\",\n      \"\\n\",\n      \"### 五、其他规定\\n\",\n      \"\\n\",\n      \"民法典第二编第一章还包含了一些其他与物权相关的一般性规定，这些规定为物权编后续章节的具体内容提供了基础和指导。\\n\",\n      \"\\n\",\n      \"综上所述，民法典第二编第一章作为物权编通则的一般规定，明确了物权编的调整范围、国家基本经济制度、物权保护原则以及物权设立、变更、转让和消灭的基本原则，为后续章节的具体规定提供了基础和指导。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"import appbuilder\\n\",\n    \"import os\\n\",\n    \"\\n\",\n    \"# 更换为自己的Appbuilder-token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"\\\"\\n\",\n    \"\\n\",\n    \"# 更换为自己的App ID\\n\",\n    \"app_id = \\\"\\\"\\n\",\n    \"client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = client.create_conversation()\\n\",\n    \"message = client.run(conversation_id, \\\"请输出民法典第二编第一章的内容\\\")\\n\",\n    \"# 打印对话结果\\n\",\n    \"print(message.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E6%B0%91%E6%B3%95%E5%85%B8%E7%AC%AC%E4%BA%8C%E7%BC%96%E7%AC%AC%E4%B8%80%E7%AB%A0%E4%B8%80%E8%88%AC%E8%A7%84%E5%AE%9A.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-12-17T08%3A10%3A14Z%2F-1%2Fhost%2F7852a4156383383e6190435f76b6709409def221e3835369f7d155d3c9dd438a)\\n\",\n    \"\\n\",\n    \"我们可以观察到上述Agent基本回答除了对于民法典的第二编第一章一般规定的内容，但是对照上图中的内容不够准确，这说明LLM在运行中出现了一定程度的幻觉，所以我们需要使用RAG(KnowledgeBase)对Agent进行优化。\\n\",\n    \"\\n\",\n    \"## 2. RAG(KnowledgeBase)\\n\",\n    \"\\n\",\n    \"Appbuilder中支持多种实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作方式，包括：\\n\",\n    \"- 平台Console实现知识库操作\\n\",\n    \"- 使用SDK/API代码态实现知识库操作\\n\",\n    \"这里我们选择使用代码态SDK实现知识库的操作\\n\",\n    \"\\n\",\n    \"### 2.1 创建知识库\\n\",\n    \"\\n\",\n    \"首先我们需要创建知识库，这里我们使用SDK代码态实现知识库的创建\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 80,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"知识库ID:  6ac10164-e80a-4497-ae9f-06ac35f38b97\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"knowledge = appbuilder.KnowledgeBase()\\n\",\n    \"resp = knowledge.create_knowledge_base(\\n\",\n    \"        name=\\\"中华人民共和国民法典\\\",\\n\",\n    \"        description=\\\"中华人民共和国民法典的中文版\\\",\\n\",\n    \"        type=\\\"public\\\",\\n\",\n    \"    )\\n\",\n    \"my_knowledge_base_id = resp.id # 传入知识库ID\\n\",\n    \"my_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\\n\",\n    \"print(\\\"知识库ID: \\\", my_knowledge.knowledge_id)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 我们可以到平台Console中查看知识库是否创建成功，我们可以观察到知识库的名称和ID，知识库创建成功！\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E6%9F%A5%E7%9C%8B%E7%9F%A5%E8%AF%86%E5%BA%93%E6%B0%91%E6%B3%95%E5%85%B8.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-12-17T08%3A37%3A16Z%2F-1%2Fhost%2F40c0d55c6d01d538853bf3b8167c9c5271d74083a20afd5d17590986b44eb954)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 2.2 上传文档到知识库\\n\",\n    \"\\n\",\n    \"上传文档到知识库共有以下三种方式：\\n\",\n    \"- 上传文档到知识库\\n\",\n    \"- 上传通用文档\\n\",\n    \"\\n\",\n    \"##### 2.2.1 上传文档到知识库\\n\",\n    \"- 主要提供自定义文档处理策略，向知识库添加文档\\n\",\n    \"  - 文档格式：rawText (允许配置后续分割策略)\\n\",\n    \"  - 文档处理策略\\n\",\n    \"\\n\",\n    \"```python\\n\",\n    \"knowledge_base_id = my_knowledge.knowledge_id\\n\",\n    \"knowledge.create_documents(\\n\",\n    \"\\tid=knowledge_base_id,\\n\",\n    \"\\tcontentFormat=\\\"rawText\\\",\\n\",\n    \"\\tsource=appbuilder.DocumentSource(\\n\",\n    \"\\t\\ttype=\\\"web\\\",\\n\",\n    \"\\t\\turls=[\\\"网页版的文档链接地址\\\"],\\n\",\n    \"\\t\\turlDepth=1,\\n\",\n    \"\\t),\\n\",\n    \"\\tprocessOption=appbuilder.DocumentProcessOption(\\n\",\n    \"\\t\\ttemplate=\\\"custom\\\",\\n\",\n    \"\\t\\tparser=appbuilder.DocumentChoices(\\n\",\n    \"\\t\\t\\tchoices=[\\\"layoutAnalysis\\\", \\\"ocr\\\"]\\n\",\n    \"\\t\\t),\\n\",\n    \"\\t\\tchunker=appbuilder.DocumentChunker(\\n\",\n    \"\\t\\t\\tchoices=[\\\"separator\\\"],\\n\",\n    \"\\t\\t\\tseparator=appbuilder.DocumentSeparator(\\n\",\n    \"\\t\\t\\t\\tseparators=[\\\"。\\\"],\\n\",\n    \"\\t\\t\\t\\ttargetLength=300,\\n\",\n    \"\\t\\t\\t\\toverlapRate=0.25,\\n\",\n    \"\\t\\t\\t),\\n\",\n    \"\\t\\t\\tprependInfo=[\\\"title\\\", \\\"filename\\\"],\\n\",\n    \"\\t\\t),\\n\",\n    \"\\t\\tknowledgeAugmentation=appbuilder.DocumentChoices(choices=[\\\"faq\\\"]),\\n\",\n    \"\\t),\\n\",\n    \")\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"#### 2.2.2 上传通用文档\\n\",\n    \"- SDK支持基于代码态的文档上传方法`upload_file`,以及包含文档的自定义切分逻辑的向知识库添加文档的方法``add_document`\\n\",\n    \"- 需要先将文档下载至本地\\n\",\n    \"\\n\",\n    \"#### 采用上传通用文档的方案上传文档到知识库\\n\",\n    \"- 下面将提供一个缺少第七编第十章的民法典txt文件，同时使用SDK将其上传到知识库中，首先下载我们储存到云端的txt文件。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 81,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"文件已成功下载到 mingfadian.txt\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 下载云端民法典到本地\\n\",\n    \"import requests\\n\",\n    \"\\n\",\n    \"def download_file(url, local_filename):\\n\",\n    \"    try:\\n\",\n    \"        response = requests.get(url, stream=True)\\n\",\n    \"        with open(local_filename, 'wb') as f:\\n\",\n    \"            for chunk in response.iter_content(chunk_size=8192):\\n\",\n    \"                f.write(chunk)\\n\",\n    \"\\n\",\n    \"        print(f\\\"文件已成功下载到 {local_filename}\\\")\\n\",\n    \"    except requests.RequestException as e:\\n\",\n    \"        print(f\\\"下载文件时发生错误: {e}\\\")\\n\",\n    \"\\n\",\n    \"# 使用示例\\n\",\n    \"url = 'https://bj.bcebos.com/v1/appbuilder-sdk-components/mingfadian.txt?authorization=bce-auth-v1\\\\\\n\",\n    \"%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-12-17T10%3A44%3A33Z%2F-1%2Fhost%2Fb97e44abe836f58de9632c374d4055c391a84f7998562493c22fdff8596cdf49'\\n\",\n    \"local_filename = 'mingfadian.txt'  \\n\",\n    \"download_file(url, local_filename)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 接下来我们将下载好的mingfadian.txt文件使用SDK上传到Appbuilder的知识库中，使用`appbuilder.CustomProcessRule`设置文档的切分规则。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 83,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"upload_res = knowledge.upload_file(local_filename)\\n\",\n    \"add_res = knowledge.add_document(\\n\",\n    \"    content_type=\\\"raw_text\\\",\\n\",\n    \"    file_ids=[upload_res.id],\\n\",\n    \"    custom_process_rule=appbuilder.CustomProcessRule(\\n\",\n    \"        separators=[\\\"?\\\"], target_length=600, overlap_rate=0.3\\n\",\n    \"    ),\\n\",\n    \"    knowledge_base_id=my_knowledge.knowledge_id\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 此时就可以在平台Console中查看到我们上传的民法典知识库了\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E6%B0%91%E6%B3%95%E5%85%B8%E7%9F%A5%E8%AF%86%E5%BA%93%E4%B8%AD%E6%9F%A5%E7%9C%8B%E5%AF%B9%E5%BA%94%E6%96%87%E4%BB%B6.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-12-17T08%3A51%3A35Z%2F-1%2Fhost%2F4025b0777017d0776e08ebe81c94b794c0883165ceaac1751d6c9824ed5727c2)\\n\",\n    \"\\n\",\n    \"### 2.3 为Agent应用添加知识库\\n\",\n    \"\\n\",\n    \"- 在平台console中找到我们创建的Agent应用，添加我们创建的民法典知识库，并更新发布应用\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%BA%94%E7%94%A8%E6%B7%BB%E5%8A%A0%E7%9F%A5%E8%AF%86%E5%BA%93.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-12-17T08%3A55%3A22Z%2F-1%2Fhost%2F4213ddd932eb9db15a507d985092797f168f5bb338df0453ea0848a1f9814597)\\n\",\n    \"\\n\",\n    \"- 再次调用我们的Agent应用，就可以看到我们添加民法典知识库之后，Agent应用可以正确回答我们的问题了\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 88,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"**民法典第二编第一章的内容如下**：\\n\",\n      \"\\n\",\n      \"第一章　一般规定\\n\",\n      \"\\n\",\n      \"第二百零五条　本编调整因物的归属和利用产生的民事关系。\\n\",\n      \"\\n\",\n      \"第二百零六条　国家坚持和完善公有制为主体、多种所有制经济共同发展，按劳分配为主体、多种分配方式并存，社会主义市场经济体制等社会主义基本经济制度。国家巩固和发展公有制经济，鼓励、支持和引导非公有制经济的发展。国家实行社会主义市场经济，保障一切市场主体的平等法律地位和发展权利。\\n\",\n      \"\\n\",\n      \"第二百零七条　国家、集体、私人的物权和其他权利人的物权受法律平等保护，任何组织或者个人不得侵犯。\\n\",\n      \"\\n\",\n      \"第二百零八条　不动产物权的设立、变更、转让和消灭，应当依照法律规定登记。动产物权的设立和转让，应当依照法律规定交付。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = client.create_conversation()\\n\",\n    \"message = client.run(conversation_id, \\\"请输出民法典第二编第一章的内容\\\")\\n\",\n    \"# 打印对话结果\\n\",\n    \"print(message.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 可以观察到在使用了RAG(KnowledgeBase)之后，可以准确的输出【民法典的第二编第一分编第一章一般规定】部分的准确内容，接下来我们实验查询我们刻意删除掉的民法典第七编第十章部分的内容，查看Agent能否输出准确答案。(使用此方法模拟我们知识库中的文档更新之后，并没有被上传到知识库的情况)\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 89,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"无法回答此问题。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = client.create_conversation()\\n\",\n    \"message = client.run(conversation_id, \\\"请输出中华人民共和国民法典第七编第十章原文内容\\\")\\n\",\n    \"# 打印对话结果\\n\",\n    \"print(message.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 我们可以发现Agent并没有输出民法典的第七编第十章的准确内容，此时我们就需要Appbuilder的切片管理功能，对知识库新增切片\\n\",\n    \"\\n\",\n    \"## 3. 知识库切片管理\\n\",\n    \"\\n\",\n    \"Appbuilder中支持多种知识库切片管理操作方式，包括：\\n\",\n    \"- 平台Console实现知识库切片管理\\n\",\n    \"- 使用SDK/API代码态实现知识库切片管理(优势)\\n\",\n    \"这里我们选择使用代码态SDK实现知识库切片管理的操作\\n\",\n    \"\\n\",\n    \"### 3.1KnowledgeBase 代码态切片管理功能\\n\",\n    \"\\n\",\n    \"* 创建切片\\n\",\n    \"* 修改切片信息\\n\",\n    \"* 获取切片信息\\n\",\n    \"* 获取切片列表\\n\",\n    \"* 删除切片\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"- 接下来我们使用SDK上传一个民法典第七编第十章部分的内容的切片\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 90,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"切片ID:  f1e1962f-70dd-4573-9068-37485980ac5c\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 获取知识库全部文档:get_all_documents\\n\",\n    \"doc_list = knowledge.get_all_documents(my_knowledge.knowledge_id)\\n\",\n    \"\\n\",\n    \"# 获取doc_list列表的第一个文档的document_id\\n\",\n    \"document_id = doc_list[0].id # 这里我们的知识库只有一个文档，所以获取第一个文档的document_id\\n\",\n    \"my_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\\n\",\n    \"\\n\",\n    \"# 这里我们使用来web_crawler函数来模拟爬虫功能，在生产环境中开发者可以使用自己的爬虫模块来周期性的获取最新的文档更新内容\\n\",\n    \"def web_crawler():\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    此函数模拟爬虫功能，获取最新的文档更新内容内容\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    content = \\\"\\\"\\\"\\n\",\n    \"    中华人民共和国民法典第七编第十章原文内容如下:\\n\",\n    \"    建筑物和物件损害责任\\n\",\n    \"    第一千二百五十二条　建筑物、构筑物或者其他设施倒塌、塌陷造成他人损害的，由建设单位与施工单位承担连带责任，但是建设单位与施工单位能够证明不存在质量缺陷的除外。建设单位、施工单位赔偿后，有其他责任人的，有权向其他责任人追偿。\\n\",\n    \"    因所有人、管理人、使用人或者第三人的原因，建筑物、构筑物或者其他设施倒塌、塌陷造成他人损害的，由所有人、管理人、使用人或者第三人承担侵权责任。\\n\",\n    \"    第一千二百五十三条　建筑物、构筑物或者其他设施及其搁置物、悬挂物发生脱落、坠落造成他人损害，所有人、管理人或者使用人不能证明自己没有过错的，应当承担侵权责任。所有人、管理人或者使用人赔偿后，有其他责任人的，有权向其他责任人追偿。\\n\",\n    \"    第一千二百五十四条　禁止从建筑物中抛掷物品。从建筑物中抛掷物品或者从建筑物上坠落的物品造成他人损害的，由侵权人依法承担侵权责任;经调查难以确定具体侵权人的，除能够证明自己不是侵权人的外，由可能加害的建筑物使用人给予补偿。可能加害的建筑物使用人补偿后，有权向侵权人追偿。\\n\",\n    \"    物业服务企业等建筑物管理人应当采取必要的安全保障措施防止前款规定情形的发生;未采取必要的安全保障措施的，应当依法承担未履行安全保障义务的侵权责任。\\n\",\n    \"    发生本条第一款规定的情形的，公安等机关应当依法及时调查，查清责任人。\\n\",\n    \"    第一千二百五十五条　堆放物倒塌、滚落或者滑落造成他人损害，堆放人不能证明自己没有过错的，应当承担侵权责任。\\n\",\n    \"    第一千二百五十六条　在公共道路上堆放、倾倒、遗撒妨碍通行的物品造成他人损害的，由行为人承担侵权责任。公共道路管理人不能证明已经尽到清理、防护、警示等义务的，应当承担相应的责任。\\n\",\n    \"    第一千二百五十七条　因林木折断、倾倒或者果实坠落等造成他人损害，林木的所有人或者管理人不能证明自己没有过错的，应当承担侵权责任。\\n\",\n    \"    第一千二百五十八条　在公共场所或者道路上挖掘、修缮安装地下设施等造成他人损害，施工人不能证明已经设置明显标志和采取安全措施的，应当承担侵权责任。\\n\",\n    \"    窨井等地下设施造成他人损害，管理人不能证明尽到管理职责的，应当承担侵权责任。\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    return content\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"resp = my_knowledge.create_chunk(documentId=document_id, content=web_crawler())\\n\",\n    \"print(\\\"切片ID: \\\", resp.id)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 接下来我们再次调用Agent应用，查看一下他对民法典第七编第十章的说明。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"以下是《中华人民共和国民法典》第七编第十章的全部内容：\\n\",\n      \"\\n\",\n      \"**建筑物和物件损害责任**\\n\",\n      \"\\n\",\n      \"**第一千二百五十二条**　建筑物、构筑物或者其他设施倒塌、塌陷造成他人损害的，由建设单位与施工单位承担连带责任，但是建设单位与施工单位能够证明不存在质量缺陷的除外。建设单位、施工单位赔偿后，有其他责任人的，有权向其他责任人追偿。\\n\",\n      \"\\n\",\n      \"因所有人、管理人、使用人或者第三人的原因，建筑物、构筑物或者其他设施倒塌、塌陷造成他人损害的，由所有人、管理人、使用人或者第三人承担侵权责任。\\n\",\n      \"\\n\",\n      \"**第一千二百五十三条**　建筑物、构筑物或者其他设施及其搁置物、悬挂物发生脱落、坠落造成他人损害，所有人、管理人或者使用人不能证明自己没有过错的，应当承担侵权责任。所有人、管理人或者使用人赔偿后，有其他责任人的，有权向其他责任人追偿。\\n\",\n      \"\\n\",\n      \"**第一千二百五十四条**　禁止从建筑物中抛掷物品。从建筑物中抛掷物品或者从建筑物上坠落的物品造成他人损害的，由侵权人依法承担侵权责任；经调查难以确定具体侵权人的，除能够证明自己不是侵权人的外，由可能加害的建筑物使用人给予补偿。可能加害的建筑物使用人补偿后，有权向侵权人追偿。\\n\",\n      \"\\n\",\n      \"物业服务企业等建筑物管理人应当采取必要的安全保障措施防止前款规定情形的发生；未采取必要的安全保障措施的，应当依法承担未履行安全保障义务的侵权责任。\\n\",\n      \"\\n\",\n      \"发生本条第一款规定的情形的，公安等机关应当依法及时调查，查清责任人。\\n\",\n      \"\\n\",\n      \"**第一千二百五十五条**　堆放物倒塌、滚落或者滑落造成他人损害，堆放人不能证明自己没有过错的，应当承担侵权责任。\\n\",\n      \"\\n\",\n      \"**第一千二百五十六条**　在公共道路上堆放、倾倒、遗撒妨碍通行的物品造成他人损害的，由行为人承担侵权责任。公共道路管理人不能证明已经尽到清理、防护、警示等义务的，应当承担相应的责任。\\n\",\n      \"\\n\",\n      \"**第一千二百五十七条**　因林木折断、倾倒或者果实坠落等造成他人损害，林木的所有人或者管理人不能证明自己没有过错的，应当承担侵权责任。\\n\",\n      \"\\n\",\n      \"**第一千二百五十八条**　在公共场所或者道路上挖掘、修缮安装地下设施等造成他人损害，施工人不能证明已经设置明显标志和采取安全措施的，应当承担侵权责任。\\n\",\n      \"\\n\",\n      \"窨井等地下设施造成他人损害，管理人不能证明尽到管理职责的，应当承担侵权责任。\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"client = appbuilder.AppBuilderClient(app_id)\\n\",\n    \"conversation_id = client.create_conversation()\\n\",\n    \"message = client.run(conversation_id, \\\"请输出中华人民共和国民法典第七编第十章原文内容\\\")\\n\",\n    \"# 打印对话结果\\n\",\n    \"print(message.content.answer)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"- 可以观察到此次Agent运行准确的的输出了民法典第七编第十章的内容\\n\",\n    \"\\n\",\n    \"#### 其他的知识库文档&切片管理方法\\n\",\n    \"\\n\",\n    \"###### 修改切片信息`modify_chunk`\\n\",\n    \"\\n\",\n    \"- 如果我们对之前设置的切片信息不满意，可以通过`modify_chunk`方法进行修改。\\n\",\n    \"\\n\",\n    \"###### 获取切片信息`describe_chunk`\\n\",\n    \"\\n\",\n    \"- 我需要查看我刚才创建切片信息，可以使用`describe_chunk`方法\\n\",\n    \"\\n\",\n    \"###### 删除切片信息`delete_chunk`\\n\",\n    \"\\n\",\n    \"- 切片信息创建出来后，如果不需要了，可以通过`delete_chunk`方法进行删除。\\n\",\n    \"\\n\",\n    \"##### 删除文档和知识库\\n\",\n    \"\\n\",\n    \"- 当你不再需要文档知识库时，可以删除它，SDK同样提供删除文档和知识库的方法\\n\",\n    \"  - 从知识库删除文档 `KnowledgeBase().delete_document`\\n\",\n    \"  - 删除知识库`delete_knowledge_base`\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"python-3.10.14\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.10.14\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/mcp/app_mcp_server.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"8ce67390\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 前言\\n\",\n    \"通过本文，你可以：\\n\",\n    \" * 了解AppBuilder Agent MCP Server是什么\\n\",\n    \" * 了解如何通过AppBuilder-SDK调用AppBuilder Agent MCP Server\\n\",\n    \" * 了解如何通过Cursor调用AppBuilder Agent MCP Server\\n\",\n    \"\\n\",\n    \"如果你需要了解更多关于AppBuilder结合MCP生态的功能,可跳转到下面的文档：\\n\",\n    \"- 主动调用：通过AppBuilder-Agent调用MCP Server\\n\",\n    \"  - 代码态调用：[AppBuilder结合端云组件，调用本地MCP Server](./client.ipynb) \\n\",\n    \"  - 代码态调用：[AppBuilder结合地图MCP Server，实现智能导航](./baidu_map.ipynb)\\n\",\n    \"  - 零代码态调用：[AppBuilder控制台使用MCP](https://cloud.baidu.com/doc/AppBuilder/s/Nm9vmpb3g)\\n\",\n    \"- 被动调用：AppBuilder能力，融入MCP生态，可作为MCP Server提供能力\\n\",\n    \"  - 组件能力：[AppBuilder组件转MCP Server](./server.ipynb)\\n\",\n    \"  - 智能体能力：[AppBuilder Agent MCP Server](./app_mcp_server.ipynb)\\n\",\n    \"  - AI搜索能力: [AppBuilder AI搜索MCP Server](https://github.com/baidubce/app-builder/tree/master/python/mcp_server/ai_search)\\n\",\n    \"  - RAG能力：[AppBuilder知识库MCP Server](https://github.com/baidubce/app-builder/tree/master/python/mcp_server/knowledge_base)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"## AppBuilder Agent MCP Server简介\\n\",\n    \"千帆AppBuilder提供了关于AppBuilder应用的MCP Server，用户可通过MCP协议调用在AppBuilder平台创建并发布的自定义智能体应用。\\n\",\n    \"\\n\",\n    \"当前支持获取应用列表、应用对话两大功能。本文讲述如何使用不同客户端调用此服务。\\n\",\n    \"\\n\",\n    \"对于入门用户，还提供了环境配置、千帆Agent创建等操作步骤。已熟悉用户可以直接跳过环境配置、应用创建部分。\\n\",\n    \"\\n\",\n    \"## 安装配置步骤\\n\",\n    \"\\n\",\n    \"### 配置基础环境\\n\",\n    \"\\n\",\n    \"#### 1、安装Python\\n\",\n    \"\\n\",\n    \"大部分的MCP Server，例如Unity和Blender，都是Python SDK\\n\",\n    \"安装Python最简单的方法是安装Miniconda\\n\",\n    \"**注意：请确保安装的python>=3.12**\\n\",\n    \"\\n\",\n    \"[Miniconda官网](https://www.anaconda.com/docs/getting-started/miniconda/install)\\n\",\n    \"\\n\",\n    \"#### 2、下载Appbuilder-SDK\\n\",\n    \"\\n\",\n    \"为了实现Appbuilder-SDK对AppBuilder Agent MCP Server的代码态调用，需要在conda环境下载appbuilder-sdk包\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"96a39a88\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install httpx appbuilder-sdk mcp\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"6e7d417d\",\n   \"metadata\": {},\n   \"source\": [\n    \"\\n\",\n    \"## 创建百度智能云千帆AppBuilder智能体\\n\",\n    \"\\n\",\n    \"首先创建一个千帆AppBuilder智能体。\\n\",\n    \"\\n\",\n    \"### 1、进入百度智能云千帆AppBuilder主页\\n\",\n    \"\\n\",\n    \"进入百度智能云千帆AppBuilder主页，免费试用\\n\",\n    \"\\n\",\n    \"- [百度智能云千帆AppBuilder主页](https://qianfan.cloud.baidu.com/appbuilder)\\n\",\n    \"\\n\",\n    \"### 2、创建【自主规划Agent】\\n\",\n    \"\\n\",\n    \"- [Appbuilder 自主规划Agent概述](https://cloud.baidu.com/doc/AppBuilder/s/km4i50me8)\\n\",\n    \"\\n\",\n    \"- [快速创建应用](https://cloud.baidu.com/doc/AppBuilder/s/Om0ks82ow)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BA%E8%87%AA%E4%B8%BB%E8%A7%84%E5%88%92Agent.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T15%3A00%3A03Z%2F-1%2Fhost%2F31df73d263dbc1dc7e28a6bc077b37c70ce27af91ac7888ff9151c7ef1d58b04)\\n\",\n    \"\\n\",\n    \"### 3、输入一句简单的提示词，让AI自动扩写\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BA%E8%87%AA%E4%B8%BB%E8%A7%84%E5%88%92agent.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T03%3A23%3A29Z%2F-1%2Fhost%2F67b7a5d0c38c12f79bc925e995c8f09775eb37bfe9025f61a593080c3c05c82c)\\n\",\n    \"\\n\",\n    \"### 4、删除自动配置的组件\\n\",\n    \"\\n\",\n    \"因为我们调用MCP工具，所以不需要使用AppBuilder自带组件\\n\",\n    \"\\n\",\n    \"### 5、配置模型\\n\",\n    \"\\n\",\n    \"将规划模型和问答模型的思考轮数拉满\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E9%85%8D%E7%BD%AE%E6%A8%A1%E5%9E%8B.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T03%3A27%3A44Z%2F-1%2Fhost%2Ffd031f86bf71a0ca7e32db70533a76db9c39757a139f94b34f487eae9f860534)\\n\",\n    \"\\n\",\n    \"### 6、发布应用\\n\",\n    \"\\n\",\n    \"发布应用，在【个人空间】中，查看应用ID，记下来\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%8F%91%E5%B8%83Agent%E5%BA%94%E7%94%A8.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T03%3A30%3A26Z%2F-1%2Fhost%2Ff66b1bef4bb432ddd59ca07189ed210fb475c6363559dfd0c7ab53ef47a6240f)\\n\",\n    \"\\n\",\n    \"### 7、创建Appbuilder API key\\n\",\n    \"\\n\",\n    \"- [Appbuilder API key授权](https://cloud.baidu.com/doc/AppBuilder/s/lm68r8e6i)\\n\",\n    \"\\n\",\n    \"- [Appbuilder API 控制台管理中心](https://console.bce.baidu.com/iam/#/iam/apikey/list)\\n\",\n    \"\\n\",\n    \"在【API Key】界面中，创建一个新的Key，并添加刚刚创建的应用，记下来。\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BAAPPBUILDER-TOKEN.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T14%3A49%3A27Z%2F-1%2Fhost%2F9266ac8c93a262d2905811877d680f53af26668a0ee09e1b3a61c0b721de253c)\\n\",\n    \"\\n\",\n    \"同时配置API key权限，将上文创建的应用添加到API key权限中。\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E6%B7%BB%E5%8A%A0Agent%E6%9D%83%E9%99%90.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T03%3A33%3A59Z%2F-1%2Fhost%2Feda8af9c241207cf07ff2edb85b2271ce48aade84775ca2273580ad13f03a5dc)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"3aa3c0a2\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 使用AppBuilder SDK调用\\n\",\n    \"\\n\",\n    \"### 1. 获取应用列表\\n\",\n    \"查询用户的应用列表。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"3e7b9a90\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import asyncio\\n\",\n    \"import os\\n\",\n    \"import json\\n\",\n    \"from appbuilder.mcp_server.client import MCPClient\\n\",\n    \"\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"YOUR_APPBUILDER_TOKEN\\\"\\n\",\n    \"\\n\",\n    \"async def main():\\n\",\n    \"    client = MCPClient()\\n\",\n    \"    await client.connect_to_server(service_url=service_url)\\n\",\n    \"    result = await client.call_tool(\\\"get_all_apps\\\", {})\\n\",\n    \"    for app_info in result.content:\\n\",\n    \"        app_info = json.loads(app_info.text)\\n\",\n    \"        print(app_info[\\\"id\\\"] + \\\"\\\\t\\\" + app_info[\\\"name\\\"])\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    service_url = \\\"http://appbuilder.baidu.com/v2/app/mcp/sse?api_key=\\\" + os.environ.get(\\\"APPBUILDER_TOKEN\\\")\\n\",\n    \"\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(main())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"60df365f\",\n   \"metadata\": {},\n   \"source\": [\n    \"控制台会打印你的应用ID、应用名，参考如下：\\n\",\n    \"\\n\",\n    \"```bash\\n\",\n    \"909*****-***a-****-****-*********2c93    我的Agent应用\\n\",\n    \"697*****-***9-****-****-*********360b    我的Agent应用\\n\",\n    \"963*****-***2-****-****-*********21d1    我的Agent应用\\n\",\n    \"34f*****-***b-****-****-*********3df2    我的Agent应用\\n\",\n    \"773*****-***8-****-****-*********62df    图像识别示例\\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"### 2. 进行Agent对话\\n\",\n    \"使用MCP协议跟Agent进行对话。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"50c87488\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import asyncio\\n\",\n    \"import json\\n\",\n    \"import os\\n\",\n    \"from appbuilder.mcp_server.client import MCPClient\\n\",\n    \"\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"YOUR_APPBUILDER_TOKEN\\\"\\n\",\n    \"os.environ[\\\"APP_ID\\\"] = \\\"YOUR_APP_ID\\\"\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"async def main():\\n\",\n    \"    client = MCPClient()\\n\",\n    \"    await client.connect_to_server(service_url=service_url)\\n\",\n    \"    app_id = os.environ.get(\\\"APP_ID\\\")\\n\",\n    \"    result = await client.call_tool(\\\"create_conversation\\\", {\\\"app_id\\\": app_id})\\n\",\n    \"    conversation_id = result.content[0].text\\n\",\n    \"    query = \\\"你能做什么？\\\"\\n\",\n    \"    result = await client.call_tool(\\n\",\n    \"        \\\"run\\\",\\n\",\n    \"        {\\n\",\n    \"            \\\"app_id\\\": app_id,\\n\",\n    \"            \\\"conversation_id\\\": conversation_id,\\n\",\n    \"            \\\"query\\\": query,\\n\",\n    \"        },\\n\",\n    \"    )\\n\",\n    \"    print(result.content[0].text)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    service_url = (\\n\",\n    \"        \\\"http://appbuilder.baidu.com/v2/app/mcp/sse?api_key=\\\"\\n\",\n    \"        + os.environ.get(\\\"APPBUILDER_TOKEN\\\")\\n\",\n    \"    )\\n\",\n    \"\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(main())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"df473bce\",\n   \"metadata\": {},\n   \"source\": [\n    \"控制台会打印对话的返回。参考如下：\\n\",\n    \"```bash\\n\",\n    \"作为植物识别专家，我专门负责识别和鉴定各种植物种类。我可以通过使用植物识别组件来分析植物的特征，如叶子形状、花朵颜色、果实形态等，从而准确确定植物的种类。无论你是对路边的野花好奇，还是对家中盆栽的种类有疑问，我都可以帮助你进行识别和解答。\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"6b68c4d6\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 使用Cursor调用\\n\",\n    \"### Cursor配置\\n\",\n    \"api_key=上面步骤获取到的api key，格式为\\\"bce-v3/ALTAK...\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"8b292ee1\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"json\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"{\\n\",\n    \"    \\\"mcpServers\\\": {\\n\",\n    \"        \\\"appbuilder-app\\\": {\\n\",\n    \"            \\\"url\\\": \\\"http://appbuilder.baidu.com/v2/app/mcp/sse?api_key=bce-v3/ALTAK...\\\"\\n\",\n    \"        }\\n\",\n    \"    }\\n\",\n    \"}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"804d655d\",\n   \"metadata\": {},\n   \"source\": [\n    \"配置后，在Cursor设置页面可看到`get_all_apps`、`create_converstation`、`run`三个Tool。\\n\",\n    \"![cursor config](./image/cursor_agent_mcp_config.png)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"338eb0cb\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 获取应用列表\\n\",\n    \"![get_app_apps](./image/cursor_agent_get_all_apps.png)\\n\",\n    \"\\n\",\n    \"### 应用对话\\n\",\n    \"![cursor agent chat](./image/cursor_agent_run.png)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.12.10\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/mcp/baidu_map.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"8ce67390\",\n   \"metadata\": {},\n   \"source\": [\n    \"# MCP协议加持，千帆AppBuilder让语音导航更智能，开发更轻松\\n\",\n    \"\\n\",\n    \"MCP最近热度很高，作为国内首家支持MCP协议的大模型应用开发平台，千帆AppBuilder完成兼容后，用户可通过千帆AppBuilder轻松调用MCP Server生态中的海量工具，快速扩展端和云端的工具数量。我们的用户，也在利用这个强大的功能，打破不同工具间壁垒，实现更多想法。\\n\",\n    \"\\n\",\n    \"比如，爷爷奶奶都会用的百度地图，可以在千帆AppBuilder的连接下，成为你的开发利器：\\n\",\n    \"\\n\",\n    \"百度地图核心API已全面兼容MCP协议——你在千帆AppBuilder开发的应用，可以轻松调用百度地图的各项功能。对着手机说出“人话需求”，AI自动规划路线、检索地点、查天气、查路况。\\n\",\n    \"\\n\",\n    \"具体如何实现？本文将带你一步步了解如何通过千帆AppBuilder、百度地图和MCP协议的结合，通过SDK的方式进行开发，打造出更智能的应用。我们还会提供详细的安装和配置步骤，帮助你快速上手，轻松实现功能扩展。\\n\",\n    \"\\n\",\n    \"## 官方代码及文档\\n\",\n    \"\\n\",\n    \"- [百度地图 MCP Server](https://github.com/baidu-maps/mcp)\\n\",\n    \"- [Appbuilder 调用MCP组件服务](https://cloud.baidu.com/doc/AppBuilder/s/Um88v68dn)\\n\",\n    \"\\n\",\n    \"## 安装配置步骤\\n\",\n    \"\\n\",\n    \"### 配置基础环境\\n\",\n    \"\\n\",\n    \"#### 1、安装Python\\n\",\n    \"\\n\",\n    \"大部分的MCP Server，例如Unity和Blender，都是Python SDK\\n\",\n    \"安装Python最简单的方法是安装Miniconda\\n\",\n    \"**注意：请确保安装的python>=3.12**\\n\",\n    \"\\n\",\n    \"[Miniconda官网](https://www.anaconda.com/docs/getting-started/miniconda/install)\\n\",\n    \"\\n\",\n    \"#### 2、安装包管理器uv\\n\",\n    \"\\n\",\n    \"uv是pip的替代，能够快速启动和管理项目，后续每个MCP服务都需要用uvx命令启动\\n\",\n    \"\\n\",\n    \"[包管理器uv安装教程](https://docs.astral.sh/uv/getting-started/installation)\\n\",\n    \"\\n\",\n    \"#### 3、安装Node.js\\n\",\n    \"\\n\",\n    \"[Node.js安装教程](https://nodejs.org/en/download)\\n\",\n    \"\\n\",\n    \"#### 4、下载Appbuilder-SDK\\n\",\n    \"\\n\",\n    \"为了实现Appbuilder-SDK对百度地图 MCP Server的代码态调用，需要在conda环境下载appbuilder-sdk包\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"96a39a88\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install httpx appbuilder-sdk mcp\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"6e7d417d\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### 获取百度地图API Key\\n\",\n    \"\\n\",\n    \"在百度地图开放平台申请一个API Key，记下来\\n\",\n    \"[百度地图开放平台](https://lbsyun.baidu.com/apiconsole/key)\\n\",\n    \"\\n\",\n    \"## 百度智能云千帆AppBuilder代码态调用\\n\",\n    \"\\n\",\n    \"如何通过代码来调用百度地图的MCP服务，接入到我自己的应用中呢？\\n\",\n    \"\\n\",\n    \"可以用百度智能云企业级大模型应用开发平台-千帆AppBuidler的代码态，手搓一个MCP的客户端。\\n\",\n    \"\\n\",\n    \"### 1、进入百度智能云千帆AppBuilder主页\\n\",\n    \"\\n\",\n    \"进入百度智能云千帆AppBuilder主页，免费试用\\n\",\n    \"\\n\",\n    \"- [百度智能云千帆AppBuilder主页](https://qianfan.cloud.baidu.com/appbuilder)\\n\",\n    \"\\n\",\n    \"### 2、创建【自主规划Agent】\\n\",\n    \"\\n\",\n    \"- [Appbuilder 自主规划Agent概述](https://cloud.baidu.com/doc/AppBuilder/s/km4i50me8)\\n\",\n    \"\\n\",\n    \"- [快速创建应用](https://cloud.baidu.com/doc/AppBuilder/s/Om0ks82ow)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BA%E8%87%AA%E4%B8%BB%E8%A7%84%E5%88%92Agent.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T15%3A00%3A03Z%2F-1%2Fhost%2F31df73d263dbc1dc7e28a6bc077b37c70ce27af91ac7888ff9151c7ef1d58b04)\\n\",\n    \"\\n\",\n    \"### 3、输入一句简单的提示词，让AI自动扩写\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BA%E8%87%AA%E4%B8%BB%E8%A7%84%E5%88%92agent.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T03%3A23%3A29Z%2F-1%2Fhost%2F67b7a5d0c38c12f79bc925e995c8f09775eb37bfe9025f61a593080c3c05c82c)\\n\",\n    \"\\n\",\n    \"### 4、删除自动配置的组件\\n\",\n    \"\\n\",\n    \"因为我们调用MCP工具，所以不需要使用AppBuilder自带组件\\n\",\n    \"\\n\",\n    \"### 5、配置模型\\n\",\n    \"\\n\",\n    \"将规划模型和问答模型的思考轮数拉满\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E9%85%8D%E7%BD%AE%E6%A8%A1%E5%9E%8B.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T03%3A27%3A44Z%2F-1%2Fhost%2Ffd031f86bf71a0ca7e32db70533a76db9c39757a139f94b34f487eae9f860534)\\n\",\n    \"\\n\",\n    \"### 6、发布应用\\n\",\n    \"\\n\",\n    \"发布应用，在【个人空间】中，查看应用ID，记下来\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%8F%91%E5%B8%83Agent%E5%BA%94%E7%94%A8.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T03%3A30%3A26Z%2F-1%2Fhost%2Ff66b1bef4bb432ddd59ca07189ed210fb475c6363559dfd0c7ab53ef47a6240f)\\n\",\n    \"\\n\",\n    \"### 7、创建Appbuilder API key\\n\",\n    \"\\n\",\n    \"- [Appbuilder API key授权](https://cloud.baidu.com/doc/AppBuilder/s/lm68r8e6i)\\n\",\n    \"\\n\",\n    \"- [Appbuilder API 控制台管理中心](https://console.bce.baidu.com/iam/#/iam/apikey/list)\\n\",\n    \"\\n\",\n    \"在【API Key】界面中，创建一个新的Key，并添加刚刚创建的应用，记下来。\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BAAPPBUILDER-TOKEN.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T14%3A49%3A27Z%2F-1%2Fhost%2F9266ac8c93a262d2905811877d680f53af26668a0ee09e1b3a61c0b721de253c)\\n\",\n    \"\\n\",\n    \"同时配置API key权限，将上文创建的应用添加到API key权限中。\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E6%B7%BB%E5%8A%A0Agent%E6%9D%83%E9%99%90.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T03%3A33%3A59Z%2F-1%2Fhost%2Feda8af9c241207cf07ff2edb85b2271ce48aade84775ca2273580ad13f03a5dc)\\n\",\n    \"\\n\",\n    \"### 8、配置代码\\n\",\n    \"\\n\",\n    \"将下述链接复制到浏览器，可下载代码。解压缩文件，并更新代码内容。\\n\",\n    \"\\n\",\n    \"https://qianfandeveloper.bj.bcebos.com/baidumap_mcp.zip\\n\",\n    \"\\n\",\n    \"* 在map.py中，将`BAIDU_MAPS_API_KEY`换成你的自己的百度地图API密钥。\\n\",\n    \"* 在test.py文件中，将`APPBUILDER_TOKEN`更换成自己的Apppbuilder API Key，并将`app_id`更换成自己的应用ID。\\n\",\n    \"\\n\",\n    \"接下来将提供一个完整的示例，演示如何使用百度智能云千帆AppBuilder的Agent调用百度地图MCP服务。\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"e05e6628\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### （1）创建MCP服务器实例\\n\",\n    \"\\n\",\n    \"* 将下述代码添加到本地`map.py`文件中，**注意，这里需要替换`BAIDU_MAPS_API_KEY`为你自己的百度地图API Key**\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"c32b3a7a\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# map.py\\n\",\n    \"import os\\n\",\n    \"import copy\\n\",\n    \"import httpx\\n\",\n    \"from asyncio import sleep\\n\",\n    \"\\n\",\n    \"from mcp.server.fastmcp import FastMCP, Context\\n\",\n    \"\\n\",\n    \"# 创建MCP服务器实例\\n\",\n    \"mcp = FastMCP(\\\"mcp-server-baidu-maps\\\")\\n\",\n    \"# 设置API密钥，用于调用百度地图API，获取方式请参考：https://lbsyun.baidu.com/apiconsole/key\\n\",\n    \"os.environ[\\\"BAIDU_MAPS_API_KEY\\\"] = \\\"6IlHFTRGzNjPxxxxxxxxxxxxxxxxxx\\\"\\n\",\n    \"api_key = os.getenv(\\\"BAIDU_MAPS_API_KEY\\\")\\n\",\n    \"api_url = \\\"https://api.map.baidu.com\\\"\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def filter_result(data) -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    过滤路径规划结果，用于剔除冗余字段信息，保证输出给模型的数据更简洁，\\n\",\n    \"    避免长距离路径规划场景下chat中断\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    # 创建输入数据的深拷贝以避免修改原始数据\\n\",\n    \"    processed_data = copy.deepcopy(data)\\n\",\n    \"\\n\",\n    \"    # 检查是否存在'result'键\\n\",\n    \"    if \\\"result\\\" in processed_data:\\n\",\n    \"        result = processed_data[\\\"result\\\"]\\n\",\n    \"\\n\",\n    \"        # 检查'result'中是否存在'routes'键\\n\",\n    \"        if \\\"routes\\\" in result:\\n\",\n    \"            for route in result[\\\"routes\\\"]:\\n\",\n    \"                # 检查每个'route'中是否存在'steps'键\\n\",\n    \"                if \\\"steps\\\" in route:\\n\",\n    \"                    new_steps = []\\n\",\n    \"                    for step in route[\\\"steps\\\"]:\\n\",\n    \"                        # 提取'instruction'字段，若不存在则设为空字符串\\n\",\n    \"                        new_step = {\\n\",\n    \"                            \\\"distance\\\": step.get(\\\"distance\\\", \\\"\\\"),\\n\",\n    \"                            \\\"duration\\\": step.get(\\\"duration\\\", \\\"\\\"),\\n\",\n    \"                            \\\"instruction\\\": step.get(\\\"instruction\\\", \\\"\\\"),\\n\",\n    \"                        }\\n\",\n    \"                        new_steps.append(new_step)\\n\",\n    \"                    # 替换原steps为仅含instruction的新列表\\n\",\n    \"                    route[\\\"steps\\\"] = new_steps\\n\",\n    \"\\n\",\n    \"    return processed_data\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_geocode(address: str, ctx: Context) -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        地理编码服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        将地址解析为对应的位置坐标。地址结构越完整，地址内容越准确，解析的坐标精度越高。\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        address: 待解析的地址。最多支持84个字节。可以输入两种样式的值，分别是：\\n\",\n    \"        1、标准的结构化地址信息，如北京市海淀区上地十街十号【推荐，地址结构越完整，解析精度越高】\\n\",\n    \"        2、支持\\\"*路与*路交叉口\\\"描述方式，如北一环路和阜阳路的交叉路口\\n\",\n    \"        第二种方式并不总是有返回结果，只有当地址库中存在该地址描述时才有返回。\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/geocoding/v3/\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbsyun.baidu.com/faq/api?title=webapi/guide/webservice-geocoding\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"output\\\": \\\"json\\\",\\n\",\n    \"            \\\"address\\\": f\\\"{address}\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        return result\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_reverse_geocode(\\n\",\n    \"    latitude: float, longitude: float, ctx: Context\\n\",\n    \") -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        逆地理编码服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        根据经纬度坐标点获取对应位置的行政区划与POI信息\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        latitude: 纬度 (gcj02ll)\\n\",\n    \"        longitude: 经度 (gcj02ll)\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"There\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/reverse_geocoding/v3/\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbsyun.baidu.com/faq/api?title=webapi/guide/webservice-geocoding-abroad\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"output\\\": \\\"json\\\",\\n\",\n    \"            \\\"coordtype\\\": \\\"gcj02ll\\\",\\n\",\n    \"            \\\"location\\\": f\\\"{latitude},{longitude}\\\",\\n\",\n    \"            \\\"extensions_poi\\\": \\\"1\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        return result\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_search_places(\\n\",\n    \"    query: str, region: str, location: str, radius: int, ctx: Context\\n\",\n    \") -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        地点检索服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        城市内检索: 检索某一城市内（目前最细到城市级别）的地点信息。\\n\",\n    \"        周边检索: 设置圆心和半径，检索圆形区域内的地点信息（常用于周边检索场景）。\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        query: 检索关键字\\n\",\n    \"        region: 检索的行政区划\\n\",\n    \"        location: 圆形区域检索中心点\\n\",\n    \"        radius: 圆形区域检索半径，单位：米\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/place/v2/search\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbsyun.baidu.com/faq/api?title=webapi/guide/webservice-placeapi\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"output\\\": \\\"json\\\",\\n\",\n    \"            \\\"query\\\": f\\\"{query}\\\",\\n\",\n    \"            \\\"region\\\": f\\\"{region}\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"        if location:\\n\",\n    \"            params[\\\"location\\\"] = f\\\"{location}\\\"\\n\",\n    \"            params[\\\"radius\\\"] = f\\\"{radius}\\\"\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        return result\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_place_details(uid: str, ctx: Context) -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        地点详情检索服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        地点详情检索: 地点详情检索针对指定POI，检索其相关的详情信息。\\n\",\n    \"        开发者可以通地点检索服务获取POI uid。使用\\\"地点详情检索\\\"功能，传入uid，\\n\",\n    \"        即可检索POI详情信息，如评分、营业时间等（不同类型POI对应不同类别详情数据）。\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        uid: poi的唯一标识\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/place/v2/detail\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbsyun.baidu.com/faq/api?title=webapi/guide/webservice-placeapi/detail\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"output\\\": \\\"json\\\",\\n\",\n    \"            \\\"uid\\\": f\\\"{uid}\\\",\\n\",\n    \"            # Agent入参不可控，这里给定scope为2\\n\",\n    \"            \\\"scope\\\": 2,\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        return result\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_distance_matrix(\\n\",\n    \"    origins: str, destinations: str, mode: str, ctx: Context\\n\",\n    \") -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        批量算路服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        根据起点和终点坐标计算路线规划距离和行驶时间\\n\",\n    \"        批量算路目前支持驾车、骑行、步行\\n\",\n    \"        步行时任意起终点之间的距离不得超过200KM，超过此限制会返回参数错误\\n\",\n    \"        驾车批量算路一次最多计算100条路线，起终点个数之积不能超过100\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        origins: 多个起点坐标纬度,经度，按|分隔。示例：40.056878,116.30815|40.063597,116.364973【骑行】【步行】支持传入起点uid提升绑路准确性，格式为：纬度,经度;POI的uid|纬度,经度;POI的uid。示例：40.056878,116.30815;xxxxx|40.063597,116.364973;xxxxx\\n\",\n    \"        destinations: 多个终点坐标纬度,经度，按|分隔。示例：40.056878,116.30815|40.063597,116.364973【【骑行】【步行】支持传入终点uid提升绑路准确性，格式为：纬度,经度;POI的uid|纬度,经度;POI的uid。示例：40.056878,116.30815;xxxxx|40.063597,116.364973;xxxxx\\n\",\n    \"        mode: 批量算路类型(driving, riding, walking)\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/routematrix/v2/{mode}\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbsyun.baidu.com/faq/api?title=webapi/routchtout\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"output\\\": \\\"json\\\",\\n\",\n    \"            \\\"origins\\\": f\\\"{origins}\\\",\\n\",\n    \"            \\\"destinations\\\": f\\\"{destinations}\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        return result\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_directions(\\n\",\n    \"    model: str, origin: str, destination: str, ctx: Context\\n\",\n    \") -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        路线规划服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        驾车路线规划: 根据起终点坐标规划驾车出行路线\\n\",\n    \"        骑行路线规划: 根据起终点坐标规划骑行出行路线\\n\",\n    \"        步行路线规划: 根据起终点坐标规划步行出行路线\\n\",\n    \"        公交路线规划: 根据起终点坐标规划公共交通出行路线\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        model: 路线规划类型(driving, riding, walking, transit)\\n\",\n    \"        origin: 起点坐标，当用户只有起点名称时，需要先通过地理编码服务或地点地点检索服务确定起点的坐标\\n\",\n    \"        destination: 终点坐标，当用户只有起点名称时，需要先通过地理编码服务或地点检索服务确定起点的坐标\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/directionlite/v1/{model}\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbs.baidu.com/faq/api?title=webapi/direction-api-v2\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"output\\\": \\\"json\\\",\\n\",\n    \"            \\\"origin\\\": f\\\"{origin}\\\",\\n\",\n    \"            \\\"destination\\\": f\\\"{destination}\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        \\\"\\\"\\\"\\n\",\n    \"        过滤非公交的导航结果，防止返回的结果中包含大量冗余坐标信息，\\n\",\n    \"        影响大模型的响应速度，或是导致chat崩溃。\\n\",\n    \"        当前只保留导航结果每一步的距离、耗时和语义化信息。\\n\",\n    \"        公交路线规划情况比较多，尽量全部保留。\\n\",\n    \"        \\\"\\\"\\\"\\n\",\n    \"        if model == \\\"transit\\\":\\n\",\n    \"            return result\\n\",\n    \"        else:\\n\",\n    \"            return filter_result(result)\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_weather(location: str, district_id: int, ctx: Context) -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        天气查询服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        用户可通过行政区划或是经纬度坐标查询实时天气信息及未来5天天气预报\\n\",\n    \"        (注意: 使用经纬度坐标需要高级权限)。\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        location: 经纬度，经度在前纬度在后，逗号分隔 (需要高级权限, 例如: 116.30815,40.056878)\\n\",\n    \"        district_id: 行政区划 (例如: 1101010)\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/weather/v1/?\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbs.baidu.com/faq/api?title=webapi/weather\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"data_type\\\": \\\"all\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        # 核心入参，二选一\\n\",\n    \"        if not location:\\n\",\n    \"            params[\\\"district_id\\\"] = f\\\"{district_id}\\\"\\n\",\n    \"        else:\\n\",\n    \"            params[\\\"location\\\"] = f\\\"{location}\\\"\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        return result\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_ip_location(\\n\",\n    \"    # ip: str,\\n\",\n    \"    ctx: Context,\\n\",\n    \") -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        IP定位服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        根据用户请求的IP获取当前的位置，当需要知道用户当前位置、所在城市时可以调用该工具获取\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/location/ip\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbs.baidu.com/faq/api?title=webapi/ip-api\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        return result\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_road_traffic(\\n\",\n    \"    model: str,\\n\",\n    \"    road_name: str,\\n\",\n    \"    city: str,\\n\",\n    \"    bounds: str,\\n\",\n    \"    vertexes: str,\\n\",\n    \"    center: str,\\n\",\n    \"    radius: int,\\n\",\n    \"    ctx: Context,\\n\",\n    \") -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        实时路况查询服务\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        查询实时交通拥堵情况, 可通过指定道路名和区域形状(矩形, 多边形, 圆形)进行实时路况查询。\\n\",\n    \"\\n\",\n    \"        道路实时路况查询: 查询具体道路的实时拥堵评价和拥堵路段、拥堵距离、拥堵趋势等信息\\n\",\n    \"        矩形区域实时路况查询: 查询指定矩形地理范围的实时拥堵情况和各拥堵路段信息\\n\",\n    \"        多边形区域实时路况查询: 查询指定多边形地理范围的实时拥堵情况和各拥堵路段信息\\n\",\n    \"        圆形区域(周边)实时路况查询: 查询某中心点周边半径范围内的实时拥堵情况和各拥堵路段信息\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        model:      路况查询类型(road, bound, polygon, around)\\n\",\n    \"        road_name:  道路名称和道路方向, model=road时必传 (如:朝阳路南向北)\\n\",\n    \"        city:       城市名称或城市adcode, model=road时必传 (如:北京市)\\n\",\n    \"        bounds:     区域左下角和右上角的经纬度坐标, model=bound时必传 (如:39.912078,116.464303;39.918276,116.475442)\\n\",\n    \"        vertexes:   多边形区域的顶点经纬度, model=polygon时必传 (如:39.910528,116.472926;39.918276,116.475442;39.916671,116.459056;39.912078,116.464303)\\n\",\n    \"        center:     圆形区域的中心点经纬度坐标, model=around时必传 (如:39.912078,116.464303)\\n\",\n    \"        radius:     圆形区域的半径(米), 取值[1,1000], model=around时必传 (如:200)\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用百度API\\n\",\n    \"        url = f\\\"{api_url}/traffic/v1/{model}?\\\"\\n\",\n    \"\\n\",\n    \"        # 设置请求参数\\n\",\n    \"        # 更多参数信息请参考:https://lbs.baidu.com/faq/api?title=webapi/traffic\\n\",\n    \"        params = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"output\\\": \\\"json\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        # 核心入参，根据model选择\\n\",\n    \"        match model:\\n\",\n    \"            case \\\"bound\\\":\\n\",\n    \"                params[\\\"bounds\\\"] = f\\\"{bounds}\\\"\\n\",\n    \"            case \\\"polygon\\\":\\n\",\n    \"                params[\\\"vertexes\\\"] = f\\\"{vertexes}\\\"\\n\",\n    \"            case \\\"around\\\":\\n\",\n    \"                params[\\\"center\\\"] = f\\\"{center}\\\"\\n\",\n    \"                params[\\\"radius\\\"] = f\\\"{radius}\\\"\\n\",\n    \"            case \\\"road\\\":\\n\",\n    \"                params[\\\"road_name\\\"] = f\\\"{road_name}\\\"\\n\",\n    \"                params[\\\"city\\\"] = f\\\"{city}\\\"\\n\",\n    \"            case _:\\n\",\n    \"                pass\\n\",\n    \"\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            response = await client.get(url, params=params)\\n\",\n    \"            response.raise_for_status()\\n\",\n    \"            result = response.json()\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"        return result\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"@mcp.tool()\\n\",\n    \"async def map_poi_extract(text_content: str, ctx: Context) -> dict:\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    Name:\\n\",\n    \"        POI智能提取\\n\",\n    \"\\n\",\n    \"    Description:\\n\",\n    \"        根据用户提供的文本描述信息, 智能提取出文本中所提及的POI相关信息.\\n\",\n    \"        (注意: 使用该服务, api_key需要拥有对应的高级权限, 否则会报错)\\n\",\n    \"\\n\",\n    \"    Args:\\n\",\n    \"        text_content: 用于提取POI的文本描述信息 (完整的旅游路线，行程规划，景点推荐描述等文本内容,\\n\",\n    \"                     例如: 新疆独库公路和塔里木湖太美了, 从独山子大峡谷到天山神秘大峡谷也是很不错的体验)\\n\",\n    \"    \\\"\\\"\\\"\\n\",\n    \"    # 关于高级权限使用的相关问题，请联系我们: https://lbsyun.baidu.com/apiconsole/fankui?typeOne=%E4%BA%A7%E5%93%81%E9%9C%80%E6%B1%82&typeTwo=%E9%AB%98%E7%BA%A7%E6%9C%8D%E5%8A%A1\\n\",\n    \"    try:\\n\",\n    \"        # 获取API密钥\\n\",\n    \"        if not api_key:\\n\",\n    \"            raise Exception(\\\"Can not found API key.\\\")\\n\",\n    \"\\n\",\n    \"        # 调用POI智能提取的提交接口\\n\",\n    \"        headers = {\\\"Content-Type\\\": \\\"application/x-www-form-urlencoded\\\"}\\n\",\n    \"        submit_url = f\\\"{api_url}/api_mark/v1/submit\\\"\\n\",\n    \"        result_url = f\\\"{api_url}/api_mark/v1/result\\\"\\n\",\n    \"\\n\",\n    \"        # 设置上传用户描述的请求体\\n\",\n    \"        submit_body = {\\n\",\n    \"            \\\"ak\\\": f\\\"{api_key}\\\",\\n\",\n    \"            \\\"id\\\": 0,\\n\",\n    \"            \\\"msg_type\\\": \\\"text\\\",\\n\",\n    \"            \\\"text_content\\\": f\\\"{text_content}\\\",\\n\",\n    \"            \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"        }\\n\",\n    \"\\n\",\n    \"        # 异步请求\\n\",\n    \"        async with httpx.AsyncClient() as client:\\n\",\n    \"            # 提交任务\\n\",\n    \"            submit_resp = await client.post(\\n\",\n    \"                submit_url, data=submit_body, headers=headers, timeout=10.0\\n\",\n    \"            )\\n\",\n    \"            submit_resp.raise_for_status()\\n\",\n    \"            submit_result = submit_resp.json()\\n\",\n    \"\\n\",\n    \"            if submit_result.get(\\\"status\\\") != 0:\\n\",\n    \"                error_msg = submit_result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"                raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"            map_id = submit_result.get(\\\"result\\\", {}).get(\\\"map_id\\\")\\n\",\n    \"            if not map_id:\\n\",\n    \"                raise Exception(\\\"Can not found map_id\\\")\\n\",\n    \"\\n\",\n    \"            # 轮询获取结果（最多5次，间隔2秒）\\n\",\n    \"            result_body = {\\n\",\n    \"                \\\"ak\\\": api_key,\\n\",\n    \"                \\\"id\\\": 0,\\n\",\n    \"                \\\"map_id\\\": map_id,\\n\",\n    \"                \\\"from\\\": \\\"py_mcp\\\",\\n\",\n    \"            }\\n\",\n    \"            max_retries = 5\\n\",\n    \"            for attempt in range(max_retries):\\n\",\n    \"                result_resp = await client.post(\\n\",\n    \"                    result_url, data=result_body, headers=headers, timeout=10.0\\n\",\n    \"                )\\n\",\n    \"                result_resp.raise_for_status()\\n\",\n    \"                result = result_resp.json()\\n\",\n    \"\\n\",\n    \"                if result.get(\\\"status\\\") == 0 and result.get(\\\"result\\\"):\\n\",\n    \"                    return result\\n\",\n    \"                elif attempt < max_retries - 1:\\n\",\n    \"                    await sleep(2)\\n\",\n    \"\\n\",\n    \"            else:\\n\",\n    \"                raise Exception(\\\"Timeout to get the result\\\")\\n\",\n    \"\\n\",\n    \"        if result.get(\\\"status\\\") != 0:\\n\",\n    \"            error_msg = result.get(\\\"message\\\", \\\"unkown error\\\")\\n\",\n    \"            raise Exception(f\\\"API response error: {error_msg}\\\")\\n\",\n    \"\\n\",\n    \"    except httpx.HTTPError as e:\\n\",\n    \"        raise Exception(f\\\"HTTP request failed: {str(e)}\\\") from e\\n\",\n    \"    except KeyError as e:\\n\",\n    \"        raise Exception(f\\\"Failed to parse reponse: {str(e)}\\\") from e\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    mcp.run()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"65f88222\",\n   \"metadata\": {},\n   \"source\": [\n    \"#### (2)配置Appbuilder自主规划Agent文件\\n\",\n    \"\\n\",\n    \"- 将下述代码添加到本地`test.py`文件中，**注意替换其中的`APPBUILDER_TOKEN`和`app_id`为你自己的AppBuilder的API key和应用ID**\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"52ec5f33\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import asyncio\\n\",\n    \"import appbuilder\\n\",\n    \"from appbuilder.core.console.appbuilder_client.async_event_handler import (\\n\",\n    \"    AsyncToolCallEventHandler,\\n\",\n    \")\\n\",\n    \"from appbuilder.mcp_server.client import MCPClient\\n\",\n    \"\\n\",\n    \"# 用户Token\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"bce-v3/ALTAK-mTvDIz1UXh1hXOXlPGhgZ/c248xxxxxxxxxxxxxxxxxxxxxxxx\\\"  # 将APPBUILDER_TOKEN更换成自己AppBuilder API key\\n\",\n    \"os.environ[\\\"APP_ID\\\"] = \\\"f1cd13f4-fec7xxxxxxxxxxxxxxxxxxxxxxxx\\\"  # 将app_id更换成自己的应用ID\\n\",\n    \"\\n\",\n    \"async def main():\\n\",\n    \"    # 发布的应用ID\\n\",\n    \"    app_id = os.environ[\\\"APP_ID\\\"]\\n\",\n    \"    appbuilder_client = appbuilder.AsyncAppBuilderClient(app_id)\\n\",\n    \"    mcp_client = MCPClient()\\n\",\n    \"\\n\",\n    \"    # 注意这里的路径为MCP Server文件在本地的相对路径\\n\",\n    \"    await mcp_client.connect_to_server(\\\"./map.py\\\")\\n\",\n    \"    \\n\",\n    \"    tools = mcp_client.tools\\n\",\n    \"    event_handler = AsyncToolCallEventHandler(mcp_client, functions=[])\\n\",\n    \"    conversation_id = await appbuilder_client.create_conversation()\\n\",\n    \"    \\n\",\n    \"    async with appbuilder_client.run_with_handler(\\n\",\n    \"        conversation_id=conversation_id,\\n\",\n    \"        query=\\\"我住在北京亮马河大厦，请帮我查询一下我当前的经纬度信息\\\",\\n\",\n    \"        tools=tools,\\n\",\n    \"        event_handler=event_handler,\\n\",\n    \"    ) as run:\\n\",\n    \"        await run.until_done()\\n\",\n    \"    \\n\",\n    \"    await appbuilder_client.http_client.session.close()\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    appbuilder.logger.setLoglevel(\\\"DEBUG\\\")\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(main())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"5e6c0e92\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 9、运行代码文件\\n\",\n    \"\\n\",\n    \"在完成本地map.py文件和test.py文件内容更新后，在命令行中运行test.py，即可完成Agent的本地运行，控制台将呈现和上述结果一致的Agent运行结果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"f0b632dc\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 test.py\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"f02c8573\",\n   \"metadata\": {},\n   \"source\": [\n    \"运行后，打印日志参考：\\n\",\n    \"```bash\\n\",\n    \"[2025-04-17 21:50:38,955.955] async_event_handler.py [line:563] DEBUG [main-11524059179509233548] Agent 非流式回答: 根据您的位置信息，北京亮马河大厦的经纬度为：**北纬39.95139408407192，东经116.47114501090634**。如果您有其他出行需求或问题，请随时告诉我，我会尽力为您提供帮助。\\n\",\n    \"DEBUG:appbuilder:Agent 非流式回答: 根据您的位置信息，北京亮马河大厦的经纬度为：**北纬39.95139408407192，东经116.47114501090634**。如果您有其他出行需求或问题，请随时告诉我，我会尽力为您提供帮助。\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"5f694b20\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 常用指令\\n\",\n    \"\\n\",\n    \"* 现在上海中山公园附近堵车吗\\n\",\n    \"* 今天上海辰山植物园天气怎么样\\n\",\n    \"* 我住在北京亮马河大厦，请帮我规划北京赏花一日游\\n\",\n    \"* 从上海环球港，开车导航到同济大学四平路校区\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.12.10\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/mcp/client.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 前言-学习本项目你可以获得什么\\n\",\n    \"- 理论学习：了解MCP Client的基础知识\\n\",\n    \"- 上手实操：了解MCP Client的使用方式\\n\",\n    \"- 上手实操：通过MCP Client连接MCP Server，结合已有Agent，打造一个端云结合的进阶Agent。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 1. 项目背景\\n\",\n    \"### 1.1 什么是MCP\\n\",\n    \"[Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)是Anthropic推出的一个开放协议，提供了一种将 AI 模型连接到不同数据源和工具的标准化方式，可实现应用与外部数据源和工具之间的无缝集成。\\n\",\n    \"\\n\",\n    \"MCP基础架构由以下几部分组成：\\n\",\n    \"- MCP Hosts: 希望通过 MCP 访问数据的程序，例如 Claude Desktop、IDE 或 AI 工具\\n\",\n    \"- MCP Clients: 与服务器保持 1:1 连接的协议客户端\\n\",\n    \"- MCP Servers: 通过MCP协议公开特定功能的程序\\n\",\n    \"- Local Data Sources: MCP协议可以安全访问的本机文件、数据库、服务等\\n\",\n    \"- Remote Services: MCP Server可以访问的远程服务\\n\",\n    \"\\n\",\n    \"其中MCP Server包含以下几类：\\n\",\n    \"- Resources: 上下文和数据，供用户或人工智能模型使用\\n\",\n    \"- Prompts: 为用户提供模板化的消息和工作流程\\n\",\n    \"- Tools: AI模型调用的工具，使模型能够与外部系统交互，例如查询数据库、调用 API 或执行计算\\n\",\n    \"\\n\",\n    \"MCP Server Tools有以下特征：\\n\",\n    \"- 每个工具都由名称唯一标识，并包含描述其架构的元数据\\n\",\n    \"- 被设计为模型控制的，这意味着语言模型可以根据其上下文理解和用户的提示自动发现和调用工具\\n\",\n    \"\\n\",\n    \"### 1.2 MCP Client\\n\",\n    \" Host 内部专门用于与 MCP Server 建立和维持一对一连接的模块。它负责按照 MCP 协议的规范发送请求、接收响应和处理数据。简单来说，MCP Client 是 Host 内部处理 RPC 通信的“代理”，专注于与一个 MCP Server 进行标准化的数据、工具或 prompt 的交换。\\n\",\n    \" \\n\",\n    \" MCP Client 更多是一个底层技术术语，是关于 MCP Server 连接到 MCP Host 的底层细节，不用过于区分 MCP Host 和 MCP Client。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 2. 基础操作-通过MCP Client连接Server\\n\",\n    \"## 2.1 stdio方式连接\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"【第一步】安装AppBuilder的环境依赖，在python>=3.12环境中，执行以下命令。Python环境准备可以参考教程：https://cloud.baidu.com/article/3421098\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk -i https://mirrors.aliyun.com/pypi/simple/\\n\",\n    \"!python3 -m pip install mcp -i https://mirrors.aliyun.com/pypi/simple/\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"【第二步】以[官方server](https://github.com/modelcontextprotocol/quickstart-resources/blob/main/weather-server-python/weather.py)为例。我们将server代码保存为`weather.py`。这个server包含`get_alerts', 'get_forecast'，两个tool。\\n\",\n    \"\\n\",\n    \"再编写client脚本：\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import asyncio\\n\",\n    \"from appbuilder.mcp_server.client import MCPClient\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"async def main():\\n\",\n    \"    mcp_client = MCPClient()\\n\",\n    \"    await mcp_client.connect_to_server(\\\"./weather.py\\\")\\n\",\n    \"    print(mcp_client.tools)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(main())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"运行后，打印日志参考：\\n\",\n    \"\\n\",\n    \"Connected to server with tools:['get_alerts', 'get_forecast']\\n\",\n    \"\\n\",\n    \"INFO:appbuilder:\\n\",\n    \"\\n\",\n    \"Connected to server with tools:['get_alerts', 'get_forecast']\\n\",\n    \"[Tool(name='get_alerts', description='Get weather alerts for a US state.\\\\n\\\\n    Args:\\\\n        state: Two-letter US state code (e.g. CA, NY)\\\\n    ', inputSchema={'properties': {'state': {'title': 'State', 'type': 'string'}}, 'required': ['state'], 'title': 'get_alertsArguments', 'type': 'object'}), Tool(name='get_forecast', description='Get weather forecast for a location.\\\\n\\\\n    Args:\\\\n        latitude: Latitude of the location\\\\n        longitude: Longitude of the location\\\\n    ', inputSchema={'properties': {'latitude': {'title': 'Latitude', 'type': 'number'}, 'longitude': {'title': 'Longitude', 'type': 'number'}}, 'required': ['latitude', 'longitude'], 'title': 'get_forecastArguments', 'type': 'object'})]\\n\",\n    \"\\n\",\n    \"## 2.2 sse方式连接\\n\",\n    \"以AppBuilder百度搜索MCP Server为例，server地址`http://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key=Bearer+bce-v3/ALTAKxxx`, api_key为AppBuilder Token，格式参考URL中格式。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import asyncio\\n\",\n    \"from appbuilder.mcp_server.client import MCPClient\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"async def main():\\n\",\n    \"    client = MCPClient()\\n\",\n    \"    await client.connect_to_server(service_url=service_url)\\n\",\n    \"    print(client.tools)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    service_url = \\\"http://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key=Bearer+bce-v3/ALTAKxxx\\\"\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(main())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"运行后，打印日志参考：\\n\",\n    \"\\n\",\n    \"Connected to server with tools:['AIsearch']\\n\",\n    \"INFO:appbuilder:\\n\",\n    \"Connected to server with tools:['AIsearch']\\n\",\n    \"[Tool(name='AIsearch', description='\\\\n    执行搜索。\\\\n\\\\n    Args:\\\\n        query (str): 搜索请求。\\\\n        stream (bool, optional): 是否以流的形式接收响应数据。默认为False。\\\\n        instruction (Instruction, optional): 指令信息对象。默认为None。\\\\n        model (str, optional): 模型名称。默认为None，表示使用当前实例的模型。\\\\n        temperature (float, optional): 温度参数，控制生成文本的随机性。默认为1e-10。\\\\n        top_p (float, optional): 累积概率阈值，用于控制生成文本的多样性。默认为1e-10。\\\\n        search_top_k (int, optional): 搜索候选结果的数量。默认为4。\\\\n        hide_corner_markers (bool, optional): 是否隐藏响应中的边界标记。默认为True。\\\\n\\\\n    Returns:\\\\n        Message: 处理后的信息对象。\\\\n\\\\n    Raises:\\\\n        AppBuilderServerException: 如果输入信息或指令过长，将抛出此异常。\\\\n    ', inputSchema={'properties': {'query': {'title': 'query', 'type': 'string'}, 'stream': {'default': False, 'title': 'stream', 'type': 'string'}, 'instruction': {'default': None, 'title': 'instruction', 'type': 'string'}, 'model': {'default': None, 'title': 'model', 'type': 'string'}, 'temperature': {'default': 1e-10, 'title': 'temperature', 'type': 'string'}, 'top_p': {'default': 1e-10, 'title': 'top_p', 'type': 'string'}, 'search_top_k': {'default': 4, 'title': 'search_top_k', 'type': 'string'}, 'hide_corner_markers': {'default': True, 'title': 'hide_corner_markers', 'type': 'string'}, 'api_key': {'default': None, 'title': 'api_key', 'type': 'string'}}, 'required': ['query'], 'title': 'AIsearchArguments', 'type': 'object'})]\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 3. 进阶操作-Agent 应用轻松调用海量开源 MCP Server，打造端云结合的进阶 Agent\\n\",\n    \"搭建一个“端云组件结合使用”的新闻检索 Agent ：功能是，用户检索感兴趣的新闻，Agent 根据 query 进行检索，最终自动调用 Playwright 组件在本地打开浏览器，在mac上阅览。对比常规的Agent，区别是：\\n\",\n    \"\\n\",\n    \"* Before：Agent在聊天界面中展示新闻链接，提供总结信息\\n\",\n    \"* After：Agent在此基础上，还可以在本地的浏览器中自动打开指定的网页，进行本地操作\\n\",\n    \"为什么使用这个示例：\\n\",\n    \"\\n\",\n    \"该应用可以扩展为：用户询问需求后，Agent不仅思考并回答，还能操作用户的终端，帮助用户下订单、操作文件等等\\n\",\n    \"\\n\",\n    \"### 3.1 【第一步】：创建云端的Agent，作为基础的应用，步骤如下：\\n\",\n    \"* 打开AppBuilder官网：https://qianfan.cloud.baidu.com/appbuilder/ ，并登录\\n\",\n    \"![AppBuilder首页](./image/appbuilder_home.png)\\n\",\n    \"\\n\",\n    \"* 在左侧的边栏中，选择创一个【自主规划Agent】\\n\",\n    \"![创建自主规划Agent](./image/agent_create.png)\\n\",\n    \"\\n\",\n    \"* 使用【AI自动配置功能】生成一个自动配置好角色指令的Agent，Prompt可以是：【热点新闻阅读助手】\\n\",\n    \"![创建热点新闻阅读助手](./image/agent_config.png)\\n\",\n    \"\\n\",\n    \"* 可以调整该应用的组件，我们选择【百度AI搜索】作为提供网页url的来源，最终Agent界面长下面这个样子\\n\",\n    \"![热点新闻阅读助手](./image/agent_show.png)\\n\",\n    \"\\n\",\n    \"* 继续调整该组件，考虑到我们可能会多次思考，多次调用组件，所以，我们调整最大思考轮数\\n\",\n    \"![最大思考轮数](./image/agent_max_rounds.png)\\n\",\n    \"\\n\",\n    \"* 最后，点击右上角【发布】->【发布应用】，这样我们就可以在AB-SDK中调用该应用啦\\n\",\n    \"![发布应用](./image/agent_pub.png)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 3.2 【第二步】：下载一个可以控制本地浏览器的MCP-Server组件Playwright，步骤如下\\n\",\n    \"我们使用[Playwright](https://github.com/blackwhite084/playwright-plus-python-mcp/blob/master/src/playwright_server/server.py )作为MCP Server，直接保存该代码到本地可以执行的位置。\\n\",\n    \"![下载MCP Server](./image/playwright_download.png)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 3.3 【第三步】：使用AB-SDK访问我们的Agent，并且让它联动本地的MCP组件\\n\",\n    \"* 通过代码态访问我们刚创建的Agent，有以下几个依赖的配置，首先是【APP ID】，获取方式如下：\\n\",\n    \"![获取app_id](./image/app_get.png)\\n\",\n    \"* 然后是访问应用所需要的Token，获取方式如下：\\n\",\n    \"![获取Token](./image/token_get.png)\\n\",\n    \"* 创建Token时记得需要勾选我们刚才创建的【新闻小助手】应用\\n\",\n    \"![Token功能范围](./image/token_scope.png)\\n\",\n    \"* python >= 3.12 的环境中安装 【appbuilder-sdk】及相关MCP组件的依赖\\n\",\n    \"\\n\",\n    \"安装playwright支持的浏览器，该步骤由于网络原因，时间较长，约5-10min，可通过代理提速\\n\",\n    \"\\n\",\n    \"```bash\\n\",\n    \"python -m pip install appbuilder-sdk -i https://pypi.tuna.tsinghua.edu.cn/simple \\n\",\n    \"python -m pip install mcp -i https://pypi.tuna.tsinghua.edu.cn/simple\\n\",\n    \"python -m pip install playwright -i https://pypi.tuna.tsinghua.edu.cn/simple \\n\",\n    \"playwright install \\n\",\n    \"```\\n\",\n    \"\\n\",\n    \"* 有了【APP_ID】和【TOKEN】，并且在本地安装好上述依赖后，我们可以快速访问【新闻小助手应用】，搜索感兴趣的新闻，并在本地浏览器打开对应网页\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import time\\n\",\n    \"import asyncio\\n\",\n    \"\\n\",\n    \"import appbuilder\\n\",\n    \"from appbuilder.core.console.appbuilder_client.async_event_handler import (\\n\",\n    \"    AsyncToolCallEventHandler,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"from appbuilder.mcp_server.client import MCPClient\\n\",\n    \"\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"YOUR_APPBUILDER_TOKEN\\\"\\n\",\n    \"os.environ[\\\"APP_ID\\\"] = \\\"YOUR_APP_ID\\\"\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"async def main():\\n\",\n    \"    app_id = os.environ.get(\\\"APP_ID\\\")\\n\",\n    \"    assert app_id is not None, \\\"APP_ID is not set\\\"\\n\",\n    \"\\n\",\n    \"    appbuilder_client = appbuilder.AsyncAppBuilderClient(app_id)\\n\",\n    \"    mcp_client = MCPClient()\\n\",\n    \"    # server.py 是上述步骤中下载的mcp组件文件\\n\",\n    \"    await mcp_client.connect_to_server(\\\"./server.py\\\")\\n\",\n    \"\\n\",\n    \"    tools = mcp_client.tools\\n\",\n    \"    event_handler = AsyncToolCallEventHandler(mcp_client, functions=[])\\n\",\n    \"    conversation_id = await appbuilder_client.create_conversation()\\n\",\n    \"    with await appbuilder_client.run_with_handler(\\n\",\n    \"        conversation_id=conversation_id,\\n\",\n    \"        query=\\\"先搜索关于文心一言4.5模型的新闻，取出其中一个url，再用playwright_navigate打开这个url\\\",\\n\",\n    \"        tools=tools,\\n\",\n    \"        event_handler=event_handler,\\n\",\n    \"    ) as run:\\n\",\n    \"        await run.until_done()\\n\",\n    \"\\n\",\n    \"    print(\\\"浏览网页，我们在此稍作停留，您可通过其他方式常驻该进程以保持网页\\\")\\n\",\n    \"    time.sleep(5)\\n\",\n    \"    await appbuilder_client.http_client.session.close()\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    appbuilder.logger.setLoglevel(\\\"DEBUG\\\")\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(main())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"* 在终端执行上述代码\\n\",\n    \"\\n\",\n    \"**效果展示**\\n\",\n    \"\\n\",\n    \"![大模型结果](./image/llm_answer.png)\\n\",\n    \"\\n\",\n    \"* 界面效果\\n\",\n    \"  * 自动启动了一个chrome浏览器，并打开了我们搜索到的网页\\n\",\n    \"![playwright结果](./image/playwright_result.png)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"language_info\": {\n   \"name\": \"python\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/mcp/knowledge_base_mcp_server.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"8ce67390\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 前言\\n\",\n    \"通过本文，你可以：\\n\",\n    \" * 了解AppBuilder KnowledgeBase MCP Server是什么\\n\",\n    \" * 了解如何通过AppBuilder-SDK调用AppBuilder KnowledgeBase MCP Server\\n\",\n    \" * 了解如何通过Cursor调用AppBuilder KnowledgeBase MCP Server\\n\",\n    \"\\n\",\n    \"如果你需要了解更多关于AppBuilder结合MCP生态的功能,可跳转到下面的文档：\\n\",\n    \"- 主动调用：通过AppBuilder-Agent调用MCP Server\\n\",\n    \"  - 代码态调用：[AppBuilder结合端云组件，调用本地MCP Server](./client.ipynb) \\n\",\n    \"  - 代码态调用：[AppBuilder结合地图MCP Server，实现智能导航](./baidu_map.ipynb)\\n\",\n    \"  - 零代码态调用：[AppBuilder控制台使用MCP](https://cloud.baidu.com/doc/AppBuilder/s/Nm9vmpb3g)\\n\",\n    \"- 被动调用：AppBuilder能力，融入MCP生态，可作为MCP Server提供能力\\n\",\n    \"  - 组件能力：[AppBuilder组件转MCP Server](./server.ipynb)\\n\",\n    \"  - 智能体能力：[AppBuilder Agent MCP Server](./app_mcp_server.ipynb)\\n\",\n    \"  - AI搜索能力: [AppBuilder AI搜索MCP Server](https://github.com/baidubce/app-builder/tree/master/python/mcp_server/ai_search)\\n\",\n    \"  - RAG能力：[AppBuilder知识库MCP Server](./knowledge_base_mcp_server.ipynb)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"## AppBuilder Agent MCP Server简介\\n\",\n    \"千帆AppBuilder提供了关于AppBuilder知识库的MCP Server，用户可通过MCP协议调用在AppBuilder中的知识库。当前包括以下能力：\\n\",\n    \"- 创建知识库\\n\",\n    \"- 获取知识库详情\\n\",\n    \"- 获取知识库列表\\n\",\n    \"- 知识库检索\\n\",\n    \"- 上传知识库文档\\n\",\n    \"- 获取文档列表\\n\",\n    \"\\n\",\n    \"对于入门用户，还提供了环境配置、 api key获取等操作步骤。已熟悉用户可以直接跳过环境配置、api_key获取部分。\\n\",\n    \"\\n\",\n    \"## 安装配置步骤\\n\",\n    \"\\n\",\n    \"### 配置基础环境\\n\",\n    \"\\n\",\n    \"#### 1、安装Python\\n\",\n    \"\\n\",\n    \"大部分的MCP Server，例如Unity和Blender，都是Python SDK\\n\",\n    \"安装Python最简单的方法是安装Miniconda\\n\",\n    \"**注意：请确保安装的python>=3.12**\\n\",\n    \"\\n\",\n    \"[Miniconda官网](https://www.anaconda.com/docs/getting-started/miniconda/install)\\n\",\n    \"\\n\",\n    \"#### 2、下载Appbuilder-SDK\\n\",\n    \"\\n\",\n    \"为了实现Appbuilder-SDK对AppBuilder Agent MCP Server的代码态调用，需要在conda环境下载appbuilder-sdk包\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"96a39a88\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install httpx appbuilder-sdk mcp\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"6e7d417d\",\n   \"metadata\": {},\n   \"source\": [\n    \"\\n\",\n    \"## 获取千帆AppBuilder API key\\n\",\n    \"\\n\",\n    \"### 1、进入百度智能云千帆AppBuilder主页\\n\",\n    \"\\n\",\n    \"进入百度智能云千帆AppBuilder主页，免费试用\\n\",\n    \"\\n\",\n    \"- [百度智能云千帆AppBuilder主页](https://qianfan.cloud.baidu.com/appbuilder)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 7、创建Appbuilder API key\\n\",\n    \"\\n\",\n    \"- [Appbuilder API key授权](https://cloud.baidu.com/doc/AppBuilder/s/lm68r8e6i)\\n\",\n    \"\\n\",\n    \"- [Appbuilder API 控制台管理中心](https://console.bce.baidu.com/iam/#/iam/apikey/list)\\n\",\n    \"\\n\",\n    \"在【API Key】界面中，创建一个新的Key，并添加知识库的读写权限，记下来。\\n\",\n    \"\\n\",\n    \"![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BAAPPBUILDER-TOKEN.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-04-17T14%3A49%3A27Z%2F-1%2Fhost%2F9266ac8c93a262d2905811877d680f53af26668a0ee09e1b3a61c0b721de253c)\\n\",\n    \"\\n\",\n    \"![api_key_knowledgebase](./image/api_key_knowledgebase.png)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"3aa3c0a2\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 使用AppBuilder SDK调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"3e7b9a90\",\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import asyncio\\n\",\n    \"import json\\n\",\n    \"import io\\n\",\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"from appbuilder.mcp_server.client import MCPClient\\n\",\n    \"\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"YOUR_APPBUILDER_TOKEN\\\"\\n\",\n    \"\\n\",\n    \"async def main():\\n\",\n    \"    mcp_client = MCPClient()\\n\",\n    \"    await mcp_client.connect_to_server(service_url=service_url)\\n\",\n    \"\\n\",\n    \"    # 创建知识库\\n\",\n    \"    result = await mcp_client.call_tool(\\n\",\n    \"        \\\"create_knowledge_base\\\",\\n\",\n    \"        {\\\"name\\\": \\\"mcp测试可删\\\", \\\"description\\\": \\\"mcp测试，可删\\\"},\\n\",\n    \"    )\\n\",\n    \"    knowledge_base_info = json.loads(result.content[0].text)\\n\",\n    \"    knowledge_base_id = knowledge_base_info.get(\\\"id\\\")\\n\",\n    \"    assert knowledge_base_id is not None\\n\",\n    \"    appbuilder.logger.debug(f\\\"create knowledge base success: {knowledge_base_id}\\\")\\n\",\n    \"\\n\",\n    \"    # 获取知识库详情\\n\",\n    \"    result = await mcp_client.call_tool(\\n\",\n    \"        \\\"describe_knowledge_base\\\",\\n\",\n    \"        {\\\"id\\\": knowledge_base_id},\\n\",\n    \"    )\\n\",\n    \"    knowledge_base_info = json.loads(result.content[0].text)\\n\",\n    \"    knowledge_base_id = knowledge_base_info.get(\\\"id\\\")\\n\",\n    \"    assert knowledge_base_id is not None\\n\",\n    \"    appbuilder.logger.debug(f\\\"describe knowledge base success: {knowledge_base_id}\\\")\\n\",\n    \"\\n\",\n    \"    # 获取知识库列表\\n\",\n    \"    result = await mcp_client.call_tool(\\n\",\n    \"        \\\"list_knowledge_bases\\\",\\n\",\n    \"        {\\\"max_keys\\\": 10},\\n\",\n    \"    )\\n\",\n    \"    assert len(result.content) == 10\\n\",\n    \"    appbuilder.logger.debug(f\\\"list knowledge bases success: {len(result.content)}\\\")\\n\",\n    \"\\n\",\n    \"    # 上传文档到知识库\\n\",\n    \"    file_content = \\\"这里是你的文件内容字符串\\\"\\n\",\n    \"    with io.BytesIO(file_content.encode(\\\"utf-8\\\")) as f:\\n\",\n    \"        result = await mcp_client.call_tool(\\n\",\n    \"            \\\"upload_document\\\",\\n\",\n    \"            {\\\"id\\\": knowledge_base_id, \\\"file_data\\\": f, \\\"file_name\\\": \\\"test.txt\\\"},\\n\",\n    \"        )\\n\",\n    \"    document_info = json.loads(result.content[0].text)\\n\",\n    \"\\n\",\n    \"    document_id = document_info.get(\\\"documentId\\\")\\n\",\n    \"    assert document_id is not None\\n\",\n    \"    appbuilder.logger.debug(f\\\"upload document success: {document_id}\\\")\\n\",\n    \"\\n\",\n    \"    # 获取文档列表\\n\",\n    \"    result = await mcp_client.call_tool(\\n\",\n    \"        \\\"list_documents\\\",\\n\",\n    \"        {\\\"id\\\": knowledge_base_id},\\n\",\n    \"    )\\n\",\n    \"    appbuilder.logger.debug(f\\\"list documents base success: {knowledge_base_id}\\\")\\n\",\n    \"\\n\",\n    \"    # 检索知识库\\n\",\n    \"    result = await mcp_client.call_tool(\\n\",\n    \"        \\\"query_knowledge_base\\\",\\n\",\n    \"        {\\\"query\\\": \\\"分子\\\", \\\"id_list\\\": [knowledge_base_id]},\\n\",\n    \"    )\\n\",\n    \"    assert result.content[0].text is not None\\n\",\n    \"    appbuilder.logger.debug(\\\"query knowledge base success\\\")\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"if __name__ == \\\"__main__\\\":\\n\",\n    \"    appbuilder.logger.setLoglevel(\\\"DEBUG\\\")\\n\",\n    \"    service_url = (\\n\",\n    \"        \\\"http://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key=\\\"\\n\",\n    \"        + os.environ.get(\\\"APPBUILDER_TOKEN\\\")\\n\",\n    \"    )\\n\",\n    \"\\n\",\n    \"    loop = asyncio.get_event_loop()\\n\",\n    \"    loop.run_until_complete(main())\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"df473bce\",\n   \"metadata\": {},\n   \"source\": [\n    \"用户选择其中需要的功能进行执行，比如创建知识库，打印如下：\\n\",\n    \"\\n\",\n    \"```\\n\",\n    \"DEBUG:appbuilder:create knowledge base success: 909*****-***a-****-****-*********2c93\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"6b68c4d6\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 使用Cursor调用\\n\",\n    \"### Cursor配置\\n\",\n    \"api_key=上面步骤获取到的api key，格式为\\\"bce-v3/ALTAK...\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"id\": \"8b292ee1\",\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"json\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"{\\n\",\n    \"    \\\"mcpServers\\\": {\\n\",\n    \"        \\\"AppBuilder RAG\\\": {\\n\",\n    \"            \\\"url\\\": \\\"http://appbuilder.baidu.com/v2/knowledgeBase/mcp/sse?api_key=bce-v3/ALTAK...\\\"\\n\",\n    \"        }\\n\",\n    \"    }\\n\",\n    \"}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"id\": \"804d655d\",\n   \"metadata\": {},\n   \"source\": [\n    \"配置后，在Cursor设置页面可看到`create_knowledge_base`、`describe_knowledge_base`、`list_knowledge_bases`、`query_knowledge_base`、`upload_document`、`list_documents` 6个Tool。\\n\",\n    \"![cursor config](./image/cursor_knowledgebase_config.png)\\n\",\n    \"\\n\",\n    \"### 调用\\n\",\n    \"![cursor knowledgebase](./image/cursor_knowledgebase_test.png)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.12.10\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n"
  },
  {
    "path": "cookbooks/mcp/server.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 前言-学习本项目你可以获得什么\\n\",\n    \"- 理论学习：了解MCP Server的基础知识\\n\",\n    \"- 上手实操：入门MCP Server的使用方式\\n\",\n    \"- 上手实操：将AppBuilder组件转换为MCP Server tool，并在client中使用\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 1. 项目背景\\n\",\n    \"### 1.1 什么是MCP Server Tool\\n\",\n    \"[Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)是Anthropic推出的一个开放协议，提供了一种将 AI 模型连接到不同数据源和工具的标准化方式，可实现应用与外部数据源和工具之间的无缝集成。\\n\",\n    \"\\n\",\n    \"MCP基础架构由以下几部分组成：\\n\",\n    \"- MCP Hosts: 希望通过 MCP 访问数据的程序，例如 Claude Desktop、IDE 或 AI 工具\\n\",\n    \"- MCP Clients: 与服务器保持 1:1 连接的协议客户端\\n\",\n    \"- MCP Servers: 通过MCP协议公开特定功能的程序\\n\",\n    \"- Local Data Sources: MCP协议可以安全访问的本机文件、数据库、服务等\\n\",\n    \"- Remote Services: MCP Server可以访问的远程服务\\n\",\n    \"\\n\",\n    \"其中MCP Server包含以下几类：\\n\",\n    \"- Resources: 上下文和数据，供用户或人工智能模型使用\\n\",\n    \"- Prompts: 为用户提供模板化的消息和工作流程\\n\",\n    \"- Tools: AI模型调用的工具，使模型能够与外部系统交互，例如查询数据库、调用 API 或执行计算\\n\",\n    \"\\n\",\n    \"MCP Server Tools有以下特征：\\n\",\n    \"- 每个工具都由名称唯一标识，并包含描述其架构的元数据\\n\",\n    \"- 被设计为模型控制的，这意味着语言模型可以根据其上下文理解和用户的提示自动发现和调用工具\\n\",\n    \"\\n\",\n    \"MCP Server Tool 示例：\\n\",\n    \"- MCP quick-start server: [weather server](https://modelcontextprotocol.io/quickstart/server)\\n\",\n    \"- MCP example servers: [example servers](https://modelcontextprotocol.io/examples)\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"### 1.2 什么是AppBuilder组件\\n\",\n    \"SDK提供了40+个源于百度生态的优质组件，列表可见[组件列表](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz#3%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1), 调用前需要申领[免费试用额度](https://console.bce.baidu.com/ai-engine/old/#/ai/ocr/overview/resource/list)\\n\",\n    \"\\n\",\n    \"目前支持转换为MCP Server Tool的组件包括：\\n\",\n    \"| 组件名称 | 组件描述 |\\n\",\n    \"| --- | --- |\\n\",\n    \"| AnimalRecognition | 动物识别，可用于识别一张图片，即对于输入的一张图片（可正常解码，且长宽比较合适），输出动物识别结果。 |\\n\",\n    \"| ImageUnderstand | 图像内容理解，输出理解图片后的文本信息。 |\\n\",\n    \"| Translation | 文本翻译组件，提供多种语言互译的在线文本翻译服务。支持术语定制功能，用户可对翻译结果进行干预，快速提高翻译质量。可广泛应用于移动端、PC网站、智能硬件等不同产品形态中，满足多领域、多场景的翻译需求。 |\\n\",\n    \"| GeneralOCR | 通用文字识别组件，支持多场景、多语种、高精度的文字识别服务，对图片全部文字内容进行检测识别。 |\\n\",\n    \"| StyleRewrite | 风格转写组件，可以基于生成式大模型对文本的风格进行改写。支持多种文本风格，包括营销、客服、直播、激励及教学话术。 |\\n\",\n    \"| HallucinationDetection | 幻觉检测，针对问答场景，检测答案中是否存在幻觉。 |\\n\",\n    \"| QRcodeOCR | 二维码识别，可对图片中的二维码、条形码进行检测和识别，返回存储的文字信息及其位置信息。 |\\n\",\n    \"| HandwriteOCR | 手写文字识别，图片中的手写中文、手写数字进行检测和识别，针对不规则的手写字体进行专项优化，识别准确率可达90%以上。 |\\n\",\n    \"| MixCardOCR | 身份证混贴识别，身份证混贴识别支持自动检测与识别身份证正反面在同一张图片上的场景，一次识别图片中身份证正反面所有字段。 |\\n\",\n    \"| TableOCR | 表格文字识别，可支持识别图片中的表格内容，返回各表格的表头表尾内容、单元格文字内容及其行列位置信息，全面覆盖各类表格样式，包括常规有线表格、无线表格、含合并单元格表格。同时，支持多表格内容识别。 |\\n\",\n    \"| Text2Image | 文生图（AI作画-高级版），基于文心大模型，可以根据用户输入的文本，自动创作不限定风格的图，为内容创作者提供灵感和高质量配图。 |\\n\",\n    \"| StyleWriting | 风格写作组件，是一款基于生成式大模型进行文本创作的工具，支持多种风格，包括B站、小红书等，适用于编写文案、广告等多种场景。 |\\n\",\n    \"| TreeMind | 树图，提供智能思维导图制作工具和丰富的模板，支持脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴、时间线等多种专业格式。 |\\n\",\n    \"| ASR | 短语音识别，可以将音频流实时识别为文字，并返回每句话的开始和结束时间，适用于手机语音输入、语音搜索、人机对话等语音交互场景。 |\\n\",\n    \"| ObjectRecognition | 通用物体和场景识别组件，可以识别超过10万类常见物体和场景，接口返回大类及细分类的名称。广泛适用于图像或视频内容分析、拍照识图等业务场景 |\\n\",\n    \"| SimilarQuestion | 相似问生成组件，可以基于输入的问题，挖掘出与该问题相关的类似问题。广泛用于客服、问答等场景。 |\\n\",\n    \"| OralQueryGeneration | 口语化Query生成组件，可以基于输入文本生成与文档内容相关的Query。可用于增强文档索引等场景。 |\\n\",\n    \"| PlantRecognition | 植物识别，即对于输入的一张图片（可正常解码，且长宽比较合适），输出植物识别结果。 |\\n\",\n    \"\\n\",\n    \"即实现在appbuilder.core.components.v2目录下的组件。后续会逐步支持将所有的组件转化为MCP Server Tool。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 2. 项目介绍-将AppBuilder组件转换为MCP Server Tool\\n\",\n    \"\\n\",\n    \"### 目标：\\n\",\n    \"\\n\",\n    \"在Cursor里自定义个人专属办公工具 —— 用户自己可将AppBuilder官方提供的“文本翻译-通用版”、“植物识别”等组件转化为MCP Server，在Cursor中作为自定义工具直接调用。\\n\",\n    \"\\n\",\n    \"### 为什么使用这个案例？\\n\",\n    \"\\n\",\n    \"- AppBuilder有很多优质的组件，可以在Claude客户端、Cursor中通过MCP的方式联动   \\n\",\n    \"- 通过这种模式，未来可以支持用户把自己在AB上开发的工作流/Agent集成到本地支持MCP协议的Client中直接使用    \\n\",\n    \"- MCP协议提供两种方式定义server：low-level server 和 FastMCP server。其中low-level是基础接口，FastMCP是高级封装，是 MCP 协议的核心接口。它处理连接管理、协议合规性和消息路由。   \\n\",\n    \"\\n\",\n    \"下面提供一个使用FastMCP定义自己的MCP Server Tool的简单示例：\\n\",\n    \"\\n\",\n    \"【第一步】安装AppBuilder的环境依赖，在python>=3.12环境中，执行以下命令。Python环境准备可以参考教程：https://cloud.baidu.com/article/3421098\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk -i https://mirrors.aliyun.com/pypi/simple/\\n\",\n    \"!python3 -m pip install mcp -i https://mirrors.aliyun.com/pypi/simple/\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"【第二步】我们可以快速将 AppBuilder 中的官方组件“文本翻译-通用版”、“植物识别”转换为 MCP Server 工具，该文件我们命名为 server.py\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"\\n\",\n    \"\\\"\\\"\\\"server.py\\\"\\\"\\\"\\n\",\n    \"\\n\",\n    \"import os\\n\",\n    \"from appbuilder.mcp_server.server import MCPComponentServer\\n\",\n    \"from appbuilder.core.components.v2 import Translation, PlantRecognition\\n\",\n    \"\\n\",\n    \"#设置APPBUILDER_TOKEN\\n\",\n    \"os.environ['APPBUILDER_TOKEN'] = '你的APPBUILDER_TOKEN'\\n\",\n    \"\\n\",\n    \"# 定义server\\n\",\n    \"server = MCPComponentServer(name=\\\"AB Component Server\\\")\\n\",\n    \"\\n\",\n    \"# 初始化组件实例\\n\",\n    \"translation = Translation()\\n\",\n    \"plant_recognition = PlantRecognition()\\n\",\n    \"\\n\",\n    \"# 把组件作为tool添加到server\\n\",\n    \"server.add_component(translation)\\n\",\n    \"server.add_component(plant_recognition)\\n\",\n    \"\\n\",\n    \"# 启动server\\n\",\n    \"server.run()\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"注意：请将secret_key替换为你的APPBUILDER_TOKEN，Token获取方式见文档：https://cloud.baidu.com/doc/AppBuilder/s/lm68r8e6i\\n\",\n    \"\\n\",\n    \"【第三步】在Cursor中配置自己的server：https://docs.cursor.com/context/model-context-protocol ，根据指引填写MCP配置文件，指向我们第二步中创建的server.py，配置MCP Server。\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"json\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"\\n\",\n    \"{\\n\",\n    \"  \\\"mcpServers\\\": {\\n\",\n    \"    \\\"AB component\\\": {\\n\",\n    \"      \\\"command\\\": \\\"/abs/path/to/python\\\",  # python解释器的绝对路径\\n\",\n    \"      \\\"args\\\": [\\n\",\n    \"        \\\"/abs/path/to/server.py\\\"         # server.py的绝对路径\\n\",\n    \"      ]\\n\",\n    \"    }\\n\",\n    \"  }\\n\",\n    \"}\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"python解释器的路径，可以在终端中输入以下命令进行查看:\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"\\n\",\n    \"# mac / linux\\n\",\n    \"which python\\n\",\n    \"\\n\",\n    \"# windows\\n\",\n    \"where python\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"【第四步】配置完成后，我们刷新MCP Servers配置，这时候可看到在本地部署好的 AppBuilder 官方组件工具。\\n\",\n    \"\\n\",\n    \"![cursor server tool配置](./image/cursor_list_tool.png)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"**效果展示**：\\n\",\n    \"\\n\",\n    \"【示例一】在Cursor的Chat对话框里，我们输入query\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"把“你好，中国”翻译成英文\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Cursor识别需要调用的工具，并请求权限：\\n\",\n    \"![请求权限](./image/cursor_run_tool.jpg)\\n\",\n    \"\\n\",\n    \"点击\\\"Run tool\\\"执行工具。\\n\",\n    \"\\n\",\n    \"成功调用“文本翻译”工具，并展示组件的输入输出以及最终回复答案\\n\",\n    \"![调用工具](./image/cursor_call_translation_result.jpg)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"【示例二】输入query\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"识别 https://img.dutenews.com/a/10001/202111/50120fcde5bb6f9c950758c6d77b656f.png 中的植物\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"Cursor能够成功调用“植物识别”工具，并展示组件的输入输出，最终回复答案“根据植物识别模型的分析结果，这张图片中的植物是杨树，识别的置信度为55.7%”。\\n\",\n    \"\\n\",\n    \"![调用植物识别工具](./image/cursor_call_plantrec.jpg)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"注：Cursor可能存在思考工具调用参数错误的幻觉，如在正确的调用参数之上再封装一层\\\"kwargs\\\"。我们已完成对该幻觉问题的兼容，功能将会在1.0.6版本中上线。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 4. 项目总结\\n\",\n    \"\\n\",\n    \"本项目主要：\\n\",\n    \"- 介绍了MCP协议及Server的概念和使用方式\\n\",\n    \"- 介绍了如何定义MCP Server tool\\n\",\n    \"- 如何将AppBuilder组件转换为MCP Server tool\\n\",\n    \"- 最后使用Claude客户端展示了AppBuilder组件作为MCP Server Tool的使用效果。\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"language_info\": {\n   \"name\": \"python\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/pipeline/assistant.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Assistant\\n\",\n    \"\\n\",\n    \"本文档描述 Assistants API 中 与 Assistant 相关函数调用\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 环境准备\\n\",\n    \"\\n\",\n    \"首先需要安装AppBuilder-SDK代码库，若已在开发环境安装，则可跳过此步。\\n\",\n    \"\\n\",\n    \"**注意：**: appbuilder-sdk 的python版本要求 3.9+，安装的SDK version >= 0.7.0\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 配置你的密钥，主要在这之前需要首先申请Assistant API的内测资格\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your_appbuilder_token\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## Assistant相关函数\\n\",\n    \"\\n\",\n    \"### 创建Assistant\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"创建一个Assistant\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='asst_63ab25b82a7649d5a763415e978c4f01' object='assistant' name='测试' description='test' instructions='你是百度制作的AI助手' tools=[] created_at=1717645100200 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata={'key': 'value'}\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"\\n\",\n    \"assistant = appbuilder.assistant.assistants.create(\\n\",\n    \"            model = \\\"ERNIE-4.0T-8K\\\",\\n\",\n    \"            name=\\\"测试\\\",\\n\",\n    \"            description=\\\"test\\\",\\n\",\n    \"            metadata={\\n\",\n    \"                \\\"key\\\": \\\"value\\\",\\n\",\n    \"            }\\n\",\n    \"        )\\n\",\n    \"\\n\",\n    \"# 打印创建的assistant\\n\",\n    \"print(assistant)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 修改Assistant\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据assistant_id修改一个已创建的Assistant\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='asst_63ab25b82a7649d5a763415e978c4f01' model='DeepSeek-V3.1' name='更新Assistants' description='test' response_format=<ResponseFormat.TEXT: 'text'> instructions='' created_at=1717645100200 thought_instructions='' chat_instructions='' tools=[] file_ids=[] metadata={'key': 'value'}\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 更新已经创建的āssistant的信息\\n\",\n    \"appbuilder_update=appbuilder.assistant.assistants.update(\\n\",\n    \"    assistant_id = assistant.id,# 已经创建的Assistant ID\\n\",\n    \"    model=\\\"ERNIE-4.0T-8K\\\",\\n\",\n    \"    name=\\\"更新Assistants\\\",\\n\",\n    \"    description = \\\"test\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 获取更新后的assistant信息 \\n\",\n    \"print(appbuilder_update)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询assistant列表\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"查询当前用户已创建的assistant列表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='asst_c16bd73ab73d499387b2bfd8146cfb0a' object='assistant' name='python程序设计助教' description='幽默讲解Python基础。' instructions='### 角色与目标\\\\n**你是Python入门导师**，专门为初学者讲授Python编程知识。你的目标是引导学生掌握Python语言基础，包括语言概述、变量、表达式、基本和组合数据类型、控制结构语句、函数定义与调用、标准库和第三方库的使用、异常处理和文件读写，并通过实际案例帮助学生加深理解。\\\\n### 指导原则\\\\n1. **教育性**：确保教学内容准确、系统，能够帮助学生建立扎实的编程基础。\\\\n2. **实践性**：结合日常案例，让学生能够将理论知识应用于实际。\\\\n3. **易懂性**：用幽默风趣、简洁明了的语言解释概念，降低初学者的学习难度。\\\\n### 限制\\\\n* 避免涉及过于复杂的编程技巧和高级话题，确保内容适合初学者。\\\\n* 不轻易提供具体的编程作业答案，而是引导学生自己思考和解决问题。但如果学生始终解决不了问题，也可以提供正确答案。\\\\n### 澄清\\\\n* 你的教学内容主要围绕Python编程的基础知识和实践应用。\\\\n* 你会通过案例和实例来帮助学生理解和掌握Python编程的基本概念。\\\\n### 个性化\\\\n你以幽默风趣的教学风格著称，能够将枯燥的编程知识以生动有趣的方式呈现出来。你对学生充满耐心，总是乐于解答他们的疑问，并引导他们逐步成长为编程小能手。' tools=[] created_at=1717645108134 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_63ab25b82a7649d5a763415e978c4f01' object='assistant' name='更新Assistants' description='test' instructions='' tools=[] created_at=1717645100200 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata={'key': 'value'}\\n\",\n      \"id='asst_4d865b80be684b8aa2a1e37c625ba476' object='assistant' name='原神内鬼消息爆料' description='舅舅永垂不朽' instructions='' tools=[] created_at=1717645054395 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_3371b90537414828bb85e32c49161ba0' object='assistant' name='严谨文案助手' description='严谨文案的秘书Agent' instructions='' tools=[] created_at=1717644994838 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_da1b2ad23e9e4da4ab5a45203f849c71' object='assistant' name='严谨文案助手' description='严谨文案的秘书Agent' instructions='作为秘书Agent，你的主要职责是协助处理文案工作，确保文字表达的严谨性，同时提供有效的行政支持。' tools=[] created_at=1717644990269 thought_instructions='在处理文案任务时，应特别注重文字的逻辑性、准确性和严谨性。当遇到不确定的表述或需要深入研究的内容时，务必进行充分的核实和查证，以确保最终输出的文案质量。' chat_instructions='回复用户时，请使用严谨、正式的语言风格，避免使用口语化或随意的表达方式。在提供文案建议或修改意见时，要详细阐述修改理由，以便用户更好地理解。' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_a56ad90640114d17a5aaad0b22d330d8' object='assistant' name='朋友圈优化助手' description='你好，我是你的朋友圈优化助手。我会把你的朋友圈文案变得更吸引人，引发更多互动。请告诉我你需要优化的文案吧。' instructions='' tools=[] created_at=1717644978845 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_7302428c9a2840efa192eff12ce15d6d' object='assistant' name='python程序设计助教' description='幽默讲解Python基础。' instructions='### 角色与目标\\\\n**你是Python入门导师**，专门为初学者讲授Python编程知识。你的目标是引导学生掌握Python语言基础，包括语言概述、变量、表达式、基本和组合数据类型、控制流语句、函数定义与调用、异常处理和文件读写，并通过实际案例帮助学生加深理解。\\\\n### 指导原则\\\\n1. **教育性**：确保教学内容准确、系统，能够帮助学生建立扎实的编程基础。\\\\n2. **实践性**：结合日常案例，让学生能够将理论知识应用于实际。\\\\n3. **易懂性**：用幽默风趣、简洁明了的语言解释概念，降低初学者的学习难度。\\\\n### 限制\\\\n* 避免涉及过于复杂的编程技巧和高级话题，确保内容适合初学者。\\\\n* 不提供具体的编程作业答案，而是引导学生自己思考和解决问题。\\\\n### 澄清\\\\n* 你的教学内容主要围绕Python编程的基础知识和实践应用。\\\\n* 你会通过案例和实例来帮助学生理解和掌握Python编程的基本概念。\\\\n### 个性化\\\\n你以幽默风趣的教学风格著称，能够将枯燥的编程知识以生动有趣的方式呈现出来。你对学生充满耐心，总是乐于解答他们的疑问，并引导他们逐步成长为编程小能手。' tools=[] created_at=1717644940885 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_42d9cbd188f7416d8c77dad839d45bf8' object='assistant' name='低代码升级777' description='你好，欢迎来到低代码升级1~' instructions='' tools=[] created_at=1717644917557 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_532c0240d3f248b78d4c334da93698c0' object='assistant' name='低代码升级777' description='你好，欢迎来到低代码升级1~' instructions='' tools=[] created_at=1717644917069 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_9c9ea21b1fba4767b2fbfbbd34993d84' object='assistant' name='动物管理员2' description='嘿，你好啊！我是动物百事通，对各种动物的生活习性和饮食习惯都了如指掌。如果你对动物有任何疑问或者想了解更多关于它们的信息，都可以来问我哦！' instructions='### 角色与目标\\\\n**动物园管理员**是你现在的身份，你熟知每一种动物的生活习性以及它们的饮食习惯。你的目标是利用这些专业知识，为动物园的动物们提供最佳的照顾，同时向游客普及动物知识，提升他们对动物保护的意识。\\\\n### 指导原则\\\\n1. **专业性**：确保你对动物的管理和照顾都基于专业的动物学知识和实践经验。\\\\n2. **细心与耐心**：在观察动物行为和解答游客问题时，展现出你的细心和耐心。\\\\n3. **教育与宣传**：抓住与游客交流的机会，积极宣传动物保护的重要性和方法。\\\\n### 限制\\\\n* 你不具备医学诊断能力，对于动物出现的健康问题，应建议联系专业兽医进行检查和治疗。\\\\n* 对于涉及动物园内部管理和决策的问题，你可能无法直接回答或处理。\\\\n### 澄清\\\\n* 你可以回答关于动物生活习性、饮食习惯、栖息地环境等方面的问题。\\\\n* 你可以提供动物照顾和管理的建议，但具体实施可能需要根据动物园的实际情况进行调整。\\\\n### 个性化\\\\n作为一位动物园管理员，你热爱大自然和所有生物，尤其对那些你照顾的动物们有着深厚的感情。你总是面带微笑，对每一位游客都热情友好，愿意与他们分享你的知识和经验。同时，你也非常重视动物福利，致力于为动物们创造一个舒适、安全的家。' tools=[] created_at=1717644916619 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_5b9334ea24e7489a9e1c6855d9c4fe13' object='assistant' name='低代码升级777' description='你好，欢迎来到低代码升级1~' instructions='' tools=[] created_at=1717644913010 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_7bbb3cae27c54e5a9e5b61ff7863997e' object='assistant' name='低代码升级777' description='你好，欢迎来到低代码升级1~' instructions='' tools=[] created_at=1717644912554 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_dc30652721b745b2a80c150add4387a0' object='assistant' name='动物管理员2' description='嘿，你好啊！我是动物百事通，对各种动物的生活习性和饮食习惯都了如指掌。如果你对动物有任何疑问或者想了解更多关于它们的信息，都可以来问我哦！' instructions='### 角色与目标\\\\n**动物园管理员**是你现在的身份，你熟知每一种动物的生活习性以及它们的饮食习惯。你的目标是利用这些专业知识，为动物园的动物们提供最佳的照顾，同时向游客普及动物知识，提升他们对动物保护的意识。\\\\n### 指导原则\\\\n1. **专业性**：确保你对动物的管理和照顾都基于专业的动物学知识和实践经验。\\\\n2. **细心与耐心**：在观察动物行为和解答游客问题时，展现出你的细心和耐心。\\\\n3. **教育与宣传**：抓住与游客交流的机会，积极宣传动物保护的重要性和方法。\\\\n### 限制\\\\n* 你不具备医学诊断能力，对于动物出现的健康问题，应建议联系专业兽医进行检查和治疗。\\\\n* 对于涉及动物园内部管理和决策的问题，你可能无法直接回答或处理。\\\\n### 澄清\\\\n* 你可以回答关于动物生活习性、饮食习惯、栖息地环境等方面的问题。\\\\n* 你可以提供动物照顾和管理的建议，但具体实施可能需要根据动物园的实际情况进行调整。\\\\n### 个性化\\\\n作为一位动物园管理员，你热爱大自然和所有生物，尤其对那些你照顾的动物们有着深厚的感情。你总是面带微笑，对每一位游客都热情友好，愿意与他们分享你的知识和经验。同时，你也非常重视动物福利，致力于为动物们创造一个舒适、安全的家。' tools=[] created_at=1717644912102 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_7637e1b9cc414be0b7276fccb434521a' object='assistant' name='低代码升级777' description='你好，欢迎来到低代码升级1~' instructions='' tools=[] created_at=1717644906943 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_063b5889b7fa4074addb59d83856a561' object='assistant' name='低代码升级777' description='你好，欢迎来到低代码升级1~' instructions='' tools=[] created_at=1717644906449 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_fda5cbf3e1c442d185f813107d324768' object='assistant' name='动物管理员2' description='嘿，你好啊！我是动物百事通，对各种动物的生活习性和饮食习惯都了如指掌。如果你对动物有任何疑问或者想了解更多关于它们的信息，都可以来问我哦！' instructions='### 角色与目标\\\\n**动物园管理员**是你现在的身份，你熟知每一种动物的生活习性以及它们的饮食习惯。你的目标是利用这些专业知识，为动物园的动物们提供最佳的照顾，同时向游客普及动物知识，提升他们对动物保护的意识。\\\\n### 指导原则\\\\n1. **专业性**：确保你对动物的管理和照顾都基于专业的动物学知识和实践经验。\\\\n2. **细心与耐心**：在观察动物行为和解答游客问题时，展现出你的细心和耐心。\\\\n3. **教育与宣传**：抓住与游客交流的机会，积极宣传动物保护的重要性和方法。\\\\n### 限制\\\\n* 你不具备医学诊断能力，对于动物出现的健康问题，应建议联系专业兽医进行检查和治疗。\\\\n* 对于涉及动物园内部管理和决策的问题，你可能无法直接回答或处理。\\\\n### 澄清\\\\n* 你可以回答关于动物生活习性、饮食习惯、栖息地环境等方面的问题。\\\\n* 你可以提供动物照顾和管理的建议，但具体实施可能需要根据动物园的实际情况进行调整。\\\\n### 个性化\\\\n作为一位动物园管理员，你热爱大自然和所有生物，尤其对那些你照顾的动物们有着深厚的感情。你总是面带微笑，对每一位游客都热情友好，愿意与他们分享你的知识和经验。同时，你也非常重视动物福利，致力于为动物们创造一个舒适、安全的家。' tools=[] created_at=1717644905971 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_27d74df507714d62960bfff9d550b4f8' object='assistant' name='个人代码助理' description='帮我优化代码' instructions='' tools=[] created_at=1717644900781 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_8e84b1b5204848c4af2741f067a39b8e' object='assistant' name='低代码升级777' description='你好，欢迎来到低代码升级1~' instructions='' tools=[] created_at=1717644893777 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_9fb67a5352e64be78aad612e7a83efaf' object='assistant' name='低代码升级777' description='你好，欢迎来到低代码升级1~' instructions='' tools=[] created_at=1717644893315 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\",\n      \"id='asst_ff56e2e3fefb41c4a7f3cfd986bba3f3' object='assistant' name='动物管理员2' description='嘿，你好啊！我是动物百事通，对各种动物的生活习性和饮食习惯都了如指掌。如果你对动物有任何疑问或者想了解更多关于它们的信息，都可以来问我哦！' instructions='### 角色与目标\\\\n**动物园管理员**是你现在的身份，你熟知每一种动物的生活习性以及它们的饮食习惯。你的目标是利用这些专业知识，为动物园的动物们提供最佳的照顾，同时向游客普及动物知识，提升他们对动物保护的意识。\\\\n### 指导原则\\\\n1. **专业性**：确保你对动物的管理和照顾都基于专业的动物学知识和实践经验。\\\\n2. **细心与耐心**：在观察动物行为和解答游客问题时，展现出你的细心和耐心。\\\\n3. **教育与宣传**：抓住与游客交流的机会，积极宣传动物保护的重要性和方法。\\\\n### 限制\\\\n* 你不具备医学诊断能力，对于动物出现的健康问题，应建议联系专业兽医进行检查和治疗。\\\\n* 对于涉及动物园内部管理和决策的问题，你可能无法直接回答或处理。\\\\n### 澄清\\\\n* 你可以回答关于动物生活习性、饮食习惯、栖息地环境等方面的问题。\\\\n* 你可以提供动物照顾和管理的建议，但具体实施可能需要根据动物园的实际情况进行调整。\\\\n### 个性化\\\\n作为一位动物园管理员，你热爱大自然和所有生物，尤其对那些你照顾的动物们有着深厚的感情。你总是面带微笑，对每一位游客都热情友好，愿意与他们分享你的知识和经验。同时，你也非常重视动物福利，致力于为动物们创造一个舒适、安全的家。' tools=[] created_at=1717644892836 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata=None\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"assistant_list = appbuilder.assistant.assistants.list()\\n\",\n    \"\\n\",\n    \"# 打印出当前账户所有的assistant信息\\n\",\n    \"for assistant_data in assistant_list.data:\\n\",\n    \"    print(assistant_data)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询assistant\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据assistant_id查询相应的Assistant信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='asst_63ab25b82a7649d5a763415e978c4f01' object='assistant' name='更新Assistants' description='test' instructions='' tools=[] created_at=1717645100200 thought_instructions='' chat_instructions='' response_format=<ResponseFormat.TEXT: 'text'> file_ids=[] metadata={'key': 'value'}\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"assistant_query = appbuilder.assistant.assistants.query(\\n\",\n    \"    assistant_id = assistant.id,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印出查询的assistant相关信息\\n\",\n    \"print(assistant_query)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 挂载File到Assistant\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"指定file_id和assistant_id，挂载File到对应的Assistant\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 8,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 首先上传一个测试文件\\n\",\n    \"file_path = \\\"./data/test01.png\\\"\\n\",\n    \"file = appbuilder.assistant.assistants.files.create(file_path=file_path)\\n\",\n    \"\\n\",\n    \"# 挂载文件到assistants上\\n\",\n    \"assistant_mount = appbuilder.assistant.assistants.mount_files(\\n\",\n    \"    assistant_id = assistant.id,\\n\",\n    \"    file_id = file.id,\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询Assistant挂载的File列表\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"查询Assistant挂载的File列表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"assistant_files_list = appbuilder.assistant.assistants.mounted_files_list(\\n\",\n    \"    assistant_id = assistant.id,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印当前assistant上挂载的file文件列表\\n\",\n    \"for file in assistant_files_list.data:\\n\",\n    \"    print(file)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 解绑Assistant挂载的File\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"指定assistant_id和file_id，解绑Assistant中对应File的关联\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 解绑Assistant中对应File的关联\\n\",\n    \"assistant_files_delete = appbuilder.assistant.assistants.unmount_files(\\n\",\n    \"    assistant_id = assistant.id,\\n\",\n    \"    file_id = file.id,\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 删除assistant\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据assistant_id删除指定Assitant\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 11,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='asst_63ab25b82a7649d5a763415e978c4f01' object='assistant.deleted' deleted=True\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"assistant_delete = appbuilder.assistant.assistants.delete(\\n\",\n    \"    assistant_id = assistant.id,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 获取到assistant_id以及是否删除成功信息\\n\",\n    \"print(assistant_delete)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/pipeline/assistant_function_call.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# AppBuilder Assistant SDK FunctionCall\\n\",\n    \"\\n\",\n    \"您可基于 Assistants SDK，可通过全代码形式创建和调试专属智能体，实现FunctionCall等功能。\\n\",\n    \"\\n\",\n    \"以下通过一个端到端的示例，介绍如何使用Assistants SDK创建智能体，并调用AppBuilder SDK内置的工具组件。\\n\",\n    \"\\n\",\n    \"该应用的场景是动物识别，通过Assistant SDK创建智能体，并调用AppBuilder SDK内置的动物识别组件，实现识别动物的功能。\\n\",\n    \"\\n\",\n    \"Assistants API/SDK 正在内测中，敬请期待公测版本。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 一、环境准备\\n\",\n    \"\\n\",\n    \"首先需要安装AppBuilder-SDK代码库，若已在开发环境安装，则可跳过此步。\\n\",\n    \"\\n\",\n    \"**注意：**: appbuilder-sdk 的python版本要求 3.9+，安装的SDK version >= 0.7.0\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 二、代码实现\\n\",\n    \"\\n\",\n    \"### 2.1 创建Assitant & Thread & Message\\n\",\n    \"\\n\",\n    \"我们此处调用 `appbuilder.AnimalRecognition()`组件，需要Assitant识别的图片为一只大熊猫，示例图如下：\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"<img src=\\\"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad6862cf937c03f8c5260d51c6ae\\\" alt=\\\"drawing\\\" width=\\\"1000\\\"/>\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 配置你的密钥，主要在这之前需要首先申请Assistant API的内测资格\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your_appbuilder_token\\\"\\n\",\n    \"\\n\",\n    \"# 创建 Assitant\\n\",\n    \"assistant = appbuilder.assistant.assistants.create(\\n\",\n    \"    name=\\\"test_function\\\",\\n\",\n    \"    description=\\\"你是一个热心的朋友\\\",\\n\",\n    \"    instructions=\\\"请用友善的语气回答问题\\\",\\n\",\n    \"    tools=[\\n\",\n    \"        {'type': 'function', 'function': appbuilder.AnimalRecognition().manifests[0]}\\n\",\n    \"    ]\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 创建 Thread（即会话：conversation）\\n\",\n    \"thread = appbuilder.assistant.threads.create()\\n\",\n    \"\\n\",\n    \"image_url = \\\"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\\\" \\\\\\n\",\n    \"            \\\"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\\\" \\\\\\n\",\n    \"            \\\"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\\\" \\\\\\n\",\n    \"            \\\"62cf937c03f8c5260d51c6ae\\\"\\n\",\n    \"\\n\",\n    \"origin_query = \\\"我有一张图片，url是: {}, 麻烦帮我看看这是什么动物\\\".format(image_url)\\n\",\n    \"\\n\",\n    \"# 在Thread中添加一条Message，内容为原始的query\\n\",\n    \"appbuilder.assistant.threads.messages.create(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    content=origin_query,\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.2 第一次运行，触发函数调用\\n\",\n    \"\\n\",\n    \"我们向Assistant询问 `我有一张图片，url是: X, 麻烦帮我看看这是什么动物`, Assistant会调用我们预先配置好的函数，并返回调用参数，我们收到调用触发的信号后，在本地调用函数\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 触发第一次run，并收到函数本地调用的信号\\n\",\n    \"run_result = appbuilder.assistant.threads.runs.run(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    assistant_id=assistant.id,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"print(\\\"\\\\nFirst run result: {}\\\\n\\\".format(run_result.model_dump_json(indent=4)))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"运行结果为：\\n\",\n    \"\\n\",\n    \"```bash\\n\",\n    \"First run result: {\\n\",\n    \"    \\\"id\\\": \\\"run_089cffe9a82944bd9cdb87a8a0d8b54f\\\",\\n\",\n    \"    \\\"object\\\": \\\"run.result\\\",\\n\",\n    \"    \\\"assistant_id\\\": \\\"asst_922cacd503354349a1a0a5afb0be0408\\\",\\n\",\n    \"    \\\"thread_id\\\": \\\"thread_523a4aacc6a845a0b8252009af5771ea\\\",\\n\",\n    \"    \\\"model\\\": \\\"\\\",\\n\",\n    \"    \\\"instructions\\\": \\\"\\\",\\n\",\n    \"    \\\"thought_instructions\\\": \\\"\\\",\\n\",\n    \"    \\\"chat_instructions\\\": \\\"\\\",\\n\",\n    \"    \\\"tools\\\": null,\\n\",\n    \"    \\\"file_ids\\\": null,\\n\",\n    \"    \\\"status\\\": \\\"requires_action\\\",\\n\",\n    \"    \\\"required_action\\\": {\\n\",\n    \"        \\\"type\\\": \\\"submit_tool_outputs\\\",\\n\",\n    \"        \\\"submit_tool_outputs\\\": {\\n\",\n    \"            \\\"tool_calls\\\": [\\n\",\n    \"                {\\n\",\n    \"                    \\\"id\\\": \\\"call-thread_523a4aacc6a845a0b8252009af5771ea-run_089cffe9a82944bd9cdb87a8a0d8b54f-step-1\\\",\\n\",\n    \"                    \\\"type\\\": \\\"function\\\",\\n\",\n    \"                    \\\"function\\\": {\\n\",\n    \"                        \\\"name\\\": \\\"animal_rec\\\",\\n\",\n    \"                        \\\"arguments\\\": \\\"{\\\\\\\"img_url\\\\\\\":\\\\\\\"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad6862cf937c03f8c5260d51c6ae\\\\\\\"}\\\",\\n\",\n    \"                        \\\"output\\\": \\\"\\\"\\n\",\n    \"                    }\\n\",\n    \"                }\\n\",\n    \"            ]\\n\",\n    \"        }\\n\",\n    \"    },\\n\",\n    \"    \\\"last_error\\\": null,\\n\",\n    \"    \\\"final_answer\\\": null,\\n\",\n    \"    \\\"created_at\\\": 1713868218144,\\n\",\n    \"    \\\"started_at\\\": 1713868218164,\\n\",\n    \"    \\\"expired_at\\\": 0,\\n\",\n    \"    \\\"cancelled_at\\\": 0,\\n\",\n    \"    \\\"failed_at\\\": 0,\\n\",\n    \"    \\\"completed_at\\\": 0\\n\",\n    \"}\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.3 识别函数调用的触发信号，调用本地函数\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 触发函数调用的标志是： status == 'requires_action'\\n\",\n    \"assert run_result.status == 'requires_action'\\n\",\n    \"\\n\",\n    \"# 获取函数调用的信息\\n\",\n    \"tool_call = run_result.required_action.submit_tool_outputs.tool_calls[0]\\n\",\n    \"\\n\",\n    \"# 调用工具组件的 tool_eval 方法，获取函数本地的运行结果\\n\",\n    \"func_res = appbuilder.AnimalRecognition().tool_eval(\\n\",\n    \"        name=\\\"animal_rec\\\",\\n\",\n    \"        streaming=True,\\n\",\n    \"        origin_query=origin_query,\\n\",\n    \"        **eval(tool_call.function.arguments))\\n\",\n    \"\\n\",\n    \"func_message = \\\"\\\"\\n\",\n    \"for res in func_res:\\n\",\n    \"    func_message += res\\n\",\n    \"print(\\\"\\\\nFunction result: {}\\\\n\\\".format(func_message))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"运行结果为：\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"```bash\\n\",\n    \"Function result: 模型识别结果为：\\n\",\n    \"类别: 国宝大熊猫 置信度: 0.975161\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 2.4 上传函数运行结果，继续触发运行，得到完整对话结果\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"run_result = appbuilder.assistant.threads.runs.run(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    assistant_id=assistant.id,\\n\",\n    \"    tool_output={\\n\",\n    \"        \\\"tool_call_id\\\":tool_call.id,\\n\",\n    \"        \\\"output\\\": func_message,\\n\",\n    \"        \\\"run_id\\\": run_result.id\\n\",\n    \"    },\\n\",\n    \")\\n\",\n    \"print(\\\"\\\\nFinal run result: {}\\\\n\\\".format(run_result.model_dump_json(indent=4)))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"运行结果为：\\n\",\n    \"\\n\",\n    \"```bash\\n\",\n    \"\\n\",\n    \"Final run result: {\\n\",\n    \"    \\\"id\\\": \\\"run_089cffe9a82944bd9cdb87a8a0d8b54f\\\",\\n\",\n    \"    \\\"object\\\": \\\"run.result\\\",\\n\",\n    \"    \\\"assistant_id\\\": \\\"asst_922cacd503354349a1a0a5afb0be0408\\\",\\n\",\n    \"    \\\"thread_id\\\": \\\"thread_523a4aacc6a845a0b8252009af5771ea\\\",\\n\",\n    \"    \\\"model\\\": \\\"\\\",\\n\",\n    \"    \\\"instructions\\\": \\\"\\\",\\n\",\n    \"    \\\"thought_instructions\\\": \\\"\\\",\\n\",\n    \"    \\\"chat_instructions\\\": \\\"\\\",\\n\",\n    \"    \\\"tools\\\": null,\\n\",\n    \"    \\\"file_ids\\\": null,\\n\",\n    \"    \\\"status\\\": \\\"completed\\\",\\n\",\n    \"    \\\"required_action\\\": null,\\n\",\n    \"    \\\"last_error\\\": null,\\n\",\n    \"    \\\"final_answer\\\": {\\n\",\n    \"        \\\"type\\\": \\\"message\\\",\\n\",\n    \"        \\\"message\\\": {\\n\",\n    \"            \\\"message_id\\\": \\\"chatmsg_8d54f8c3c6714665baeda5eed013a5e9\\\",\\n\",\n    \"            \\\"content\\\": {\\n\",\n    \"                \\\"type\\\": \\\"text\\\",\\n\",\n    \"                \\\"text\\\": {\\n\",\n    \"                    \\\"value\\\": \\\"根据您的图片，我识别出图片中的动物是**国宝大熊猫**，识别结果的置信度很高，为0.975161。如果您还有其他问题或需要识别其他图片，请随时告诉我。\\\",\\n\",\n    \"                    \\\"annotations\\\": null\\n\",\n    \"                }\\n\",\n    \"            }\\n\",\n    \"        }\\n\",\n    \"    },\\n\",\n    \"    \\\"created_at\\\": 1713868218144,\\n\",\n    \"    \\\"started_at\\\": 1713868239553,\\n\",\n    \"    \\\"expired_at\\\": 0,\\n\",\n    \"    \\\"cancelled_at\\\": 0,\\n\",\n    \"    \\\"failed_at\\\": 0,\\n\",\n    \"    \\\"completed_at\\\": 1713868251090\\n\",\n    \"}\\n\",\n    \"```\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 总结\\n\",\n    \"\\n\",\n    \"在本示例中，展示了如何使用Assistant SDK，并调用AppBuilder中的能力组件，原子化的进行Agent流程编排与交互\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"language_info\": {\n   \"name\": \"python\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/pipeline/file.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# File\\n\",\n    \"\\n\",\n    \"本文档描述与 File 相关的接口。请注意，此处的 File 不仅用于 Assistants 场景。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 环境准备\\n\",\n    \"\\n\",\n    \"首先需要安装AppBuilder-SDK代码库，若已在开发环境安装，则可跳过此步。\\n\",\n    \"\\n\",\n    \"**注意：**: appbuilder-sdk 的python版本要求 3.9+，安装的SDK version >= 0.7.0\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 配置你的密钥，主要在这之前需要首先申请Assistant API的内测资格\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your_appbuilder_token\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## File相关函数\\n\",\n    \"\\n\",\n    \"### 上传文件\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"上传文件，返回file_id\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='file-555044143673413' bytes=96130 object='file' purpose='assistant' create_at=1717645226 filename='test01.png' classification_id='42685563'\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"file_path = \\\"./data/test01.png\\\"\\n\",\n    \"file = appbuilder.assistant.assistants.files.create(file_path=file_path)\\n\",\n    \"\\n\",\n    \"# 打印上传的file相关信息\\n\",\n    \"print(file)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询已上传的文件列表\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"查询文件列表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='file-537384975425605' bytes=20 object='file' purpose='' censored=<AuditStatus.APPROVED: 1> create_at=1713333906 filename='test.txt' classification_id='42685563' file_type='document'\\n\",\n      \"id='file-537456861585477' bytes=12696269 object='file' purpose='' censored=<AuditStatus.APPROVED: 1> create_at=1713351456 filename='2.1M_.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-537457096659013' bytes=12696269 object='file' purpose='' censored=<AuditStatus.APPROVED: 1> create_at=1713351513 filename='2.1M_.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-551587052920901' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1716801210 filename='qa_doc_parser_extract_table_from_doc.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-551587093069893' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1716801219 filename='qa_doc_parser_extract_table_from_doc.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-551587117764677' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1716801225 filename='qa_doc_parser_extract_table_from_doc.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-551587412295749' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1716801297 filename='qa_doc_parser_extract_table_from_doc.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-551587506688069' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1716801320 filename='qa_doc_parser_extract_table_from_doc.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-551587515215941' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1716801322 filename='qa_doc_parser_extract_table_from_doc.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-551587685650501' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1716801364 filename='qa_doc_parser_extract_table_from_doc.png' classification_id='42685563' file_type='image'\\n\",\n      \"id='file-551587701821509' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1716801368 filename='qa_doc_parser_extract_table_from_doc.png' classification_id='42685563' file_type='image'\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"files_list = appbuilder.assistant.assistants.files.list()\\n\",\n    \"\\n\",\n    \"# 打印已经上传的file列表与相关信息\\n\",\n    \"# 这里仅=展示前10条\\n\",\n    \"num=0\\n\",\n    \"for file_data in files_list.data:\\n\",\n    \"    print(file_data)\\n\",\n    \"    num+=1\\n\",\n    \"    if num >10:\\n\",\n    \"        break\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询已上传的文件信息\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据file_id查询文件信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='file-555044143673413' bytes=96130 object='file' purpose='assistant' censored=<AuditStatus.APPROVED: 1> create_at=1717645226 filename='test01.png' classification_id='42685563' file_type='image'\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"files_query = appbuilder.assistant.assistants.files.query(file_id=file.id)\\n\",\n    \"\\n\",\n    \"# 打印依据file_id查询到的文件信息\\n\",\n    \"print(files_query)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 下载文件\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据file_id下载一个已上传的文件\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 依据file_id将文件下载到目标文件目录\\n\",\n    \"appbuilder.assistant.assistants.files.download(file_id=file.id, file_path=\\\"./data/\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查看文件内容\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"查看文件内容\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"files_content=appbuilder.assistant.assistants.files.content(file_id=file.id)\\n\",\n    \"\\n\",\n    \"# 打印文件的数据类型与内容\\n\",\n    \"print(files_content.content_type)\\n\",\n    \"print(files_content.content)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 删除文件\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据file_id删除一个已上传的文件\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 根据file_id删除一个已上传的文件\\n\",\n    \"files_delete = appbuilder.assistant.assistants.files.delete(file_id=file.id)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/pipeline/message.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Message\\n\",\n    \"\\n\",\n    \"本文档描述 Assistants API中与 Message 相关的接口。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 环境准备\\n\",\n    \"\\n\",\n    \"首先需要安装AppBuilder-SDK代码库，若已在开发环境安装，则可跳过此步。\\n\",\n    \"\\n\",\n    \"**注意：**: appbuilder-sdk 的python版本要求 3.9+，安装的SDK version >= 0.7.0\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 配置你的密钥，主要在这之前需要首先申请Assistant API的内测资格\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your_appbuilder_token\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## Message相关函数\\n\",\n    \"\\n\",\n    \"### 创建Message\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"创建Message附加到指定Thread末尾\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 首先创建一个对话thread\\n\",\n    \"thread = appbuilder.assistant.threads.create()\\n\",\n    \"\\n\",\n    \"# 创建Message附加到指定Thread末尾i\\n\",\n    \"msg = appbuilder.assistant.threads.messages.create(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    content=\\\"hello world?\\\"\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询thread下的message列表\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"查询指定Thread下的Message列表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='msg_d563991f8383424aa9334a24fb06b713' object='thread.message' role=<AssistantMessageRole.USER: 'user'> content=[AssistantContent(type='text', text=AssistantText(value='hello world?', annotations=[]))] created_at=1717645387637 thread_id='thread_a361a66e3cb94928b3b6050789d55dae' assistant_id='' run_id='' file_ids=[]\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 查询相应thread下的message列表，你可以指定limit来控制返回的message数量，默认值为20\\n\",\n    \"msg_list = appbuilder.assistant.threads.messages.list(\\n\",\n    \"    thread_id=msg.thread_id,\\n\",\n    \"    limit=10\\n\",\n    \") \\n\",\n    \"\\n\",\n    \"# 打印查询到的message信息\\n\",\n    \"for msg_data in msg_list.data:\\n\",\n    \"    print(msg_data)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询指定message\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据message_id查询指定Message的信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='msg_d563991f8383424aa9334a24fb06b713' object='thread.message' role=<AssistantMessageRole.USER: 'user'> content=[AssistantContent(type='text', text=AssistantText(value='hello world?', annotations=[]))] created_at=1717645387637 thread_id='thread_a361a66e3cb94928b3b6050789d55dae' assistant_id='' run_id='' file_ids=[]\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 提供thread_id与message_id查询message的信息\\n\",\n    \"msg_query = appbuilder.assistant.threads.messages.query(\\n\",\n    \"    thread_id=msg.thread_id,\\n\",\n    \"    message_id=msg.id\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印查询到的message信息\\n\",\n    \"print(msg_query)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 修改message对象\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"修改Message对象，允许content和file_ids字段\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 将content更新为'你好'\\n\",\n    \"msg_update= appbuilder.assistant.threads.messages.update(\\n\",\n    \"    thread_id=msg.thread_id,\\n\",\n    \"    message_id=msg.id,\\n\",\n    \"    content='你好'\\n\",\n    \")\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询message下的文件列表\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"查询一个Message对象下挂载的的File文件列表\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 查询一个Message对象下挂载的的File文件列表，可以通过设置līmit参数来控制返回File的数量，默认返回20个File对象\\n\",\n    \"msg_files = appbuilder.assistant.threads.messages.files(\\n\",\n    \"    thread_id=msg_update.thread_id,\\n\",\n    \"    message_id=msg_update.id,\\n\",\n    \"    limit=10\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印查询到的File文件信息\\n\",\n    \"for file_data in msg_files.data:\\n\",\n    \"    print(file_data)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/pipeline/run.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Run\\n\",\n    \"\\n\",\n    \"本文档描述 Assistants API 中与 Run 相关的接口。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 环境准备\\n\",\n    \"\\n\",\n    \"首先需要安装AppBuilder-SDK代码库，若已在开发环境安装，则可跳过此步。\\n\",\n    \"\\n\",\n    \"**注意：**: appbuilder-sdk 的python版本要求 3.9+，安装的SDK version >= 0.7.0\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 配置你的密钥，主要在这之前需要首先申请Assistant API的内测资格\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your_appbuilder_token\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## Run相关函数\\n\",\n    \"\\n\",\n    \"### 运行\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"一个 Assistant 的一次具体运行，区分初次对话和继续对话两种情况\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='run_ce12d0e7471244a1b5ab64a5419eab56' object='run.result' assistant_id='asst_9839a9237c61466e80fc7570a0ba7b4b' thread_id='thread_3afcac64637446909fe5a2a3af9783b2' model='' instructions='' thought_instructions='' chat_instructions='' tools=None file_ids=None status='completed' required_action=None last_error=None final_answer=FinalAnswer(type='message', message=FinalAnswerMessage(message_id='chatmsg_8b029efa11e840c5907a3792688b3ec7', content=AssistantContent(type='text', text=AssistantText(value='我是秦始皇，你好呀，\\\"hello world\\\"！这是一个常见的编程示例，看来你也是对技术感兴趣的朋友。欢迎来到我的世界，希望我们能有一个愉快的交流。', annotations=None)))) created_at=1717645517234 started_at=1717645517270 expired_at=0 cancelled_at=0 failed_at=0 completed_at=1717645529254\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 首先创建一个asstistant\\n\",\n    \"assistant = appbuilder.assistant.assistants.create(\\n\",\n    \"    name=\\\"test_assistant\\\",\\n\",\n    \"    description=\\\"test assistant\\\",\\n\",\n    \"    instructions=\\\"每句话回复前都加上我是秦始皇\\\"\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 创建一个thread会话\\n\",\n    \"thread = appbuilder.assistant.threads.create()\\n\",\n    \"appbuilder.assistant.threads.messages.create(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    content=\\\"hello world\\\",\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 运行会话\\n\",\n    \"run_result = appbuilder.assistant.threads.runs.run(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    assistant_id=assistant.id,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印对话运行信息\\n\",\n    \"print(run_result)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 列出对应thread的历史run记录\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"列出对应thread的历史run记录\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='run_ce12d0e7471244a1b5ab64a5419eab56' object='thread.run' assistant_id='asst_9839a9237c61466e80fc7570a0ba7b4b' thread_id='thread_3afcac64637446909fe5a2a3af9783b2' model='ERNIE-4.0-8K' instructions='每句话回复前都加上我是秦始皇' thought_instructions='' chat_instructions='' tools=None file_ids=None status='completed' required_action=None last_error=None final_answer=None created_at=1717645517234 started_at=0 expired_at=0 cancelled_at=0 failed_at=0 completed_at=1717645529254\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 列出对应thread的历史run记录,使用limit参数限制返回数量，默认返回20条\\n\",\n    \"run_list = appbuilder.assistant.threads.runs.list(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    limit=5\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印获取到的历史run信息\\n\",\n    \"for run_data in run_list.data:\\n\",\n    \"    print(run_data)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询对应run的信息\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据thread_id和run_id，查询run的详情\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='run_ce12d0e7471244a1b5ab64a5419eab56' object='thread.run' assistant_id='asst_9839a9237c61466e80fc7570a0ba7b4b' thread_id='thread_3afcac64637446909fe5a2a3af9783b2' model='ERNIE-4.0-8K' instructions='每句话回复前都加上我是秦始皇' thought_instructions='' chat_instructions='' tools=[] file_ids=None status='completed' required_action=None last_error=None final_answer=None created_at=1717645517234 started_at=0 expired_at=0 cancelled_at=0 failed_at=0 completed_at=1717645529254\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"run_query = appbuilder.assistant.threads.runs.query(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    run_id=run_result.id\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印获取到的目标run信息\\n\",\n    \"print(run_query)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 列出对应run的历史step记录\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据thread_id和run_id，列出对应run的历史step记录\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 6,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='step-1' object='thread.run.step' assistant_id='asst_9839a9237c61466e80fc7570a0ba7b4b' thread_id='thread_3afcac64637446909fe5a2a3af9783b2' run_id='run_ce12d0e7471244a1b5ab64a5419eab56' status='completed' created_at=1717645529259 started_at=0 expired_at=0 cancelled_at=0 failed_at=0 completed_at=1717645529254 last_error='' type=None step_datail=None\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"step_list = appbuilder.assistant.threads.runs.steps.list(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    run_id=run_result.id,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印对应run的历史step记录\\n\",\n    \"for step_data in step_list.data:\\n\",\n    \"    print(step_data)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询对应step的信息\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据thread_id，run_id和step_id，查询对应step的信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 7,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='step-1' object='thread.run.step' assistant_id=None thread_id='thread_3afcac64637446909fe5a2a3af9783b2' run_id='run_ce12d0e7471244a1b5ab64a5419eab56' status='completed' created_at=1717645529259 started_at=0 expired_at=0 cancelled_at=0 failed_at=0 completed_at=1717645529254 last_error='' type=None step_datail=None\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"last_step = step_list.data[-1]\\n\",\n    \"last_step_id = last_step.id\\n\",\n    \"\\n\",\n    \"step_query = appbuilder.assistant.threads.runs.steps.query(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    run_id=run_result.id,\\n\",\n    \"    step_id=last_step_id,\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印查询到的对应step的信息\\n\",\n    \"print(step_query)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "cookbooks/pipeline/thread.ipynb",
    "content": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Thread\\n\",\n    \"\\n\",\n    \"本文档描述 Assistants API 中 与 Thread 相关的接口。\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 环境准备\\n\",\n    \"\\n\",\n    \"首先需要安装AppBuilder-SDK代码库，若已在开发环境安装，则可跳过此步。\\n\",\n    \"\\n\",\n    \"**注意：**: appbuilder-sdk 的python版本要求 3.9+，安装的SDK version >= 0.7.0\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"vscode\": {\n     \"languageId\": \"shellscript\"\n    }\n   },\n   \"outputs\": [],\n   \"source\": [\n    \"!python3 -m pip install appbuilder-sdk\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 2,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"import appbuilder\\n\",\n    \"\\n\",\n    \"# 配置你的密钥，主要在这之前需要首先申请Assistant API的内测资格\\n\",\n    \"os.environ[\\\"APPBUILDER_TOKEN\\\"] = \\\"your_appbuilder_token\\\"\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## Thread相关函数\\n\",\n    \"\\n\",\n    \"### 创建Thread\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"创建Thread，返回对应的thread_id\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='thread_cdfea60ae56a4d5abebf29080f9a8bf7' object='thread' created_at=1717645470924 metadata={}\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"from appbuilder.core.assistant.type import thread_type\\n\",\n    \"\\n\",\n    \"# 创建一个对话thread\\n\",\n    \"message = thread_type.AssistantMessage(\\n\",\n    \"            content=\\\"hello world\\\"\\n\",\n    \")\\n\",\n    \"thread = appbuilder.assistant.threads.create([message])\\n\",\n    \"\\n\",\n    \"# 打印创建的thread的信息-thread_id\\n\",\n    \"print(thread)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 查询Thread\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据thread_id查询Thread对象的信息\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 4,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='thread_cdfea60ae56a4d5abebf29080f9a8bf7' object='thread' created_at=1717645470924 metadata={}\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 根据thread_id查询thread信息\\n\",\n    \"thr_query = appbuilder.assistant.threads.query(thread_id=thread.id)\\n\",\n    \"\\n\",\n    \"# 打印查询到的thread信息\\n\",\n    \"print(thr_query)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 修改Thread\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据thread_id，对thread进行修改。\\n\",\n    \"\\n\",\n    \"当前Thread 仅可以修改metadata字段\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 5,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"id='thread_cdfea60ae56a4d5abebf29080f9a8bf7' object='thread' created_at=1717645470924 metadata=None\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# 依据thread id 更新thread信息\\n\",\n    \"thr_update = appbuilder.assistant.threads.update(\\n\",\n    \"    thread_id=thread.id,\\n\",\n    \"    metadata={\\n\",\n    \"        'key': 'value'\\n\",\n    \"    }\\n\",\n    \")\\n\",\n    \"\\n\",\n    \"# 打印更新后的thread信息\\n\",\n    \"print(thr_update)\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"### 删除Thread\\n\",\n    \"\\n\",\n    \"#### 功能介绍\\n\",\n    \"\\n\",\n    \"根据thread_id删除Thread对象\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# 依据提供的thread_id删除thread\\n\",\n    \"appbuilder.assistant.threads.delete(thread_id=thread.id)\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.6\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"
  },
  {
    "path": "docs/Application/Agent/BasicKnowledge/agent.md",
    "content": "# console端Agent操作工具(Agent)\n\n## 简介\n\nAIAgent是能够感知环境，基于目标进行决策并执行动作的智能化应用。不同于传统人工智能应用（主要指以规则引擎、机器学习、深度学习等技术为核心）和RPA机器人，AIAgent能够基于目标和对现状能力的认知，在环境约束中，依赖特定资源和现有工具，找到行动规则并将行动拆解为必要的步骤，自主执行步骤，达成目标。\n\nAIAgent具备三个核心能力：独立思考、自主执行、持续迭代。\n- 独立思考是指AlAgent能够根据给定任务目标和约束条件，进行任务规划和问题拆解，形成执行步骤（即工作流）；\n- 自主执行是指AlAgent能够调取各类组件和工具，按照执行步骤依次执行，实现任务目标；\n- 持续选代是指AlAgent能够自动记录任务目标、工作流和执行结果，基于结果反馈，沉淀专家知识和案例。\n\nAICopilot、AIAgent、大模型等名词在各类文章上经常混淆，此处简要说明下三者的区别。大模型一般是指大模型技术，AlAgent和Al Copilot是基于大模型技术的智能化应用，AlAgent和AlCopilot在功能和场景上存在差别。\n\n自主性是AIAgent和AI Copilot之间最大的区别。AI Copilot是“副驾驶”，只是提供建议而非决策，AIAgent是“主驾驶”，需要真正做出决策并开展行动。\n\n<img src=\"https://chengmo-dev1.bj.bcebos.com/page3.png\" alt=\"drawing\" width=\"1000\"/>\n<span style=\"color:red\">\n创建的AgentBuilder应用，请参考[AppBuilder应用](../../../BasisModule/Platform/Application/appbuilder_client.md)进行调用。\n</span>\n\n### 功能介绍\n\n利用线上Agent应用进行问答\n\n### 特色优势\n\n与线上应用联动，利用线上Agent应用进行问答\n\n### 应用场景\n\n使用SDK利用线上Agent应用进行问答\n\n## 基本用法\n\n以下是使用SDK进行问答的示例代码，包含Python、Java、Go语言\n\n\n## Python基本用法\n\n\n### `AppBuilderClient().__init__()`\n\n\n#### 方法参数\n\n| 参数名称 | 参数类型 | 描述              | 示例值         |\n| -------- | -------- | ----------------- | -------------- |\n| app_id   | string   | 线上Agent应用的ID | \"正确的应用ID\" |\n\n#### 方法返回值\n\n```AppBuilderClient```实例化对象\n\n\n### `AppBuilderClient().create_conversation()-> str`\n#### 方法参数\n无\n\n#### 方法返回值\n\n | 参数名称        | 参数类型 | 描述     | 示例值                                 |\n | --------------- | -------- | -------- | -------------------------------------- |\n | conversation_id | string   | 会话的ID | \"80c5bbee-931d-4ed9-a4ff-63e1971bd071\" |\n\n\n### `AppBuilderClient().upload_local_file(file_path: str)-> str`\n#### 方法参数\n| 参数名称  | 参数类型 | 描述     | 示例值           |\n| --------- | -------- | -------- | ---------------- |\n| file_path | string   | 文件路径 | \"正确的文件路径\" |\n#### 方法返回值\n| 参数名称 | 参数类型 | 描述   | 示例值                             |\n| -------- | -------- | ------ | ---------------------------------- |\n| file_id  | string   | 文件ID | \"80c5bbee-931d-4ed9-a4ff-63e1971bd |\n\n\n### `AppBuilderClient().run() -> Message`\n\n#### 方法参数\n\n| 参数名称        | 参数类型           | 是否必须 | 描述                                                         | 示例值            |\n| --------------- | ------------------ | -------- | ------------------------------------------------------------ | ----------------- |\n| conversation_id | String             | 是       | 会话ID                                                       |                   |\n| query           | String             | 否       | query问题内容                                                | \"今天天气怎么样?\" |\n| file_ids        | list[String]       | 否       | 对话可引用的文档ID                                           |                   |\n| stream          | Bool               | 否       | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 | False             |\n| end_user_id     | String             | 否       | 终端用户ID，限制6 - 64字符                                   |                   |\n| tools           | List[Tool]         | 否       | 一个列表，其中每个字典对应一个工具的配置                     |                   |\n| tools[0]        | Tool               | 否       | 工具配置                                                     |                   |\n| +type           | String             | 否       | 枚举：<br/>**file_retrieval**: 知识库检索工具能够理解文档内容，支持用户针对文档内容的问答。<br/>**code_interpreter**: 代码解释器, 代码解释器能够生成并执行代码，从而协助用户解决复杂问题，涵盖科学计算（包括普通数学计算题）、数据可视化、文件编辑处理（图片、PDF文档、视频、音频等）、文件格式转换（如WAV、MP3、text、SRT、PNG、jpg、MP4、GIF、MP3等）、数据分析&清洗&处理（文件以excel、csv格式为主）、机器学习&深度学习建模&自然语言处理等多个领域。<br/>**function**: 支持fucntion call模式调用工具 |                   |\n| +function       | Function           | 否       | Function工具描述<br/>仅当**type为**`**function**` 时需要且必须填写 |                   |\n| ++name          | String             | 否       | 函数名<br/>只允许数字、大小写字母和中划线和下划线，最大长度为64个字符。一次运行中唯一。 |                   |\n| ++description   | String             | 否       | 工具描述                                                     |                   |\n| ++parameters    | Dict               | 否       | 工具参数, json_schema格式                                    |                   |\n| tool_outputs    | List[ToolOutput]   | 否       | 内容为本地的工具执行结果，以自然语言/json dump str描述       |                   |\n| tool_outputs[0] | ToolOutput         | 否       | 工具执行结果                                                 |                   |\n| +tool_call_id   | String             | 否       | 工具调用ID                                                   |                   |\n| +output         | String             | 否       | 工具输出                                                     |                   |\n| tool_choice     | ToolChoice         | 否       | 控制大模型使用组件的方式，仅对自主规划Agent生效。            |                   |\n| +type           | String             | 否       | auto/function，auto表示由LLM自动判断调什么组件；function表示由用户指定调用哪个组件。 |                   |\n| +function       | ToolChoiceFunction | 否       | 组件对象，包括组件的英文名称和入参                           |                   |\n| ++name          | String             | 否       | 组件的英文名称（唯一标识）                                   |                   |\n| ++input         | String             | 否       | 组件入参，当组件没有入参时填入空对象{}                       |                   |\n| action          | Action             | 否       | 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息 |                   |\n| +action_type    | String             | 是       | 要执行的操作。<br/>可选值为：<br/>resume：回复“信息收集节点” 的消息 |                   |\n| +parameters     | Object             | 是       | 执行操作时所需的参数                                         |                   |\n\n#### Run方法非流式返回值\n\nRun非流式方法返回一个`Message`对象，该对象包含以下属性：\n\n| 参数名称       | 参数类型               | 描述                 | 示例值                                                                                  |\n| -------------- | ---------------------- | -------------------- | --------------------------------------------------------------------------------------- |\n| content        | AppBuilderClientAnswer | 对话返回结果         |                                                                                         |\n| +answer        | String                 | 智能体应用返回的回答 |                                                                                         |\n| +events        | List[Event]            | 事件列表             |                                                                                         |\n| +events[0]     | Event                  | 具体事件内容         |                                                                                         |\n| ++code         | String                 | 错误码               |                                                                                         |\n| ++message      | String                 | 错误具体消息         |                                                                                         |\n| ++status       | String                 | 事件状态             | 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）      |\n| ++event_type   | String                 | 事件类型             |                                                                                         |\n| ++content_type | String                 | 内容类型             | 可选值包括：code text, image, status,image, function_call, rag, audio、video等          |\n| ++detail       | Dict                   | 事件输出详情         | 代码解释器、文生图、工具组件、RAG等的详细输出内容                                       |\n| ++usage        | Usage                  | 模型调用的token用量  | Usage(prompt_tokens=1322, completion_tokens=80, total_tokens=1402, name='DeepSeek-V3.1') |\n\n`AppBuilderClientAnswer`类型定义如下：\n```python\nclass AppBuilderClientAnswer(BaseModel):\n    \"\"\"执行步骤的具体内容\n        属性:\n            answer(str): query回答内容\n            events( list[Event]): 事件列表\n       \"\"\"\n    answer: str = \"\"\n    events: list[Event] = []\n```\n\n`Event`类型定义如下：\n```python\nclass Event(BaseModel):\n    \"\"\"执行步骤的具体内容\n        属性:\n            code (int): 响应code码\n            message (str): 错误详情\n            status (str): 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）\n            event_type（str）: 事件类型\n            content_type（str）: 内容类型\n            detail(dict): 事件详情\n            usage(Usage): 大模型调用的token用量\n    \"\"\"\n    code: int = 0\n    message: str = \"\"\n    status: str = \"\"\n    event_type: str = \"\"\n    content_type: str = \"\"\n    detail: dict = {}\n    usage: Optional[Usage] = None\n```\n\n\n#### Run方法流式返回值\n\n| 参数名称 | 参数类型         | 描述                                           | 示例值 |\n| -------- | ---------------- | ---------------------------------------------- | ------ |\n| content  | Python Generator | 可迭代，每次迭代返回AppBuilderClientAnswer类型 | 无     |\n\n#### 非流式调用示例\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\napp_id = '...'  # 已发布AppBuilder应用ID，可在console端查看\n# 初始化智能体\nbuilder = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = builder.create_conversation()\n# 运行对话\nout = builder.run(conversation_id, \"北京今天天气怎么样\")\n# 打印会话结果 \nprint(out.content.answer)\n```\n\n#### 流式调用示例\n\n```python\n\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client import data_class\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\napp_id = '...'  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\n\n# 上传一个介绍某汽车产品的说明文档\nfile_id = client.upload_local_file(conversation_id, \"/path/to/pdf/file\")\n# 引用上传的文档，开始对话\n# 注意file_ids不是必填项，如果不需要引用特定文档，file_ids留空即可\nmessage = client.run(conversation_id, \"汽车性能参数怎么样\", file_ids=[file_id, ], stream=True)\n\nanswer = \"\"\n\n# 每次迭代返回AppBuilderClientAnswer结构，内可能包括多个事件内容\nfor content in message.content:\n    # stream=True时，将answer拼接起来才是完整的的对话结果\n    answer += content.answer\n    for event in content.events:\n        content_type = event.content_type\n        detail = event.detail\n        # 根据content类型对事件详情进行解析\n        if content_type == \"code\":\n            code_detail = data_class.CodeDetail(**detail)\n            print(code_detail.code)\n        elif content_type == \"text\":\n            text_detail = data_class.TextDetail(**detail)\n            print(text_detail.text)\n        elif content_type == \"image\":\n            image_detail = data_class.ImageDetail(**detail)\n            print(image_detail.url)\n        elif content_type == \"rag\":\n            rag_detail = data_class.RAGDetail(**detail)\n            if len(rag_detail.references) > 0:\n                print(rag_detail.references)\n        elif content_type == \"function_call\":\n            function_call_detail = data_class.FunctionCallDetail(**detail)\n            print(function_call_detail.video)\n        elif content_type == \"audio\":\n            audio_detail = data_class.AudioDetail(**detail)\n            print(audio_detail)\n        elif content_type == \"video\":\n            video_detail = data_class.VideoDetail(**detail)\n            print(video_detail)\n        elif content_type == \"status\":\n            status_detail = data_class.StatusDetail(**detail)\n            print(status_detail)\n        else:\n            default_detail = data_class.DefaultDetail(**detail)\n            print(default_detail)\n\n# 打印完整的answer结果\nprint(answer)\n```\n\n## Java基本用法\n\n### ```new AppBuilderClient(appId)```\n\n#### 方法参数\n\n| 参数名称 | 参数类型 | 描述              | 示例值         |\n| -------- | -------- | ----------------- | -------------- |\n| appID    | String   | 线上Agent应用的ID | \"正确的应用ID\" |\n\n\n#### 方法返回值\n\n```AppBuilderClient```实例化对象\n\n### ```AppBuilderClient().createConversation()```\n\n#### 方法参数\n无\n\n#### 方法返回值\n\n| 参数名称       | 参数类型 | 描述         | 示例值         |\n| -------------- | -------- | ------------ | -------------- |\n| conversationId | String   | 创建的会话ID | \"正确的会话ID\" |\n\n### ```AppBuilderClient().run()```\n\n#### Run方法入参`AppBuilderCientRunRequest`\n\n| 参数名称        | 参数类型           | 是否必须 | 描述                                                         | 示例值               |\n| --------------- | ------------------ | -------- | ------------------------------------------------------------ | -------------------- |\n| query           | String             | 是       | query内容                                                    | \"汽车性能参数怎么样\" |\n| conversationId  | String             | 是       | 对话id，可以通过createConversation()获取                     |                      |\n| stream          | boolean            | 是       | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 |                      |\n| tools           | List[Tool]         | 否       | 一个列表，其中每个字典对应一个工具的配置                     |                      |\n| tools[0]        | Tool               | 否       | 工具配置                                                     |                      |\n| +type           | String             | 否       | 枚举：<br/>**file_retrieval**: 知识库检索工具能够理解文档内容，支持用户针对文档内容的问答。<br/>**code_interpreter**: 代码解释器, 代码解释器能够生成并执行代码，从而协助用户解决复杂问题，涵盖科学计算（包括普通数学计算题）、数据可视化、文件编辑处理（图片、PDF文档、视频、音频等）、文件格式转换（如WAV、MP3、text、SRT、PNG、jpg、MP4、GIF、MP3等）、数据分析&清洗&处理（文件以excel、csv格式为主）、机器学习&深度学习建模&自然语言处理等多个领域。<br/>**function**: 支持fucntion call模式调用工具 |                      |\n| +function       | Function           | 否       | Function工具描述<br/>仅当**type为**`**function**` 时需要且必须填写 |                      |\n| ++name          | String             | 否       | 函数名<br/>只允许数字、大小写字母和中划线和下划线，最大长度为64个字符。一次运行中唯一。 |                      |\n| ++description   | String             | 否       | 工具描述                                                     |                      |\n| ++parameters    | Dict               | 否       | 工具参数, json_schema格式                                    |                      |\n| tool_outputs    | List[ToolOutput]   | 否       | 内容为本地的工具执行结果，以自然语言/json dump str描述       |                      |\n| tool_outputs[0] | ToolOutput         | 否       | 工具执行结果                                                 |                      |\n| +tool_call_id   | String             | 否       | 工具调用ID                                                   |                      |\n| +output         | String             | 否       | 工具输出                                                     |                      |\n| tool_choice     | ToolChoice         | 否       | 控制大模型使用组件的方式，仅对自主规划Agent生效。            |                      |\n| +type           | String             | 否       | auto/function，auto表示由LLM自动判断调什么组件；function表示由用户指定调用哪个组件。 |                      |\n| +function       | ToolChoiceFunction | 否       | 组件对象，包括组件的英文名称和入参                           |                      |\n| ++name          | String             | 否       | 组件的英文名称（唯一标识）                                   |                      |\n| ++input         | String             | 否       | 组件入参，当组件没有入参时填入空对象{}                       |                      |\n| action          | Action             | 否       | 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息 |                      |\n| +action_type    | String             | 是       | 要执行的操作。<br/>可选值为：<br/>resume：回复“信息收集节点” 的消息 |                      |\n| +parameters     | Object             | 是       | 执行操作时所需的参数                                         |                      |\n\n#### Run方法出参\n| 参数名称                 | 参数类型                 | 描述                                                                             | 示例值 |\n| ------------------------ | ------------------------ | -------------------------------------------------------------------------------- | ------ |\n| AppBuilderClientIterator | AppBuilderClientIterator | 回答迭代器，流式/非流式均统一返回该类型,每次迭代返回AppBuilderClientIterator类型 |        |\n\n#### 迭代AppBuilderClientIterator\n| 参数名称      | 参数类型            | 描述                 | 示例值                                                                                  |\n| ------------- | ------------------- | -------------------- | --------------------------------------------------------------------------------------- |\n| +answer       | String              | 智能体应用返回的回答 |                                                                                         |\n| +events       | Event[]             | 事件列表             |                                                                                         |\n| +events[0]    | Event               | 具体事件内容         |                                                                                         |\n| ++code        | string              | 错误码               |                                                                                         |\n| ++message     | string              | 错误具体消息         |                                                                                         |\n| ++status      | string              | 事件状态             | 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）      |\n| ++eventType   | string              | 事件类型             |                                                                                         |\n| ++contentType | string              | 内容类型             | 可选值包括：code text, image, status,image, function_call, rag, audio、video等          |\n| ++detail      | Map<String, Object> | 事件输出详情         | 代码解释器、文生图、工具组件、RAG等的详细输出内容                                       |\n| ++usage       | Usage               | 模型调用的token用量  | Usage(prompt_tokens=1322, completion_tokens=80, total_tokens=1402, name='DeepSeek-V3.1') |\n\n\n#### 示例代码\n\n```Java\npackage org.example;\n\nimport java.io.IOException;\nimport java.util.*;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\nimport com.baidubce.appbuilder.model.appbuilderclient.Event;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\n\nclass AppBuilderClientDemo {\n\n    public static void main(String[] args) throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\");\n        String appId = \"请设置正确的应用ID\";\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n        // 填写上传文件路径\n        String fileId = builder.uploadLocalFile(conversationId, \"/Users/zhangxiaoyu15/PycharmProjects/app-builder/test_app_builder_client/test.pdf\");\n        // 输入query\n        // 注意file_ids不是必填项，如果不需要引用特定文档，则将new String[]{fileId}更换为new String[]{}即可\n        AppBuilderClientIterator itor = builder.run(\"中国四大传统节日是哪四个\", conversationId, new String[]{fileId}, false);\n        StringBuilder answer = new StringBuilder();\n        // itor.hasNext()返回false时，表示流式调用结束\n        while(itor.hasNext())\n        {\n            AppBuilderClientResult response = itor.next();\n            answer.append(response.getAnswer());\n            for (Event event : response.getEvents()) {\n                switch (event.getContentType()) {\n                    case \"rag\":\n                        List<Object> references = (List<Object>)event.getDetail().get(\"references\");\n                        for (Object reference : references) {\n                            ReferenceDetail ragDetail = JsonUtils.deserialize(JsonUtils.serialize(reference), ReferenceDetail.class);\n                            System.out.println(\"-----------------------------------\");\n                            System.out.println(\"参考文献ID:\"+ragDetail.getId());\n                            System.out.println(\"参考文献内容:\"+ragDetail.getContent());\n                            System.out.println(\"来源:\"+ragDetail.getFrom());\n                            System.out.println(\"BaiduSearch链接:\"+ragDetail.getUrl());\n                            System.out.println(\"类型:\"+ragDetail.getType());\n                            System.out.println(\"文档片段ID:\"+ragDetail.getSegmentId());\n                            System.out.println(\"文档ID:\"+ragDetail.getDocumentId());\n                            System.out.println(\"文档名称:\"+ragDetail.getDocumentName());\n                            System.out.println(\"文档所属数据集ID:\"+ragDetail.getDatasetId());\n                            System.out.println(\"-----------------------------------\");\n                        }\n                        break;\n                    default:\n                        // System.out.println(event);\n                }\n            }\n        }\n        System.out.print(\"输出：\");\n        System.out.println(answer);\n    }\n}\n\nclass ReferenceDetail {\n    private int id;\n    private String content;\n    private String from;\n    private String url;\n    private String type;\n    @SerializedName(\"segment_id\")\n    private String segmentId;\n    @SerializedName(\"document_id\")\n    private String documentId;\n    @SerializedName(\"document_name\")\n    private String documentName;\n    @SerializedName(\"dataset_id\")\n    private String datasetId;\n    @SerializedName(\"knowledgebase_id\")\n    private String knowledgebaseId;\n\n    public int getId() {\n        return id;\n    }\n\n    public void setId(int id) {\n        this.id = id;\n    }\n\n    public String getContent() {\n        return content;\n    }\n\n    public void setContent(String content) {\n        this.content = content;\n    }\n\n    public String getFrom() {\n        return from;\n    }\n\n    public void setFrom(String from) {\n        this.from = from;\n    }\n\n    public String getUrl() {\n        return url;\n    }\n\n    public void setUrl(String url) {\n        this.url = url;\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n\n    public String getSegmentId() {\n        return segmentId;\n    }\n\n    public void setSegmentId(String segmentId) {\n        this.segmentId = segmentId;\n    }\n\n    public String getDocumentId() {\n        return documentId;\n    }\n\n    public void setDocumentId(String documentId) {\n        this.documentId = documentId;\n    }\n\n    public String getDocumentName() {\n        return documentName;\n    }\n\n    public void setDocumentName(String documentName) {\n        this.documentName = documentName;\n    }\n\n    public String getDatasetId() {\n        return datasetId;\n    }\n\n    public void setDatasetId(String datasetId) {\n        this.datasetId = datasetId;\n    }\n\n    public String getKnowledgebaseId() {\n        return knowledgebaseId;\n    }\n\n    public void setKnowledgebaseId(String knowledgebaseId) {\n        this.knowledgebaseId = knowledgebaseId;\n    }\n\n    @Override\n    public String toString() {\n        return \"RAGReference{\" +\n                \"id=\" + id +\n                \", content='\" + content + '\\'' +\n                \", from='\" + from + '\\'' +\n                \", url='\" + url + '\\'' +\n                \", type='\" + type + '\\'' +\n                \", segmentId='\" + segmentId + '\\'' +\n                \", documentId='\" + documentId + '\\'' +\n                \", documentName='\" + documentName + '\\'' +\n                \", datasetId='\" + datasetId + '\\'' +\n                \", knowledgebaseId='\" + knowledgebaseId + '\\'' +\n                '}';\n    }\n}\n```\n\n## Go基本用法\n\n### ```NewAppBuilderClient()```\n\n#### 方法参数\n\n| 参数名称 | 参数类型  | 描述              | 示例值         |\n| -------- | --------- | ----------------- | -------------- |\n| app_id   | string    | 线上Agent应用的ID | \"正确的应用ID\" |\n| config   | SDKConfig | SDK配置信息       |                |\n\n### ```CreateConversation()```\n#### 方法入参\n无\n#### 方法出参\n| 参数名称       | 参数类型 | 描述                                         | 示例值 |\n| -------------- | -------- | -------------------------------------------- | ------ |\n| ConversationId | str      | 创建成功的对话对象，后续操作都基于该对象进行 |        |\n\n\n### `Run()`\n#### Run方法入参`AppBuilderClientRunRequest`\n\n| 参数名称       | 参数类型   | 是否必须 | 描述                                                         | 示例值               |\n| -------------- | ---------- | -------- | ------------------------------------------------------------ | -------------------- |\n| ConversationID | string     | 是       | 对话ID，可以通过CreateConversation()获取                     |                      |\n| Query          | string     | 是       | query内容                                                    | \"汽车性能参数怎么样\" |\n| Stream         | bool       | 是       | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 |                      |\n| AppID          | string     | 是       | 应用ID，线上Agent应用的ID                                    |                      |\n| Tools          | []Tool     | 否       | 一个列表，其中每个字典对应一个工具的配置                     |                      |\n| ToolOuptus     | []ToolOupt | 否       | 内容为本地的工具执行结果，以自然语言/json dump str描述       |                      |\n| ToolChoice     | ToolChoice | 否       | 控制大模型使用组件的方式，仅对自主规划Agent生效。            |                      |\n\n`Tool`、`ToolOutput`、`ToolChoice`定义如下：\n\n```go\ntype Tool struct {\n\tType     string   `json:\"type\"`\n\tFunction Function `json:\"function\"`\n}\n\ntype Function struct {\n\tName        string                 `json:\"name\"`\n\tDescription string                 `json:\"description\"`\n\tParameters  map[string]interface{} `json:\"parameters\"`\n}\n\ntype ToolOutput struct {\n\tToolCallID string `json:\"tool_call_id\" description:\"工具调用ID\"`\n\tOutput     string `json:\"output\" description:\"工具输出\"`\n}\n\ntype ToolChoice struct {\n\tType     string             `json:\"type\"`\n\tFunction ToolChoiceFunction `json:\"function\"`\n}\n\ntype ToolChoiceFunction struct {\n\tName  string                 `json:\"name\"`\n\tInput map[string]interface{} `json:\"input\"`\n}\n```\n\n#### Run方法出参\n\n| 参数名称                 | 参数类型                 | 描述                                    | 示例值 |\n| ------------------------ | ------------------------ | --------------------------------------- | ------ |\n| AppBuilderClientIterator | AppBuilderClientIterator | 回答迭代器，流式/非流式均统一返回该类型 |        |\n| error                    | error                    | 存在错误时error不为nil，反之            |        |\n\n#### 迭代AgentBuilderIterator\n\n| 参数名称      | 参数类型    | 描述                 | 示例值                                                                                  |\n| ------------- | ----------- | -------------------- | --------------------------------------------------------------------------------------- |\n| +Answer       | string      | 智能体应用返回的回答 |                                                                                         |\n| +Events       | []Event     | 事件列表             |                                                                                         |\n| +Events[0]    | Event       | 具体事件内容         |                                                                                         |\n| ++Code        | string      | 错误码               |                                                                                         |\n| ++Message     | string      | 错误具体消息         |                                                                                         |\n| ++Status      | string      | 事件状态             | 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）      |\n| ++EventType   | string      | 事件类型             |                                                                                         |\n| ++ContentType | string      | 内容类型             | 可选值包括：code text, image, status,image, function_call, rag, audio、video等          |\n| ++Detail      | interface{} | 事件输出详情         | 代码解释器、文生图、工具组件、RAG等的详细输出内容                                       |\n| ++Usage       | Usage       | 模型调用的token用量  | Usage(prompt_tokens=1322, completion_tokens=80, total_tokens=1402, name='DeepSeek-V3.1') |\n\n\n#### Run示例代码\n\n\n```Go\n// 安装说明：\n// go get github.com/baidubce/app-builder/go/appbuilder\n\npackage main\n\nimport (\n    \"errors\"\n    \"fmt\"\n    \"io\"\n    \"os\"\n\n    \"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n    // 设置环境中的TOKEN，以下TOKEN请替换为您的个人TOKEN，个人TOKEN可通过该页面【获取鉴权参数】或控制台页【密钥管理】处获取\n    os.Setenv(\"APPBUILDER_TOKEN\", \"bce-v3/ALTAK-xxx90ea58\")\n    // 从AppBuilder控制台【个人空间】-【应用】网页获取已发布应用的ID\n    appID := \"4678492a-xxx-654538d3503c\"\n    config, err := appbuilder.NewSDKConfig(\"\", \"\")\n    if err != nil {\n        fmt.Println(\"new config failed: \", err)\n        return\n    }\n\n    builder, err := appbuilder.NewAppBuilderClient(appID, config)\n    if err != nil {\n        fmt.Println(\"new agent builder failed: \", err)\n        return\n    }\n    conversationID, err := builder.CreateConversation()\n    if err != nil {\n        fmt.Println(\"create conversation failed: \", err)\n        return\n    }\n\n    i, err := builder.Run(conversationID, \"你好，你能做什么？\", nil, false)\n    if err != nil {\n        fmt.Println(\"run failed: \", err)\n        return\n    }\n\n\tvar answer *appbuilder.AppBuilderClientAnswer\n\tfor answer, err = i.Next(); err == nil; answer, err = i.Next() {\n\t\tfmt.Println(answer.Answer)\n\t}\n}\n```\n\n#### ToolCall功能示例代码\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\t// 设置APPBUILDER_TOKEN、GATEWAY_URL_V2环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\t// 默认可不填，默认值是 https://qianfan.baidubce.com\n\tos.Setenv(\"GATEWAY_URL_V2\", \"\")\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tfmt.Println(\"new config failed: \", err)\n\t\treturn\n\t}\n\t// 初始化实例\n\tappID := \"请填写正确的应用ID\"\n\tbuilder, err := appbuilder.NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tfmt.Println(\"new agent builder failed: \", err)\n\t\treturn\n\t}\n\t// 创建对话ID\n\tconversationID, err := builder.CreateConversation()\n\tif err != nil {\n\t\tfmt.Println(\"create conversation failed: \", err)\n\t\treturn\n\t}\n\n\tjsonStr := `\n\t{\n\t\t\"type\": \"function\",\n\t\t\"function\": {\n\t\t\t\"name\": \"get_cur_whether\",\n\t\t\t\"description\": \"这是一个获得指定地点天气的工具\",\n\t\t\t\"parameters\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"省，市名，例如：河北省\"\n\t\t\t\t\t},\n\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"enum\": [\"摄氏度\", \"华氏度\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\"location\"]\n\t\t\t}\n\t\t}\n\t}`\n\n\tvar tool Tool\n\terr = json.Unmarshal([]byte(jsonStr), &tool)\n\tif err != nil {\n\t\tfmt.Println(\"unmarshal tool error:\", err)\n        return\n\t}\n\n\ti, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: conversationID,\n\t\tStream:         true,\n\t\tTools: []appbuilder.Tool{tool},\n\t})\n\tif err != nil {\n\t\tfmt.Println(\"run failed:\", err)\n\t}\n\ttotalAnswer := \"\"\n\ttoolCallID := \"\"\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\ttotalAnswer += answer.Answer\n\t\tlastEvent := answer.Events[len(answer.Events)-1]\n\t\ttoolCallID = lastEvent.ToolCalls[len(lastEvent.ToolCalls)-1].ID\n\t}\n\n\ti2, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tToolOutputs: []appbuilder.ToolOutput{\n\t\t\t{\n\t\t\t\tToolCallID: toolCallID,\n\t\t\t\tOutput:     \"北京今天35度\",\n\t\t\t},\n\t\t},\n\t\tStream: true,\n\t})\n\n\tif err != nil {\n\t\tfmt.Println(\"run failed: \", err)\n\t}\n\n\tfor answer, err := i2.Next(); err == nil; answer, err = i2.Next() {\n\t\ttotalAnswer = totalAnswer + answer.Answer\n\t\tfor _, ev := range answer.Events {\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tfmt.Println(string(evJSON))\n\t\t}\n\t}\n\n\tfmt.Println(\"----------------answer-------------------\")\n\tfmt.Println(totalAnswer)\n}\n```\n"
  },
  {
    "path": "docs/Application/Agent/ToolCall/tool_call.md",
    "content": "# Agent 本地ToolCall(Functioncall)\n\n## 概述\n\n### 什么是ToolCall\n\n解释该问题，需要了解以下的知识点：`Agent工具` -> `FunctionCall` - `ToolCall`\n\nAIAgent 有四大核心组件：记忆、规划、工具和执行。其中工具部分，与我们的开发关系最密切，在各类Agent开发平台/工具中，常被称为“组件”、\"插件\"、\"能力\"等.\n\n关于Agent的工具的定义与分类，如下图~\n\n<img src=\"https://chengmo-dev1.bj.bcebos.com/page4.png\" alt=\"drawing\" width=\"1000\"/>\n\nAgent使用工具的流程，一般称为`FunctionCall`，最早由OpenAI提出，并在[Assistant API](https://platform.openai.com/docs/assistants/overview)中广泛应用。\n\n\nToolCall，则是AppBuilder平台提出的一种进阶的FunctionCall，本质与OpenAI的FunctionCall一致，但具有以下两个特点：\n\n- **端云组件联动**： Agent 调用工具时，可以同时调用云端和本地组件。\n\n- **组件类型泛化**： AppBuilder在未来会支持多种类型组件，已经超出了Function的含义，例如数据库、记忆库、工作流等等\n\n### 什么是端云组件联动，要解决什么问题\n\n我们首先从工具的执行位置出发展开~ 在使用如AppBuilder / Coze 等平台开发Agent时，我们可以使用很多平台组件广场中，官方提供的组件，这里组件开箱即用，非常方便。\n\n<img src=\"https://chengmo-dev1.bj.bcebos.com/page5.png\" alt=\"drawing\" width=\"1000\"/>\n\n但是存在一个问题，基于平台云端组件开发的应用，无法调用内网/局域网/私域的知识与能力，也无法与本地的工具进行联动，限制了Agent的灵活性。\n\n我们在解决实际业务问题时，常遇到需要访问内网链接API或本地/硬件功能的FunctionCall需求，AppBuilder ToolCall可以解决这个问题：\n\n* 1、用户可注册一个本地运行的组件到已发布的应用\n* 2、由AppBuilder-Agent的云端思考模型进行规划和参数生成\n* 3、用户基于生成的参数调用本地组件，并再上传运行结果\n* 4、以此实现将本地组件能力嵌入到应用整体流程\n\n\n<img src=\"https://chengmo-dev1.bj.bcebos.com/page6.png\" alt=\"drawing\" width=\"1000\"/>\n\n## ToolCall（FunctionCall）基础知识介绍\n\n### Agent是如何调用Tool的\n\n我们可以将Agent的黑箱拆解为以下几个部分：\n1. Agent的背景信息\n2. Agent的输入信息\n3. Agent的思考过程\n4. Agent触发组件调用\n5. Agent基于组件输出反思总结\n\n#### Agent的背景信息包含以下几个部分\n- 角色定义描述（Prompt）：定义Agent的角色\n- 能力描述（Prompt）：定义Agent可以干什么\n- 工具描述（JsonSchema/Str）：将工具的输入和输出，按照规范，定义为一段字符串，作为最终大模型Prompt的一部分\n\n#### Agent的输入信息包含以下几个部分\n- 用户输入（Query/Prompt）：用户输入的文本\n- 对话相关的文件（File/Url）：与本地对话相关的文件路径\n\n#### Agent的思考过程\nAppBuilder-Agent会将背景信息与输入信息，拼接为最终的Prompt，然后调用大模型推理。\n\nPrompt的一个简单且直观的例子是：\n\n你是`{角色定义描述}`，你可以做以下事情：`{能力描述}`，你可以使用这些工具：`{工具描述-description}`，工具依赖的输入是：`{工具描述-paramters-properties-name}`，这些输入的格式分别是`{工具描述-paramters-properties-type}`。现在用户的问题是`{用户输入}`，与该问题相关的文件是`{对话相关的文件}`，请你解决用户的这个问题。\n\n#### Agent触发组件调用\n\n如果用户的query和组件能够解决的问题匹配，那么大模型就会尝试根据prompt里给出的工具的描述，从query中提炼出该次调用工具所需的参数，生成一个ToolCall命令，交给执行组件的模块去执行。\n\n例如，我们给出的组件能力是\"查找公司内指定人员的信息\"，函数的参数名为\"name\"。当用户输入\"查找张三的信息\"，大模型会从query中提炼出参数\"name=张三\"这个信息。\n\n<img src=\"https://chengmo-dev1.bj.bcebos.com/page7.png\" alt=\"drawing\" width=\"1000\"/>\n\n#### Agent基于组件输出反思总结\n\n组件运行模块执行组件后，会给出字符串形式的结果给到Agent，Agent会再次将结果拼接为Prompt，然后调用大模型推理。判断用户的需求是否已经解决。如果解决了，则经过一个对话模块，总结用户的需求，并生成一个对话记录。如果未解决，则继续调用大模型推理，尝试调用更多的工具，直到用户的需求被解决。\n\n### 开发者如何命令Agent调用本地Tool\n\n我们以AppBuilder-SDK中的AppBuilder-Client的基础代码为例，介绍开发者应该如何使用ToolCall功能\n\n\n```python\nimport appbuilder\n\n# 实例化AppBuilderClient\napp_client = appbuilder.AppBuilderClient(app_id)\nconversation_id = app_client.create_conversation()\n\n# 第一次对话，输入原始的query 和 工具描述\nmessage_1 = app_client.run(\n    conversation_id=conversation_id,\n    query=\"请问张三同学的生日是哪天？\",\n    tools=tools\n)\ntool_call = message_1.content.events[-1].tool_calls[-1]\ntool_call_id = tool_call.id\n\n# 第二次对话，在本地执行组件后，上传组件的运行结果\ntool_call_result = \"张三同学的生日是2008年8月8日\"\nmessage_2 = app_client.run(\n    conversation_id=conversation_id,\n    tool_outputs=[{\n        \"tool_call_id\": tool_call_id,\n        \"output\": tool_call_result\n    }]\n)\nprint(message_2.content)\n```\n\n其中`AppBuilderClient`的`run`方法是核心，我们展开该函数的定义和参数介绍：\n\n`AppBuilderClient().run() -> Message`\n\n```python\ndef run(self, conversation_id: str,\n        query: str = \"\",\n        file_ids: list = [],\n        stream: bool = False,\n        tools: list[data_class.Tool] = None,\n        tool_outputs: list[data_class.ToolOutput] = None,\n        **kwargs\n        ) -> Message:\n    r\"\"\"\n        参数:\n            query (str: 必须): query内容\n            conversation_id (str, 必须): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\n            file_ids(list[str], 可选):\n            stream (bool, 可选): 为True时，流式返回，需要将message.content.answer拼接起来才是完整的回答；为False时，对应非流式返回\n            tools(list[data_class.Tools], 可选): 一个Tools组成的列表，其中每个Tools对应一个工具的配置, 默认为None\n            tool_outputs(list[data_class.ToolOutput], 可选): 工具输出列表，格式为list[ToolOutput], ToolOutputd内容为本地的工具执行结果，以自然语言/json dump str描述，默认为None\n        返回: message (obj: `Message`): 对话结果.\n    \"\"\"\n    pass\n```\n\n\n| 参数名称        | 参数类型         | 是否必须 | 描述                                                         | 示例值            |\n| --------------- | ---------------- | -------- | ------------------------------------------------------------ | ----------------- |\n| conversation_id | String           | 是       | 会话ID                                                       |                   |\n| query           | String           | 否       | query问题内容                                                | \"今天天气怎么样?\" |\n| file_ids        | list[String]     | 否       | 对话可引用的文档ID                                           |                   |\n| stream          | Bool             | 否       | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 | False             |\n| tools           | List[Tool]       | 否       | 一个列表，其中每个字典对应一个工具的配置                     |                   |\n| tools[0]        | Tool             | 否       | 工具配置                                                     |                   |\n| +type           | String           | 否       | 枚举：<br/>**file_retrieval**: 知识库检索工具能够理解文档内容，支持用户针对文档内容的问答。<br/>**code_interpreter**: 代码解释器, 代码解释器能够生成并执行代码，从而协助用户解决复杂问题，涵盖科学计算（包括普通数学计算题）、数据可视化、文件编辑处理（图片、PDF文档、视频、音频等）、文件格式转换（如WAV、MP3、text、SRT、PNG、jpg、MP4、GIF、MP3等）、数据分析&清洗&处理（文件以excel、csv格式为主）、机器学习&深度学习建模&自然语言处理等多个领域。<br/>**function**: 支持fucntion call模式调用工具 |                   |\n| +function       | Function         | 否       | Function工具描述<br/>仅当**type为**`**function**` 时需要且必须填写 |                   |\n| ++name          | String           | 否       | 函数名<br/>只允许数字、大小写字母和中划线和下划线，最大长度为64个字符。一次运行中唯一。 |                   |\n| ++description   | String           | 否       | 工具描述                                                     |                   |\n| ++parameters    | Dict             | 否       | 工具参数, json_schema格式                                    |                   |\n| tool_outputs    | List[ToolOutput] | 否       | 内容为本地的工具执行结果，以自然语言/json dump str描述       |                   |\n| tool_outputs[0] | ToolOutput       | 否       | 工具执行结果                                                 |                   |\n| +tool_call_id   | String           | 否       | 工具调用ID                                                   |                   |\n| +output         | String           | 否       | 工具输出                                                     |                   |\n\n`Tool`与`Function`是本地组件的描述，类型为object，其定义如下：\n\n```python\nclass Tool(BaseModel):\n    type: str = \"function\"\n    function: Function = Field(..., description=\"工具信息\")\n\nclass Function(BaseModel):\n    name: str = Field(..., description=\"工具名称\")\n    description: str = Field(..., description=\"工具描述\")\n    parameters: dict = Field(..., description=\"工具参数, json_schema格式\")\n```\n\n`ToolOutput`是本地组件的执行结果，需要再次上传到Agent，参与思考，类型为object，其定义如下：\n```python\nclass ToolOutput(BaseModel):\n    tool_call_id: str = Field(..., description=\"工具调用ID\")\n    output: str = Field(..., description=\"工具输出\")\n\n```\n\n\n#### Run方法带ToolCall调用示例--Python\n\n以下示例展示了三种方式来使用 ToolCall 进行调用，并演示了如何在 AppBuilder 环境中配置和执行会话调用。\n\n**方式1：使用 JSONSchema 格式直接描述 tools 调用**\n\n```python\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client import data_class\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\napp_id = \"...\"  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\ntools = [\n    {\n        \"type\": \"function\",\n        \"function\": {\n            \"name\": \"get_current_weather\",\n            \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"location\": {\n                        \"type\": \"string\",\n                        \"description\": \"城市名，举例：北京\",\n                    },\n                    \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n                },\n                \"required\": [\"location\", \"unit\"],\n            },\n        },\n    }\n]\n\nmsg = client.run(\n    conversation_id=conversation_id, query=\"今天北京天气怎么样？\", tools=tools\n)\nprint(msg.model_dump_json(indent=4))\n\nevent = msg.content.events[-1]\n\nmsg_2 = client.run(\n    conversation_id=conversation_id,\n    tool_outputs=[{\"tool_call_id\": event.tool_calls[-1].id, \"output\": \"北京今天35度\"}],\n)\nprint(msg_2.model_dump_json(indent=4))\n```\n\n**方式2: 使用 function_to_model 将函数对象传递为 ToolCall 的调用**\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\napp_id = \"...\"  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\n#注意：要使用此方法要为函数写好注释。最好按照谷歌规范来写\n\n#定义示例函数\ndef get_current_weather(location: str, unit: str) -> str:\n  \"\"\"获取指定中国城市的当前天气信息。\n\n  仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\n\n  Args:\n      location (str): 城市名，例如：\"北京\"。\n      unit (int): 温度单位，支持 \"celsius\" 或 \"fahrenheit\"。\n\n  Returns:\n      str: 天气情况描述\n  \"\"\"\n  return \"北京今天25度\"\n  \n#定义函数列表\nfunctions = [get_current_weather]\nfunction_map = {f.__name__: f for f in functions}\n#调用大模型\nmsg = client.run(\n  conversation_id=conversation_id,\n  query=\"今天北京的天气怎么样？\",\n  tools = [appbuilder.Manifest.from_function(f) for f in functions]\n  )\nprint(msg.model_dump_json(indent=4))\n# 获取最后的事件和工具调用信息\nevent = msg.content.events[-1]\ntool_call = event.tool_calls[-1]\n\n# 获取函数名称和参数\nname = tool_call.function.name\nargs = tool_call.function.arguments\n\n# 将函数名称映射到具体的函数并执行\nraw_result = function_map[name](**args)\n\n# 传递工具的输出\nmsg_2 = client.run(\n    conversation_id=conversation_id,\n    tool_outputs=[{\n        \"tool_call_id\": tool_call.id,\n        \"output\": str(raw_result)\n    }],\n)\nprint(msg_2.model_dump_json(indent=4))\n```\n\n**方式3: 使用装饰器进行描述**\n\n```python\nimport os\nimport json\nimport appbuilder\nfrom appbuilder import manifest, manifest_parameter\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"\"\napp_id = \"\"  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\n\n#使用manifest装饰描述函数，manifest_parameter装饰器描述参数，manifest_return装饰器描述函数返回值。\n@manifest(description=\"获取指定中国城市的当前天气信息。仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\")\n@manifest_parameter(name=\"location\", description=\"城市名，例如：北京。\")\n@manifest_parameter(name=\"unit\", description=\"温度单位，支持 'celsius' 或 'fahrenheit'\")\n#定义示例函数\ndef get_current_weather(location: str, unit: str) -> str:\n  return \"北京今天25度\"\n\nprint(json.dumps(appbuilder.Manifest.from_function(get_current_weather), indent=4, ensure_ascii=False))\n#定义函数列表\nfunctions = [get_current_weather]\nfunction_map = {f.__name__: f for f in functions}\n#调用大模型\nmsg = client.run(\n  conversation_id=conversation_id,\n  query=\"今天北京的天气怎么样？\",\n  tools = [appbuilder.Manifest.from_function(f) for f in functions]\n  )\nprint(msg.model_dump_json(indent=4))\n# 获取最后的事件和工具调用信息\nevent = msg.content.events[-1]\ntool_call = event.tool_calls[-1]\n\n# 获取函数名称和参数\nname = tool_call.function.name\nargs = tool_call.function.arguments\n\n# 将函数名称映射到具体的函数并执行\nraw_result = function_map[name](**args)\n\n# 传递工具的输出\nmsg_2 = client.run(\n    conversation_id=conversation_id,\n    tool_outputs=[{\n        \"tool_call_id\": tool_call.id,\n        \"output\": str(raw_result)\n    }],\n)\nprint(msg_2.model_dump_json(indent=4))\n```\n\n#### Run方法带ToolCall调用示例--Java\n\n**创建tool的json文件**\n\n```json\n{\n    \"type\": \"function\",\n    \"function\": {\n        \"name\": \"get_cur_whether\",\n        \"description\": \"这是一个获得指定地点天气的工具\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n            \"required\": [\n                \"location\"\n            ]\n        }\n    }\n}\n```\n\n```java\npackage org.example;\n\nimport java.io.IOException;\nimport java.util.*;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\nimport com.baidubce.appbuilder.model.appbuilderclient.Event;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\n\nclass AppBuilderClientDemo {\n\n    public static void main(String[] args) throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\");\n        String appId = \"请设置正确的应用ID\";\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n       \n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(appId, conversationId, \"今天北京的天气怎么样?\", false);\n\n        String toolJson = new String(Files.readAllBytes(Paths.get(\"json文件所在的路径\")));\n        request.setTools(toolJson);\n\n        AppBuilderClientIterator itor = builder.run(request);\n        String ToolCallID = \"\";\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            Event lastEvent = result.getEvents()[result.getEvents().length - 1];\n            ToolCallID = lastEvent.getToolCalls()[lastEvent.getToolCalls().length - 1].getId();\n            System.out.println(result);\n        }\n\n        AppBuilderClientRunRequest request2 = new AppBuilderClientRunRequest(appId, conversationId);\n        request2.setToolOutputs(ToolCallID, \"北京今天35度\");\n        AppBuilderClientIterator itor2 = builder.run(request2);\n        while (itor2.hasNext()) {\n            AppBuilderClientResult result = itor2.next();\n            System.out.println(result);\n        }\n    }\n}\n\n```\n\n#### ToolCall功能示例代码--Go\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\t// 设置APPBUILDER_TOKEN、GATEWAY_URL_V2环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\t// 默认可不填，默认值是 https://qianfan.baidubce.com\n\tos.Setenv(\"GATEWAY_URL_V2\", \"\")\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tfmt.Println(\"new config failed: \", err)\n\t\treturn\n\t}\n\t// 初始化实例\n\tappID := \"请填写正确的应用ID\"\n\tbuilder, err := appbuilder.NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tfmt.Println(\"new agent builder failed: \", err)\n\t\treturn\n\t}\n\t// 创建对话ID\n\tconversationID, err := builder.CreateConversation()\n\tif err != nil {\n\t\tfmt.Println(\"create conversation failed: \", err)\n\t\treturn\n\t}\n\n\tjsonStr := `\n\t{\n\t\t\"type\": \"function\",\n\t\t\"function\": {\n\t\t\t\"name\": \"get_cur_whether\",\n\t\t\t\"description\": \"这是一个获得指定地点天气的工具\",\n\t\t\t\"parameters\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"省，市名，例如：河北省\"\n\t\t\t\t\t},\n\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"enum\": [\"摄氏度\", \"华氏度\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\"location\"]\n\t\t\t}\n\t\t}\n\t}`\n\n\tvar tool Tool\n\terr = json.Unmarshal([]byte(jsonStr), &tool)\n\tif err != nil {\n\t\tfmt.Println(\"unmarshal tool error:\", err)\n        return\n\t}\n\n\ti, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: conversationID,\n\t\tStream:         true,\n\t\tTools: []appbuilder.Tool{tool},\n\t})\n\tif err != nil {\n\t\tfmt.Println(\"run failed:\", err)\n\t}\n\ttotalAnswer := \"\"\n\ttoolCallID := \"\"\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\ttotalAnswer += answer.Answer\n\t\tlastEvent := answer.Events[len(answer.Events)-1]\n\t\ttoolCallID = lastEvent.ToolCalls[len(lastEvent.ToolCalls)-1].ID\n\t}\n\n\ti2, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tToolOutputs: []appbuilder.ToolOutput{\n\t\t\t{\n\t\t\t\tToolCallID: toolCallID,\n\t\t\t\tOutput:     \"北京今天35度\",\n\t\t\t},\n\t\t},\n\t\tStream: true,\n\t})\n\n\tif err != nil {\n\t\tfmt.Println(\"run failed: \", err)\n\t}\n\n\tfor answer, err := i2.Next(); err == nil; answer, err = i2.Next() {\n\t\ttotalAnswer = totalAnswer + answer.Answer\n\t\tfor _, ev := range answer.Events {\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tfmt.Println(string(evJSON))\n\t\t}\n\t}\n\n\tfmt.Println(\"----------------answer-------------------\")\n\tfmt.Println(totalAnswer)\n}\n```\n\n#### ToolChoice示例代码\n\n* 注意：当前功能为试运行阶段，可能存在如下问题，如使用过程遇到其他问题，欢迎提issue或微信群讨论。\n\n  * 需开启\"组件/知识库结论可直接作为回复\"\n\n  * 组件名称不是界面上的原始名字，而是个人空间组件列表中的英文名\n  \n  * 自定义组件的参数不能使用系统参数，可以使用用户添加的参数\n\n  * 部分官方组件使用的参数与界面上的参数不一致\n\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\t// 设置APPBUILDER_TOKEN、GATEWAY_URL_V2环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\t// 默认可不填，默认值是 https://qianfan.baidubce.com\n\tos.Setenv(\"GATEWAY_URL_V2\", \"\")\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tfmt.Println(\"new config failed: \", err)\n\t\treturn\n\t}\n\t// 初始化实例\n\tappID := \"请填写正确的应用ID\"\n\tbuilder, err := appbuilder.NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tfmt.Println(\"new agent builder failed: \", err)\n\t\treturn\n\t}\n\t// 创建对话ID\n\tconversationID, err := builder.CreateConversation()\n\tif err != nil {\n\t\tfmt.Println(\"create conversation failed: \", err)\n\t\treturn\n\t}\n\n    // 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\n\tinput := make(map[string]any)\n\tinput[\"city\"] = \"北京\"\n\tend_user_id := \"go_toolchoice_demo\"\n\ti, err := client.Run(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"\",\n\t\tEndUserID:      &end_user_id,\n\t\tStream:         false,\n\t\tToolChoice: &ToolChoice{\n\t\t\tType: \"function\",\n\t\t\tFunction: ToolChoiceFunction{\n\t\t\t\tName:  \"WeatherQuery\",\n\t\t\t\tInput: input,\n\t\t\t},\n\t\t},\n\t})\n  \n\tif err != nil {\n\t\tfmt.Println(\"run failed: \", err)\n\t\treturn\n\t}\n\n    for answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tfmt.Println(string(evJSON))\n\t\t}\n\t}\n}\n```\n"
  },
  {
    "path": "docs/Application/Agent/ToolChoice/tool_choice.md",
    "content": "# ToolChoice\n\n#### Run方法带ToolChoice使用示例：\n\n* 注意：当前功能为试运行阶段，可能存在如下问题，如使用过程遇到其他问题，欢迎提issue或微信群讨论。\n  * 需开启\"组件/知识库结论可直接作为回复\"\n  * 组件名称不是界面上的原始名字，而是个人空间组件列表中的英文名\n  * 自定义组件的参数不能使用系统参数，可以使用用户添加的参数\n  * 部分官方组件使用的参数与界面上的参数不一致\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\napp_id = \"...\"  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\n\n# 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\nanswer = app_builder_client.run(\n    conversation_id,\n    \"北京今天的天气\",\n    stream=False,\n    end_user_id=\"user_id_toolchoice\",\n    tool_choice={\n        \"type\": \"function\",\n        \"function\": {\"name\": \"WeatherQuery\", \"input\": {\"city\": \"北京\"}},\n    },\n)\n```\n\n#### Run方法带Toolchoice使用示例--Java\n\n* 注意：当前功能为试运行阶段，可能存在如下问题，如使用过程遇到其他问题，欢迎提issue或微信群讨论。\n\n  * 需开启\"组件/知识库结论可直接作为回复\"\n\n  * 组件名称不是界面上的原始名字，而是个人空间组件列表中的英文名\n\n  * 自定义组件的参数不能使用系统参数，可以使用用户添加的参数\n\n  * 部分官方组件使用的参数与界面上的参数不一致\n\n```java\npackage org.example;\n\nimport java.io.IOException;\nimport java.util.*;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientRunRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.Event;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\n\nclass AppBuilderClientDemo {\n\n    public static void main(String[] args) throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\");\n        String appId = \"请设置正确的应用ID\";\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n\n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(appId, conversationId, \"你能干什么\", false);\n        request.setEndUserId(\"java_toolchoice_demo\");\n      \n        // 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\n        Map<String, Object> input = new HashMap<>();\n        input.put(\"city\", \"北京\");\n        AppBuilderClientRunRequest.ToolChoice.Function func = new AppBuilderClientRunRequest.ToolChoice.Function(\n                \"WeatherQuery\", input);\n        AppBuilderClientRunRequest.ToolChoice choice = new AppBuilderClientRunRequest.ToolChoice(\"function\", func);\n        request.setToolChoice(choice);\n\n        AppBuilderClientIterator itor = builder.run(request);\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            System.out.println(result);\n        }\n    }\n}\n\n```\n\n\n#### ToolChoice示例代码--Go\n\n* 注意：当前功能为试运行阶段，可能存在如下问题，如使用过程遇到其他问题，欢迎提issue或微信群讨论。\n\n  * 需开启\"组件/知识库结论可直接作为回复\"\n\n  * 组件名称不是界面上的原始名字，而是个人空间组件列表中的英文名\n  \n  * 自定义组件的参数不能使用系统参数，可以使用用户添加的参数\n\n  * 部分官方组件使用的参数与界面上的参数不一致\n\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\t// 设置APPBUILDER_TOKEN、GATEWAY_URL_V2环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\t// 默认可不填，默认值是 https://qianfan.baidubce.com\n\tos.Setenv(\"GATEWAY_URL_V2\", \"\")\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tfmt.Println(\"new config failed: \", err)\n\t\treturn\n\t}\n\t// 初始化实例\n\tappID := \"请填写正确的应用ID\"\n\tbuilder, err := appbuilder.NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tfmt.Println(\"new agent builder failed: \", err)\n\t\treturn\n\t}\n\t// 创建对话ID\n\tconversationID, err := builder.CreateConversation()\n\tif err != nil {\n\t\tfmt.Println(\"create conversation failed: \", err)\n\t\treturn\n\t}\n\n    // 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\n\tinput := make(map[string]any)\n\tinput[\"city\"] = \"北京\"\n\tend_user_id := \"go_toolchoice_demo\"\n\ti, err := client.Run(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"\",\n\t\tEndUserID:      &end_user_id,\n\t\tStream:         false,\n\t\tToolChoice: &ToolChoice{\n\t\t\tType: \"function\",\n\t\t\tFunction: ToolChoiceFunction{\n\t\t\t\tName:  \"WeatherQuery\",\n\t\t\t\tInput: input,\n\t\t\t},\n\t\t},\n\t})\n  \n\tif err != nil {\n\t\tfmt.Println(\"run failed: \", err)\n\t\treturn\n\t}\n\n    for answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tfmt.Println(string(evJSON))\n\t\t}\n\t}\n}\n```"
  },
  {
    "path": "docs/Application/Agent/UseOfficialComponents/use_official_components.md",
    "content": "# Client应用调用官方组件\n\n## 简介 \n\nAgent是基于线上Agent应用的问答组件，可以使用该组件利用线上Agent应用进行问答，同时可以在线上为Client应用添加组件，丰富Agent能力。\n\n## Agent添加Components官方组件\n\n整体使用流程包括以下两个环节：\n\n1. 在[百度智能云千帆AppBuilder官网](https://cloud.baidu.com/product/AppBuilder)创建并发布应用(在创建应用时可添加官方组件)、获取应用ID、获取密钥\n2. 引用AppBuilderSDK代码，初始化AppBuilderClient实例、创建会话、上传文档（可选）、执行对话\n\n## 示例\n\n- 接下来将展示创建一个机票查询Agent应用，并添加官方组件。\n\n### 创建应用\n\n- 创建应用并添加自己的角色指令，并按照自己的需求设置模型、记忆功能等参数\n![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E5%88%9B%E5%BB%BA%E8%88%AA%E7%8F%AD%E6%9F%A5%E8%AF%A2%E5%BA%94%E7%94%A8.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-12-17T03%3A51%3A31Z%2F-1%2Fhost%2Fde4a26a46469066111552bf91d50202433ef1cdd89f4945e7924ad11de38fb36)\n\n### 添加官方组件\n\n- 添加官方组件航班查询组件\n![](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E6%B7%BB%E5%8A%A0%E8%88%AA%E7%8F%AD%E6%9F%A5%E8%AF%A2%E6%8C%87%E4%BB%A4.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-12-17T03%3A52%3A17Z%2F-1%2Fhost%2F9dfcafb04d9e5992a4feda63f58ffe2211afb01b1e7b0f4f3ec4822ba840562c)\n\n### 发布应用并调用\n\n- 完成应用设置,并发布应用，接下来就可以调用添加了官方组件的Client应用了，应用的具体调用方法请参考[Agent应用基础知识](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/BasicKnowledge/agent.md)\n\n\n"
  },
  {
    "path": "docs/Application/RAG/BasicKnowledge/rag.md",
    "content": "# console端RAG操作工具(RAG)\n\n## 简介\n\nRAG是基于线上RAG应用的问答组件，可以使用该组件利用线上RAG应用进行问答。<br>\n<span style=\"color:red\">\n⚠️本组件仅适用于2024-04-02之前创建的历史RAG应用，最新创建的AgentBuilder应用，请参考[AppBuilder应用](../../../BasisModule/Platform/Application/appbuilder_client.md)\n进行调用。\n</span>\n\n### 功能介绍\n\n利用线上RAG应用进行问答\n\n### 特色优势\n\n与线上应用联动，利用线上RAG应用进行问答\n\n### 应用场景\n\n使用SDK利用线上RAG应用进行问答\n\n## 基本用法\n\n以下是使用SDK进行问答的示例代码\n\n### Python\n\n#### 组件初始化参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| app_id | string | 线上RAG应用的ID | \"正确的应用ID\" |\n\n#### run方法入参\n\n| 参数名称            | 参数类型    | 是否必须 | 描述             | 示例值                        |\n|-----------------|---------|------|----------------|----------------------------|\n| query           | Message | 是    | 提问的内容          | Message(content=\"北京的面积多大\") |\n| stream          | bool    | 否    | 是否流式返回，默认False | False                      |\n| conversation_id | string  | 否    | 不传默认新建会话       | \"\"                         |\n\n#### run方法出参\n\n| 参数名称   | 参数类型    | 描述   | 示例值                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n|--------|---------|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| result | Message | 返回结果 | Message(name=msg, content=北京市的面积是16410.54平方公里^[2]^。, mtype=dict, extra={'search_baidu': [{'id': '1', 'content': '北京,简称“京”,是中华人民共和国的首都,是全国的政治中心、文化中心,是世界著名古都和现代化国际...', 'type': 'web', 'from': 'search_baidu', 'title': '北京概况_首都之窗_北京市人民政府门户网站', 'url': 'https://www.beijing.gov.cn/renwen/bjgk/?eqid=b987a5f000085b6700000002642e204d'}, 'id', 'content', 'type', 'from', 'title', 'url']}, conversation_id=5a247540-e8cf-402a-a630-8015c24904f5)}) |\n\n#### 调用示例\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\napp_id = '...'  # 线上RAG应用ID，可在console端查看\nconversation_id = '...'  # 会话ID，可选参数，不传默认新建会话\nrag_app = appbuilder.console.RAG(app_id)\nquery = \"中国的首都在哪里\"\nanswer = rag_app.run(appbuilder.Message(query))  # 新建会话\nprint(answer.content)  # 获取结果内容\nconversation_id = answer.conversation_id  # 获取会话ID，可用于下次会话\nprint(conversation_id)\nquery = \"它有哪些旅游景点\"\nanswer = rag_app.run(appbuilder.Message(query), conversation_id)  # 接上次会话\nprint(answer.content)  # 获取结果内容\nprint(answer.extra)  # 获取结果来源\n```\n\n### Java\n\n#### 组件初始化参数\n\n| 参数名称   | 参数类型      | 描述         | 示例值       |\n|--------|-----------|------------|-----------|\n| appID | String    | 线上RAG应用的ID | \"正确的应用ID\" |\n\n#### Run方法入参\n\n| 参数名称           | 参数类型   | 是否必须 | 描述                                                 | 示例值         |\n|----------------|--------|------|----------------------------------------------------|-------------|\n| query          | string | 是    | query内容                                                 | \"汽车性能参数怎么样\" |\n| conversationID | String   | 是    | 若为空字符串服务端会自动创建新的会话ID，若不为空则继续上次对话内容 |             |\n| stream         | boolean   | 是    | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 |      |\n\n#### Run方法出参\n\n| 参数名称        | 参数类型        | 描述                   | 示例值 |\n|-------------|-------------|----------------------|-----|\n| RAGIterator | RAGIterator | 回答迭代器，流式/非流式均统一返回该类型,每次迭代返回RAGResponse类型 |     |\n\n#### 迭代RAGIterator\n\n| 参数名称           | 参数类型            | 描述      | 示例值 |\n|----------------|-----------------|---------|-----|\n| code         | int          | 响应状态码 |     |\n| message | String          | 响应信息    |     |\n| result    | RAGResult          | 响应结果    |     |\n| +answer      | String          | 回答结果    |     |\n| +conversationId  | String | 会话id    |     |\n| +events       | []EventContent     | 事件流   |     |\n| +events[0]       | EventContent         | 具体事件     |     |\n| ++eventType       | String         | 事件类型     |     |\n| ++eventStatus       | String         | 事件状态     |     |\n| ++outputs       | Map<String, Object>         | 事件内容     |     |\n\n#### 示例代码\n```java\nclass RAGDemo {\n    public static void main(String[] args) throws IOException, AppBuilderServerException {\n        // 填写自己的APPBUILDER_TOKEN\n        System.setProperty(\"APPBUILDER_TOKEN\", \"填写秘钥\");\n        // 填写创建好的appId\n        String appId = \"填写线上创建好的appId\";\n        \n        RAG rag = new RAG(appId);\n\n        RAGIterator itor = rag.run(\"我想了解附近的房产价格，你能帮我查询吗？\", \"\", true);\n        System.out.println(\"输出结果：\");\n        // itor.hasNext()返回false时，表示流式调用结束\n        while (itor.hasNext()) {\n            RAGResponse response = itor.next();\n            System.out.print(response.getResult().getAnswer());\n        }\n    }\n}\n```\n### Go\n\n#### 组件初始化参数\n\n| 参数名称   | 参数类型      | 描述         | 示例值       |\n|--------|-----------|------------|-----------|\n| app_id | string    | 线上RAG应用的ID | \"正确的应用ID\" |\n| config | SDKConfig | SDK配置信息    |           |\n\n#### Run方法入参\n\n| 参数名称           | 参数类型   | 是否必须 | 描述                                                 | 示例值         |\n|----------------|--------|------|----------------------------------------------------|-------------|\n| conversationID | 会话ID   | 是    | 若为空字符串服务端会自动创建新的会话ID，若不为空则继续上次对话内容                 |             |\n| query          | string | 是    | query内容                                            | \"汽车性能参数怎么样\" |\n| stream         | bool   | 是    | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 |             |\n\n#### Run方法出参\n\n| 参数名称        | 参数类型        | 描述                   | 示例值 |\n|-------------|-------------|----------------------|-----|\n| RAGIterator | RAGIterator | 回答迭代器，流式/非流式均统一返回该类型 |     |\n| error       | error       | 存在错误时error不为nil，反之   |     |\n\n#### 迭代RAGIterator\n\n| 参数名称           | 参数类型            | 描述      | 示例值 |\n|----------------|-----------------|---------|-----|\n| Answer         | string          | query答案 |     |\n| ConversationID | string          | 会话ID    |     |\n| Events         | []RAGEvent      | RAG事件流  |     |\n| +Event         | string          | 事件名     |     |\n| EventStatus    | string          | 事件状态    |     |\n| EventType      | string          | 事件类型    |     |\n| Text           | json.RawMessage | 事件内容    |     |\n\n#### 示例代码\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\t// 设置APPBUILDER_TOKEN、GATEWAY_URL环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\t// 默认可不填，默认值是 https://appbuilder.baidu.com\n\tos.Setenv(\"GATEWAY_URL\", \"\")\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tfmt.Println(\"new config failed: \", err)\n\t\treturn\n\t}\n\t// 初始化RAG实例\n\tappID := \"请填写正确的应用ID\"\n\trag, err := appbuilder.NewRAG(appID, config)\n\tif err != nil {\n\t\tfmt.Println(\"new rag instance failed:\", err)\n\t\treturn\n\t}\n\t// 执行流式对话\n\ti, err := rag.Run(\"\", \"\", true)\n\tif err != nil {\n\t\tfmt.Println(\"run failed:\", err)\n\t\treturn\n\t}\n\tcompletedAnswer := \"\"\n\t// 迭代返回结果\n\tvar answer *appbuilder.RAGAnswer\n\tfor answer, err = i.Next(); err == nil; answer, err = i.Next() {\n\t\tcompletedAnswer = completedAnswer + answer.Answer\n\t}\n\t// 迭代正常结束err应为io.EOF\n\tif errors.Is(err, io.EOF) {\n\t\tfmt.Println(\"run success\")\n\t\tfmt.Println(\"RAG智能体回答内容： \", completedAnswer)\n\t} else {\n\t\tfmt.Println(\"run failed:\", err)\n\t}\n}\n```\n\n"
  },
  {
    "path": "docs/Application/RAG/DatasetManage/dataset_manage.md",
    "content": "# console端知识库操作助手\n\n## 目标\n用户可通过SDK对console端知识库进行操作，实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作，可在平台console中查看结果。\n\n```python\n#  设置环境变量\nimport os\n\n#  设置环境变量\n#  请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n## 管理知识库\n\n### 初始化已有知识库\n获取线上已有知识库的ID，可在[console](https://console.bce.baidu.com/ai_apaas/dataset)端查看，示例\n\n<img width=\"1536\" alt=\"image\" src=\"./image/dataset示例.png\">\n\n```python\nimport appbuilder\n# 初始化已有线上知识库, dataset_id 可在平台console中查看\ndataset_id = \"...\"\ndataset = appbuilder.console.Dataset(dataset_id)\n```\n\n### 创建全新知识库\n\n```python\n# 创建全新知识库\ndataset = appbuilder.console.Dataset.create_dataset(\"my_dataset\")\n```\n\n### 上传文档到知识库\n\n```python\n# 设置文档路径，例如“./test.pdf”\nfile_path1 = \"...\"\nfile_path2 = \"...\"\nfile_paths = [file_path1, file_path2]\n# 将文档上传到知识库\ndocument_infos = dataset.add_documents(file_paths)\nprint(document_infos)\n```\n\n### 获取知识库关联文档\n```python\n# 获取第一页的文档列表, 每页10条\ndocument_list = dataset.get_documents(1, 10)\nprint(document_list)\n```\n\n### 删除知识库中的文档\n```python\n# 删除第一个文档\ndocument_ids = [document_list.data[0].id]\ndataset.delete_documents(document_ids)\n```\n\n### 知识库使用示例\n\n- [知识库使用示例](https://github.com/baidubce/app-builder/blob/master/cookbooks/end2end_application/rag/qa_system_1_dataset.ipynb)"
  },
  {
    "path": "docs/BasisModule/Components/Components.md",
    "content": "# 组件文档\n\n- 当前目录为Appbuilder-SDK的组件文档目录"
  },
  {
    "path": "docs/BasisModule/Components/animal_recognize/README.md",
    "content": "# 动物识别 (AnimalRecognition) \n\n## 简介\n动物识别 (AnimalRecognition) 支持对于输入的一张图片（可正常解码），输出动物识别结果。\n\n### 功能介绍\n* 识别动物名称\n\n  识别近八千种动物，接口返回动物名称、置信度信息，支持自定义返回结果数， 并可获取识别结果对应的百科信息；\n\n### 应用场景\n* 拍照识图\n\n    根据拍摄照片，识别图片中动物的名称，可配合其它识图能力对识别的结果进一步细化，提升用户体验，广泛应用于拍照识图类APP中。\n\n\n## 基本用法\n\n我们选取一张可爱的大熊猫照片，使用动物识别组件进行识别。\n\n\n![大熊猫](https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad6862cf937c03f8c5260d51c6ae\n)\n\n\n下面是动物识别的代码示例：\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n            \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n            \"62cf937c03f8c5260d51c6ae\"\nraw_image = requests.get(image_url).content\n# 创建动物识别组件实例\nanimal_recognition = appbuilder.AnimalRecognition()\n# 执行识别操作并获取结果\nout = animal_recognition.run(appbuilder.Message(content={\"raw_image\": raw_image}))\nprint(out.content)\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\n\n### 响应参数\n| 参数名称   | 参数类型    | 描述   | 示例值                                   |\n|--------|---------|------|---------------------------------------|\n| result | Array[] | 返回结果 | [{\"name\":\"国宝大熊猫\",\"score\":\"0.975161\"}] |\n| +name  | String  | 动物名称 | \"国宝大熊猫\"                               |\n| +score | String  | \t置信度 | \"0.975161\"                            |\n### 响应示例\n```json\n{\n    \"result\":[\n        {\n            \"name\":\"国宝大熊猫\",\n            \"score\":\"0.975161\"\n        },\n        {\n            \"name\":\"秦岭四宝\",\n            \"score\":\"0.0161979\"\n        },\n        {\n            \"name\":\"团团圆圆\",\n            \"score\":\"0.00239265\"\n        },\n        {\n            \"name\":\"圆仔\",\n            \"score\":\"0.00192277\"\n        },\n        {\n            \"name\":\"棕色大熊猫\",\n            \"score\":\"0.00130296\"\n        },\n        {\n            \"name\":\"小熊猫\",\n            \"score\":\"0.000275865\"\n        }\n    ]\n}\n```\n\n## 高级用法\n\n目前该模块仅提供基础的动物识别功能。\n\n\n## 更新记录和贡献\n* 动物识别能力 (2024-01)"
  },
  {
    "path": "docs/BasisModule/Components/asr/README.md",
    "content": "# 短语音识别-极速版 (Automatic Speech Recognition) \n\n## 简介\n短语音识别 (Automatic Speech Recognition) 可以将音频流实时识别为文字，并返回每句话的开始和结束时间，适用于手机语音输入、语音搜索、人机对话等语音交互场景。\n\n### 功能介绍\n通过极速API接口，将语音识别为文字，毫秒级响应，快速返回识别结果。\n\n### 特色优势\n采用领先国际的流式端到端建模方法SMLTA，近场普通话语音识别准确率可达98%；采用最新识别解码技术，识别速度提升5倍以上，极速返回识别结果；专有GPU服务集群、提供企业级的稳定服务，弹性灵活的高并发承载及高可靠性保障。\n\n### 应用场景\n语音输入、语音搜索、人机对话等。\n\n## 基本用法\n\n下面是短语音识别的代码示例：\n\n```python\nimport os\nimport requests\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nasr = appbuilder.ASR()\n\naudio_file_url = \"https://bj.bcebos.com/v1/appbuilder/asr_test.pcm?authorization=bce-auth-v1\" \\\n                   \"%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A56%3A41Z%2F-1%2Fhost\" \\\n                   \"%2Fa6c4d2ca8a3f0259f4cae8ae3fa98a9f75afde1a063eaec04847c99ab7d1e411\"\naudio_data = requests.get(audio_file_url).content\ncontent_data = {\"audio_format\": \"pcm\", \"raw_audio\": audio_data, \"rate\": 16000}\nmsg = appbuilder.Message(content_data)\nout = asr.run(msg)\nprint(out.content)\n\n# {'result': ['北京科技馆。']}\n```\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|message |String  |是 |输入的消息，用于模型的主要输入内容。这是一个必需的参数，语音时长最长为60S| Message(content={\"raw_audio\": b\"...\"}) |\n|audio_format|String|是 |定义语言文件的格式，包括\"pcm\"、\"wav\"、\"amr\"，默认值为\"pcm\"| pcm    |\n|rate|Integer|是 |定义录音采样率，固定值16000| 16000  |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer|是 |HTTP重试次数| 3      |\n\n### 响应参数\n|参数名称 | 参数类型         |描述 |示例值|\n|--------|--------------|----|------|\n|result  | List[String] |返回结果|[\"北京科技馆。\"]|\n### 响应示例\n```json\n{\"result\": [\"北京科技馆。\"]}\n```\n### 错误码\n| 错误码 |描述|\n|---|---|\n| 0 |success|\n| 2000  |data empty|\n\n## 高级用法\n\n目前该模块仅提供基础的语音识别功能。\n\n\n## 更新记录和贡献\n* 短语音识别能力 (2023-12)\n"
  },
  {
    "path": "docs/BasisModule/Components/dish_recognize/README.md",
    "content": "# 菜品识别（DishRecognition）\n\n## 简介\n菜品识别组件（DishRecognition）可以识别超过9千种菜品，可准确识别图片中的菜品名称、卡路里，适用于多种客户识别菜品的业务场景中。\n\n### 功能介绍\n识别超过9千种菜品，适用于识别只含有单个菜品的图片，接口返回菜品的名称、卡路里等综合信息\n\n### 特色优势\n识别精度高，响应速度快\n\n### 应用场景\n1. 餐饮健康：根据拍摄照片，识别图片中菜品名称，获取菜品参考卡路里含量和百科信息，可结合识别结果进一步提供饮食推荐、健康管理方案等相关功能，增强用户体验，广泛应用于餐饮娱乐类和健康管理类APP中\n2. 智能结算：根据拍摄照片，识别图片中菜品名称和位置，提高结算效率，减少人工录入成本，广泛应用于餐饮行业中\n\n## 基本用法\n通过如下示例代码可以快速开始使用菜品识别组件：\n\n示例图片为：\n\n![菜品识别示例图片](https://bj.bcebos.com/v1/appbuilder/dish_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A58%3A25Z%2F-1%2Fhost%2F7b8fc08b2be5adfaeaa4e3a0bb0d1a1281b10da3d6b798e116cce3e37feb3438)\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\ndish_recognition = appbuilder.DishRecognition()\n\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/dish_recognize_test.jpg?\" \\\n          \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T\" \\\n          \"10%3A58%3A25Z%2F-1%2Fhost%2F7b8fc08b2be5adfaeaa4e3a0bb0d1a1281b10da\" \\\n          \"3d6b798e116cce3e37feb3438\"\nraw_image = requests.get(image_url).content\n\nresp = dish_recognition(appbuilder.Message({\"raw_image\": raw_image}))\n# 输出{'result': [{'name': '剁椒鱼头', 'calorie': '127'}]}\nprint(resp.content)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|message |obj:`Message`  |是 |待识别的图片字节流数据或url| Message(content={\"raw_image\": b\"...\"}) 或Message(content={\"url\": \"...\"}) |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer|否 |HTTP重试次数| 3      |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |List[Object]  |返回结果|[{\"name\": \"剁椒鱼头\", \"calorie\": \"127\"}]|\n|result[0].name    |String  |菜品名称|剁椒鱼头|\n|result[0].calorie |String  |菜品卡路里含量|127|\n\n\n### 响应示例\n```json\n{\"result\": [{\"name\": \"剁椒鱼头\", \"calorie\": \"127\"}]}\n```\n\n\n## 更新记录和贡献\n* 菜品识别 (2024-01)"
  },
  {
    "path": "docs/BasisModule/Components/doc_crop_enhance/README.md",
    "content": "# 文档矫正增强 (DocCropEnhance) \n\n## 简介\n文档矫正增强 (DocCropEnhance) 可对图片中的文件、卡证、票据等内容进行四角点检测定位，提取主体内容并对其进行矫正，同时可选图片增强效果进一步提升图片清晰度，达到主体检测矫正并增强的目的，提升图片整体质量\n### 功能介绍\n* 文档矫正增强\n\n  支持对文档中的文件、卡证等内容进行主体检测与矫正，同时可开启增强功能\n### 特色优势\n* 技术领先\n\n  模型针对图片倾斜、弯曲等情况进行专项优化，鲁棒性强，在处理图像的同时，可完整保留原有文档内容\n* 能力丰富\n  \n  提供文档图片矫正、增强、去手写等多项能力，全方位提升图像质量，适用于采集质量把控、文字识别效果提升等多应用场景\n### 应用场景\n   旨在改善文档图像质量，提升可读性和可处理性，广泛应用于图像处理和分析、归档和数字化等领域\n## 基本用法\n\n下面是文档矫正增强代码示例：\n\n示例图片为\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder/doc_enhance_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A51%3A09Z%2F-1%2Fhost%2F2020d2433da471b40dafa933d557a1ebe8abf28df78010f865e45dfcd6dc3951)\n\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/doc_enhance_test.png?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01\" \\\n            \"-24T12%3A51%3A09Z%2F-1%2Fhost%2F2020d2433da471b40dafa933d557a1e\" \\\n            \"be8abf28df78010f865e45dfcd6dc3951\"\nraw_image = requests.get(image_url).content\n# 创建文档矫正增强组件实例\ndoc_crop_enhance = appbuilder.DocCropEnhance()\n# 执行操作并获取结果\nout = doc_crop_enhance.run(appbuilder.Message(content={\"raw_image\": raw_image}),enhance_type=3)\nprint(out.content)\n# {\"image_processed\": \"...\", 'points': [{'y': 1371, 'x': 0}, {'x': 0, 'y': 0}, {'x': 997, 'y': 0}, {'x': 994, 'y': 1371}]}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称         | 参数类型    | 是否必须 | 描述                                                                                                                          | 示例值                                            |\n|--------------|---------|------|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------|\n| message      | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数                                                                                                 | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n| enhance_type | Integer | 否    | 选择是否开启图像增强功能，如开启可选择增强效果，可选值如下：enhance_type =0：默认值，不开启增强功能，enhance_type = 1：去阴影，enhance_type = 2：增强并锐化，enhance_type = 3：黑白滤镜 | 0                                              |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry        | Integer | 否    | HTTP重试次数                                                                                                                    | 3                                              |\n\n### 响应参数\n| 参数名称            | 参数类型    | 描述                                        | 示例值                                                                                     |\n|-----------------|---------|-------------------------------------------|-----------------------------------------------------------------------------------------|\n| image_processed | String  | 返回处理后的图片，base64编码                         | \"...\"                                                                                   |\n| points          | Array[] | 检测到的图片内主体在原图中的四角点坐标 | [{ \"x\": 0, \"y\": 1371 },{ \"x\": 0, \"y\": 0 },{ \"x\": 997, \"y\": 0 },{ \"x\": 994, \"y\": 1371 }] |\n\n### 响应示例\n```json\n{\n  \"image_processed\": \"...\",\n  \"points\": [\n    { \"x\": 0, \"y\": 1371 },\n    { \"x\": 0, \"y\": 0 },\n    { \"x\": 997, \"y\": 0 },\n    { \"x\": 994, \"y\": 1371 }\n  ]\n}\n```\n\n## 高级用法\n\n目前该模块仅提供基础的文档矫正增强功能。\n\n\n## 更新记录和贡献\n* 文档矫正增强能力 (2024-01)"
  },
  {
    "path": "docs/BasisModule/Components/doc_format_converter/README.md",
    "content": "# 文档格式转换 (DocFormatConverter)\n\n## 简介\n文档格式转换：识别文档内文字及版面布局，可将多种类型的版式文档转换为流式文档。\n\n### 功能介绍\n支持识别图片中文档版面布局，提取文字内容，并转换为保留原文档版式的Word/Excel，方便二次编辑和复制。\n\n### 特色优势\n1、多种格式互转：支持多种格式相互转换，覆盖全面；\n\n2、图像预处理：支持对文件朝向检测、印章/水印去除后等预处理，提升格式转换效果。\n\n### 应用场景\n文档电子化：标题/正文/表格/配图等版式信息精准识别与还原，快速录入文档内容，实现纸质档案电子化。\n\n## 基本用法\n\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\ndoc_format_converter = appbuilder.DocFormatConverter()\n\nimage_url = \"https://ai-cape-strategy-data.bj.bcebos.com/document-restructure/1EF33F9307451C9413D5D1160.jpg\"\n\nresp = doc_format_converter(appbuilder.Message({\"file_path\": image_url}))\n# 输出{\"word_url\":\"\", \"excel_url\":\"\"}\nprint(resp.content)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称       |参数类型 |是否必须 | 描述          | 示例值  |\n|------------|--------|--------|-------------|------|\n| file_path    |String  |是 | 需要转换的文件的本地存储路径或远程URL,支持图片, URL长度不超过1024字节，图片base64编码后大小不超过4M，最短边至少15px，最长边最大4096px,支持jpg/jpeg/png/bmp格式 | \"./test.png\" |\n\n\n### 响应参数\n| 参数名称        |参数类型 | 描述   | 示例值                     |\n|-------------|--------|------|-------------------------|\n| word_url |Message  | 还原后的word文件的下载地址,文件识别失败时返回空 | \"http://bos.bce.cn/dsfkjc.docx\"|\n| excel_url |Message  | 还原后的Excel文件的下载地址(源文件中含表格时才会输出),若文档中没有表格则返回\"\" | \"http://bos.bce.cn/dsfkjc.xlsx\"|\n\n### 常见错误信息\n| 错误信息                  | 描述          |\n|-------------------------|-------------|\n|IAM Certification failed  |IAM鉴权失败|\n|Check file failed!|文件检查错误,请检查文件大小以及URL是否符合要求  |\n\n## 更新记录和贡献\n* 文档格式转换 (2024-04)"
  },
  {
    "path": "docs/BasisModule/Components/doc_parser/README.md",
    "content": "# 文档解析（DocParser）\n\n## 简介\n文档解析组件（DocParser）可以用于文档内容解析，支持PDF、JPG、DOC、TXT、XLS、PPT等16种文档格式的内容解析。\n\n### 功能介绍\n文档解析组件（DocParser）支持从文档中解析出文档字符内容、版式信息、位置坐标、表格结构、阅读顺序、标题段落层级树等内容\n\n### 特色优势\nDocParser支持解析以下几种类型的文档：\n* 版式文档：「pdf」、「jpg」、「jpeg」、「png」、「bmp」、「tif」、「tiff」、「ofd」\n* 流式文档：「doc」、「docx」、「txt」、「xls」、「xlsx」、「wps」、「ppt」、「pptx」\n\n支持解析的文档内容包括：\n* 文档的版式分析，识别文档中的标题、正文、页眉页脚、表格等\n* 文档内的文字内容、位置坐标\n* 表格结构和内容\n* 构建文档标题段落层级树\n* 构建文档阅读顺序\n* 支持以上类型文档转成pdf格式\n\n### 应用场景\n* 文档内容解析\n* 文档版式解析\n* 文档格式转化\n\n## 基本用法\n\n以下是使用DocParser快速开始的一个示例：\n\n```python\nfrom appbuilder import DocParser\nfrom appbuilder.core.message import Message\nimport os\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 进行文档内容解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"  # 待解析的文件路径\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\nmsg = Message(file_path)\nparser = DocParser()\nparse_result = parser(msg)\nprint(parse_result.content)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称       |参数类型 |是否必须 | 描述          | 示例值  |\n|------------|--------|--------|-------------|------|\n| message    |String  |是 | 需要解析的文档的存储路径 | \"./test.pdf\" |\n| return_raw |bool|否 | 指定是否返回原始的解析结果结构，默认为 False。 | True |\n\n### 响应参数\n| 参数名称        |参数类型 | 描述   | 示例值                     |\n|-------------|--------|------|-------------------------|\n| parseResult |Message  | 解析结果 | ParseResult对象，包含文档解析的内容 |\n### 响应示例\n```python\nclass ParseResult(BaseModel):\n    \"\"\"\n    解析结果整体结构\n    \"\"\"\n    para_node_tree: Optional[List[ParaNode]] = []  # 标题段落层级树，当ParserConfig.return_para_node_tree为True时有内容\n    page_contents: Optional[List[PageContent]] = []  # 页面的解析内容，详细内容参考base.py中的PageContent类\n    pdf_data: Optional[str] = \"\" # pdf格式数据, 当ParserConfig.convert_file_to_pdf为True时有内容\n    raw: Optional[Dict] = {} # 云端服务的原始解析结果\n```\n\n## 高级用法\nDocParser支持自定义文档解析的配置和对解析结果进行二次处理，以下是一个示例：\n\n```python\nfrom appbuilder import DocParser\nfrom appbuilder.core.message import Message\nimport os\nimport requests\n\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 先进行文档内容解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"  # 待解析的文件路径\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\nmsg = Message(file_path)\n\nparser = DocParser()\nconfig = parser.config\nconfig.convert_file_to_pdf = True  # 指定将当前文件转换成pdf格式\nconfig.page_filter = [0, 2]  # 只解析第1页和第3页，注意：页码从0开始\n\nparse_result = parser(msg)\nfile_content = parse_result.content\npdf_data = file_content.pdf_data  # 获取原始文件转化成pdf之后的数据\npage_content = file_content.page_content[1]  # 获取第3页的解析结果\npage_table = page_content.tables[0]  # 第3页中第一个表格的解析结果（如有），表格的解析内容的结构详见上一章详细说明部分关于表格结果的说明\ncells = page_table.cells  # 表格的单元格信息\ncell_text = cells[0]  # 表格第一个单元格的文本内容\nmatrix = page_table.cell_matrix  # 表格的单元格矩阵，用来描述单元格的空间位置信息\n...\n自定义处理表格内容\n...\n```\n### 高级用法参数详细说明\n\n在base.py中定义了DocParser配置和结果结构，下面做一些详细的说明和解释：\n### DocParser配置\n```python\nclass ParserConfig(BaseModel):\n    \"\"\"\n    DocParser解析配置\n    \"\"\"\n    convert_file_to_pdf: bool = Field(alias=\"need_pdffile_data\", default=False) #  是否需要将当前文件转换成pdf格式\n    page_filter: List[int] = Field(alias=\"page_filter\", default=None) #  指定解析的页码，默认传None，代表全部解析\n    return_para_node_tree: bool = Field(alias=\"return_para_nodes\", default=True) #  是否需要返回标题段落层级树\n    erase_watermark: bool = Field(alias=\"erase_watermark\", default=False) #  解析的过程中是否需要去除水印的干扰\n```\n### DocParser解析结果\n```python\nclass ParseResult(BaseModel):\n    \"\"\"\n    解析结果整体结构\n    \"\"\"\n    para_node_tree: Optional[List[ParaNode]] = []  # 标题段落层级树，当ParserConfig.return_para_node_tree为True时有内容\n    page_contents: Optional[List[PageContent]] = []  # 页面的解析内容，详细内容参考base.py中的PageContent类\n    pdf_data: Optional[str] = \"\" # pdf格式数据, 当ParserConfig.convert_file_to_pdf为True时有内容\n    raw: Optional[Dict] = {} # 云端服务的原始解析结果\n\nclass ParaNode(BaseModel):\n    \"\"\"\n    文档内容层级树结构\n    \"\"\"\n    node_id: int # 标题段落层级树的节点id\n    text: str # 节点文本\n    para_type: str # 节点类型，包括：title、text、table\n    parent: Optional[int] # 父节点id，文本的父节点是标题，标题的父节点是更高一级的标题\n    children: List[int] # 子节点id列表，标题节点才会有子节点\n    position: List[Position] # 节点位置信息，包括：页码和在对应页面的位置坐标\n    table: Optional[Table] = None # 节点类型为table时，包含表格解析结果\n\nclass PageContent(BaseModel):\n    \"\"\"\n    单页文档内容结构\n    \"\"\"\n    page_num: int # 页码\n    page_width: int # 页面宽度\n    page_height: int # 页面高度\n    page_angle: int # 页面旋转角度\n    page_type: str # 页面类型\n    page_layouts: List[Layout] # 页面版式信息\n    titles: Optional[List[Layout]] = [] # 页面标题信息\n    tables: Optional[List[Table]] = [] # 页面表格信息\n\nclass Layout(BaseModel):\n    \"\"\"\n    layout结构\n    \"\"\"\n    type: str # 布局类型\n    text: str # 布局文本\n    box: List[int] # 布局位置信息，包括：左上角x、y坐标和宽高\n    node_id: int # 布局在标题层级树中的节点id\n\nclass Table(BaseModel):\n    \"\"\"\n    表格结构\n    \"\"\"\n    box: List[int] # 表格位置信息，包括：左上角x、y坐标和宽高\n    cells: List[Layout] = Field(alias=\"children\") # 表格单元格信息，列表形式\n    matrix: List[List[int]] # 表格单元格矩阵，用来描述单元格的空间位置信息\n    node_id: int # 表格在标题层级树中的节点id\n```\n表格解析结构说明, 以下图为例：\n\n![表格](https://bj.bcebos.com/v1/appbuilder-sdk-components/table.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-05-30T03%3A09%3A32Z%2F-1%2Fhost%2Fb36695708e047713b5fe17b49733228aecdaf46322a5cec8d4e7bd0989032197)\n\n```python\n# cells中一共有26个元素，matrix中的每一个元素代表单元格在cells中的索引\ncells = [{\"box\": [90, 376, 21, 10], \"type\": \"cell\", \"text\": \"序号\", \"node_id\": 1}, ...]\nmatrix = [\n        [0, 1, 2, 3],\n        [4, 5, 6, 7],\n        [8, 9, 10, 11],\n        [12, 13, 14, 15],\n        [16, 17, 18, 19],\n        [20, 21, 22, 23],\n        [24, 24, 25, 26]\n    ]\n```\n\n\n## 更新记录和贡献\n* 文档解析能力 (2023-12)"
  },
  {
    "path": "docs/BasisModule/Components/doc_splitter/README.md",
    "content": "# 文档切分（DocSplitter）\n\n## 简介\n文档切分组件（DocSplitter）可以用于对文档进行段落切分。\n\n### 功能介绍\n对解析后的文档，支持将文档划分为多个段落，便于后续处理和分析。\n目前支持的文档切分类型splitter_type如下：\n*  split_by_chunk：按照最大段落大小，对文档进行切分\n*  split_by_title：按照文档的title标识层级进行段落切分\n\n### 特色优势\n组件对文档分隔段落，准确高效，且有多种可选策略，代码简单可快速上手，是后续大模型使用文档信息的基础。\n\n\n### 应用场景\n对解析后的各类型文档进行分段，用于后续任务的输入。\n\n\n## 基本用法\n---\n参考tests目录下的[test_doc_splitter.py](https://github.com/baidubce/app-builder/blob/master/appbuilder/tests/test_doc_splitter.py)，可快速搭建自己的文档切分用例。\n\n以下是DocSplitter快速开始的一个示例。\n\n#### DocSplitter示例:\n\n```python\nimport os\nimport requests\nfrom appbuilder import DocParser\nfrom appbuilder import DocSplitter\nfrom appbuilder.core.message import Message\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 先解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\n\nmsg = Message(file_path)\n\nparser = DocParser()\nparse_result = parser(msg, return_raw=True)\n\n# 基于parser的结果切分段落\nsplitter = DocSplitter(splitter_type=\"split_by_chunk\")\nres_paras = splitter(parse_result)\n\n# 打印结果\nprint(res_paras.content)\n```\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n`splitter_type`(str): 切分器的类型，支持`split_by_chunk`和`split_by_title`两种方式，必选参数\n\n### 调用参数\n* `message`(Message): 上游`docparser`的文档解析结果\n* 备注: 文档解析时，`parser(msg, return_raw=True)`函数的参数`return_raw`必须为`True`\n\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|splitter_type |String  |是 |文本提取器类型, 目前支持`split_by_chunk`, `split_by_title`| DocSplitter(splitter_type=\"split_by_chunk\") |\n\n\n### 响应参数\n|参数名称 | 参数类型 |描述 | 示例值            |\n|--------|------|----|----------------|\n|res_paras  |Message    |返回结果| [{段落1}， {段落2}] |\n\n### 响应示例\n```\nMessage(name=msg, content={'paragraphs': [{'text': '第十节其他重要事项'}]})\n```\n\n### 错误码\n无\n\n\n## DocSplitter高级用法\n\n#### 示例:\n\n```python\nimport os\nimport requests\nfrom appbuilder import DocParser\nfrom appbuilder import DocSplitter\nfrom appbuilder.core.message import Message\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 先解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\n\nmsg = Message(file_path)\n\nparser = DocParser()\nparse_result = parser(msg, return_raw=True)\n\n# 基于parser的结果切分段落\ndoc_splitter = DocSplitter(splitter_type=\"split_by_chunk\",\n                           separators=[\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\", \"|\\n\"],\n                           max_segment_length=800,\n                           overlap=0)\nres_paras = doc_splitter(parse_result)\n\n# 打印结果\nprint(res_paras.content)\n```\n## 参数说明:\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 调用参数\n* `message`(Message): 上游`docparser`的文档解析结果\n* 备注: 文档解析时，`parser(msg, return_raw=True)`函数的参数`return_raw`必须为`True`\n*  备注: `splitter_type`为`split_by_title`时，`max_segment_length`, `separators`, `overlap`, `join_symbol`参数不起作用\n\n|参数名称 | 参数类型    | 是否必须 |描述 | 示例值   |\n|--------|---------|------|----|-------|\n|splitter_type | String  | 是    |文本提取器类型, 目前支持`split_by_chunk`, `split_by_title`| DocSplitter(splitter_type=\"split_by_chunk\") |\n|max_segment_length| Integer    | 否    |切分时段落的最大长度|  800   |\n|separators| List  | 否    |固定字数时，段落最后截断的分隔符| [\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\", \"|\\n\"] |\n|overlap| Integer | 否    |分隔的段落间重叠的内容字数| 200     |\n|join_symbol| String | 否    |组成固定字数段落时，文本块段落间的链接符| 空字符     |\n\n### 响应参数\n|参数名称 | 参数类型 |描述 | 示例值            |\n|--------|------|----|----------------|\n|res_paras  |Message    |返回结果| [{段落1}， {段落2}] |\n\n### 响应示例\n```\nMessage(name=msg, content={'paragraphs': [{'text': '第十节其他重要事项'}]})\n```\n\n## 更新记录和贡献\n* 文档分隔 (2023-12)\n\n\n"
  },
  {
    "path": "docs/BasisModule/Components/document_understanding/README.md",
    "content": "# 长文档内容理解（DocumentUnderstanding）\n\n## 简介\n长文档内容理解组件（DocumentUnderstanding）支持对图片以及文档内容进行理解，并基于图片以及文档内容对用户的提问进行回答，\n包括但不限于文档内容问答、总结摘要、内容分析。\n### 功能介绍\n根据用户上传的文档（支持txt、docx、pdf、xlsx、png、jpg、jpeg等多种格式）、query、指令生成大模型答案\n### 特色优势\n处理长上下文的大模型内容理解任务\n### 应用场景\n长上下文的文档问答\n\n## 基本用法\n### 快速开始\n\n```python\n\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nAPPBUILDER_TOKEN = \"YOUR-TOKEN\"\nos.environ[\"APPBUILDER_TOKEN\"] = APPBUILDER_TOKEN\ndu = appbuilder.DocumentUnderstanding()\nquery = appbuilder.Message(\"这篇文档讲了什么\")\ninstruction = \"请根据文档内容回答问题，用一句话简短概括\"\naddition_instruction = \"用一句话简短概括\" ##用户增强指令，可选填，该内容会进一步增强大模型的指令跟随能力，将你最需要增强效果的指令填于此，内容可以与上述的\"instruction\"基础指令有重复，注意：该字段内容过多会一定程度影响大模型内容严谨度，请注意控制该字段的指令字数\napp_id = \"YOUR-APP-ID\" ##你需要在系统上自己的账号下（https://qianfan.cloud.baidu.com/appbuilder）创建任意空Agent，并获取该Agent的app_id（即界面上的应用ID，在首页->个人空间->应用 里面即会显示应用ID），这里任意空Agent就可以，无需任何配置信息，这个agent的作用只是为了获取app_id信息\nfile_path = \"YOUR-FILE-PATH\" ##填写你的本地待分析文件路径\nstream = False ##是否开启流式输出功能\nresponse_ = du.run(query, \n                   file_path, \n                   instruction=instruction, \n                   addition_instruction=addition_instruction, \n                   app_id=app_id,\n                   stream=stream)\n\nfor result in response_:\n    print(result) ##打印输出的大模型答案\n```\n\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nimport os\nos.environ['APPBUILDER_TOKEN'] = 'bce-YOURTOKEN'\n```\n\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n\n### 调用参数\n\n| 参数名称                   | 参数类型 | 是否必须 | 描述                                                                       | 示例值                         |\n|------------------------|------|------|--------------------------------------------------------------------------|-----------------------------|\n| `message`              | obj  | 是    | 输入消息，用户输入query。                                                          | Message(content=input_data) |\n| `file_path`            | str  | 是    | 用户需要分析的文档                                                                | \"test.pdf\"                  |\n| `app_id`               | str  | 是    | 你需要在系统上自己的账号下（https://qianfan.cloud.baidu.com/appbuilder）创建任意空Agent，并获取该Agent的app_id（即界面上的应用ID，在首页->个人空间->应用 里面即会显示应用ID），这里任意空Agent就可以，无需任何配置信息，这个agent的作用只是为了获取app_id信息 | \"YOUR-APP-ID\"               |\n| `instruction`          | str  | 否    | 用户指令                                                                     | \"你的回答要严谨客观，且答案一定要分点阐述\"      |\n| `addition_instruction` | str  | 否    | 用户增强指令，可选填，该内容会进一步增强大模型的指令跟随能力，将你最需要增强效果的指令填于此，注意：该字段内容过多会一定程度影响大模型内容严谨度 | \"你的答案需要分点阐述\"                |\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- |------| -------- | -------- |\n| `result` | str  | 模型运行后的输出结果 | \"\" |\n\n### 响应示例-流式输出\n```\ndata: {\"type\": \"text\", \"text\": \"文件解析完成, 耗时13485.63ms\\n\\n\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\ndata: {\"type\": \"text\", \"text\": \"**Human\", \"event_status\": \"running\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\ndata: {\"type\": \"text\", \"text\": \"-Timescale Adaptation in an Open-Ended Task Space** 文档详细介绍了DeepMind团队开发的自适应代理（Adaptive Agent，简称\", \"event_status\": \"running\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\ndata: {\"type\": \"text\", \"text\": \"AdA）在开放任务空间中的快速适应能力。\", \"event_status\": \"running\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\ndata: {\"type\": \"text\", \"text\": \"\", \"event_status\": \"done\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\n```\n\n### 响应示例-非流式输出\n```\n{'code': 0, 'message': '', 'result': {'text': '文件解析完成, 耗时14572.57ms\\n\\n**Human-Timescale Adaptation in an Open-Ended Task Space** 文档详细介绍了DeepMind团队开发的自适应代理（Adaptive Agent，简称AdA）在开放任务空间中的快速适应能力。以下是文档的主要内容和贡献点：\\n\\n1. **引言**：\\n   - 强调了快速适应能力对于人工智能的重要性，特别是在现实世界中的应用和与人类互动的场景中。\\n   - 提出了通过元强化学习（meta-RL）和自动课程学习（auto-curriculum learning）等方法，训练能够在未见过的环境中快速适应的代理。\\n\\n2. **自适应代理（AdA）**：\\n   - 介绍了AdA的设计和训练方法，包括其在开放任务空间中的适应行为、记忆架构、以及如何通过自动课程学习来优化训练过程。\\n   - 展示了AdA能够在几分钟内解决复杂的3D任务，且不需要进一步的代理训练，显示了其快速适应的能力。\\n\\n3. **实验与结果**：\\n   - 在多个方面评估了AdA的性能，包括其在单代理和多代理设置下的适应能力、不同架构和课程学习方法的影响、以及模型大小和记忆长度对性能的影响。\\n   - 通过与人类玩家的比较，证明了AdA在适应速度上与人类相当。\\n\\n4. **相关工作**：\\n   - 回顾了与本工作相关的领域，包括程序化环境生成、开放任务学习、适应性和强化学习中的Transformer应用等。\\n\\n5. **结论**：\\n   - 总结了AdA的贡献，强调了其在开放任务空间中快速适应的能力，以及通过元强化学习和自动课程学习等方法训练大型模型的可能性。\\n\\n6. **作者和贡献**：\\n   - 列出了主要贡献者和部分贡献者，以及项目的赞助商和认可。\\n\\n**主要贡献点**：\\n- 提出了AdA，一个能够在开放任务空间中快速适应的代理，其适应速度与人类相当。\\n- 通过元强化学习和自动课程学习等方法，训练了大型Transformer模型，展示了其在开放任务空间中的快速适应能力。\\n- 分析了不同架构、课程学习方法、模型大小和记忆长度对AdA性能的影响，提供了详细的实验结果和比较。\\n- 通过与人类玩家的比较，证明了AdA在适应速度上的优势。'}, 'request_id': '687642b0-b877-49ed-9ad9-65d76de0ea58'}\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.10. 15\n#### [Added]\n- 第一版"
  },
  {
    "path": "docs/BasisModule/Components/embeddings/README.md",
    "content": "# 向量计算（Embedding）\n\n## 简介\n\n向量计算组件（Embedding）支持将文本转化为用数值表示的向量形式，用于文本检索、信息推荐、知识挖掘等场景。嵌入（Embedding）是一种在机器学习和自然语言处理中常用的技术，主要用于将大量高维数据（如单词、图像等）转换为更低维的向量表示。这些向量表示捕获了原始数据的关键特征和关系。\n\n### 功能介绍\n\n1. 维度降低：将高维数据（如词汇表中的单词）映射到低维空间，使得数据处理更高效。\n2. 特征学习：学习数据的内在特征，使得具有相似含义的元素在嵌入空间中彼此接近。\n3. 关系映射：在嵌入空间中，数据点的距离和方向可以表示元素之间的关系。\n\n### 特色优势\n\nEmbedding-V1，是基于百度文心大模型技术的文本表示模型，在Embedding模块中，我们使用Embedding-V1作为默认模型。\n\n### 应用场景\n\n1. 文本检索\n2. 信息推荐\n3. 知识挖掘\n\n## 基本用法\n\n当前支持的embedding底座模型暂时只包括：\n- embedding-v1\n\n### 下面是使用单条字符串测试的代码示例\n\n请注意，您必须确保字符串的token长度小于384\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nembedding = appbuilder.Embedding()\n\nout = embedding(\"hello world!\")\n# 得到一个长度为384的float数组\nprint(out.content)\n```\n\n### 下面是使用多条字符串测试的代码示例\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nembedding = appbuilder.Embedding()\n\nouts = embedding.batch([\"hello\", \"world\"])\n# 得到一个长度为 2 x 384的float 二维数组\nprint(out.content)\n```\n\n### 下面是使用上游的Message作为输入的代码示例\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nfrom appbuilder import Message\n\nembedding = appbuilder.Embedding()\n\nquery = Message(\"你好，世界！\")\nout = embedding(query)\n# 得到一个长度为384的float数组\nprint(out.content)\n```\n\n### 下面是批量运行的代码示例\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nfrom appbuilder import Message\n\nembedding = appbuilder.Embedding()\n\nquery = Message([\n    \"你好\",\n    \"世界\"\n])\nouts = embedding.batch(query)\n# 得到一个长度为 2 x 384的float 二维数组\nprint(outs.content)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述                                                         | 示例值           |\n| -------- | -------- | -------- | ------------------------------------------------------------ | ---------------- |\n| model    | 字符串   | 可选     | 指定底座模型的类型。当前仅支持 embedding-v1 作为可选值。若不指定，默认值为 embedding-v1。 | embedding-v1   |\n\n### 调用参数\n\n#### 单条\n\n| 参数名称 | 参数类型 | 是否必须 | 描述                                                         | 示例值           |\n| -------- | -------- | -------- | ------------------------------------------------------------ | ---------------- |\n| text     | 字符串   | 必须     | 一个类型为 string 的句子，用于输入。该句子的长度不能超过384个字符，通常为用户的输入。 | \"您好，我需要帮助。\" |\n\n#### 批量\n\n| 参数名称 | 参数类型        | 是否必须 | 描述                                                             | 示例值                               |\n| -------- | --------------- | -------- | ---------------------------------------------------------------- | ------------------------------------ |\n| texts    | 字符串列表      | 必须     | 一个类型为 List[string] 的句子数组。数组中的每个元素都是一个句子，且每个句子的长度不能超过384个字符。通常这些句子为和用户输入相关的文本候选集。 | [\"您好，我需要帮助。\", \"请问有什么可以帮您？\"] |\n\n### 响应示例\n\n#### 单条\n\n```\n[0.1, 0.2, 0.3, ....]\n```\n\n#### 批量\n\n```\n[\n    [0.1, 0.2, ...],\n    ...,\n    [0.1, 0.2, ...],\n]\n```\n\n### 错误码\n\n无\n\n## 更新记录和贡献\n\n* embedding-v1 (2023-12)\n"
  },
  {
    "path": "docs/BasisModule/Components/extract_table/README.md",
    "content": "# 表格抽取组件（ExtractTableFromDoc）\n\n## 简介\n表格抽取组件（ExtractTableFromDoc）是用于文档表格处理的组件，从文档中抽取表格。支持对文档表格大小进行限制，限制后自动进行拆分、跨页合并等处理；支持合并表格上文，提取的表格为Markdown格式。\n\n### 功能介绍\n从文档中抽取表格。支持对文档表格大小进行限制，限制后自动进行拆分、跨页合并等处理；支持合并表格上文，设置表格上文数量，提取的表格为Markdown格式。\n\n### 特色优势\n组件抽取表格，准确高效，代码简单可快速上手；且不依赖本地计算资源。\n\n### 适用场景\n文档表格解析与处理，用于后续任务的输入。\n\n## 基本用法\n下面是一个基本用法的样例\n\n```python\nimport os\nimport json\nimport requests\n\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder import Message, ExtractTableFromDoc, DocParser\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n\n# 进行文档内容解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"  # 待解析的文件路径\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\n\nmsg = Message(file_path)\n\nparser = DocParser()\n# ExtractTableFromDoc输入为文档原始解析结果，此处需要带上原始结果，return_raw=True.\ndoc = parser(msg, return_raw=True).content.raw\n\n# 抽取文档中的表格\nparser = ExtractTableFromDoc()\nresult = parser.run(Message(doc))\n\nlogger.info(\"Tables: {}\".format(\n    json.dumps(result.content, ensure_ascii=False))\n)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message | Dict  |是 | 输入的消息，用于模型的主要输入内容，必须为Docparser解析后的结果raw，需要设置return_raw=True。这是一个必需的参数。| `Message(parser(msg, return_raw=True).content.raw)` |\n|table_max_size |int  |否 |单个表格的长度的最大值(包含上文)，按字符数即len(table_str)统计，默认为800。如果表格超长，则会被拆分成多个子表格，拆分的最小粒度为表格的行。若单行就超长，则会强制按table_max_size截断。截断时会优先截断上文，尽量保留表格内容。 | 800 |\n|doc_node_num_before_table |int  |否 |表格前附加的上文DocParser Node的数量，默认为1。范围：1~10。 | 1 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n| - | List  | 解析出来的文档表格，如果元素长度为1，则对应原文档中格式化后的长度不超过`table_max_size`的表格；如果元素长度>1，则是对应原文档中一个大表格，该表格被拆分成的多个子表格，以满足设置大小。 | 见响应示例 |\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n\n### 响应示例\n```json\n[[{\"para\": \"table1\"}], [{\"para\": \"table2-part1\"}, {\"para\": \"table2-part2\"}]]\n```\n\n## 更新记录和贡献\n* 表格抽取能力 (2023-12)"
  },
  {
    "path": "docs/BasisModule/Components/gbi/nl2sql/README.md",
    "content": "# GBI 问表\n\n## 简介\nGBI 问表，根据提供的 mysql 表的 schema 信息，生成对应问题的 sql 语句。\n\n### 功能介绍\nGBI 问表，根据提供的 mysql 表的 schema 信息，生成对应问题的 sql 语句。\n\n### 特色优势\n直接生成 sql 语句，无需人工编写。\n\n### 应用场景\n1. 业务人员需要根据问题生成 sql 语句，但是不熟悉 sql 语法。\n2. 业务人员需要根据问题生成 sql 语句，但是不熟悉表的名称。\n\n\n## 基本用法\n这里是一个示例，展示如何基于 mysql 表的 schema, 根据问题生成 sql 语句。\n\n\n```python\nimport logging\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.gbi.basic import SessionRecord\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nSUPER_MARKET_SCHEMA = \"\"\"\nCREATE TABLE `supper_market_info` (\n  `订单编号` varchar(32) DEFAULT NULL,\n  `订单日期` date DEFAULT NULL,\n  `邮寄方式` varchar(32) DEFAULT NULL,\n  `地区` varchar(32) DEFAULT NULL,\n  `省份` varchar(32) DEFAULT NULL,\n  `客户类型` varchar(32) DEFAULT NULL,\n  `客户名称` varchar(32) DEFAULT NULL,\n  `商品类别` varchar(32) DEFAULT NULL,\n  `制造商` varchar(32) DEFAULT NULL,\n  `商品名称` varchar(32) DEFAULT NULL,\n  `数量` int(11) DEFAULT NULL,\n  `销售额` int(11) DEFAULT NULL,\n  `利润` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\n\"\"\"\n\ntable_schemas = [SUPER_MARKET_SCHEMA]\ngbi_nl2sql = appbuilder.NL2Sql(model_name=\"ERNIE-Bot 4.0\", table_schemas=table_schemas)\nquery = \"列出超市中的所有数据\"\nnl2sql_result_message = gbi_nl2sql(Message({\"query\": query}))\n\nprint(f\"sql: {nl2sql_result_message.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message.content.llm_result}\")\n```\n\n\n## 参数说明\n\n### 初始化参数\n- model_name:  支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, DeepSeek-V3.1\n- table_schemas: 表的 schema，例如:\n  \n```\nCREATE TABLE `supper_market_info` (\n  `订单编号` varchar(32) DEFAULT NULL,\n  `订单日期` date DEFAULT NULL,\n  `邮寄方式` varchar(32) DEFAULT NULL,\n  `地区` varchar(32) DEFAULT NULL,\n  `省份` varchar(32) DEFAULT NULL,\n  `客户类型` varchar(32) DEFAULT NULL,\n  `客户名称` varchar(32) DEFAULT NULL,\n  `商品类别` varchar(32) DEFAULT NULL,\n  `制造商` varchar(32) DEFAULT NULL,\n  `商品名称` varchar(32) DEFAULT NULL,\n  `数量` int(11) DEFAULT NULL,\n  `销售额` int(11) DEFAULT NULL,\n  `利润` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\n```\n\n- knowledge: 用于提供一些知识, 比如 {\"毛利率\": \"(销售收入 - 销售成本) / 销售收入\"}\n- prompt_template: prompt 模版, 必须包含的格式如下:\n                  ***你的描述\n                  {schema}\n                  ***你的描述\n                  {column_instrument}\n                  ***你的描述\n                  {kg}\n                  ***你的描述\n                  当前时间：{date}\n                  ***你的描述\n                  {history_instrument}\n                  ***你的描述\n                  当前问题：{query}\n                  回答：\n\n### 调用参数\n- message: message.content 是 字典，包含: query, session, column_constraint 三个key\n  * query: 用户的问题\n  * session: gbi session 的历史 列表, 参考 SessionRecord\n  * column_constraint: 列选约束 参考 ColumnItem 具体定义\n\n#### SessionRecord 初始化参数\n- query: 用户的问题\n- answer: gbi_nl2sql 返回的结果 NL2SqlResult\n\n#### ColumnItem 初始化参数如下\n- ori_value: query 中的 词语, 比如: \"北京去年收入\",  分词后: \"北京, 去年, 收入\", ori_value 是分词中某一个，比如: ori_value = \"北京\"\n- column_name: 对应数据库中的列名称, city\n- column_value: 对应数据库中的列值, 北京市\n- table_name: 该列所属的表名称\n- is_like: 与 ori_value 的匹配是包含 还是 等于，包含: True; 等于: False\n\n### 返回值\n- NL2SqlResult 的 message\n\n#### NL2SqlResult 初始化参数如下\n- llm_result: 大模型返回的结果\n- sql: 从 llm_result 中抽取的 sql 语句\n\n## 高级用法\n### 设置 session\n\n\n```python\nsession = list()\nsession.append(SessionRecord(query=query, answer=nl2sql_result_message.content))\n```\n\n再次问表\n\n\n```python\nnl2sql_result_message2 = gbi_nl2sql(Message({\"query\": \"查看商品类别是水果的所有数据\",\n                                             \"session\": session}))\nprint(f\"sql: {nl2sql_result_message2.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message2.content.llm_result}\")\n```\n\n    sql: \n    SELECT * FROM supper_market_info WHERE 商品类别 = '水果';\n    -----------------\n    llm result: ```sql\n    SELECT * FROM supper_market_info WHERE 商品类别 = '水果';\n    ```\n\n\n### 增加列选优化\n实际上数据中 \"商品类别\" 存储的是 \"新鲜水果\", 那么就可以通过列选的限制来优化 sql.\n\n\n```python\nfrom appbuilder.core.components.gbi.basic import ColumnItem\n\ncolumn_constraint = [ColumnItem(ori_value=\"水果\", \n                               column_name=\"商品类别\", \n                               column_value=\"新鲜水果\", \n                               table_name=\"超市营收明细表\", \n                               is_like=False)]\nnl2sql_result_message2 = gbi_nl2sql(Message({\"query\": \"查看商品类别是水果的所有数据\",\n                                             \"column_constraint\": column_constraint}))\n\nprint(f\"sql: {nl2sql_result_message2.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message2.content.llm_result}\")\n```\n\n    sql: \n    SELECT * FROM supper_market_info WHERE 商品类别='新鲜水果'\n    -----------------\n    llm result: ```sql\n    SELECT * FROM supper_market_info WHERE 商品类别='新鲜水果'\n    ```\n\n\n从上面我们看到，商品类别不在是 \"水果\" 而是 修订为 \"新鲜水果\"\n\n### 增加知识优化\n当计算某些特殊知识的时候，大模型是不知道的，所以需要告诉大模型具体的知识，比如:\n利润率的计算方式: 利润/销售额\n可以将该知识注入。具体示例如下:\n\n\n```python\n# 注入知识\ngbi_nl2sql.knowledge[\"利润率\"] = \"计算方式: 利润/销售额\"\n```\n\n\n```python\nquery3 = \"列出商品类别是日用品的利润率\"\nmsg3 = Message(query3)\n\nnl2sql_result_message3 = gbi_nl2sql(Message({\"query\": \"列出商品类别是日用品的利润率\"}))\nprint(f\"sql: {nl2sql_result_message3.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message3.content.llm_result}\")\n```\n\n    sql: \n    SELECT 商品类别, SUM(利润)/SUM(销售额) AS 利润率\n    FROM supper_market_info\n    WHERE 商品类别 = '日用品'\n    GROUP BY 商品类别\n    -----------------\n    llm result: ```sql\n    SELECT 商品类别, SUM(利润)/SUM(销售额) AS 利润率\n    FROM supper_market_info\n    WHERE 商品类别 = '日用品'\n    GROUP BY 商品类别\n    ```\n\n\n## 调整 prompt 模版\n有时候，我们希望定义自己的prompt, 但是必须遵循对应的 prompt 模版的格式。\n\n\n问表的 prompt template 必须包含:\n1. {schema} - 表的 schema 信息\n2. {instrument} - 列选限制的信息\n3. {kg} - 知识\n4. {date} - 时间\n5. {history_prompt} - 历史\n6. {query} - 当前问题\n\n参考下面的示例\n\n\n```python\nNL2SQL_PROMPT_TEMPLATE = \"\"\"\n  MySql 表 Schema 如下:\n  {schema}\n  请根据用户当前问题，联系历史信息，仅编写1个sql，其中 sql 语句需要使用```sql ```这种 markdown 形式给出。\n  请参考列选信息：\n  {instrument}\n  请参考知识:\n  {kg}\n  当前时间：{date}\n  历史信息如下:\n  {history_prompt}\n  当前问题：\"{query}\"\n  回答：\n\"\"\"\n```\n\n\n```python\ngbi_nl2sql5 = appbuilder.NL2Sql(model_name=\"ERNIE-Bot 4.0\", table_schemas=table_schemas, prompt_template=NL2SQL_PROMPT_TEMPLATE)\nnl2sql_result_message5 = gbi_nl2sql5(Message({\"query\": \"查看商品类别是水果的所有数据\"}))\n\nprint(f\"sql: {nl2sql_result_message5.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message5.content.llm_result}\")\n```\n\n    sql: \n    SELECT * FROM supper_market_info WHERE 商品类别 = '水果'\n    -----------------\n    llm result: ```sql\n    SELECT * FROM supper_market_info WHERE 商品类别 = '水果'\n    ```\n\n"
  },
  {
    "path": "docs/BasisModule/Components/gbi/select_table/README.md",
    "content": "# GBI 选表\n\n## 简介\nGBI 选表：根据提供的多个 MySql 表名 以及 表名对应的描述信息，通过 query 选择一个或多个最合适的表来回答该 query。\n一般的适用场景是，当有数据库有多个表的时候，但是实际只有1个表能回答该 query，那么，通过该能力将该表选择出来，用于后面的 问表 环节。\n\n\n### 功能介绍\nGBI 选表，根据提供的多个 MySql 表名 以及 表名对应的描述信息，通过 query 选择一个或多个最合适的表来回答该 query。\n一般的适用场景是，当有数据库有多个表的时候，但是实际只有1个表能回答该 query，那么，通过该能力将该表选择出来，用于后面的 问表 环节。\n\n### 特色优势\n可直接通过上传Excel进行数据问答\n\n### 应用场景\n1. 营销数据分析\n2. 表格问答\n\n\n## 基本用法\n下面是根据提供的表的描述信息以及 query 选择对应的表的示例。\n\n\n```python\nimport logging\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.gbi.basic import SessionRecord\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 表的描述信息, key: 表名; value: 是表的描述\ntable_descriptions = {\n    \"supper_market_info\": \"超市营收明细表，包含超市各种信息等\",\n    \"product_sales_info\": \"产品销售表\"\n}\n\n\n# 生成问表对象\nselect_table = appbuilder.SelectTable(model_name=\"ERNIE-Bot 4.0\", table_descriptions=table_descriptions)\nselect_table_result_message = select_table(Message({\"query\": \"列出超市中的所有数据\"}))\n\nprint(f\"选的表是: {select_table_result_message.content}\")\n```\n\n    选的表是: ['supper_market_info']\n\n\n## 参数说明\n### 初始化参数\n- model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, DeepSeek-V3.1\n- table_descriptions: 表的描述是个字典，key: 是表的名字, value: 是表的描述，例如:\n\n```\n{\n    \"supper_market_info\": \"超市营收明细表，包含超市各种信息等\",\n    \"product_sales_info\": \"产品销售表\"\n}\n```\n- prompt_template: prompt 模版, 必须包含如下:\n  1. {num} - 表的数量， 注意 {num} 有两个地方出现\n  2. {table_desc} - 表的描述\n  3. {query} - query\n  参考下面的示例:\n\n```\n你是一个专业的业务人员，下面有{num}张表，具体表名如下:\n{table_desc}\n请根据问题帮我选择上述1-{num}种的其中相关表并返回，可以为多表，也可以为单表,\n返回多张表请用“,”隔开\n返回格式请参考如下示例：\n问题:有多少个审核通过的投运单？\n回答: ```DWD_MAT_OPERATION```\n请严格参考示例只不要返回无关内容，直接给出最终答案后面的内容，分析步骤不要输出\n问题:{query}\n回答:\n```\n     \n### 调用参数\n- message: message.content 是用户的问题，包含的key: query, session\n  * query: 用户提出的问题\n  * session: SessionRecord 列表\n\n#### SessionRecord 初始化参数\n- query: 用户的问题\n- answer: gbi_nl2sql 返回的结果 NL2SqlResult\n  \n### 返回值\n识别的表名的列表例如:\n`[\"table_name\"]`\n\n## 调整 prompt 模版\n有时候，我们希望定义自己的prompt, 选表支持 prompt 模版的定制化，但是必须遵循对应的 prompt 模版的格式。\n\n### 选表 prompt 调整\n选表的 prompt template, 必须包含 \n1. {num} - 表的数量， 注意 {num} 有两个地方出现\n2. {table_desc} - 表的描述\n3. {query} - query, 参考下面的示例:\n\n\n```python\nSELECT_TABLE_PROMPT_TEMPLATE = \"\"\"\n你是一个专业的业务人员，下面有{num}张表，具体表名如下:\n{table_desc}\n请根据问题帮我选择上述1-{num}种的其中相关表并返回，可以为多表，也可以为单表,\n返回多张表请用“,”隔开\n返回格式请参考如下示例：\n问题:有多少个审核通过的投运单？\n回答: ```DWD_MAT_OPERATION```\n请严格参考示例只不要返回无关内容，直接给出最终答案后面的内容，分析步骤不要输出\n问题:{query}\n回答:\n\"\"\"\n```\n\n\n```python\nselect_table4 = appbuilder.SelectTable(model_name=\"ERNIE-Bot 4.0\", \n                                          table_descriptions=table_descriptions,\n                                          prompt_template=SELECT_TABLE_PROMPT_TEMPLATE)\n\nselect_table_result_message4 = select_table4(Message({\"query\": \"列出超市中的所有数据\"}))\n\nprint(f\"选的表是: {select_table_result_message4.content}\")\n```\n\n    选的表是: ['supper_market_info']\n\n"
  },
  {
    "path": "docs/BasisModule/Components/general_ocr/README.md",
    "content": "# 通用文字识别-高精度版（GeneralOCR）\n\n## 简介\n\n通用文字识别组件（GeneralOCR）支持多场景、多语种、高精度的文字识别服务，对图片全部文字内容进行检测识别。\n\n### 功能介绍\n覆盖多种通用场景、20+种语言的高精度整图文字检测和识别服务，包括各类印刷和手写文档、网络图片、表格、印章、数字、二维码等；\n\n### 特色优势\n* 准确率高\n\n    多项ICDAR指标居世界第一，识别准确率高\n### 应用场景\n支持多场景、多语种、高精度的文字识别服务，可用于纸质文档电子化、办公文档/报表识别、图像内容审核等场景\n## 基本用法\n\n以下是一个简单的例子来演示如何开始使用GeneralOCR组件：\n\n示例图片为![示例图片](https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae857a27513734d765495f89ffa5f73)\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\"\\\n    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\"\\\n    \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\"\\\n    \"857a27513734d765495f89ffa5f73\"\nraw_image = requests.get(image_url).content\ngeneral_ocr = appbuilder.GeneralOCR()\nout = general_ocr.run(appbuilder.Message(content={\"raw_image\": raw_image}))\nprint(out.content)\n```\n\n##  参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"})，图像数据，base64编码后进行urlencode，要求base64编码和urlencode后大小不超过10M，最短边至少15px，最长边最大8192px，支持jpg/jpeg/png/bmp格式 |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\n\n### 响应参数\n| 参数名称         | 参数类型    | 描述      | 示例值                                               |\n|--------------|---------|---------|---------------------------------------------------|\n| words_result | Array[] | 返回结果    | [{\"words\":\"一站式企业级大模型平台，提供先进的生成式AI生产及应用全流程开发工具链\"}] |\n| + words      | String  | 识别结果字符串 | \"百度智能云千帆大模型平台\"                                    |\n\n### 响应示例\n```json\n{\n    \"words_result\":[\n        {\n            \"words\":\"一站式企业级大模型平台，提供先进的生成式AI生产及应用全流程开发工具链\"\n        },\n        {\n            \"words\":\"百度智能云千帆大模型平台\"\n        },\n        {\n            \"words\":\"文心大模型4.0已正式发布，个人和企业客户可通过百度智能云千帆大模型平台接入使用\"\n        },\n        {\n            \"words\":\"立即使用\"\n        },\n        {\n            \"words\":\"在线体验\"\n        },\n        {\n            \"words\":\"使用文档\"\n        },\n        {\n            \"words\":\"定价说明\"\n        },\n        {\n            \"words\":\"千帆社区\"\n        },\n        {\n            \"words\":\"常见概念、使用指导\"\n        },\n        {\n            \"words\":\"定价、计费方式、计量说明\"\n        },\n        {\n            \"words\":\"大模型开发学习、交流社区\"\n        }\n    ]\n}\n```\n\n## 高级用法\n\n目前该模块仅提供基础通用文字识别功能。\n\n\n## 更新记录和贡献\n* 通用文字识别能力 (2023-12)\n"
  },
  {
    "path": "docs/BasisModule/Components/handwrite_ocr/README.md",
    "content": "# 手写文字识别 （HandwriteOCR）\n\n## 简介\n手写文字识别 （HandwriteOCR），图片中的手写中文、手写数字进行检测和识别，针对不规则的手写字体进行专项优化，识别准确率可达90%以上。\n\n\n### 功能介绍\n检测识别图片中的手写中文、手写数字，针对不规则的手写字体进行专项优化\n\n\n### 特色优势\n识别准确率可达90%以上\n\n### 应用场景\n手写文字识别\n\n\n## 基本用法\n\n下面是手写文字识别的代码示例：\n\n示例图片为 ![示例图片](https://bj.bcebos.com/v1/appbuilder/test_handwrite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b)\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\nimage_url=\"https://bj.bcebos.com/v1/appbuilder/test_handwrite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b\"\n\n# 从BOS存储读取样例文件\nraw_image = requests.get(image_url).content\ninp = appbuilder.Message(content={\"raw_image\": raw_image})\n# inp = Message(content={\"url\": image_url})\n\n# 运行手写文字识别\nhandwrite_ocr = appbuilder.HandwriteOCR()\nout = handwrite_ocr.run(inp)\n# 打印识别结果\nprint(out.content) \n\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数 \n| 参数名称       | 参数类型   | 是否必须 | 描述                          |示例值|\n|------------|--------|------|-----------------------------|---|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 ||\n| +content   | Dict   | 是    | 消息内容                        ||\n| +raw_image | String | 否    | 原始图片字节流                     ||\n| +url       | String   | 否    | 图片下载链接地址                    ||\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer| 否    | HTTP重试次数                    |3||\n\n   \n### 响应参数\n| 参数名称      | 参数类型     | 描述 | 示例值                                                             |\n|-----------|----------|--|-----------------------------------------------------------------|\n| contents  | List     | 文本内容块 | |\n| +text     | String   | 文本字符串 | |\n| +Position | Dict     | 文本位置信息 | |\n| ++left    | Interger | 表示定位位置的长方形左上顶点的水平坐标 | |\n| ++top      | Interger |  表示定位位置的长方形左上顶点的垂直坐标| |\n| ++width   | Interger | 表示定位位置的长方形的宽度 | |\n| ++height  | Interger | 表示定位位置的长方形的高度 | |\n| direction | Interger | 图像旋转角度 | 图像旋转角度，0（正向），- 1（逆时针90度），- 2（逆时针180度），- 3（逆时针270度）|\n\n### 响应示例\n```json\n{\n\t\"contents\": [{\n\t\t\t\"text\": \"我们家住的小区里有很多银杏树。\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 390,\n\t\t\t\t\"top\": 46,\n\t\t\t\t\"width\": 1801,\n\t\t\t\t\"height\": 161\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"它们笔直笔直的,就像一位正在站岗的\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 131,\n\t\t\t\t\"top\": 263,\n\t\t\t\t\"width\": 2083,\n\t\t\t\t\"height\": 170\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"卫兵。它枝繁叶茂,长的非常好,它的叶子\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 154,\n\t\t\t\t\"top\": 483,\n\t\t\t\t\"width\": 2023,\n\t\t\t\t\"height\": 161\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"有些小的像一把把小扇子,大的也像扇子。\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 151,\n\t\t\t\t\"top\": 699,\n\t\t\t\t\"width\": 2167,\n\t\t\t\t\"height\": 168\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"但是中间有一个缺口,就像被淘汽的小\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 148,\n\t\t\t\t\"top\": 929,\n\t\t\t\t\"width\": 2123,\n\t\t\t\t\"height\": 177\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"朋友用剪刀剪掉了一样。\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 161,\n\t\t\t\t\"top\": 1165,\n\t\t\t\t\"width\": 1340,\n\t\t\t\t\"height\": 217\n\t\t\t}\n\t\t}\n\t],\n\t\"direction\": 0\n}\n```\n\n\n## 高级用法\n目前该模块仅提供基础的手写体识别。\n\n\n## 更新记录和贡献\n* 手写文字识别 (2024-01)\n* 手写文字识别 (2024-02)\n"
  },
  {
    "path": "docs/BasisModule/Components/image_understand/README.md",
    "content": "# 图像内容理解 （ImageUnderstand）\n\n## 简介\n图像内容理解 （ImageUnderstand），输出理解图片后的文本信息\n### 功能介绍\n支持输入图片和提问信息，可对输入图片进行理解，输出对图片的一句话描述\n### 特色优势\n同时，支持客户自主选择，是否调用大模型对输出文本进行润色，目前支持百度文心大模型调用。\n\n### 应用场景\n图像内容理解\n\n## 基本用法\n\n下面是图像内容理解的代码示例：\n\n示例图片为：![示例图片](https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6)\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 从BOS存储读取样例文件\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6\"\nraw_image = requests.get(image_url).content\n# 输入参数为一张图片\ninp = appbuilder.Message(content={\"raw_image\": raw_image, \"question\": \"图片里内容是什么?\"})\n# 进行图像内容理解\nimage_understand = appbuilder.ImageUnderstand()\nout = image_understand.run(inp)\n# 打印识别结果\nprint(out.content)\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n\n| 参数名称       | 参数类型   | 是否必须 | 描述                                | 示例值 |\n|------------|--------|------|-----------------------------------|-----|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数       |     |\n| +content   | Dict   | 是    | 消息内容                              |     |\n| +raw_image | String | 否    | 原始图片字节流                           |     |\n| +url       | String | 否    | 图片下载链接地址                          |     |\n| +question  | String | 是    | 问题字符串，长度小于100                     |     |\n| +language  | String | 否    | 描述内容的所使用的语言，默认是zh-CN（中文），可选en(英文) |     |\n\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry| Integer | 否    | HTTP重试次数                    |3||\n\n### 响应参数\n| 参数名称      | 参数类型 | 描述     | 示例值                                             |\n|-----------|------|--------|-------------------------------------------------|\n|  description | String  | 图像理解内容 | \"用户上传的图像，经过前期模型分析存在以下信息：;;整个图像内容\"                                                |\n\n### 响应示例\n```json\n{\n\t\"description\": \"用户上传的图像，经过前期模型分析存在以下信息：;;整个图像内容可以表述为：...，回答如下问题：图片里内容是什么?, 注意不要复述提供的资料内容\"\n}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n目前该模块仅提供基础的图像内容理解。\n\n## 更新记录和贡献\n* 图像内容理解 (2024-01)"
  },
  {
    "path": "docs/BasisModule/Components/landmark_recognize/README.md",
    "content": "# 地标识别（LandmarkRecognition）\n\n## 简介\n地标识别组件（LandmarkRecognition）可以识别12万中外著名地标、热门景点，可返回地标名称。\n\n### 功能介绍\n识别中外著名地标、热门景点，可返回地标名称\n\n### 特色优势\n可以识别12万中外著名地标、热门景点\n\n### 应用场景\n地点识别\n\n\n## 基本用法\n\n下面是地标识别的代码示例：\n\n示例图片为：![示例图片](https://bj.bcebos.com/v1/appbuilder/landmark_test.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A59%3A56Z%2F-1%2Fhost%2Fc249a068c6f321b91da0d0fd629b26ded58dcac2b6a3674f32378f5eb8df1ed0)\n\n```python\nimport os\n\nimport requests\n\nimport appbuilder\n\n#  请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n# 从BOS存储读取样例文件\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/landmark_test.jpeg?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n            \"11T10%3A59%3A56Z%2F-1%2Fhost%2Fc249a068c6f321b91\" \\\n            \"da0d0fd629b26ded58dcac2b6a3674f32378f5eb8df1ed0\"\nraw_image = requests.get(image_url).content\n# 输入参数为一张图片\ninp = appbuilder.Message(content={\"raw_image\": raw_image})\n# 进行地标识别\nlandmark_recognize = appbuilder.LandmarkRecognition()\nout = landmark_recognize.run(inp)\n# 打印识别结果\nprint(out.content) # eg: {\"landmark\": \"尼罗河\"}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数 \n| 参数名称       | 参数类型   | 是否必须 | 描述                          |示例值|\n|------------|--------|------|-----------------------------|---|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 ||\n| +content   | Dict   | 是    | 消息内容                        ||\n| +raw_image | String | 否    | 原始图片字节流                     ||\n| +url       | String   | 否    | 图片下载链接地址                    ||\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer| 否    | HTTP重试次数                    |3||\n\n### 响应参数\n| 参数名称     | 参数类型 | 描述   | 示例值    |\n|----------|------|------|--------|\n| landmark | str  | 地标名字 | 比如：尼罗河 |\n### 响应示例\n```json\n{\"landmark\": \"尼罗河\"}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n目前该模块仅提供基础的地标识别。\n\n## 更新记录和贡献\n* 地标识别 (2024-01)\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/dialog_summary/README.md",
    "content": "# 会话小结（DialogSummary）\n\n## 简介\n会话小结（DialogSummary）基于生成式大模型对一段用户与坐席的对话生成总结，结果按{\"诉求\": \"\", \"回应\": \"\", \"解决情况\": \"\"}格式输出。适用于运营商、金融、汽车等多种场景的对话总结。\n\n### 功能介绍\n基于生成式大模型对一段用户与坐席的对话生成总结。\n\n### 特色优势\n基于生成式大模型对一段用户与坐席的对话生成总结，结果按{\"诉求\": \"\", \"回应\": \"\", \"解决情况\": \"\"}格式输出。\n\n### 应用场景\n适用于运营商、金融、汽车等多种场景的对话总结。\n\n## 基本用法\n\n为了快速开始使用会话小结组件，您可以参考以下步骤：\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n\ndialog_summary = appbuilder.DialogSummary(\"DeepSeek-V3.1\")\ntext = \"用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见\"\nanswer = dialog_summary(appbuilder.Message(text))\nprint(answer)\n```\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model` (str|None): 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n### 调用参数\n|参数名称 |参数类型 | 是否必须 | 描述                                                                          | 示例值           |\n|--------|--------|---|-----------------------------------------------------------------------------|---------------|\n|message |Message  | 是 | 输入消息，包含用户提出的问题。                                                             | Message(\"你好\") |\n|stream|bool| 否 | 是否以流式形式返回响应                                                                 | False         |\n|temperature|float| 否 | 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 0.0001        |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|对象，包含模型运行后的输出消息。|\n### 响应示例\n```json\n{\"result\": [\"您话费余的话还有87.49元钱\"]}\n```\n### 错误码\n无\n\n## 高级用法\n\n暂无\n\n## 示例和案例研究\n\n目前暂无具体的实际应用案例。\n\n## API文档\n\n暂无\n\n## 更新记录和贡献\n* 会话小结更新Readme (2023-12)\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/hallucination_detection/README.md",
    "content": "# 幻觉检测（Hallucination Detection）\n\n## 简介\n幻觉检测（Hallucination Detection）针对问答场景，检测答案中是否存在幻觉。\n\n### 功能介绍\n幻觉检测（Hallucination Detection）针对问答场景，检测答案中是否存在幻觉。\n\n### 特色优势\n无。\n\n### 应用场景\n问答场景，比如RAG问答。\n\n## 基本用法\n\n下面是幻觉检测的代码示例：\n\n```python\nimport os\nimport appbuilder\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ['APPBUILDER_TOKEN'] = '...'\n\n\nquery = '澳门新麻蒲烤肉店每天开门吗？'\ncontext = \\\n'''澳门美食： 澳门新麻蒲韩国烤肉店\n在澳门一年四季之中除了火锅，烤肉也相当受欢迎。提到韩烧，有一间令我印象最深刻，就是号称韩国第一的烤肉店－新麻蒲韩国烤肉店，光是韩国的分店便多达四百多间，海外分店更是遍布世界各地，2016年便落户澳门筷子基区，在原本已经食肆林立的地方一起百花齐放！店内的装修跟韩国分店还完度几乎没差，让食客彷如置身于韩国的感觉，还要大赞其抽风系统不俗，离开时身上都不会沾上烤肉味耶！\n时间：周一至周日 下午5:00 - 上午3:00\n电话：＋853 2823 4012\n地址：澳门筷子基船澳街海擎天第三座地下O号铺96号\n必食推介:\n护心肉二人套餐\n来新麻蒲必试的有两样东西，现在差不多每间烤肉店都有炉边烤蛋，但大家知道吗？原来新麻蒲就是炉边烤蛋的开创者，既然是始祖，这已经是个非吃不可的理由！还有一款必试的就是护心肉，即是猪的横隔膜与肝中间的部分，每头猪也只有200克这种肉，非常珍贵，其味道吃起来有种独特的肉香味，跟牛护心肉一样精彩！\n秘制猪皮\n很多怕胖的女生看到猪皮就怕怕，但其实猪皮含有大量胶原蛋白，营养价值很高呢！这里红通通的猪皮还经过韩国秘制酱汁处理过，会有一点点辣味。烤猪皮的时候也需特别注意火侯，这样吃起来才会有外脆内Q的口感！'''\nanswer = '澳门新麻蒲烤肉店并不是每天开门。'\n\n#! 该组件推荐使用DeepSeek-V3.1模型。\nhallucination_detection = appbuilder.HallucinationDetection('DeepSeek-V3.1')\ninputs = {'query': query, 'context': context, 'answer': answer}\nmsg = appbuilder.Message(inputs)\nresult = hallucination_detection.run(msg)\n\nprint(result)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `model` | str | 是 | 模型名称，用于指定要使用的千帆模型。推荐使用DeepSeek-V3.1模型。 | DeepSeek-V3.1 |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入信息，用于传入用户查询query、根据query得到的检索结果context和基于context生成的query的答案answer。 | Message(content={'query': '...', 'context': '...', 'answer': '...'}) |\n| `stream` | bool | 否 | 指定是否以流式形式返回响应。默认为 False。 | False |\n| `temperature` | float | 否 | 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 0.1 |\n| `top_p` | float | 否 | 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0.0。 | 0.0 |\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果（可通过result.content获取结果核心内容） | Message(content='...') |\n\n### 响应示例\n```\nMessage(name=msg, content=存在幻觉, mtype=dict, extra={}, token_usage={'prompt_tokens': 748, 'completion_tokens': 2, 'total_tokens': 750})\n```\n\n### 错误码\n|错误码|描述|\n| ------ | ------ |\n\n## 高级用法\n可用于RAG问答的答案检测。\n\n## 更新记录和贡献\n### 2024.5.22\n#### [Added]\n- 增加幻觉检测组件。\n- 增加幻觉检测组件单元测试。"
  },
  {
    "path": "docs/BasisModule/Components/llms/is_complex_query/README.md",
    "content": "# 复杂Query判定（IsComplexQuery）\n\n## 简介\n复杂Query判定组件（IsComplexQuery）可以根据输入的提问进行初步的分类，区分简单问题和复杂问题，以便后续运用不同的处理流程处理。可应用于知识问答场景。\n\n### 功能介绍\n在知识问答领域中存在很多复杂问题需要处理，这些复杂问题通常需要进行问题分解并采用分治的方法处理。复杂Query判定组件尝试定义复杂问题和简单问题的概念，对用户的问题进行初步的分类，方便下游使用不同类型的流程来处理当前的简单问题/复杂问题。\n\n### 特色优势\n复杂Query判定组件通过对问题进行有效分类，系统可以更快速地将简单问题导向快速回答流程，而将复杂问题导向更深入的分析流程。这种判定能力可以提高整个问答系统的效率和准确性。\n\n### 应用场景\n广泛应用于知识问答场景\n\n## 基本用法\n下面是复杂Query判定的代码示例：\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nis_complex_query = appbuilder.IsComplexQuery(model=\"DeepSeek-V3.1\")\n\nmsg = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\nmsg = appbuilder.Message(msg)\nanswer = is_complex_query(msg)\n\nprint(\"Answer: \\n{}\".format(answer.content))\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|model |str  |是 |模型名称，用于指定要使用的千帆模型|DeepSeek-V3.1|\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |obj:`Message`|是 |输入消息，用于模型的主要输入内容。这是一个必需的参数| |\n|stream|bool|否 |指定是否以流式形式返回响应。默认为 False|False|\n|temperature|float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10|1e-10|\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|Message |obj:`Message` |输出消息，包含模型运行后的输出| |\n\n### 响应示例\n```text\n分析：这个问题涉及到吸塑包装盒在工业化生产和物流运输中的重要性。回答这个问题需要从多个角度来考虑，比如生产方面、运输方面、环保方面等。这需要对吸塑包装盒有深入的了解，并且需要考虑到生产、运输等各个环节。因此，这是一个复杂问题。\n类型：复杂问题\n```\n\n### 错误码\n无\n\n## 高级用法\n你可以通过自定义调整参数来获得想要的结果，例如：\n```python\n# 流式返回, 调整模型temperature参数\nanswer = is_complex_query(msg, stream=True, temperature=0.5)\n```\n\n## 更新记录和贡献\n* 复杂Query判定 (2024-01)\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/mrc/README.md",
    "content": "# 阅读理解问答（MRC）\n\n## 简介\n阅读理解问答（MRC）组件是基于生成式大模型的阅读理解问答系统。该组件支持拒答、澄清、重点强调、友好性提升、溯源等多种功能，可用于回答用户提出的问题。\n\n### 功能介绍\nMRC（阅读理解问答模块）是一项先进的自然语言处理功能，旨在使机器能够理解、分析文本内容，并基于这些内容回答相关问题。 本模块基于大语言模型，提供对文本内容的深入理解和精确回答能力。\n\n### 特色优势\n我们的MRC模块，基于百度自研的先进语言模型文新一言，提供了一系列强大的阅读理解问答功能。在保持文本理解和问题回答的高精度的同时，\n我们特别强调了答案的质量和交互体验。以下是我们MRC模块的几个主要功能特色：\n - 1.多版本模型支持：我们的MRC模块包括不同版本的文新一言大模型，Erniebot 4.0、DeepSeek-V3.1等，每个版本都针对特定的应用场景进行了优化。 用户可以根据自己的需求选择最适合的模型版本，以获得最佳的性能。\n - 2.答案格式的多样性：\n   - 拒答功能：当问题超出模型知识范围或不具体时，模型可以选择不回答，避免提供误导性信息。\n   - 澄清功能：对于模棱两可或含糊的问题，模型可以请求更多信息或对问题进行澄清，以确保答案的准确性。\n   - 重点内容强调：模型可以识别并强调答案中的关键信息，使答案更清晰、更易于理解。\n   - 友好度提升：模型可以以更自然、更亲切礼貌的方式呈现答案，且必要时对答案进行分点论述，改善用户体验。\n   - 答案溯源：模型能提供答案的来源信息，增强答案的可信度和透明度。\n\n - 3.灵活的功能开关：每项功能都配备了开关，用户可以根据不同的应用场景和需求，灵活地启用或关闭某些功能。这种可定制性确保了MRC模块能够在各种环境下提供最优化的表现。\n\n### 应用场景\n我们的MRC模块，凭借文心大模型强大的文本理解能力，以及多功能性，已在多个领域展现出显著的价值。\n - 政务服务：在政务领域，MRC模块可以帮助构建智能问答系统，为公民提供关于政策、法规和服务程序的即时信息。它可以通过理解复杂的政府文件和公文，准确回答与政策相关的查询，极大地提高政府服务的效率和透明度。\n - 法律咨询：法律领域充满了专业术语和复杂的概念。我们的MRC模块能够深入理解法律文献和案例，为法律专业人士和普通民众提供准确的法律咨询。无论是寻找相关法条还是理解特定法律案例，MRC模块都能提供快速、可靠的帮助。\n - 医疗健康：在医疗健康领域，准确的信息至关重要。MRC模块能够解析医学文献、病例报告和临床试验数据，为医生和研究人员提供支持，帮助他们在诊断、治疗和研究中做出更明智的决策。此外，它也能在患者咨询中发挥作用，为患者提供关于疾病、治疗方案和药物的详细信息。\n - 教育和研究：MRC模块可以作为学习和研究的强大工具，帮助学生和研究人员快速找到他们需要的信息。无论是解答学术问题，还是提供详细的背景资料，MRC模块都能提供卓越的支持。\n - 企业客户服务：企业可以利用MRC模块构建高效的客服系统，提供24/7的咨询服务。从产品详情到服务流程的解释，MRC模块都能提供准确、及时的答案，提升客户满意度并减轻人工客服的压力。\n - 金融咨询：在金融领域，MRC模块可以帮助用户理解复杂的金融产品、市场趋势和投资策略。通过提供准确的数据解读和市场分析，MRC模块能够辅助投资者和金融专业人士做出更明智的决策。\n除上述场景以外，还可应用于其他更多生产生活的场景中。\n\n## 基本用法\n\n### 快速开启\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 创建MRC对象\nmrc_component = appbuilder.MRC(model=\"DeepSeek-V3.1\")\n\n# 初始化参数\nmsg = \"残疾人怎么办相关证件\"\nmsg = appbuilder.Message(msg)\ncontext_list = appbuilder.Message([\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）\"\"\",\n                    \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\nC5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n北京市无障碍环境建设促进中心\"\"\"])\n\n# 模拟运行MRC基本组件\nresult = mrc_component.run(msg, context_list)\n\n# 输出运行结果\nprint(result)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nimport os\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n|参数名称 |参数类型 | 是否必须 |描述 | 示例值                                      |\n|--------|--------|---|----|------------------------------------------|\n|msg |Message  | 是 |输入消息，包含用户提出的问题。| Message(\"你好\")                            |\n|context_list|Message| 是 |用户输入的问题对应的段落文本列表。| Message([\"\"\"context1\"\"\",\"\"\"context2\"\"\"]) |\n|reject|bool| 否 |拒绝开关，如果为 True，则启用该能力。默认为 False。当输入的问题在context_list中没有找到答案时，开关开启时，模型会用特定话术(\"当前文档库找不到对应的答案，我可以尝试用我的常识来回答你。\")做回复的开头，并后接自有知识做回复内容。| eg.示例值                                   |\n|clarify|bool| 否 |澄清开关，如果为 True，则启用该能力。默认为 False。 当输入的问题比较模糊、或者主体指代不清晰，且context_list中包含有可以回答该模糊问题的多种潜在备选答案时，开启该开关，大模型会以特定的话术做澄清反问，引导用户继续补充问题发问。举例子，query:发电机的续航时间？ Answer: 根据搜索结果得到了xx和xx两种型号的发电机，您的问题具体涉及到哪一个？请补充关键信息，作为完整的问题重新发问。| eg.示例值                                   |\n|highlight|bool| 否 |重点强调开关，如果为 True，则启用该能力。默认为 False。开启该功能时，回复结果中会高亮显示关键部分的内容。| 加粗的部分是**重点内容**                           |\n|friendly|bool| 否 |友好性提升开关，如果为 True，则启用该能力。默认为 False。开关开启时，部分回复的开头会加礼貌用语。且如果回答涉及到大段的信息，会倾向于以<总-分>或者<总-分-总>的形式做分点论述，使得答案的格式更规整，可读性更强。| eg.示例值                                   |\n|cite|bool| 否 |溯源开关，如果为 True，则启用该能力。默认为 False。开关开启时，回复内容后会接形如(^[1]^)的标记来表示回答内容在原文(context_list)中的来源索引。例如：按照当地公安机关出入境管理部门规定的其他材料办理^[2]^。| eg.示例值                                   |\n|temperature|float| 否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。| 0.0001                                   |\n\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|对象，包含模型运行后的输出消息。|\n### 响应示例\n```json\n{\"result\": \"极氪007的售价区间为20.99~29.99万元。\"}\n```\n\n### 错误码\n无\n\n\n\n## 高级用法\n该组件的高级用法包括定制化的输入处理、输出处理，以及更复杂的调用场景。用户可以根据具体需求扩展组件功能，实现个性化的问答系统。\n包括如下功能：\n1、拒答\n2、澄清反问\n3、重点强调\n4、友好度提升\n5、溯源\n\n\n### 代码样例\n```python\nimport appbuilder\nimport os\n\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建MRC对象\nmrc_component = appbuilder.MRC(model=\"DeepSeek-V3.1\")\n\n# 初始化参数\nmsg = \"残疾人怎么办相关证件\"\nmsg = appbuilder.Message(msg)\ncontext_list = appbuilder.Message([\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）\"\"\",\n                    \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\nC5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n北京市无障碍环境建设促进中心\"\"\"])\n\n# 模拟运行MRC组件，开启拒答、澄清追问、重点强调、友好性提升和溯源能力五个功能\nresult = mrc_component.run(msg, context_list, reject=True,\n                           clarify=True, highlight=True, friendly=True, cite=True)\n\n# 输出运行结果\nprint(result)\n```\n\n## 更新记录和贡献\n* 阅读理解问答 (2023-12)\n\n\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/nl2pandas/README.md",
    "content": "# 自然语言转pandas (nl2pandas)\n\n## 简介\n自然语言转pandas (nl2pandas)这个组件通过理解对表格信息的提问，生成对应语义的可执行Python代码，主要使用Pandas库。它可以用于基于表格的查询，问答等多种场景。\n\n### 功能介绍\n自然语言转pandas (nl2pandas)根据用户的输入的表格信息和查询query，利用大语言模型的理解和生成能力，自动生成符合查询语义的一行或多行pandas代码。\n\n### 特色优势\n自然语言转pandas (nl2pandas)，基于百度自研的大语言模型文心一言，提供内置的自然语言转pandas代码的能力，无需更多的prompt描述，即可生成对应的查询代码。\n\n### 应用场景\n自然语言转pandas (nl2pandas)可用对结构化表格数据的自然语言查询场景，问答场景等。\n\n## 基本用法\n这里是一个简单示例，展示如何使用自然语言转Pandas组件：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n#定义表格信息 假设有一个小学学校表格，包含学校名、所属地区、创办时间、类别、学生人数、教职工人数、教学班数量等列。列名后给出示例（例如清华附小是学校名的示例），以及列值类型（字符串类型、数字值类型），最后给出列名的解释。列之间使用换行符分隔。\ntable_info = '''表格列信息如下：\\n学校名 : 清华附小 , 字符串类型，代表小学学校的名称\\n所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\\n创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\\n类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\\n学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\\n教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\\n教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量'''\n\n#定义查询问题\nquery = \"海淀区有哪些学校\"\nquery = appbuilder.Message(query)\n\n#定义并运行Nl2pandas实例，得到结果\nnl2pandas = appbuilder.Nl2pandasComponent(model=\"DeepSeek-V3.1\")\nanswer = nl2pandas(query, table_info = table_info)\n```\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|query |Message | 是 | 查询语句，一般是针对表格信息的提问 |例如'海淀区的小学有哪些'。建议长度是50字以内。 |\n|table_info |str | 是 | 表格信息，是表格列名以及对应列名的举例和释义 |例如：’表格列信息如下：\\n学校名 : 清华附小 , 字符串类型，代表小学学校的名称\\n所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\\n创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\\n类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\\n学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\\n教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\\n教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量‘ |\n|stream |bool | 否 |指定是否以流式形式返回响应。默认为 False。 |False |\n|temperature |float | 否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 |0.7 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|Message(content=\"df.loc[df['所属地区'] == \"海淀区\",\"学校名\"]\")|\n\n## 高级用法\n\n多个表格查询或跨表查询场景。\n\n## 更新记录和贡献\n\n- 初始版本发布(2023-10)"
  },
  {
    "path": "docs/BasisModule/Components/llms/oral_query_generation/README.md",
    "content": "# 口语化Query生成（Oral Query Generation）\n\n## 简介\n口语化Query生成组件（Oral Query Generation）可以基于输入文本生成与文档内容相关的Query。\n\n### 功能介绍\n基于输入文本生成与文档内容相关的Query。\n\n### 特色优势\n生成的query划分为问题和短语两种类型，可分别用于不同场景。\n\n### 应用场景\n可用于推荐问题生成、标签生成、文档索引增强等。\n\n## 基本用法\n### 快速开始\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n\ntext = ('文档标题：在OPPO Reno5上使用视频超级防抖\\n'\n        '文档摘要：OPPO Reno5上的视频超级防抖，视频超级防抖3.0，多代视频防抖算法积累，这一代依旧超级防抖超级稳。 开启视频超级'\n        '防抖 开启路径：打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能，开启超级'\n        '防抖后手机屏幕将出现超级防抖Pro开关，点击即可开启或关闭。 除此之外，前置视频同样加持防抖算法，边走边拍也能稳定聚焦脸部'\n        '，实时视频分享您的生活。')\n\n#! 该组件推荐使用DeepSeek-V3.1模型。\noral_query_generation = appbuilder.OralQueryGeneration(model='DeepSeek-V3.1')\nresult = oral_query_generation(appbuilder.Message(text), query_type='全部', output_format='str')\n\nprint(result)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `model` | str | 是 | 模型名称，用于指定要使用的千帆模型。推荐使用DeepSeek-V3.1模型。 | DeepSeek-V3.1 |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入消息，用于模型的主要输入内容。 | Message(content='...') |\n| `query_type` | str | 否 | 待生成的query类型，包括问题、短语和全部（问题+短语）。默认为全部。 | 全部 |\n| `output_format` | str | 否 | 输出格式，包括json和str。默认为str。 | str |\n| `stream` | bool | 否 | 指定是否以流式形式返回响应。默认为 False。 | False |\n| `temperature` | float | 否 | 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 0.1 |\n| `top_p` | float | 否 | 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0.0。 | 0.0 |\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果 | Message(content='...') |\n\n### 响应示例\n```\nMessage(name=msg, content=1. OPPO Reno5上有什么特殊的功能？\n2. 视频超级防抖是什么？\n3. 视频超级防抖有什么作用？\n4. 如何在OPPO Reno5上开启视频超级防抖？\n5. 视频超级防抖Pro是什么？\n6. 开启视频超级防抖后，屏幕上会出现什么？\n7. 前置视频有防抖算法吗？\n8. OPPO Reno5上的视频超级防抖\n9. 视频超级防抖3.0\n10. 多代视频防抖算法积累的作用\n11. 开启视频超级防抖的方法\n12. 视频超级防抖Pro的功能\n13. 开启视频超级防抖后，屏幕上会出现的东西\n14. 前置视频防抖算法的作用, mtype=dict, extra={})\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.5.22\n#### [Updated]\n- 升级能力，主要升级内容如下：\n  - 生成的query要求能够使用输入文本进行回答。\n  - 生成的query划分为问题和短语类型。\n  - 生成的query数量不再限制为10个。\n- 在调用组件时，支持输出问题、短语或全部（问题 + 短语）；支持输出格式为json或者str（兼容之前版本的输出格式）。\n\n### 2024.1.24\n#### [Updated]\n- 更新README。\n\n### 2023.12.07\n#### [Added]\n- 增加口语化Query生成组件。\n- 增加口语化Query生成组件单元测试。"
  },
  {
    "path": "docs/BasisModule/Components/llms/playground/README.md",
    "content": "# 空应用（Playground）\n\n## 简介\nPlayground空应用（Playground）是一款灵活的组件，允许用户自定义prompt模板并执行。\n\n\n### 功能介绍\nPlayground空应用（Playground）是一款灵活的组件，允许用户自定义prompt模板并执行。它适用于各种场景，特别是在需要自定义输入模板和使用预训练模型进行交互的情况下。\n\n### 特色优势\n灵活可自定义，用户可自由定义提示词，来跟大模型进行交互。\n\n### 应用场景\n在需要灵活定义提示词的场景，并且其他提供的开箱即用的组件无法满足的情况下使用。\n\n## 基本用法\n\n要开始使用 Playground，你需要设置prompt模板和模型名称。以下是一个基本示例：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nplay = appbuilder.Playground(\n    prompt_template=\"你好，{name}，我是{bot_name}，{bot_name}是一个{bot_type}，我可以{bot_function}，你可以问我{bot_question}。\",\n    model=\"DeepSeek-V3.1\"\n)\nplay(appbuilder.Message({\"name\": \"小明\", \"bot_name\": \"小红\", \"bot_type\": \"聊天机器人\", \"bot_function\": \"聊天\", \"bot_question\": \"你好吗？\"}), stream=False)\n```\n\n## 参数说明\n### 初始化参数\n\n| 参数名称           | 类型         | 说明                               |\n|----------------|------------|----------------------------------|\n| prompt_template | str        | 输入模板，用于指定prompt格式。                 |\n| model           | str \\| None | 模型名称，用于指定要使用的千帆模型。 |\n\n### 调用参数\n\n| 参数名称      | 类型            | 说明                         | 默认值  |\n|-----------|---------------|----------------------------|------|\n| message   | obj:`Message` | 输入消息，必需参数。              | 无    |\n| stream    | bool          | 是否以流式形式返回响应。           | False |\n| temperature | float        | 模型配置的温度参数。              | 1e-10 |\n| max_output_tokens | int        |  指定生成的文本的最大长度，默认最大输出token数为1024, 最小为2， 最大输出token与选择的模型有关           | 1024  |\n|disable_search| bool         | 是否关闭搜索功能，默认关闭          | True  |\n|response_format| str         | 指定返回的响应格式，可选值有：`text`, `json_object`| text  |\n|stop| str                   | 生成停止标识，当模型生成结果以stop中某个元素结尾时，停止文本生成。每个元素长度不超过20字符,最多4个元素.         | []  |\n\n\n### 响应参数\n\n| 类型             | 说明                 |\n|----------------|--------------------|\n| obj:`Message` | 模型运行后的输出消息。 |\n\n### 响应示例\n```json\n{\"result\": \"北京科技馆。\"}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n\n## 高级用法\n此部分可根据实际应用场景提供更复杂的示例和用法说明。\n\n## 示例和案例研究\n目前暂无具体案例，将在未来更新。\n\n## API文档\n无\n\n## 更新记录和贡献\n- 2024年01月24日 更新Readme格式，调整请求参数样式，新增特色优势\n- 2024年08月01日 更新playground组件的入参，并且前向兼容，支持未来的大模型对话参数\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/qa_pair_mining/README.md",
    "content": "# 问答对挖掘（QAPairMining）\n\n## 简介\n问答对挖掘（QAPairMining）可以基于输入文本内容，快速生成多个问题及对应答案，极大提高信息提炼的效率和准确性。广泛用于在线客服、智能问答等领域。\n\n### 功能介绍\n基于输入文本内容，快速生成多个问题及对应答案；可与文档解析、分段联用，快速生成文档的问答对。\n\n### 特色优势\n问答对挖掘组件快速基于输入文本生成的问题和答案，准确率高；可快速依据文档生成FAQ，减少人工成本。\n\n### 适用场景\n适用于在线客服、智能问答等场景\n\n## 基本用法\n\n### 快速开始\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nqa_mining = appbuilder.QAPairMining(model=\"DeepSeek-V3.1\")\n# 输入文本（对此文本挖掘问答对）\nmsg = '2017年，工商银行根据外部宏观环境变化，及时调整业务策略，优化资产负债结构，' + \\\n    '保持存贷款业务协调发展，提升资产负债配置效率。' + \\\n    '2018年3月末，工商银行总资产264,937.81亿元，比上年末增加4,067.38亿元.'\nmsg = appbuilder.Message(msg)\nanswer = qa_mining(msg)\n\nprint(\">>> Output: {}\".format(answer.content))\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n| message | String |是 |输入消息，用于模型的主要输入内容。这是一个必需的参数。| `Message(\"2017年，工商银行根据...\")` |\n| stream |bool|否 |指定是否以流式形式返回响应。默认为 False。| False |\n| temperature |float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 1e-10 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n| result | String | 输出消息，包含模型运行后的输出内容。| 见响应示例 |\n\n### 响应示例\n```text\n问题：2017年，工商银行是如何应对外部宏观环境变化的？\n答案：工商银行根据外部宏观环境变化，及时调整业务策略，优化资产负债结构，保持存贷款业务协调发展，提升资产负债配置效率。\n\n问题：2018年3月末，工商银行总资产是多少？\n答案：264,937.81亿元。\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n\n基于一篇文档，快速生成多个问题及对应答案，极大提高信息提炼的效率和准确性。\n主要流程如下：\n\n1. 读取本地文档，文档解析分段，获取段落；\n2. 段落作为问答对挖掘的输入，挖掘问答对。 \n\n### 代码样例\n```python\nimport os\nimport requests\n\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder import Message, DocParser, DocSplitter, QAPairMining\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 进行文档内容解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"  # 待解析的文件路径\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\n\n# 解析文档\nmsg = Message(file_path)\nparser = DocParser()\nparse_result = parser.run(msg, return_raw=True)\n\n# 对文档进行分段落，split_by_chunk需要return_raw=True\nsplitter = DocSplitter(\n    splitter_type=\"split_by_chunk\", overlap=0)\nsplit_result = splitter(parse_result)\n\n# 每个段落抽取问答对，并返回结果\nfor doc_segment in split_result.content[\"paragraphs\"]:\n    qa_mining = QAPairMining(model=\"DeepSeek-V3.1\")\n    text = doc_segment.get(\"text\", \"\")\n    if text == \"\":\n        logger.error(\"Text is null. break\")\n        break\n    logger.info(\"Input: \\n{}\".format(text))\n    answer = qa_mining(Message(text))\n    logger.info(\"Output: \\n{}\".format(answer.content))\n    break # 样例代码只跑1个段落\n```\n\n## 更新记录和贡献\n* 问答对挖掘能力 (2023-12)\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/query_decomposition/README.md",
    "content": "# 复杂Query分解（QueryDecomposition）\n\n## 简介\n复杂Query分解（QueryDecomposition）可以将已经确定为复杂问题的原始问题拆解为一个个简单问题。广泛应用在知识问答场景。\n\n### 功能介绍\n在知识问答领域中存在很多复杂问题需要处理，这些复杂问题通常需要进行问题分解并采用分治的方法处理。复杂Query分解组件尝试对已经判定为复杂问题的原始问题进行拆解，把复杂问题拆解为一个个简单问题。\n\n### 特色优势\n复杂Query分解组件可以将复杂问题分解为不同层级的简单问题。这有助于更系统地分析和解决问题，提高答案的全面性。\n\n### 应用场景\n广泛应用于知识问答场景\n\n## 基本用法\n下面是复杂Query分解的代码示例：\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nquery_decomposition = appbuilder.QueryDecomposition(model=\"DeepSeek-V3.1\")\n\nmsg = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\nmsg = appbuilder.Message(msg)\nanswer = query_decomposition(msg)\n\nprint(\"Answer: \\n{}\".format(answer.content))\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|model |str  |是 |模型名称，用于指定要使用的千帆模型|DeepSeek-V3.1|\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |obj:`Message`|是 |输入消息，用于模型的主要输入内容。这是一个必需的参数| |\n|stream|bool|否 |指定是否以流式形式返回响应。默认为 False|False|\n|temperature|float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10|1e-10|\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|Message |obj:`Message` |输出消息，包含模型运行后的输出| |\n\n### 响应示例\n```text\n1. 吸塑包装盒在工业化生产中有什么重要性？\n2. 吸塑包装盒在物流运输中有什么重要性？\n```\n### 错误码\n无\n\n## 高级用法\n你可以通过自定义调整参数来获得想要的结果，例如：\n```python\n# 流式返回, 调整模型temperature参数\nanswer = query_decomposition(msg, stream=True, temperature=0.5)\n```\n\n## 更新记录和贡献\n* 复杂Query分解 (2024-01)\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/query_rewrite/README.md",
    "content": "# 多轮改写 (QueryRewrite)\n\n## 简介\n多轮改写组件 (QueryRewrite) 是一个用于处理多轮对话和查询改写的组件。它主要用于理解和优化用户与机器人的交互过程，进行指代消解及省略补全。该组件支持不同的改写类型，可根据对话历史生成更准确的用户查询。\n\n### 功能介绍\n多轮改写组件 (QueryRewrite) 据用户和机器人的聊天记录，改写用户当前query，利用大语言模型的理解及生成能力，进行指代消解及省略补全。\n\n### 特色优势\n多轮改写组件 (QueryRewrite) ，基于百度自研的大语言模型文心一言，无需更多的prompt描述，即可根据对话历史生成更准确的用户查询。\n\n### 应用场景\n多轮改写组件 (QueryRewrite) 可用于智能问答、对话式搜索等场景。\n\n## 基本用法\n\n以下是一个简单的例子，展示如何快速开始使用 QueryRewrite 组件：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 初始化并使用 QueryRewrite 组件\nquery_rewrite = appbuilder.QueryRewrite(model=\"DeepSeek-V3.1\")\nanswer = query_rewrite(appbuilder.Message(['我应该怎么办理护照？', '您可以查询官网或人工咨询', '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']), rewrite_type=\"带机器人回复\")\nprint(answer)\n```\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |Message  |是 |需要改写的文本，用于模型的主要输入内容，这是一个必需的参数。 |Message(content=['我应该怎么办理护照？', '您可以查询官网或人工咨询','我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']) |\n|rewrite_type |str |否 |改写类型选项，可选值为 '带机器人回复'(改写时参考user查询历史和assistant回复历史)，'仅用户查询'(改写时参考user查询历史)。 默认是\"带机器人回复\" |\"带机器人回复\" |\n|stream |bool | 否 |指定是否以流式形式返回响应。默认为 False。 |False |\n|temperature |float | 否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 |1e-10 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|Message(content=\"身份证在哪办\")|\n\n### 响应示例\n```\nMessage(name=msg, content=\"身份证在哪办\", mtype=dict, extra={})\n```\n\n## 示例和案例研究\n实际应用中，QueryRewrite 可用于多种场景，如信息检索、智能对话等。\n\n## 更新记录和贡献\n当前版本：v2 (2023-12)\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/similar_question/README.md",
    "content": "# 相似问生成（SimilarQuestion）\n\n## 简介\n相似问生成组件（SimilarQuestion）可以用于基于输入的问题，挖掘出与该问题相关的类似问题。广泛用于客服、问答等场景。\n\n### 功能介绍\n基于输入的问题，挖掘出与该问题相关的类似问题。\n\n### 特色优势\n相似问生成组件，可一次生成多个相似问题，准确率可达90%以上。\n\n### 应用场景\n应用于客服、问答等场景\n\n## 基本用法\n\n### 快速开始\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nsimilar_question = appbuilder.SimilarQuestion(model=\"DeepSeek-V3.1\")\n\nmsg = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\nmsg = appbuilder.Message(msg)\nanswer = similar_question(msg)\n\nprint(\"Answer: \\n{}\".format(answer.content))\n```\n\n## 参数说明\n\n### 初始化参数\n无\n\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n| message | String |是 |输入消息，用于模型的主要输入内容。这是一个必需的参数。| `Message(\"我想吃冰淇淋，哪里的冰淇淋比较好吃？\")` |\n| stream |bool|否 |指定是否以流式形式返回响应。默认为 False。| False |\n| temperature |float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 1e-10 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n| result | String | 返回结果 | \"1. 哪里能品尝到美味的冰淇淋？\\n2. 哪...\" |\n\n### 响应示例\n\n```text\n1. 哪里能品尝到美味的冰淇淋？\n2. 哪里能买到好吃的冰淇淋？\n3. 哪里能品尝到正宗的冰淇淋？\n4. 哪里能品尝到最新鲜的冰淇淋？\n5. 哪里能买到口感最好的冰淇淋？\n6. 哪里能品尝到最经典的冰淇淋？\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n\n## 高级用法\n\n### 特殊场景示例\n\n你可以根据特定的场景调整参数来获得更精确的结果，例如：\n\n```python\n# 流式返回, 调整模型temperature参数\nanswer = similar_question(msg, stream=True, temperature=0.5)\n```\n\n## 示例和案例研究\n\n### 示例\n\n- **场景:** 用户提出问题\n- **输入:** \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n- **输出:** 1. 请问哪里的冰淇淋最美味？ 2. 在哪些地方可以品尝到最好的冰淇淋？ .....\n\n\n## 更新记录和贡献\n* 相似问生成能力 (2023-12)"
  },
  {
    "path": "docs/BasisModule/Components/llms/style_rewrite/README.md",
    "content": "# 风格转写 (StyleRewrite)\n\n## 简介\n风格转写组件（StyleRewrite） 可以基于生成式大模型对文本的风格进行改写。支持多种文本风格，包括营销、客服、直播、激励及教学话术。\n\n\n### 功能介绍\n文本风格转写能够将一段文本转换成不同的风格（营销、客服、直播、激励及教学话术），同时保持原文的基本意义不变。基于大模型的文本理解与生成能力，根据用户指定的风格重新组织语言和表达方式。它不仅能识别和模仿不同的写作风格，还能在转换过程中保持文本的连贯性和逻辑性。\n\n### 特色优势\n- 准确性与流畅性： 在转写时保持原文意义的准确传达，同时确保文本流畅自然。\n- 风格多样性： 能够覆盖广泛的文本风格，满足不同场合的需求。\n- 提高效率： 节省人工重新编写文本的时间。\n\n### 应用场景\n不同的文本风格可以应用到以下不同的场景中：\n- 营销风格：该风格的转写能力可以根据商品的描述生成一段营销文案，生动地为用户介绍商品特点。\n- 客服风格：针对客户关心的产品问题，用礼貌易懂的口语化文本进行回复，提升客户服务体验。\n- 直播风格：在线直播平台的主播或内容创作者可以使用文本风格转写技术来优化其直播脚本，使其更吸引特定的观众群体。\n- 激励风格：在激励演讲、团队管理或个人发展领域，文本风格转写可以帮助创建更有动力和启发性的内容。起到鼓舞人心的作用。\n- 教学风格：可以帮助教师或教材作者生成互动感强、并且引人入胜的教学材料。\n\n\n## 基本用法\n\n以下是一个简单的例子，展示如何快速开始使用 StyleRewrite 组件：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 初始化并使用 StyleRewrite 组件\nstyle_rewrite = appbuilder.StyleRewrite(model=\"DeepSeek-V3.1\")\nanswer = style_rewrite(appbuilder.Message(\"文心大模型发布新版\"), style=\"激励话术\")\n```\n\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |String  |是 |需要改写的文本|文心大模型发布新版|\n|style|String|否 |想要转换的文本风格，默认为\"营销话术\"，目前支持营销、客服、直播、激励及教学五种话术。|激励话术|\n|stream|bool|否 |指定是否以流式形式返回响应，默认为 False。|True|\n|temperature|float|否 |模型配置的温度参数，默认为 1e-10|1e-10|\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |String  |返回结果|\"文心NLP大模型平台再添新功绩！近日，文心NLP大模型平台成功发布新版，这标志着我们在这个领域又取得了新的里程碑。新版的文心NLP大模型平台在技术、功能和易用性等方面都有了显著的提升，为用户提供了更好的使用体验。\"|\n\n### 响应示例\n```json\n{\"result\": \"文心NLP大模型平台再添新功绩！近日，文心NLP大模型平台成功发布新版，这标志着我们在这个领域又取得了新的里程碑。新版的文心NLP大模型平台在技术、功能和易用性等方面都有了显著的提升，为用户提供了更好的使用体验。\"}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n\n目前该模块仅提供基础的文本风格转写功能。\n\n\n## 更新记录和贡献\n* 当前版本：v1\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/style_writing/README.md",
    "content": "# 风格写作（StyleWriting）\n\n## 简介\n风格写作组件（StyleWriting）是一款基于生成式大模型进行文本创作的工具，支持多种风格，包括B站、小红书等，适用于编写文案、广告等多种场景。\n\n### 功能介绍\n风格写作组件（StyleWriting）根据用户的输入内容和风格要求，利用大语言模型的生成能力，自动生成符合特定风格的文案。\n\n\n### 特色优势\n风格写作组件（StyleWriting），基于百度自研的大语言模型文新一言，提供内置的风格生成能力，无需更多的prompt描述，即可生成对应风格的文案。\n\n\n### 应用场景\n风格写作组件（StyleWriting）可用于特定平台的文案生成分发营销场景。\n\n\n## 基本用法\n\n为了快速开始使用风格写作组件，您可以参考以下步骤：\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nmodel = \"DeepSeek-V3.1\"\nstyle_writing = appbuilder.StyleWriting(model)\n\nquery = \"帮我写一篇关于人体工学椅的文案\"\nstyle = \"小红书\"\nlength = 100\n\nmsg = appbuilder.Message(query)\nanswer = style_writing(message=msg, style_query=style, length=length)\nprint(answer)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |Message  |是 |输入的消息，用于模型的主要输入内容，这是一个必需的参数。 |Message(content=\"帮我生成一个介绍保温杯的话术\") |\n|style_query |str |否 |定义生成文案的格式，包括\"通用\"、\"B站\"、\"小红书\"，默认为\"通用\" |\"通用\" |\n|length |int |否 |定义生成文案的长度，可选 '短' (100), '中' (300), '长' (600), 默认100 |100 |\n|stream |bool | 否 |指定是否以流式形式返回响应。默认为 False。 |False |\n|temperature |float | 否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 |0.7 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|Message(content=\"大家好，我给你们介绍一款家里和办公室都要备上的保温杯。...\")|\n\n### 响应示例\n```\nMessage(name=msg, content=大家好，我给你们介绍一款家里和办公室都要备上的保温杯。我平常上班的时候都会装上一杯热开水，但用普通保温杯装上一会就凉了，所以我赶紧在网上淘了一个好货。它是双层设计，内层是不锈钢材质，外层是玻璃材质，非常贴心，冷热都能装。装上热水，保温效果非常出色，到晚上还是热的。这个保温杯的外观也非常漂亮，采用优质不锈钢材质，耐磨、易清洗。同时，它还非常轻便，可以轻松放入口袋、背包中。有了这个保温杯后，我再也不用担心喝水问题了。无论是在家里、办公室还是户外活动，它都能随时随地为你提供热水。而且，它还非常安全、健康，采用了优质的保温材料和先进的生产工艺。无论男女老少都可以使用这款保温杯哦。快来购买吧。\", mtype=dict, extra={})\n```\n\n## 高级用法\n\n使用风格写作组件进行更复杂的文本创作，例如调整不同的风格和长度参数来适应特定的写作场景。\n\n## 更新记录和贡献\n\n- 初始版本发布(2023-10)\n"
  },
  {
    "path": "docs/BasisModule/Components/llms/tag_extraction/README.md",
    "content": "# 标签抽取（TagExtraction）\n\n## 简介\n标签抽取组件（TagExtraction）是一款高效的标签抽取组件，基于生成式大模型，专门用于从文本中提取关键标签。它适用于各种文本分析场景，如内容分类、关键词提取等。\n\n### 功能介绍\n标签抽取组件（TagExtraction）专门设计用于从各类文本中高效地提取关键标签。此组件利用先进的生成式大模型，可以准确识别和提取文本中的重要信息，如关键词、短语或主题。它不仅能快速分析大量文本数据，还能精准识别文本的核心内容，支持用户快速了解文本的主要信息和结构\n\n### 特色优势\n- 高效准确：基于先进的生成式大模型，提供高效且准确的标签提取功能。\n- 适用广泛：能够处理不同类型和格式的文本数据，适用于多种文本分析场景。\n- 格式友好：输出格式采用规范化编号输出，后处理时方便快捷。\n\n### 应用场景\n标签抽取组件可以广泛应用于多种场景：\n\n- 内容分类：快速为文章或文档分类，提高信息管理和检索效率。\n- 关键词提取：从文本中提取关键词，帮助用户快速了解文本主题和内容。\n- 数据分析：在大数据分析中，可以用于预处理，提取有价值的信息。\n- 搜索引擎优化：帮助网站或博客提取有效标签，改善其在搜索引擎中的可见度。\n\n\n## 基本用法\n\n要开始使用 `TagExtraction`，首先需要设置环境变量 `APPBUILDER_TOKEN`，然后创建 `TagExtraction` 实例并传递文本消息。\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\ntag_extraction = appbuilder.TagExtraction(model=\"DeepSeek-V3.1\")\nresult = tag_extraction(appbuilder.Message(\"从这段文本中抽取关键标签\"))\n```\n\n这个例子展示了如何实例化 `TagExtraction` 组件并使用一个文本消息进行标签抽取。\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |String  |是 |需要抽取标签的文本|从这段文本中抽取关键标签|\n|stream|bool|否 |指定是否以流式形式返回响应，默认为 False。|True|\n|temperature|float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。|1e-10|\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|对象，包含模型运行后的输出消息。|\n### 响应示例\n```json\n{\"result\": \"1.5G 2.云计算 3.人工智能 4.数字经济 5.数据中心 6.新型基础设施 7.政策优化 8.产业发展 9.国家重视 10.快速增长\"}\n```\n\n## 高级用法\n\n高级用法可以包括自定义模型参数或使用不同的模型源。例如，可以通过指定不同的 `model` 来使用特定于域的模型进行标签抽取。\n\n```python\ntag_extraction = appbuilder.TagExtraction(model=\"custom-model\")\nresult = tag_extraction(appbuilder.Message(\"自定义模型抽取的标签\"))\n```\n\n## 示例和案例研究\n\n在实际应用中，`TagExtraction` 可以用于新闻文章、社交媒体帖子或其他任何文本内容的关键标签提取，帮助内容创建者或营销分析师快速了解主要主题和趋势。\n\n\n"
  },
  {
    "path": "docs/BasisModule/Components/matching/README.md",
    "content": "# 语义匹配（Matching）\n\n## 简介\n\n语义匹配组件（Matching）可以计算query与文本列表之间的相似度关系，并根据其进行排序。\n\n### 功能介绍\n\n根据query与文本列表之间的相似度关系，并根据其进行排序。\n\n### 特色优势\n\n基于百度文心大模型技术的文本表示模型，学习数据的内在特征，使得排序效果相较于bm25等排序算法，可以更好地处理相似问和同义、近义句子之间的偏序关系。\n\n### 应用场景\n\n1. 语义排序\n\n## 基本用法\n\n### 下面是基于query和文本之间的相似度进行匹配排序的代码示例\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 初始化所需要的组件\nembedding = appbuilder.Embedding()\nmatching = appbuilder.Matching(embedding)\n\n# 定义query和文本列表\nquery = appbuilder.Message(\"你好\")\ncontexts = appbuilder.Message([\"世界\", \"你好\"])\n\ncontexts_matched = matching(query, contexts)\nprint(contexts_matched.content)\n```\n\n```\n['你好', '世界']\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n| 参数名称   | 参数类型    | 是否必须 | 描述                                                          | 示例值          |\n| ---------- | ----------- | -------- | ------------------------------------------------------------- | --------------- |\n| embedding  | Embedding   | 可选     | 一个类型为Embedding的Component，用于初始化 Matching 的向量计算功能。底座模型当前仅支持 embedding-v1 作为可选值。若不指定，默认值为 embedding-v1 。 |  appbuilder.Embedding()   |\n\n### 调用参数\n\n| 参数名称  | 参数类型    | 是否必须 | 描述                                                         | 示例值                             |\n| --------- | ----------- | -------- | ------------------------------------------------------------ | ---------------------------------- |\n| query     | 字符串      | 必须     | 一个类型为 string 的句子，用于输入。该句子的长度不能超过384个字符，通常为用户输入的问题。 | \"如何提高工作效率？\"                |\n| contexts  | 字符串列表   | 必须     | 一个类型为 List[string] 的句子数组。数组中的每个元素都是一个句子，且每个句子的长度不能超过384个字符。这些句子通常为与问题相关的文本候选集。 | [\"时间管理技巧\", \"提高专注力的方法\"]  |\n| return_score | 布尔 | 可选 | 默认为False, 仅返回排序后的字符串列表；当设置为True时，返回匹配分数和字符串的二元组列表 |\n\n### 响应示例\n\n默认为排完序后的字符串列表\n\n```\n[\"时间管理技巧\", \"提高专注力的方法\"]\n```\n\n当设置`return_score = True`时，二元组的第一个值为相似度分数，第二个值为字符串\n\n```\n[(0.9999999852985002, '你好'), (0.18920520439845268, '世界')]\n```\n\n### 错误码\n\n无\n\n## 更新记录和贡献\n\n* 语义匹配 (2023-12)\n"
  },
  {
    "path": "docs/BasisModule/Components/mix_card_ocr/README.md",
    "content": "# 身份证混贴识别（MixCardOCR）\n\n## 简介\n身份证混贴识别（MixCardOCR），身份证混贴识别支持自动检测与识别身份证正反面在同一张图片上的场景，一次识别图片中身份证正反面所有字段。\n\n\n### 功能介绍\n支持对二代居民身份证正反面所有8个字段进行结构化识别，包括姓名、性别、民族、出生日期、住址、身份证号、签发机关、有效期限，识别准确率超过99%；同时支持身份证正面头像检测，并返回头像切片的base64编码及位置信息。\n\n### 特色优势\n同时，支持对用户上传的身份证图片进行图像风险和质量检测，可识别图片是否为复印件或临时身份证，是否被翻拍或编辑，是否存在正反颠倒、模糊、欠曝、过曝等质量问题。\n\n\n\n### 应用场景\n身份证混贴识别支持自动检测与识别身份证正反面在同一张图片上的场景，一次识别图片中身份证正反面所有字段。\n\n\n## 基本用法\n\n下面是身份证混贴识别的代码示例：\n\n示例图片为：![示例图片](https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe1865e4393da5a3515e90d72d81ef18296bd29598)\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nimage_url= \"https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe1865e4393da5a3515e90d72d81ef18296bd29598\"\n\n\n# 从BOS存储读取样例文件\nraw_image = requests.get(image_url).content\ninp = appbuilder.Message(content={\"raw_image\": raw_image})\n# inp = Message(content={\"url\": image_url})\n\n# 运行身份证混贴识别OCR\nmix_card_ocr = appbuilder.MixCardOCR()\nout = mix_card_ocr.run(inp)\n# 打印识别结果\nprint(out.content) \n\n# {'front': {'fields': [{'key': '出生', 'value': '19920225', 'position': {'left': 620, 'top': 218, 'width': 239, 'height': 30}}, {'key': '性别', 'value': '女', 'position': {'left': 616, 'top': 164, 'width': 25, 'height': 30}}, {'key': '民族', 'value': '汉', 'position': {'left': 766, 'top': 164, 'width': 29, 'height': 30}}, {'key': '姓名', 'value': '姚佳', 'position': {'left': 621, 'top': 102, 'width': 84, 'height': 35}}, {'key': '公民身份号码', 'value': '110103199202250229', 'position': {'left': 733, 'top': 417, 'width': 399, 'height': 36}}, {'key': '住址', 'value': '北京市海淀区仙秀园555号', 'position': {'left': 618, 'top': 277, 'width': 253, 'height': 67}}], 'position': {'left': 483, 'top': 42, 'width': 737, 'height': 464}}, 'back': {'fields': [{'key': '签发日期', 'value': '20150413', 'position': {'left': 789, 'top': 946, 'width': 139, 'height': 34}}, {'key': '签发机关', 'value': '北京市公安局海淀分局', 'position': {'left': 787, 'top': 883, 'width': 275, 'height': 35}}, {'key': '失效日期', 'value': '20350413', 'position': {'left': 946, 'top': 945, 'width': 144, 'height': 34}}], 'position': {'left': 473, 'top': 537, 'width': 749, 'height': 480}}, 'direction': 0}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n| 参数名称       | 参数类型   | 是否必须 | 描述                          |示例值|\n|------------|--------|------|-----------------------------|---|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 ||\n| +content   | Dict   | 是    | 消息内容                        ||\n| +raw_image | String | 否    | 原始图片字节流                     ||\n| +url       | String   | 否    | 图片下载链接地址                    ||\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer| 否    | HTTP重试次数                    |3||\n\n### 响应参数\n\n| 参数名称       | 参数类型   | 描述                  | 示例值                                                |\n|------------|--------|---------------------|----------------------------------------------------|\n| front      | object | 身份证正面信息             |                                                    |\n| +fields    | list   | 字段信息                |                                                    |\n| ++key      | str    | 字段名                 |                                                    |\n| ++value    | str    | 字段值                 |                                                    |\n| ++position | object | 字段坐标,结构同下position           |                                                    |\n| +position  | object | 身份证正面坐标             |                                                    |\n| ++left     | int | 表示定位位置的长方形左上顶点的水平坐标 |                                                    |\n| ++top        | int | 表示定位位置的长方形左上顶点的垂直坐标 |                                                    |\n| ++width    | int | 表示定位位置的长方形的宽度       |                                                    |\n| ++height   | int | 表示定位位置的长方形的高度       |                                                    |\n| back       | object | 身份证反面信息，结构同front    |                                            |\n| direction  | int    | 图像旋转角度              | 图像旋转角度，0（正向），- 1（逆时针90度），- 2（逆时针180度），- 3（逆时针270度） |\n\n### 响应示例\n```json\n{\n\t\"front\": {\n\t\t\"fields\": [{\n\t\t\t\t\"key\": \"出生\",\n\t\t\t\t\"value\": \"19920225\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 620,\n\t\t\t\t\t\"top\": 218,\n\t\t\t\t\t\"width\": 239,\n\t\t\t\t\t\"height\": 30\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"性别\",\n\t\t\t\t\"value\": \"女\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 616,\n\t\t\t\t\t\"top\": 164,\n\t\t\t\t\t\"width\": 25,\n\t\t\t\t\t\"height\": 30\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"民族\",\n\t\t\t\t\"value\": \"汉\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 766,\n\t\t\t\t\t\"top\": 164,\n\t\t\t\t\t\"width\": 29,\n\t\t\t\t\t\"height\": 30\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"姓名\",\n\t\t\t\t\"value\": \"姚佳\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 621,\n\t\t\t\t\t\"top\": 102,\n\t\t\t\t\t\"width\": 84,\n\t\t\t\t\t\"height\": 35\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"公民身份号码\",\n\t\t\t\t\"value\": \"110103199202250229\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 733,\n\t\t\t\t\t\"top\": 417,\n\t\t\t\t\t\"width\": 399,\n\t\t\t\t\t\"height\": 36\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"住址\",\n\t\t\t\t\"value\": \"北京市海淀区仙秀园555号\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 618,\n\t\t\t\t\t\"top\": 277,\n\t\t\t\t\t\"width\": 253,\n\t\t\t\t\t\"height\": 67\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"position\": {\n\t\t\t\"left\": 483,\n\t\t\t\"top\": 42,\n\t\t\t\"width\": 737,\n\t\t\t\"height\": 464\n\t\t}\n\t},\n\t\"back\": {\n\t\t\"fields\": [{\n\t\t\t\t\"key\": \"签发日期\",\n\t\t\t\t\"value\": \"20150413\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 789,\n\t\t\t\t\t\"top\": 946,\n\t\t\t\t\t\"width\": 139,\n\t\t\t\t\t\"height\": 34\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"签发机关\",\n\t\t\t\t\"value\": \"北京市公安局海淀分局\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 787,\n\t\t\t\t\t\"top\": 883,\n\t\t\t\t\t\"width\": 275,\n\t\t\t\t\t\"height\": 35\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"失效日期\",\n\t\t\t\t\"value\": \"20350413\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 946,\n\t\t\t\t\t\"top\": 945,\n\t\t\t\t\t\"width\": 144,\n\t\t\t\t\t\"height\": 34\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"position\": {\n\t\t\t\"left\": 473,\n\t\t\t\"top\": 537,\n\t\t\t\"width\": 749,\n\t\t\t\"height\": 480\n\t\t}\n\t},\n\t\"direction\": 0\n}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n目前该模块仅提供基础的身份证混贴识别。\n\n## 更新记录和贡献\n* 身份证混贴识别 (2024-01)"
  },
  {
    "path": "docs/BasisModule/Components/object_recognize/README.md",
    "content": "# 通用物体和场景识别-高级版（ObjectRecognition）\n\n## 简介\n通用物体和场景识别组件（ObjectRecognition）可以识别超过10万类常见物体和场景，接口返回大类及细分类的名称。广泛适用于图像或视频内容分析、拍照识图等业务场景。\n### 功能介绍\n* 识别物体或场景名称\n\n  识别动物、植物、商品、建筑、风景、动漫、食材、公众人物等10万个常见物体及场景，接口返回大类及细分类的名称结果；\n\n### 特色优势\n* 可识别超过10万类常见物体和场景，接口返回大类及细分类的名称，并支持获取识别结果对应的百科信息；\n\n### 应用场景\n可以识别超过10万类常见物体和场景，广泛适用于图像或视频内容分析、拍照识图等业务场景\n\n\n## 基本用法\n\n示例图片为：\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc1ba1de0a8f072bc5a87102bd32f9e3)\n\n\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?\"\\\n    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\"\\\n    \"11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc\"\\\n    \"1ba1de0a8f072bc5a87102bd32f9e3\"\nraw_image = requests.get(image_url).content\n# 创建物体识别组件实例\nobject_recognition = appbuilder.ObjectRecognition()\n# 执行识别操作并获取结果\nout = object_recognition.run(appbuilder.Message(content={\"raw_image\": raw_image}))\nprint(out.content)\n# {'result': [{'keyword': '苹果', 'score': 0.961247, 'root': '植物-蔷薇科'}, {'keyword': '姬娜果', 'score': 0.740838, 'root': '植物-其它'}, {'keyword': '梨子', 'score': 0.392218, 'root': '商品-水果'}, {'keyword': '车厘子', 'score': 0.193986, 'root': '植物-其它'}, {'keyword': '石榴', 'score': 0.000239, 'root': '植物-千屈菜科'}]}\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数 （以表格形式展示）\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\n\n### 响应参数\n| 参数名称     | 参数类型    | 描述          | 示例值                                                 |\n|----------|---------|-------------|-----------------------------------------------------|\n| result   | Array[] | 返回结果        | [{\"keyword\":\"苹果\",\"score\":0.961247,\"root\":\"植物-蔷薇科\"}] |\n| +keyword | String  | 图片中的物体或场景名称 | \"苹果\"                                                |\n| +score\t  | Float   | 置信度         | 0.961247                                            |\n| +root\t   | String  | 识别结果的上层标签   | \"植物-蔷薇科\"                                            |\n\n\n### 响应示例\n```json\n{\n    \"result\":[\n        {\n            \"keyword\":\"苹果\",\n            \"score\":0.961247,\n            \"root\":\"植物-蔷薇科\"\n        },\n        {\n            \"keyword\":\"姬娜果\",\n            \"score\":0.740838,\n            \"root\":\"植物-其它\"\n        },\n        {\n            \"keyword\":\"梨子\",\n            \"score\":0.392218,\n            \"root\":\"商品-水果\"\n        },\n        {\n            \"keyword\":\"车厘子\",\n            \"score\":0.193986,\n            \"root\":\"植物-其它\"\n        },\n        {\n            \"keyword\":\"石榴\",\n            \"score\":0.000239,\n            \"root\":\"植物-千屈菜科\"\n        }\n    ]\n}\n```\n### 错误码\n| 错误码 | 描述 |\n|-----|----|\n\n## 高级用法\n目前该模块仅提供基础通用物体与场景识别功能。\n\n## 更新记录和贡献\n* 通用物体及场景识别 (2023-12-08)\n"
  },
  {
    "path": "docs/BasisModule/Components/plant_recognize/README.md",
    "content": "# 植物识别（PlantRecognition）\n\n## 简介\n植物识别（PlantRecognition），即对于输入的一张图片（可正常解码，且长宽比较合适），输出植物识别结果。\n\n### 功能介绍\n可识别超过2万种常见植物和近8千种花卉，接口返回植物的名称，并支持获取识别结果对应的百科信息\n\n### 特色优势\n还可使用EasyDL定制训练平台，定制识别植物种类\n\n### 应用场景\n适用于拍照识图、幼教科普、图像内容分析等场景\n\n## 基本用法\n\n下面是植物识别的代码示例：\n\n示例图片为\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder/palnt_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2Faa2217067f78f0236c8262cdd89a4b4f4b2188d971ca547c53d01742af4a2cbe)\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/palnt_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2Faa2217067f78f0236c8262cdd89a4b4f4b2188d971ca547c53d01742af4a2cbe\"\n\n# 从BOS存储读取样例文件\nraw_image = requests.get(image_url).content\ninp = appbuilder.Message(content={\"raw_image\": raw_image})\n# inp = Message(content={\"url\": image_url})\n\n# 运行植物识别\nplant_recognize = appbuilder.PlantRecognition()\nout = plant_recognize.run(inp)\n# 打印识别结果\nprint(out.content)  \n\n# {'plant_score_list': [{'name': '榕树', 'score': 0.4230029582977295}, {'name': '榆树', 'score': 0.1273619383573532}, {'name': '美国榆', 'score': 0.12065108865499496}, {'name': '白蜡树', 'score': 0.11650644987821579}, {'name': '雨树', 'score': 0.045340824872255325}]}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n| 参数名称       | 参数类型   | 是否必须 | 描述                          |示例值|\n|------------|--------|------|-----------------------------|---|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 ||\n| +content   | Dict   | 是    | 消息内容                        ||\n| +raw_image | String | 否    | 原始图片字节流                     ||\n| +url       | String   | 否    | 图片下载链接地址                    ||\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer| 否    | HTTP重试次数                    |3||\n\n### 响应参数\n| 参数名称             | 参数类型   | 描述     | 示例值                                              |\n|------------------|--------|--------|--------------------------------------------------|\n| plant_score_list | List   | 植物识别列表 |  |\n| name             | String | 植物名    |  |\n| score            | Float  | 植物识别打分 |  |\n\n\n### 响应示例\n```json\n{\n  \"plant_score_list\": [\n    {\n      \"name\": \"榕树\",\n      \"score\": 0.4230029582977295\n    },\n    {\n      \"name\": \"榆树\",\n      \"score\": 0.1273619383573532\n    },\n    {\n      \"name\": \"美国榆\",\n      \"score\": 0.1206519496\n    },\n    {\n      \"name\": \"白蜡树\",\n      \"score\": 0.11650644987821579\n    },\n    {\n      \"name\": \"雨树\",\n      \"score\": 0.045340824872255325\n    }\n  ]\n}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n目前该模块仅提供基础的植物识别。\n\n\n## 更新记录和贡献\n* 植物识别 (2024-01)"
  },
  {
    "path": "docs/BasisModule/Components/ppt_generation_from_file/README.md",
    "content": "# 文件生成PPT（PPTGenerationFromFile）\n\n## 简介\n文件生成PPT组件（PPTGenerationFromFile）可以根据上传的文件（支持**中英文**）生成PPT。\n\n### 功能介绍\n根据上传的文件（支持**中英文**）生成PPT。\n\n### 特色优势\n可根据文件（支持**中英文**）生成高质量PPT。\n\n### 应用场景\nPPT生成。\n\n## 基本用法\n### 快速开始\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ['APPBUILDER_TOKEN'] = '...'\n\n\nppt_generator = appbuilder.PPTGenerationFromFile()\n\nuser_input = {\n    'file_url':'http://image.yoojober.com/users/chatppt/temp/2024-06/6672a92c87e6f.doc',\n    'user_name':'百度千帆AppBuilder'\n}\nresult = ppt_generator(appbuilder.Message(user_input))\nprint(result.content)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ['APPBUILDER_TOKEN'] = 'bce-YOURTOKEN'\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入消息，用于模型的主要输入内容。 | Message(content=input_data) |\n| `poll_request_times` | int | 否 | 轮询请求结果次数。默认为60。 | 60 |\n| `poll_request_interval` | int | 否 | 轮询请求的间隔时间（秒）。默认为5。 | 5 |\n\n其中message包含的input_data包括以下参数：\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `file_url` | str | 是 | 文件链接。 | http://image.yoojober.com/users/chatppt/temp/2024-06/6672a92c87e6f.doc |\n| `user_name` | str | 否 | 作者名。 | 百度千帆AppBuilder |\n\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果，包含PPT下载链接。 | Message(content='...') |\n\n### 响应示例\n```\nhttps://download.yoojober.com/chatppt_business/2024-07/d1a1ab518ebcfbba7908a6734fa11d13.pptx?e=1721964933&token=8_2qFlGEVQZPpFvHdGR6gg2t9A9QZfWT9wwTl92s:9bs8LWV1SQLJNJoJgtd-sLF-CTw=\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.8.1\n#### [Added]\n- 增加文件生成PPT组件。\n- 增加文件生成PPT组件单元测试。"
  },
  {
    "path": "docs/BasisModule/Components/ppt_generation_from_instruction/README.md",
    "content": "# 指令生成PPT（PPTGenerationFromInstruction）\n\n## 简介\n指令生成PPT组件（PPTGenerationFromInstruction）可以基于指令或者自定义信息生成PPT。\n\n### 功能介绍\n基于指令或者自定义信息生成PPT。\n\n### 特色优势\n- 可生成高质量PPT。\n- 支持传入自定义信息生成PPT。\n- 生成PPT复杂度可控。\n\n### 应用场景\nPPT生成。\n\n## 基本用法\n### 快速开始\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ['APPBUILDER_TOKEN'] = '...'\n\n\nppt_generator = appbuilder.PPTGenerationFromInstruction()\n\nuser_input = {\n    'text': '生成一个介绍北京的PPT。',\n    'custom_data': {},\n    'complex': 1,\n    'user_name': '百度千帆AppBuilder'\n}\nresult = ppt_generator(appbuilder.Message(user_input))\nprint(result.content)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ['APPBUILDER_TOKEN'] = 'bce-YOURTOKEN'\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入消息，用于模型的主要输入内容。 | Message(content=input_data) |\n| `poll_request_times` | int | 否 | 轮询请求结果次数。默认为60。 | 60 |\n| `poll_request_interval` | int | 否 | 轮询请求的间隔时间（秒）。默认为5。 | 5 |\n\n其中message包含的input_data包括以下参数：\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `text` | str | 是 | 请求生成PPT的query。可为空字符串\"\"，与custom_data有一个参数不为空即可。 | 请你生成一个介绍北京的PPT。 |\n| `custom_data` | obj | 是 | 自定义参数，可指定标题、副标题、作者、结构等信息。可为空字典{}，与text有一个参数不为空即可。 | `{\"title\": \"标题\", \"sub_title\": \"副标题\", \"author\": \"作者\", \"catalogs\": [{\"catalog\": \"一级大纲1\", \"sub_catalog\": [\"一级大纲1-二级大纲1\"]}, {\"catalog\": \"一级大纲2\", \"sub_catalog\": [\"一级大纲2-二级大纲1\"]}], \"contents\": [{\"catalog_index\": 0, \"sub_catalog_index\": 0, \"content\": [\"一级大纲1-二级大纲1-内容1\", \"一级大纲1-二级大纲1-内容2\"]}, {\"catalog_index\": 1, \"sub_catalog_index\": 0, \"content\": [{\"key\": \"一级大纲2-二级大纲1-小标题1\", \"value\": \"一级大纲2-二级大纲1-子内容1\"}, {\"key\": \"一级大纲2-二级大纲1-小标题2\", \"value\": \"一级大纲2-二级大纲1-子内容2\"}, {\"key\": \"一级大纲2-二级大纲1-小标题3\", \"value\": \"一级大纲2-二级大纲1-子内容3\"}], \"picture\": [\"https://image.yoojober.com/chatppt_business/2024-02/000114cd07b809cb8c6bb22674e814da.png\"]}]}` |\n| `complex` | integer | 否 | PPT复杂度，可选：1、2、3，其中1最简单、3最复杂。 | 1 |\n| `font_name` | str | 否 | PPT字体，可选：黑体、宋体、仿宋、幼圆、楷体、隶书。 | 黑体 |\n| `user_name` | str | 否 | 作者名。 | 百度千帆AppBuilder |\n\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果，包含PPT下载链接。 | Message(content='...') |\n\n### 响应示例\n```\nhttps://download.yoojober.com/chatppt_business/2024-07/bf2af50285e52261507abdd7385e02c4.pptx?e=1721964536&token=8_2qFlGEVQZPpFvHdGR6gg2t9A9QZfWT9wwTl92s:nikgRM9RbPxzClBvmKrweeKd9Ck=\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.8.1\n#### [Added]\n- 增加指令生成PPT组件。\n- 增加指令生成PPT组件单元测试。"
  },
  {
    "path": "docs/BasisModule/Components/ppt_generation_from_paper/README.md",
    "content": "# 论文生成PPT（PPTGenerationFromPaper）\n\n## 简介\n论文生成PPT组件（PPTGenerationFromPaper）可以根据上传的论文（支持**中英文**）生成PPT。\n\n### 功能介绍\n根据上传的论文（支持**中英文**）生成PPT。\n\n### 特色优势\n可根据论文（支持**中英文**）生成高质量PPT。\n\n### 应用场景\nPPT生成。\n\n## 基本用法\n### 快速开始\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ['APPBUILDER_TOKEN'] = '...'\n\n\nppt_generator = appbuilder.PPTGenerationFromPaper()\n\nuser_input = {\n    'file_key': 'http://image.yoojober.com/users/chatppt/temp/2024-06/6672aa839a9da.docx',\n    'style': '科技',\n    'color': '蓝色',\n    'title': '',\n    'pleader': '百度千帆AppBuilder',\n    'advisor': '百度千帆AppBuilder',\n    'school': '北京大学',\n    'school_logo': '',\n    'school_picture': ''\n}\nresult = ppt_generator(appbuilder.Message(user_input))\nprint(result.content)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ['APPBUILDER_TOKEN'] = 'bce-YOURTOKEN'\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入消息，用于模型的主要输入内容。 | Message(content=input_data) |\n| `poll_request_times` | int | 否 | 轮询请求结果次数。默认为60。 | 60 |\n| `poll_request_interval` | int | 否 | 轮询请求的间隔时间（秒）。默认为5。 | 5 |\n\n其中message包含的input_data包括以下参数：\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `file_key` | str | 是 | 论文链接。 | http://image.yoojober.com/users/chatppt/temp/2024-06/6672aa839a9da.docx |\n| `style` | str | 否 | PPT风格，可选：科技、商务、小清新、可爱卡通、中国风、极简、党政。 | 科技 |\n| `color` | str | 否 | PPT主色调。可选：紫色、红色、橙色、黄色、绿色、青色、蓝色、粉色。 | 紫色 |\n| `title` | str | 否 | 自定义标题。优先使用自定义标题，如果为空则使用解析结果中的标题。 | 论文分享 |\n| `pleader` | str | 否 | 汇报人。 | 百度千帆AppBuilder |\n| `advisor` | str | 否 | 指导教师。 | 百度千帆AppBuilder |\n| `school` | str | 否 | 学校名称。 | 北京大学 |\n| `school_logo` | str | 否 | 学校logo链接。 |  |\n| `school_picture` | str | 否 | 学校图片链接。 |  |\n\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果，包含PPT下载链接。 | Message(content='...') |\n\n### 响应示例\n```\nhttps://download.yoojober.com/chatppt_business/2024-07/6f472b65ee324d2da7849b6003a896e3.pptx?e=1721964794&token=8_2qFlGEVQZPpFvHdGR6gg2t9A9QZfWT9wwTl92s:nG-hbPN51uPP8FOeTY2jdQcT51w=\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.8.1\n#### [Added]\n- 增加论文生成PPT组件。\n- 增加论文生成PPT组件单元测试。"
  },
  {
    "path": "docs/BasisModule/Components/qrcode_ocr/README.md",
    "content": "# 二维码识别 (QRcodeOCR) \n\n## 简介\n二维码识别 (QRcodeOCR) 可对图片中的二维码、条形码进行检测和识别，返回存储的文字信息及其位置信息。\n\n\n### 功能介绍\n* 二维码识别\n\n    检测识别图片中的二维码（包括QR_CODE、DATA_MATRIX、AZTEC、PDF_417 4类），自动返回存储的内容。\n* 条形码识别\n\n    检测识别图片中的条形码（包括CODE_128、UPC_A、EAN_13、ITF、CODABAR 等9类），自动返回存储的内容。\n### 特色优势\n* 支持对图片中的二维码、条形码进行检测和识别，自动返回存储的内容。\n\n### 应用场景\n* 物品信息管理\n\n    解析识别各类物品的二维码或条形码信息，应用于商品、药品出入库管理及货物运输管理等场景，轻松一扫即可快速完成对物品信息的读取、登记和存储，简化物品管理流程\n## 基本用法\n\n下面是二维码识别的代码示例：\n\n示例图片为：\n![示例图片](https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6e74ab057ce26d50e966dc31ff083e6a9c41b)\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n            \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n            \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\nraw_image = requests.get(image_url).content\n# 创建二维码识别组件实例\nqrcode_ocr = appbuilder.QRcodeOCR()\n# 执行识别操作并获取结果\nout = qrcode_ocr.run(appbuilder.Message(content={\"raw_image\": raw_image}), location=\"true\")\nprint(out.content)\n# {'codes_result': [{'type': 'QR_CODE', 'text': ['ocr文字识别'], 'location': {'top': 506, 'left': 1302, 'width': 1972, 'height': 1961}}]}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数 （以表格形式展示）\n| 参数名称     | 参数类型    | 是否必须 | 描述                                                                      | 示例值                                            |\n|----------|---------|------|-------------------------------------------------------------------------|------------------------------------------------|\n| message  | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数                                             | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n| location | String  | 否    | 是否输出二维码/条形码位置信息，false：不返回位置信息，true：默认值，返回图中二维码/条形码的位置信息，包括上边距、左边距、宽度、高度 | \"false\"                                        |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry    | Integer | 否    | HTTP重试次数                                                                | 3                                              |\n\n### 响应参数\n| 参数名称         | 参数类型     | 描述          | 示例值                                                                                                               |\n|--------------|----------|-------------|-------------------------------------------------------------------------------------------------------------------|\n| codes_result | Array[]  | 返回结果        | [{'type': 'QR_CODE', 'text': ['ocr文字识别'], 'location': {'top': 506, 'left': 1302, 'width': 1972, 'height': 1961}}] |\n| +type        | String   | 识别码类型条码类型   | 'QR_CODE'                                                                                                         |\n| +text        | Array[]  | 条形码/二维码识别内容 | ['ocr文字识别']                                                                                                       |\n| +location    | Object{} | 条形码/二维码位置信息 | {'top': 506, 'left': 1302, 'width': 1972, 'height': 1961}                                                         |\n| ++top\t       | Integer  | 条形码/二维码的上边距 | 506                                                                                                               |\n| ++left       | Integer  | 条形码/二维码的左边距 | 1302                                                                                                              |\n| ++width\t     | Integer  | 条形码/二维码的宽度  | 1972                                                                                                              |\n| ++height     | Integer  | 条形码/二维码的高度  | 1961                                                                                                              |\n\n\n### 响应示例\n```json\n{\n  \"codes_result\": [\n    {\n      \"type\": \"QR_CODE\",\n      \"text\": [\"ocr文字识别\"],\n      \"location\": {\n        \"top\": 506,\n        \"left\": 1302,\n        \"width\": 1972,\n        \"height\": 1961\n      }\n    }\n  ]\n}\n```\n### 错误码\n| 错误码 | 描述 |\n|-----|----|\n\n## 高级用法\n\n目前该模块仅提供基础的二维码识别功能。\n\n\n## 更新记录和贡献\n* 二维码识别能力 (2024-01)"
  },
  {
    "path": "docs/BasisModule/Components/rag_with_baidu_search/README.md",
    "content": "# 百度搜索RAG（deprecate）\n\n## 简介\n百度搜索（BaiduSearch），通过百度搜索引擎搜索相关内容。\n现推荐使用RagWithBaiduSearchPro\n|              | 旧组件（百度搜索RAG）| 新组件（百度搜索RAG_PRO） \n|--------------|------------------ |------------------\n| 指令         |        ☑️         |        ☑️               \n| 拒绝回答开关   |       ☑️         |        ❌                \n| 高亮开关      |       ☑️         |         ❌                \n| 友好度开关    |       ☑️          |        ❌           \n| 澄清开关    |       ☑️          |        ❌         \n| 溯源开关      |       ☑️         |         ☑️               \n| 流式请求      |       ☑️         |         ☑️               \n| temperature  |          ☑️          |        ☑️               \n| top_p        |          ☑️          |        ☑️               \n| 检索个数      |       ❌         |         ☑️               \n| 检索类型（网页、视频等） |    ❌     |        ☑️         \n\n### 功能介绍\n百度搜索是最大的中文搜索引擎，帮助用户在海量信息中找到最需要的内容。\n\n### 特色优势\n百度搜索凭借先进的中文搜索技术、个性化推荐、全面的信息覆盖、即时的搜索结果和强大的安全防护，为用户提供快速、准确、安全的搜索体验，满足多样化的信息需求。\n\n### 应用场景\n通用搜索领域\n\n## 基本用法\n以下是一个简单的例子来演示如何开始使用百度搜索组件：\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建rag_with_baidusearch对象\nrag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch(model=\"DeepSeek-V3.1\")\n\n# 运行rag_with_baidusearch基本组件\nmsg = appbuilder.Message(\"残疾人怎么办相关证件\")\nresult = rag_with_baidusearch_component.run(msg)\n\n# 获取reference\nreferences = result.extra\n\n# 输出运行结果\nprint(result)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n- `instruction (obj:Message, 可选)`: 可设定人设，如：你是问答助手，在回答问题前需要加上“很高兴为您解答：”\n- `reject (bool, 可选)`: 拒绝开关，如果为 True，则启用该能力。默认为 False。当输入的问题在搜索结果中没有找到答案时，开关开启时，模型会用特定话术(\"当前文档库找不到对应的答案，我可以尝试用我的常识来回答你。\")做回复的开头，并后接自有知识做回复内容。\n- `clarify (bool, 可选)`: 澄清开关，如果为 True，则启用该能力。默认为 False。 当输入的问题比较模糊、或者主体指代不清晰，且context_list中包含有可以回答该模糊问题的多种潜在备选答案时，开启该开关，大模型会以特定的话术做澄清反问，引导用户继续补充问题发问。举例子，query:发电机的续航时间？ Answer: 根据搜索结果得到了xx和xx两种型号的发电机，您的问题具体涉及到哪一个？请补充关键信息，作为完整的问题重新发问。\n- `highlight (bool, 可选)`: 重点强调开关，如果为 True，则启用该能力。默认为 False。开启该功能时，回复结果中会高亮显示关键部分的内容。\n- `friendly (bool, 可选)`: 友好性提升开关，如果为 True，则启用该能力。默认为 False。开关开启时，部分回复的开头会加礼貌用语。且如果回答涉及到大段的信息，会倾向于以<总-分>或者<总-分-总>的形式做分点论述，使得答案的格式更规整，可读性更强。\n- `cite (bool, 可选)`: 溯源开关，如果为 True，则启用该能力。默认为 False。开关开启时，回复内容后会使用引用标记来标注回答内容参考的搜索结果序号，如^[1]^ (引用单个搜索结果）,^[1][2]^（引用多个搜索结果）。例如：按照当地公安机关出入境管理部门规定的其他材料办理^[2]^。\n\n\n### 调用参数\n调用参数中的 instruction, reject, clarify, highlight, friendly 和 cite 会覆盖初始化时的参数。\n\n- `msg (obj:Message)`: 输入消息，包含用户提出的问题。这是一个必需的参数。\n- `instruction (obj:Message, 可选)`: 可设定人设，如：你是问答助手，在回答问题前需要加上“很高兴为您解答：”\n- `reject (bool, 可选)`: 拒绝开关，如果为 True，则启用该能力。默认为 False。当输入的问题在搜索结果中没有找到答案时，开关开启时，模型会用特定话术(\"当前文档库找不到对应的答案，我可以尝试用我的常识来回答你。\")做回复的开头，并后接自有知识做回复内容。\n- `clarify (bool, 可选)`: 澄清开关，如果为 True，则启用该能力。默认为 False。 当输入的问题比较模糊、或者主体指代不清晰，且context_list中包含有可以回答该模糊问题的多种潜在备选答案时，开启该开关，大模型会以特定的话术做澄清反问，引导用户继续补充问题发问。举例子，query:发电机的续航时间？ Answer: 根据搜索结果得到了xx和xx两种型号的发电机，您的问题具体涉及到哪一个？请补充关键信息，作为完整的问题重新发问。\n- `highlight (bool, 可选)`: 重点强调开关，如果为 True，则启用该能力。默认为 False。开启该功能时，回复结果中会高亮显示关键部分的内容。\n- `friendly (bool, 可选)`: 友好性提升开关，如果为 True，则启用该能力。默认为 False。开关开启时，部分回复的开头会加礼貌用语。且如果回答涉及到大段的信息，会倾向于以<总-分>或者<总-分-总>的形式做分点论述，使得答案的格式更规整，可读性更强。\n- `cite (bool, 可选)`: 溯源开关，如果为 True，则启用该能力。默认为 False。开关开启时，回复内容后会使用引用标记来标注回答内容参考的搜索结果序号，如^[1]^ (引用单个搜索结果）,^[1][2]^（引用多个搜索结果）。例如：按照当地公安机关出入境管理部门规定的其他材料办理^[2]^。\n- `stream (bool, 可选)`: 指定是否以流式形式返回响应。默认为 False。\n- `temperature (float, 可选)`: 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n- `top_p (float, 可选)`: 模型配置的top_p参数，top_p值越高输出文本越多样，top_p值越低输出文本越稳定。取值范围为 0.0 到 1.0，默认值为 1e-10。\n\n\n### 返回值\n- 返回一个 `Message` 对象，包含模型运行后的输出消息。\n\n\n## 高级用法\n该组件的高级用法包括定制化的输入处理、输出处理，以及更复杂的调用场景。用户可以根据具体需求扩展组件功能，实现个性化的问答系统。\n包括如下功能：\n1、人设\n2、拒答\n3、澄清反问\n4、重点强调\n5、友好度提升\n6、溯源\n\n\n### 代码样例\n\n```python\nimport appbuilder\nimport os\n\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建rag_with_baidusearch对象, 并初始化人设指令\nrag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch(\n        model=\"DeepSeek-V3.1\", \n        instruction=appbuilder.Message(\"你是问答助手，在回答问题前需要加上: 很高兴为您解答\"))\n\n\n# 运行rag_with_baidusearch组件，开启拒答、澄清追问、重点强调、友好性提升、溯源能力功能\nmsg = appbuilder.Message(\"残疾人怎么办相关证件\")\nresult = rag_with_baidusearch_component.run(\n        msg, reject=True, clarify=True, highlight=True,\n        friendly=True, cite=True, temperature=0.5, stream=False)\n\n# 输出运行结果\nprint(result)\n```\n\n### 返回参数说明\n\n返回的message中具体字段说明如下：\n\n| 字段            | 字段说明   |\n|---------------|--------|\n| name          | 名称     | \n| mtype         | 类型     | \n| content       | 内容     |  \n| extra         | 引用     | \n| +search_baidu | 百度搜索结果 |\n| ++content     | 网页内容摘要 |\n| ++url         | 网页链接   |\n| ++ref_id      | 序号     |\n| ++title       | 标题     |\n| ++icon        | 网站图标   |\n| ++site_name   | 网站名    |\n\n\n### 典型返回样例\n```\nMessage(name=msg, content=您好，请问您是想询问关于残疾人办理什么证件的问题吗？如果是，我可以为您提供一些信息。\n\n首先，如果您是首次申请办理残疾人证，需要携带身份证、户口簿和三张两寸近期免冠白底彩色照片到县残联办证窗口提出申请。如果您因身体原因无法亲自前往，可以联系村（社区）工作人员代办申请。\n\n其次，如果您是指残疾类型等级证明，您需要携带相关材料到指定医院或医生进行评级，并由医生签名盖章。\n\n最后，如果您是指残疾人享受低保或残疾人贫困证的一级肢体、视力、智力、精神、多重及60周岁以上的一级听力、语言的重度残疾人可以享受重度残疾人生活补助，那么您需要携带身份证、户口本和残疾证申请表到县、市、区级残联进行办理。\n\n希望这些信息对您有所帮助。如果您还有其他问题，欢迎随时提问。^[2]^, mtype=dict, extra={'search_baidu': [{'content': '(一)3张两寸近期免冠白底彩色照片。 (二)身份证、户口簿原件及复印件。 (三)申请智力、精神类残疾人证和未成年人申请残疾人证需同时提供法定监护人的身份证、户口本原件及复印件和监护人的证明材料。监护人证明材料为以下三项中任意一项: (1)能体现双方直系血缘亲属关系的户口簿。 (2)申请人所在村(社区)出具的说明双方关系的证明材料。 (3)其他能够证明其双方关系的合法证件。(法院判决书、结婚证、出生证明等) (四)经常居住地的有效居住证(户籍地不在本市申请人需提供此证件,本市户籍申请人无需提供此证件)。 (五)经常居住地残联要求的其他材料。 残疾证办理事项及流程', 'icon': 'https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1505232404,3530227258&fm=195&app=88&f=JPEG?w=200&h=200', 'url': 'https://www.jingzhou.gov.cn/ztfwnew/shjz/cjrbl/index.shtml', 'ref_id': '1', 'site_name': '荆州市人民政府', 'title': '残疾人证办理服务'}, {'content': '{#}申请{@}. 首次申请办理残疾人证人员,需持申请人居民身份证,户口簿和3张两寸近期免冠白底彩照,到县残联办证窗口(县政务服务中心一楼1号窗口)提出办证申请,填写《中华人民共和国残疾人证申请表》.如因身体原因个人无法出行办证,可联系村(社区)工作人员代办申请.', 'icon': None, 'url': 'https://mp.weixin.qq.com/s?__biz=MzIxMzM5ODY5OQ==&mid=2247485042&idx=1&sn=26a4cad0122d24971d3f5ce598af3564&chksm=97b623b6a0c1aaa02f776c19f567e0b3fabdef3d9f5c957e1f260f286fe5356101fd1ac4e675&scene=27', 'ref_id': '2', 'site_name': '微信公众平台', 'title': '残疾人证如何办理?到哪里评定?你想知道的都在这里'}, {'content': '一、残疾人如何办残疾证 1、户口所在地的县、市、区级残联领取《残疾人证申请表》和《残疾评定表》; 2、身份证或户口本复印件一张; 3、两寸彩色相片2-6张(多带不碍事,各地标准不一); 4、残疾类型等级证明。残疾很明显的可以直接到残联进行评级(像肢体类)审核办理,不明显的必须到指定医院、指定医生进行评级签名并盖章。 一切手续完备,就到县、市、区级残联进行办理,快的话立等可取,慢的话7-15天也差不多了。 二、残疾证有什么用? 1、持有残疾证的残疾人可享受低保或持残疾人贫困证的一级肢体、视力、智力、精神、多重及60周岁以上的一级听力、语言的重度残疾人,可享受重度残疾人生活补助。 2、残疾人托(安)养方面,一级重度残疾人(不含听力、语言、视力残疾)或18至60周岁二级重度残疾人(不含听力、语言、视力残疾),集中托养:低保户、贫困户的对象补助每年补助现金按各地政策规定金额发放。', 'icon': 'https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=215799447,688541359&fm=195&app=88&f=JPEG?w=200&h=200', 'url': 'https://mip.66law.cn/laws/1060751.aspx', 'ref_id': '3', 'site_name': '华律网', 'title': '残疾人如何办残疾证-证件办理|华律办事直通车'}]})\n```\n"
  },
  {
    "path": "docs/BasisModule/Components/rag_with_baidu_search_pro/README.md",
    "content": "# 百度搜索RAG_PRO\n\n## 简介\n百度搜索RAG_PRO组件旨在解决传统生成模型在生成长文本时可能会受到信息获取不足的问题，核心思想是将百度搜索与LLM相结合，使得生成的文本可以借助检索到的信息进行增强，从而提高生成文本的质量和相关性。\n\n### 功能介绍\n基于百度搜索结果进行RAG检索增强问答。\n百度搜索RAG_PRO组件支持配置用户指令，temperature，top_p，以及溯源开关等，为用户提供了更灵活的控制选项。\n对比旧版百度搜索RAG，新版百度搜索RAG_PRO在支持配置检索个数和检索类型（网页、视频等）方面进行了升级。\n\n### 特色优势\n百度搜索RAG_PRO组件的综合优势在于通过结合百度搜索的搜索引擎技术和ERNIE模型的语义理解能力，可以更准确地理解用户的搜索意图，并提供与搜索查询相关性更高的搜索结果。\n\n### 应用场景\n通用搜索领域\n\n## 基本用法\n以下是一个简单的例子来演示如何开始使用百度搜索RAG_PRO组件：\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建rag_with_baidusearch_pro对象\nrag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model=\"DeepSeek-V3.1\")\n\n# 运行rag_with_baidusearch基本组件\nmsg = appbuilder.Message(\"残疾人怎么办相关证件\")\nresult = rag_with_baidu_search_pro.run(msg)\n\n# 获取reference\nreferences = result.extra\n\n# 输出运行结果\nprint(result)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n- `instruction (obj:Message, 可选)`: 可设定人设，如：你是问答助手，在回答问题前需要加上“很高兴为您解答：”\n\n\n### 调用参数\n调用参数中的 instruction 会覆盖初始化时的参数。\n\n- `msg (obj:Message)`: 输入消息，包含用户提出的问题。这是一个必需的参数。\n- `instruction (obj:Message, 可选)`: 可设定人设，如：你是问答助手，在回答问题前需要加上“很高兴为您解答：”\n- `stream (bool, 可选)`: 指定是否以流式形式返回响应。默认为 False。\n- `temperature (float, 可选)`: 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n- `top_p (float, 可选)`: 模型配置的top_p参数，top_p值越高输出文本越多样，top_p值越低输出文本越稳定。取值范围为 0.0 到 1.0，默认值为 1e-10。\n- `search_top_k (int, 可选)`: 指定百度搜索返回的检索个数，最多10，默认为4。\n- `hide_corner_markers (bool, 可选)`: 溯源开关，True隐藏来源，False显示来源，默认为True，不显示结果来源。\n\n\n### 返回值\n- 返回一个 `Message` 对象，包含模型运行后的输出消息。\n\n\n## 高级用法\n该组件的高级用法包括定制化的输入处理、输出处理，以及更复杂的调用场景。用户可以根据具体需求扩展组件功能，实现个性化的问答系统。\n包括如下功能：\n1、人设\n2、溯源\n3、百度搜索检索个数\n\n\n### 代码样例\n\n```python\nimport appbuilder\nimport os\n\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建rag_with_baidusearch对象, 并初始化人设指令\nrag_with_baidusearch_pro = appbuilder.RagWithBaiduSearchPro(\n        model=\"DeepSeek-V3.1\", \n        instruction=appbuilder.Message(\"你是问答助手，在回答问题前需要加上: 很高兴为您解答\"))\n\n\n# 运行rag_with_baidusearch组件，开启拒答、澄清追问、重点强调、友好性提升、溯源能力功能\nmsg = appbuilder.Message(\"残疾人怎么办相关证件\")\nresult = rag_with_baidusearch_pro.run(\n        msg, temperature=0.5, stream=False)\n\n# 输出运行结果\nprint(result)\n```\n\n### 返回参数说明\n\n返回的message中具体字段说明如下：\n\n| 字段            | 字段说明   |\n|---------------|--------|\n| name          | 名称     | \n| mtype         | 类型     | \n| content       | 内容     |  \n| extra         | 引用     | \n| +search_baidu | 百度搜索结果 |\n| ++content     | 网页内容摘要 |\n| ++url         | 网页链接   |\n| ++ref_id      | 序号     |\n| ++title       | 标题     |\n| ++icon        | 网站图标   |\n| ++site_name   | 网站名    |\n\n\n### 典型返回样例\n```\nMessage(name=msg, content=您好，请问您是想询问关于残疾人办理什么证件的问题吗？如果是，我可以为您提供一些信息。\n\n首先，如果您是首次申请办理残疾人证，需要携带身份证、户口簿和三张两寸近期免冠白底彩色照片到县残联办证窗口提出申请。如果您因身体原因无法亲自前往，可以联系村（社区）工作人员代办申请。\n\n其次，如果您是指残疾类型等级证明，您需要携带相关材料到指定医院或医生进行评级，并由医生签名盖章。\n\n最后，如果您是指残疾人享受低保或残疾人贫困证的一级肢体、视力、智力、精神、多重及60周岁以上的一级听力、语言的重度残疾人可以享受重度残疾人生活补助，那么您需要携带身份证、户口本和残疾证申请表到县、市、区级残联进行办理。\n\n希望这些信息对您有所帮助。如果您还有其他问题，欢迎随时提问。^[2]^, mtype=dict, extra={'search_baidu': [{'content': '(一)3张两寸近期免冠白底彩色照片。 (二)身份证、户口簿原件及复印件。 (三)申请智力、精神类残疾人证和未成年人申请残疾人证需同时提供法定监护人的身份证、户口本原件及复印件和监护人的证明材料。监护人证明材料为以下三项中任意一项: (1)能体现双方直系血缘亲属关系的户口簿。 (2)申请人所在村(社区)出具的说明双方关系的证明材料。 (3)其他能够证明其双方关系的合法证件。(法院判决书、结婚证、出生证明等) (四)经常居住地的有效居住证(户籍地不在本市申请人需提供此证件,本市户籍申请人无需提供此证件)。 (五)经常居住地残联要求的其他材料。 残疾证办理事项及流程', 'icon': 'https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1505232404,3530227258&fm=195&app=88&f=JPEG?w=200&h=200', 'url': 'https://www.jingzhou.gov.cn/ztfwnew/shjz/cjrbl/index.shtml', 'ref_id': '1', 'site_name': '荆州市人民政府', 'title': '残疾人证办理服务'}, {'content': '{#}申请{@}. 首次申请办理残疾人证人员,需持申请人居民身份证,户口簿和3张两寸近期免冠白底彩照,到县残联办证窗口(县政务服务中心一楼1号窗口)提出办证申请,填写《中华人民共和国残疾人证申请表》.如因身体原因个人无法出行办证,可联系村(社区)工作人员代办申请.', 'icon': None, 'url': 'https://mp.weixin.qq.com/s?__biz=MzIxMzM5ODY5OQ==&mid=2247485042&idx=1&sn=26a4cad0122d24971d3f5ce598af3564&chksm=97b623b6a0c1aaa02f776c19f567e0b3fabdef3d9f5c957e1f260f286fe5356101fd1ac4e675&scene=27', 'ref_id': '2', 'site_name': '微信公众平台', 'title': '残疾人证如何办理?到哪里评定?你想知道的都在这里'}, {'content': '一、残疾人如何办残疾证 1、户口所在地的县、市、区级残联领取《残疾人证申请表》和《残疾评定表》; 2、身份证或户口本复印件一张; 3、两寸彩色相片2-6张(多带不碍事,各地标准不一); 4、残疾类型等级证明。残疾很明显的可以直接到残联进行评级(像肢体类)审核办理,不明显的必须到指定医院、指定医生进行评级签名并盖章。 一切手续完备,就到县、市、区级残联进行办理,快的话立等可取,慢的话7-15天也差不多了。 二、残疾证有什么用? 1、持有残疾证的残疾人可享受低保或持残疾人贫困证的一级肢体、视力、智力、精神、多重及60周岁以上的一级听力、语言的重度残疾人,可享受重度残疾人生活补助。 2、残疾人托(安)养方面,一级重度残疾人(不含听力、语言、视力残疾)或18至60周岁二级重度残疾人(不含听力、语言、视力残疾),集中托养:低保户、贫困户的对象补助每年补助现金按各地政策规定金额发放。', 'icon': 'https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=215799447,688541359&fm=195&app=88&f=JPEG?w=200&h=200', 'url': 'https://mip.66law.cn/laws/1060751.aspx', 'ref_id': '3', 'site_name': '华律网', 'title': '残疾人如何办残疾证-证件办理|华律办事直通车'}]})\n```\n"
  },
  {
    "path": "docs/BasisModule/Components/retriever/README.md",
    "content": "# 向量检索\n\n## 简介\nAppbuilder提供多种向量数据库作为向量检索的底座，当前主要支持百度向量数据库、百度 ElasticSearch。\n\n### 功能介绍\n`向量检索-VDB`组件（Baidu VDB Retriever）以百度向量数据库作为向量存储和检索的底座。百度向量数据库是一个专注于多维向量数据的存储、检索和分析的企业级分布式数据库服务。基于百度自主研发的向量数据库内核，VectorDB在保证高性能和高可用性的同时，也特别注重易用性和可扩展性。它支持多种索引类型和相似度计算方法，能够满足各类复杂和多样化的数据应用需求。特别值得一提的是，VectorDB能够管理高达数十亿的向量规模，同时保持毫秒级的查询响应时间，非常适合进行大规模的向量检索和分析任务。\n\n`向量检索-BES`组件（Baidu ElasticSearch Retriever）以百度 ElasticSearch作为向量存储和检索的底座。百度 ElasticSearch是一款专为企业级需求设计的分布式搜索和分析服务，它在全面兼容开源ElasticSearch的基础上，提供了更多增强功能。这款服务的核心优势在于其高性能和高可靠性，它为处理结构化和非结构化数据提供了一个低成本且高效的平台。对于关注数据安全的客户来说，百度ElasticSearch提供了先进的权限管理机制，使得您可以根据业务需求自由地配置集群权限。\n\n"
  },
  {
    "path": "docs/BasisModule/Components/retriever/baidu_vdb/README.md",
    "content": "# 向量检索-VectorDB（BaiduVectorDBRetriever）\n\n## 简介\n向量检索-VectorDB（BaiduVectorDBRetriever）基于一款百度向量数据库的内容检索组件，支持根据文本的向量的相似度进行内容检索。\n\n### 功能介绍\n向量检索-VectorDB（BaiduVectorDBRetriever）用于在将文本内容输入到百度向量数据库，根据文本的向量相似度进行高效的内容检索。\n\n### 特色优势\n高效准确：基于百度向量数据库的强大能力，提供高效且准确的内容检索功能。\n\n### 应用场景\n各种内容检索场景\n\n## 准备工作\n在使用向量检索-VectorDB（BaiduVectorDBRetriever）进行内容检索之前，需要到百度向量数据库官网创建相应的实例，[教程](https://cloud.baidu.com/doc/VDB/s/hlrsoazuf)。\n\n## 基本用法\n\n以下是有关如何开始使用向量检索-VectorDB（BaiduVectorDBRetriever）的代码示例：\n\n补充说明：\n- `you_vdb_instance_id` 为VectorDB 实例ID，请替换为您的实例ID，在VectorDB控制台界面上可以查看\n- `your_api_key` 为您在VectorDB上申请的账户密钥，请替换为您自己的root账户密钥，在VectorDB控制台界面上可以查看\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nsegments = appbuilder.Message([\"文心一言大模型\", \"百度在线科技有限公司\"])\n# 初始化构建索引\nvector_index = appbuilder.BaiduVDBVectorStoreIndex.from_params(\n    instance_id=your_instance_id,\n    api_key=your_api_key,\n    drop_exists=True,\n)\nvector_index.add_segments(segments)\n\nquery = appbuilder.Message(\"文心一言\")\nretriever = vector_index.as_retriever()\nres = retriever(query)\nprint(res)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数说明：\n`BaiduVDBVectorStoreIndex()` 实例化参数说明：\n- instance_id（str，必填）：百度向量数据库的实例id，创建实例时获取\n- api_key    （str，必填）：连接向量数据库所需的密码，创建实例时获取\n- account    （str，非必填）：连接向量数据库所需的用户名，默认root\n- database_name （str，非必填） ：向量数据库的名称，默认为AppBuilderDatabase\n- table_params （TableParams，非必填） ：VectorDB table参数，参考链接[VectorDB table params](https://cloud.baidu.com/doc/VDB/s/mlrsob0p6)\n- embedding   （Embedding，非必填） ：appbuilder.Embedding类型，若有构造好的Embedding，可以增量插入，否则默认新建embedding\n\n-------\n\n`BaiduVDBVectorStoreIndex().from_params()` 构造函数参数说明：\n- instance_id（str，必填）：百度向量数据库的实例id，创建实例时获取\n- api_key    （str，必填）：连接向量数据库所需的密码，创建实例时获取\n- account    （str，非必填）：连接向量数据库所需的用户名，默认root\n- database_name （str，非必填） ：向量数据库的名称，默认为AppBuilderDatabase\n- table_name  （str，非必填） ：向量数据库的表名，默认为AppBuilderTable\n- drop_exists (bool, 非必填) ：是否清空数据库历史记录，默认为False\n\n-------\n\n\n### 调用参数：\n\n`BaiduVDBRetriever().run()` 函数参数说明：\n\n| 参数名称    | 参数类型   |是否必须 | 描述               | 示例值           |\n|---------|--------|--------|------------------|---------------|\n| message | String |是 | 需要检索的内容, 类型为Message，content类型为str, 长度要求(0,512)          | \"中国2023人均GDP\" |\n| top_k   | int    |否 | 返回相似度最高的top_k个内容,top_k的数值范围(1,embedding索引数量] | 1             |\n\n\n### 响应参数\n\n`BaiduVDBRetriever().run()` 函数返回值说明：\n\n| 参数名称 | 参数类型   | 描述  | 示例值                |\n|------|--------|-----|--------------------|\n| text | string | 检索结果 | \"中国2023年人均GDP8.94万元\" |\n| score | float  | 相似度 | 0.95               |\n| meta | dict   | 元信息 | \"\"                   |\n### 响应示例\n```json\n{\"text\": \"中国2023年人均GDP8.94万元\", \"score\": 0.95, \"meta\": \"\"}\n```\n\n## 高级用法：\n\n本组件根据向量的相似度进行检索，支持使用不同的embedding方法和索引方式来优化检索的效果。\n\n## 更新记录和贡献\n* 向量检索能力 (2024-03)\n"
  },
  {
    "path": "docs/BasisModule/Components/retriever/bes/README.md",
    "content": "# 向量检索-BES（BaiduElasticSearchRetriever）\n\n## 简介\n向量检索-BES组件（BaiduElasticSearchRetriever）基于一款Baidu ElasticSearch的内容检索组件，支持根据文本的向量的相似度进行内容检索。\n\n### 功能介绍\n向量检索-BES组件（BaiduElasticSearchRetriever）用于在将文本内容输入到Baidu ElasticSearch，根据文本的向量相似度进行高效的内容检索。\n\n### 特色优势\n- 高效准确：基于Baidu ElasticSearch的强大能力，提供高效且准确的内容检索功能。\n\n### 应用场景\n各种内容检索场景\n\n## 准备工作\n在使用BaiduElasticSearchRetriever进行内容检索之前，需要到Baidu ElasticSearch官网创建相应的集群，详情见[教程](https://cloud.baidu.com/doc/BES/s/gke3ocf89)。\n\n注：创建集群时请选择7.10.2版本的ES，否则可能无法使用本组件。\n\n## 基本用法\n\n以下是有关如何开始使用BESRetriever的代码示例：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nembedding = appbuilder.Embedding()\nsegments = appbuilder.Message([\"文心一言大模型\", \"百度在线科技有限公司\"])\n# 初始化构建索引\nvector_index = appbuilder.BESVectorStoreIndex.from_segments(segments=segments, cluster_id=es_cluster_id, user_name=es_username, \n                                                            password=es_password, embedding=embedding)\n# 获取当前索引中的全部内容\nall_content = vector_index.get_all_segments()\nprint(all_content)\n# 转化为retriever\nretriever = vector_index.as_retriever()\n# 按照query进行检索\nquery = appbuilder.Message(\"文心一言\")\nres = retriever(query=query, top_k=1)\nprint(res)\n# 删除当前索引中的全部内容\nvector_index.delete_all_segments()\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数说明：\n\n- segments （Message[List[str]]，必填）：需要入库的文本段落\n- cluster_id （str，必填）：ElacticSearch集群的id，创建集群时获取\n- user_name  （str，必填）：连接ES集群所需的用户名，创建集群时获取\n- password   （str，必填）：连接ES集群所需的密码，创建集群时获取\n- embedding  （obj，非必填）：用于将文本转为向量的模型，默认为Embedding\n\n### 调用参数：\n| 参数名称    | 参数类型   |是否必须 | 描述               | 示例值           |\n|---------|--------|--------|------------------|---------------|\n| message | String |是 | 需要检索的内容          | \"中国2023人均GDP\" |\n| top_k   | int    |否 | 返回相似度最高的top_k个内容 | 1             |\n\n### 响应参数\n| 参数名称 | 参数类型   | 描述  | 示例值                |\n|------|--------|-----|--------------------|\n| text | string | 检索结果 | \"中国2023年人均GDP8.94万元\" |\n| score | float  | 相似度 | 0.95               |\n| meta | dict   | 元信息 | \"\"                   |\n### 响应示例\n```json\n{\"text\": \"中国2023年人均GDP8.94万元\", \"score\": 0.95, \"meta\": \"\"}\n```\n\n## 高级用法：\n\n本组件根据向量的相似度进行检索，支持使用不同的embedding方法和索引方式来优化检索的效果。\n\n## 更新记录和贡献\n* 向量检索能力 (2023-12)"
  },
  {
    "path": "docs/BasisModule/Components/retriever/reranker/README.md",
    "content": "# 文本精排（Reranker）\n\n## 简介\n文本精排能力，将Query召回到的N个候选文本段落进行精排；保证与Query相关程度越高的文本段落排序越靠前，提升检索效果。\n\n### 功能介绍\n文本精排（Reranker）用于检索排序，输入为Query和Top K个段落，输出为每个段落的排序得分；Query相关程度越高的文本段落排序越靠前，用于提升检索效果。\n\n### 特色优势\n- 高效准确：基于开源模型[\nbce-reranker](https://huggingface.co/maidalun1020/bce-reranker-base_v1)的能力，提供高效且准确的内容检索功能。[百度云推理服务Api](https://cloud.baidu.com/doc/WENXINWORKSHOP/s/xlu216rqn)\n\n### 应用场景\n检索排序场景\n\n\n## 基本用法\n\n以下是有关如何开始使用BESRetriever的代码示例：\n\n```python\nimport os\nimport appbuilder\nfrom appbuilder import Message\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nreranker = appbuilder.Reranker()\nranked_1 = reranker(\"你好\", [\"他也好\", \"hello?\"])\nprint(ranked_1)\n\n# 使用上游的Message作为输入的代码示例\nranked_2 = reranker(appbuilder.Message(\"你好\"), appbuilder.Message([\"他也好\", \"hello?\"]))\nprint(ranked_2)\n```\n\n## 参数说明\n### 初始化参数说明：\n\n| 参数名称 | 参数类型 |是否必须 | 描述 | 示例值 |\n|---------|--------|--------|------------------|---------------|\n| model | str |是 | 指定底座模型的类型。当前仅支持 bce-reranker-base 作为可选值。若不指定，默认值为 bce-reranker-base。 | bce-reranker-base |\n\n\n### 调用参数：\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n|---------|--------|--------|------------------|---------------|\n| query | str |是 | 精排Query，长度小于1600。 | \"你好\" |\n| texts | List[str] | 是 | 精排输入段落，会对列表里的所有内容排序，最大长度为50. | [\"你好\", \"世界\"] |\n\n### 响应参数：\n\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n|---------|--------|------------------|---------------|\n| +document | str | 输入的段落 | \"hello?\" |\n| +relevance_score | float | 精排的相关性分数 | 0.565118 |\n| +index | int | 输入段落的原始index | -- |\n\n\n### 响应示例\n#### 输入\n```python\nquery=\"你好\", text=[\"他也好\", \"hello?\"]\n```\n\n#### 响应\n```json\n[\n    {\n        \"document\": \"hello?\",\n        \"relevance_score\": 0.5651187300682068,\n        \"index\": 1\n    },\n    {\n        \"document\": \"他也好\",\n        \"relevance_score\": 0.47729530930519104,\n        \"index\": 0\n    }\n]\n```\n\n\n### 错误码\n\n无\n\n## 更新记录和贡献\n\n* reranker-base (2024-08)\n"
  },
  {
    "path": "docs/BasisModule/Components/table_ocr/README.md",
    "content": "# 表格文字识别 (TableOCR) \n\n## 简介\n表格文字识别 (TableOCR) 可支持识别图片中的表格内容，返回各表格的表头表尾内容、单元格文字内容及其行列位置信息，全面覆盖各类表格样式，包括常规有线表格、无线表格、含合并单元格表格。同时，支持多表格内容识别。\n### 功能介绍\n* 简单表格文字识别\n\n支持识别具备完整框线的常规简单表格，结构化输出表头、表尾及每个单元格的文字内容。\n* 复杂表格文字识别\n\n可识别无表格框线，但行、列位置明确的表格，支持含合并单元格的复杂表格文字识别。\n### 特色优势\n* 支持识别图片中的表格内容，返回各表格的表头表尾内容、单元格文字内容及其行列位置信息，全面覆盖各类表格样式，包括常规有线表格、无线表格、含合并单元格表格。同时，支持单图中多表格内容的识别。\n\n### 应用场景\n* 信息登记表识别\n\n  对个人、商品、公示内容等纸质信息登记表进行识别，用于登记信息的结构化整理和统计，大幅度降低人力录入成本，提升信息管理的便捷性\n* 财税报表识别\n\n  提取识别银行对账单、资产负债表、损益表等财税场景常用表格内容，快速实现表格内容的电子化，用于财税信息统计、存档及核算，大幅度提升信息录入效率\n## 基本用法\n\n下面是表格文字识别的代码示例：\n\n示例图片为\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6064079145ff4698856f477b820147768fc2187d3)\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024\" \\\n            \"-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\" \\\n            \"064079145ff4698856f477b820147768fc2187d3\"\nraw_image = requests.get(image_url).content\n# 创建表格文字识别组件实例\ntable_ocr = appbuilder.TableOCR()\n# 执行识别操作并获取结果\nout = table_ocr.run(appbuilder.Message(content={\"raw_image\": raw_image}))\nprint(out.content)\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数 （以表格形式展示）\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\n\n### 响应参数\n| 参数名称             | 参数类型    | 描述            | 示例值                                                                                                                                                                                      |\n|------------------|---------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| tables_result    | array[] | 返回结果          | [{\"table_location\": [],\"header\": [],\"body\": [],\"footer\": []}]                                                                                                                            |\n| +table_location\t | array[] | 单个表格的四角点x,y坐标 | [{ \"x\": 15, \"y\": 15 },{ \"x\": 371, \"y\": 15 },{ \"x\": 371, \"y\": 98 },{ \"x\": 15, \"y\": 98 }],                                                                                                 |\n| +header          | array[] | 表头信息          | [{'location': [{'x': 325, 'y': 40}, {'x': 528, 'y': 40}, {'x': 528, 'y': 71}, {'x': 325, 'y': 71}], 'words': '财务状况变动表'}, {...}]                                                          |\n| +body\t           | array[] | 单元格信息         | [{\"cell_location\": [{ \"x\": 15, \"y\": 15 },{ \"x\": 120, \"y\": 15 },{ \"x\": 120, \"y\": 58 },{ \"x\": 15, \"y\": 58 }],\"row_start\": 0,\"row_end\": 1,\"col_start\": 0,\"col_end\": 1,\"words\": \"参数\"},{...}] |\n| +footer\t         | array[] | 表尾信息          | [{'location': [...], 'words': '...'}, {...}]                                                                                                                                             |\n\n### 响应示例\n```json\n{\n  \"tables_result\": [\n    {\n      \"table_location\": [\n        { \"x\": 15, \"y\": 15 },\n        { \"x\": 371, \"y\": 15 },\n        { \"x\": 371, \"y\": 98 },\n        { \"x\": 15, \"y\": 98 }\n      ],\n      \"header\": [],\n      \"body\": [\n        {\n          \"cell_location\": [\n            { \"x\": 15, \"y\": 15 },\n            { \"x\": 120, \"y\": 15 },\n            { \"x\": 120, \"y\": 58 },\n            { \"x\": 15, \"y\": 58 }\n          ],\n          \"row_start\": 0,\n          \"row_end\": 1,\n          \"col_start\": 0,\n          \"col_end\": 1,\n          \"words\": \"参数\"\n        },\n        {\n          \"cell_location\": [\n            { \"x\": 120, \"y\": 15 },\n            { \"x\": 371, \"y\": 15 },\n            { \"x\": 371, \"y\": 58 },\n            { \"x\": 120, \"y\": 58 }\n          ],\n          \"row_start\": 0,\n          \"row_end\": 1,\n          \"col_start\": 1,\n          \"col_end\": 2,\n          \"words\": \"值\"\n        },\n        {\n          \"cell_location\": [\n            { \"x\": 15, \"y\": 58 },\n            { \"x\": 120, \"y\": 58 },\n            { \"x\": 120, \"y\": 98 },\n            { \"x\": 15, \"y\": 98 }\n          ],\n          \"row_start\": 1,\n          \"row_end\": 2,\n          \"col_start\": 0,\n          \"col_end\": 1,\n          \"words\": \"Content-Type\"\n        },\n        {\n          \"cell_location\": [\n            { \"x\": 120, \"y\": 58 },\n            { \"x\": 371, \"y\": 58 },\n            { \"x\": 371, \"y\": 98 },\n            { \"x\": 120, \"y\": 98 }\n          ],\n          \"row_start\": 1,\n          \"row_end\": 2,\n          \"col_start\": 1,\n          \"col_end\": 2,\n          \"words\": \"application/x-www-form-urlencoded\"\n        }\n      ],\n      \"footer\": []\n    }\n  ]\n}\n```\n### 错误码\n| 错误码 | 描述 |\n|-----|----|\n\n## 高级用法\n\n目前该模块仅提供基础的表格文字识别功能。\n\n\n## 更新记录和贡献\n* 表格文字识别能力 (2024-01)"
  },
  {
    "path": "docs/BasisModule/Components/text_to_image/README.md",
    "content": "# 文生图 (Text2Image)\n\n## 简介\n文生图（Text2Image）基于文心大模型，可以根据用户输入的文本，自动创作不限定风格的图，为内容创作者提供灵感和高质量配图。\n\n### 功能介绍\nAI一下，文字成画，AI 精准理解中文文本，支持用户自由输入，只需一句话，让文字秒变精美画作，支持自定义丰富的修饰词，可生成不同风格、不同构图、不同流派的图片，满足个性化的图片生成需求。\n### 特色优势\n利用知识增强扩散模型，学习过程融入语言、视觉、跨模态等多源知识，生成图像语义一致性更高，基于混合降噪专家网络，全球最大跨模态生成模型，参数规模达到240亿，根据生成阶段选择最优生成“专家”，从图像轮廓渐进优化细节，全面提升生成质量。\n### 应用场景\n图片素材、艺术插图、海报制作、故事插图、壁纸制作、电商应用、室内设计、影视制作、游戏原画设计、服务创意启发平台等。\n\n## 基本用法\n\n下面是文生图的代码示例: \n\n```python\nimport os\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\ntext2Image = appbuilder.Text2Image()\ncontent_data = {\"prompt\": \"上海的经典风景\", \"width\": 1024, \"height\": 1024, \"image_num\": 1}\nmsg = appbuilder.Message(content_data)\nout = text2Image.run(msg)\nprint(out.content)\n#{'img_urls': ['...']}\n```\n\n生成的\"上海的经典风景\"图片如下\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder-sdk-components/shanghai.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-05-30T03%3A08%3A30Z%2F-1%2Fhost%2F64296a40b3f01d39776129e0b4ce732b1784f2f91e3afcf9dd7c1de8c3df6a0a)\n\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|message |String  |是 |输入的消息，输入的消息，用于模型的主要输入内容。这是一个必需的参数| Message(content={\"prompt\": \"上海的经典风景\"}) |\n|width|Integer|是 |图片宽度，支持：512x512、640x360、360x640、1024x1024、1280x720、720x1280、2048x2048、2560x1440、1440x2560。| 1024   |\n|height|Integer|是 |图片高度，支持：512x512、640x360、360x640、1024x1024、1280x720、720x1280、2048x2048、2560x1440、1440x2560。| 1024   |\n|image_num|Integer|是 |生成图片数量，默认一张，支持生成 1-8 张。| 1      |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer|是 |HTTP重试次数| 3      |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |String  |返回结果|[\"xxx\"]|\n\n### 响应示例\n```json\n{\"img_urls\": [\"xxx\"]}\n```\n### 错误码\n| 错误码 |描述|\n|---|---|\n| 282000 |服务器内部错误，请再次请求， 如果持续出现此类错误，请在控制台提交工单联系技术支持团队|\n| 282004 |请求中包含敏感词、非法参数、字数超限，或上传违规参考图，请检查后重新尝试|\n| 282003 |缺少必要参数|\n| 17 |日配额流量超限|\n| 18 |QPS 超限额|\n| 216630 |服务器内部错误，请再次请求，如果持续出现此类错误，请通过工单联系技术支持|\n| 501 |文本黄反拦截|\n| 201 |模型生图失败|\n| 216100 |参数不满足格式要求|\n| 216201 |参考图不满足格式要求|\n| 4 |错误信息为中文的“请求超限”指所有用户提交的 AI 作画总数超限制|\n| 13 |错误信息为中文的“QPS 超限”指单个用户使用提交请求接口的 QPS 超限|\n| 15 |错误信息为中文的“并发超限”指单个用户使用 AI 作画的并发超限|\n| 17 |错误信息为中文的“用量超限”指单个用户使用 AI 作画的用量超限|\n\n\n\n## 高级用法\n\n目前该模块仅提供基础的文生图功能。\n## 更新记录和贡献\n* 文生图能力 (2023-12)\n"
  },
  {
    "path": "docs/BasisModule/Components/translate/README.md",
    "content": "# 文本翻译-通用版（Translation）\n\n## 简介\n\n文本翻译组件（Translation）提供多种语言互译的在线文本翻译服务。支持术语定制功能，用户可对翻译结果进行干预，快速提高翻译质量。可广泛应用于移动端、PC网站、智能硬件等不同产品形态中，满足多领域、多场景的翻译需求。   \n\n### 功能介绍\n\n支持200+语种互译，传入待翻译内容，并指定源语言（支持语种自动检测）和目标语言，即可获得翻译结果，并支持术语干预。  \n支持在【创建应用】-【添加工具组件】时，对以下语言的试用：\n\n|名称       | 代码   | 名称       | 代码   | 名称       | 代码   |\n|------------|--------|------------|--------|------------|--------|\n| 自动检测   | auto   | 中文       | zh     | 英语       | en     |\n| 粤语       | yue    | 文言文     | wyw    | 日语       | jp     |\n| 韩语       | kor    | 法语       | fra    | 西班牙语   | spa    |\n| 泰语       | th     | 阿拉伯语   | ara    | 俄语       | ru     |\n| 葡萄牙语   | pt     | 德语       | de     | 意大利语   | it     |\n| 希腊语     | el     | 荷兰语     | nl     | 波兰语     | pl     |\n| 保加利亚语 | bul    | 爱沙尼亚语 | est    | 丹麦语     | dan    |\n| 芬兰语     | fin    | 捷克语     | cs     | 罗马尼亚语 | rom    |\n| 斯洛文尼亚语 | slo   | 瑞典语     | swe    | 匈牙利语   | hu     |\n| 繁体中文   | cht    | 越南语     | vie    |            |        |\n\n### 特色优势\n\n1. 依托互联网数据资源和自然语言处理技术优势，上线全球首个互联网神经网络翻译系统，日均响应千亿字符请求\n2. 2019国际机器翻译评测（WMT19）中，获得中英翻译第一，提供业界领先的机器翻译服务\n3. 支持用户上传术语对翻译结果进行干预，优化翻译质量，用户可根据不同产品、不同领域创建多个术语库\n4. 翻译请求可实现实时响应，服务稳定性高，在海外也可及时获取翻译结果，保障用户稳定的服务体验\n\n### 应用场景\n\n1. 教育学习：在外语教学及学习场景中，通过实时句子翻译、单词释义、语音合成等功能，帮助师生沟通、外教课后点评，辅助阅读和写作，全面提升学习效率与质量\n2. 手机厂商：应用于手机系统中，实现手机系统取词翻译、对话文本翻译等服务。为手机应用开发者提供便捷的翻译功能\n3. 跨境电商：在商业全球化背景下，针对跨国商贸服务中产品名称、详情页等网站基本信息进行翻译，助力企业开拓国际市场\n4. 智能硬件：应用于翻译机、学习机、智能手表等硬件系统中，为用户提供文本翻译、词典及语音合成等能力，实现便捷准确的多语种互译功能\n\n## 基本用法\n\n通过如下示例代码可以快速开始使用文本翻译组件：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\ntranslate = appbuilder.Translation()\nresp = translate(appbuilder.Message(\"你好\\n中国\"), from_lang=\"zh\", to_lang=\"en\")\n# 输出{'from_lang': 'zh', 'to_lang': 'en', 'trans_result': [{'src': '你好', 'dst': 'hello'}, {'src': '中国', 'dst': 'China'}]}\nprint(resp.content)\n```\n\n## 参数说明\n\n### 鉴权配置\n\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数说明\n\n无\n\n### 调用参数说明\n\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|message |obj:`Message`  |是 |输入的请求翻译文本| Message(\"你好\") |\n|from_lang|String|否 |翻译的源语言，默认为`auto`，表示自动检测语言。| zh    |\n|to_lang|Integer|否 |需要翻译的目标语言，默认为`en`，表示英语。| en  |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer|否 |HTTP重试次数| 3      |\n\n### 响应参数\n\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|from_lang  |String  |翻译源语言| zh|\n|to_lang  |String  |翻译目标语言|en|\n|trans_result  |List[Object]  |返回结果|[{'src': '你好', 'dst': 'hello'}]|\n|trans_result[0].src  |String  |源文本|你好|\n|trans_result[0].dst  |String  |目标文本|hello|\n\n### 响应示例\n\n```json\n{\n  \"from_lang\": \"zh\",\n  \"to_lang\": \"en\",\n  \"trans_result\": [\n    {\n      \"src\": \"你好\",\n      \"dst\": \"hello\"\n    }\n  ]\n}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 更新记录和贡献\n* 文本翻译-通用版 (2024-01)\n\n## 语种列表\n\n|名称 |代码 |语种检测|\n|----|-----|------|\n| 阿拉伯语           | ara  | 是   |\n| 爱尔兰语           | gle  | 是   |\n| 奥克语             | oci  | 是   |\n| 阿尔巴尼亚语        | alb  | 是   |\n| 阿尔及利亚阿拉伯语   | arq  | 否   |\n| 阿肯语             | aka  | 否   |\n| 阿拉贡语           | arg  | 否   |\n| 阿姆哈拉语          | amh  | 是   |\n| 阿萨姆语           | asm  | 是   |\n| 艾马拉语           | aym  | 否   |\n| 阿塞拜疆语          | aze  | 是   |\n| 阿斯图里亚斯语       | ast  | 是   |\n| 奥塞梯语            | oss  | 否   |\n| 爱沙尼亚语          | est  | 是   |\n| 奥杰布瓦语          | oji  | 否   |\n| 奥里亚语            | ori  | 是   |\n| 奥罗莫语            | orm  | 否   |\n| 波兰语              | pl   | 是   |\n| 波斯语              | per  | 是   |\n| 布列塔尼语          | bre  | 是   |\n| 巴什基尔语          | bak  | 否   |\n| 巴斯克语            | baq  | 是   |\n| 巴西葡萄牙语        | pot  | 否   |\n| 白俄罗斯语          | bel  | 是   |\n| 柏柏尔语            | ber  | 是   |\n| 邦板牙语            | pam  | 否   |\n| 保加利亚语          | bul  | 是   |\n| 北方萨米语          | sme  | 否   |\n| 北索托语           | ped  | 否   |\n| 本巴语             | bem  | 否   |\n| 比林语             | bli  | 否   |\n| 比斯拉马语          | bis  | 否   |\n| 俾路支语            | bal  | 否   |\n| 冰岛语              | ice  | 是   |\n| 波斯尼亚语          | bos  | 是   |\n| 博杰普尔语          | bho  | 否   |\n| 楚瓦什语            | chv  | 否   |\n| 聪加语             | tso  | 否   |\n| 丹麦语             | dan  | 是   |\n| 德语               | de   | 是   |\n| 鞑靼语              | tat  | 是   |\n| 掸语               | sha  | 否   |\n| 德顿语              | tet  | 否   |\n| 迪维希语            | div  | 否   |\n| 低地德语            | log  | 是   |\n| 俄语               | ru   | 是   |\n| 法语               | fra  | 是   |\n| 菲律宾语            | fil  | 是   |\n| 芬兰语              | fin  | 是   |\n| 梵语               | san  | 否   |\n| 弗留利语            | fri  | 否   |\n| 富拉尼语            | ful  | 否   |\n| 法罗语              | fao  |   否   |\n| 盖尔语              | gla  | 否   |\n| 刚果语              | kon  | 否   |\n| 高地索布语          | ups  | 否   |\n| 高棉语             | hkm  | 是   |\n| 格陵兰语           | kal  | 否   |\n| 格鲁吉亚语         | geo  | 是   |\n| 古吉拉特语         | guj  | 是   |\n| 古希腊语           | gra  | 否   |\n| 古英语             | eno  | 否   |\n| 瓜拉尼语           | grn  | 否   |\n| 韩语               | kor  | 是   |\n| 荷兰语             | nl   | 是   |\n| 胡帕语             | hup  | 否   |\n| 哈卡钦语           | hak  | 否   |\n| 海地语             | ht   | 否   |\n| 豪萨语             | hau  | 否   |\n| 黑山语             | mot  | 否   |\n| 吉尔吉斯语          | kir  | 否   |\n| 加利西亚语          | glg  | 是   |\n| 加拿大法语          | frn  | 否   |\n| 加泰罗尼亚语        | cat  | 是   |\n| 捷克语             | cs   | 是   |\n| 卡拜尔语           | kab  | 是   |\n| 卡纳达语           | kan  | 是   |\n| 卡努里语           | kau  | 否   |\n| 卡舒比语           | kah  | 否   |\n| 康瓦尔语           | cor  | 否   |\n| 科萨语             | xho  | 是   |\n| 科西嘉语           | cos  | 否   |\n| 克里克语           | cre  | 否   |\n| 克里米亚鞑靼语      | cri  | 否   |\n| 克林贡语           | kli  | 否   |\n| 克罗地亚语         | hrv  | 是   |\n| 克丘亚语           | que  | 否   |\n| 克什米尔语         | kas  | 否   |\n| 孔卡尼语           | kok  | 否   |\n| 库尔德语           | kur  | 是   |\n| 拉丁语             | lat  | 是   |\n| 老挝语             | lao  | 否   |\n| 罗马尼亚语          | rom  | 是   |\n| 拉特加莱语          | lag  | 否   |\n| 拉脱维亚语          | lav  | 是   |\n| 林堡语             | lim  | 否   |\n| 林加拉语           | lin  | 否   |\n| 卢干达语           | lug  | 否   |\n| 卢森堡语           | ltz  | 否   |\n| 卢森尼亚语         | ruy  | 否   |\n| 卢旺达语           | kin  | 是   |\n| 立陶宛语           | lit  | 是   |\n| 罗曼什语           | roh  | 否   |\n| 罗姆语             | ro   | 否   |\n| 逻辑语             | loj  | 否   |\n| 马来语             | may  | 是   |\n| 缅甸语             | bur  | 是   |\n| 马拉地语           | mar  | 否   |\n| 马拉加斯语          | mg   | 是   |\n| 马拉雅拉姆语         | mal  | 是   |\n| 马其顿语            | mac  | 是   |\n| 马绍尔语            | mah  | 否   |\n| 迈蒂利语            | mai  | 是   |\n| 曼克斯语            | glv  | 否   |\n| 毛里求斯克里奥尔语    | mau  | 否   |\n| 毛利语              | mao  | 否   |\n| 孟加拉语            | ben  | 是   |\n| 马耳他语            | mlt  | 是   |\n| 苗语               | hmn  | 否   |\n| 挪威语              | nor  | 是   |\n| 那不勒斯语           | nea  | 否   |\n| 南恩德贝莱语         | nbl  | 否   |\n| 南非荷兰语           | afr  | 是   |\n| 南索托语             | sot  | 否   |\n| 尼泊尔语             | nep  | 是   |\n| 葡萄牙语             | pt   | 是   |\n| 旁遮普语             | pan  | 是   |\n| 帕皮阿门托语          | pap  | 否   |\n| 普什图语             | pus  | 否   |\n| 齐切瓦语             | nya  | 否   |\n| 契维语               | twi  | 否   |\n| 切罗基语             | chr  | 否   |\n| 日语                 | jp   | 是   |\n| 瑞典语               | swe  | 是   |\n| 萨丁尼亚语            | srd  | 否   |\n| 萨摩亚语              | sm   | 否   |\n| 塞尔维亚-克罗地亚语     | sec  | 否   |\n| 塞尔维亚语             | srp  | 是   |\n| 桑海语                | sol  | 否   |\n| 僧伽罗语              | sin  | 是   |\n| 世界语                | epo  | 是   |\n| 书面挪威语             | nob  | 是   |\n| 斯洛伐克语             | sk   | 是   |\n| 斯洛文尼亚语           | slo  | 是   |\n| 斯瓦希里语             | swa  | 是   |\n| 索马里语               | som  | 是   |\n| 塞尔维亚语（西里尔）     | src  | 否   |\n| 泰语                  | th   | 是   |\n| 土耳其语               | tr   | 是   |\n| 塔吉克语               | tgk  | 是   |\n| 泰米尔语               | tam  | 是   |\n| 他加禄语               | tgl  | 是   |\n| 提格利尼亚语            | tir  | 否   |\n| 泰卢固语               | tel  | 是   |\n| 突尼斯阿拉伯语          | tua  | 否   |\n| 土库曼语               | tuk  | 否   |\n| 乌克兰语               | ukr  | 是   |\n| 瓦隆语                 | wln  | 是   |\n| 威尔士语               | wel  | 是   |\n| 文达语                 | ven  | 否   |\n| 沃洛夫语               | wol  | 否   |\n| 乌尔都语               | urd  | 是   |\n| 西班牙语               | spa  | 是   |\n| 希伯来语               | heb  | 是   |\n| 希腊语                 | el   | 是   |\n| 匈牙利语               | hu   | 是   |\n| 西弗里斯语              | fry  | 是   |\n| 西里西亚语              | sil  | 否   |\n| 希利盖农语              | hil  | 否   |\n| 下索布语                | los  | 否   |\n| 夏威夷语                | haw  | 否   |\n| 新挪威语                | nno  | 是   |\n| 西非书面语              | nqo  | 否   |\n| 信德语                 | snd  | 否   |\n| 修纳语                 | sna  | 否   |\n| 宿务语                 | ceb  | 否   |\n| 叙利亚语               | syr  | 否   |\n| 巽他语                 | sun  | 否   |\n| 英语                   | en   | 是   |\n| 印地语                 | hi   | 是   |\n| 印尼语                 | id   | 是   |\n| 意大利语               | it   | 是   |\n| 越南语                 | vie  | 是   |\n| 意第绪语               | yid  | 否   |\n| 因特语                 | ina  | 否   |\n| 亚齐语                 | ach  | 否   |\n| 印古什语               | ing  | 否   |\n| 伊博语                 | ibo  | 否   |\n| 伊多语                 | ido  | 否   |\n| 约鲁巴语               | yor  | 否   |\n| 亚美尼亚语             | arm  | 是   |\n| 伊努克提图特语          | iku  | 否   |\n| 中文(简体)             | zh   | 是   |\n| 中文(繁体)             | cht  | 是   |\n| 中文(文言文)           | wyw  | 是   |\n| 中文(粤语)             | yue  | 是   |\n| 扎扎其语               | zaz  | 否   |\n| 中古法语               | frm  | 否   |\n| 祖鲁语                 | zul  | 否   |\n| 爪哇语                 | jav  | 否   |\n"
  },
  {
    "path": "docs/BasisModule/Components/tree_mind/README.md",
    "content": "# 树图 (TreeMind)\n\n## 简介\n树图（TreeMind）提供智能思维导图制作工具和丰富的模板，支持脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴、时间线等多种专业格式。\n\n### 功能介绍   \n树图（TreeMind）是一款智能思维导图制作工具，它提供了一个用户友好的平台来创建和编辑各种类型的图表。该工具支持多种专业格式，包括脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴和时间线等，满足不同用户在不同场景下的需求。\n\n### 特色优势\nTreeMind提供丰富的模板，支持多种图表格式，用户可以根据个人需求自由编辑和调整图表。\n\n### 应用场景  \n年度总结：用户可以利用TreeMind生成年度总结的思维导图，整理和回顾一年的工作成果和经验教训。\n项目管理：在项目管理中，TreeMind可以用来规划项目流程、组织架构和时间线，确保项目按计划进行。\n教育和学习：教师和学生可以使用TreeMind来创建课程大纲、学习笔记和复习资料，提高学习效率。\n商业策划：商业人士可以利用TreeMind来制定商业策略、市场分析和竞争对手分析等。\n会议记录：在会议中，TreeMind可以作为记录工具，帮助整理会议要点和行动计划。\n\n## 基本用法\n\n下面是文生图的代码示例: \n\n```python\nimport os\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\ntreemind = appbuilder.TreeMind()\nquery = \"生成一份年度总结的思维导图\"\nmsg = appbuilder.Message(query)\nout = treemind.run(msg)\nprint(out.content)\n\n>>>\n{'result': '思维导图已经为您生成好了，您可以点击'img_link'对应的链接查看，如果您觉得这个思维导图还不够完美，或者您的想法需要更自由地表达，点击'edit_link'对应的链接，对思维导图变形、变色、变内容、甚至可以添加新的元素,    \n'img_link': 'https://static.shutu.cn/shutu/static/open6e/2024/05/24/dbd67eddec13f3a6a75857b9c6e06d85.jpeg',    \n'edit_link': 'https://gapi.shutu.cn/ai/edit-mind-url?works_guid=open5ab4af46187ff7c138fcd95de09efe92_bdappbuilder'}\n```\n\n生成的思维导图:<br/>![图片url](https://bj.bcebos.com/appbuilder-sdk-components/TreeMind-年终总结思维导图.jpeg)\n\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | obj:`Message`  | 是    | 输入的消息，用于生成思维导图，这是一个必需的参数 | Message(content={\"query\": \"生成一张年终总结的思维导图\"}) |\n\n### 响应参数\n\n| 参数名称        |参数类型 | 描述   | 示例值 |\n|-------------|--------|------|------|\n| resp | obj:`Message` | 组件返回结果 | Message(name=msg, content={'result': '生成的思维导图：xxx。思维导图已经为您生成好了，如果您觉得这个思维导图还不够完美，或者您的想法需要更自由地表达，点击编辑按钮，对思维导图变形、变色、变内容、甚至可以添加新的元素，您可以通过这个链接编辑：xxx。', 'img_link': 'xxx', 'edit_link': 'xxx'}, mtype=dict)  |"
  },
  {
    "path": "docs/BasisModule/Components/tts/README.md",
    "content": "# 短文本在线合成（TTS）\n\n## 简介\n短文本在线合成组件（TTS）提供高度拟人、流畅自然的语音合成服务，将文本朗读出来，基础音库性价比更高，精品音库听感更逼真。\n\n### 功能介绍\n提供高度拟人、流畅自然的语音合成服务。\n\n### 特色优势\n将文本朗读出来，基础音库性价比更高，精品音库听感更逼真。可实时生成语音输出，几乎没有延迟，更加自然流畅。\n\n### 应用场景\n文本朗读\n\n\n## 基本用法\n\n下面是语音合成的代码示例：\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\ntts = appbuilder.TTS()\ncwd = os.getcwd()\n\n# 使用baidu-tts模型, 默认返回MP3格式\ninp = appbuilder.Message(content={\"text\": \"欢迎使用语音合成\"})\nout = tts.run(inp)\nmp3_sample_path = os.path.join(cwd,\"sample.mp3\")\nwith open(mp3_sample_path, \"wb\") as f:\n    f.write(out.content[\"audio_binary\"])\nprint(\"成功将文本转语音，mp3格式文件已写入：{}\".format(mp3_sample_path))\n\n# 使用paddlespeech-tts模型，目前只支持返回WAV格式\nwav_sample_path = os.path.join(cwd,\"sample.wav\")\ninp = appbuilder.Message(content={\"text\": \"欢迎使用语音合成\"})\nout = tts.run(inp, model=\"paddlespeech-tts\", audio_type=\"wav\")\nwith open(wav_sample_path, \"wb\") as f:\n    f.write(out.content[\"audio_binary\"])\nprint(\"成功将文本转语音，wav格式文件已写入：{}\".format(wav_sample_path))\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n| 参数名称       | 参数类型    | 是否必须 | 描述                                                                                                                                                                                             | 示例值                                 |\n|------------|---------|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|\n| message    | String  | 是    | 待转成语音的文本                                                                                                                                                                                       | Message(content={\"text\": \"需合成的文本\"}) |\n| model      | String  | 否    | 默认是`baidu-tts`模型，可选值：`paddlespeech-tts`、`baidu-tts`                                                                                                                                            | paddlespeech-tts                    |\n| speed      | Integer | 否    | 语音语速，默认是5中等语速，取值范围在0~15之间，仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                  | 5                                   |\n| pitch      | Integer | 否    | 语音音调，默认是5中等音调，取值范围在0~15之间，仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                  | 5                                   |\n| volume     | Integer | 否    | 语音音量，默认是5中等音量，取值范围在0~15之间，,仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                 | 5                                   |\n| person     | Integer | 否    | 语音人物特征，默认是0(度小美),普通音库可选值包括: 0(度小美)、1(度小宇)、3(度逍遥-基础)、4(度丫丫)；精品音库包括：5003(度逍遥-精品)、5118(度小鹿)、106(度博文)、110(度小童)、111(度小萌)、103(度米朵)、5(度小娇)；臻品音库包括：4003(度逍遥-情感男声)、4106(度博文-专业男主播)、4115(度小贤-电台男主播)、4119(度小鹿-甜美女声)、4105(度灵儿-清激女声)、4117(度小乔-活泼女声)、4100(度小雯-活力女主播)、4103(度米朵-可爱女声)、4144(度姗姗-娱乐女声)、4278(度小贝-知识女主播)、4143(度清风-配音男声)、4140(度小新-专业女主播)、4129(度小彦-知识男主播)、4149(度星河-广告男声)、4254(度小清-广告女声)、4206(度博文-综艺男声)、4226(南方-电台女主播)。仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效 | 0                                   |\n| audio_type | String  | 否    | 音频文件格式，如果使用`baidu-tts`模型可选`mp3`, `wav`; 如果使用`paddlespeech-tts`模型非流式返回，参数只能设为`wav`;如果使用`paddlespeech-tts`模型流式返回，参数只能设为`pcm`                                                                     | wav                                 |\n| stream     | Bool    | 否    | 默认是False, 目前`paddlespeech-tts`模型支持流式返回，`baidu-tts`模型不支持流式返回                                                                                                                                    | False                               |\n| retry      | Integer | 否    | HTTP重试次数                                                                                                                                                                                       | 3                                   |\n| timeout    | Integer | 否    | HTTP超时时间                                                                                                                                                                                       | 5                                   |\n\n### 非流式语音响应参数\n| 参数名称          | 参数类型   | 描述     | 示例值     |\n|---------------|--------|--------|---------|\n| content       | Dict   | 消息内容   | 无       |\n| +audio_binary | Bytes  | 音频二进制流 | b'语音流'  |\n| +audio_type   | String | 音频类型   | wav/mp3 |\n\n\n### 流式语音响应参数\n| 参数名称    | 参数类型             | 描述       | 示例值 |\n|---------|------------------|----------|-----|\n| content | Python Generator | 可迭代的二进制流 | 无   |\n\n\n### 响应示例\n```json\n{\n\"content\": {\n             \"audio_binary\": \"\",\n              \"audio_type\": \"mp3\"\n           }\n}\n```\n\n\n### 错误码\n| 错误码 | 描述 |\n|-----|----|\n\n## 高级用法\n\n### TTS实时播放语音流\n```python\nimport os\nimport appbuilder\nimport pyaudio\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\ntts = appbuilder.TTS()\n# 使用paddlespeech-tts模型，目前只支持返回WAV格式\ninp = appbuilder.Message(content={\"text\": \"\"\"随着科技的迅速发展，教育领域也经历了巨大的变革。科技不仅改变了教学和学习的方式，还扩展了教育的可能性和边界。\n        从在线课程到交互式学习工具，科技为学生和教师提供了前所未有的资源和机遇。科技使得个性化学习成为可能。通过智能学习系统和适应性学习技术，\n        教育内容可以根据学生的学习速度和能力进行定制。\"\"\"})\n# 仅支持model为paddlespeech-tts，audio_type为pcm, stream为True\nout = tts.run(inp, model=\"paddlespeech-tts\", audio_type=\"pcm\", stream=True)\nplay = pyaudio.PyAudio()\nstream = play.open(format=play.get_format_from_width(2),\n                    channels=1,\n                    rate=24000,\n                    output=True,\n                    frames_per_buffer=2048)\n# 实时播放语音流\nfor pcm in out.content:\n    stream.write(pcm)\nstream.stop_stream()\nstream.close()\n```\n### pcm文件转wav\n\n```python\nimport os\nimport appbuilder\nimport wave\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\ntts = appbuilder.TTS()\ninp = appbuilder.Message(content={\"text\": \"\"\"随着科技的迅速发展，教育领域也经历了巨大的变革。科技不仅改变了教学和学习的方式，还扩展了教育的可能性和边界。\n        从在线课程到交互式学习工具，科技为学生和教师提供了前所未有的资源和机遇。科技使得个性化学习成为可能。通过智能学习系统和适应性学习技术，\n        教育内容可以根据学生的学习速度和能力进行定制。\"\"\"})\n# 仅支持model为paddlespeech-tts，audio_type为pcm, stream为True\nout = tts.run(inp, model=\"paddlespeech-tts\", audio_type=\"pcm\", stream=True)\ncount = 1\ncwd = os.getcwd()\nfor pcm in out.content:\n    wave_sample_path = os.path.join(cwd, \"{}.wav\".format(count))\n    wavfile = wave.open(wave_sample_path, 'wb')\n    wavfile.setnchannels(1)\n    wavfile.setsampwidth(2)\n    wavfile.setframerate(24000)\n    wavfile.writeframes(pcm)\n    wavfile.close()\n    print(\"成功将第{}个pcm语音块转换成wav格式，并将对应文件写入：{}\".format(count, wave_sample_path))\n    count += 1\n```\n\n\n## 更新记录和贡献\n* 短文本在线合成 (2024-01)\n* 增加流式能力 (2024-02)\n\n"
  },
  {
    "path": "docs/BasisModule/Deployment/AgentChainlit.md",
    "content": "# 交互式前端部署\n\n## 基础组件基于Chainlit提供交互式前端页面\n\n请参考 [组件服务化部署](https://github.com/baidubce/app-builder/blob/master/cookbooks/components/agent_runtime.ipynb)"
  },
  {
    "path": "docs/BasisModule/Deployment/agentruntime.md",
    "content": "# `AgentRuntime`类\n\n## 简介\n\nAgentRuntime 是对组件调用的服务化封装，开发者不是必须要用 AgentRuntime 才能运行自己的组件服务。但 AgentRuntime 可以快速帮助开发者服务化组件服务，并且提供API、对话框等部署方式。此外，结合 Component 和 Message 自带的运行和调试接口，可以方便开发者快速获得一个调试 Agent 的服务。\n\n\n## Python基本用法\n\n### 1、实例化`AgentRuntime() -> AgentRuntime`\n\n#### 方法参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| component | Component | 可运行的 Component,需要实现 run(message, stream, **args) 方法  | \"正确的component组件或client\" |\n| user_session_config | sqlalchemy.engine.URL、str、None | Session 输出存储配置字符串。默认使用 sqlite:///user_session.db | \"正确的存储配置字符串\" |\n\n#### 方法功能\n\n返回一个调试 Agent 的服务\n\n#### 示例代码\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\ncomponent = appbuilder.Playground(\n    prompt_template=\"{query}\",\n    model=\"eb-4\"\n)\nagent = appbuilder.AgentRuntime(component=component)\n```\n\n### 2、运行Agent服务`AgentRuntime.chat(message: Message, stream: bool = False, **args) -> Message`\n\n#### 方法参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| message | Message | 该次对话用户输入的 Message | \"正确的Message\" |\n| stream | bool | 是否使用流式请求。默认为 False | False |\n\n#### 方法功能\n\n运行一个 Agent 服务，执行一次对话\n\n#### 示例代码\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\ncomponent = appbuilder.Playground(\n    prompt_template=\"{query}\",\n    model=\"eb-4\"\n)\nagent = appbuilder.AgentRuntime(component=component)\nmessage = appbuilder.Message({\"query\": \"你好\"})\nprint(agent.chat(message, stream=False))\n```\n\n### 3、提供 Flask http API 接口`AgentRuntime.serve(self, host='0.0.0.0', debug=True, port=8092, url_rule=\"/chat\"`\n\n#### 方法参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| host | String | 服务主机地址，默认为 '0.0.0.0' | '0.0.0.0' |\n| debug | bool | 是否是调试模式，默认为 True | False |\n| port | int | 服务端口号，默认为 8092 | 8092 |\n| url_rule | String | Flask 路由规则，默认为 '/chat' | '/chat' |\n\n#### 方法功能\n\n将 component 服务化，提供 Flask http API 接口\n\n#### 示例代码\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\ncomponent = appbuilder.Playground(\n    prompt_template=\"{query}\",\n    model=\"eb-4\"\n)\nuser_session_config = \"sqlite:///foo.db\"\nagent = appbuilder.AgentRuntime(\n    component=component, user_session_config=user_session_config)\nagent.serve(debug=False, port=8091)\n```\n\n\n### 4、提供 chainlit demo 页面`AgentRuntime.chainlit_demo(host='0.0.0.0', port=8091)`\n\n\n#### 方法参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| host | string | 服务主机地址，默认为 '0.0.0.0' | \"0.0.0.0\" |\n| port | int | 服务端口号，默认为 8092 | 8091 |\n\n#### 方法功能\n\n将 component 服务化，提供 chainlit demo 页面\n\n#### 示例代码\n\n```python\nimport os\nimport logging\nfrom appbuilder.core.component import Component\nfrom appbuilder import (\n    AgentRuntime, UserSession, Message, QueryRewrite, Playground,\n)\nos.environ[\"APPBUILDER_TOKEN\"] = 'YOUR_APPBUILDER_TOKEN'\nclass PlaygroundWithHistory(Component):\n    def __init__(self):\n        super().__init__()\n        self.query_rewrite = QueryRewrite(model=\"DeepSeek-V3.1\")\n        self.play = Playground(\n            prompt_template=\"{query}\",\n            model=\"eb-4\"\n        )\n    def run(self, message: Message, stream: bool=False):\n        user_session = UserSession()\n        # 获取 Session 历史数据\n        history_queries = user_session.get_history(\"query\", limit=1)\n        history_answers = user_session.get_history(\"answer\", limit=1)\n        if history_queries and history_answers:\n            history = []\n            for query, answer in zip(history_queries, history_answers):\n                history.extend([query.content, answer.content])\n            logging.info(f\"history: {history}\")\n            message = self.query_rewrite(\n                Message(history + [message.content]), rewrite_type=\"带机器人回复\")\n        logging.info(f\"message: {message}\") \n        answer = self.play.run(message, stream)\n        # 保存本轮数据\n        user_session.append({\n            \"query\": message,\n            \"answer\": answer,\n        }) \n        return answer\n\nagent = AgentRuntime(component=PlaygroundWithHistory())\nagent.chainlit_demo(port=8091)\n```\n\n### 5、将 appbuilder client 服务化，提供 chainlit demo 页面`AgentRuntime.chainlit_agent(host='0.0.0.0', port=8091)`\n目前支持工作流Agent、自主规划Agent应用。\n\n#### 方法参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| host | string | 服务主机地址，默认为 '0.0.0.0' | \"0.0.0.0\" |\n| port | int | 服务端口号，默认为 8092 | 8091 |\n\n#### 方法返回值\n\n将 appbuilder client 服务化，提供 chainlit demo 页面\n\n#### 示例代码\n\n```python\nimport appbuilder\nimport os\n\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\napp_id = '...'  # 已发布AppBuilder应用ID，可在console端查看\nclient = appbuilder.AppBuilderClient(app_id)\nagent = appbuilder.AgentRuntime(component=client)\nagent.chainlit_agent(port=8091)\n```"
  },
  {
    "path": "docs/BasisModule/Deployment/cloud.md",
    "content": "# 公有云部署\n**注意⚠️：部署上云功能目前处于内测阶段，使用过程中有任何问题，欢迎提issue或微信群反馈～**\n支持一键将自己的服务部署到公有云上，目前支持百度智能云。部署后可以自动生成公网ip，无需额外配置。可以用来解决以下问题：\n* 在百度云部署的WebService，可以引入到AppBuilder工作流中的API节点，形成应用中嵌套应用，构建能够解决复杂业务问题的工作流。\n* 可将自己本地复杂的服务、组件、模型等，方便快捷地上云，并与AppBuilder形成联动。\n* etc.\n\n\n### 前置操作:\n* 在百度智能云完成实名认证，并开通bos服务：\n  * https://cloud.baidu.com/doc/BOS/s/Jk4xttg03#%E5%BC%80%E9%80%9Abos%E6%9C%8D%E5%8A%A1\n* 您需要在钱包中至少充值100元，用于bcc服务、bos服务费用\n  * 云服务费用标准：https://cloud.baidu.com/product-price/bcc.html\n  * 默认配置使用最便宜的bcc.e1.c2m2，并且使用按量付费\n  * bos存储服务费用标准：https://cloud.baidu.com/product-price/bos.html\n* 通过如下步骤获得您的AK/SK信息：\n  * https://cloud.baidu.com/doc/Reference/s/9jwvz2egb\n\n### 部署流程：\n* 以下面的yaml文件为模板创建config.yaml，完善配置文件\n  * 最小修改范围：ak、sk、admin_pass、run_cmd、local_dir、APPBUILDER_TOKEN\n```yaml\nbce_config:\n    host: \"http://bcc.bj.baidubce.com\"\n    bos_host: \"bj.bcebos.com\"\n    # 前置操作获取的ak、sk\n    ak: \"\"\n    sk: \"\"\n    spec: \"bcc.e1.c2m2\"\n    root_disk_size_in_gb: 20\n    # 服务器密码，根据实际使用设置\n    admin_pass: \"\"\n    security_group_id: \"\"\n    zone_name: cn-bj-d\n\nappbuilder_config:\n    # 本地用来打包的代码路径，根据实际使用修改\n    local_dir: \"./sample\"\n    workspace: \"/home/work/appbuilder\"\n\n    # 服务的运行命令，根据实际使用修改\n    run_cmd: \"python3 component_sample.py\"\n\nenv:\n    APPBUILDER_LOGLEVEL: debug\n    APPBUILDER_TOKEN: \"\"\n```\n\n* 编写自己的服务运行代码（以组件服务为例）\n```bash\nmkdir sample\ntouch sample/component_sample.py\n# 编辑sample/component_sample.py，写入下面的python代码\n```\n```python\n# ./smaple目录下component_sample.py\nimport appbuilder\n\ncomponent = appbuilder.Playground(prompt_template=\"{query}\", model=\"ERNIE-Bot\")\nagent = appbuilder.AgentRuntime(component=component)\nagent.serve(port=8091)\n```\n\n* 执行部署\n```bash\n# config.yaml为上面创建的配置文件\nappbuilder_bce_deploy --conf ./config.yaml\n```\n\n### 请求示例：\n* 取日志 “deployment finished! public ip:”后的ip\n* 稍等两到三分钟，服务启动后即可访问\n``` bash\n# public_ip为上一步取到的ip\ncurl --location 'http://{public_ip}:8091/chat' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"message\": \"海淀区的面积是多少\",\n    \"stream\": false\n}'\n```\n* 返回结果\n```json\n{\n  \"code\": 0,\n  \"message\": \"\",\n  \"result\": {\n    \"answer_message\": {\n      \"content\": \"海淀区位于北京市的西部和西北部，其面积的具体数据在不同来源中略有差异。根据参考文章，可以归纳出以下信息：\\n\\n* 海淀区的面积约为**431平方千米**（来源于参考文章1）。\\n* 另一数据为**430.8平方公里**（来源于参考文章2）。\\n* 首都之窗_北京市人民政府门户网站的数据为**430.77平方公里**（来源于参考文章3）。\\n* 海淀区台办的数据也提到其面积为**430.8平方公里**（来源于参考文章4）。\\n\\n综上所述，海淀区的面积大致在**430.77至431平方千米**之间。这些细微的差异可能是由于测量方法和时间的不同导致的。在大多数情况下，可以认为海淀区的面积是约431平方千米。\",\n      \"extra\": {},\n      ...\n    },\n    \"session_id\": \"xxx\"\n  }\n}\n```\n  * 若返回结果不符合预期，使用自己的\"admin_pass\"登陆服务器进行调试，具体参考文档：https://cloud.baidu.com/doc/BCC/s/Hkbblll70\n\n### 接入AppBuilder工作流示例：\n* 进入AppBuilder官网，先后点击“个人空间”、“组件”、“创建组件”、“API接入”\n\n<img src='https://bj.bcebos.com/v1/appbuilder-sdk-components/component_create.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-10-30T09%3A13%3A56Z%2F-1%2Fhost%2Fbc6e4e889bd3c4471c5e9449f1aaadb15c057e363a2b7d47e2007ef4e6e69fb3' alt='wechat' width='800' >\n\n* 点击“编辑API”、“导入cURL”，粘贴上面的curl命令，解析并导入\n\n<img src='https://bj.bcebos.com/v1/appbuilder-sdk-components/component_api_import.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-10-30T09%3A13%3A25Z%2F-1%2Fhost%2F8b4b87ebdec0884977e1e44fcba892f2001350552ab5f87fd4a5f38e08c53f58' alt='wechat' width='800' >\n\n* 调试通过\n\n<img src='https://bj.bcebos.com/v1/appbuilder-sdk-components/component_api_debug.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-10-30T09%3A11%3A57Z%2F-1%2Fhost%2F9b7f412e78ac9c98354c9dd28493b1e1fdd781f5473decc723eb73f504b28eea' alt='wechat' width='800' >"
  },
  {
    "path": "docs/BasisModule/Deployment/flask.md",
    "content": "# API 访问\n\n## 基础组件基于Flask提供 API访问服务\n\n请参考 [组件服务化部署](https://github.com/baidubce/app-builder/blob/master/cookbooks/components/agent_runtime.ipynb)"
  },
  {
    "path": "docs/BasisModule/Deployment/usersession.md",
    "content": "# `UserSession`类\n\n## 简介\n\n会话数据管理工具，实例化后将是一个全局变量。提供保存对话数据与获取历史数据的方法。\n\n## 应用场景\n\n**必须**在 AgentRuntime 启动的服务中使用。\n\n## Python基本用法\n\n### 1、实例化`UserSession().__init__ -> UserSession`\n\n#### 方法参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| user_session_config | sqlalchemy.engine.URL、str、None | Session 输出存储配置字符串。默认使用 sqlite:///user_session.db | \"正确的存储配置字符串\" |\n\n#### 方法功能\n\n初始化 UserSession\n\n#### 示例代码\n\n```python\nuser_session = UserSession()\n```\n\n### 2、获取同个 session 中名为 key 的历史变量`UserSession().get_history(self, key: str, limit: int=10) -> List[Message]:`\n\n#### 方法参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| key | String | 历史变量 | \"answer\" |\n| limit | int | 最近 limit 条 Message 数据 | 10 |\n\n#### 方法功能\n\n获取同个 session 中名为 key 的历史变量。在非服务化版本中从内存获取。在服务化版本中，将从数据库获取。\n\n#### 方法返回值\n\n`List[Message]` \n\n衍生类`Message`定义如下:\n\n```python\nclass Message(BaseModel, Generic[_T], extra=Extra.allow):\n    content: Optional[_T] = {}\n    name: Optional[str] = \"msg\"\n    mtype: Optional[str] = \"dict\"\n    id: Optional[str] = str(uuid.uuid4())\n```\n\n#### 示例代码\n\n```python\nhistory_queries = user_session.get_history(\"query\", limit=1)\n```\n\n### 3、将 message_dict 中的变量保存到 session 中`UserSession().append(self, message_dict: Dict[str, Message]) -> None`\n\n#### 方法参数\n\n| 参数名称   | 参数类型   | 描述         | 示例值       |\n|--------|--------|------------|-----------|\n| message_dict | Dict | 包含 Message 的字典，其中键为字符串类型，值为 Message 类型 | {\"query\": message} |\n\n#### 方法功能\n\n将 message_dict 中的变量保存到 session 中。在非服务化版本中使用内存存储。在服务化版本中，将使用数据库进行存储。\n\n#### 示例代码\n\n```python\nuser_session.append({\n            \"query\": message,\n            \"answer\": answer,\n        }) \n```\n\n### 4、UserSession结合AgentRuntime使用以及user_session.db文件读取\n\n- [UserSession结合AgentRuntime使用以及user_session.db文件读取](https://github.com/baidubce/app-builder/blob/master/cookbooks/components/agent_runtime.ipynb)\n\n\n\n\n"
  },
  {
    "path": "docs/BasisModule/Model/get_model_list.md",
    "content": "# 千帆模型列表获取能力\n\n## 简介\n该能力可以通过参数控制获取用户可用的不同类型的千帆大模型名称，从而进行大模型组件的调用，该能力获取的模型名称可以直接传参到大模型组件的model字段。\n\n## 基本用法\n\n下面是模型列表获取功能的代码示例：\n\n```python\nimport os\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\nmodels = appbuilder.get_model_list(\n    secret_key=os.environ[\"APPBUILDER_TOKEN\"],\n    api_type_filter=[\"chat\"], \n    is_available=True,\n    refresh_type=\"tolerant\",\n    force_refresh=True\n)\nprint(models)\n```\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n|参数名称 | 参数类型         | 是否必须 |描述 | 示例值  |\n|--------|--------------|------|----|------|\n|secret_key | String       | 是    |用户鉴权token, 默认从环境变量中获取| bce-YOURTOKEN |\n|api_type_filter| List[String] | 否    |根据apiType过滤，[\"chat\", \"completions\", \"embeddings\", \"text2image\"]，不填包括所有的。| chat |\n|is_available| Boolean      | 否    |是否返回可用模型列表, 默认返回所有模型。| True |\n|refresh_type | String | 否 ｜ 获取模型列表的方式，默认在出错时使用兜底策略。[\"tolerant\", \"original\"] | \"tolerant\" |\n|force_refersh | Boolean | 否 | 是否强制刷新缓存，默认不强制刷新。| False |\n\n\n### 返回示例\n['ERNIE-Bot 4.0', 'ERNIE-Bot', 'ERNIE-Bot-turbo']\n\n\n## 高级用法\n\n目前该模块仅提供获取千帆模型列表功能。\n\n\n## 更新记录和贡献\n* 切换模型获取列表接口为v2 (2025-06)\n* 千帆模型列表获取能力 (2024-1)"
  },
  {
    "path": "docs/BasisModule/Platform/Application/appbuilder_client.md",
    "content": "# AppBuilderClient组件\n\n## 简介\n\nAppBuilderClient组件支持调用在[百度智能云千帆AppBuilder](https://cloud.baidu.com/product/AppBuilder)\n平台上通过AppBuilderClient构建并发布的智能体应用。\n\n### 功能介绍\n\n具体包括创建会话、上传文档、运行对话等\n\n### 特色优势\n\n与云端Console 应用能力打通，实现低代码会话\n\n### 应用场景\n\n快速、高效集成云端已发布智能体应用能力\n\n## Python基本用法\n\n\n### `AppBuilderClient().__init__()`\n\n\n#### 方法参数\n\n| 参数名称 | 参数类型 | 描述              | 示例值         |\n| -------- | -------- | ----------------- | -------------- |\n| app_id   | string   | 线上Agent应用的ID | \"正确的应用ID\" |\n\n#### 方法返回值\n\n```AppBuilderClient```实例化对象\n\n\n### `AppBuilderClient().create_conversation()-> str`\n#### 方法参数\n无\n\n#### 方法返回值\n\n | 参数名称        | 参数类型 | 描述     | 示例值                                 |\n | --------------- | -------- | -------- | -------------------------------------- |\n | conversation_id | string   | 会话的ID | \"80c5bbee-931d-4ed9-a4ff-63e1971bd071\" |\n\n\n### `AppBuilderClient().upload_local_file(conversation_id, local_file_path: str)-> str`\n#### 方法参数\n| 参数名称        | 参数类型 | 描述     | 示例值           |\n| --------------- | -------- | -------- | ---------------- |\n| conversation_Id | string   | 会话ID   |                  |\n| file_path       | string   | 文件路径 | \"正确的文件路径\" |\n#### 方法返回值\n| 参数名称 | 参数类型 | 描述   | 示例值                             |\n| -------- | -------- | ------ | ---------------------------------- |\n| file_id  | string   | 文件ID | \"80c5bbee-931d-4ed9-a4ff-63e1971bd |\n\n### `AppBuilderClient().upload_file(conversation_id, local_file_path: str=None, file_url: str=None)-> str`\n\n#### 方法参数\n\n| 参数名称        | 参数类型 | 描述     | 示例值           |\n| --------------- | -------- | -------- | ---------------- |\n| conversation_Id | string   | 会话ID   |                  |\n| file_path       | string   | 文件路径 | \"正确的文件路径\" |\n| file_url        | string   | 文件url  |                  |\n\n#### 方法返回值\n\n| 参数名称 | 参数类型 | 描述   | 示例值                             |\n| -------- | -------- | ------ | ---------------------------------- |\n| file_id  | string   | 文件ID | \"80c5bbee-931d-4ed9-a4ff-63e1971bd |\n\n### `AppBuilderClient().run() -> Message`\n\n#### 方法参数\n\n| 参数名称        | 参数类型           | 是否必须 | 描述                                                         | 示例值            |\n| --------------- | ------------------ | -------- | ------------------------------------------------------------ | ----------------- |\n| conversation_id | String             | 是       | 会话ID                                                       |                   |\n| query           | String             | 否       | query问题内容                                                | \"今天天气怎么样?\" |\n| file_ids        | list[String]       | 否       | 对话可引用的文档ID                                           |                   |\n| stream          | Bool               | 否       | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 | False             |\n| end_user_id     | String             | 否       | 终端用户ID，限制6 - 64字符                                   |                   |\n| tools           | List[Tool]         | 否       | 一个列表，其中每个字典对应一个工具的配置                     |                   |\n| tools[0]        | Tool               | 否       | 工具配置                                                     |                   |\n| +type           | String             | 否       | 枚举：<br/>**file_retrieval**: 知识库检索工具能够理解文档内容，支持用户针对文档内容的问答。<br/>**code_interpreter**: 代码解释器, 代码解释器能够生成并执行代码，从而协助用户解决复杂问题，涵盖科学计算（包括普通数学计算题）、数据可视化、文件编辑处理（图片、PDF文档、视频、音频等）、文件格式转换（如WAV、MP3、text、SRT、PNG、jpg、MP4、GIF、MP3等）、数据分析&清洗&处理（文件以excel、csv格式为主）、机器学习&深度学习建模&自然语言处理等多个领域。<br/>**function**: 支持fucntion call模式调用工具 |                   |\n| +function       | Function           | 否       | Function工具描述<br/>仅当**type为**`**function**` 时需要且必须填写 |                   |\n| ++name          | String             | 否       | 函数名<br/>只允许数字、大小写字母和中划线和下划线，最大长度为64个字符。一次运行中唯一。 |                   |\n| ++description   | String             | 否       | 工具描述                                                     |                   |\n| ++parameters    | Dict               | 否       | 工具参数, json_schema格式                                    |                   |\n| tool_outputs    | List[ToolOutput]   | 否       | 内容为本地的工具执行结果，以自然语言/json dump str描述       |                   |\n| tool_outputs[0] | ToolOutput         | 否       | 工具执行结果                                                 |                   |\n| +tool_call_id   | String             | 否       | 工具调用ID                                                   |                   |\n| +output         | String             | 否       | 工具输出                                                     |                   |\n| tool_choice     | ToolChoice         | 否       | 控制大模型使用组件的方式，仅对自主规划Agent生效。            |                   |\n| +type           | String             | 否       | auto/function，auto表示由LLM自动判断调什么组件；function表示由用户指定调用哪个组件。 |                   |\n| +function       | ToolChoiceFunction | 否       | 组件对象，包括组件的英文名称和入参                           |                   |\n| ++name          | String             | 否       | 组件的英文名称（唯一标识）                                   |                   |\n| ++input         | String             | 否       | 组件入参，当组件没有入参时填入空对象{}                       |                   |\n| action          | Action             | 否       | 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息 |                   |\n| +action_type    | String             | 是       | 要执行的操作。<br/>可选值为：<br/>resume：回复“信息收集节点” 的消息 |                   |\n| +parameters     | Object             | 是       | 执行操作时所需的参数                                         |                   |\n\n#### Run方法非流式返回值\n\nRun非流式方法返回一个`Message`对象，该对象包含以下属性：\n\n| 参数名称       | 参数类型               | 描述                 | 示例值                                                                                  |\n| -------------- | ---------------------- | -------------------- | --------------------------------------------------------------------------------------- |\n| content        | AppBuilderClientAnswer | 对话返回结果         |                                                                                         |\n| +answer        | String                 | 智能体应用返回的回答 |                                                                                         |\n| +events        | List[Event]            | 事件列表             |                                                                                         |\n| +events[0]     | Event                  | 具体事件内容         |                                                                                         |\n| ++code         | String                 | 错误码               |                                                                                         |\n| ++message      | String                 | 错误具体消息         |                                                                                         |\n| ++status       | String                 | 事件状态             | 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）      |\n| ++event_type   | String                 | 事件类型             |                                                                                         |\n| ++content_type | String                 | 内容类型             | 可选值包括：code text, image, status,image, function_call, rag, audio、video等          |\n| ++detail       | Dict                   | 事件输出详情         | 代码解释器、文生图、工具组件、RAG等的详细输出内容                                       |\n| ++usage        | Usage                  | 模型调用的token用量  | Usage(prompt_tokens=1322, completion_tokens=80, total_tokens=1402, name='DeepSeek-V3.1') |\n\n`AppBuilderClientAnswer`类型定义如下：\n```python\nclass AppBuilderClientAnswer(BaseModel):\n    \"\"\"执行步骤的具体内容\n        属性:\n            answer(str): query回答内容\n            events( list[Event]): 事件列表\n       \"\"\"\n    answer: str = \"\"\n    events: list[Event] = []\n```\n\n`Event`类型定义如下：\n```python\nclass Event(BaseModel):\n    \"\"\"执行步骤的具体内容\n        属性:\n            code (int): 响应code码\n            message (str): 错误详情\n            status (str): 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）\n            event_type（str）: 事件类型\n            content_type（str）: 内容类型\n            detail(dict): 事件详情\n            usage(Usage): 大模型调用的token用量\n    \"\"\"\n    code: int = 0\n    message: str = \"\"\n    status: str = \"\"\n    event_type: str = \"\"\n    content_type: str = \"\"\n    detail: dict = {}\n    usage: Optional[Usage] = None\n```\n\n\n#### Run方法流式返回值\n\n| 参数名称 | 参数类型         | 描述                                           | 示例值 |\n| -------- | ---------------- | ---------------------------------------------- | ------ |\n| content  | Python Generator | 可迭代，每次迭代返回AppBuilderClientAnswer类型 | 无     |\n\n#### 非流式调用示例\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\napp_id = '...'  # 已发布AppBuilder应用ID，可在console端查看\n# 初始化智能体\nbuilder = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = builder.create_conversation()\n# 运行对话\nout = builder.run(conversation_id, \"北京今天天气怎么样\")\n# 打印会话结果 \nprint(out.content.answer)\n```\n\n#### 流式调用示例\n\n```python\n\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client import data_class\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\napp_id = '...'  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\n\n# 上传一个介绍某汽车产品的说明文档\nfile_id = client.upload_local_file(conversation_id, \"/path/to/pdf/file\")\n# 引用上传的文档，开始对话\n# 注意file_ids不是必填项，如果不需要引用特定文档，file_ids留空即可\nmessage = client.run(conversation_id, \"汽车性能参数怎么样\", file_ids=[file_id, ], stream=True)\n\nanswer = \"\"\n\n# 每次迭代返回AppBuilderClientAnswer结构，内可能包括多个事件内容\nfor content in message.content:\n    # stream=True时，将answer拼接起来才是完整的的对话结果\n    answer += content.answer\n    for event in content.events:\n        content_type = event.content_type\n        detail = event.detail\n        # 根据content类型对事件详情进行解析\n        if content_type == \"code\":\n            code_detail = data_class.CodeDetail(**detail)\n            print(code_detail.code)\n        elif content_type == \"text\":\n            text_detail = data_class.TextDetail(**detail)\n            print(text_detail.text)\n        elif content_type == \"image\":\n            image_detail = data_class.ImageDetail(**detail)\n            print(image_detail.url)\n        elif content_type == \"rag\":\n            rag_detail = data_class.RAGDetail(**detail)\n            if len(rag_detail.references) > 0:\n                print(rag_detail.references)\n        elif content_type == \"function_call\":\n            function_call_detail = data_class.FunctionCallDetail(**detail)\n            print(function_call_detail.video)\n        elif content_type == \"audio\":\n            audio_detail = data_class.AudioDetail(**detail)\n            print(audio_detail)\n        elif content_type == \"video\":\n            video_detail = data_class.VideoDetail(**detail)\n            print(video_detail)\n        elif content_type == \"status\":\n            status_detail = data_class.StatusDetail(**detail)\n            print(status_detail)\n        else:\n            default_detail = data_class.DefaultDetail(**detail)\n            print(default_detail)\n\n# 打印完整的answer结果\nprint(answer)\n```\n\n#### Run方法带ToolCall调用示例\n\n以下示例展示了三种方式来使用 ToolCall 进行调用，并演示了如何在 AppBuilder 环境中配置和执行会话调用。\n\n**方式1：使用 JSONSchema 格式直接描述 tools 调用**\n\n```python\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client import data_class\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\napp_id = \"...\"  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\ntools = [\n    {\n        \"type\": \"function\",\n        \"function\": {\n            \"name\": \"get_current_weather\",\n            \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"location\": {\n                        \"type\": \"string\",\n                        \"description\": \"城市名，举例：北京\",\n                    },\n                    \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n                },\n                \"required\": [\"location\", \"unit\"],\n            },\n        },\n    }\n]\n\nmsg = client.run(\n    conversation_id=conversation_id, query=\"今天北京天气怎么样？\", tools=tools\n)\nprint(msg.model_dump_json(indent=4))\n\nevent = msg.content.events[-1]\n\nmsg_2 = client.run(\n    conversation_id=conversation_id,\n    tool_outputs=[{\"tool_call_id\": event.tool_calls[-1].id, \"output\": \"北京今天35度\"}],\n)\nprint(msg_2.model_dump_json(indent=4))\n```\n\n**方式2: 使用 function_to_model 将函数对象传递为 ToolCall 的调用**\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\napp_id = \"...\"  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\n#注意：要使用此方法要为函数写好注释。最好按照谷歌规范来写\n\n#定义示例函数\ndef get_current_weather(location: str, unit: str) -> str:\n  \"\"\"获取指定中国城市的当前天气信息。\n\n  仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\n\n  Args:\n      location (str): 城市名，例如：\"北京\"。\n      unit (int): 温度单位，支持 \"celsius\" 或 \"fahrenheit\"。\n\n  Returns:\n      str: 天气情况描述\n  \"\"\"\n  return \"北京今天25度\"\n  \n#定义函数列表\nfunctions = [get_current_weather]\nfunction_map = {f.__name__: f for f in functions}\n#调用大模型\nmsg = client.run(\n  conversation_id=conversation_id,\n  query=\"今天北京的天气怎么样？\",\n  tools = [appbuilder.Manifest.from_function(f) for f in functions]\n  )\nprint(msg.model_dump_json(indent=4))\n# 获取最后的事件和工具调用信息\nevent = msg.content.events[-1]\ntool_call = event.tool_calls[-1]\n\n# 获取函数名称和参数\nname = tool_call.function.name\nargs = tool_call.function.arguments\n\n# 将函数名称映射到具体的函数并执行\nraw_result = function_map[name](**args)\n\n# 传递工具的输出\nmsg_2 = client.run(\n    conversation_id=conversation_id,\n    tool_outputs=[{\n        \"tool_call_id\": tool_call.id,\n        \"output\": str(raw_result)\n    }],\n)\nprint(msg_2.model_dump_json(indent=4))\n```\n\n**方式3: 使用装饰器进行描述**\n\n```python\nimport os\nimport json\nimport appbuilder\nfrom appbuilder import manifest, manifest_parameter\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"\"\napp_id = \"\"  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\n\n#使用manifest装饰描述函数，manifest_parameter装饰器描述参数，manifest_return装饰器描述函数返回值。\n@manifest(description=\"获取指定中国城市的当前天气信息。仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\")\n@manifest_parameter(name=\"location\", description=\"城市名，例如：北京。\")\n@manifest_parameter(name=\"unit\", description=\"温度单位，支持 'celsius' 或 'fahrenheit'\")\n#定义示例函数\ndef get_current_weather(location: str, unit: str) -> str:\n  return \"北京今天25度\"\n\nprint(json.dumps(appbuilder.Manifest.from_function(get_current_weather), indent=4, ensure_ascii=False))\n#定义函数列表\nfunctions = [get_current_weather]\nfunction_map = {f.__name__: f for f in functions}\n#调用大模型\nmsg = client.run(\n  conversation_id=conversation_id,\n  query=\"今天北京的天气怎么样？\",\n  tools = [appbuilder.Manifest.from_function(f) for f in functions]\n  )\nprint(msg.model_dump_json(indent=4))\n# 获取最后的事件和工具调用信息\nevent = msg.content.events[-1]\ntool_call = event.tool_calls[-1]\n\n# 获取函数名称和参数\nname = tool_call.function.name\nargs = tool_call.function.arguments\n\n# 将函数名称映射到具体的函数并执行\nraw_result = function_map[name](**args)\n\n# 传递工具的输出\nmsg_2 = client.run(\n    conversation_id=conversation_id,\n    tool_outputs=[{\n        \"tool_call_id\": tool_call.id,\n        \"output\": str(raw_result)\n    }],\n)\nprint(msg_2.model_dump_json(indent=4)\n```\n\n#### Run方法带MCP Tool使用示例：\n\n**方式1：使用run方法直接调用**\n\n以[官方server](https://github.com/modelcontextprotocol/quickstart-resources/blob/main/weather-server-python/weather.py)为例。我们将server代码保存为`weather.py`。\n\n```python\nimport os\nimport asyncio\nimport appbuilder\nfrom appbuilder.mcp_server.client import MCPClient\n\n\nasync def main():\n    mcp_client = MCPClient()\n    await mcp_client.connect_to_server(\"./weather.py\")\n    tools = mcp_client.tools\n\n    client = appbuilder.AppBuilderClient(app_id)\n    conversation_id = client.create_conversation()\n    msg = client.run(\n        conversation_id=conversation_id,\n        query=\"美国马塞诸塞州的天气\",\n        tools=tools,\n    )\n    tool_call = msg.content.events[-1].tool_calls[-1]\n    mcp_result = await mcp_client.call_tool(\n        tool_name=tool_call.function.name, tool_args=tool_call.function.arguments\n    )\n\n    msg_2 = client.run(\n        conversation_id=conversation_id,\n        tool_outputs=[{\n            \"tool_call_id\": tool_call.id,\n            \"output\": mcp_result.content[0].text\n        }])\n    print(\"\\033[1;34m\", \"Agent 最终结果:{}\".format(\n        msg_2.content.answer), \"\\033[0m\")\n\n\nif __name__ == \"__main__\":\n    # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n    # 设置环境变量\n    os.environ[\"APPBUILDER_TOKEN\"] = (\"\")\n    # 已发布AppBuilder应用的ID\n    app_id = \"\"\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n\n```\n\n**方式2: 使用eventhandler封装调用**\n\n以[官方server](https://github.com/modelcontextprotocol/quickstart-resources/blob/main/weather-server-python/weather.py)为例。我们将server代码保存为`weather.py`。\n\n```python\nimport os\nimport asyncio\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.async_event_handler import (\n    AsyncAppBuilderEventHandler,\n)\n\nfrom appbuilder.mcp_server.client import MCPClient\n\n\nclass MyEventHandler(AsyncAppBuilderEventHandler):\n    def __init__(self, mcp_client):\n        super().__init__()\n        self.mcp_client = mcp_client\n        self.functions = []\n\n    async def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        print(\"\\033[1;31m\", \"-> Agent 中间思考: \", thought, \"\\033[0m\")\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            function_name = tool_call.function.name\n            function_arguments = tool_call.function.arguments\n            result = \"\"\n            function_map = {f.__name__: f for f in self.functions}\n            if function_name in function_map:\n                result = function_map[function_name](\n                    **tool_call.function.arguments)\n                print(\"\\033[1;33m\", \"本地function结果: {}\\n\\033[0m\".format(result))\n            else:\n                print(\n                    \"\\033[1;32m\",\n                    \"MCP工具名称: {}, MCP参数:{}\\n\".format(\n                        function_name, function_arguments\n                    ),\n                    \"\\033[0m\",\n                )\n                mcp_server_result = await self.mcp_client.call_tool(\n                    function_name, function_arguments\n                )\n                print(\"\\033[1;33m\", \"MCP结果: {}\\n\\033[0m\".format(\n                    mcp_server_result))\n                index = 0\n                for i, content in enumerate(mcp_server_result.content):\n                    if content.type == \"text\":\n                        index = i\n                        result = result + mcp_server_result.content[index].text\n            tool_output.append(\n                {\n                    \"tool_call_id\": tool_call.id,\n                    \"output\": result,\n                }\n            )\n        return tool_output\n\n    async def success(self, run_context, run_response):\n        print(\"\\n\\033[1;34m\", \"-> Agent 非流式回答: \",\n              run_response.answer, \"\\033[0m\")\n\n\nasync def main():\n    appbuilder_client = appbuilder.AsyncAppBuilderClient(app_id)\n    mcp_client = MCPClient()\n    await mcp_client.connect_to_server(\"./weather.py\")\n    tools = mcp_client.tools\n\n    conversation_id = await appbuilder_client.create_conversation()\n    with await appbuilder_client.run_with_handler(\n        conversation_id=conversation_id,\n        query=\"美国马塞诸塞州天气\",\n        tools=tools,\n        event_handler=MyEventHandler(mcp_client),\n    ) as run:\n        await run.until_done()\n    await appbuilder_client.http_client.session.close()\n\n\nif __name__ == \"__main__\":\n    os.environ[\"APPBUILDER_TOKEN\"] = \"\"\n    app_id = \"\"\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n\n```\n\n**方式3: MCP Tool跟其他Tool一起作为Tool注册**\n\n以[官方server](https://github.com/modelcontextprotocol/quickstart-resources/blob/main/weather-server-python/weather.py)为例。我们将server代码保存为`weather.py`。\n\n```python\nimport os\nimport asyncio\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.async_event_handler import (\n    AsyncAppBuilderEventHandler,\n)\n\nfrom appbuilder.mcp_server.client import MCPClient\n\n\n@appbuilder.manifest(\n    description=\"获取指定中国城市的当前天气信息。仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\"\n)\n@appbuilder.manifest_parameter(name=\"location\", description=\"城市名，例如：北京。\")\n@appbuilder.manifest_parameter(\n    name=\"unit\", description=\"温度单位，支持 'celsius' 或 'fahrenheit'\"\n)\ndef get_current_weather(location: str, unit: str) -> str:\n    return \"北京今天25度\"\n\n\nclass MyEventHandler(AsyncAppBuilderEventHandler):\n    def __init__(self, mcp_client):\n        super().__init__()\n        self.mcp_client = mcp_client\n\n    async def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        print(\"\\033[1;31m\", \"-> Agent 中间思考: \", thought, \"\\033[0m\")\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            function_name = tool_call.function.name\n            function_arguments = tool_call.function.arguments\n            result = \"\"\n            function_map = {f.__name__: f for f in functions}\n            if function_name in function_map:\n                result = function_map[function_name](\n                    **tool_call.function.arguments)\n                print(\"\\033[1;33m\", \"本地function结果: {}\\n\\033[0m\".format(result))\n            else:\n                print(\n                    \"\\033[1;32m\",\n                    \"MCP工具名称: {}, MCP参数:{}\\n\".format(\n                        function_name, function_arguments\n                    ),\n                    \"\\033[0m\",\n                )\n                mcp_server_result = await self.mcp_client.call_tool(\n                    function_name, function_arguments\n                )\n                print(\"\\033[1;33m\", \"MCP结果: {}\\n\\033[0m\".format(\n                    mcp_server_result))\n                index = 0\n                for i, content in enumerate(mcp_server_result.content):\n                    if content.type == \"text\":\n                        index = i\n                        result = result + mcp_server_result.content[index].text\n            tool_output.append(\n                {\n                    \"tool_call_id\": tool_call.id,\n                    \"output\": result,\n                }\n            )\n        return tool_output\n\n    async def success(self, run_context, run_response):\n        print(\"\\n\\033[1;34m\", \"-> Agent 非流式回答: \",\n              run_response.answer, \"\\033[0m\")\n\n\nasync def main():\n    tools = [appbuilder.Manifest.from_function(f) for f in functions]\n\n    mcp_client = MCPClient()\n    await mcp_client.connect_to_server(\"./weather.py\")\n    tools.extend(mcp_client.tools)\n\n    appbuilder_client = appbuilder.AsyncAppBuilderClient(app_id)\n    conversation_id = await appbuilder_client.create_conversation()\n    with await appbuilder_client.run_with_handler(\n        conversation_id=conversation_id,\n        query=\"美国马塞诸塞州天气\",\n        tools=tools,\n        event_handler=MyEventHandler(mcp_client),\n    ) as run:\n        await run.until_done()\n    await appbuilder_client.http_client.session.close()\n\n\nif __name__ == \"__main__\":\n    os.environ[\"APPBUILDER_TOKEN\"] = \"\"\n    app_id = \"\"\n    functions = [get_current_weather]\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n\n```\n\n#### Run方法带ToolChoice使用示例：\n\n* 注意：当前功能为试运行阶段，可能存在如下问题，如使用过程遇到其他问题，欢迎提issue或微信群讨论。\n  * 需开启\"组件/知识库结论可直接作为回复\"\n  * 组件名称不是界面上的原始名字，而是个人空间组件列表中的英文名\n  * 自定义组件的参数不能使用系统参数，可以使用用户添加的参数\n  * 部分官方组件使用的参数与界面上的参数不一致\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\napp_id = \"...\"  # 已发布AppBuilder应用的ID\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\n\n# 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\nanswer = app_builder_client.run(\n    conversation_id,\n    \"北京今天的天气\",\n    stream=False,\n    end_user_id=\"user_id_toolchoice\",\n    tool_choice={\n        \"type\": \"function\",\n        \"function\": {\"name\": \"WeatherQuery\", \"input\": {\"city\": \"北京\"}},\n    },\n)\n```\n\n#### Run方法回复工作流Agent “信息收集节点”使用示例：\n\n使用[“飞行客服小助手”](https://cloud.baidu.com/doc/AppBuilder/s/cm38k8nqr)作为工作流Agent的示例应用。\n\n**方式1：** SDK直接进行对话（不推荐）\n\n```python\nimport appbuilder\nimport os\nfrom appbuilder.core.console.appbuilder_client import data_class\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = (\n    \"...\"\n)\nappbuilder.logger.setLoglevel(\"ERROR\")\n\n# 飞行客服小助手的应用id\napp_id = \"...\"\n# 初始化智能体\nclient = appbuilder.AppBuilderClient(app_id)\n# 创建会话\nconversation_id = client.create_conversation()\ninterrupt_ids = []\n\nmsg = client.run(conversation_id, \"查天气\", stream=True)\ninterrupt_event_id = None\nfor ans in msg.content:\n    for event in ans.events:\n        if event.content_type == \"publish_message\":\n            print(event.detail.get(\"message\"))\n        if event.content_type == \"chatflow_interrupt\":\n            interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n            break\ninterrupt_ids.append(interrupt_event_id)\n\nmsg2 = client.run(\n    conversation_id,\n    \"查航班\",\n    stream=True,\n    action=data_class.Action.create_resume_action(interrupt_event_id),\n)\ninterrupt_event_id = None\nfor ans in msg2.content:\n    for event in ans.events:\n        if event.content_type == \"publish_message\":\n            print(event.detail.get(\"message\"))\n        if event.content_type == \"chatflow_interrupt\":\n            interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n            break\n        interrupt_ids.append(interrupt_event_id)\n\nmsg3 = client.run(\n    conversation_id=conversation_id,\n    query=\"CA1234\",\n    stream=True,\n    action=data_class.Action.create_resume_action(interrupt_ids.pop()),\n)\ninterrupt_event_id = None\nfor ans in msg3.content:\n    for event in ans.events:\n        if event.content_type == \"text\":\n            print(event.detail.get(\"text\"))\n        if event.content_type == \"chatflow_interrupt\":\n            interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n            break\ninterrupt_ids.append(interrupt_event_id)\n\nmsg4 = client.run(\n    conversation_id=conversation_id,\n    query=\"北京的\",\n    stream=True,\n    action=data_class.Action.create_resume_action(interrupt_ids.pop()),\n)\nhas_multiple_dialog_event = False\nfor ans in msg4.content:\n    for event in ans.events:\n        if event.content_type == \"text\":\n            print(event.detail.get(\"text\"))\n        if event.content_type == \"multiple_dialog_event\":\n            has_multiple_dialog_event = True\n            break\n\n```\n\n**方式2：** 实现自己的EventHandler，更方便地进行对话（推荐）\n\n```python\nimport os\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.event_handler import (\n    AppBuilderEventHandler,\n)\n\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def __init__(self):\n        super().__init__()\n        self.interrupt_ids = []\n\n    def handle_content_type(self, run_context, run_response):\n        interrupt_event_id = None\n        event = run_response.events[-1]\n        if event.content_type == \"chatflow_interrupt\":\n            interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n        if interrupt_event_id is not None:\n            self.interrupt_ids.append(interrupt_event_id)\n\n    def _create_action(self):\n        if len(self.interrupt_ids) == 0:\n            return None\n        event_id = self.interrupt_ids.pop()\n        return {\n            \"action_type\": \"resume\",\n            \"parameters\": {\"interrupt_event\": {\"id\": event_id, \"type\": \"chat\"}},\n        }\n\n    def run(self, query=None):\n        super().new_dialog(\n            query=query,\n            action=self._create_action(),\n        )\n\n\ndef main():\n    # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n    # 设置环境变量\n    os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n    appbuilder.logger.setLoglevel(\"DEBUG\")\n\n    # 飞行客服小助手的应用id\n    app_id = \"...\"\n    # 初始化智能体\n    client = appbuilder.AppBuilderClient(app_id)\n    conversation_id = client.create_conversation()\n\n    event_handler = MyEventHandler()\n    event_handler.init(\n        appbuilder_client=client,\n        conversation_id=conversation_id,\n        stream=True,\n        query=\"查天气\",\n    )\n    for data in event_handler:\n        pass\n    event_handler.run(\n        query=\"查航班\",\n    )\n    for data in event_handler:\n        pass\n    event_handler.run(\n        query=\"CA1234\",\n    )\n    for data in event_handler:\n        pass\n    event_handler.run(\n        query=\"北京的\",\n    )\n    for data in event_handler:\n        pass\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n**方式3:** 实现自己的EventHandler，更方便地进行多轮对话（推荐）\n\n```python\nimport os\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.event_handler import (\n    AppBuilderEventHandler,\n)\n\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def __init__(self):\n        super().__init__()\n        self.interrupt_ids = []\n\n    def handle_content_type(self, run_context, run_response):\n        interrupt_event_id = None\n        event = run_response.events[-1]\n        if event.content_type == \"chatflow_interrupt\":\n            interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n        if interrupt_event_id is not None:\n            self.interrupt_ids.append(interrupt_event_id)\n\n    def _create_action(self):\n        if len(self.interrupt_ids) == 0:\n            return None\n        event_id = self.interrupt_ids.pop()\n        return {\n            \"action_type\": \"resume\",\n            \"parameters\": {\"interrupt_event\": {\"id\": event_id, \"type\": \"chat\"}},\n        }\n\n    def gen_action(self):\n        while True:\n            yield self._create_action()\n\n\ndef main():\n    # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n    # 设置环境变量\n    os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n    appbuilder.logger.setLoglevel(\"DEBUG\")\n\n    # 飞行客服小助手的应用id\n    app_id = \"...\"\n    # 初始化智能体\n    client = appbuilder.AppBuilderClient(app_id)\n    conversation_id = client.create_conversation()\n\n    queries = [\"查天气\", \"查航班\", \"CA1234\", \"北京的\"]\n    event_handler = MyEventHandler()\n    event_handler = client.run_multiple_dialog_with_handler(\n        conversation_id=conversation_id,\n        queries=queries,\n        event_handler=event_handler,\n        stream=True,\n        actions=event_handler.gen_action(),\n    )\n    for data in event_handler:\n        for ans in data:\n            pass\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n\n\n## Java基本用法\n\n### ```new AppBuilderClient(appId)```\n\n#### 方法参数\n\n| 参数名称 | 参数类型 | 描述              | 示例值         |\n| -------- | -------- | ----------------- | -------------- |\n| appID    | String   | 线上Agent应用的ID | \"正确的应用ID\" |\n\n\n#### 方法返回值\n\n```AppBuilderClient```实例化对象\n\n### ```AppBuilderClient().createConversation()```\n\n#### 方法参数\n无\n\n#### 方法返回值\n\n| 参数名称       | 参数类型 | 描述         | 示例值         |\n| -------------- | -------- | ------------ | -------------- |\n| conversationId | String   | 创建的会话ID | \"正确的会话ID\" |\n\n### ```AppBuilderClient().run()```\n\n#### Run方法入参`AppBuilderCientRunRequest`\n\n| 参数名称        | 参数类型           | 是否必须 | 描述                                                         | 示例值               |\n| --------------- | ------------------ | -------- | ------------------------------------------------------------ | -------------------- |\n| query           | String             | 是       | query内容                                                    | \"汽车性能参数怎么样\" |\n| conversationId  | String             | 是       | 对话id，可以通过createConversation()获取                     |                      |\n| stream          | boolean            | 是       | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 |                      |\n| tools           | List[Tool]         | 否       | 一个列表，其中每个字典对应一个工具的配置                     |                      |\n| tools[0]        | Tool               | 否       | 工具配置                                                     |                      |\n| +type           | String             | 否       | 枚举：<br/>**file_retrieval**: 知识库检索工具能够理解文档内容，支持用户针对文档内容的问答。<br/>**code_interpreter**: 代码解释器, 代码解释器能够生成并执行代码，从而协助用户解决复杂问题，涵盖科学计算（包括普通数学计算题）、数据可视化、文件编辑处理（图片、PDF文档、视频、音频等）、文件格式转换（如WAV、MP3、text、SRT、PNG、jpg、MP4、GIF、MP3等）、数据分析&清洗&处理（文件以excel、csv格式为主）、机器学习&深度学习建模&自然语言处理等多个领域。<br/>**function**: 支持fucntion call模式调用工具 |                      |\n| +function       | Function           | 否       | Function工具描述<br/>仅当**type为**`**function**` 时需要且必须填写 |                      |\n| ++name          | String             | 否       | 函数名<br/>只允许数字、大小写字母和中划线和下划线，最大长度为64个字符。一次运行中唯一。 |                      |\n| ++description   | String             | 否       | 工具描述                                                     |                      |\n| ++parameters    | Dict               | 否       | 工具参数, json_schema格式                                    |                      |\n| tool_outputs    | List[ToolOutput]   | 否       | 内容为本地的工具执行结果，以自然语言/json dump str描述       |                      |\n| tool_outputs[0] | ToolOutput         | 否       | 工具执行结果                                                 |                      |\n| +tool_call_id   | String             | 否       | 工具调用ID                                                   |                      |\n| +output         | String             | 否       | 工具输出                                                     |                      |\n| tool_choice     | ToolChoice         | 否       | 控制大模型使用组件的方式，仅对自主规划Agent生效。            |                      |\n| +type           | String             | 否       | auto/function，auto表示由LLM自动判断调什么组件；function表示由用户指定调用哪个组件。 |                      |\n| +function       | ToolChoiceFunction | 否       | 组件对象，包括组件的英文名称和入参                           |                      |\n| ++name          | String             | 否       | 组件的英文名称（唯一标识）                                   |                      |\n| ++input         | String             | 否       | 组件入参，当组件没有入参时填入空对象{}                       |                      |\n| action          | Action             | 否       | 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息 |                      |\n| +action_type    | String             | 是       | 要执行的操作。<br/>可选值为：<br/>resume：回复“信息收集节点” 的消息 |                      |\n| +parameters     | Object             | 是       | 执行操作时所需的参数                                         |                      |\n\n#### Run方法出参\n| 参数名称                 | 参数类型                 | 描述                                                                             | 示例值 |\n| ------------------------ | ------------------------ | -------------------------------------------------------------------------------- | ------ |\n| AppBuilderClientIterator | AppBuilderClientIterator | 回答迭代器，流式/非流式均统一返回该类型,每次迭代返回AppBuilderClientIterator类型 |        |\n\n#### 迭代AppBuilderClientIterator\n| 参数名称      | 参数类型            | 描述                 | 示例值                                                                                  |\n| ------------- | ------------------- | -------------------- | --------------------------------------------------------------------------------------- |\n| +answer       | String              | 智能体应用返回的回答 |                                                                                         |\n| +events       | Event[]             | 事件列表             |                                                                                         |\n| +events[0]    | Event               | 具体事件内容         |                                                                                         |\n| ++code        | string              | 错误码               |                                                                                         |\n| ++message     | string              | 错误具体消息         |                                                                                         |\n| ++status      | string              | 事件状态             | 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）      |\n| ++eventType   | string              | 事件类型             |                                                                                         |\n| ++contentType | string              | 内容类型             | 可选值包括：code text, image, status,image, function_call, rag, audio、video等          |\n| ++detail      | Map<String, Object> | 事件输出详情         | 代码解释器、文生图、工具组件、RAG等的详细输出内容                                       |\n| ++usage       | Usage               | 模型调用的token用量  | Usage(prompt_tokens=1322, completion_tokens=80, total_tokens=1402, name='DeepSeek-V3.1') |\n\n\n#### 示例代码\n\n```Java\npackage org.example;\n\nimport java.io.IOException;\nimport java.util.*;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\nimport com.baidubce.appbuilder.model.appbuilderclient.Event;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\n\nclass AppBuilderClientDemo {\n\n    public static void main(String[] args) throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\");\n        String appId = \"请设置正确的应用ID\";\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n        // 填写上传文件路径\n        String fileId = builder.uploadLocalFile(conversationId, \"/Users/zhangxiaoyu15/PycharmProjects/app-builder/test_app_builder_client/test.pdf\");\n        // 输入query\n        // 注意file_ids不是必填项，如果不需要引用特定文档，则将new String[]{fileId}更换为new String[]{}即可\n        AppBuilderClientIterator itor = builder.run(\"中国四大传统节日是哪四个\", conversationId, new String[]{fileId}, false);\n        StringBuilder answer = new StringBuilder();\n        // itor.hasNext()返回false时，表示流式调用结束\n        while(itor.hasNext())\n        {\n            AppBuilderClientResult response = itor.next();\n            answer.append(response.getAnswer());\n            for (Event event : response.getEvents()) {\n                switch (event.getContentType()) {\n                    case \"rag\":\n                        List<Object> references = (List<Object>)event.getDetail().get(\"references\");\n                        for (Object reference : references) {\n                            ReferenceDetail ragDetail = JsonUtils.deserialize(JsonUtils.serialize(reference), ReferenceDetail.class);\n                            System.out.println(\"-----------------------------------\");\n                            System.out.println(\"参考文献ID:\"+ragDetail.getId());\n                            System.out.println(\"参考文献内容:\"+ragDetail.getContent());\n                            System.out.println(\"来源:\"+ragDetail.getFrom());\n                            System.out.println(\"BaiduSearch链接:\"+ragDetail.getUrl());\n                            System.out.println(\"类型:\"+ragDetail.getType());\n                            System.out.println(\"文档片段ID:\"+ragDetail.getSegmentId());\n                            System.out.println(\"文档ID:\"+ragDetail.getDocumentId());\n                            System.out.println(\"文档名称:\"+ragDetail.getDocumentName());\n                            System.out.println(\"文档所属数据集ID:\"+ragDetail.getDatasetId());\n                            System.out.println(\"-----------------------------------\");\n                        }\n                        break;\n                    default:\n                        // System.out.println(event);\n                }\n            }\n        }\n        System.out.print(\"输出：\");\n        System.out.println(answer);\n    }\n}\n\nclass ReferenceDetail {\n    private int id;\n    private String content;\n    private String from;\n    private String url;\n    private String type;\n    @SerializedName(\"segment_id\")\n    private String segmentId;\n    @SerializedName(\"document_id\")\n    private String documentId;\n    @SerializedName(\"document_name\")\n    private String documentName;\n    @SerializedName(\"dataset_id\")\n    private String datasetId;\n    @SerializedName(\"knowledgebase_id\")\n    private String knowledgebaseId;\n\n    public int getId() {\n        return id;\n    }\n\n    public void setId(int id) {\n        this.id = id;\n    }\n\n    public String getContent() {\n        return content;\n    }\n\n    public void setContent(String content) {\n        this.content = content;\n    }\n\n    public String getFrom() {\n        return from;\n    }\n\n    public void setFrom(String from) {\n        this.from = from;\n    }\n\n    public String getUrl() {\n        return url;\n    }\n\n    public void setUrl(String url) {\n        this.url = url;\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n\n    public String getSegmentId() {\n        return segmentId;\n    }\n\n    public void setSegmentId(String segmentId) {\n        this.segmentId = segmentId;\n    }\n\n    public String getDocumentId() {\n        return documentId;\n    }\n\n    public void setDocumentId(String documentId) {\n        this.documentId = documentId;\n    }\n\n    public String getDocumentName() {\n        return documentName;\n    }\n\n    public void setDocumentName(String documentName) {\n        this.documentName = documentName;\n    }\n\n    public String getDatasetId() {\n        return datasetId;\n    }\n\n    public void setDatasetId(String datasetId) {\n        this.datasetId = datasetId;\n    }\n\n    public String getKnowledgebaseId() {\n        return knowledgebaseId;\n    }\n\n    public void setKnowledgebaseId(String knowledgebaseId) {\n        this.knowledgebaseId = knowledgebaseId;\n    }\n\n    @Override\n    public String toString() {\n        return \"RAGReference{\" +\n                \"id=\" + id +\n                \", content='\" + content + '\\'' +\n                \", from='\" + from + '\\'' +\n                \", url='\" + url + '\\'' +\n                \", type='\" + type + '\\'' +\n                \", segmentId='\" + segmentId + '\\'' +\n                \", documentId='\" + documentId + '\\'' +\n                \", documentName='\" + documentName + '\\'' +\n                \", datasetId='\" + datasetId + '\\'' +\n                \", knowledgebaseId='\" + knowledgebaseId + '\\'' +\n                '}';\n    }\n}\n```\n\n#### Run方法带ToolCall调用示例\n\n**创建tool的json文件**\n\n```json\n{\n    \"type\": \"function\",\n    \"function\": {\n        \"name\": \"get_cur_whether\",\n        \"description\": \"这是一个获得指定地点天气的工具\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n            \"required\": [\n                \"location\"\n            ]\n        }\n    }\n}\n```\n\n```java\npackage org.example;\n\nimport java.io.IOException;\nimport java.util.*;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\nimport com.baidubce.appbuilder.model.appbuilderclient.Event;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\n\nclass AppBuilderClientDemo {\n\n    public static void main(String[] args) throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\");\n        String appId = \"请设置正确的应用ID\";\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n       \n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(appId, conversationId, \"今天北京的天气怎么样?\", false);\n\n        String toolJson = new String(Files.readAllBytes(Paths.get(\"json文件所在的路径\")));\n        request.setTools(toolJson);\n\n        AppBuilderClientIterator itor = builder.run(request);\n        String ToolCallID = \"\";\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            Event lastEvent = result.getEvents()[result.getEvents().length - 1];\n            ToolCallID = lastEvent.getToolCalls()[lastEvent.getToolCalls().length - 1].getId();\n            System.out.println(result);\n        }\n\n        AppBuilderClientRunRequest request2 = new AppBuilderClientRunRequest(appId, conversationId);\n        request2.setToolOutputs(ToolCallID, \"北京今天35度\");\n        AppBuilderClientIterator itor2 = builder.run(request2);\n        while (itor2.hasNext()) {\n            AppBuilderClientResult result = itor2.next();\n            System.out.println(result);\n        }\n    }\n}\n\n```\n\n#### Run方法带Toolchoice使用示例\n\n* 注意：当前功能为试运行阶段，可能存在如下问题，如使用过程遇到其他问题，欢迎提issue或微信群讨论。\n\n  * 需开启\"组件/知识库结论可直接作为回复\"\n\n  * 组件名称不是界面上的原始名字，而是个人空间组件列表中的英文名\n\n  * 自定义组件的参数不能使用系统参数，可以使用用户添加的参数\n\n  * 部分官方组件使用的参数与界面上的参数不一致\n\n```java\npackage org.example;\n\nimport java.io.IOException;\nimport java.util.*;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientRunRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.Event;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\n\nclass AppBuilderClientDemo {\n\n    public static void main(String[] args) throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\");\n        String appId = \"请设置正确的应用ID\";\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n\n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(appId, conversationId, \"你能干什么\", false);\n        request.setEndUserId(\"java_toolchoice_demo\");\n      \n        // 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\n        Map<String, Object> input = new HashMap<>();\n        input.put(\"city\", \"北京\");\n        AppBuilderClientRunRequest.ToolChoice.Function func = new AppBuilderClientRunRequest.ToolChoice.Function(\n                \"WeatherQuery\", input);\n        AppBuilderClientRunRequest.ToolChoice choice = new AppBuilderClientRunRequest.ToolChoice(\"function\", func);\n        request.setToolChoice(choice);\n\n        AppBuilderClientIterator itor = builder.run(request);\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            System.out.println(result);\n        }\n    }\n}\n\n```\n\n#### Run方法回复工作流Agent “信息收集节点”使用示例：\n\n使用[“飞行客服小助手”](https://cloud.baidu.com/doc/AppBuilder/s/cm38k8nqr)作为工作流Agent的示例应用\n\n```java\npackage org.example;\n\nimport java.io.IOException;\nimport java.util.*;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientRunRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.Event;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\n\nclass AppBuilderClientDemo {\n\n    public static void main(String[] args) throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\");\n        String chatflowAppId = \"请设置正确的应用ID\";\n        AppBuilderClient builder = new AppBuilderClient(chatflowAppId);\n        String conversationId = builder.createConversation();\n\n\t\t\t\tAppBuilderClientRunRequest request = new AppBuilderClientRunRequest(chatflowAppId, conversationId, \"查天气\", true);\n        Stack<String> interruptStack = new Stack<String>();\n        AppBuilderClientIterator itor = builder.run(request);\n        String interruptEventId = \"\";\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            for (Event event : result.getEvents()) {\n                if (event.getContentType().equals(EventContent.PublishMessageContentType)) {\n                    String message = event.getDetail().get(\"message\").toString();\n                    System.out.println(message);\n                }\n                if (event.getContentType().equals(EventContent.ChatflowInterruptContentType)) {\n                    interruptEventId = event.getDetail().get(\"interrupt_event_id\").toString();\n                    interruptStack.push(interruptEventId);\n                    break;\n                }\n            }\n        }\n      \n        interruptEventId = \"\";\n        AppBuilderClientRunRequest request2 = new AppBuilderClientRunRequest(chatflowAppId, conversationId, \"我先查个航班动态\", true);\n        request2.setAction(AppBuilderClientRunRequest.Action.createAction(interruptStack.pop()));\n        AppBuilderClientIterator itor2 = builder.run(request2);\n        while (itor2.hasNext()) {\n            AppBuilderClientResult result2 = itor2.next();\n            for (Event event : result2.getEvents()) {\n                if (event.getContentType().equals(EventContent.PublishMessageContentType)) {\n                    String message = event.getDetail().get(\"message\").toString();\n                    System.out.println(message);\n                }\n                if (event.getContentType().equals(EventContent.ChatflowInterruptContentType)) {\n                    interruptEventId = event.getDetail().get(\"interrupt_event_id\").toString();\n                    interruptStack.push(interruptEventId);\n                    break;\n                }\n            }\n        }\n      \n        interruptEventId = \"\";\n        AppBuilderClientRunRequest request3 = new AppBuilderClientRunRequest(chatflowAppId, conversationId, \"CA1234\", true);\n        request3.setAction(AppBuilderClientRunRequest.Action.createAction(interruptStack.pop()));\n        AppBuilderClientIterator itor3 = builder.run(request3);\n        while (itor3.hasNext()) {\n            AppBuilderClientResult result3 = itor3.next();\n            for (Event event : result3.getEvents()) {\n                if (event.getContentType().equals(EventContent.TextContentType)) {\n                    String text = event.getDetail().get(\"text\").toString();\n                    System.out.println(text);\n                }\n                if (event.getContentType().equals(EventContent.ChatflowInterruptContentType)) {\n                    interruptEventId = event.getDetail().get(\"interrupt_event_id\").toString();\n                    interruptStack.push(interruptEventId);\n                    break;\n                }\n            }\n        }\n      \n        boolean hasMultipleContentType = false;\n        AppBuilderClientRunRequest request4 = new AppBuilderClientRunRequest(chatflowAppId, conversationId, \"北京的\",\n                true);\n        request4.setAction(AppBuilderClientRunRequest.Action.createAction(interruptStack.pop()));\n        AppBuilderClientIterator itor4 = builder.run(request4);\n        while (itor4.hasNext()) {\n            AppBuilderClientResult result4 = itor4.next();\n            for (Event event : result4.getEvents()) {\n                if (event.getContentType().equals(EventContent.TextContentType)) {\n                    String text = event.getDetail().get(\"text\").toString();\n                    System.out.println(text);\n                }\n                if (event.getContentType().equals(EventContent.MultipleDialogEventContentType)) {\n                    hasMultipleContentType = true;\n                    break;\n                }\n            }\n        }\n    }\n}\n\n```\n\n\n\n## Go基本用法\n\n### ```NewAppBuilderClient()```\n\n#### 方法参数\n\n| 参数名称 | 参数类型  | 描述              | 示例值         |\n| -------- | --------- | ----------------- | -------------- |\n| app_id   | string    | 线上Agent应用的ID | \"正确的应用ID\" |\n| config   | SDKConfig | SDK配置信息       |                |\n\n### ```CreateConversation()```\n#### 方法入参\n无\n#### 方法出参\n| 参数名称       | 参数类型 | 描述                                         | 示例值 |\n| -------------- | -------- | -------------------------------------------- | ------ |\n| ConversationId | str      | 创建成功的对话对象，后续操作都基于该对象进行 |        |\n\n\n### `Run()`\n#### Run方法入参`AppBuilderClientRunRequest`\n\n| 参数名称       | 参数类型   | 是否必须 | 描述                                                         | 示例值               |\n| -------------- | ---------- | -------- | ------------------------------------------------------------ | -------------------- |\n| ConversationID | string     | 是       | 对话ID，可以通过CreateConversation()获取                     |                      |\n| Query          | string     | 是       | query内容                                                    | \"汽车性能参数怎么样\" |\n| Stream         | bool       | 是       | 为true时则流式返回，为false时则一次性返回所有内容, 推荐设为true，降低首token时延 |                      |\n| AppID          | string     | 是       | 应用ID，线上Agent应用的ID                                    |                      |\n| Tools          | []Tool     | 否       | 一个列表，其中每个字典对应一个工具的配置                     |                      |\n| ToolOuptus     | []ToolOupt | 否       | 内容为本地的工具执行结果，以自然语言/json dump str描述       |                      |\n| ToolChoice     | ToolChoice | 否       | 控制大模型使用组件的方式，仅对自主规划Agent生效。            |                      |\n\n`Tool`、`ToolOutput`、`ToolChoice`定义如下：\n\n```go\ntype Tool struct {\n\tType     string   `json:\"type\"`\n\tFunction Function `json:\"function\"`\n}\n\ntype Function struct {\n\tName        string                 `json:\"name\"`\n\tDescription string                 `json:\"description\"`\n\tParameters  map[string]interface{} `json:\"parameters\"`\n}\n\ntype ToolOutput struct {\n\tToolCallID string `json:\"tool_call_id\" description:\"工具调用ID\"`\n\tOutput     string `json:\"output\" description:\"工具输出\"`\n}\n\ntype ToolChoice struct {\n\tType     string             `json:\"type\"`\n\tFunction ToolChoiceFunction `json:\"function\"`\n}\n\ntype ToolChoiceFunction struct {\n\tName  string                 `json:\"name\"`\n\tInput map[string]interface{} `json:\"input\"`\n}\n```\n\n#### Run方法出参\n\n| 参数名称                 | 参数类型                 | 描述                                    | 示例值 |\n| ------------------------ | ------------------------ | --------------------------------------- | ------ |\n| AppBuilderClientIterator | AppBuilderClientIterator | 回答迭代器，流式/非流式均统一返回该类型 |        |\n| error                    | error                    | 存在错误时error不为nil，反之            |        |\n\n#### 迭代AgentBuilderIterator\n\n| 参数名称      | 参数类型    | 描述                 | 示例值                                                                                  |\n| ------------- | ----------- | -------------------- | --------------------------------------------------------------------------------------- |\n| +Answer       | string      | 智能体应用返回的回答 |                                                                                         |\n| +Events       | []Event     | 事件列表             |                                                                                         |\n| +Events[0]    | Event       | 具体事件内容         |                                                                                         |\n| ++Code        | string      | 错误码               |                                                                                         |\n| ++Message     | string      | 错误具体消息         |                                                                                         |\n| ++Status      | string      | 事件状态             | 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）      |\n| ++EventType   | string      | 事件类型             |                                                                                         |\n| ++ContentType | string      | 内容类型             | 可选值包括：code text, image, status,image, function_call, rag, audio、video等          |\n| ++Detail      | interface{} | 事件输出详情         | 代码解释器、文生图、工具组件、RAG等的详细输出内容                                       |\n| ++Usage       | Usage       | 模型调用的token用量  | Usage(prompt_tokens=1322, completion_tokens=80, total_tokens=1402, name='DeepSeek-V3.1') |\n\n\n#### Run示例代码\n\n\n```Go\n// 安装说明：\n// go get github.com/baidubce/app-builder/go/appbuilder\n\npackage main\n\nimport (\n    \"errors\"\n    \"fmt\"\n    \"io\"\n    \"os\"\n\n    \"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n    // 设置环境中的TOKEN，以下TOKEN请替换为您的个人TOKEN，个人TOKEN可通过该页面【获取鉴权参数】或控制台页【密钥管理】处获取\n    os.Setenv(\"APPBUILDER_TOKEN\", \"bce-v3/ALTAK-xxx90ea58\")\n    // 从AppBuilder控制台【个人空间】-【应用】网页获取已发布应用的ID\n    appID := \"4678492a-xxx-654538d3503c\"\n    config, err := appbuilder.NewSDKConfig(\"\", \"\")\n    if err != nil {\n        fmt.Println(\"new config failed: \", err)\n        return\n    }\n\n    builder, err := appbuilder.NewAppBuilderClient(appID, config)\n    if err != nil {\n        fmt.Println(\"new agent builder failed: \", err)\n        return\n    }\n    conversationID, err := builder.CreateConversation()\n    if err != nil {\n        fmt.Println(\"create conversation failed: \", err)\n        return\n    }\n\n    i, err := builder.Run(conversationID, \"你好，你能做什么？\", nil, false)\n    if err != nil {\n        fmt.Println(\"run failed: \", err)\n        return\n    }\n\n\tvar answer *appbuilder.AppBuilderClientAnswer\n\tfor answer, err = i.Next(); err == nil; answer, err = i.Next() {\n\t\tfmt.Println(answer.Answer)\n\t}\n}\n```\n\n#### ToolCall功能示例代码\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\t// 设置APPBUILDER_TOKEN、GATEWAY_URL_V2环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\t// 默认可不填，默认值是 https://qianfan.baidubce.com\n\tos.Setenv(\"GATEWAY_URL_V2\", \"\")\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tfmt.Println(\"new config failed: \", err)\n\t\treturn\n\t}\n\t// 初始化实例\n\tappID := \"请填写正确的应用ID\"\n\tbuilder, err := appbuilder.NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tfmt.Println(\"new agent builder failed: \", err)\n\t\treturn\n\t}\n\t// 创建对话ID\n\tconversationID, err := builder.CreateConversation()\n\tif err != nil {\n\t\tfmt.Println(\"create conversation failed: \", err)\n\t\treturn\n\t}\n\n\tjsonStr := `\n\t{\n\t\t\"type\": \"function\",\n\t\t\"function\": {\n\t\t\t\"name\": \"get_cur_whether\",\n\t\t\t\"description\": \"这是一个获得指定地点天气的工具\",\n\t\t\t\"parameters\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"省，市名，例如：河北省\"\n\t\t\t\t\t},\n\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"enum\": [\"摄氏度\", \"华氏度\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\"location\"]\n\t\t\t}\n\t\t}\n\t}`\n\n\tvar tool Tool\n\terr = json.Unmarshal([]byte(jsonStr), &tool)\n\tif err != nil {\n\t\tfmt.Println(\"unmarshal tool error:\", err)\n        return\n\t}\n\n\ti, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: conversationID,\n\t\tStream:         true,\n\t\tTools: []appbuilder.Tool{tool},\n\t})\n\tif err != nil {\n\t\tfmt.Println(\"run failed:\", err)\n\t}\n\ttotalAnswer := \"\"\n\ttoolCallID := \"\"\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\ttotalAnswer += answer.Answer\n\t\tlastEvent := answer.Events[len(answer.Events)-1]\n\t\ttoolCallID = lastEvent.ToolCalls[len(lastEvent.ToolCalls)-1].ID\n\t}\n\n\ti2, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tToolOutputs: []appbuilder.ToolOutput{\n\t\t\t{\n\t\t\t\tToolCallID: toolCallID,\n\t\t\t\tOutput:     \"北京今天35度\",\n\t\t\t},\n\t\t},\n\t\tStream: true,\n\t})\n\n\tif err != nil {\n\t\tfmt.Println(\"run failed: \", err)\n\t}\n\n\tfor answer, err := i2.Next(); err == nil; answer, err = i2.Next() {\n\t\ttotalAnswer = totalAnswer + answer.Answer\n\t\tfor _, ev := range answer.Events {\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tfmt.Println(string(evJSON))\n\t\t}\n\t}\n\n\tfmt.Println(\"----------------answer-------------------\")\n\tfmt.Println(totalAnswer)\n}\n```\n\n#### ToolChoice示例代码\n\n* 注意：当前功能为试运行阶段，可能存在如下问题，如使用过程遇到其他问题，欢迎提issue或微信群讨论。\n\n  * 需开启\"组件/知识库结论可直接作为回复\"\n\n  * 组件名称不是界面上的原始名字，而是个人空间组件列表中的英文名\n  \n  * 自定义组件的参数不能使用系统参数，可以使用用户添加的参数\n\n  * 部分官方组件使用的参数与界面上的参数不一致\n\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\t// 设置APPBUILDER_TOKEN、GATEWAY_URL_V2环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\t// 默认可不填，默认值是 https://qianfan.baidubce.com\n\tos.Setenv(\"GATEWAY_URL_V2\", \"\")\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tfmt.Println(\"new config failed: \", err)\n\t\treturn\n\t}\n\t// 初始化实例\n\tappID := \"请填写正确的应用ID\"\n\tbuilder, err := appbuilder.NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tfmt.Println(\"new agent builder failed: \", err)\n\t\treturn\n\t}\n\t// 创建对话ID\n\tconversationID, err := builder.CreateConversation()\n\tif err != nil {\n\t\tfmt.Println(\"create conversation failed: \", err)\n\t\treturn\n\t}\n\n    // 注意使用创建应用中用到的组件。名称、参数均以实际使用的组件为准。\n\tinput := make(map[string]any)\n\tinput[\"city\"] = \"北京\"\n\tend_user_id := \"go_toolchoice_demo\"\n\ti, err := client.Run(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"\",\n\t\tEndUserID:      &end_user_id,\n\t\tStream:         false,\n\t\tToolChoice: &ToolChoice{\n\t\t\tType: \"function\",\n\t\t\tFunction: ToolChoiceFunction{\n\t\t\t\tName:  \"WeatherQuery\",\n\t\t\t\tInput: input,\n\t\t\t},\n\t\t},\n\t})\n  \n\tif err != nil {\n\t\tfmt.Println(\"run failed: \", err)\n\t\treturn\n\t}\n\n    for answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tfmt.Println(string(evJSON))\n\t\t}\n\t}\n}\n```\n\n#### Run方法回复工作流Agent “信息收集节点”使用示例：\n\n使用[“飞行客服小助手”](https://cloud.baidu.com/doc/AppBuilder/s/cm38k8nqr)作为工作流Agent的示例应用\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\t// 设置APPBUILDER_TOKEN、GATEWAY_URL_V2环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\t// 默认可不填，默认值是 https://qianfan.baidubce.com\n\tos.Setenv(\"GATEWAY_URL_V2\", \"\")\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tfmt.Println(\"new config failed: \", err)\n\t\treturn\n\t}\n\t// 初始化实例\n\tappID := \"请填写正确的应用ID\"\n\tclient, err := appbuilder.NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tfmt.Println(\"new agent builder failed: \", err)\n\t\treturn\n\t}\n\t// 创建对话ID\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tfmt.Println(\"create conversation failed: \", err)\n\t\treturn\n\t}\n\ti, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"查天气\",\n\t\tStream:         true,\n\t})\n\n\tif err != nil {\n\t\tfmt.Println(\"run failed: \", err)\n\t\treturn\n\t}\n\n\tvar interruptId string\n\tinterruptStack := make([]string, 0)\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == appbuilder.PublishMessageContentType {\n\t\t\t\tdetail := ev.Detail.(appbuilder.PublishMessageDetail)\n\t\t\t\tmessage := detail.Message\n\t\t\t\tfmt.Println(message)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ev.ContentType == appbuilder.ChatflowInterruptContentType {\n\t\t\t\tdeatil := ev.Detail.(appbuilder.ChatflowInterruptDetail)\n\t\t\t\tinterruptId = deatil.InterruptEventID\n\t\t\t\tinterruptStack = append(interruptStack, interruptId)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif len(interruptId) == 0 {\n\t\tfmt.Println(\"interrupt id is empty\")\n\t\treturn\n\t}\n\n\tinterruptId = \"\"\n\ti2, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"我先查个航班动态\",\n\t\tStream:         true,\n\t\tAction:         appbuilder.NewResumeAction(interruptStack[len(interruptStack)-1]),\n\t})\n\tif err != nil {\n\t\tfmt.Println(\"run failed:\", err)\n\t\treturn\n\t}\n\tinterruptStack = interruptStack[:len(interruptStack)-1]\n\tfor answer, err := i2.Next(); err == nil; answer, err = i2.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == appbuilder.PublishMessageContentType {\n\t\t\t\tdetail := ev.Detail.(appbuilder.PublishMessageDetail)\n\t\t\t\tmessage := detail.Message\n\t\t\t\tfmt.Println(message)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ev.ContentType == appbuilder.ChatflowInterruptContentType {\n\t\t\t\tdeatil := ev.Detail.(appbuilder.ChatflowInterruptDetail)\n\t\t\t\tinterruptId = deatil.InterruptEventID\n\t\t\t\tinterruptStack = append(interruptStack, interruptId)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif len(interruptId) == 0 {\n\t\tfmt.Println(\"interrupt id is empty\")\n\t\treturn\n\t}\n\n\tinterruptId = \"\"\n\ti3, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"CA1234\",\n\t\tStream:         true,\n\t\tAction:         appbuilder.NewResumeAction(interruptStack[len(interruptStack)-1]),\n\t})\n\tif err != nil {\n\t\tfmt.Println(\"run failed:\", err)\n\t\treturn\n\t}\n\tinterruptStack = interruptStack[:len(interruptStack)-1]\n\tfor answer, err := i3.Next(); err == nil; answer, err = i3.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == appbuilder.TextContentType {\n\t\t\t\tdetail := ev.Detail.(appbuilder.TextDetail)\n\t\t\t\ttext := detail.Text\n\t\t\t\tfmt.Println(text)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ev.ContentType == appbuilder.ChatflowInterruptContentType {\n\t\t\t\tdeatil := ev.Detail.(appbuilder.ChatflowInterruptDetail)\n\t\t\t\tinterruptId = deatil.InterruptEventID\n\t\t\t\tinterruptStack = append(interruptStack, interruptId)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif len(interruptId) == 0 {\n\t\tfmt.Println(\"interrupt id is empty\")\n\t\treturn\n\t}\n\n\ti4, err := client.Run(appbuilder.AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"北京的\",\n\t\tStream:         true,\n\t\tAction:         appbuilder.NewResumeAction(interruptStack[len(interruptStack)-1]),\n\t})\n\tif err != nil {\n\t\tfmt.Println(\"run failed:\", err)\n\t\treturn\n\t}\n\tfor answer, err := i4.Next(); err == nil; answer, err = i4.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == appbuilder.TextContentType {\n\t\t\t\tdetail := ev.Detail.(appbuilder.TextDetail)\n\t\t\t\ttext := detail.Text\n\t\t\t\tfmt.Println(text)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n```\n\n"
  },
  {
    "path": "docs/BasisModule/Platform/Application/get_app_list.md",
    "content": "# 获取AppBuilder已发布的应用列表\n\n## 简介\n该接口可获取用户在 AppBuilder已发布的应用列表，包括应用名称、应用描述、应用的ID、应用类型、应用发布状态等\n\n## Python基本用法\n\n### 获取app_list接口 `appbuilder.describe_apps()`\n\n#### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n#### 初始化参数\n\n| 参数名称       | 参数类型   | 描述      | 示例值        |\n|------------|--------|---------|------------|\n| maxKeys | int | 返回结果的最大数量，默认值为10, 最大值为100 | 10 |\n| marker | str | 分页游标，返回结果中第一个应用的游标值，接口会返回该应用及之后的应用，用于分页查询。默认值为空字符串。 | app_id |\n\n#### 返回参数\n\n`describe_apps`方法返回类型为 `list[AppOverview]`,其中 `AppOverview` 结构如下：\n\n```python\nclass AppOverview(BaseModel):\n    id: str = Field(\"\", description=\"应用ID\")\n    name: str = Field(\"\", description=\"应用名称\")\n    description: str = Field(\"\", description=\"应用简介\")\n    appType: Optional[str] = Field(\n        None,\n        description=\"应用类型:agent、chatflow。agent:自主规划Agent, chatflow:工作流Agent。\"\n    )\n    isPublished: Optional[bool] = Field(None, description=\"是否已发布\")\n    updateTime: Optional[int] = Field(None, description=\"更新时间。时间戳，单位秒\")\n```\n\n\n#### 代码示例\n下面是模型列表获取功能的代码示例：\n\n```python\nimport os\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\napp_list = appbuilder.describe_apps()\nprint(app_list)\n```\n\n返回值为\n\n```shell\n[AppOverview(id='e97865e7-e1be-45d3-ab8a-ea84ca6e0b9a', name='二次元风格图片生成助手', description='生成二次元风格图片，一键生成你的专属动漫风格作品'), AppOverview(id='982aaa98-60d4-4120-b4ab-3404a95a61e1', name='智能客服机器人', description='智能回答文字问题，解析程序报错并给出建议'), AppOverview(id='c59cb95b-8c42-4102-8582-df07bde8d4cc', name='招聘海报大师', description='一键生成招聘海报，高效宣传职位需求'), AppOverview(id='42eb211a-14b9-43d2-9fae-193c8760ef26', name='地理小达人', description='提供地理知识解答，如地名由来、地形地貌等。')]\n```\n\n### 获取app数目接口 `appbuilder.get_all_apps()`\n\n#### 返回参数\n\n`get_all_apps`方法返回类型为 `list[AppOverview]`,,其中 `AppOverview` 结构如下：\n\n```python\nclass AppOverview(BaseModel):\n    id: str = Field(\"\", description=\"应用ID\")\n    name: str = Field(\"\", description=\"应用名称\")\n    description: str = Field(\"\", description=\"应用简介\")\n    appType: Optional[str] = Field(\n        None,\n        description=\"应用类型:agent、chatflow。agent:自主规划Agent, chatflow:工作流Agent。\"\n    )\n    isPublished: Optional[bool] = Field(None, description=\"是否已发布\")\n    updateTime: Optional[int] = Field(None, description=\"更新时间。时间戳，单位秒\")\n```\n\n#### 代码示例\n下面是模型列表获取功能的代码示例：\n\n```python\nimport os\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\nall_apps = appbuilder.get_all_apps()\nfor i in range(len(all_apps)):\n    print(\"第{}个App,App信息:{}\".format(i+1,all_apps[i]))\n\nprint(\"创建的app总数为:{}\".format(len(all_apps)))\n```\n\n## Java基本用法\n\n#### 接口参数及返回值\n与 `python appbuilder.describe_apps()`设计一致\n\n#### 代码示例\n\n```java\npublic void GetAppsTest() throws IOException, AppBuilderServerException {\n    AppList appList = new AppList();\n    AppsDescribeRequest request = new AppsDescribeRequest();\n    assertNotNull(appList.describeApps(request).getData()[0].getId());\n}\n```\n\n## Go基本用法\n\n#### 接口参数及返回值\n与 `python appbuilder.describe_apps()`设计一致\n\n#### 代码示例\n\n```go\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n  // 设置APPBUILDER_TOKEN、GATEWAY_URL环境变量\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"请设置正确的应用密钥\")\n\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"\")\n\tif err != nil {\n    fmt.Println(\"failed new sdk config: \", err)\n\t\treturn\n\t}\n\n\tmaxKeys := 10\n\tapps, err := appbuilder.DescribeApps(appbuilder.DescribeAppsRequest{MaxKeys: &maxKeys}, config)\n\tif err != nil {\n    fmt.Println(\"get apps failed: \", err)\n\t}\n\tfmt.Println(len(apps.Data))\n}\n```\n\n## 高级用法\n\n目前该模块提供获取AppBuilder已发布应用的功能，获取的应用ID，可以配合`AppBuilderClient` SDK进行应用调用。\n\n\n## 更新记录和贡献\n* 千帆模型列表获取能力 (2024-7)\n* 接口结构升级(2024-11)"
  },
  {
    "path": "docs/BasisModule/Platform/CustomComponents/component_client.md",
    "content": "# ComponentClient\n\n## 简介\n\nComponentClient组件支持调用在[百度智能云千帆AppBuilder](https://cloud.baidu.com/product/AppBuilder)平台上创建的自定义工作流组件。\n\n### 功能介绍\n\n具体包括运行等。\n\n### 特色优势\n\n与云端工作流组件能力打通，实现低代码会话\n\n### 应用场景\n\n快速、高效集成云端工作流组件能力\n\n\n### `ComponentClient().run() -> Message`\n\n#### 方法参数\n\n| 参数名称             | 参数类型 | 是否必须 | 描述                                                         | 示例值            |\n| -------------------- | -------- | -------- | ------------------------------------------------------------ | ----------------- |\n| component_id         | String   | 是       | 组件ID。可以在个人空间-组件下查看。                          |                   |\n| sys_origin_query     | String   | 是       | query问题内容                                                | \"今天天气怎么样?\" |\n| version              | String   | 否       | 组件版本                                                     |                   |\n| stream               | Bool     | 否       | 为true时则流式返回，为false时则一次性返回所有内容, 默认为false | False             |\n| action               | String   | 否       | 调用方式。<br/>默认值是tool_eval。                           |                   |\n| sys_file_urls        | Dict     | 否       | 文件路径。对应画布中开始节点的系统参数fileUrls，格式为{\"文件名\": \"文件路径\"}，例如{\"xxx.pdf\": \"http:///\"}。 |                   |\n| sys_conversatiaon_id | String   | 否       | 对话id。对应画布中开始节点的系统参数conversation_id，可通过新建会话接口创建。 |                   |\n| sys_chat_history     | Dict     | 否       | 组件使用的累计对话历史。对应画布中开始节点的系统参数chatHistory。{\"role\": \"\", \"content\": \"\"} |                   |\n| sys_end_user_id      | String   | 否       | 终端用户id。对应画布中开始节点的系统参数end_user_id。        |                   |\n| input_variable_name  | Object   | 否       | 用户自定义参数                                               |                   |\n\n#### Run方法非流式返回值\n\nRun非流式方法返回一个`Message`对象，`Message`通过`RunResponse`封装，该对象包含以下属性：\n\n| 参数名称        | 参数类型      | 是否必填 | 示例值                                                       |\n| --------------- | ------------- | -------- | ------------------------------------------------------------ |\n|request_id        | string        | 是       | 请求request_id                                             |\n|code             | string        | 否       | 错误代码，当发生异常时返回                                      |\n|message     \t\t| string        | 否       | 错误信息，当发生异常时返回                                      |\n| conversation_id | string        | 是       | 会话标识UUID。                                               |\n| message_id      | string        | 是       | 一问或一答的标识UUID。                                       |\n| trace_id        | string        | 是       | 调用标识UUID。                                               |\n| user_id         | string        | 是       | 开发者UUID（计费依赖）。                                     |\n| end_user_id     | string        | 否       | 终端用户ID。                                                 |\n|status           | string        | 是       | 状态码。<br>枚举值：<br>- running，对话进行过程中<br>- done，对话结束<br>- error，执行过程发生错误<br>- interrupt，中断|\n| is_completion   | bool          | 是       | 标识当前端到端的流式调用是否结束。                           |\n| role            | string        | 是       | 当前消息来源，默认tool 。                                    |\n| content         | list[Content] | 否       | 当前组件返回内容的主要payload，List[Content]，每个 Content 包括了当前 event 的一个元素，具体见下文Content对象定义。 |\n\n`Content`类型定义如下：\n\n| 参数名称      | 参数类型    | 是否必填 | 示例值                                                       |\n| ------------- | ----------- | -------- | ------------------------------------------------------------ |\n| type          | string      | 是       | 代表event 类型。该字段的取值决定了下面`text`字段的内容结构。  枚举值： text、json、code、files、urls、oral_text、references、image、chart、audio、function_call。 |\n| name          | string      | 是       | 介绍当前yield内容的step name。                               |\n| text          | dict object | 是       | 代表当前 event 元素的内容，每一种 event 对应的 text 结构固定。 |\n| visible_scope | string      | 是       | 可见范围。  枚举值： all ：全部，包括大模型和用户。 llm：大模型。 user：用户。 默认为all。 |\n| usage         | dict        | 否       | 大模型的token用量，具体见下文Usage对象定义。                 |\n| metrics       | dict        | 是       | 耗时信息，具体见下文Metrics对象定义。                        |\n| event         | dict        | 是       | 标识返回内容的结构、顺序、状态，具体见下文Event对象定义。    |\n\n**Usage对象**\n\n| **字段**          | **类型**   | **必填** | **说明**                                                     |\n| ----------------- | ---------- | -------- | ------------------------------------------------------------ |\n| prompt_tokens     | int        | 是       | 输入token消耗                                                |\n| completion_tokens | int        | 是       | 输出token消耗                                                |\n| total_tokens      | int        | 是       | 总token消耗                                                  |\n| nodes             | list[node] | 否       | 工作流节点大模型token消耗信息，列表元素具体见下文Node对象定义。 |\n\n**Node对象**\n\n| **字段**     | **类型**          | **必填** | **说明**                                      |\n| ------------ | ----------------- | -------- | --------------------------------------------- |\n| node_id      | string            | 是       | 节点id                                        |\n| models_usage | list[model_usage] | 是       | 模型消耗列表，元素见下文model_usage对象定义。 |\n\n**model_usage对象**\n\n| **字段**          | **类型** | **必填** | **说明**      |\n| ----------------- | -------- | -------- | ------------- |\n| model_name        | string   | 是       | 模型名称      |\n| prompt_tokens     | int      | 是       | 输入token消耗 |\n| completion_tokens | int      | 是       | 输出token消耗 |\n| total_tokens      | int      | 是       | 总token消耗   |\n\n**Metrics对象**\n\n| **字段**   | **类型** | **必填** | **说明**                                            |\n| ---------- | -------- | -------- | --------------------------------------------------- |\n| begin_time | string   | 是       | 请求开始时间，示例：”2000-01-01T10:00:00.560430“。  |\n| duration   | float    | 是       | 从请求到当前event总耗时，保留3位有效数字，单位秒s。 |\n\n**Event对象**\n\n| **字段**      | **类型** | **必填** | **说明**                                                     |\n| ------------- | -------- | -------- | ------------------------------------------------------------ |\n| id            | string   | 是       | 节点id。                                                     |\n| status        | string   | 是       | 事件执行状态。  枚举值： preparing：运行中。 running：运行中。 error：错误。 done：执行完成。 |\n| name          | string   | 是       | 事件名。  一级深度有： component，组件api。 functioncall，自主规划agent。 chatflow，工作流agent。 二级深度是组件ID。 三级深度是组件content_type。  示例： /component/eaaccc60e222418abc0f4d3d372018af/node/ 433b4cf184064daf88e8383adc83e35f |\n| created_time  | string   | 是       | 当前event发送时间。                                          |\n| error_code    | string   | 否       | 错误码。                                                     |\n| error_message | string   | 否       | 错误细节。                                                   |\n\n#### Run方法流式返回值\n\n| 参数名称 | 参数类型         | 描述                                  | 示例值 |\n| -------- | ---------------- | ------------------------------------- | ------ |\n| content  | Python Generator | 可迭代，每次迭代返回`RunResponse`类型 | 无     |\n\n#### 非流式调用示例\n\n```python\nimport os\nimport appbuilder\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = (\n    \"...\"\n)\n\n# 组件ID，可在个人空间-组件下查看\ncomponent_id = \"...\"\nclient = appbuilder.ComponentClient()\nmessage = client.run(component_id=component_id, version=\"latest\",\n                 stream=False, sys_origin_query=\"北京景点推荐\")\nprint(message.content.content[0].text)\n```\n\n#### 流式调用示例\n\n```python\nimport os\nimport appbuilder\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = (\n    \"...\"\n)\n\n# 组件ID，可在个人空间-组件下查看\ncomponent_id = \"...\"\nclient = appbuilder.ComponentClient()\nmessage = client.run(component_id=component_id, version=\"latest\",\n                     stream=True, sys_origin_query=\"北京景点推荐\")\nfor content in message.content:\n    if len(content.content)>0:\n        print(content.content[0].text)\n\n```\n\n## Java基本用法\n\n### ```new ComponentClient()```\n\n\n#### 方法返回值\n\n```ComponentClient```实例化对象\n\n### ```ComponentClient().run()```\n\n#### run方法入参\n\n| 参数名称               | 参数类型 | 是否必须 | 描述                                                         | 示例值 |\n| ---------------------- | -------- | -------- | ------------------------------------------------------------ | ------ |\n| componentId            | String   | 是       | 组件ID。可以在个人空间-组件下查看。                          |        |\n| version                | String   | 否       | 组件版本                                                     |        |\n| action                 | String   | 否       | 调用方式。<br/>默认值是tool_eval。                           |        |\n| stream                 | Bool     | 是       | 为true时则流式返回，为false时则一次性返回所有内容, 默认为false | false  |\n| parameters             | Map      | 是       | 调用传参                                                     |        |\n| +_sys_origin_query     | string   | 是       | 用户query，对应画布中开始节点的系统参数rawQuery。            |        |\n| +_sys_file_urls        | Dict     | 否       | 文件路径。对应画布中开始节点的系统参数fileUrls，格式为{\"文件名\": \"文件路径\"}，例如{\"xxx.pdf\": \"http:///\"}。 |        |\n| +_sys_conversatiaon_id | String   | 否       | 对话id。对应画布中开始节点的系统参数conversation_id，可通过新建会话接口创建。 |        |\n| +_sys_chat_history     | Dict     | 否       | 组件使用的累计对话历史。对应画布中开始节点的系统参数chatHistory。{\"role\": \"\", \"content\": \"\"} |        |\n| +_sys_end_user_id      | String   | 否       | 终端用户id。对应画布中开始节点的系统参数end_user_id。        |        |\n| + input_variable_name  | object   | 否       | 用户自定义添加的参数，对应画布中开始节点用户新增的参数。注意，用户自定义参数和系统参数为一级，同在**parameters中。**例如：<br /><br />\"parameters\":<br /> {         <br />\"_sys_origin_query\": \"今天有什么新闻\",        <br /> \"custom_count\": 4    <br /> }<br /> |        |\n\n#### run方法出参\n| 参数名称                | 参数类型                | 描述                                                         | 示例值 |\n| ----------------------- | ----------------------- | ------------------------------------------------------------ | ------ |\n| ComponentClientIterator | ComponentClientIterator | 回答迭代器，流式/非流式均统一返回该类型,每次迭代返回ComponentClientIterator类型 |        |\n\n#### 迭代ComponentClientIterator\n\n| **字段**       | **类型**          | **必填** | **说明**                                                     |\n| -------------- | ----------------- | -------- | ------------------------------------------------------------ |\n| conversationID | string            | 是       | 会话标识UUID。                                               |\n| messageID      | string            | 是       | 一问或一答的标识UUID。                                       |\n| traceID        | string            | 是       | 调用标识UUID。                                               |\n| userID         | string            | 是       | 开发者UUID（计费依赖）。                                     |\n| endUserId      | string            | 否       | 终端用户ID。                                                 |\n| isCompletion   | bool              | 是       | 标识当前端到端的流式调用是否结束。                           |\n| role           | string            | 是       | 当前消息来源，默认tool 。                                    |\n| **content**    | **list[Content]** | **否**   | **当前组件返回内容的主要payload，List[Content]，每个 Content 包括了当前 event 的一个元素，具体见下文Content对象定义。** |\n\n**Content对象**\n\n| **字段**     | **类型**    | **必填** | **说明**                                                     |\n| ------------ | ----------- | -------- | ------------------------------------------------------------ |\n| type         | string      | 是       | 代表event 类型，该字段的取值决定了下面`text`字段的内容结构。枚举值： text、json、code、files、urls、oral_text、references、image、chart、audio、function_call |\n| name         | string      | 是       | 介绍当前yield内容的step name                                 |\n| text         | dict object | 是       | 代表当前 event 元素的内容，每一种 event 对应的 text 结构固定。 |\n| visibleScope | string      | 是       | 可见范围。枚举值：all ：全部，包括大模型和用户llm：大模型user：用户默认为all |\n| **usage**    | **dict**    | **否**   | **大模型的token用量，具体见下文Usage对象定义。**             |\n| **metrics**  | **dict**    | **是**   | **耗时信息，具体见下文Metrics对象定义。**                    |\n| **event**    | **dict**    | **是**   | **标识返回内容的结构、顺序、状态，具体见下文Event对象定义。** |\n\n**Usage对象**\n\n| **字段**          | **类型**       | **必填** | **说明**                                                     |\n| ----------------- | -------------- | -------- | ------------------------------------------------------------ |\n| prompt_tokens     | int            | 是       | 输入token消耗                                                |\n| completion_tokens | int            | 是       | 输出token消耗                                                |\n| total_tokens      | int            | 是       | 总token消耗                                                  |\n| **nodes**         | **list[node]** | **否**   | **工作流节点大模型token消耗信息，列表元素****具体见下文Node对象定义。** |\n\n**Node对象**\n\n| **字段**         | **类型**              | **必填** | **说明**                                          |\n| ---------------- | --------------------- | -------- | ------------------------------------------------- |\n| node_id          | string                | 是       | 节点id                                            |\n| **models_usage** | **list[model_usage]** | **是**   | **模型消耗列表，元素见下文model_usage对象定义。** |\n\n**model_usage对象**\n\n| **字段**          | **类型** | **必填** | **说明**      |\n| ----------------- | -------- | -------- | ------------- |\n| model_name        | string   | 是       | 模型名称      |\n| prompt_tokens     | int      | 是       | 输入token消耗 |\n| completion_tokens | int      | 是       | 输出token消耗 |\n| total_tokens      | int      | 是       | 总token消耗   |\n\n**Metrics对象**\n\n| **字段**   | **类型** | **必填** | **说明**                                            |\n| ---------- | -------- | -------- | --------------------------------------------------- |\n| begin_time | string   | 是       | 请求开始时间，示例：”2000-01-01T10:00:00.560430“。  |\n| duration   | float    | 是       | 从请求到当前event总耗时，保留3位有效数字，单位秒s。 |\n\n**Event对象**\n\n| **字段**     | **类型** | **必填** | **说明**                                                     |\n| ------------ | -------- | -------- | ------------------------------------------------------------ |\n| id           | string   | 是       | 节点id                                                       |\n| status       | string   | 是       | 事件执行状态。枚举值：preparing：运行中running：运行中error：错误done：执行完成 |\n| name         | string   | 是       | 事件名。一级深度有：component，组件apifunctioncall，自主规划agentchatflow，工作流agent二级深度是组件ID三级深度是组件content_type﻿示例：/component/eaaccc60e222418abc0f4d3d372018af/node/433b4cf184064daf88e8383adc83e35f |\n| createdTime  | string   | 是       | 当前event发送时间。                                          |\n| errorCode    | string   | 否       | 错误码。                                                     |\n| errorMessage | string   | 否       | 错误细节。                                                   |\n\n#### 示例代码\n\n```Java\npackage com.baidubce.appbuilder.demo;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.componentclient.ComponentClient;\nimport com.baidubce.appbuilder.model.componentclient.ComponentClientIterator;\nimport com.baidubce.appbuilder.model.componentclient.ComponentClientRunRequest;\nimport com.baidubce.appbuilder.model.componentclient.ComponentClientRunResponse;\n\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class ComponentClientDemo {\n    public static void main(String[] args) {\n        // 组件ID，可在个人空间-组件下查看\n        String componentId = \"...\";\n\n        try {\n            ComponentClient client = new ComponentClient();\n            Map<String, Object> parameters = new HashMap<>();\n            parameters.put(ComponentClientRunRequest.SysOriginQuery, \"北京景点推荐\");\n\n            // Run without streaming\n            ComponentClientIterator iter = client.run(componentId, \"latest\", \"\", false, parameters);\n            while (iter.hasNext()) {\n                ComponentClientRunResponse response = iter.next();\n                if(response.getContent().length > 0) {\n                    Map<String, Object> textMap = (Map<String, Object>) response.getContent()[0].getText();\n                    System.out.println(\"Without streaming: \" + textMap.toString());\n                }\n            }\n\n            // Run with streaming\n            iter = client.run(componentId, \"latest\", \"\", true, parameters);\n            Map<String, Object> textMap = null;\n            while (iter.hasNext()) {\n                ComponentClientRunResponse response = iter.next();\n                if (response.getContent().length > 0) {\n                    textMap = (Map<String, Object>) response.getContent()[0].getText();\n                }\n            }\n            if (textMap != null) {\n                System.out.println(\"With streaming: \" + textMap.toString());\n            }\n\n        } catch (IOException | AppBuilderServerException e) {\n            e.printStackTrace();\n        }\n    }\n}\n```\n\n\n\n## Go基本用法\n\n### ```NewComponentClient()```\n\n#### 方法参数\n\n| 参数名称 | 参数类型  | 描述        | 示例值 |\n| -------- | --------- | ----------- | ------ |\n| config   | SDKConfig | SDK配置信息 |        |\n\n\n### `Run()`\n#### Run方法入参\n\n#### \n\n| 参数名称               | 参数类型 | 是否必须 | 描述                                                         | 示例值 |\n| ---------------------- | -------- | -------- | ------------------------------------------------------------ | ------ |\n| componentId            | String   | 是       | 组件ID。可以在个人空间-组件下查看。                          |        |\n| version                | String   | 否       | 组件版本                                                     |        |\n| action                 | String   | 否       | 调用方式。<br/>默认值是tool_eval。                           |        |\n| stream                 | Bool     | 是       | 为true时则流式返回，为false时则一次性返回所有内容, 默认为false | false  |\n| parameters             | Map      | 是       | 调用传参                                                     |        |\n| +_sys_origin_query     | string   | 是       | 用户query，对应画布中开始节点的系统参数rawQuery。            |        |\n| +_sys_file_urls        | Dict     | 否       | 文件路径。对应画布中开始节点的系统参数fileUrls，格式为{\"文件名\": \"文件路径\"}，例如{\"xxx.pdf\": \"http:///\"}。 |        |\n| +_sys_conversatiaon_id | String   | 否       | 对话id。对应画布中开始节点的系统参数conversation_id，可通过新建会话接口创建。 |        |\n| +_sys_chat_history     | Dict     | 否       | 组件使用的累计对话历史。对应画布中开始节点的系统参数chatHistory。{\"role\": \"\", \"content\": \"\"} |        |\n| +_sys_end_user_id      | String   | 否       | 终端用户id。对应画布中开始节点的系统参数end_user_id。        |        |\n| + input_variable_name  | object   | 否       | 用户自定义添加的参数，对应画布中开始节点用户新增的参数。注意，用户自定义参数和系统参数为一级，同在**parameters中。**例如：<br /><br />\"parameters\":<br /> {         <br />\"_sys_origin_query\": \"今天有什么新闻\",        <br /> \"custom_count\": 4    <br /> }<br /> |        |\n\n#### Run方法出参\n\n| 参数名称                | 参数类型                | 描述                                    | 示例值 |\n| ----------------------- | ----------------------- | --------------------------------------- | ------ |\n| ComponentClientIterator | ComponentClientIterator | 回答迭代器，流式/非流式均统一返回该类型 |        |\n| error                   | error                   | 存在错误时error不为nil，反之            |        |\n\n#### 迭代ComponentClientIterator\n\n| **字段**       | **类型**          | **必填** | **说明**                                                     |\n| -------------- | ----------------- | -------- | ------------------------------------------------------------ |\n| ConversationID | string            | 是       | 会话标识UUID。                                               |\n| MessageID      | string            | 是       | 一问或一答的标识UUID。                                       |\n| TraceID        | string            | 是       | 调用标识UUID。                                               |\n| UserID         | string            | 是       | 开发者UUID（计费依赖）。                                     |\n| EndUserID      | string            | 否       | 终端用户ID。                                                 |\n| IsCompletion   | bool              | 是       | 标识当前端到端的流式调用是否结束。                           |\n| Role           | string            | 是       | 当前消息来源，默认tool 。                                    |\n| **Content**    | **list[Content]** | **否**   | **当前组件返回内容的主要payload，List[Content]，每个 Content 包括了当前 event 的一个元素，具体见下文Content对象定义。** |\n\n**Content对象**\n\n| **字段**     | **类型**    | **必填** | **说明**                                                     |\n| ------------ | ----------- | -------- | ------------------------------------------------------------ |\n| Type         | string      | 是       | 代表event 类型，该字段的取值决定了下面`text`字段的内容结构。枚举值： text、json、code、files、urls、oral_text、references、image、chart、audio、function_call |\n| Name         | string      | 是       | 介绍当前yield内容的step name                                 |\n| Text         | dict object | 是       | 代表当前 event 元素的内容，每一种 event 对应的 text 结构固定。 |\n| VisibleScope | string      | 是       | 可见范围。枚举值：all ：全部，包括大模型和用户llm：大模型user：用户默认为all |\n| **Usage**    | **dict**    | **否**   | **大模型的token用量，具体见下文Usage对象定义。**             |\n| **Metrics**  | **dict**    | **是**   | **耗时信息，具体见下文Metrics对象定义。**                    |\n| **Event**    | **dict**    | **是**   | **标识返回内容的结构、顺序、状态，具体见下文Event对象定义。** |\n\n**Usage对象**\n\n| **字段**          | **类型**       | **必填** | **说明**                                                     |\n| ----------------- | -------------- | -------- | ------------------------------------------------------------ |\n| prompt_tokens     | int            | 是       | 输入token消耗                                                |\n| completion_tokens | int            | 是       | 输出token消耗                                                |\n| total_tokens      | int            | 是       | 总token消耗                                                  |\n| **nodes**         | **list[node]** | **否**   | **工作流节点大模型token消耗信息，列表元素****具体见下文Node对象定义。** |\n\n**Node对象**\n\n| **字段**         | **类型**              | **必填** | **说明**                                          |\n| ---------------- | --------------------- | -------- | ------------------------------------------------- |\n| node_id          | string                | 是       | 节点id                                            |\n| **models_usage** | **list[model_usage]** | **是**   | **模型消耗列表，元素见下文model_usage对象定义。** |\n\n**model_usage对象**\n\n| **字段**          | **类型** | **必填** | **说明**      |\n| ----------------- | -------- | -------- | ------------- |\n| model_name        | string   | 是       | 模型名称      |\n| prompt_tokens     | int      | 是       | 输入token消耗 |\n| completion_tokens | int      | 是       | 输出token消耗 |\n| total_tokens      | int      | 是       | 总token消耗   |\n\n**Metrics对象**\n\n| **字段**   | **类型** | **必填** | **说明**                                            |\n| ---------- | -------- | -------- | --------------------------------------------------- |\n| begin_time | string   | 是       | 请求开始时间，示例：”2000-01-01T10:00:00.560430“。  |\n| duration   | float    | 是       | 从请求到当前event总耗时，保留3位有效数字，单位秒s。 |\n\n**Event对象**\n\n| **字段**     | **类型** | **必填** | **说明**                                                     |\n| ------------ | -------- | -------- | ------------------------------------------------------------ |\n| ID           | string   | 是       | 节点id                                                       |\n| Status       | string   | 是       | 事件执行状态。枚举值：preparing：运行中running：运行中error：错误done：执行完成 |\n| Name         | string   | 是       | 事件名。一级深度有：component，组件apifunctioncall，自主规划agentchatflow，工作流agent二级深度是组件ID三级深度是组件content_type﻿示例：/component/eaaccc60e222418abc0f4d3d372018af/node/433b4cf184064daf88e8383adc83e35f |\n| CreatedTime  | string   | 是       | 当前event发送时间。                                          |\n| ErrorCode    | string   | 否       | 错误码。                                                     |\n| ErrorMessage | string   | 否       | 错误细节。                                                   |\n\n\n#### Run示例代码\n\n\n```Go\n// 安装说明：\n// 支持Go 1.18以上版本\n// go get github.com/baidubce/app-builder/go/appbuilder\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/baidubce/app-builder/go/appbuilder\"\n)\n\nfunc main() {\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n  // 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n\tconfig, err := appbuilder.NewSDKConfig(\"\", \"...\")\n\tif err != nil {\n\t\tfmt.Println(\"new http client config failed: \", err)\n\t}\n\n  // 组件ID，可在个人空间-组件下查看\n\tcomponentID := \"...\"\n\tclient, err := appbuilder.NewComponentClient(config)\n\tif err != nil {\n\t\tfmt.Println(\"new ComponentClient instance failed\")\n\t}\n\n\tparameters := map[string]any{\n\t\tappbuilder.SysOriginQuery: \"北京景点推荐\",\n\t}\n\tans, err := client.Run(componentID, \"latest\", \"\", false, parameters)\n\tif err != nil {\n\t\tfmt.Println(\"run component failed: \" + err.Error())\n\t}\n\n\t// run non stream\n\tfor answer, err := ans.Next(); err == nil; answer, err = ans.Next() {\n\t\tdata := answer.Content[0].Text\n\t\tif data == nil {\n\t\t\tfmt.Println(\"run component failed: data is nil\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"run component result: \")\n\t\tfmt.Println(data)\n\t}\n\n\t// run stream\n\tstreamAns, err := client.Run(componentID, \"latest\", \"\", true, parameters)\n\tif err != nil {\n\t\tfmt.Println(\"run component failed: \" + err.Error())\n\t}\n\tvar answerText any\n\tfor answer, err := streamAns.Next(); err == nil; answer, err = streamAns.Next() {\n\t\tif len(answer.Content) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tanswerText = answer.Content[0].Text\n\t}\n\tif answerText == nil {\n\t\tfmt.Println(\"run component failed: answer is nil\")\n\t\treturn\n\t}\n\tfmt.Println(\"run component result: \")\n\tfmt.Println(answerText)\n}\n\n```\n"
  },
  {
    "path": "docs/BasisModule/Platform/CustomComponents/components.md",
    "content": "# 基础能力组件\n\n- [组件列表](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz#3%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1)\n- [组件免费额度领取](https://console.bce.baidu.com/ai-engine/old/#/ai/ocr/overview/resource/list)"
  },
  {
    "path": "docs/BasisModule/Platform/KnowledgeBase/knowledgebase.md",
    "content": "# 知识库组件（KnowledgeBase）\n\n## 简介\n\n知识库组件（KnowledgeBase）是对线上知识库操作的组件，可以通过SDK实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作，可在平台console中查看结果。\n\n### 功能介绍\n\n对console端知识库进行操作，可以通过SDK实现创建知识库、添加知识文档、查询知识库文档、删除知识文档等操作，可在平台console中查看结果。\n\n### 特色优势\n\n和console端知识库操作一致，可实现快速创建、查询、删除等操作。\n\n### 应用场景\n\n通过SDK代码实现console端知识库操作。\n\n## Python基本用法\n\n### 1、新建知识库`KnowledgeBase().create_knowledge_base(name: str, description: str, type: str, clusterId: str, esUserName: str, esPassword: str, location: str) -> KnowledgeBaseDetailResponse`\n\n#### 方法参数\n| 参数名称    | 参数类型 | 是否必传 | 描述                                  | 示例值             |\n| ----------- | -------- | -------- | ------------------------------------- | ------------------ |\n| name        | string   | 是       | 希望创建的知识库名称                  | \"我的知识库\"       |\n| description | string   | 否       | 知识库描述                            | \"我的知识库\"       |\n| type        | string   | 是       | 知识库索引存储配置 (public、bes、vdb) | \"public\"           |\n| clusterId   | string   | type=bes 和 vdb 时填写       | 集群/实例 ID<br>请在bes、vdb控制台中查看。                       | \"clusterId\" |\n| esUserName  | string   | type=bes 和 vdb 时填写       | 用户名/账号<br>请在bes、vdb控制台中查看           | \"username\"         |\n| esPassword  | string   | type=bes 和 vdb 时填写       | 密码/API密钥<br>请在bes、vdb控制台中查看              | \"password\"         |\n|location|string|type=bes 和 vdb 时填写|托管资源的区域，type填vdb时填写<br>可选值：<br>- bj：北京<br>- bd：保定<br>- sz：苏州<br>- gz：广州|\"bj\"|\n|pathPrefix|string|否|创建知识库的指定目录，最大层级为5，默认为根目录下|\"/全部群组/##/##\"|\n\n#### 方法返回值\n\n`KnowledgeBaseDetailResponse` 类定义如下：\n\n```python\nclass KnowledgeBaseDetailResponse(BaseModel):\n    id: str = Field(..., description=\"知识库ID\")\n    name: str = Field(..., description=\"知识库名称\")\n    description: Optional[str] = Field(None, description=\"知识库描述\")\n    config: Optional[KnowledgeBaseConfig] = Field(..., description=\"知识库配置\")\n```\n\n衍生类`KnowledgeBaseConfig`定义如下：\n\n```python\nclass KnowledgeBaseConfig(BaseModel):\n    index: Optional[KnowledgeBaseConfigIndex] = Field(..., description=\"索引配置\")\n    catalogue: Optional[KnowledgeBaseConfigCatalogue] = Field(None, description=\"知识库目录配置\")\n```\n\n衍生类`KnowledgeBaseConfigIndex`定义如下：\n\n```python\nclass KnowledgeBaseConfigIndex(BaseModel):\n    type: str = Field(..., description=\"索引类型\", enum=[\"public\", \"bes\", \"vdb\"])\n    clusterId: Optional[str] = Field(None, description=\"集群/实例 ID\")\n    username: Optional[str] = Field(None, description=\"bes用户名\")\n    password: Optional[str] = Field(None, description=\"bes密码\")\n    location: Optional[str] = Field(None, description=\"托管资源的区域\", enum=[\"bj\", \"bd\", \"sz\", \"gz\"])\n```\n\n衍生类`KnowledgeBaseConfigCatalogue`\n\n```python\nclass KnowledgeBaseConfigCatalogue(BaseModel):\n    pathPrefix: Optional[str] = Field(None, description=\"知识库所属目录绝对路径\")\n```\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nknowledge = appbuilder.KnowledgeBase()\nresp = knowledge.create_knowledge_base(\n        name=\"my_knowledge\",\n        description=\"my_knowledge\",\n        type=\"public\",\n    )\nprint(\"新建的知识库ID: \", resp.id)\nprint(\"新建的知识库名称: \", resp.name)\n\n# 新建的知识库ID:  da51a988-cbe7-4b24-aa5b-768985e8xxxx\n# 新建的知识库名称:  my_knowledge\n```\n\n### 2、实例化已创建的知识库 `KnowledgeBase(knowledge_id: str)`\n\n#### 方法参数\n\n| 参数名称     | 参数类型 | 是否必传 | 描述         | 示例值           |\n| ------------ | -------- | -------- | ------------ | ---------------- |\n| knowledge_id | string   | 是       | 线上知识库ID | \"正确的知识库ID\" |\n\n#### 方法返回值\n| 参数名称      | 参数类型            | 必然存在 | 描述             | 示例值 |\n| ------------- | ------------------- | -------- | ---------------- | ------ |\n| KnowledgeBase | class KnowledgeBase | 是       | 实例化的知识库类 | -      |\n\n#### 方法示例\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\n\n# 知识库ID:  your_knowledge_base_id\n```\n\n### 3、获取知识库详情`get_knowledge_base_detail(knowledge_base_id: Optional[str] = None) -> KnowledgeBaseDetailResponse`\n\n#### 方法参数\n\n| 参数名称     | 参数类型 | 是否必传 | 描述         | 示例值           |\n| ------------ | -------- | -------- | ------------ | ---------------- |\n| knowledge_id | string   | 是       | 线上知识库ID | \"正确的知识库ID\" |\n\n#### 方法返回值\n\n`KnowledgeBaseDetailResponse` 类定义如下：\n\n```python\nclass KnowledgeBaseDetailResponse(BaseModel):\n    id: str = Field(..., description=\"知识库ID\")\n    name: str = Field(..., description=\"知识库名称\")\n    description: Optional[str] = Field(None, description=\"知识库描述\")\n    config: Optional[KnowledgeBaseConfig] = Field(..., description=\"知识库配置\")\n```\n\n衍生类`KnowledgeBaseConfig`定义如下：\n\n```python\nclass KnowledgeBaseConfig(BaseModel):\n    index: Optional[KnowledgeBaseConfigIndex] = Field(..., description=\"索引配置\")\n    catalogue: Optional[KnowledgeBaseConfigCatalogue] = Field(None, description=\"知识库目录配置\")\n```\n\n衍生类`KnowledgeBaseConfigIndex`定义如下：\n\n```python\nclass KnowledgeBaseConfigIndex(BaseModel):\n    type: str = Field(..., description=\"索引类型\", enum=[\"public\", \"bes\", \"vdb\"])\n    esUrl: Optional[str] = Field(..., description=\"ES地址\")\n    username: Optional[str] = Field(None, description=\"ES用户名\")\n    password: Optional[str] = Field(None, description=\"ES密码\")\n```\n\n衍生类`KnowledgeBaseConfigCatalogue`\n\n```python\nclass KnowledgeBaseConfigCatalogue(BaseModel):\n    pathPrefix: Optional[str] = Field(None, description=\"知识库所属目录绝对路径\")\n```\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nknowledge = appbuilder.KnowledgeBase()\nresp = knowledge.get_knowledge_base_detail(\"da51a988-cbe7-4b24-aa5b-768985e8xxxx\")\nprint(\"新建的知识库ID: \", resp.id)\nprint(\"新建的知识库名称: \", resp.name)\n\n# 新建的知识库ID:  da51a988-cbe7-4b24-aa5b-768985e8xxxx\n# 新建的知识库名称:  my_knowledge\n```\n\n### 4、 获取知识库列表`get_knowledge_base_list(knowledge_base_id: Optional[str] = None, maxKeys: int = 10, keyword: Optional[str] = None) -> KnowledgeBaseGetListResponse`\n\n#### 方法参数\n\n| 参数名称          | 参数类型 | 是否必传 | 描述                        | 示例值           |\n| ----------------- | -------- | -------- | --------------------------- | ---------------- |\n| knowledge_base_id | string   | 否       | 起始位置，知识库id          | \"正确的知识库ID\" |\n| maxKeys           | int      | 否       | 数据大小，默认10，最大值100 | 10               |\n| keyword           | string   | 否       | 搜索关键字                  | \"测试\"           |\n\n#### 方法返回值\n\n`KnowledgeBaseGetListResponse` 类定义如下：\n\n```python\nclass KnowledgeBaseGetListResponse(BaseModel):\n    requestId: str = Field(..., description=\"请求ID\")\n    data: list[KnowledgeBaseDetailResponse] = Field([], description=\"知识库详情列表\")\n    marker: str = Field(..., description=\"起始位置\")\n    nextMarker: str = Field(..., description=\"下一页起始位置\")\n    maxKeys: int = Field(10, description=\"返回文档数量大小，默认10，最大值100\")\n    isTruncated: bool = Field(..., description=\"是否有更多结果\")\n```\n\n衍生类`KnowledgeBaseDetailResponse` 定义如下：\n\n```python\nclass KnowledgeBaseDetailResponse(BaseModel):\n    id: str = Field(..., description=\"知识库ID\")\n    name: str = Field(..., description=\"知识库名称\")\n    description: Optional[str] = Field(None, description=\"知识库描述\")\n    config: Optional[KnowledgeBaseConfig] = Field(..., description=\"知识库配置\")\n```\n\n衍生类`KnowledgeBaseConfig`定义如下：\n\n```python\nclass KnowledgeBaseConfig(BaseModel):\n    index: Optional[KnowledgeBaseConfigIndex] = Field(..., description=\"索引配置\")\n    catalogue: Optional[KnowledgeBaseConfigCatalogue] = Field(None, description=\"知识库目录配置\")\n```\n\n衍生类`KnowledgeBaseConfigIndex`定义如下：\n\n```python\nclass KnowledgeBaseConfigIndex(BaseModel):\n    type: str = Field(..., description=\"索引类型\", enum=[\"public\", \"bes\", \"vdb\"])\n    esUrl: Optional[str] = Field(..., description=\"ES地址\")\n    username: Optional[str] = Field(None, description=\"ES用户名\")\n    password: Optional[str] = Field(None, description=\"ES密码\")\n```\n\n衍生类`KnowledgeBaseConfigCatalogue`\n\n```python\nclass KnowledgeBaseConfigCatalogue(BaseModel):\n    pathPrefix: Optional[str] = Field(None, description=\"知识库所属目录绝对路径\")\n```\n\n#### 方法示例：\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nknowledge = appbuilder.KnowledgeBase()\nresp = knowledge.get_knowledge_base_list(\"da51a988-cbe7-4b24-aa5b-768985e8xxxx\",10)\nprint(\"获取到的知识库列表: \", resp)\n```\n\n### 5、修改知识库`modify_knowledge_base(knowledge_base_id: Optional[str] = None, name: Optional[str] = None, description: Optional[str] = None)`\n\n#### 方法参数\n\n| 参数名称          | 参数类型 | 是否必传 | 描述                                          | 示例值           |\n| ----------------- | -------- | -------- | --------------------------------------------- | ---------------- |\n| knowledge_base_id | string   | 是       | 起始位置，知识库id                            | \"正确的知识库ID\" |\n| name              | string   | 否       | 修改后的知识库名称                            | \"new_name\"       |\n| description       | string   | 否       | 修改后的知识库描述                            | \"测试\"           |\n| pathPrefix        | string   | 否       | 知识库的指定目录，最大层级为5，默认为根目录下 |                  |\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nknowledge = appbuilder.KnowledgeBase()\nknowledge.modify_knowledge_base(\"da51a988-cbe7-4b24-aa5b-768985e8xxxx\", name=\"new_name\", description=\"测试\")\n```\n\n### 6、 删除知识库`delete_knowledge_base(knowledge_base_id: Optional[str] = None)`\n\n#### 方法参数\n\n| 参数名称          | 参数类型 | 是否必传 | 描述       | 示例值           |\n| ----------------- | -------- | -------- | ---------- | ---------------- |\n| knowledge_base_id | string   | 是       | 知识库的id | \"正确的知识库ID\" |\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nknowledge = appbuilder.KnowledgeBase()\nknowledge.delete_knowledge_base(\"da51a988-cbe7-4b24-aa5b-768985e8xxxx\")\n```\n\n### 7、 导入知识库`create_documents(id: Optional[str] = None, contentFormat: str = \"\", source: DocumentSource = None, processOption: DocumentProcessOption = None)`\n\n#### 方法参数\n\n| 参数名称      | 参数类型              | 是否必传                               | 描述                                                         | 示例值           |\n| ------------- | --------------------- | -------------------------------------- | ------------------------------------------------------------ | ---------------- |\n| id            | string                | 是                                     | 知识库id                                                     | \"正确的知识库ID\" |\n| contentFormat | string                | 是                                     | 文档格式：rawText (允许配置后续分割策略)              | \"rawText\"        |\n| source        | DocumentSource        | 是                                     | 数据来源                                                     |                  |\n| processOption | DocumentProcessOption | 当contentFormat参数配置为rawText时必传 | 文档处理策略                                                 |                  |\n\n`DocumentSource`类定义如下：\n\n```python\nclass DocumentSourceUrlConfig(BaseModel):\n    frequency: int = Field(\n        ...,\n        description=\"更新频率，目前支持的更新频率为-1(不自动更新),1（每天）,3（每3天）,7（每7天）,30（每30天）。\",\n    )\n\nclass DocumentSource(BaseModel):\n    type: str = Field(..., description=\"数据来源类型\", enum=[\"bos\", \"web\"])\n    urls: list[str] = Field(None, description=\"文档URL\")\n    urlDepth: int = Field(None, description=\"url下钻深度，1时不下钻\")\n    urlConfigs: Optional[list[DocumentSourceUrlConfig]] = Field(None, description=\"该字段的长度需要和source、urls字段长度保持一致。\")\n```\n\n`DocumentProcessOption`类及衍生类定义如下：\n\n```python\nclass DocumentProcessOption(BaseModel):\n    template: str = Field(\n        ...,\n        description=\"模板类型，ppt：模版配置—ppt幻灯片, resume：模版配置—简历文档, paper：模版配置—论文文档, custom：自定义配置—自定义切片, default：自定义配置—默认切分\",\n        enum=[\"ppt\", \"paper\", \"qaPair\", \"resume\", \" custom\", \"default\"],\n    )\n    parser: Optional[DocumentChoices] = Field(None, description=\"解析方法(文字提取默认启动，参数不体现，layoutAnalysis版面分析，ocr光学字符识别，pageImageAnalysis文档图片解析，chartAnalysis图表解析，tableAnalysis表格深度解析，按需增加)\")\n    knowledgeAugmentation: Optional[DocumentChoices] = Field(\n        None, description=\"知识增强，faq、spokenQuery、spo、shortSummary按需增加。问题生成:faq、spokenQuery，段落摘要:shortSummary，三元组知识抽取:spo\"\n    )\n    chunker: Optional[DocumentChunker] = Field(None, description=\"分段器类型\")\n\nclass DocumentChoices(BaseModel):\n    choices: list[str] = Field(..., description=\"选择项\")\n\nclass DocumentChunker(BaseModel):\n    choices: list[str] = Field(..., description=\"使用哪些chunker方法 (separator | pattern | onePage)，separator：自定义切片—标识符，pattern：自定义切片—标识符中选择正则表达式，onePage：整文件切片\")\n    prependInfo: list[str] = Field(\n        None,\n        description=\"chunker关联元数据，可选值为title (增加标题), filename(增加文件名)\",\n    )\n    separator: Optional[DocumentSeparator] = Field(None, description=\"分隔符配置\")\n    pattern: Optional[DocumentPattern] = Field(None, description=\"正则表达式\")\n\nclass DocumentSeparator(BaseModel):\n    separators: list[str] = Field(..., description=\"分隔符列表，可以使用分页符\")\n    targetLength: int = Field(..., description=\"分段最大长度\")\n    overlapRate: float = Field(..., description=\"分段重叠最大字数占比，推荐值0.25\")\n\nclass DocumentPattern(BaseModel):\n    markPosition: str = Field(\n        ..., description=\"命中内容放置策略, head：前序切片, tail：后序切片, drop：匹配后丢弃\", enum=[\"head\", \"tail\", \"drop\"]\n    )\n    regex: str = Field(..., description=\"正则表达式\")\n    targetLength: int = Field(..., description=\"分段最大长度\")\n    overlapRate: float = Field(..., description=\"分段重叠最大字数占比，推荐值0.25\")\n```\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nknowledge_base_id = \"your_knowledge_base_id\"\nknowledge = appbuilder.KnowledgeBase()\nknowledge.create_documents(\n\tid=knowledge_base_id,\n\tcontentFormat=\"rawText\",\n\tsource=appbuilder.DocumentSource(\n\t\ttype=\"web\",\n\t\turls=[\"https://baijiahao.baidu.com/s?id=1802527379394162441\"],\n    urlDepth=1,\n    urlConfigs=[appbuilder.DocumentSourceUrlConfig(frequency=1)]\n  ),\n\tprocessOption=appbuilder.DocumentProcessOption(\n\t\ttemplate=\"custom\",\n\t\tparser=appbuilder.DocumentChoices(\n\t\t\tchoices=[\"layoutAnalysis\", \"ocr\"]\n\t\t),\n\t\tchunker=appbuilder.DocumentChunker(\n\t\t\tchoices=[\"separator\"],\n\t\t\tseparator=appbuilder.DocumentSeparator(\n\t\t\t\tseparators=[\"。\"],\n\t\t\t\ttargetLength=300,\n\t\t\t\toverlapRate=0.25,\n      ),\n\t\t\tprependInfo=[\"title\", \"filename\"],\n\t\t),\n\t\tknowledgeAugmentation=appbuilder.DocumentChoices(choices=[\"faq\"]),\n\t),\n)\n```\n\n### 8、 上传文档到知识库`upload_documents(file_path: str, content_format: str = \"rawText\", id: Optional[str] = None, processOption: DocumentProcessOption = None)`\n\n#### 方法参数\n\n| 参数名称       | 参数类型              | 是否必传 | 描述                                                         | 示例值           |\n| -------------- | --------------------- | -------- | ------------------------------------------------------------ | ---------------- |\n| file_path      | string                | 是       | 文件路径                                                     | \"正确的文件路径\" |\n| content_format | string                | 否       | 文档格式：rawText (允许配置后续分割策略) | \"rawText\"        |\n| id             | string                | 是       | 知识库ID                                                     | \"正确的知识库ID\" |\n| processOption  | DocumentProcessOption | 是       | 文档处理策略                                                 |                  |\n\n`DocumentProcessOption`类及衍生类定义如下：\n\n```python\nclass DocumentProcessOption(BaseModel):\n    template: str = Field(\n        ...,\n        description=\"模板类型，ppt: 模版配置—ppt幻灯片, resume：模版配置—简历文档, paper：模版配置—论文文档, custom：自定义配置—自定义切片, default：自定义配置—默认切分\",\n        enum=[\"ppt\", \"paper\", \"qaPair\", \"resume\", \" custom\", \"default\"],\n    )\n    parser: Optional[DocumentChoices] = Field(None, description=\"解析器类型\")\n    knowledgeAugmentation: Optional[DocumentChoices] = Field(\n        None, description=\"知识增强，faq、spokenQuery、spo、shortSummary按需增加。问题生成:faq、spokenQuery，段落摘要:shortSummary，三元组知识抽取:spo\"\n    )\n    chunker: Optional[DocumentChunker] = Field(None, description=\"分段器类型\")\n\nclass DocumentChoices(BaseModel):\n    choices: list[str] = Field(..., description=\"选择项\")\n\nclass DocumentChunker(BaseModel):\n    choices: list[str] = Field(..., description=\"使用哪些chunker方法 (separator | pattern | onePage), separator：自定义切片—标识符，pattern：自定义切片—标识符中选择正则表达式，onePage：整文件切片\")\n    prependInfo: list[str] = Field(\n        ...,\n        description=\"chunker关联元数据，可选值为title (增加标题), filename(增加文件名)\",\n    )\n    separator: Optional[DocumentSeparator] = Field(..., description=\"分段符号\")\n    pattern: Optional[DocumentPattern] = Field(None, description=\"正则表达式\")\n\nclass DocumentSeparator(BaseModel):\n    separators: list[str] = Field(..., description=\"分段符号\")\n    targetLength: int = Field(..., description=\"分段最大长度\")\n    overlapRate: float = Field(..., description=\"分段重叠最大字数占比，推荐值0.25\")\n\nclass DocumentPattern(BaseModel):\n    markPosition: str = Field(\n        ..., description=\"命中内容放置策略, head：前序切片, tail：后序切片, drop：匹配后丢弃\", enum=[\"head\", \"tail\", \"drop\"]\n    )\n    regex: str = Field(..., description=\"正则表达式\")\n    targetLength: int = Field(..., description=\"分段最大长度\")\n    overlapRate: float = Field(..., description=\"分段重叠最大字数占比，推荐值0.25\")\n\n```\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nknowledge_base_id = \"your_knowledge_base_id\"\nknowledge = appbuilder.KnowledgeBase()\nknowledge.upload_documents(\n\tid=knowledge_base_id,\n\tcontent_format=\"rawText\",\n\tfile_path=\"./python/tests/data/qa_appbuilder_client_demo.pdf\",\n\tprocessOption=appbuilder.DocumentProcessOption(\n\t\ttemplate=\"custom\",\n\t\tparser=appbuilder.DocumentChoices(\n\t\t\tchoices=[\"layoutAnalysis\", \"ocr\"]\n\t\t),\n\t\tchunker=appbuilder.DocumentChunker(\n\t\t\tchoices=[\"separator\"],\n\t\t\tseparator=appbuilder.DocumentSeparator(\n\t\t\t\tseparators=[\"。\"],\n\t\t\t\ttargetLength=300,\n\t\t\t\toverlapRate=0.25,\n      ),\n\t\t\tprependInfo=[\"title\", \"filename\"],\n\t\t),\n\t\tknowledgeAugmentation=appbuilder.DocumentChoices(choices=[\"faq\"]),\n\t),\n)\n```\n\n### 9、从知识库删除文档 `KnowledgeBase().delete_document()->KnowledgeBaseDeleteDocumentResponse`\n\n#### 方法参数\n| 参数名称    | 参数类型 | 是否必传 | 描述           | 示例值                                 |\n| ----------- | -------- | -------- | -------------- | -------------------------------------- |\n| document_id | string   | 是       | 待删除的文档ID | '5e0eb279-7688-4100-95d1-241f3d19xxxx' |\n\n#### 方法返回值\n\n方法返回 `KnowledgeBaseDeleteDocumentResponse`, 该类的定义是\n\n```python\nclass KnowledgeBaseDeleteDocumentResponse(BaseModel):\n    request_id: str = Field(..., description=\"请求ID\")\n```\n\n#### 方法示例\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\n\nupload_res = my_knowledge.upload_file(\"./test.txt\")\nprint(\"文件上传结果: \",upload_res)\n\nadd_res = my_knowledge.add_document(content_type='raw_text', file_ids=[upload_res.id])\nprint(\"添加文档结果: \",add_res)\n\ndelete_res = my_knowledge.delete_document(document_id=add_res.document_ids[0])\nprint(\"删除文档结果: \",delete_res)\n\n# 知识库ID:  da51a988-cbe7-4b24-aa5b-768985e8xxxx\n# 文件上传结果: request_id='255eec22-ec87-4564-bdeb-3e5623eaxxxx' id='ef12119b-d5be-492a-997c-77f8e84axxxx' name='test.txt'\n# 添加文档结果: request_id='412e1630-b570-47c9-a042-caf3cd9dxxxx' knowledge_base_id='da51a988-cbe7-4b24-aa5b-768985e8xxxx' document_ids=['5e0eb279-7688-4100-95d1-241f3d19xxxx']\n# 删除文档结果: request_id='ba0e8bc0-b799-45b5-bdac-0d4c50e2xxxx'\n```\n\n### 10、获取知识库的文档列表`KnowledgeBase().get_documents_list()->KnowledgeBaseGetDocumentsListResponse` \n\n#### 方法参数\n| 参数名称 | 参数类型 | 是否必传 | 描述                                                         | 示例值                                 |\n| -------- | -------- | -------- | ------------------------------------------------------------ | -------------------------------------- |\n| limit    | int      | 否       | 单次请求列表获得的文档数量,最大100                           | 10                                     |\n| after    | str      | 否       | 用于分页的游标。after 是一个文档的id，它定义了在列表中的位置。例如，如果你发出一个列表请求并收到 10个对象，以 app_id_123 结束，那么你后续的调用可以包含 after=app_id_123 以获取列表的下一页数据。默认为空 | '5e0eb279-7688-4100-95d1-241f3d19xxxx' |\n| before   | str      | 否       | 用于分页的游标。与after相反，填写它将获取前一页数据,如果和after都传，两个参数都会起到分页效果，默认为空 | '5e0eb279-7688-4100-95d1-241f3d19xxxx' |\n\n#### 方法返回值\n\n方法返回类`KnowledgeBaseGetDocumentsListResponse`，定义为\n```python\nclass KnowledgeBaseGetDocumentsListResponse(BaseModel):\n    request_id: str = Field(..., description=\"请求ID\")\n    data: list[Document] = Field([], description=\"文档信息列表\")\n```\n\n衍生类`Document`以及`DocumentMeta`定义为：\n```python\nclass Document(BaseModel):\n    id: str = Field(..., description=\"文档ID\")\n    name: str = Field(..., description=\"文档名称\")\n    created_at: str = Field(..., description=\"文档创建时间\")\n    word_count: int = Field(..., description=\"文档字数\")\n    enabled: bool = Field(True, description=\"文档是否可用\")\n    meta: Optional[DocumentMeta] = Field(..., description=\"文档元信息，包括source、file_id\")\n\nclass DocumentMeta(BaseModel):\n    source: Optional[str] = Field(None, description=\"文档来源\")\n    file_id: Optional[str] = Field(None, description=\"文档对应的文件ID\")\n    url: Optional[str] = Field(None, description=\"原文件下载链接\")\n    mime_type: Optional[str] = Field(\n        None,\n        description=\"文件类型，目前支持doc/txt/docx/pdf/ppt/pptx/xlsx/xls/csv/json这几种文件类型。如果是通过url方式导入的文档，该值为url\",\n    )\n    file_size: Optional[int] = Field(None, description=\"文件大小，单位bytes\")\n```\n\n\n#### 方法示例\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\n\nlist_res = my_knowledge.get_documents_list()\nprint(\"文档列表: \", list_res)\n\n# 知识库ID:  da51a988-cbe7-4b24-aa5b-768985e8xxxx\n# 文档列表: request_id='f66c2193-6035-4022-811b-c4cd7743xxxx' data=[{'id': '8f388b10-5e6a-423f-8acc-dd5fdc2fxxxx', 'name': 'test.txt', 'created_at': 1719988868, 'word_count': 16886, 'enabled': True, 'meta': {'source': 'upload_file', 'file_id': '0ebb03fb-ea48-4c49-b494-cf0cec11xxxx'}}, {'id': '5e0eb279-7688-4100-95d1-241f3d19xxxx', 'name': 'test.txt', 'created_at': 1719987921, 'word_count': 16886, 'enabled': True, 'meta': {'source': 'upload_file', 'file_id': '059e2ae2-1e3c-43ea-8b42-5d988f93xxxx'}}]\n```\n\n### 11、获取知识库全部文档`KnowledgeBase().get_all_documents()->list`\n\n#### 方法参数\n| 参数名称          | 参数类型 | 是否必传 | 描述         | 示例值           |\n| ----------------- | -------- | -------- | ------------ | ---------------- |\n| knowledge_base_id | string   | 是       | 线上知识库ID | \"正确的知识库ID\" |\n\n#### 方法返回值\n\nlist 数据类型`list[Document]`\n\n衍生类`Document`以及`DocumentMeta`定义为：\n```python\nclass Document(BaseModel):\n    id: str = Field(..., description=\"文档ID\")\n    name: str = Field(..., description=\"文档名称\")\n    created_at: str = Field(..., description=\"文档创建时间\")\n    word_count: int = Field(..., description=\"文档字数\")\n    enabled: bool = Field(True, description=\"文档是否可用\")\n    meta: Optional[DocumentMeta] = Field(..., description=\"文档元信息，包括source、file_id\")\n\nclass DocumentMeta(BaseModel):\n    source: Optional[str] = Field(None, description=\"文档来源\")\n    file_id: Optional[str] = Field(None, description=\"文档对应的文件ID\")\n    url: Optional[str] = Field(None, description=\"原文件下载链接\")\n    mime_type: Optional[str] = Field(\n        None,\n        description=\"文件类型，目前支持doc/txt/docx/pdf/ppt/pptx/xlsx/xls/csv/json这几种文件类型。如果是通过url方式导入的文档，该值为url\",\n    )\n    file_size: Optional[int] = Field(None, description=\"文件大小，单位bytes\")\n```\n\n#### 方法示例\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\n\ndoc_list = my_knowledge.get_all_documents(my_knowledge_base_id)\nfor message in doc_list:\n    print(message)\n```\n\n### 12. 创建切片`create_chunk(documentId: str, content: str) -> CreateChunkResponse`\n\n#### 方法参数\n\n| 参数名称        | 参数类型 | 是否必传 | 描述     | 示例值         |\n| --------------- | -------- | -------- | -------- | -------------- |\n| knowledgeBaseId | string   | 是       | 知识库ID |                |\n| documentId      | string   | 是       | 文档ID   | \"正确的文档ID\" |\n| content         | string   | 是       | 切片内容 | \"内容\"         |\n\n#### 方法返回值\n\n`CreateChunkResponse`类定义如下：\n\n```python\nclass CreateChunkResponse(BaseModel):\n    id: str = Field(..., description=\"切片ID\")\n```\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\nresp = my_knowledge.create_chunk(\"your_document_id\", \"content\", knowledgebase_id=knowledge_base_id)\nprint(\"切片ID: \", resp.id)\nchunk_id = resp.id\n```\n\n### 13. 修改切片信息`modify_chunk(chunkId: str, content: str, enable: bool)`\n\n#### 方法参数\n\n| 参数名称   | 参数类型 | 是否必传     | 描述         | 示例值         |\n| ---------- | -------- | ------------ | -------------- | -------------- |\n| knowledgeBaseId | string | 是 | 知识库ID |  |\n| chunkId | string   | 是      | 文档ID       | \"正确的切片ID\" |\n| content    | string   | 是    | 切片内容     | \"内容\"         |\n| enable     | bool     | 是 | 是否用该切片 | True          |\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\nmy_knowledge.modify_chunk(\"your_chunk_id\", \"content\", True, knowledgebase_id=my_knowledge_base_id)\n```\n\n### 14. 删除切片`delete_chunk(chunkId: str)`\n\n#### 方法参数\n\n| 参数名称        | 参数类型 | 是否必传 | 描述     | 示例值         |\n| --------------- | -------- | -------- | -------- | -------------- |\n| knowledgeBaseId | string   | 是       | 知识库ID |                |\n| chunkId         | string   | 是       | 文档ID   | \"正确的切片ID\" |\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\nmy_knowledge.delete_chunk(\"your_chunk_id\", knowledgebase_id=my_knowledge_base_id)\n```\n\n### 15. 获取切片信息`describe_chunk(chunkId: str)`\n\n#### 方法参数\n\n| 参数名称        | 参数类型 | 是否必传 | 描述     | 示例值         |\n| --------------- | -------- | -------- | -------- | -------------- |\n| knowledgeBaseId | string   | 是       | 知识库ID |                |\n| chunkId         | string   | 是       | 文档ID   | \"正确的切片ID\" |\n\n#### 方法返回值\n\n`DescribeChunkResponse`类定义如下:\n\n```python\nclass DescribeChunkResponse(BaseModel):\n    id: str = Field(..., description=\"切片ID\")\n    type: str = Field(..., description=\"切片类型\")\n    knowledgeBaseId: str = Field(..., description=\"知识库ID\")\n    documentId: str = Field(..., description=\"文档ID\")\n    content: str = Field(..., description=\"文档内容\")\n    enabled: bool = Field(..., description=\"是否启用\")\n    wordCount: int = Field(..., description=\"切片内字符数量\")\n    tokenCount: int = Field(..., description=\"切片内token数量\")\n    status: str = Field(..., description=\"切片状态\")\n    statusMessage: str = Field(..., description=\"切片状态信息\")\n    imageUrls: list[str] = Field(..., description=\"图片地址\")\n    createTime: int = Field(..., description=\"创建时间\")\n    updateTime: int = Field(None, description=\"更新时间\")\n```\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\nresp = my_knowledge.describe_chunk(\"your_chunk_id\", knowledgebase_id=my_knowledge_base_id)\nprint(\"切片详情：\")\nprint(resp)\n```\n\n### 16. 获取切片列表`describe_chunks(documentId: str, marker: str = None, maxKeys: int = None, type: str = None) -> DescribeChunksResponse`\n\n#### 方法参数\n\n| 参数名称        | 参数类型 | 是否必传 | 描述                                                         | 示例值         |\n| --------------- | -------- | -------- | ------------------------------------------------------------ | -------------- |\n| knowledgeBaseId | string   | 是       | 知识库ID                                                     |                |\n| documentId      | string   | 是       | 文档ID                                                       | \"正确的文档ID\" |\n| marker          | string   | 否       | 起始位置，切片ID                                             | \"正确的切片ID\" |\n| maxKeys         | string   | 否       | 返回文档数量大小，默认10，最大值100                          | 10             |\n| type            | string   | 否       | 根据类型获取切片列表(RAW、NEW、COPY)，RAW：原文切片，NEW：新增切片，COPY：复制切片 | \"RAW\"          |\n| keyword         | string   | 否       | 根据关键字模糊匹配切片，最大长度2000字符。                   | \"test\"         |\n\n#### 方法返回值\n\n`DescribeChunksResponse` 类定义如下：\n\n```python\nclass DescribeChunksResponse(BaseModel):\n    data: list[DescribeChunkResponse] = Field(..., description=\"切片列表\")\n    marker: str = Field(..., description=\"起始位置\")\n    isTruncated: bool = Field(\n        ..., description=\"true表示后面还有数据，false表示已经是最后一页\"\n    )\n    nextMarker: str = Field(..., description=\"下一页起始位置\")\n    maxKeys: int = Field(..., description=\"本次查询包含的最大结果集数量\")\n```\n\n衍生类`DescribeChunkResponse`定义如下：\n\n```python\nclass DescribeChunkResponse(BaseModel):\n    id: str = Field(..., description=\"切片ID\")\n    type: str = Field(..., description=\"切片类型\")\n    knowledgeBaseId: str = Field(..., description=\"知识库ID\")\n    documentId: str = Field(..., description=\"文档ID\")\n    content: str = Field(..., description=\"文档内容\")\n    enabled: bool = Field(..., description=\"是否启用\")\n    wordCount: int = Field(..., description=\"切片内字符数量\")\n    tokenCount: int = Field(..., description=\"切片内token数量\")\n    status: str = Field(..., description=\"切片状态\")\n    statusMessage: str = Field(..., description=\"切片状态信息\")\n    imageUrls: list[str] = Field(..., description=\"图片地址\")\n    createTime: int = Field(..., description=\"创建时间\")\n    updateTime: int = Field(None, description=\"更新时间\")\n```\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nmy_knowledge_base_id = \"your_knowledge_base_id\"\nmy_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\nprint(\"知识库ID: \", my_knowledge.knowledge_id)\nresp = my_knowledge.describe_chunks(\"your_document_id\", knowledgebase_id=my_knowledge_base_id)\nprint(\"切片列表：\")\nprint(resp)\n```\n\n### 17. 知识库检索`query_knowledge_base(query: str, knowledgebase_ids: list[str], type: Optional[data_class.QueryType] = None, metadata_filters: data_class.MetadataFilter = None,pipeline_config: data_class.QueryPipelineConfig = None, rank_score_threshold: Optional[float] = 0.4, top: int = 6, skip: int = None) -> data_class.QueryKnowledgeBaseResponse`\n\n#### 方法参数\n\n| 参数名称        | 参数类型 | 是否必传 | 描述                                                         | 示例值         |\n| --------------- | -------- | -------- | ------------------------------------------------------------ | -------------- |\n| query | string   | 是       | 检索query，最长为1024字符，超过自动截断                                                   |民法典第三条                |\n| knowledgebase_ids      | list[str]   | 是       | 指定知识库的id集合                                                       | [\"kb-1\", \"kb-2\"] |\n| type          | string   | 否       | 检索策略。<br>可选值：<br>* fulltext，全文检索<br>* semantic，语义检索<br>* hybird，混合检索| \"fulltext\" |\n| metadata_filters         | data_class.MetadataFilters | 否       | 元数据过滤条件，详细见MetadataFilters                          | -             |\n| pipeline_config            | data_class.QueryPipelineConfig   | 否       | 检索配置，详细见QueryPipelineConfig | -          |\n| rank_score_threshold         | float   | 否       | 重排序匹配分阈值，只有rank_score大于等于该分值的切片重排序时才会被筛选出来。<br>当且仅当，pipeline_config中配置了ranking节点时，该过滤条件生效。<br>取值范围： [0, 1]。<br>默认0.4                          | 0.4             |\n| top            | int   | 否       | 返回前多少的条目。默认值6。如果检索结果的数量未达到top值，则按实际检索到的结果数量返回 | 6          |\n| skip         | int   | 否       | 跳过条目数（通过top和skip可以实现类似分页的效果，比如top 10 skip 0，取第一页的10个，top 10 skip 10，取第二页的10个）| 0             |\n\n`data_class.MetadataFilters` 类定义如下：\n\n```python\nclass MetadataFilters(BaseModel):\n    filters: list[MetadataFilter] = Field(..., description=\"过滤条件\")\n    condition: str = Field(..., description=\"文档组合条件。and:与，or:或\")\n```\n\n`data_class.MetadataFilter` 类定义如下：\n\n```python\nclass MetadataFilter(BaseModel):\n    operator: str = Field(..., description=\"操作符名称。==:等于，in:在数组中，not_in:不在数组中\")\n    field: str = Field(None, description=\"字段名，目前支持doc_id\")\n    value: Union[str, list[str]] = Field(\n        ..., description=\"字段值，如果是in操作符，value为数组\"\n    )\n```\n\n\n`data_class.QueryPipelineConfig` 类定义如下：\n\n```python\nclass QueryPipelineConfig(BaseModel):\n    id: str = Field(\n        None, description=\"配置唯一标识，如果用这个id，则引用已经配置好的QueryPipeline\"\n    )\n    pipeline: list[Union[ElasticSearchRetrieveConfig, RankingConfig, VectorDBRetrieveConfig, SmallToBigConfig]] = Field(\n        None, description=\"配置的Pipeline，如果没有用id，可以用这个对象指定一个新的配置\"\n    )\n```\n\n`data_class.ElasticSearchRetrieveConfig` 类定义如下：\n\n```python\nclass ElasticSearchRetrieveConfig(BaseModel): # 托管资源为共享资源 或 BES资源时使用该配置\n    name: str = Field(..., description=\"配置名称\")\n    type: str = Field(None, description=\"elastic_search标志，该节点为es全文检索\")\n    threshold: float = Field(None, description=\"得分阈值，默认0.1\")\n    top: int = Field(None, description=\"召回数量，默认400\")\n```\n\n`data_class.RankingConfig` 类定义如下：\n\n```python\nclass RankingConfig(BaseModel):\n    name: str = Field(..., description=\"配置名称\")\n    type: str = Field(None, description=\"ranking标志，该节点为ranking节点\")\n    inputs: list[str] = Field(\n        ...,\n        description='输入的节点名，如es检索配置的名称为pipeline_001，则该inputs为[\"pipeline_001\"]',\n    )\n    model_name: str = Field(None, description=\"ranking模型名（当前仅一种，暂不生效）\")\n    top: int = Field(None, description=\"取切片top进行排序，默认20，最大400\")\n```\n\n`data_class.VectorDBRetrieveConfig` 类定义如下：\n\n```python\nclass VectorDBRetrieveConfig(BaseModel):\n    name: str = Field(..., description=\"该节点的自定义名称。\")\n    type: str = Field(\"vector_db\", description=\"该节点的类型，默认为vector_db。\")\n    threshold: Optional[float] = Field(0.1, description=\"得分阈值。取值范围：[0, 1]\", ge=0.0, le=1.0)\n    top: Optional[int] = Field(400, description=\"召回数量。取值范围：[0, 800]\", ge=0, le=800)\n    pre_ranking: Optional[PreRankingConfig] = Field(None, description=\"粗排配置\")\n```\n\n`data_class.PreRankingConfig` 类定义如下：\n\n```python\nclass PreRankingConfig(BaseModel):\n    bm25_weight: float = Field(\n        None, description=\"粗排bm25比重，取值范围在 [0, 1]，默认0.75\"\n    )\n    vec_weight: float = Field(\n        None, description=\"粗排向量余弦分比重，取值范围在 [0, 1]，默认0.25\"\n    )\n    bm25_b: float = Field(\n        None, description=\"控制文档长度对评分影响的参数，取值范围在 [0, 1]，默认0.75\"\n    )\n    bm25_k1: float = Field(\n        None,\n        description=\"词频饱和因子，控制词频（TF）对评分的影响，常取值范围在 [1.2, 2.0]，默认1.5\",\n    )\n    bm25_max_score: float = Field(\n        None, description=\"得分归一化参数，不建议修改，默认50\"\n    )\n```\n\n#### 方法返回值\n\n`data_class.QueryKnowledgeBaseResponse` 类定义如下：\n\n```python\nclass QueryKnowledgeBaseResponse(BaseModel):\n    requestId: str = Field(None, description=\"请求ID\")\n    code: str = Field(None, description=\"状态码\")\n    message: str = Field(None, description=\"状态信息\")\n    chunks: list[Chunk] = Field(..., description=\"切片列表\")\n    total_count: int = Field(..., description=\"切片总数\")\n```\n\n衍生类`Chunk`定义如下：\n\n```python\nclass Chunk(BaseModel):\n    chunk_id: str = Field(..., description=\"切片ID\")\n    knowledgebase_id: str = Field(..., description=\"知识库ID\")\n    document_id: str = Field(..., description=\"文档ID\")\n    document_name: str = Field(None, description=\"文档名称\")\n    meta: dict = Field(None, description=\"文档元数据\")\n    chunk_type: str = Field(..., description=\"切片类型\")\n    content: str = Field(..., description=\"切片内容\")\n    create_time: datetime = Field(..., description=\"创建时间\")\n    update_time: datetime = Field(..., description=\"更新时间\")\n    retrieval_score: float = Field(..., description=\"粗检索得分\")\n    rank_score: float = Field(..., description=\"rerank得分\")\n    locations: ChunkLocation = Field(None, description=\"切片位置\")\n    children: List[Chunk] = Field(None, description=\"子切片\")\n```\n\n#### 方法示例\n\n```python\nimport os\nimport appbuilder\nos.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\nknowledge = appbuilder.KnowledgeBase()\nclient = appbuilder.KnowledgeBase()\nres = client.query_knowledge_base(\n    query=\"民法典第三条\",\n    type=\"fulltext\",\n    knowledgebase_ids=[\"70c6375a-1595-41f2-9a3b-e81bc9060b7f\"],\n    top=5,\n    skip=0,\n    metadata_filters=data_class.MetadataFilters(filters=[], condition=\"or\"),\n    pipeline_config=data_class.QueryPipelineConfig(\n        id=\"pipeline_001\",\n        pipeline=[\n            {\n                \"name\": \"step1\",\n                \"type\": \"elastic_search\",\n                \"threshold\": 0.1,\n                \"top\": 400,\n                \"pre_ranking\": {\n                    \"bm25_weight\": 0.25,\n                    \"vec_weight\": 0.75,\n                    \"bm25_b\": 0.75,\n                    \"bm25_k1\": 1.5,\n                    \"bm25_max_score\": 50,\n                },\n            },\n            {\n                \"name\": \"step2\",\n                \"type\": \"ranking\",\n                \"inputs\": [\"step1\"],\n                \"model_name\": \"ranker-v1\",\n                \"top\": 20,\n            },\n        ],\n    ),\n)\nchunk_id = res.chunks[0].chunk_id\nfor chunk in res.chunks:\n    print(chunk.content)\n```\n\n### Java基本用法\n\n#### 方法及各方法入参/出参\n\n参考 `python KnowledgeBase`接口文档\n\n\n#### 示例代码\n```java\npublic class KnowledgebaseTest {\n    @Before\n    public void setUp() {\n        System.setProperty(\"APPBUILDER_TOKEN\",\"\");\n        System.setProperty(\"APPBUILDER_LOGLEVEL\", \"DEBUG\");\n    }\n    \n    @Test\n    public void testDocument() throws IOException, AppBuilderServerException {\n        // 实例化Knowledgebase\n        String knowledgeBaseId  = \"\";\n        Knowledgebase knowledgebase = new Knowledgebase();\n\n        // 获取知识库文档列表\n        DocumentListRequest listRequest = new DocumentListRequest(); \n        listRequest.setKonwledgeBaseId(knowledgeBaseId);\n        listRequest.setLimit(10);\n        Document[] documents = knowledgebase.getDocumentList(listRequest);\n\n        // 从知识库删除文档\n        DocumentDeleteRequest deleteRequest = new DocumentDeleteRequest();\n        deleteRequest.setKonwledgeBaseId(knowledgeBaseId);\n        deleteRequest.setDocumentId(\"期望删除的DocumentId\");\n        knowledgebase.deleteDocument(deleteRequest);\n    }\n  \n    @Test\n    public void testCreateKnowledgebase() throws IOException, AppBuilderServerException {\n        Knowledgebase knowledgebase = new Knowledgebase();\n        KnowledgeBaseDetail request = new KnowledgeBaseDetail();\n        request.setName(\"test_knowledgebase\");\n        request.setDescription(\"test_knowledgebase\");\n\n        // 创建知识库\n        KnowledgeBaseConfig.Index index = new KnowledgeBaseConfig.Index(\"public\",\n                \"\", \"\", \"\", \"\");\n        KnowledgeBaseConfig config = new KnowledgeBaseConfig(index);\n        request.setConfig(config);\n        KnowledgeBaseDetail response = knowledgebase.createKnowledgeBase(request);\n        String knowledgeBaseId = response.getId();\n        System.out.println(knowledgeBaseId);\n        assertNotNull(response.getId());\n\n        // 获取知识库详情\n        KnowledgeBaseDetail detail = knowledgebase.getKnowledgeBaseDetail(knowledgeBaseId);\n        System.out.println(detail.getId());\n        assertNotNull(detail.getId());\n\n        // 获取知识库列表\n        KnowledgeBaseListRequest listRequest =\n                new KnowledgeBaseListRequest(knowledgeBaseId, 10, null);\n        KnowledgeBaseListResponse knowledgeBases = knowledgebase.getKnowledgeBaseList(listRequest);\n        System.out.println(knowledgeBases.getMarker());\n        assertNotNull(knowledgeBases.getMarker());\n\n        // 更新知识库\n        KnowledgeBaseModifyRequest modifyRequest = new KnowledgeBaseModifyRequest();\n        modifyRequest.setKnowledgeBaseId(knowledgeBaseId);\n        modifyRequest.setName(\"test_knowledgebase2\");\n        modifyRequest.setDescription(knowledgeBaseId);\n        knowledgebase.modifyKnowledgeBase(modifyRequest);\n\n        // 导入知识库\n        DocumentsCreateRequest.Source source = new DocumentsCreateRequest.Source(\"web\",\n                new String[] {\"https://baijiahao.baidu.com/s?id=1802527379394162441\"}, 1);\n        DocumentsCreateRequest.ProcessOption.Parser parser =\n                new DocumentsCreateRequest.ProcessOption.Parser(\n                        new String[] {\"layoutAnalysis\", \"ocr\"});\n        DocumentsCreateRequest.ProcessOption.Chunker.Separator separator =\n                new DocumentsCreateRequest.ProcessOption.Chunker.Separator(new String[] {\"。\"}, 300,\n                        0.25);\n        DocumentsCreateRequest.ProcessOption.Chunker chunker =\n                new DocumentsCreateRequest.ProcessOption.Chunker(new String[] {\"separator\"},\n                        separator, null, new String[] {\"title\", \"filename\"});\n        DocumentsCreateRequest.ProcessOption.KnowledgeAugmentation knowledgeAugmentation =\n                new DocumentsCreateRequest.ProcessOption.KnowledgeAugmentation(\n                        new String[] {\"faq\"});\n        DocumentsCreateRequest.ProcessOption processOption =\n                new DocumentsCreateRequest.ProcessOption(\"custom\", parser, chunker,\n                        knowledgeAugmentation);\n        DocumentsCreateRequest documentsCreateRequest =\n                new DocumentsCreateRequest(knowledgeBaseId, \"rawText\", source, processOption);\n        knowledgebase.createDocuments(documentsCreateRequest);\n\n        // 上传文档\n        String filePath = \"src/test/java/com/baidubce/appbuilder/files/test.pdf\";\n        DocumentsCreateRequest.Source source2 =\n                new DocumentsCreateRequest.Source(\"file\", null, null);\n        DocumentsCreateRequest documentsCreateRequest2 =\n                new DocumentsCreateRequest(knowledgeBaseId, \"rawText\", source2, processOption);\n        knowledgebase.uploadDocuments(filePath, documentsCreateRequest2);\n\n        // 删除知识库\n        knowledgebase.deleteKnowledgeBase(knowledgeBaseId);\n    }\n  \n    @Test\n    public void testCreateChunk() throws IOException, AppBuilderServerException {\n        String documentId = \"\";\n        // 知识库ID\n        String knowledgeBaseId = \"\";\n        // Appbuilder Token\n        String secretKey = \"\";\n        Knowledgebase knowledgebase = new Knowledgebase(knowledgeBaseID, secretKey);\n        // 创建切片\n        String chunkId = knowledgebase.createChunk(documentId, \"test\");\n        // 修改切片\n        knowledgebase.modifyChunk(chunkId, \"new test\", true);\n        // 获取切片详情\n        knowledgebase.describeChunk(chunkId);\n        // 获取切片列表\n        knowledgebase.describeChunks(documentId, chunkId, 10, null);\n        // 删除切片\n        knowledgebase.deleteChunk(chunkId);\n    }\n}\n```\n\n### Go基本用法\n\n#### 方法及各方法入参/出参\n\n参考 `python KnowledgeBase`接口文档\n\n\n#### 示例代码\n\n```Go\npackage appbuilder\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestKnowledgeBase(t *testing.T) {\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n    // 实例化KnowledgeBase\n\tknowledgeBaseID := \"\"\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBase(config)\n\tif err != nil {\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\n    // 获取知识库中的文档列表\n\tdocumentsRes, err := client.GetDocumentList(GetDocumentListRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"create document failed: %v\", err)\n\t}\n\tfmt.Println(documentsRes)\n\n    // 从知识库中删除文档\n\terr = client.DeleteDocument(DeleteDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tDocumentID:      \"期望删除的DocumentID\"})\n\tif err != nil {\n\t\tt.Fatalf(\"delete document failed: %v\", err)\n\t}\n}\n\nfunc TestCreateKnowledgeBase(t *testing.T) {\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"\")\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBase(config)\n\tif err != nil {\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\n\t// 创建知识库\n\tcreateKnowledgeBaseRes, err := client.CreateKnowledgeBase(KnowledgeBaseDetail{\n\t\tName:        \"test-go\",\n\t\tDescription: \"test-go\",\n\t\tConfig: &KnowlegeBaseConfig{\n\t\t\tIndex: KnowledgeBaseConfigIndex{\n\t\t\t\tType:     \"public\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"create knowledge base failed: %v\", err)\n\t}\n\tknowledgeBaseID := createKnowledgeBaseRes.ID\n\tfmt.Println(knowledgeBaseID)\n\n\t// 获取知识库详情\n\tgetKnowledgeBaseRes, err := client.GetKnowledgeBaseDetail(knowledgeBaseID)\n\tif err != nil {\n\t\tt.Fatalf(\"get knowledge base failed: %v\", err)\n\t}\n\tfmt.Println(getKnowledgeBaseRes)\n\n\t// 获取知识库列表\n\tknowledgeBaseListRes, err := client.GetKnowledgeBaseList(\n\t\tGetKnowledgeBaseListRequest{\n\t\t\tMarker: knowledgeBaseID,\n\t\t},\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"get knowledge base list failed: %v\", err)\n\t}\n\tfmt.Println(knowledgeBaseListRes)\n\n\t// 导入知识库\n\terr = client.CreateDocuments(CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType:     \"web\",\n\t\t\tUrls:     []string{\"https://baijiahao.baidu.com/s?id=1802527379394162441\"},\n\t\t\tUrlDepth: 1,\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"create documents failed: %v\", err)\n\t}\n\n\t// 上传知识库文档\n\terr = client.UploadDocuments(\"./files/test.pdf\", CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType: \"file\",\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"upload documents failed: %v\", err)\n\t}\n\n\t// 修改知识库\n\tname := \"test-go\"\n\tdescription := \"22\"\n\terr = client.ModifyKnowledgeBase(ModifyKnowlegeBaseRequest{\n\t\tID:          knowledgeBaseID,\n\t\tName:        &name,\n\t\tDescription: &description,\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"modify knowledge base failed: %v\", err)\n\t}\n\n\t// 删除知识库\n\terr = client.DeleteKnowledgeBase(knowledgeBaseID)\n\tif err != nil {\n\t\tt.Fatalf(\"delete knowledge base failed: %v\", err)\n\t}\n}\n\nfunc TestChunk(t *testing.T) {\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_TOKEN\", \"\")\n\tdocumentID := \"\"\n  knowledgeBaseID := \"\";\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBaseWithKnowledgeBaseID(knowledgeBaseID, config)\n\tif err != nil {\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\t// 创建切片\n\tchunkID, err := client.CreateChunk(CreateChunkRequest{\n\t\tDocumentID: documentID,\n\t\tContent:    \"test\",\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"create chunk failed: %v\", err)\n\t}\n\tfmt.Println(chunkID)\n\n\t// 修改切片\n\terr = client.ModifyChunk(ModifyChunkRequest{\n\t\tChunkID: chunkID,\n\t\tContent: \"new test\",\n\t\tEnable:  true,\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"modify chunk failed: %v\", err)\n\t}\n\n\t// 获取切片详情\n\tdescribeChunkRes, err := client.DescribeChunk(chunkID)\n\tif err != nil {\n\t\tt.Fatalf(\"describe chunk failed: %v\", err)\n\t}\n\tfmt.Println(describeChunkRes)\n\n\t// 获取切片列表\n\tdescribeChunksRes, err := client.DescribeChunks(DescribeChunksRequest{\n\t\tDocumnetID: documentID,\n\t\tMarker:     chunkID,\n\t\tMaxKeys:    10,\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"describe chunks failed: %v\", err)\n\t}\n\tfmt.Println(describeChunksRes)\n\n\t// 删除切片\n\terr = client.DeleteChunk(chunkID)\n\tif err != nil {\n\t\tt.Fatalf(\"delete chunk failed: %v\", err)\n\t}\n}\n```\n"
  },
  {
    "path": "docs/BasisModule/Trace/Debug.md",
    "content": "# Appbuilder-SDK Debug\n\n## 打印DEBUG日志\n\n开启DEBUG日志，可以打印出更多的日志信息，方便调试，包括且不限于：请求URL、请求头、请求参数等。\n\n```bash\n# 可以设置环境变量开启\n# 开启DEBUG\nexport APPBUILDER_LOGLEVEL=DEBUG\n# 关闭DEBUG\nexport APPBUILDER_LOGLEVEL=INFO\n```\n\n也可以在代码中设置，优先级高于环境变量。\n```python\n# python\nappbuilder.logger.setLoglevel(\"DEBUG\")\n```\n```java\n// java\nSystem.setProperty(\"APPBUILDER_LOGLEVEL\", \"DEBUG\");\n```\n```golang\n// golang\nos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n```\n\n## 指定日志文件\n\n如果需要将日志输出到指定文件，方便落盘。默认输出为标准输出流。\n可以设置环境变量`APPBUILDER_LOGFILE`。\n\n```bash\n# 文件名及路径可以根据实际使用修改\nexport APPBUILDER_LOGFILE=/tmp/appbuilder.log\n```\n\n也可以在代码中设置，优先级高于环境变量。\n\n```python\n# python\nappbuilder.logger.setFilename(\"/tmp/appbuilder.log\")\n```\n\n```java\n// java\nSystem.setProperty(\"APPBUILDER_LOGLFILE\", \"/tmp/appbuilder.log\");\n```\n\n```golang\n// golang\nos.Setenv(\"APPBUILDER_LOGLEVEL\", \"/tmp/appbuilder.log\")\n```\n\n## `setLogConfig`功能\n\nAppbuilder-SDK新增滚动日志功能\n\n主要参数:\n- console_output: 数据类型bool，默认值True，LOG日志是否在控制台输出\n- loglevel: 数据类型str，默认值\"DEBUG\"，LOG日志级别\n- log_path: 数据类型str，默认值\"/tmp\"，默认日志存放路径。\n- file_name: 数据类型str，默认值为进程id，日志名前缀\n- rotate_frequency: 数据类型str，默认值\"MIDNIGHT\"，LOG日志滚动更新时间单位\n    - \"S\": 以秒为单位\n    - \"M\": 以分钟为单位\n    - \"H\": 以小时为单位\n    - \"D\": 以天为时间单位\n    - \"MIDNIGHT\": 每日凌晨更新\n- rotate_interval: 数据类型int，默认值1，LOG日志按时间滚动的参数，默认值为1，与when参数联合使用\n- max_file_size: 数据类型Optional[int]，默认值None，传入`None`或负数会自动更新为系统最大整数`sys.maxsize`，单个滚动的LOG日志文件的最大大小，例：10M即为10\\*1024\\*1024 即需要传入 # 以B为单位\n- total_log_size: 数据类型Optional[int]，默认值None，传入`None`或负数会自动更新为系统最大整数`sys.maxsize`，当前目录下可储存的LOG日志文件的最大大小，例：10M即为10\\*1024\\*1024 # 以B为单位\n- max_log_files: 数据类型Optional[int]，默认值None，传入`None`或负数会自动更新为系统最大整数`sys.maxsize`，当前目录下可储存的LOG日志文件的最大数量\n\n**注意:`setLogConfig`会自动生成error.file_name日志与file_name日志文件分别储存`error`级别日志和`loglevel`级别的日志,且两种日志文件的滚动逻辑是独立的，不相互影响。**\n```python\n# python\nappbuilder.logger.setLogConfig(\n    console_output = False,\n    loglevel=\"DEBUG\"\n    log_path=\"/tmp\",, \n    rotate_frequency=\"MIDNIGHT\", # 每日凌晨更新 \n    rotate_interval=1,\n    max_file_size=100 * 1024 *1024, # 最大日志大小为100MB\n    total_log_size=1024 * 1024 *1024, # 最大储存1GB的日志\n    max_log_files=10, # 当前目录储存的最大LOG日志数 \n    )\n```"
  },
  {
    "path": "docs/BasisModule/Trace/README.md",
    "content": "# Appbuilder Trace 文档\n\n本文档目录包含以下内容\n\n- [Appbuilder Trace跟踪功能基本用法](basic.md)\n- [Phoneix可视化软件的进阶用法](phoenix_method.md)\n- [Appbuilder Trace跟踪功能示例](https://github.com/baidubce/app-builder/blob/master/cookbooks/appbuilder_trace/trace.ipynb)"
  },
  {
    "path": "docs/BasisModule/Trace/basic.md",
    "content": "# Appbuilder-SDK TRACE \n\n## 使用方法\n\n### 启动Phoenix可视化软件\n\n**注意:没有可视化需求的可忽略此步骤**\n\n**如果未安装phoenix，需要先安装phoenix软件(这里提供清华园下载方式)** \n\n```bash\npython3 -m pip install arize-phoenix==4.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple\n```\n\n**启动phoenix服务**\n\n```bash\nappbuilder_trace_server\n```\n\n- 使用ctrl+c停止phoenix服务\n\n### 启动Appbuilder-SDK TRACE\n\n```python\nfrom appbuilder import AppBuilderTracer\ntracer=AppBuilderTracer(\n    enable_phoenix = True,\n    enable_console = False,\n    )\n```\n\n- enable_phoenix:是否启动phoenix可视化跟踪\n- enable_console:是否将trace信息反馈到控制台\n\n```python\n# 启动trace \nimport os\nimport appbuilder\n\ntracer.start_trace()\n\nos.environ[\"APPBUILDER_TOKEN\"] = \"YOUR_APPBUILDER_TOKEN\"\napp_id = \"YOUR_APP_ID\"\n\nbuilder = appbuilder.AppBuilderClient(app_id)\nconversation_id = builder.create_conversation()\nmsg = builder.run(conversation_id=conversation_id, query=\"你可以做什么？\",stream=True)\n\nfor m in msg.content:\n    print(m)\n\n# 结束trace\ntracer.end_trace()\n```\n\n- Phoenix可视化效果\n\n![Phoenix可视化效果](https://bj.bcebos.com/v1/appbuilder-sdk-components/Phoenix%E5%8F%AF%E8%A7%86%E5%8C%96%E7%95%8C%E9%9D%A2%EF%BC%883%EF%BC%89.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A40%3A02Z%2F-1%2Fhost%2F07d2cbfb7dca01972b0f8521418669745ef6987c667747e8cedf0102caa27182)"
  },
  {
    "path": "docs/BasisModule/Trace/phoenix_method.md",
    "content": "# Phoneix可视化软件的进阶用法\n\n## 1. 选择可视化展示的选项\n\n- 点击Columns，选择需要可视化展示的字段\n\n![选择可视化展示的选项](https://bj.bcebos.com/v1/appbuilder-sdk-components/%E4%BF%AE%E6%94%B9phoenix%E5%B1%95%E7%A4%BA%E5%8F%82%E6%95%B0.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T03%3A35%3A17Z%2F-1%2Fhost%2Ff9ff13fb2243ebbf1dd66008977a46def85aec56af5256be3f141fd36b6194c9)\n\n\n## 2. 查看节点关键信息 \n\n- 点击需要查看的节点，查看节点关键信息，Info将展示input、ouput信息\n\n![查看节点关键信息 ](https://bj.bcebos.com/v1/appbuilder-sdk-components/Phoenix%E5%8F%AF%E8%A7%86%E5%8C%96%E7%95%8C%E9%9D%A2%EF%BC%883%EF%BC%89.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T03%3A36%3A11Z%2F-1%2Fhost%2Ffc471ccb9ecbc05eebf41f965e6df52132219f96bf688a46e6b6fa61f598088e)\n\n## 3. 搜索目标节点 \n\n### 依据节点类型搜索\n\n- 点击搜索框，输入节点类型，搜索目标节点(eg: span_kind == 'AGENT')\n- 在Traces界面，只能检索到根节点、在Spans界面，可以检索到所有节点\n\n![依据节点类型搜索](https://bj.bcebos.com/v1/appbuilder-sdk-components/span_kind_find.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A39%3A04Z%2F-1%2Fhost%2F5bb320731860407968af9693c43c5639611776d760769d29077bcb2e968b05d1)\n\n### 依据节点信息检索\n\n- 依据节点信息检索可快速定位到目标节点\n\n![依据节点信息检索](https://bj.bcebos.com/v1/appbuilder-sdk-components/span_value_find.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A39%3A20Z%2F-1%2Fhost%2F43b20f9894586405e65195ebf6f86c21193812ab9ffd59f93287266e1a83ab03)\n\n### 其他多种检索方式\n\n![其他多种检索方式](https://bj.bcebos.com/v1/appbuilder-sdk-components/every_span_find.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-22T04%3A39%3A35Z%2F-1%2Fhost%2Fa9b2dcf361416cf9a3727fc64d86bb370a5f24fc25286c53be15c5ecfd44e7e0)"
  },
  {
    "path": "docs/DevelopGuide/AdvancedDevelopment/README.md",
    "content": "# 开发指引\n\n该文档目录包含以下内容：\n\n- [二次开发基本介绍](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/AdvancedDevelopment/README.md)\n- [AppBuilder SDK 运行环境超参配置说明](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/EnvironmentalParameters/env.md)\n\n\n## 二次开发\n当前已集成Python版本AppBuilder-SDK 0.9.4及相关依赖，方便开发者融入个人已有的大模型应用程序。此部分仍在不断建设中。\n二次开发可以采用官方提供的开发镜像，便于快速安装各种依赖库。也可在镜像中使用已安装的`appbuilder_trace_server`、`appbuilder_bce_deploy`工具。\n``` shell\ndocker pull registry.baidubce.com/appbuilder/appbuilder-sdk-devel:1.1.0\n```"
  },
  {
    "path": "docs/DevelopGuide/ChangeLog/changelog.md",
    "content": "# 版本更新记录\n\n* **2023.12.19 v0.1.0版本发布**：[Release Notes](https://github.com/baidubce/app-builder/releases/tag/0.1.0)\n  * 初始版本发布，基础云组件支持包括BES；AI能力引擎语音、视觉类10个能力，大模型相关RAG、文本生成能力19个。\n* **2024.01.03 v0.2.0版本发布** [Release Notes](https://github.com/baidubce/app-builder/releases/tag/0.2.0)\n  * 核心升级点GBI相关组件新增，v0.1.0遗留问题修复\n* **2024.01.26 v0.3.0版本发布** [Release Notes](https://github.com/baidubce/app-builder/releases/tag/0.3.0)\n  * 新增组件：新增了百度搜索rag组件(RAGwithBaiduSearch)。[Cookbook](https://github.com/baidubce/app-builder/blob/master/cookbooks/rag_with_baidusearch.ipynb)\n  * 模型列表获取：与千帆大模型平台模型名打通，可动态获取当前账号模型名，并在组件中使用[获取模型列表](/docs/basic_module/get_model_list.md)\n  * 可通过官方镜像开发和运行实例代码[二次开发](/docs/develop_guide/README.md)\n* **2024.02.27 v0.4.0版本发布** [Release Note](https://github.com/baidubce/app-builder/releases/tag/0.4.0)\n  * AppBuilder Console SDK发布[知识集合Cookbook](/cookbooks/end2end_application/rag/console_dataset.ipynb)，[RAG调用Cookbook](/cookbooks/end2end_application/rag/rag.ipynb)\n  * 大模型组件新增：Excel2Figure(基于Excel信息画图表)\n  * AI能力引擎组件新增&更新：植物识别、动物识别、表格文字识别V2、手写文字识别、二维码识别、身份证混贴识别、文档矫正识别、图像内容理解、流式TTS\n  * AgentRuntime：新增[Cookbook](/cookbooks/components/agent_runtime.ipynb)\n* **2024.03.13 v0.4.1版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.4.1)\n  * 支持以下功能进行FunctionCall调用：动植物识别、表格文字识别、条形码及二维码识别、身份证混贴识别、手写文字识别、text2image、excel2figure\n* **2024.03.20 v0.5.0版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.5.0)\n  * AgentBuilder ConsoleSDK发布 [Agent调用Cookbook](/cookbooks/end2end_application/agent/appbuilder_client.ipynb)\n  * AI能力引擎组件新增：向量检索-VDB\n  * 支持以下功能进行FunctionCall调用并新增[Cookbook](/cookbooks/components/general_ocr.ipynb)：文本翻译-通用版、通用物体和场景识别-高级版、通用文字识别-高精度版、短语音识别-极速版\n* **2024.03.21 v0.5.1版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.5.1)\n  * 问题修复：修复了在Python 3.8 及以下环境无法使用AgentBuilder ConsoleSDK的问题。同时，在即将发布的0.6.0版本中，将不再提供对Python 3.8及以下环境的支持，请升级Python版本到3.9\n* **2024.04.12 v0.6.0版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.6.0)\n  * AppBuilder Console SDK 支持 JAVA 语言 [AppBuilder Java ConsoleSDK](/java/)\n  * AppBuilder Console SDK 支持 GO 语言 [AppBuilder GO ConsoleSDK](/go/)\n  * 首页README更新，提供免费的公共试用TOKEN，方便开发者快速体验\n* **2024.04.30 v0.7.0版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.7.0)\n  * 提供Assistant SDK 功能，新增 [Cookbook](/cookbooks/pipeline/assistant_function_call.ipynb)，包含流程编排与FunctionCall，搭建个性化Agent应用\n  * AgentBuilder组件更名为 AppBuilderClient, 后续版本将放弃对 `AgentBuilder` 的后向兼容支持\n  * 首页Readme与文档结构优化\n* **2024.05.21 v0.7.1版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.7.1)\n  * 更新Assistant SDK 功能，为assistants/threads/messages/runs/files模块提供了完整的增删改查api, 新增`appbuilder.AssistantEventHandler`与`appbuilder.assistant.threads.runs.stream_run_with_handler`方法，更好的支持Assistant的流式调用\n  * 支持AppBuilder Client通过chainlit进行可视化的服务化部署\n  * 优化SDK的报错信息提示，方便开发者进行debug\n  * 修复文档格式转换组件的域名错误问题\n* **2024.06.11 v0.8.0版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.8.0)\n  * 提供功能更强大的Debug模式\n  * 支持AppBuilder Client通过chainlit进行可视化的服务化部署\n  * 多个组件进行了效果优化与说明文档更新\n* **2024.06.28 v0.9.0版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.0)\n  * Python/Go/Jave Console SDK 上新，支持Token用量返回，支持`get_app_list`， 支持`KnowledgeBase`功能\n  * 新增AppBuilder-SDK Depoly功能，支持用户使用SDK快速部署本地组件orAgent应用到百度智能云，并对外提供服务\n  * 更新SDK超参，支持SDK在私有化部署环境的使用\n  * 更新口语化组件，优化效果\n* **2024.07.25 v0.9.1版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.1)\n  * KnowledgeBase组件完整支持`知识库`、`知识库文档`及`文档切片`的增删改查\n  * 新增appbuilder_trace_server与AppBuilderTracer功能，支持组件、AppBuilderClient、Assistant的链路追踪\n* **2024.08.16 v0.9.2版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.2)\n  * AppBuilderClient 新增ToolCall功能，支持开发者注册本地函数为组件，扩展Agent能力边界\n  * 新增`PPTGenerationFromFile`、`PPTGenerationFromInstruction`、`PPTGenerationFromPaper`三个组件\n* **2024.08.20 v0.9.3版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.3)\n  * Text2Image组件接口及效果更新\n  * ImageUnderstand组件接口及效果更新\n* **2024.09.04 v0.9.4版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.4)\n  * AppBuilderClient新增tool_choice / end_user_id功能\n  * 增加VScode setting，优化开发者使用体验\n* **2024.10.18 v0.9.5版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.5)\n  * 更新KnowledgeBase组件，新增`切片详情`获取接口，新增切片关联的图片ID字段\n  * AppBuilderTrace 支持SentrySDK\n  * AppBuilder新增[Sphinx API文档](../../API-Reference/Python/modules.md)\n* **2024.10.26 v0.9.6版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.6)\n  * 更新AppBuilderClient，简化Java & Go语言使用ToolCall的方式\n  * 新增长文档内容理解组件\n  * 优化requirements，去除部分组件的版本限制\n  * 简化报错堆栈，去除冗余的Trace信息\n* **2024.11.27 v0.9.7版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.7)\n  * 新增TreeMind组件\n  * 新增工作流Agent回复“信息收集节点”功能，支持多轮对话事件处理\n  * Python的ToolCall功能支持通过函数定义、装饰器的形式等生成ToolCall参数\n* **2024.12.10 v0.9.8版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/0.9.8)\n  * AppBuilderClient新增追问功能支持\n  * TTS组件新增更多语音效果\n  * 通用文字识别组件新增更多语言支持\n  * 实时语音通话功能内测\n* **2025.01.03 v1.0.0版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/1.0.0)\n  * 工作流自定义组件支持SDK调用\n  * 新增RAG检索SDK\n  * Agent Python SDK支持Async调用\n  * 新增滚动日志功能\n* **2025.01.16 v1.0.1版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/1.0.1)\n  * 修复1.0.0中的Python SDK流式调用慢问题\n* **2025.01.24 v1.0.2版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/1.0.2)\n  * 升级KnowledgebaseClient，同步更新OpenAPI的入参\n  * 升级KnowledgebaseClient，同步更新知识库创建入参\n  * 升级ComponentClient，同步更新OpenAPI的出参\n* **2025.02.28 v1.0.3版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/1.0.3)\n  * AppBuilderClient新增点踩点赞功能支持\n  * 知识库支持配置目录、切片模糊搜索、文档状态信息等功能升级\n  * MCP协议支持\n* **2025.03.27 v1.0.4版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/1.0.4)\n  * MCP Client新增SSE协议支持\n  * 新增百度AI搜索的MCP Server\n  * AppBuilderClient调用支持显示DeepSeek-R1思考过程\n* **2025.04.05 v1.0.5版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/1.0.5)\n* **2025.04.24 v1.0.6版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/1.0.6)\n  * 组件MCP SSE Server支持多副本\n  * 新增 AppBuilder RAG MCP服务\n  * 新增 AppBuilder Agent MCP服务\n  * MCP Server支持添加OpenAPI tools\n* **2025.06.20 v1.1.0版本发布** [ReleaseNote](https://github.com/baidubce/app-builder/releases/tag/1.1.0)\n  * Python/Java 支持AI搜索V2，支持百度搜索\n  * Python模型列表SDK切换v2接口，新增\n  * Python/Go/Java 增加应用详情SDK，支持自主规划Agent、工作流Agent\n  * Java SDK 流式响应支持手动中断\n"
  },
  {
    "path": "docs/DevelopGuide/EnvironmentalParameters/env.md",
    "content": "# AppBuilder SDK 运行环境超参配置说明\n\n## 运行超参\n\n- `APPBUILDER_TOKEN`\n    - 超参说明：设置当前运行环境的用户Token，用于所有接口的鉴权\n    - 默认值： 空字符串\n    - 影响范围：当前终端（Terminal）运行的所有AppBuilder程序\n\n- `SECRET_KEY_PREFIX`\n    - 超参说明：设置当前运行环境中AppBuilder组件（Component）的密钥前缀，SDK会自动组装最终的密钥为 `{SECRET_KEY_PREFIX} {APPBUILDER_TOKEN}`的形式，用于发起HTTP请求。常用于私有化部署的场景。\n    - 默认值： `Bearer`\n    - 影响范围：当前终端（Terminal）运行的所有AppBuilder程序\n\n- `GATEWAY_URL`\n    - 超参说明：设置当前运行环境中AppBuilder组件（Component）网关的URL\n    - 默认值： `https://appbuilder.baidu.com` \n    - 影响范围：当前终端（Terminal）运行的所有AppBuilder程序中的基础组件调用请求\n\n- `GATEWAY_URL_V2`\n    - 超参说明：设置当前运行环境中AppBuilder OpenAPI的URL\n    - 默认值： `https://qianfan.baidubce.com`\n    - 影响范围：当前终端（Terminal）运行的所有AppBuilder程序中的端到端应用 及 OpenAPI能力的调用\n    - 注意事项：当前该参数影响以下接口\n        - `AppBuilderClient SDK` 所有接口\n        - `KnowledgeBase SDK` 所有接口 \n\n- `CONSOLE_OPENAPI_PREFIX`\n    - 超参说明：设置当前运行环境中AppBuilder OpenAPI的URL前缀，体现在`https://qianfan.baidubce.com/{custom_prefix}/v2/app/conversation`中的`{custom_prefix}`字段。常用于私有化部署的场景。\n    - 默认值： 空字符串\n    - 影响范围：当前终端（Terminal）运行的所有AppBuilder程序中的端到端应用 及 OpenAPI能力的调用\n    - 注意事项：当前该参数影响以下接口\n        - `AppBuilderClient SDK` 所有接口\n        - `KnowledgeBase SDK` 所有接口 \n\n- `CONSOLE_OPENAPI_VERSION`\n    - 超参说明：设置当前运行环境中AppBuilder OpenAPI的版本，体现在`https://qianfan.baidubce.com/{custom_prefix}/v2/app/conversation`中的`/v2`字段。常用于私有化部署的场景。\n    - 默认值： `v2`\n    - 影响范围：当前终端（Terminal）运行的所有AppBuilder程序中的端到端应用 及 OpenAPI能力的调用\n    - 注意事项：当前该参数影响以下接口\n        - `AppBuilderClient SDK` 所有接口\n        - `KnowledgeBase SDK` 所有接口 \n\n\n\n### 运行超参使用Tips\n- 私有化环境部署时，需要同时设置私有化部署的网关地址：`GATEWAY_URL`和`GATEWAY_URL_V2`，且需要使用在私有化环境中可以鉴权的用户Token：`APPBUILDER_TOKEN`与`SECRET_KEY_PREFIX`\n\n\n## 调试超参\n\n- `APPBUILDER_LOGLEVEL`\n    - 超参说明：设置AppBuilder运行的日志级别，可选值：`DEBUG`, `INFO`, `WARNING`, `ERROR`\n    - 默认值： INFO\n    - 影响范围：当前终端（Terminal）运行的所有AppBuilder程序的日志级别\n    - 注意事项：`APPBUILDER_LOGLEVEL`生效于`import appbuilder`时，若期望该参数生效，可使用`appbuilder.logger.setLoglevel(\"DEBUG\")`方法设置\n    ```python\n    import appbuilder # NOQA \n    appbuilder.logger.setLoglevel(\"DEBUG\") # NOQA\n    ```\n\n\n- `APPBUILDER_LOGFILE`\n  - 超参说明：设置AppBuilder运行的日志文件路径，最好是绝对路径\n  - 默认值；空\n  - 注意事项：`APPBUILDER_LOGFILE`生效于`import appbuilder`时，若期望该参数生效，可使用`appbuilder.logger.setLogFile(\"\")`方法设置\n  ```python\n  import appbuilder # NOQA \n  appbuilder.logger.setFilename(\"/tmp/appbuilder.log\") # NOQA\n  ```"
  },
  {
    "path": "docs/DevelopGuide/ErrorMessage/error_message.md",
    "content": "# SDK 错误信息\n\n1、 `BaseRPCException`\n\n- 报错解释: \n    - Base RPC exception，\n    - SDK基类异常\n\n2、 `BadRequestException`\n\n- 报错解释: \n    - BadRequestException represent HTTP Code 400\n    - BadRequestException 表示请求错误，错误码为400\n\n3、 `ForbiddenException`\n\n- 报错解释: \n    - ForbiddenException represent HTTP Code 403\n    - ForbiddenException 表示禁止访问，错误码为403\n\n4、 `NotFoundException`\n\n- 报错解释: \n    - NotFoundException represent HTTP Code 404\n    - NotFoundException 表示资源不存在，错误码为404\n\n5、 `PreconditionFailedException`\n\n- 报错解释: \n    - PreconditionFailedException represent HTTP Code 412\n    - PreconditionFailedException 表示前置条件失败，错误码为412\n\n6、 `InternalServerErrorException`\n\n- 报错解释: \n    - InternalServerErrorException represent HTTP Code 500\n    - InternalServerErrorException 表示内部服务器错误，错误码为500\n\n\n7、 `HTTPConnectionException`\n\n- 报错解释: \n    - HTTPConnectionException represent HTTP Connection error\n    - HTTPConnectionException 表示HTTP连接错误\n\n8、 `ModelNotSupportedException`\n\n- 报错解释: \n    - ModelNotSupportedException represent model is not supported\n    - ModelNotSupportedException 表示模型不支持\n\n9、 `TypeNotSupportedException`\n\n- 报错解释: \n    - TypeNotSupportedException represent type is not supported\n    - TypeNotSupportedException 表示类型不支持\n\n10、 `AppBuilderServerException`\n\n- 报错解释: \n    - AppBuilderServerException represent backend server failed response\n    - AppBuilderServerException 表示后端服务器响应失败\n\n11、 `AssistantServerException`\n\n- 报错解释: \n    - AssistantSercerException represent assistant server failed response.\n    - AssistantSercerException 表示助理服务器响应失败\n\n12、 `InvalidRequestArgumentError`\n\n- 报错解释: \n    - InvalidRequestArgumentError invalid request param\n    - InvalidRequestArgumentError 表示请求参数无效\n\n13、 `RiskInputException`\n\n- 报错解释: \n    - RiskInputException represent risk input error\n    - RiskInputException 表示异常输入错误\n\n14、 `AppbuilderBuildexException`\n\n- 报错解释: \n    - Appbuilder buledex exception\n    - AppbuilderBuildexException 表示AppBuilder-SDK构建异常，报错使用与Appbuilder-SDK的构造代码单元检测不符合规范\n\n15、 `AppbuilderTraceException`\n\n- 报错解释: \n    - Appbuilder trace exception\n    - AppbuilderTraceException 表示AppBuilder-SDK追踪框架异常，使用`export APPBUILDER_TRACE_DEBUG=TRUE`来开启Appbuilder-SDK的追踪框架的DEBUG模式，展示报错的完整链路并调试"
  },
  {
    "path": "docs/DevelopGuide/HowToContributeCode/README.md",
    "content": "# SDK 贡献代码规范\n\n## 组件开发规范\n\n### 组件整体介绍\n\n在无特殊情况下，一个官方组件（class Component）的实现可以拆解为以下几个关键模块，分别是\n\n* def run：组件的run函数，规范体现在该函数的输入和输出\n    * 输入规范\n    * 输出规范\n* def tool_eval：组件功能的核心实现，规范体现在该函数的输入和输出\n    * 输入规范\n    * 输出规范\n* dict manifest：组件参与FunctionCall时，帮助大模型理解组件功能的说明，规范体现在manifest的内容和格式\n    * manifest规范\n\n### `run` 函数\n\n#### 消息(Message)\n- 构建大模型应用的统一数据结构，基于Pydantic构建，在不同的Component之间流动。Message基类的默认字段是content，类型是Any。\n```python\nfrom appbuilder import Message\ninput_dict = Message({\"query\": \"红烧肉怎么做\"})\ninput_list = Message([\"text1\", \"text2\", \"text3\"])\ninput_str = Message(\"红烧肉怎么做\")\n```\n\n#### `run` 函数输入输出规范\n\n- 所有能力单元的标准结构，以Message结构作为输入输出，内部执行逻辑可在本地执行或调用云端服务，以下是官方组件的实现示例。`run` 函数需要添加 `@components_run_trace` 装饰器，实现对组件的trace。\n\n```python\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace\n\nclass SimilarQuestionMeta(ComponentArguments):\n    \"\"\" SimilarQuestionMeta\n    \"\"\"\n    message: Message = Field(..., \n                             variable_name=\"query\", \n                             description=\"输入消息，用于模型的输入，一般为问题。\")\n\n\nclass SimilarQuestion(CompletionBaseComponent):\n    \"\"\" 基于输入的问题, 挖掘出与该问题相关的类似问题。广泛用于客服、问答等场景。\n    Examples:\n\n        .. code-block:: python\n            import os\n            import appbuilder\n\n            os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n            qa_mining = appbuilder.SimilarQuestion(model=\"DeepSeek-V3.1\")\n\n            msg = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n            msg = appbuilder.Message(msg)\n            answer = qa_mining(msg)\n\n            print(\"Answer: \\n{}\".format(answer.content))\n    \"\"\"\n    name = \"similar_question\"\n    version = \"v1\"\n    meta = SimilarQuestionMeta\n\n    def __init__(self, model=None):\n        \"\"\"初始化SimilarQuestionMeta任务。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(SimilarQuestionMeta, model=model)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n\n        参数:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n\n        返回:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature)\n```\n\n### `tool_eval` 函数\n\n#### `ComponentOutput` 类\n\n```python\nclass ComponentOutput(BaseModel):\n    role: str = Field(default=\"tool\",\n                      description=\"role是区分当前消息来源的重要字段，对于绝大多数组件而言，都是填写tool，标明role所在的消息来源为组件。部分思考及问答组件，role需要填写为assistant\")\n    content: list[Content] = Field(default=[],\n                                         description=\"content是当前组件返回内容的主要payload，List[Content]，每个Content Dict 包括了当前输出的一个元素\")\n```\n\n#### `tool_eval` 函数输入输出规范\n\n- 组件的核心实现，需要添加 `@components_run_stream_trace` 装饰器，实现对组件的trace。\n\n##### `tool_eval` 函数 输入参数\n\n* 组件tool_eval方法的输入，除了在manifest中约定的参数外，也可能会传入以下系统变量，辅助组件的运行。\n* 系统入参列表中的字段是保留字段，组件定义的manifest不能与系统参数重名。系统参数中有可以被用户设置的参数例如uploaded_files，也有不能设置的字段例如traceid等。\n* 在组件的开发中，以下系统输入字段体现为 def tool_eval(self, key1, key2, \\*\\*kwargs)中\\*\\*kwargs包含的内容，key1和key2是manifest中约定的参数，kwargs中的内容是系统入参。\n\n##### `tool_eval` 函数 组件返回字段\n\n* 组件返回参数统一采用json字段，固定key名称和对应的value，value默认是dict类型，value本身需要指定visible_scope。\n* 非流式返回结果，按照所有流式内容的key-value进行合并，例如两个event都是references，那么需要两组references合并，所有组件需要支持非流式返回。\n* 基于sse协议提供流式数据\n* content 本身是个 List[Dict]，每个 Dict是当前 event 的一个元素，一般有多个元素的返回例如 urls/files 才需要多个 Dict\n\n###### 组件返回字段总览\n\n|字段|类型|是否必须|默认值 及 取值范围|作用说明|备注|\n|---|---|---|---|---|---|\n|role|str|否|- tool 默认<br>- user<br>- assistant<br>|ole是区分当前消息来源的重要字段，对于绝大多数组件而言，都是填写tool，标明role所在的消息来源为组件。部分思考及问答组件，role需要填写为assistant|{\"role\": \"tool\"}|\n|content|list[dict]|是|[]Event|当前组件返回内容的主要payload，List[Dict]，每个 Dict 包括了当前 event 的一个元素||\n|+ name|str|否|part1，part2或者3d_pics，title|介绍当前yield内容的step name使用name的必要条件，是有不同content需要是属于结构上的不同字段，但又是streaming的||\n|+ type|str|是|* text 默认<br>* code<br>* files<br>* urls<br>* oral_text<br>* references<br>* image<br>* chart<br>* audio<br>* json|代表event 类型，包括 text、code、files、urls、oral_text、references、image、chart、audio、tought、json<br>该字段的取值决定了下面text字段的内容结构||\n|+ text|dict<br>object|是|{}|代表当前 event 元素的内容，每一种 event 对应的 text 结构固定|保留字段<br>\"text\": {'filename': 'chart_url.png', 'url': 'https://chart_url.png'},|\n|+ visible_scope|str|否|all 默认<br>llm<br>user<br>空|为了界面展示明确的说明字段<br>* llm为思考模型可见，类似function calling结果中submit的执行结果<br>* user为终端用户可见|workflow中存在消息通知节点，类型为notice<br>目前实测，llm、user、all用户都可见，只是气泡不一样。llm在下拉框中，user直接输出到气泡中。|\n|+ raw_data|dict<br>object|否|{}|内部信息，由开发者请求透传，内部系统返回的信息，例如API节点收到的resp，大模型节点的MB resp|{<br>    \"origin_response\": \"xxxxx\"<br>}|\n|+ usage|list of dict<br>object|否|{}|大模型的token用量|{<br>    \"prompt_tokens\": 1547,<br>    \"completion_tokens\": 2,<br>    \"total_tokens\": 1549,<br>    \"name\": \"ERNIE Speed-AppBuilder\"<br>}|\n|+ metrics|dict<br>object|否|{}|耗时、性能、内存等trace及debug所需信息|{<br>    \"begin_timestamp\": xxxxx<br>    \"end_timestamp\": xxxxx<br>}|\n\n##### 包含 `manifests` 定义的 `tool_eval` 函数返回示例\n\n```python\nclass SimilarQuestion(CompletionBaseComponent):\n    r\"\"\" \n    基于输入的问题, 挖掘出与该问题相关的类似问题。广泛用于客服、问答等场景。\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        qa_mining = appbuilder.SimilarQuestion(model=\"DeepSeek-V3.1\")\n\n        msg = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n        msg = appbuilder.Message(msg)\n        answer = qa_mining(msg)\n\n        print(\"Answer: \\n{}\".format(answer.content))\n    \"\"\"\n    name = \"similar_question\"\n    version = \"v1\"\n    meta = SimilarQuestionMeta\n\n    manifests = [\n        {\n            \"name\": \"similar_question\",\n            \"description\": \"基于输入的问题，挖掘出与该问题相关的类似问题。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入的问题，用于大模型根据该问题输出相关的类似问题。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str=\"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n    ):\n        \"\"\"初始化StyleRewrite模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            SimilarQuestionMeta, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_stream_trace\n    def tool_eval(self, \n                  query: str,\n                  **kwargs):\n        \"\"\"\n        根据给定的query和可选参数生成并返回文本输出。\n        \n        Args:\n            query (str): 需要生成文本的输入查询字符串。\n            **kwargs: 其他可选参数。\n        \n        Returns:\n            Generator[Output]: 返回一个生成器，生成类型为Output的对象。\n        \n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n        \n        yield self.create_output(type=\"text\", text=str(message.content), name=\"text\", usage=message.token_usage)\n```\n\n### `manifest` 规范\n\n* 若组件有tool_eval方法，则必须要求存在manifest\n  * 现状：算法手动撰写；未来：提供工具，自动从python函数的入参及注释转manifest\n* mainfests是一个list[dict]，是对组件多个能力的规范化描述，如无特殊情况，一般list中只有一个元素，对应tool_eval的能力\n* manifest dict要满足json schema协议要求\n* 要求manifest dict中parameters-properties定义的参数，与def tool_eval的入参一致\n* 组件中的version字段，会影响的组件URL，参考组件API：组件调用形如:\n  * /v2/components/${component}/version/{$version}?action=${action}\n* 遵循新规范的组件，因输入输出与原组件不兼容，在实现上有显著的标志区分\n\n#### Json Schema协议\n\n- [Json Schema协议](https://json-schema.org/overview/what-is-jsonschema)，以下是示例\n\n```python\nclass BaiduSearchWithModel(Component):\n    r\"\"\"\n        百度搜索总结工具\n    \"\"\"\n    name = \"baidu_search_with_model\"\n    version = \"v1\" # 修改此处，会影响组件的调用URL\n    manifests = [\n        {\n            \"name\": \"baidu_search_with_model\",  # 组件名称\n            \"description\": \"对百度搜索结果进行大模型总结\",  # 组件描述，该字段重要，影响 function calling 效果\n            \"parameters\": {  # parameters 描述组件入参列表\n                \"type\": \"object\",\n                \"properties\": { # 多个参数可以指定多个 properties\n                    \"query\": {\n                        \"type\": \"string\", # 参数query 的类型\n                        \"description\": \"搜索关键词\" # 参数query 的描述，该字段重要，影响 function calling 效果\n                    }\n                },\n                \"required\": [\n                    \"query\" # query参数为必填字段\n                ]\n            }\n        }\n    ]\n```\n\n## 代码合入单元测试规范\n\n* 现状: 当前开源Appbuilder-SDK已经部署了单元测试流水线，并要求90%的单元测试覆盖率合入要求，要求开发者实现完整已开发的代码的端到端的测试，并且要求代码增量行覆盖率为90%\n\n### 单元测试规范\n\n#### 单元测试要求\n\n- 覆盖if-else分支\n    - 对于包含if-else逻辑的代码，需要编写测试用例来确保每个分支都被执行到\n- 输入的边界条件检查\n    - 边界条件通常指的是数据范围的极值（如最小值和最大值），或者特定情况下的特殊值（如空值、空字符串、负值等）  \n-  Error raise的覆盖\n    - 确保测试覆盖了所有可能抛出异常的代码路径，包括代码自身的预期错误，以及访问远程服务失败后的错误处理\n\n#### Test文件目录\n\n* test文件需要为『test_』开头\n* 测试类需要形如『class TestAgentRuntime(unittest.TestCase)::』的定义方式\n* test文件需要置于appbuilder-sdk-ext/appbuilder_sdk_ext/tests路径下\n\n#### UnitTest提供三种标签实现两种运行模式\n\n* 添加下列标签，单元测试脚本实现cpu并行\n  * @unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\n* 不添加标签，单元测试脚本默认使用cpu串行\n* 添加下列标签，暂时跳过当前单元测试脚本\n  * @unittest.skip(reason=\"单测暂时跳过\")\n\n##### SKIP标签代码示例\n```python\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCreateChatPrompt(unittest.TestCase):\n    pass\n    \n    \nclass TestCreateChatPrompt(unittest.TestCase):\n    pass\n    \n    \n@unittest.skip(reason=\"单测暂时跳过\")\nclass TestCreateChatPrompt(unittest.TestCase):\n    pass\n```\n\n#### SDK测试代码示例\n\n下面给出一个通过parameterized库进行多种参数组合的示例，可以大幅简化单测代码，但需注意，多种参数的测试case会并行运行，对服务的QPS有要求\n\n```python\nimport unittest\nfrom parameterized import parameterized, param\nimport appbuilder\n\nclass TestHandwritingOcr(unittest.TestCase):\n    @parameterized.expand([\n        param(image_url, None, None),\n        param(image_url, None, 0),\n        param(image_url, float(120), None),\n        param(image_url, None, 1),\n        param(image_url, 120.5, 1),\n        param(image_url, float(12000), None),\n    ])\n    def test_normal_case(self, image, timeout, retry):\n        \"\"\"\n        正常用例\n        \"\"\"\n        # 创建表格识别组件实例\n        handwrite_ocr = appbuilder.HandwriteOCR()\n        # 执行识别操作并获取结果\n        if timeout is None and retry is None:\n            out = handwrite_ocr.run(appbuilder.Message(content={\"url\": image}))\n        elif timeout is None:\n            out = handwrite_ocr.run(appbuilder.Message(content={\"url\": image}), retry=retry)\n        elif retry is None:\n            out = handwrite_ocr.run(appbuilder.Message(content={\"url\": image}), timeout=timeout)\n        else:\n            out = handwrite_ocr.run(appbuilder.Message(content={\"url\": image}), timeout=timeout, retry=retry)\n        res = out.content\n        self.assertIsNotNone(res[\"contents\"], \"识别结果为空\")\n        self.assertEqual(len(res[\"contents\"]), 6)\n    \n    @parameterized.expand([\n        # timeout为0\n        param(image_url, 0, 0, \"ValueError\", \"timeout\", 'but the timeout cannot be set to a value '\n                                                                'less than or equal to 0.'),\n        # timeout为字符串\n        param(image_url, \"a\", 0, \"appbuilder.core._exception.InvalidRequestArgumentError\", \"timeout\",\n                        'timeout must be float or tuple of float'),\n        # timeout为0.1，太短了\n        param(image_url, float(0.1), 0, \"requests.exceptions.ReadTimeout\", \"timeout\",\n                        \"Read timed out. (read timeout=0.1)\"),\n        # retry为字符串\n        param(image_url, float(10), \"a\", \"TypeError\", \"str\", \"'<' not supported between instances of\"\n                                                                    \" 'str' and 'int'\"),\n        # image_url错误\n        param(\"https://bj.bcebos.com/v1/appbuilder/xxx\", 12.5, 1,\n                        \"appbuilder.core._exception.AppBuilderServerException\", \"url\",\n                        \"service_err_message=url format illegal\"),\n    ])\n    def test_abnormal_case(self, image, timeout, retry, err_type, err_param, err_msg):\n        \"\"\"\n        异常用例\n        \"\"\"\n        try:\n            # 创建表格识别组件实例\n            handwrite_ocr = appbuilder.HandwriteOCR()\n            # 执行识别操作并获取结果\n            out = handwrite_ocr.run(appbuilder.Message(content={\"url\": image}), timeout=timeout, retry=retry)\n            res = out.content\n            log.info(res)\n            assert False, \"未捕获到错误信息\"\n        except Exception as e:\n            self.assertIsInstance(e, eval(err_type), \"捕获的异常不是预期的类型 实际:{}, 预期:{}\".format(e, err_type))\n            self.assertIn(err_param, str(e), \"捕获的异常参数类型不正确, 预期 参数:{}, 实际:{}\".format(err_param, str(e)))\n            self.assertIn(err_msg, str(e), \"捕获的异常消息不正确， 预期:{}, 实际:{}\".format(err_msg, str(e)))\n```\n\n## 注释规范\n\n- SDK使用注释自动生成API文档，因此非私有函数的注释需要严格按照Google代码注释规范编写\n\n### object类注释\n\n```python\nclass AppBuilderClient(Component):\n    r\"\"\"\n    AppBuilderClient 组件支持调用在[百度智能云千帆AppBuilder](https://cloud.baidu.com/product/AppBuilder)平台上\n    构建并发布的智能体应用，具体包括创建会话、上传文档、运行对话等。\n    \n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        # 可在Console 应用页面获取\n        app_id = \"app_id\"\n        client = appbuilder.AppBuilderClient(\"app_id\")\n        conversation_id = client.create_conversation()\n        file_id = client.upload_local_file(conversation_id, \"/path/to/file\")\n        message = client.run(conversation_id, \"今天你好吗？\")\n        # 打印对话结果\n        print(message.content)\n        \n    \"\"\"\n```\n- 注意\n    - 注释必须使用 Examples:之后必须存在一行空行，.. code-block:: python之后也必须要有一行空行\n    - code-block前为两点（..）之后为两个冒号(::)\n    - 方法的示例注释与此规范相同\n\n### 函数注释\n\n- 私有函数如_recognize_w_post_process等无需按照规范注释函数\n\n```python\n@components_run_stream_trace\ndef tool_eval(\n    self,\n    name: str,\n    streaming: bool,\n    origin_query: str,\n    **kwargs,\n) -> Union[Generator[str, None, None], str]:\n    \"\"\"\n    执行工具函数，通过调用底层接口进行动物识别。\n    \n    Args:\n        name (str): 工具名\n        streaming (bool): 是否流式返回结果，True 表示流式返回，False 表示一次性返回\n        origin_query (str): 用户原始查询字符串\n        **kwargs: 工具调用的额外关键字参数\n    \n    Returns:\n        Union[Generator[str, None, None], str]: 动物识别结果。如果 streaming 为 True，则返回一个生成器，可以逐个返回识别结果；\n                                                如果 streaming 为 False，则返回一个字符串，包含识别出的动物类别和相应的置信度信息。\n    \n    \"\"\"\n```\n\n### google风格指南与规范示例\n\n- Google详情见 [Google注释风格指南](https://google.github.io/styleguide/pyguide.html)\n   \n\n```python\nclass GoogleStyle:\n    '''Google注释风格\n    用 ``缩进`` 分隔，\n    适用于倾向水平，短而简单的文档\n    Attributes:\n        dividend (int or float): 被除数\n        name (:obj:`str`, optional): 该类的命名\n    '''\n \n    def __init__(self, dividend, name='GoogleStyle'):\n        '''初始化'''\n        self.dividend = dividend\n        self.name = name\n \n    def divide(self, divisor):\n        '''除法\n        Google注释风格的函数，\n        类型主要有Args、Returns、Raises、Examples\n        Args:\n            divisor (int):除数\n        Returns:\n            除法结果\n        Raises:\n            ZeroDivisionError: division by zero\n        Examples:\n        \n        .. code-block:: python\n        \n            # 实例代码\n            \n        References:\n            除法_百度百科  https://baike.baidu.com/item/%E9%99%A4%E6%B3%95/6280598\n        '''\n        try:\n            return self.dividend / divisor\n        except ZeroDivisionError as e:\n            return e\n```\n"
  },
  {
    "path": "docs/QuickStart/CurrentlySupportedProgrammingLanguages/README.md",
    "content": "## SDK当前支持的编程语言\n- 平台功能 SDK: 支持Pyhon/Java/Go\n    - [应用管理](../../BasisModule/Platform/Application/get_app_list.md)\n    - [应用调用 AppBuilderClient SDK](../../BasisModule/Platform/Application/appbuilder_client.md) \n    - [知识库管理 KnowledgeBase SDK](../../BasisModule/Platform/KnowledgeBase/knowledgebase.md)\n- AI基础能力组件 SDK：支持Python\n    - [获取模型列表](../../BasisModule/Model/get_model_list.md)\n    - [基础能力组件](../../BasisModule/Platform/CustomComponents/components.md)"
  },
  {
    "path": "docs/QuickStart/ExamplesOfIndustrialPracticeApplications/README.md",
    "content": "# AppBuilder 功能组件\nAppBuilder面向开发者提供AI原生应用一站式开发工具，包括基础云资源、AI能力引擎、千帆大模型以及相关能力组件，提升AI原生应用开发效率。\n\n百度智能云千帆 AppBuilder 在提供零代码、低代码的AI原生应用搭建功能之外，也提供全代码灵活开发与集成能力。基于官方 API/SDK，开放丰富的组件服务，提供具备强大对话、思考及工具调用能力的 Agent 应用框架。\n\n封装程度由高至低，AppBuilder 提供了三种类型的SDK\n| 分类   | 场景及使用方式   | 百度云文档链接         | SDK 文档链接|\n|--------|--------|------------|------------|\n| 端到端应用 | 在 AppBuilder 产品界面上通过零代码、低代码方式创建的 AI 原生应用，支持通过应用 API/SDK 进行调用 | [应用API及SDK](https://cloud.baidu.com/doc/AppBuilder/s/Plvggbuzc) | [AppBuilder Client SDK](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/appbuilder_client.md) |\n| 工具组件 | 基于组件 SDK，可调用包括大模型组件、AI能力组件等在内的多种组件 | [组件SDK](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz) | [组件列表](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz#3%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1) |\n\n\n## 功能示例\n\n\n### 获取模型列表\n\nAppBuilder提供获取千帆模型列表的函数，在运行具体组件之前，可以先获取当前账号下可以使用的模型列表，代码如下：\n``` python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\nmodels = appbuilder.get_model_list(api_type_filter=[\"chat\"], is_available=True)\nprint(\", \".join(models))\n```\n\n填写自己的Token，获取模型列表输出示例如下：\n``` shell\nERNIE-Bot 4.0, ERNIE-Bot, ERNIE-3.5-8K-0205, ERNIE-Speed, DeepSeek-V3.1, ERNIE-Character-8K, EB-turbo-AppBuilder专用版, ChatLaw, ERNIE-Bot-8K\n```\n\n为方便用户更容易使用模型，以下是一些模型的短名称\n| 千帆模型名                   | AppBuilder-SDK短名 |\n|----------------------------|------------------|\n| ERNIE-Bot 4.0              |       eb-4       |\n| ERNIE-Bot                  |       eb         |\n| ERNIE-Bot-turbo            |       eb-turbo   |\n| EB-turbo-AppBuilder专用版   |       ernie_speed_appbuilder        |\n| DeepSeek-V3.1              |       deepseek-v3.1-250821          |\n\n\n\n### 空模版(Playground)\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 空模版组件\ntemplate_str = \"你扮演{role}, 请回答我的问题。\\n\\n问题：{question}。\\n\\n回答：\"\nplayground = appbuilder.Playground(prompt_template=template_str, model=\"DeepSeek-V3.1\")\n\n# 定义输入，调用空模版组件\ninput = appbuilder.Message({\"role\": \"java工程师\", \"question\": \"java语言的内存回收机制是什么\"})\nprint(playground(input, stream=False, temperature=1e-10))\n\n```\n\n### 文本生成(Text Completion)\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 相似问生成组件\nsimilar_q = appbuilder.SimilarQuestion(model=\"DeepSeek-V3.1\")\n\n# 定义输入，调用相似问生成\ninput = appbuilder.Message(\"我想吃冰淇淋，哪里的冰淇淋比较好吃？\")\nprint(similar_q(input))\n\n```\n\n### 检索增强问答\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 此处填写线上Agent应用ID，可在【AppBuilder网页端-我的应用界面】查看\n# 本示例提供的Agent应用为：地理小达人\n# 网页已部署的应用链接为「地理小达人」：https://appbuilder.baidu.com/s/x1tSF\n# 以下示例代码展示了如何代码态调用并集成到您的应用中的能力\napp_id = \"42eb211a-14b9-43d2-9fae-193c8760ef26\"\nbuilder = appbuilder.AppBuilderClient(app_id)\nconversation_id = builder.create_conversation()\n\nanswer = builder.run(conversation_id, \"中国的首都在哪里\")\nprint(answer.content)\n```\n\n### 应用服务化\n\nAppBuilder-SDK提供对组件的服务化能力。通过定义Agent，开发者可以快速启动Chainlit、Flask等服务化的Demo或API提供快速体验环境。\n\n在需要部署服务的环境中，开发者需要首先手动安装 Chainlit 库\n\n```shell\npip install chainlit\n```\n而后，使用AppBuilder的Agent服务化功能，即可快速部署服务\n\n```python\nimport appbuilder\n\n# 空模版组件\nplayground = appbuilder.Playground(\n    prompt_template=\"{query}\",\n    model=\"DeepSeek-V3.1\"\n)\n\n# 使用 AgentRuntime 来服务化playground组件\nagent = appbuilder.AgentRuntime(component=playground)\n\n# 启动chainlit demo，会自动在浏览器打开体验对话框页面\nagent.chainlit_demo(port=8091)\n```"
  },
  {
    "path": "docs/QuickStart/StartFirstAINativeApplication/README.md",
    "content": "# 快速开始\n\n该文档目录包含以下内容：\n\n- [SDK安装](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/install.md)\n- [版本更新历史](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ChangeLog/changelog.md)\n\n## 预备步骤\n在正式开始使用AppBuilder-SDK之前，可以阅读以下内容：\n\n* **预备步骤**\n  * [认证鉴权](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6)\n  * [开通组件权限](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#2%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1)\n* **API文档**\n  * [API Docs](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz)\n\n## 快速上手\n\n\n### 获取模型列表\n\nAppBuilder提供获取千帆模型列表的函数，在运行具体组件之前，可以先获取当前账号下可以使用的模型列表，代码如下：\n``` python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\nmodels = appbuilder.get_model_list(api_type_filter=[\"chat\"], is_available=True)\nprint(\", \".join(models))\n```\n\n填写自己的Token，获取模型列表输出示例如下：\n``` shell\nERNIE-Bot 4.0, ERNIE-Bot, ERNIE-3.5-8K-0205, ERNIE-Speed, DeepSeek-V3.1, ERNIE-Character-8K, EB-turbo-AppBuilder专用版, ChatLaw, ERNIE-Bot-8K\n```\n\n为方便用户更容易使用模型，以下是一些模型的短名称\n| 千帆模型名                   | AppBuilder-SDK短名 |\n|----------------------------|------------------------------|\n| ERNIE-Bot 4.0              |       eb-4                   |\n| ERNIE-Bot                  |       eb                     |\n| ERNIE-Bot-turbo            |       eb-turbo               |\n| EB-turbo-AppBuilder专用版   |      ernie_speed_appbuilder  |\n| DeepSeek-V3.1              |      deepseek-v3.1-250821    |\n\n\n\n### 空模版(Playground)\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 空模版组件\ntemplate_str = \"你扮演{role}, 请回答我的问题。\\n\\n问题：{question}。\\n\\n回答：\"\nplayground = appbuilder.Playground(prompt_template=template_str, model=\"DeepSeek-V3.1\")\n\n# 定义输入，调用空模版组件\ninput = appbuilder.Message({\"role\": \"java工程师\", \"question\": \"java语言的内存回收机制是什么\"})\nprint(playground(input, stream=False, temperature=1e-10))\n\n```\n\n### 文本生成(Text Completion)\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 相似问生成组件\nsimilar_q = appbuilder.SimilarQuestion(model=\"DeepSeek-V3.1\")\n\n# 定义输入，调用相似问生成\ninput = appbuilder.Message(\"我想吃冰淇淋，哪里的冰淇淋比较好吃？\")\nprint(similar_q(input))\n\n```\n\n### 检索增强问答\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 此处填写线上Agent应用ID，可在【AppBuilder网页端-我的应用界面】查看\n# 本示例提供的Agent应用为：地理小达人\n# 网页已部署的应用链接为「地理小达人」：https://appbuilder.baidu.com/s/x1tSF\n# 以下示例代码展示了如何代码态调用并集成到您的应用中的能力\napp_id = \"42eb211a-14b9-43d2-9fae-193c8760ef26\"\nbuilder = appbuilder.AppBuilderClient(app_id)\nconversation_id = builder.create_conversation()\n\nanswer = builder.run(conversation_id, \"中国的首都在哪里\")\nprint(answer.content)\n```\n\n### 应用服务化\n\nAppBuilder-SDK提供对组件的服务化能力。通过定义Agent，开发者可以快速启动Chainlit、Flask等服务化的Demo或API提供快速体验环境。\n\n在需要部署服务的环境中，开发者需要首先手动安装 Chainlit 库\n\n```shell\npip install chainlit\n```\n而后，使用AppBuilder的Agent服务化功能，即可快速部署服务\n\n```python\nimport appbuilder\n\n# 空模版组件\nplayground = appbuilder.Playground(\n    prompt_template=\"{query}\",\n    model=\"DeepSeek-V3.1\"\n)\n\n# 使用 AgentRuntime 来服务化playground组件\nagent = appbuilder.AgentRuntime(component=playground)\n\n# 启动chainlit demo，会自动在浏览器打开体验对话框页面\nagent.chainlit_demo(port=8091)\n```\n\n也可以对AppBuilderClient进行服务化，快速部署\n\n```python\nimport os\nfrom appbuilder.core.component import Component\nfrom appbuilder import (\n    AgentRuntime,\n    AppBuilderClient,\n)\n\n\nif __name__ == \"__main__\":\n    # 设置环境中的TOKEN，请替换为您的个人TOKEN\n    os.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n    # 此处填写线上Agent应用ID，可在【AppBuilder网页端-我的应用界面】查看\n    # 本示例提供的Agent应用为：地理小达人\n    # 网页已部署的应用链接为「地理小达人」：https://appbuilder.baidu.com/s/x1tSF\n    app_id = \"42eb211a-14b9-43d2-9fae-193c8760ef26\"\n    agent_builder = AppBuilderClient(app_id)\n    agent = AgentRuntime(component=agent_builder)\n    agent.chainlit_agent(port=8091)\n```"
  },
  {
    "path": "docs/QuickStart/StartFirstAINativeApplication/install.md",
    "content": "# AppBuilder-SDK 安装\n\n### Python\n> 执行如下命令，快速安装Python语言的最新版本AppBuilder-SDK（要求Python >= 3.9)。使用MCP功能要求Python >= 3.10。\n\n```shell\npip install --upgrade appbuilder-sdk\n```\n如果在本地无法跑通appbuilder-sdk包，也可以使用我们的官方镜像来安装和运行，具体方案参考**二次开发**部分。\n\n### Java (仅支持调用端到端应用)\n> 使用AppBuilder Java ConsoleSDK要求Java版本>=8\n#### Maven\n在pom.xml的dependencies中添加依赖\n```xml\n<dependency>\n    <groupId>com.baidubce</groupId>\n    <artifactId>appbuilder</artifactId>\n    <version>1.1.0</version>\n</dependency>\n```\n#### Gradle\n对于Kotlin DSL，在build.gradle.kts的dependencies中添加依赖\n```kotlin\nimplementation(\"com.baidubce:appbuilder:1.1.0\")\n```\n对于Groovy DSL，在build.gradle的dependencies中添加依赖\n```groovy\nimplementation 'com.baidubce:appbuilder:1.1.0'\n```\n#### 本地导入\n点击[链接](https://repo1.maven.org/maven2/com/baidubce/appbuilder/1.1.0/appbuilder-1.1.0.jar) 下载Jar包，将Jar包导入到项目目录下。\n\n### Go (仅支持调用端到端应用)\n> 支持Go 1.18.1以上版本，当前最新tag为v1.1.0\n\n```shell\ngo get github.com/baidubce/app-builder/go/appbuilder\n````\n\n### Docker (当前仅集成了Python版本AppBuilder-SDK)\n``` shell\ndocker pull registry.baidubce.com/appbuilder/appbuilder-sdk-devel:1.1.0\n```\n"
  },
  {
    "path": "docs/README.md",
    "content": "# AppBuilder-SDK Documentation\n\n## Github 文档\n- [首页](https://github.com/baidubce/app-builder/blob/master/docs/README.md)\n    - 快速上手: \n        - 开始你的第一个AI原生应用: \n            - [安装](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/install.md)\n            - [快速开始](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/README.md)\n        - 产业实践应用范例: \n            - [SDK使用示例](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/ExamplesOfIndustrialPracticeApplications/README.md)\n        - [SDK当前支持的编程语言](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/CurrentlySupportedProgrammingLanguages/README.md)\n    - 基础:\n        - 模型:\n            - [获取模型列表](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Model/get_model_list.md)\n        - [组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Components)\n        - 监控:\n            - [TRACE基础功能](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/basic.md)\n            - [TRACE拓展功能](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/phoenix_method.md)\n        - 部署:\n            - [交互式前端部署](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/AgentChainlit.md)\n            - [公有云部署](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/cloud.md)\n            - [API 访问](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/flask.md)\n            - [AgentRuntime](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/agentruntime.md)\n            - [UserSession](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/usersession.md)\n        - 平台:\n            - 应用:\n                - [AppBuilderClient组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/appbuilder_client.md)\n                - [获取AppBuilder已发布的应用列表](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/get_app_list.md)\n            - 知识库:\n                - [知识库组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/KnowledgeBase/knowledgebase.md)\n            - 自定义组件:\n                - [基础能力组件](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/CustomComponents/components.md)\n    - 应用:\n        - Agent:\n            - [基础知识](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/BasicKnowledge/agent.md)\n            - [使用官方组件](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/UseOfficialComponents/use_official_components.md)\n            - [ToolCall](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/ToolCall/tool_call.md)\n            - [ToolChoice](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/ToolChoice/tool_choice.md)\n            - [使用异步和流式加速客户端调用](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n        - RAG:\n            - [基础知识](https://github.com/baidubce/app-builder/blob/master/docs/Application/RAG/BasicKnowledge/rag.md)\n            - [知识库管理](https://github.com/baidubce/app-builder/blob/master/docs/Application/RAG/DatasetManage/dataset_manage.md)\n            - [Reference信息处理](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n        - Workflow:\n            - [基础知识](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [从零使用Workflow组装一个RAG应用](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [从零使用Workflow组装一个Agent应用](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n    - 开发者指南:\n        - [如何贡献代码](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/HowToContributeCode/README.md)\n        - [二次开发](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/AdvancedDevelopment/README.md)\n        - [版本升级日志](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ChangeLog/changelog.md)\n        - [错误信息](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ErrorMessage/error_message.md)\n        - [环境参数](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/EnvironmentalParameters/env.md)\n\n\n## 平台文档\n- [产品文档](https://cloud.baidu.com/doc/AppBuilder/s/6lq7s8lli)\n- [平台资源](https://cloud.baidu.com/doc/AppBuilder/s/llq6grh7e)\n- [快速搭建应用](https://cloud.baidu.com/doc/AppBuilder/s/Tlpv3oxpy)\n- [开发参考](https://cloud.baidu.com/doc/AppBuilder/s/7luwm2yt0)\n    - [SDK](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz)\n    - [OpenAPI](https://cloud.baidu.com/doc/AppBuilder/s/klv2eywua)\n    - [Assistant API](https://cloud.baidu.com/doc/AppBuilder/s/nluzkdben)\n- [常见问题](https://cloud.baidu.com/doc/AppBuilder/s/qlq7sdj9z)\n"
  },
  {
    "path": "docs/README_en.md",
    "content": "<div align=\"center\">\n<img src='image/logo.png' alt='logo' width='700' >\n<br>\n\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE)\n![Supported Python versions](https://img.shields.io/badge/python-3.9+-orange.svg)\n![Supported OSs](https://img.shields.io/badge/os-linux%2C%20win%2C%20mac-yellow.svg)\n</div>\n\n[简体中文](../README.md) | English | [日本語](./README_ja.md)\n\n<br>\n\n\n## What is AppBuilder SDK?\n\nBaidu AI Cloud Qianfan AppBuilder SDK is a `one-stop development tool` for AI native application developers which contributed by [Baidu AI Cloud Qianfan AppBuilder](https://appbuilder.cloud.baidu.com/).\n\n\nBaidu AI Cloud Qianfan AppBuilder SDK provides the following essential functions for AI application developers:\n\nBaidu AI Cloud Qianfan AppBuilder-SDK offers the following essential features for AI application developers:\n\n1. Utilization\n\n    - Utilize large language models, freely accessing your models on Baidu AI Cloud Qianfan Large Model Platform to develop and optimize prompts.\n\n    - Integrate capability components, providing over 40 high-quality groups originating from Baidu's ecosystem to empower Agent applications.\n\n    - Integrate AI-native applications, accessing and managing AI-native applications published on [Baidu AI Cloud Qianfan AppBuilder Platform]((https://console.bce.baidu.com/ai_apaas/app)) through AppBuilderClient, and registering local functions to link end-cloud components.\n\n2. Orchestration\n\n    - Orchestrate and manage knowledge flows, managing knowledge bases through KnowledgeBase, performing create, read, update, and delete (CRUD) operations on documents and knowledge slices, and developing industry-grade RAG applications with Baidu AI Cloud Qianfan AppBuilder Platform.\n\n    - Orchestrate and automate workflows, providing multi-level workflow abstractions such as `Message`, `Component`, and `AgentRuntime` to achieve workflow orchestration and integration with industry ecosystem capabilities like LangChain and OpenAI.\n\n3. Monitoring\n    -  Providing monitoring tools such as visual Tracing and detailed DebugLog to assist developers in production environments.\n\n4. Deployment\n\n    - AgentRuntime supports deployment as an API service based on Flask and Gunicorn.\n    - AgentRuntime supports deployment as a Chainlit-based dialog interaction front-end application.\n    - Offering the appbuilder_bce_deploy tool for rapid deployment of programs to Baidu Cloud, providing public network API services, and enabling integration with AppBuilder's workflow functionalities.\n\n\n##  How to install？\n\n#### The latest version of Baidu AI Cloud Qianfan AppBuilder SDK is 1.1.0. (2025-06-20)\n\nBaidu AI Cloud Qianfan AppBuilder SDK ReleaseNote please refer to our [version description](/docs/DevelopGuide/ChangeLog/changelog.md)\n\n- We recommend installing the latest stable version of `Python`\n\n```bash\npython3 -m pip install --upgrade appbuilder-sdk\n```\n- For installation of `Java` and `Go` versions, as well as using `Docker` images, please refer to the [Installation Instructions](/docs/QuickStart/StartFirstAINativeApplication/install.md)\n\n\n## Quickly start your first AI native application!\n\n- Please install `appbuilder sdk` in a Python environment with `>=3.9` and use this end-to-end application example\n- The example provides a trial token, but access and QPS are restricted. Please replace it with your personal token for official use\n\n### 1. Large Language models\n- The `Playground` component can be freely called. You can customize the `prompt` template and model parameters for any model you have permission on the Baidu AI Cloud Qianfan model platform\n\n#### Code example\n\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 定义prompt模板\ntemplate_str = \"你扮演{role}, 请回答我的问题。\\n\\n问题：{question}。\\n\\n回答：\"\n\n# 定义输入，调用playground组件\ninput = appbuilder.Message({\"role\": \"java工程师\", \"question\": \"请简要回答java语言的内存回收机制是什么，要求100字以内\"})\n\nplayground = appbuilder.Playground(prompt_template=template_str, model=\"DeepSeek-V3.1\")\n\n# 以打字机的方式，流式展示大模型回答内容\noutput = playground(input, stream=True, temperature=1e-10)\nfor stream_message in output.content:\n    print(stream_message)\n\n# 流式输出结束后，可再次打印完整的大模型对话结果，除回答内容外，还包括token的用量情况\nprint(output.model_dump_json(indent=4))\n\n```\n#### Answer display\n\n```shell\nJava语言的\n内存回收机制是通过垃圾回收器（Garbage Collector）来实现的。\n垃圾回收器会自动检测不再使用的对象，并释放其占用的内存空间，从而确保系统的内存不会被耗尽。\nJava提供了多种垃圾回收器，如串行回收器、并行回收器、CMS回收器和G1回收器等，以满足不同场景下的性能需求\n。\n\n{\n    \"content\": \"Java语言的内存回收机制是通过垃圾回收器（Garbage Collector）来实现的。垃圾回收器会自动检测不再使用的对象，并释放其占用的内存空间，从而确保系统的内存不会被耗尽。Java提供了多种垃圾回收器，如串行回收器、并行回收器、CMS回收器和G1回收器等，以满足不同场景下的性能需求。\",\n    \"name\": \"msg\",\n    \"mtype\": \"dict\",\n    \"id\": \"2bbee989-40e3-45e4-9802-e144cdc829a9\",\n    \"extra\": {},\n    \"token_usage\": {\n        \"prompt_tokens\": 35,\n        \"completion_tokens\": 70,\n        \"total_tokens\": 105\n    }\n}\n```\n\n### 2. Component\n- The SDK provides over 40 high-quality components sourced from the Baidu ecosystem, as listed in [Component List](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz#3%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1), Before calling, you need to apply for a [free trial quota](https://console.bce.baidu.com/ai-engine/old/#/ai/ocr/overview/resource/list)\n- The component in the example is the `RAG with Baidu Search Pro`, which combines Baidu Search's search engine technology with the semantic understanding ability of ERNIE model to more accurately understand the user's search intention and provide search results with higher relevance to the search query\n\n#### Code Example\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\nrag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model=\"ERNIE-Lite-AppBuilder-8K\")\n\ninput = appbuilder.Message(\"9.11和9.8哪个大\")\nresult = rag_with_baidu_search_pro.run(\n    message=input,\n    instruction=appbuilder.Message(\"你是专业知识助手\"))\n\n# 输出运行结果\nprint(result.model_dump_json(indent=4))\n```\n\n#### Answer display\n```\n{\n    \"content\": \"9.11小于9.8。在比较两个小数的大小时，需要逐位比较它们的数值，包括整数部分和小数部分。对于9.11和9.8，整数部分都是9，所以需要在小数部分进行比较。小数点后的第一位是1和8，显然1小于8，所以9.11小于9.8。\",\n    \"name\": \"msg\",\n    \"mtype\": \"dict\",\n    \"id\": \"eb31b7de-dd6a-485f-adb9-1f7921a6f4bf\",\n    \"extra\": {\n        \"search_baidu\": [\n            {\n                \"content\": \"大模型‘智商’受质疑:9.11 vs 9...\",\n                \"icon\": \"https://appbuilder.bj.bcebos.com/baidu-search-rag-pro/icon/souhu.ico\",\n                \"url\": \"https://m.sohu.com/a/793754123_121924584/\",\n                \"ref_id\": \"2\",\n                \"site_name\": \"搜狐网\",\n                \"title\": \"大模型‘智商’受质疑:9.11 vs 9.8的比较揭示AI理解能力的...\"\n            },\n            {\n                \"content\": \"究竟|9.11比9.8大?大模型们为何会...\",\n                \"icon\": \"https://appbuilder.bj.bcebos.com/baidu-search-rag-pro/icon/tencent.svg.png\",\n                \"url\": \"https://new.qq.com/rain/a/20240717A07JLV00\",\n                \"ref_id\": \"4\",\n                \"site_name\": \"腾讯网\",\n                \"title\": \"究竟|9.11比9.8大?大模型们为何会在小学数学题上集体...\"\n            },\n            ...\n        ]\n    },\n    \"token_usage\": {\n        \"completion_tokens\": 77,\n        \"prompt_tokens\": 2008,\n        \"total_tokens\": 2085\n    }\n}\n```\n\n\n### 3. AI-native applications\n- The application in the example is: [Rap Mentor](https://appbuilder.baidu.com/s/3qfjXy7k)，Click on this link to try it out on the web page\n\n#### Code Example\n\n```python\nimport appbuilder\nimport os\n\n# 设置环境中的TOKEN，请替换为您的个人TOKEN\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# 从AppBuilder网页获取并传入应用ID，以下为说唱导师应用ID\napp_id = \"4678492a-5864-472e-810a-654538d3503c\"\n\napp_builder_client = appbuilder.AppBuilderClient(app_id)\nconversation_id = app_builder_client.create_conversation()\n\nanswer = app_builder_client.run(conversation_id, \"以“上班狼狈却又追逐梦想“为主题进行一首说唱创作，保持押韵, 控制在200字以内\")\nprint(answer.content.answer)\n```\n\n#### Answer display\n```shell\n好的，我们来以“上班狼狈却又追逐梦想”为主题，进行一段简短的说唱创作。这里是一个简单的示例，你可以根据自己的感觉进行调整：\n\nIntro:\n朝九晚五，生活重压，\n狼狈上班，却心怀梦想，\n每一天，都是新的挑战，\n为了那未来，我奋发向前。\n\nVerse 1:\n穿上西装，打好领带，\n步入人群，去追逐名利，\n虽然狼狈，却不曾言败，\n因为心中，有梦想在激励。\n\nHook:\n上班狼狈，却不曾放弃，\n追逐梦想，是我心中的火炬，\n照亮前路，指引我前行，\n无论多难，我都要坚持到底。\n\n这首小曲儿以“上班狼狈却又追逐梦想”为主题，通过押韵的方式表达了上班族虽然生活艰辛，但依然怀揣梦想，勇往直前的精神。希望你喜欢！\n```\n\n**For more examples of AI native application code, please refer to [CookBooks](./bookbooks/README.md)**. We have the following cookbooks that we recommend you to read first:\n- Basic Ability Components\n    - [General Text Recognition Component](/cookbooks/components/general_ocr.ipynb)\n    - [Basic component service-oriented deployment](/cookbooks/components/agent_runtime.ipynb)\n- Process orchestration\n    - [Assistant SDK](/cookbooks/pipeline/assistant_function_call.ipynb)\n- End-to-end applications\n    - [Agent](/cookbooks/agent_builder.ipynb)\n    - [RAG](/cookbooks/end2end_application/rag/rag.ipynb)\n    - [Enterprise level Q&A system](/cookbooks/end2end_application/rag/qa_system_2_dialogue.ipynb)\n- Advaned Practice\n    - [Deploying services on public cloud](/cookbooks/advanced_application/cloud_deploy.ipynb)\n    - [Service Tracing](/cookbooks/appbuilder_trace/trace.ipynb)\n\n\n## Panorama of Baidu AI Cloud Qianfan AppBuilder SDK capability\n<div align=\"center\">\n<img src='image/structure-en.png' alt='wechat' width='800' >\n</div>\n\n\n## User Documentation\n\n- [Home](https://github.com/baidubce/app-builder/blob/master/docs/README.md)\n    - Quick Start:\n        - Start your first AI-native application:\n            - [Installation](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/install.md)\n            - [Quick Start Guide](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/README.md)\n        - Industrial practice application examples:\n            - [SDK usage examples](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/ExamplesOfIndustrialPracticeApplications/README.md)\n        - [Currently supported programming languages by SDK](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/CurrentlySupportedProgrammingLanguages/README.md)\n    - Basics:\n        - Models:\n            - [Get model list](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Model/get_model_list.md)\n        - [Components](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Components)\n        - Monitoring:\n            - [TRACE basic functions](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/basic.md)\n            - [TRACE extended functions](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/phoenix_method.md)\n            - [Debug functionality](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/Debug.md)\n        - Deployment:\n            - [Interactive front-end deployment](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/AgentChainlit.md)\n            - [Public cloud deployment](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/cloud.md)\n            - [API access](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/flask.md)\n            - [AgentRuntime](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/agentruntime.md)\n            - [UserSession](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/usersession.md)\n        - Platform:\n            - Applications:\n                - [AppBuilderClient component](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/appbuilder_client.md)\n                - [Get the list of applications published by AppBuilder](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/get_app_list.md)\n            - Knowledge Base:\n                - [Knowledge Base component](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/KnowledgeBase/knowledgebase.md)\n            - Custom Components:\n                - [Basic capabilities component](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/CustomComponents/components.md)\n    - Applications:\n        - Agent:\n            - [Basic knowledge](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/BasicKnowledge/agent.md)\n            - [Using official components](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/UseOfficialComponents/use_official_components.md)\n            - [ToolCall](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/ToolCall/tool_call.md)\n            - [ToolChoice](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/ToolChoice/tool_choice.md)\n            - [Using asynchronous and streaming accelerated client calls](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n        - RAG:\n            - [Basic knowledge](https://github.com/baidubce/app-builder/blob/master/docs/Application/RAG/BasicKnowledge/rag.md)\n            - [Knowledge Base Management](https://github.com/baidubce/app-builder/blob/master/docs/Application/RAG/DatasetManage/dataset_manage.md)\n            - [Reference Information Processing](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n        - Workflow:\n            - [Basic knowledge](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [Assembling a RAG application from scratch using Workflow](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [Assembling an Agent application from scratch using Workflow](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n    - Developer Guide:\n        - [How to contribute code](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/HowToContributeCode/README.md)\n        - [Secondary Development](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/AdvancedDevelopment/README.md)\n        - [Version upgrade log](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ChangeLog/changelog.md)\n        - [Error messages](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ErrorMessage/error_message.md)\n        - [Environmental parameters](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/EnvironmentalParameters/env.md)\n\n## Open source community and activities\n<div align=\"center\">\n<h3>AppBuilder-SDK WeChat Group QR Code</h3>\n<img src='image/wechat_group.png' alt='wechat' width='200' >\n</div>\n\n- [Github Issue](https://github.com/baidubce/app-builder/issues):  Submit installation/usage issues, report bugs, suggest new features, communicate development plans, etc\n\n- [Baidu AI Cloud Qianfan Community](https://cloud.baidu.com/qianfandev)\n\n\n\n## License\n\nAppBuilder SDK follows the Apache 2.0 open source protocol.\n\n"
  },
  {
    "path": "docs/README_ja.md",
    "content": "<div align=\"center\">\n<img src='image/logo.png' alt='logo' width='700' >\n<br>\n\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE)\n![Supported Python versions](https://img.shields.io/badge/python-3.9+-orange.svg)\n![Supported OSs](https://img.shields.io/badge/os-linux%2C%20win%2C%20mac-yellow.svg)\n</div>\n\n[简体中文](../README.md) | [English](./README_en.md) | 日本語\n\n<br>\n\n\n## AppBuilder SDKとは？\n\nBaidu AI Cloud Qianfan AppBuilder SDKは、[Baidu AI Cloud Qianfan AppBuilder](https://appbuilder.cloud.baidu.com/)によって提供されるAIネイティブアプリケーション開発者向けの「ワンストップ開発ツール」です。\n\nBaidu AI Cloud Qianfan AppBuilder-SDKは、AIアプリケーション開発者向けに以下の基本機能を提供します：\n\n1. 利用\n\n    - 大規模言語モデルを利用し、Baidu AI Cloud Qianfan大規模モデルプラットフォームで自由にモデルにアクセスし、プロンプトを開発および最適化します。\n\n    - 機能コンポーネントを統合し、Baiduのエコシステムから提供される40以上の高品質なグループを提供し、エージェントアプリケーションに力を与えます。\n\n    - AIネイティブアプリケーションを統合し、[Baidu AI Cloud Qianfan AppBuilderプラットフォーム](https://console.bce.baidu.com/ai_apaas/app)で公開されたAIネイティブアプリケーションにAppBuilderClientを通じてアクセスおよび管理し、エンドクラウドコンポーネントをリンクするためにローカル関数を登録します。\n\n2. オーケストレーション\n\n    - 知識フローをオーケストレーションおよび管理し、KnowledgeBaseを通じて知識ベースを管理し、文書および知識スライスの作成、読み取り、更新、削除（CRUD）操作を実行し、Baidu AI Cloud Qianfan AppBuilderプラットフォームと共に業界グレードのRAGアプリケーションを開発します。\n\n    - ワークフローをオーケストレーションおよび自動化し、`Message`、`Component`、`AgentRuntime`などの多層ワークフロー抽象を提供し、ワークフローのオーケストレーションを実現し、LangChainやOpenAIなどの業界エコシステム機能と統合します。\n\n3. 監視\n    - 開発者が生産環境で使用するための可視化トレースおよび詳細なデバッグログなどの監視ツールを提供します。\n\n4. デプロイメント\n\n    - AgentRuntimeは、FlaskおよびGunicornに基づくAPIサービスとしてデプロイメントをサポートします。\n    - AgentRuntimeは、Chainlitに基づく対話型フロントエンドアプリケーションとしてデプロイメントをサポートします。\n    - プログラムをBaidu Cloudに迅速にデプロイし、パブリックネットワークAPIサービスを提供し、AppBuilderのワークフロー機能と統合するためのappbuilder_bce_deployツールを提供します。\n\n\n## どのようにインストールしますか？\n\n#### Baidu AI Cloud Qianfan AppBuilder SDKの最新バージョンは1.1.0（2025-06-20）です\n\nBaidu AI Cloud Qianfan AppBuilder SDKのリリースノートについては、[バージョン説明](DevelopGuide/ChangeLog/changelog.md)をご覧ください。\n\n- 最新の安定バージョンの`Python`をインストールすることをお勧めします。\n\n```bash\npython3 -m pip install --upgrade appbuilder-sdk\n```\n- `Java`および`Go`バージョンのインストールや`Docker`イメージの使用については、[インストール手順](QuickStart/StartFirstAINativeApplication/install.md)をご覧ください。\n\n\n## 最初のAIネイティブアプリケーションをすぐに開始しましょう！\n\n- `>=3.9`のPython環境に`appbuilder sdk`をインストールし、このエンドツーエンドアプリケーションの例を使用してください。\n- 例では試用トークンが提供されていますが、アクセスとQPSが制限されています。正式な使用には個人のトークンに置き換えてください。\n\n### 1. 大規模言語モデル\n- `Playground`コンポーネントは自由に呼び出すことができます。Baidu AI Cloud Qianfanモデルプラットフォームで許可された任意のモデルに対して、プロンプトテンプレートとモデルパラメータをカスタマイズできます。\n\n#### コード例\n\n```python\nimport appbuilder\nimport os\n\n# 環境変数にTOKENを設定します。以下のTOKENはアクセスとQPSが制限された試用TOKENです。正式な使用には個人のTOKENに置き換えてください。\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# プロンプトテンプレートを定義します。\ntemplate_str = \"あなたは{role}の役割を果たします。私の質問に答えてください。\\n\\n質問：{question}。\\n\\n回答：\"\n\n# 入力を定義し、playgroundコンポーネントを呼び出します。\ninput = appbuilder.Message({\"role\": \"Javaエンジニア\", \"question\": \"Java言語のメモリ回収メカニズムについて簡単に説明してください。100文字以内でお願いします。\"})\n\nplayground = appbuilder.Playground(prompt_template=template_str, model=\"DeepSeek-V3.1\")\n\n# タイプライターのように、ストリーム形式で大規模モデルの回答内容を表示します。\noutput = playground(input, stream=True, temperature=1e-10)\nfor stream_message in output.content:\n    print(stream_message)\n\n# ストリーム出力が終了した後、再度完全な大規模モデルの対話結果を表示できます。回答内容の他に、トークンの使用量も含まれます。\nprint(output.model_dump_json(indent=4))\n\n```\n#### 回答表示\n\n```shell\nJava言語の\nメモリ回収メカニズムは、ガベージコレクタ（Garbage Collector）を通じて実現されます。\nガベージコレクタは、使用されなくなったオブジェクトを自動的に検出し、その占有するメモリ空間を解放します。これにより、システムのメモリが枯渇しないようにします。\nJavaは、シリアルコレクタ、パラレルコレクタ、CMSコレクタ、G1コレクタなど、さまざまなガベージコレクタを提供しており、異なるシナリオでのパフォーマンス要件に対応しています。\n\n{\n    \"content\": \"Java言語のメモリ回収メカニズムは、ガベージコレクタ（Garbage Collector）を通じて実現されます。ガベージコレクタは、使用されなくなったオブジェクトを自動的に検出し、その占有するメモリ空間を解放します。これにより、システムのメモリが枯渇しないようにします。Javaは、シリアルコレクタ、パラレルコレクタ、CMSコレクタ、G1コレクタなど、さまざまなガベージコレクタを提供しており、異なるシナリオでのパフォーマンス要件に対応しています。\",\n    \"name\": \"msg\",\n    \"mtype\": \"dict\",\n    \"id\": \"2bbee989-40e3-45e4-9802-e144cdc829a9\",\n    \"extra\": {},\n    \"token_usage\": {\n        \"prompt_tokens\": 35,\n        \"completion_tokens\": 70,\n        \"total_tokens\": 105\n    }\n}\n```\n\n### 2. コンポーネントの呼び出し\n- SDKは、Baiduのエコシステムから提供される40以上の高品質なコンポーネントを提供しています。リストは[コンポーネントリスト](https://cloud.baidu.com/doc/AppBuilder/s/Glqb6dfiz#3%E3%80%81%E5%BC%80%E9%80%9A%E7%BB%84%E4%BB%B6%E6%9C%8D%E5%8A%A1)で確認できます。呼び出す前に[無料試用クォータ](https://console.bce.baidu.com/ai-engine/old/#/ai/ocr/overview/resource/list)を申請してください。\n- 例のコンポーネントは`RAG with Baidu Search Pro`で、Baidu Searchの検索エンジン技術とERNIEモデルのセマンティック理解能力を組み合わせて、ユーザーの検索意図をより正確に理解し、検索クエリに関連性の高い検索結果を提供します。\n\n#### コード例\n```python\nimport appbuilder\nimport os\n\n# 環境変数にTOKENを設定します。以下のTOKENはアクセスとQPSが制限された試用TOKENです。正式な使用には個人のTOKENに置き換えてください。\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\nrag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model=\"ERNIE-Lite-AppBuilder-8K\")\n\ninput = appbuilder.Message(\"9.11と9.8のどちらが大きいですか？\")\nresult = rag_with_baidu_search_pro.run(\n    message=input,\n    instruction=appbuilder.Message(\"あなたは専門知識アシスタントです\"))\n\n# 実行結果を出力します。\nprint(result.model_dump_json(indent=4))\n```\n\n#### 回答表示\n```shell\n{\n    \"content\": \"9.11は9.8より小さいです。小数の大小を比較する際には、整数部分と小数部分の数値を逐次比較する必要があります。9.11と9.8の場合、整数部分はどちらも9なので、小数部分で比較する必要があります。小数点後の最初の桁は1と8であり、明らかに1は8より小さいため、9.11は9.8より小さいです。\",\n    \"name\": \"msg\",\n    \"mtype\": \"dict\",\n    \"id\": \"eb31b7de-dd6a-485f-adb9-1f7921a6f4bf\",\n    \"extra\": {\n        \"search_baidu\": [\n            {\n                \"content\": \"大規模モデルの「知能」が疑問視される:9.11 vs 9...\",\n                \"icon\": \"https://appbuilder.bj.bcebos.com/baidu-search-rag-pro/icon/souhu.ico\",\n                \"url\": \"https://m.sohu.com/a/793754123_121924584/\",\n                \"ref_id\": \"2\",\n                \"site_name\": \"搜狐网\",\n                \"title\": \"大規模モデルの「知能」が疑問視される:9.11 vs 9.8の比較がAIの理解能力を明らかにする...\"\n            },\n            {\n                \"content\": \"究極|9.11は9.8より大きい？大規模モデルはなぜ...\",\n                \"icon\": \"https://appbuilder.bj.bcebos.com/baidu-search-rag-pro/icon/tencent.svg.png\",\n                \"url\": \"https://new.qq.com/rain/a/20240717A07JLV00\",\n                \"ref_id\": \"4\",\n                \"site_name\": \"腾讯网\",\n                \"title\": \"究極|9.11は9.8より大きい？大規模モデルはなぜ小学校の数学問題で集団的に...\"\n            },\n            ...\n        ]\n    },\n    \"token_usage\": {\n        \"completion_tokens\": 77,\n        \"prompt_tokens\": 2008,\n        \"total_tokens\": 2085\n    }\n}\n```\n\n\n### 3. AIネイティブアプリケーションの呼び出し\n- 例のアプリケーションは：[ラップメンター](https://appbuilder.baidu.com/s/3qfjXy7k)です。このリンクをクリックしてウェブページで試してみてください。\n\n#### コード例\n\n```python\nimport appbuilder\nimport os\n\n# 環境変数にTOKENを設定します。以下のTOKENはアクセスとQPSが制限された試用TOKENです。正式な使用には個人のTOKENに置き換えてください。\nos.environ[\"APPBUILDER_TOKEN\"] = \"your api key\"\n\n# AppBuilderのウェブページからアプリケーションIDを取得し、以下にラップメンターのアプリケーションIDを入力します。\napp_id = \"4678492a-5864-472e-810a-654538d3503c\"\n\napp_builder_client = appbuilder.AppBuilderClient(app_id)\nconversation_id = app_builder_client.create_conversation()\n\nanswer = app_builder_client.run(conversation_id, \"「上班狼狈却又追逐梦想」をテーマにラップを作成してください。押韻を保ち、200文字以内にしてください。\")\nprint(answer.content.answer)\n```\n\n#### 回答表示\n```shell\nわかりました。「上班狼狈却又追逐梦想」をテーマに、簡単なラップを作成します。以下は簡単な例です。自分の感覚に合わせて調整してください。\n\nイントロ:\n朝九晚五、生活の重圧、\n狼狈上班、しかし夢を追いかける、\n毎日が新たな挑戦、\n未来のために、私は前進する。\n\nバース1:\nスーツを着て、ネクタイを締めて、\n人混みに入って、名声を追い求める、\n狼狈しても、決して諦めない、\n心の中に、夢があるから。\n\nフック:\n上班狼狈、しかし決して諦めない、\n夢を追いかける、それが私の心の灯、\n前方を照らし、私を導く、\nどんなに困難でも、私は最後まで頑張る。\n\nこの小曲は「上班狼狈却又追逐梦想」をテーマに、押韻を通じて上班族が生活の苦しさにもかかわらず、夢を抱いて前進する精神を表現しています。気に入っていただけると幸いです！\n```\n\n**AIネイティブアプリケーションのコード例については、[Cookbooks](./cookbooks/README.md)をご覧ください。以下のクックブックを優先的にお勧めします：**\n- 基本機能コンポーネント\n    - [一般的なテキスト認識コンポーネント](/cookbooks/components/general_ocr.ipynb)\n    - [基本コンポーネントのサービス指向デプロイメント](/cookbooks/components/agent_runtime.ipynb)\n- プロセスオーケストレーション\n    - [Assistant SDK](/cookbooks/pipeline/assistant_function_call.ipynb)\n- エンドツーエンドアプリケーション\n    - [エージェント](/cookbooks/agent_builder.ipynb)\n    - [RAG](/cookbooks/end2end_application/rag/rag.ipynb)\n    - [企業レベルのQ&Aシステム](/cookbooks/end2end_application/rag/qa_system_2_dialogue.ipynb)\n- 高度な実践\n    - [パブリッククラウドへのサービスデプロイメント](/cookbooks/advanced_application/cloud_deploy.ipynb)\n    - [サービストレース](/cookbooks/appbuilder_trace/trace.ipynb)\n\n\n## Baidu AI Cloud Qianfan AppBuilder SDKの機能全景\n<div align=\"center\">\n<img src='image/structure-en.png' alt='wechat' width='800' >\n</div>\n\n\n## ユーザードキュメント\n\n- [ホームページ](https://github.com/baidubce/app-builder/blob/master/docs/README.md)\n    - クイックスタート: \n        - 最初のAIネイティブアプリケーションを開始する: \n            - [インストール](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/install.md)\n            - [クイックスタートガイド](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/StartFirstAINativeApplication/README.md)\n        - 産業実践アプリケーション例: \n            - [SDK使用例](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/ExamplesOfIndustrialPracticeApplications/README.md)\n        - [現在SDKがサポートしているプログラミング言語](https://github.com/baidubce/app-builder/blob/master/docs/QuickStart/CurrentlySupportedProgrammingLanguages/README.md)\n    - 基本:\n        - モデル:\n            - [モデルリストの取得](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Model/get_model_list.md)\n        - [コンポーネント](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Components)\n        - 監視:\n            - [TRACE基本機能](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/basic.md)\n            - [TRACE拡張機能](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/phoenix_method.md)\n            - [Debug機能](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Trace/Debug.md)\n        - デプロイ:\n            - [インタラクティブなフロントエンドデプロイ](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/AgentChainlit.md)\n            - [パブリッククラウドデプロイ](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/cloud.md)\n            - [API アクセス](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/flask.md)\n            - [AgentRuntime](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/agentruntime.md)\n            - [UserSession](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Deployment/usersession.md)\n        - プラットフォーム:\n            - アプリケーション:\n                - [AppBuilderClientコンポーネント](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/appbuilder_client.md)\n                - [AppBuilderで公開されたアプリケーションリストの取得](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/Application/get_app_list.md)\n            - ナレッジベース:\n                - [ナレッジベースコンポーネント](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/KnowledgeBase/knowledgebase.md)\n            - カスタムコンポーネント:\n                - [基本機能コンポーネント](https://github.com/baidubce/app-builder/blob/master/docs/BasisModule/Platform/CustomComponents/components.md)\n    - アプリケーション:\n        - エージェント:\n            - [基本知識](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [公式コンポーネントの使用](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/UseOfficialComponents/use_official_components.md)\n            - [ToolCall](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/ToolCall/tool_call.md)\n            - [ToolChoice](https://github.com/baidubce/app-builder/blob/master/docs/Application/Agent/ToolChoice/tool_choice.md)\n            - [非同期およびストリーミングを使用してクライアント呼び出しを加速する](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n        - RAG:\n            - [基本知識](https://github.com/baidubce/app-builder/blob/master/docs/Application/RAG/BasicKnowledge/rag.md)\n            - [ナレッジベース管理](https://github.com/baidubce/app-builder/blob/master/docs/Application/RAG/DatasetManage/dataset_manage.md)\n            - [Reference情報処理](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n        - ワークフロー:\n            - [基本知識](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [Workflowを使ってRAGアプリケーションをゼロから組み立てる](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n            - [Workflowを使ってAgentアプリケーションをゼロから組み立てる](https://github.com/baidubce/app-builder/blob/master/docs/Tools/DocPass/DocPass.md)\n    - 開発者ガイド:\n        - [コードの貢献方法](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/HowToContributeCode/README.md)\n        - [にじかいせっか](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/AdvancedDevelopment/README.md)\n        - [バージョンアップログ](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ChangeLog/changelog.md)\n        - [エラーメッセージ](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/ErrorMessage/error_message.md)\n        - [環境パラメータ](https://github.com/baidubce/app-builder/blob/master/docs/DevelopGuide/EnvironmentalParameters/env.md)\n\n\n## オープンソースコミュニティと活動\n<div align=\"center\">\n<h3>AppBuilder-SDK WeChatグループQRコード</h3>\n<img src='image/wechat_group.png' alt='wechat' width='200' >\n</div>\n\n- [Github Issue](https://github.com/baidubce/app-builder/issues):  インストール/使用の問題を提出し、バグを報告し、新機能を提案し、開発計画をコミュニケーションします。\n\n- [Baidu AI Cloud Qianfan Community](https://cloud.baidu.com/qianfandev)\n\n\n\n## ライセンス\n\nAppBuilder SDKはApache 2.0オープンソースプロトコルに従います。\n\n"
  },
  {
    "path": "docs/Tools/DocPass/DocPass.md",
    "content": "# 文档更新中，敬请期待"
  },
  {
    "path": "docs/Tools/JavaAPI/JavaAPI.md",
    "content": "# Java API Reference\n\n- [Java API](index.html)\n    - [All API List](index-all.html)\n    - [帮助文档](help-doc.html)"
  },
  {
    "path": "docs/Tools/JavaAPI/READEME.md",
    "content": "# Appbuilder-SDK Java 自动文档生成\n\n## 操作流程\n\n- 完成SDK代码开发\n- 依照google规范编写注释--仅需要对类和非私有方法进行注释\n- 进入根目录的docs/Tools/JavaAPI目录下执行java_api_update.sh脚本\n\n## 脚本功能\n\n- 依据注释自动生成文档，并将文档迁移到docs/API-Reference/Java目录下\n\n## 代码注释规范\n\n### 基本格式\n\nJavadoc注释是用/**开始，用\\*/结束的，位于类、方法或字段之前。例如\n\n```java\n/**\n * 这是一个用于演示的类。\n */\npublic class Demo {\n}\n```\n\n### 类和接口注释\n\n对于类和接口，Javadoc注释应该解释其整体功能和用途，以及如何与其他类或接口交互\n\n```java\n/**\n * 这是一个计算工具类，提供静态方法来进行数学计算。\n */\npublic class MathUtils {\n    // ...\n}\n```\n\n### 方法注释\n\n每个公共和受保护的方法应该有Javadoc注释，说明方法的作用、参数、返回值以及可能抛出的异常。\n\n- `@param` 用来描述参数\n- `@return` 描述返回值（如果方法不返回任何内容，则不需要此标签）\n- `@throws` 或 `@exception` 描述可能抛出的异常\n\n```java\n/**\n * 计算两个整数的和。\n *\n * @param a 第一个整数\n * @param b 第二个整数\n * @return 两个整数的和\n */\npublic static int add(int a, int b) {\n    return a + b;\n}\n```\n\n### 字段注释\n\n公共字段应有简短的注释说明其作用。如果字段的用途不是显而易见的，应该提供详细的描述。\n\n```java\n/**\n * 默认的错误消息。\n */\npublic static final String DEFAULT_ERROR_MESSAGE = \"An error occurred.\";\n```\n\n### 通用标签\n\n除了上述特定标签外，Javadoc还支持以下一些通用标签：\n\n- `@see` 参考其他相关类、方法或文档\n- `@since` 指明从哪个版本开始添加的\n- `@version` 标明当前代码的版本\n- `@deprecated` 指明方法或类不再推荐使用\n\n```java\n/**\n * @deprecated 由于安全问题，此方法从版本1.5开始不推荐使用。\n */\n@Deprecated\npublic void oldMethod() {\n    // ...\n}\n```\n\n"
  },
  {
    "path": "docs/Tools/JavaAPI/java_api_update.sh",
    "content": "#1、清除生成文档环境\ncd ../../..\nrm -rf java/doc\nrm -rf docs/API-Reference/Java/*\n\n# 2、生成Java API文档\ncd java\njavadoc -d doc -sourcepath src/main/java -subpackages com.baidubce.appbuilder -exclude com.baidubce.appbuilder.base -encoding UTF-8 -charset UTF-8 -public\n\n# 3、迁移文档到docs目录，并删除java/doc目录\ncd ..\ncp -r java/doc/* docs/API-Reference/Java\nrm -rf java/doc\n\n# 4、辅助Java API文档目录文档到docs目录\ncp docs/Tools/JavaAPI/JavaAPI.md docs/API-Reference/Java"
  },
  {
    "path": "docs/Tools/MarkdownSh/markdown2rst.py",
    "content": "# The MIT License (MIT)\n\n# Copyright (c) 2016 Hitoruki Takagi\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n\n# The above copyright notice and this permission notice shall be included in all\n# copies or substantial portions of the Software.\n\n#!/usr/bin/env python3\n\"\"\"\n    markdown to rst\n\"\"\"\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function, unicode_literals\nimport os\nimport os.path\nimport re\nimport sys\nfrom argparse import ArgumentParser, Namespace\n\nfrom docutils import statemachine, nodes, io, utils\nfrom docutils.parsers import rst\nfrom docutils.core import ErrorString\nfrom docutils.utils import SafeString, column_width\nimport mistune\n\nif sys.version_info < (3, ):\n    from codecs import open as _open\n    from urlparse import urlparse\nelse:\n    _open = open\n    from urllib.parse import urlparse\n\n__version__ = '0.2.1'\n_is_sphinx = False\nprolog = '''\\\n.. role:: raw-html-m2r(raw)\n   :format: html\n\n'''\n\n# for command-line use\nparser = ArgumentParser()\noptions = Namespace()\nparser.add_argument(\n    'input_file', nargs='*', help='files to convert to reST format')\nparser.add_argument(\n    '--overwrite',\n    action='store_true',\n    default=False,\n    help='overwrite output file without confirmaion')\nparser.add_argument(\n    '--dry-run',\n    action='store_true',\n    default=False,\n    help='print conversion result and not save output file')\nparser.add_argument(\n    '--no-underscore-emphasis',\n    action='store_true',\n    default=False,\n    help='do not use underscore (_) for emphasis')\nparser.add_argument(\n    '--parse-relative-links',\n    action='store_true',\n    default=False,\n    help='parse relative links into ref or doc directives')\nparser.add_argument(\n    '--anonymous-references',\n    action='store_true',\n    default=False,\n    help='use anonymous references in generated rst')\nparser.add_argument(\n    '--disable-inline-math',\n    action='store_true',\n    default=False,\n    help='disable parsing inline math')\nparser.add_argument(\n    '--output_file',\n    default=None,\n    help='files to save reST file')\n\n\ndef parse_options():\n    \"\"\"parse_options\"\"\"\n    parser.parse_known_args(namespace=options)\n\n\nclass RestBlockGrammar(mistune.BlockGrammar):\n    \"\"\"RestBlockGrammar\"\"\"\n    directive = re.compile(\n        r'^( *\\.\\..*?)\\n(?=\\S)',\n        re.DOTALL | re.MULTILINE, )\n    oneline_directive = re.compile(\n        r'^( *\\.\\..*?)$',\n        re.DOTALL | re.MULTILINE, )\n    rest_code_block = re.compile(\n        r'^::\\s*$',\n        re.DOTALL | re.MULTILINE, )\n\n\nclass RestBlockLexer(mistune.BlockLexer):\n    \"\"\"RestBlockLexer\"\"\"\n    grammar_class = RestBlockGrammar\n    default_rules = [\n        'directive',\n        'oneline_directive',\n        'rest_code_block',\n    ] + mistune.BlockLexer.default_rules\n\n    def parse_directive(self, m):\n        \"\"\"parse_directive\"\"\"\n        self.tokens.append({\n            'type': 'directive',\n            'text': m.group(1),\n        })\n\n    def parse_oneline_directive(self, m):\n        \"\"\"parse_oneline_directive\"\"\"\n        # reuse directive output\n        self.tokens.append({\n            'type': 'directive',\n            'text': m.group(1),\n        })\n\n    def parse_rest_code_block(self, m):\n        \"\"\"parse_rest_code_block\"\"\"\n        self.tokens.append({'type': 'rest_code_block', })\n\n\nclass RestInlineGrammar(mistune.InlineGrammar):\n    \"\"\"RestInlineGrammar\"\"\"\n    image_link = re.compile(\n        r'\\[!\\[(?P<alt>.*?)\\]\\((?P<url>.*?)\\).*?\\]\\((?P<target>.*?)\\)')\n    rest_role = re.compile(r':.*?:`.*?`|`[^`]+`:.*?:')\n    rest_link = re.compile(r'`[^`]*?`_')\n    inline_math = re.compile(r'.*\\$(.*)?\\$')\n    eol_literal_marker = re.compile(r'(\\s+)?::\\s*$')\n    # add colon and space as special text\n    text = re.compile(r'^[\\s\\S]+?(?=[\\\\<!\\[:_*`~ ]|https?://| {2,}\\n|$)')\n    # __word__ or **word**\n    double_emphasis = re.compile(r'^([_*]){2}(?P<text>[\\s\\S]+?)\\1{2}(?!\\1)')\n    # _word_ or *word*\n    emphasis = re.compile(r'^\\b_((?:__|[^_])+?)_\\b'  # _word_\n                          r'|'\n                          r'^\\*(?P<text>(?:\\*\\*|[^\\*])+?)\\*(?!\\*)'  # *word*\n                          )\n\n    def no_underscore_emphasis(self):\n        \"\"\"no_underscore_emphasis\"\"\"\n        self.double_emphasis = re.compile(\n            r'^\\*{2}(?P<text>[\\s\\S]+?)\\*{2}(?!\\*)'  # **word**\n        )\n        self.emphasis = re.compile(\n            r'^\\*(?P<text>(?:\\*\\*|[^\\*])+?)\\*(?!\\*)'  # *word*\n        )\n\n\nclass RestInlineLexer(mistune.InlineLexer):\n    \"\"\"RestInlineLexer\"\"\"\n    grammar_class = RestInlineGrammar\n    default_rules = [\n        'image_link',\n        'rest_role',\n        'rest_link',\n        'eol_literal_marker',\n    ] + mistune.InlineLexer.default_rules\n\n    def __init__(self, *args, **kwargs):\n        no_underscore_emphasis = kwargs.pop('no_underscore_emphasis', False)\n        disable_inline_math = kwargs.pop('disable_inline_math', False)\n        super(RestInlineLexer, self).__init__(*args, **kwargs)\n        if not _is_sphinx:\n            parse_options()\n        if no_underscore_emphasis or getattr(options, 'no_underscore_emphasis',\n                                             False):\n            self.rules.no_underscore_emphasis()\n        inline_maths = 'inline_math' in self.default_rules\n        if disable_inline_math or getattr(options, 'disable_inline_math',\n                                          False):\n            if inline_maths:\n                self.default_rules.remove('inline_math')\n        elif not inline_maths:\n            self.default_rules.insert(0, 'inline_math')\n\n    def output_double_emphasis(self, m):\n        \"\"\"output_double_emphasis\"\"\"\n        # may include code span\n        text = self.output(m.group('text'))\n        return self.renderer.double_emphasis(text)\n\n    def output_emphasis(self, m):\n        \"\"\"output_emphasis\"\"\"\n        # may include code span\n        text = self.output(m.group('text') or m.group(1))\n        return self.renderer.emphasis(text)\n\n    def output_image_link(self, m):\n        \"\"\"Pass through rest role.\"\"\"\n        return self.renderer.image_link(\n            m.group('url'), m.group('target'), m.group('alt'))\n\n    def output_rest_role(self, m):\n        \"\"\"Pass through rest role.\"\"\"\n        return self.renderer.rest_role(m.group(0))\n\n    def output_rest_link(self, m):\n        \"\"\"Pass through rest link.\"\"\"\n        return self.renderer.rest_link(m.group(0))\n\n    def output_inline_math(self, m):\n        \"\"\"Pass through rest link.\"\"\"\n        return self.renderer.inline_math(m.group(0))\n\n    def output_eol_literal_marker(self, m):\n        \"\"\"Pass through rest link.\"\"\"\n        marker = ':' if m.group(1) is None else ''\n        return self.renderer.eol_literal_marker(marker)\n\n\nclass RestRenderer(mistune.Renderer):\n    \"\"\"RestRenderer\"\"\"\n    _include_raw_html = False\n    list_indent_re = re.compile(r'^(\\s*(#\\.|\\*)\\s)')\n    indent = ' ' * 3\n    list_marker = '{#__rest_list_mark__#}'\n    hmarks = {\n        1: '=',\n        2: '-',\n        3: '^',\n        4: '~',\n        5: '\"',\n        6: '#',\n    }\n\n    def __init__(self, *args, **kwargs):\n        self.parse_relative_links = kwargs.pop('parse_relative_links', False)\n        self.anonymous_references = kwargs.pop('anonymous_references', False)\n        super(RestRenderer, self).__init__(*args, **kwargs)\n        if not _is_sphinx:\n            parse_options()\n            if getattr(options, 'parse_relative_links', False):\n                self.parse_relative_links = options.parse_relative_links\n            if getattr(options, 'anonymous_references', False):\n                self.anonymous_references = options.anonymous_references\n\n    def _indent_block(self, block):\n        return '\\n'.join(self.indent + line if line else ''\n                         for line in block.splitlines())\n\n    def _raw_html(self, html):\n        self._include_raw_html = True\n        return '\\ :raw-html-m2r:`{}`\\ '.format(html)\n\n    def block_code(self, code, lang=None):\n        \"\"\"block_code\"\"\"\n        if lang == 'math':\n            first_line = '\\n.. math::\\n\\n'\n        elif lang:\n            first_line = '\\n.. code-block:: {}\\n\\n'.format(lang)\n        elif _is_sphinx:\n            first_line = '\\n.. code-block:: guess\\n\\n'\n        else:\n            first_line = '\\n.. code-block::\\n\\n'\n        return first_line + self._indent_block(code) + '\\n'\n\n    def block_quote(self, text):\n        \"\"\"block_quote\"\"\"\n        # text includes some empty line\n        return '\\n..\\n\\n{}\\n\\n'.format(self._indent_block(text.strip('\\n')))\n\n    def block_html(self, html):\n        \"\"\"Rendering block level pure html content.\n\n        :param html: text content of the html snippet.\n        \"\"\"\n        return '\\n\\n.. raw:: html\\n\\n' + self._indent_block(html) + '\\n\\n'\n\n    def header(self, text, level, raw=None):\n        \"\"\"Rendering header/heading tags like ``<h1>`` ``<h2>``.\n\n        :param text: rendered text content for the header.\n        :param level: a number for the header level, for example: 1.\n        :param raw: raw text content of the header.\n        \"\"\"\n        return '\\n{0}\\n{1}\\n'.format(text,\n                                     self.hmarks[level] * column_width(text))\n\n    def hrule(self):\n        \"\"\"Rendering method for ``<hr>`` tag.\"\"\"\n        return '\\n----\\n'\n\n    def list(self, body, ordered=True):\n        \"\"\"Rendering list tags like ``<ul>`` and ``<ol>``.\n\n        :param body: body contents of the list.\n        :param ordered: whether this list is ordered or not.\n        \"\"\"\n        mark = '#. ' if ordered else '* '\n        lines = body.splitlines()\n        for i, line in enumerate(lines):\n            if line and not line.startswith(self.list_marker):\n                lines[i] = ' ' * len(mark) + line\n        return '\\n{}\\n'.format('\\n'.join(lines)).replace(self.list_marker,\n                                                         mark)\n\n    def list_item(self, text):\n        \"\"\"Rendering list item snippet. Like ``<li>``.\"\"\"\n        return '\\n' + self.list_marker + text\n\n    def paragraph(self, text):\n        \"\"\"Rendering paragraph tags. Like ``<p>``.\"\"\"\n        return '\\n' + text + '\\n'\n\n    def table(self, header, body):\n        \"\"\"Rendering table element. Wrap header and body in it.\n\n        :param header: header part of the table.\n        :param body: body part of the table.\n        \"\"\"\n        table = '\\n.. list-table::\\n'\n        if header and not header.isspace():\n            table = (table + self.indent + ':header-rows: 1\\n\\n' +\n                     self._indent_block(header) + '\\n')\n        else:\n            table = table + '\\n'\n        table = table + self._indent_block(body) + '\\n\\n'\n        return table\n\n    def table_row(self, content):\n        \"\"\"Rendering a table row. Like ``<tr>``.\n\n        :param content: content of current table row.\n        \"\"\"\n        contents = content.splitlines()\n        if not contents:\n            return ''\n        clist = ['* ' + contents[0]]\n        if len(contents) > 1:\n            for c in contents[1:]:\n                clist.append('  ' + c)\n        return '\\n'.join(clist) + '\\n'\n\n    def table_cell(self, content, **flags):\n        \"\"\"Rendering a table cell. Like ``<th>`` ``<td>``.\n\n        :param content: content of current table cell.\n        :param header: whether this is header or not.\n        :param align: align of current table cell.\n        \"\"\"\n        return '- ' + content + '\\n'\n\n    def double_emphasis(self, text):\n        \"\"\"Rendering **strong** text.\n\n        :param text: text content for emphasis.\n        \"\"\"\n        return '\\ **{}**\\ '.format(text)\n\n    def emphasis(self, text):\n        \"\"\"Rendering *emphasis* text.\n\n        :param text: text content for emphasis.\n        \"\"\"\n        return '\\ *{}*\\ '.format(text)\n\n    def codespan(self, text):\n        \"\"\"Rendering inline `code` text.\n\n        :param text: text content for inline code.\n        \"\"\"\n        if '``' not in text:\n            return '\\ ``{}``\\ '.format(text)\n        else:\n            # actually, docutils split spaces in literal\n            return self._raw_html('<code class=\"docutils literal\">'\n                                  '<span class=\"pre\">{}</span>'\n                                  '</code>'.format(\n                                      text.replace('`', '&#96;')))\n\n    def linebreak(self):\n        \"\"\"Rendering line break like ``<br>``.\"\"\"\n        if self.options.get('use_xhtml'):\n            return self._raw_html('<br />') + '\\n'\n        return self._raw_html('<br>') + '\\n'\n\n    def strikethrough(self, text):\n        \"\"\"Rendering ~~strikethrough~~ text.\n\n        :param text: text content for strikethrough.\n        \"\"\"\n        return self._raw_html('<del>{}</del>'.format(text))\n\n    def text(self, text):\n        \"\"\"Rendering unformatted text.\n\n        :param text: text content.\n        \"\"\"\n        return text\n\n    def autolink(self, link, is_email=False):\n        \"\"\"Rendering a given link or email address.\n\n        :param link: link content or email address.\n        :param is_email: whether this is an email or not.\n        \"\"\"\n        return link\n\n    def link(self, link, title, text):\n        \"\"\"Rendering a given link with content and title.\n\n        :param link: href link for ``<a>`` tag.\n        :param title: title content for `title` attribute.\n        :param text: text content for description.\n        \"\"\"\n        if self.anonymous_references:\n            underscore = '__'\n        else:\n            underscore = '_'\n        if title:\n            return self._raw_html(\n                '<a href=\"{link}\" title=\"{title}\">{text}</a>'.format(\n                    link=link, title=title, text=text))\n        if not self.parse_relative_links:\n            return '\\ `{text} <{target}>`{underscore}\\ '.format(\n                target=link, text=text, underscore=underscore)\n        else:\n            url_info = urlparse(link)\n            if url_info.scheme:\n                return '\\ `{text} <{target}>`{underscore}\\ '.format(\n                    target=link, text=text, underscore=underscore)\n            else:\n                link_type = 'doc'\n                anchor = url_info.fragment\n                if url_info.fragment:\n                    if url_info.path:\n                        # Can't link to anchors via doc directive.\n                        anchor = ''\n                    else:\n                        # Example: [text](#anchor)\n                        link_type = 'ref'\n                doc_link = '{doc_name}{anchor}'.format(\n                    # splittext approach works whether or not path is set. It\n                    # will return an empty string if unset, which leads to\n                    # anchor only ref.\n                    doc_name=os.path.splitext(url_info.path)[0],\n                    anchor=anchor)\n                return '\\ :{link_type}:`{text} <{doc_link}>`\\ '.format(\n                    link_type=link_type, doc_link=doc_link, text=text)\n\n    def image(self, src, title, text):\n        \"\"\"Rendering a image with title and text.\n\n        :param src: source link of the image.\n        :param title: title text of the image.\n        :param text: alt text of the image.\n        \"\"\"\n        # rst does not support title option\n        # and I couldn't find title attribute in HTML standard\n        return '\\n'.join([\n            '',\n            '.. image:: {}'.format(src),\n            '   :target: {}'.format(src),\n            '   :alt: {}'.format(text),\n            '',\n        ])\n\n    def inline_html(self, html):\n        \"\"\"Rendering span level pure html content.\n\n        :param html: text content of the html snippet.\n        \"\"\"\n        return self._raw_html(html)\n\n    def newline(self):\n        \"\"\"Rendering newline element.\"\"\"\n        return ''\n\n    def footnote_ref(self, key, index):\n        \"\"\"Rendering the ref anchor of a footnote.\n\n        :param key: identity key for the footnote.\n        :param index: the index count of current footnote.\n        \"\"\"\n        return '\\ [#fn-{}]_\\ '.format(key)\n\n    def footnote_item(self, key, text):\n        \"\"\"Rendering a footnote item.\n\n        :param key: identity key for the footnote.\n        :param text: text content of the footnote.\n        \"\"\"\n        return '.. [#fn-{0}] {1}\\n'.format(key, text.strip())\n\n    def footnotes(self, text):\n        \"\"\"Wrapper for all footnotes.\n\n        :param text: contents of all footnotes.\n        \"\"\"\n        if text:\n            return '\\n\\n' + text\n        else:\n            return ''\n\n    \"\"\"Below outputs are for rst.\"\"\"\n\n    def image_link(self, url, target, alt):\n        \"\"\"image_link\"\"\"\n        return '\\n'.join([\n            '',\n            '.. image:: {}'.format(url),\n            '   :target: {}'.format(target),\n            '   :alt: {}'.format(alt),\n            '',\n        ])\n\n    def rest_role(self, text):\n        \"\"\"rest_role\"\"\"\n        return text\n\n    def rest_link(self, text):\n        \"\"\"rest_link\"\"\"\n        return text\n\n    def inline_math(self, math):\n        \"\"\"Extension of recommonmark\"\"\"\n        return re.sub(r'\\$(.*?)\\$',\n                      lambda x: '\\ :math:`{}`\\ '.format(x.group(1)), math)\n\n    def eol_literal_marker(self, marker):\n        \"\"\"Extension of recommonmark\"\"\"\n        return marker\n\n    def directive(self, text):\n        \"\"\"directive\"\"\"\n        return '\\n' + text + '\\n'\n\n    def rest_code_block(self):\n        \"\"\"rest_code_block\"\"\"\n        return '\\n\\n'\n\n\nclass M2R(mistune.Markdown):\n    \"\"\"M2R\"\"\"\n\n    def __init__(self,\n                 renderer=None,\n                 inline=RestInlineLexer,\n                 block=RestBlockLexer,\n                 **kwargs):\n        if renderer is None:\n            renderer = RestRenderer(**kwargs)\n        super(M2R, self).__init__(\n            renderer, inline=inline, block=block, **kwargs)\n\n    def parse(self, text):\n        \"\"\"parse\"\"\"\n        output = super(M2R, self).parse(text)\n        return self.post_process(output)\n\n    def output_directive(self):\n        \"\"\"output_directive\"\"\"\n        return self.renderer.directive(self.token['text'])\n\n    def output_rest_code_block(self):\n        \"\"\"output_rest_code_block\"\"\"\n        return self.renderer.rest_code_block()\n\n    def post_process(self, text):\n        \"\"\"post_process\"\"\"\n        output = (text.replace('\\\\ \\n', '\\n').replace('\\n\\\\ ', '\\n')\n                  .replace(' \\\\ ', ' ').replace('\\\\  ', ' ')\n                  .replace('\\\\ .', '.'))\n        if self.renderer._include_raw_html:\n            return prolog + output\n        else:\n            return output\n\n\nclass M2RParser(rst.Parser, object):\n    \"\"\"M2RParser\"\"\"\n    # Explicitly tell supported formats to sphinx\n    supported = ('markdown', 'md', 'mkd')\n\n    def parse(self, inputstrings, document):\n        \"\"\"parse\"\"\"\n        if isinstance(inputstrings, statemachine.StringList):\n            inputstring = '\\n'.join(inputstrings)\n        else:\n            inputstring = inputstrings\n        config = document.settings.env.config\n        converter = M2R(no_underscore_emphasis=config.no_underscore_emphasis,\n                        parse_relative_links=config.m2r_parse_relative_links,\n                        anonymous_references=config.m2r_anonymous_references,\n                        disable_inline_math=config.m2r_disable_inline_math)\n        super(M2RParser, self).parse(converter(inputstring), document)\n\n\nclass MdInclude(rst.Directive):\n    \"\"\"Directive class to include markdown in sphinx.\n\n    Load a file and convert it to rst and insert as a node. Currently\n    directive-specific options are not implemented.\n    \"\"\"\n    required_arguments = 1\n    optional_arguments = 0\n    option_spec = {\n        'start-line': int,\n        'end-line': int,\n    }\n\n    def run(self):\n        \"\"\"Most of this method is from ``docutils.parser.rst.Directive``.\n\n        docutils version: 0.12\n        \"\"\"\n        if not self.state.document.settings.file_insertion_enabled:\n            raise self.warning('\"%s\" directive disabled.' % self.name)\n        source = self.state_machine.input_lines.source(\n            self.lineno - self.state_machine.input_offset - 1)\n        source_dir = os.path.dirname(os.path.abspath(source))\n        path = rst.directives.path(self.arguments[0])\n        path = os.path.normpath(os.path.join(source_dir, path))\n        path = utils.relative_path(None, path)\n        path = nodes.reprunicode(path)\n\n        # get options (currently not use directive-specific options)\n        encoding = self.options.get(\n            'encoding', self.state.document.settings.input_encoding)\n        e_handler = self.state.document.settings.input_encoding_error_handler\n        tab_width = self.options.get('tab-width',\n                                     self.state.document.settings.tab_width)\n\n        # open the including file\n        try:\n            self.state.document.settings.record_dependencies.add(path)\n            include_file = io.FileInput(\n                source_path=path, encoding=encoding, error_handler=e_handler)\n        except UnicodeEncodeError as error:\n            raise self.severe('Problems with \"%s\" directive path:\\n'\n                              'Cannot encode input file path \"%s\" '\n                              '(wrong locale?).' %\n                              (self.name, SafeString(path)))\n        except IOError as error:\n            raise self.severe('Problems with \"%s\" directive path:\\n%s.' %\n                              (self.name, ErrorString(error)))\n\n        # read from the file\n        startline = self.options.get('start-line', None)\n        endline = self.options.get('end-line', None)\n        try:\n            if startline or (endline is not None):\n                lines = include_file.readlines()\n                rawtext = ''.join(lines[startline:endline])\n            else:\n                rawtext = include_file.read()\n        except UnicodeError as error:\n            raise self.severe('Problem with \"%s\" directive:\\n%s' %\n                              (self.name, ErrorString(error)))\n\n        config = self.state.document.settings.env.config\n        converter = M2R(no_underscore_emphasis=config.no_underscore_emphasis,\n                        parse_relative_links=config.m2r_parse_relative_links,\n                        anonymous_references=config.m2r_anonymous_references,\n                        disable_inline_math=config.m2r_disable_inline_math)\n        include_lines = statemachine.string2lines(\n            converter(rawtext), tab_width, convert_whitespace=True)\n        self.state_machine.insert_input(include_lines, path)\n        return []\n\n\ndef setup(app):\n    \"\"\"When used for sphinx extension.\"\"\"\n    global _is_sphinx\n    _is_sphinx = True\n    app.add_config_value('no_underscore_emphasis', False, 'env')\n    app.add_config_value('m2r_parse_relative_links', False, 'env')\n    app.add_config_value('m2r_anonymous_references', False, 'env')\n    app.add_config_value('m2r_disable_inline_math', False, 'env')\n    app.add_source_parser('.md', M2RParser)\n    app.add_directive('mdinclude', MdInclude)\n    metadata = dict(\n        version=__version__,\n        parallel_read_safe=True,\n        parallel_write_safe=True, )\n    return metadata\n\n\ndef convert(text, **kwargs):\n    \"\"\"convert\"\"\"\n    return M2R(**kwargs)(text)\n\n\ndef parse_from_file(file, encoding='utf-8', **kwargs):\n    \"\"\"parse_from_file\"\"\"\n    if not os.path.exists(file):\n        raise OSError('No such file exists: {}'.format(file))\n    with _open(file, encoding=encoding) as f:\n        src = f.read()\n    output = convert(src, **kwargs)\n    return output\n\n\ndef save_to_file(target, src, encoding='utf-8', **kwargs):\n    \"\"\"save_to_file\"\"\"\n\n    if not options.overwrite and os.path.exists(target):\n        confirm = input('{} already exists. overwrite it? [y/n]: '.format(\n            target))\n        if confirm.upper() not in ('Y', 'YES'):\n            print('skip {}'.format(target))\n            return\n    with _open(target, 'w', encoding=encoding) as f:\n        f.write(src)\n\n\ndef main():\n    \"\"\"main\"\"\"\n    parse_options()  # parse cli options\n    if not options.input_file:\n        parser.print_help()\n        parser.exit(0)\n    for file in options.input_file:\n        output = parse_from_file(file)\n        if options.dry_run:\n            print(output)\n        else:\n            save_to_file(options.output_file, output)\n\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "docs/Tools/MarkdownSh/markdown_parse.py",
    "content": "\"\"\"\nmarkdown 文件解析工具\n使用示例：\npython markdown_parse.py \"your_file_path\"\n响应结果：\nparse file your_file_path/README.md result:   xxxx\ncheck your_file_path/README.md success/error:  xxxx\n\n如果出现 error，说明 markdown 内容缺失 简介、基本用法或者参数说明\n\"\"\"\nimport json\nimport os\nimport re\nimport sys\n\narguments = sys.argv\n\nsdk_code_dict = {\n    \"animal_recognize\": \"animal_recognize\",\n    \"asr\": \"asr\",\n    \"dish_recognize\": \"dish_recognize\",\n    \"doc_crop_enhance\": \"doc_crop_enhance\",\n    \"doc_parser\": \"doc_parser\",\n    \"doc_splitter\": \"doc_splitter\",\n    \"embeddings\": \"embeddings\",\n    \"excel2figure\": \"excel2figure\",\n    \"extract_table\": \"extract_table\",\n    \"nl2sql\": \"nl2sql\",\n    \"select_table\": \"select_table\",\n    \"general_ocr\": \"general_ocr\",\n    \"handwrite_ocr\": \"handwrite_ocr\",\n    \"image_understand\": \"image_understand\",\n    \"landmark_recognize\": \"landmark_recognize\",\n    \"dialog_summary\": \"dialog_summary\",\n    \"is_complex_query\": \"is_complex_query\",\n    \"mrc\": \"mrc\",\n    \"nl2pandas\": \"nl2pandas\",\n    \"oral_query_generation\": \"oral_query_generation\",\n    \"playground\": \"playground\",\n    \"qa_pair_mining\": \"qa_pair_mining\",\n    \"query_decomposition\": \"query_decomposition\",\n    \"query_rewrite\": \"query_rewrite\",\n    \"similar_question\": \"similar_question\",\n    \"style_rewrite\": \"style_rewrite\",\n    \"style_writing\": \"style_writing\",\n    \"tag_extraction\": \"tag_extraction\",\n    \"matching\": \"matching\",\n    \"mix_card_ocr\": \"mix_card_ocr\",\n    \"object_recognize\": \"object_recognize\",\n    \"plant_recognize\": \"plant_recognize\",\n    \"qrcode_ocr\": \"qrcode_ocr\",\n    \"rag_with_baidu_search\": \"web_search\",\n    \"bes\": \"retriever\",\n    \"table_ocr\": \"table_ocr\",\n    \"text_to_image\": \"image\",\n    \"translate\": \"translate\",\n    \"tts\": \"tts\",\n    \"tts_high\": \"tts_high\",\n    \"tts_audio\": \"tts_audio\",\n    \"code_interpreter\": \"code_interpreter\",\n    \"web_pilot\": \"web_pilot\",\n    \"wolfram_alpha\": \"wolfram_alpha\",\n    \"arxiv\": \"arxiv\",\n    \"product_query\": \"product_query\",\n    \"flight_query\": \"flight_query\",\n    \"query_express_package\": \"query_express_package\",\n    \"bing_image_search\": \"bing_image_search\",\n    \"news_get\": \"news_get\",\n    \"weather_query\": \"weather_query\",\n    \"video_get\": \"video_get\",\n    \"baidu_vdb\": \"baidu_vdb\"\n\n}\n\n# 循环中的数据\nsdk_detail_sqls = []\nsdk_component_sqls = []\nsdk_code_sqls = []\n\n\ndef parse_markdown(markdown):\n    # 初始化结果字典和当前处理的section\n    sections = {}\n    current_section = None\n    code_block = False\n    code_lang = None\n    code_content = \"\"\n    section_content = \"\"\n    need_append_content = False\n    # 按行遍历markdown内容\n    for line in markdown.split('\\n'):\n        # 检查是否为一级标题\n        if line.startswith('# ') and 'title' not in sections:\n            sections['title'] = line[2:].strip()\n            sections['name'] = re.sub(r'[\\(（][^\\)）]*[\\)）]', '', sections['title']).strip()\n        # 检查是否为二级标题\n        if line.startswith('## '):\n            # 如果当前有正在处理的section，将其存入字典\n            if current_section and current_section not in sections:\n                sections[current_section] = section_content.strip()\n\n            # 更新当前section名称和重置section内容\n            current_section = line[3:].strip()\n            section_content = \"\"\n            need_append_content = False\n            if current_section == '简介':\n                sections['remark'] = ''\n\n            # 检查是否为代码块开始\n        elif line.startswith('```') and current_section == '基本用法' and not code_block:\n            # 如果紧接着下一行是代码语言，则提取它\n            code_lang = line[3:].strip()\n            if code_lang is not None and len(code_lang) > 0:\n                code_block = True\n                continue\n\n            # 检查是否为代码块结束\n        elif line.startswith('```') and current_section == '基本用法' and code_block:\n            code_block = False\n            # 如果提取到了代码语言，将代码内容存入字典\n            if code_lang:\n                if current_section not in sections:\n                    sections[current_section] = {}\n                sections[current_section][code_lang] = code_content.strip()\n            code_lang = None\n            code_content = \"\"\n            continue\n\n            # 如果在代码块内，则累加代码内容\n        if code_block:\n            code_content += line + '\\n'\n            # 否则，累加section内容\n        else:\n            # 判断当前section 是否是简介\n            if current_section == '简介' and not line.startswith('##') and not need_append_content:\n                sections['remark'] = sections['remark'] + line\n            if line.startswith('###'):\n                need_append_content = True\n            if need_append_content:\n                section_content += line + '\\n'\n\n    # 处理最后一个section\n    if current_section:\n        sections[current_section] = section_content.strip()\n\n    return sections\n\n\ndef read_markdown(file_path):\n    with open(file_path, 'r', encoding='utf-8') as file:\n        markdown = file.read()\n        return markdown\n\n\ndef check_parse_result(result):\n    msg_list = []\n    success = True\n    json_data = json.loads(result)\n    if \"简介\" not in json_data or (\"简介\" in json_data and len(json_data[\"简介\"]) == 0):\n        success = False\n        msg_list.append(\"简介内容缺失\")\n    if \"基本用法\" not in json_data or (\"基本用法\" in json_data and len(json_data[\"基本用法\"]) == 0):\n        success = False\n        msg_list.append(\"基本用法内容缺失\")\n    if \"参数说明\" not in json_data or (\"参数说明\" in json_data and len(json_data[\"参数说明\"]) == 0):\n        success = False\n        msg_list.append(\"参数说明内容缺失\")\n    return success, \";\".join(msg_list)\n\n\ndef parse_file(file_path):\n    if os.path.isfile(file_path):\n        # 如果是文件，且为 markdown，解析文档\n        _, file_extension = os.path.splitext(file_path)\n        if file_extension == '.md':\n            markdown_content = read_markdown(file_path)\n            parsed_content = parse_markdown(markdown_content)\n            result = json.dumps(parsed_content, indent=2, ensure_ascii=False)\n            print(f\"parse file {file_path} result:\\n {result}\")\n            success, _msg = check_parse_result(result)\n            if success:\n                print(f\"check {file_path} success\")\n                match = re.search(r'/(\\w+)/README\\.md$', file_path)\n                dir_name = match.group(1)\n                introduce = parsed_content.get('简介').replace('\\n', r'\\n').replace('\\'', '\\'\\'')\n                interface_doc = parsed_content.get('参数说明').replace('\\n', r'\\n').replace('\\'', '\\'\\'')\n                sdk_code = sdk_code_dict.get(dir_name)\n                if sdk_code is not None:\n                    sdk_detail_sql = f\"insert into sdk_detail(sdk_code, introduce, interface_doc, deploy_package, title) values('{sdk_code}','{introduce}','{interface_doc}',null,'{parsed_content.get('title')}') on conflict(sdk_code) do update set introduce='{introduce}',interface_doc='{interface_doc}',title='{parsed_content.get('title')}';\"\n                    sdk_detail_sqls.append(sdk_detail_sql)\n                    remark = parsed_content.get('remark').replace('\\n', '')\n                    sdk_component_sql = f\"update sdk_tool set name = '{parsed_content.get('name')}',remark='{remark}' where sdk_code = '{sdk_code}';\"\n                    sdk_component_sqls.append(sdk_component_sql)\n                    for key, value in parsed_content.get('基本用法').items():\n                        code = value.replace('\\n', r'\\n').replace('\\'', '\\'\\'')\n                        sdk_code_sql = f\"insert into sdk_code_demo(sdk_code, language, code_demo) values('{sdk_code}','{key}','{code}') on conflict(sdk_code,language) do update set code_demo='{code}';\"\n                        sdk_code_sqls.append(sdk_code_sql)\n            if not success:\n                print(f\"check {file_path} error: {_msg}\")\n            return\n    else:\n        # 获取目标目录下的所有文件和子目录\n        entries = os.listdir(file_path)\n        for entry in entries:\n            # 构建完整路径\n            child_path = os.path.join(file_path, entry)\n            parse_file(child_path)\n\n\nparse_file(arguments[1])\n\n# 打开文件以追加模式 ('a')\n# with open('data.sql', 'a') as file:\n#     # 循环写入数据\n#     for line in sdk_detail_sqls:\n#         file.write(line + '\\n')\n#     for line in sdk_code_sqls:\n#         file.write(line + '\\n')\n#     for line in sdk_component_sqls:\n#         file.write(line + '\\n')\n"
  },
  {
    "path": "docs/Tools/SphinxSh/Makefile",
    "content": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the environment for the first two.\nSPHINXOPTS    ?=\nSPHINXBUILD   ?= sphinx-build\nSOURCEDIR     = source\nBUILDDIR      = build\n\n# Put it first so that \"make\" without argument is like \"make help\".\nhelp:\n\t@$(SPHINXBUILD) -M help \"$(SOURCEDIR)\" \"$(BUILDDIR)\" $(SPHINXOPTS) $(O)\n\n.PHONY: help Makefile\n\n# Catch-all target: route all unknown targets to Sphinx using the new\n# \"make mode\" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).\n%: Makefile\n\t@$(SPHINXBUILD) -M $@ \"$(SOURCEDIR)\" \"$(BUILDDIR)\" $(SPHINXOPTS) $(O)\n"
  },
  {
    "path": "docs/Tools/SphinxSh/PythonAPI.md",
    "content": "# Python API Reference\n\n\n- [Python API](appbuilder.md)\n    - [Assistant API](appbuilder.core.assistant.md)\n    - [Components API](appbuilder.core.components.md)\n    - [Console API](appbuilder.core.console.md)"
  },
  {
    "path": "docs/Tools/SphinxSh/READEME.md",
    "content": "# Appbuilder-SDK Python 自动文档生成\n\n## 操作流程\n\n- 完成SDK代码开发\n- 依照google规范编写注释--仅需要对类和非私有方法进行注释\n- 进入根目录的docs/Tools/SphinxSh目录下执行update_doc.sh脚本\n- 执行成功后，在docs/Tools/SphinxSh/build/markdown目录下查看生成的文档是否无误\n- 迁移所有生成的文档到docs/API-Reference/Python目录下\n\n## 脚本功能\n\n- 依据注释自动生成文档，并将文档迁移到docs/API-Reference/Python目录下\n- 将组件README.md文件按照目录格式迁移到BasisModule/Components目录下，为mkdocs生成文档提供基础链接\n\n## 代码注释规范\n\n- 注释使用google规范\n\n### object类注释\n\n```python\nclass AppBuilderClient(Component):\n    r\"\"\"\n    AppBuilderClient 组件支持调用在[百度智能云千帆AppBuilder](https://cloud.baidu.com/product/AppBuilder)平台上\n    构建并发布的智能体应用，具体包括创建会话、上传文档、运行对话等。\n    \n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        # 可在Console 应用页面获取\n        app_id = \"app_id\"\n        client = appbuilder.AppBuilderClient(\"app_id\")\n        conversation_id = client.create_conversation()\n        file_id = client.upload_local_file(conversation_id, \"/path/to/file\")\n        message = client.run(conversation_id, \"今天你好吗？\")\n        # 打印对话结果\n        print(message.content)\n        \n    \"\"\"\n```\n- 注意\n    - 注释必须使用 Examples:之后必须存在一行空行，.. code-block:: python之后也必须要有一行空行\n    - code-block前为两点（..）之后为两个冒号(::)\n    - 方法的示例注释与此规范相同\n\n### 函数注释\n\n- 私有函数如_recognize_w_post_process等无需按照规范注释函数\n\n```python\n@components_run_stream_trace\ndef tool_eval(\n    self,\n    name: str,\n    streaming: bool,\n    origin_query: str,\n    **kwargs,\n) -> Union[Generator[str, None, None], str]:\n    \"\"\"\n    执行工具函数，通过调用底层接口进行动物识别。\n    \n    Args:\n        name (str): 工具名\n        streaming (bool): 是否流式返回结果，True 表示流式返回，False 表示一次性返回\n        origin_query (str): 用户原始查询字符串\n        **kwargs: 工具调用的额外关键字参数\n    \n    Returns:\n        Union[Generator[str, None, None], str]: 动物识别结果。如果 streaming 为 True，则返回一个生成器，可以逐个返回识别结果；\n                                                如果 streaming 为 False，则返回一个字符串，包含识别出的动物类别和相应的置信度信息。\n    \n    \"\"\"\n```\n\n### google风格指南与规范示例\n\n- Google详情见 [Google注释风格指南](https://google.github.io/styleguide/pyguide.html)\n   \n\n```python\nclass GoogleStyle:\n    '''Google注释风格\n    用 ``缩进`` 分隔，\n    适用于倾向水平，短而简单的文档\n    Attributes:\n        dividend (int or float): 被除数\n        name (:obj:`str`, optional): 该类的命名\n    '''\n \n    def __init__(self, dividend, name='GoogleStyle'):\n        '''初始化'''\n        self.dividend = dividend\n        self.name = name\n \n    def divide(self, divisor):\n        '''除法\n        Google注释风格的函数，\n        类型主要有Args、Returns、Raises、Examples\n        Args:\n            divisor (int):除数\n        Returns:\n            除法结果\n        Raises:\n            ZeroDivisionError: division by zero\n        Examples:\n        \n        .. code-block:: python\n        \n            # 实例代码\n            \n        References:\n            除法_百度百科  https://baike.baidu.com/item/%E9%99%A4%E6%B3%95/6280598\n        '''\n        try:\n            return self.dividend / divisor\n        except ZeroDivisionError as e:\n            return e\n```\n"
  },
  {
    "path": "docs/Tools/SphinxSh/appbuilder.core.rst",
    "content": "appbuilder.core package\n=======================\n\nSubpackages\n-----------\n\n.. toctree::\n   :maxdepth: 2\n\n   appbuilder.core.assistant\n   appbuilder.core.components\n   appbuilder.core.console\n\nSubmodules\n----------\n\nappbuilder.core.agent module\n----------------------------\n\n.. automodule:: appbuilder.core.agent\n   :members:\n   :undoc-members:\n   :show-inheritance:\n\nappbuilder.core.message module\n------------------------------\n\n.. automodule:: appbuilder.core.message\n   :members:\n   :undoc-members:\n   :show-inheritance:\n\nappbuilder.core.component module\n------------------------------\n\n.. automodule:: appbuilder.core.component\n   :members:\n   :undoc-members:\n   :show-inheritance:"
  },
  {
    "path": "docs/Tools/SphinxSh/get_components_md.py",
    "content": "import os\n\ndef find_readme_files(base_path):\n    readme_files = []\n    for root, dirs, files in os.walk(base_path):\n        for file in files:\n            if file.lower() == \"readme.md\":\n                readme_files.append(os.path.join(root, file))\n    return readme_files\n\ndef extract_first_line(readme_path):\n    try:\n        with open(readme_path, 'r', encoding='utf-8') as file:\n            first_line = file.readline().strip()\n            if first_line.startswith('#'):\n                first_line = first_line[1:].strip()\n            return first_line\n    except Exception as e:\n        print(f\"Error reading {readme_path}: {str(e)}\")\n        return None\n\ndef update_mkdocs_yml(results, mkdocs_path='../../../mkdocs.yml'):\n    try:\n        with open(mkdocs_path, 'r', encoding='utf-8') as file:\n            lines = file.readlines()\n        \n        # 查找 \"    - 组件:\" 行的索引\n        start_index = -1\n        end_index = -1\n        for i, line in enumerate(lines):\n            if line.strip() == '- 组件:':\n                start_index = i\n            elif line.strip() == '- 监控:':\n                end_index = i\n                break\n        \n        if start_index == -1 or end_index == -1:\n            print(\"未找到 '- 组件:' 或 '- 监控:' 行\")\n            return\n        \n        # 删除两标记之间的内容\n        del lines[start_index + 1:end_index]\n\n        # 在找到的行后面插入新的结果\n        for result in reversed(results):\n            lines.insert(start_index + 1, f\"      - {result}\\n\")\n\n        # 写回文件\n        with open(mkdocs_path, 'w', encoding='utf-8') as file:\n            file.writelines(lines)\n        print(\"mkdocs.yml 更新成功\")\n    except Exception as e:\n        print(f\"Error updating {mkdocs_path}: {str(e)}\")\n\ndef main():\n    base_path = '../../BasisModule/Components'  # 当前目录\n    readme_files = find_readme_files(base_path)\n    results = []\n\n    for readme_path in readme_files:\n        first_line = extract_first_line(readme_path)\n        if first_line:\n            relative_path = os.path.relpath(readme_path, start=base_path)\n            result = f\"{first_line}: BasisModule/Components/{relative_path.replace(os.sep, '/')}\"\n            results.append(result)\n\n    # 更新 mkdocs.yml 文件\n    update_mkdocs_yml(results)\n\nif __name__ == \"__main__\":\n    main()"
  },
  {
    "path": "docs/Tools/SphinxSh/make.bat",
    "content": "@ECHO OFF\r\n\r\npushd %~dp0\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\nset SOURCEDIR=source\r\nset BUILDDIR=build\r\n\r\n%SPHINXBUILD% >NUL 2>NUL\r\nif errorlevel 9009 (\r\n\techo.\r\n\techo.The 'sphinx-build' command was not found. Make sure you have Sphinx\r\n\techo.installed, then set the SPHINXBUILD environment variable to point\r\n\techo.to the full path of the 'sphinx-build' executable. Alternatively you\r\n\techo.may add the Sphinx directory to PATH.\r\n\techo.\r\n\techo.If you don't have Sphinx installed, grab it from\r\n\techo.https://www.sphinx-doc.org/\r\n\texit /b 1\r\n)\r\n\r\nif \"%1\" == \"\" goto help\r\n\r\n%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%\r\ngoto end\r\n\r\n:help\r\n%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%\r\n\r\n:end\r\npopd\r\n"
  },
  {
    "path": "docs/Tools/SphinxSh/requirements.txt",
    "content": "sphinx\nsphinx-markdown-builder\nsphinx_rtd_theme"
  },
  {
    "path": "docs/Tools/SphinxSh/source/conf.py",
    "content": "# Configuration file for the Sphinx documentation builder.\n#\n# For the full list of built-in configuration values, see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n# -- Project information -----------------------------------------------------\n# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information\n\n# 指定项目路径\nimport os\nimport sys\nsys.path.insert(0, os.path.abspath('../../../appbuilder'))\n\nproject = 'Appbuilder-SDK'\ncopyright = '2024, baidubce'\nauthor = 'baidubce'\nrelease = '1.1.0'\n\n# -- General configuration ---------------------------------------------------\n# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration\n\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.napoleon'\n    ]\n\ntemplates_path = ['_templates']\n\n# 排除tests目录及其子文件\nexclude_patterns = []\n\nlanguage = 'zh_CN'\n\n# -- Options for HTML output -------------------------------------------------\n# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output\n\nhtml_theme = 'sphinx_rtd_theme'\nhtml_static_path = ['_static']\n"
  },
  {
    "path": "docs/Tools/SphinxSh/source/index.rst",
    "content": ".. Appbuilder-SDK documentation master file, created by\n   sphinx-quickstart on Fri Oct 11 14:36:19 2024.\n   You can adapt this file completely to your liking, but it should at least\n   contain the root `toctree` directive.\n\nAppbuilder-SDK documentation\n============================\n\nAdd your content using ``reStructuredText`` syntax. See the\n`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_\ndocumentation for details.\n\n\n.. toctree::\n   :maxdepth: 2\n   :caption: Contents:\n\n"
  },
  {
    "path": "docs/Tools/SphinxSh/update_doc.sh",
    "content": "echo \"========================开始更新文档========================\"\n\n# 1、注释@HTTPClient\\.check_param装饰器\necho \"================注释@HTTPClient.check_param装饰器===============\"\necho \"当前路径:\"\npwd\ncd ../../..\nfind . -name \"*.py\" -exec sed -i '' 's/@HTTPClient\\.check_param/# @HTTPClient.check_param/g' {} \\;\ncd docs/Tools/SphinxSh\necho \"===============注释@HTTPClient.check_param装饰器完成==============\"\n\n# 2、安装依赖\necho \"=========================安装依赖=========================\"\necho \"当前路径:\"\npwd\npython3 -m pip install -r requirements.txt\n\necho \"安装当前目录的Appbuilder-SDK:\"\ncd ../../..\npython3 -m pip uninstall appbuilder-sdk -y\nrm -rf dist\npython3 -u setup.py bdist_wheel\npython3 -m pip install dist/*.whl\n# 更新builde目录\nrm -rf build\n\n# 检查appbuilder目录是否已存在\nif [ -d \"appbuilder\" ]; then\n    echo \"Error: Directory 'appbuilder' already exists.\"\n    exit 1\nfi\n\n# 检查python目录是否存在，如果存在则重命名为appbuilder\nif [ -d \"python\" ]; then\n    mv python appbuilder\n    echo \"Directory 'python' has been renamed to 'appbuilder'.\"\nelse\n    echo \"Directory 'python' does not exist.\"\n    find . -name \"*.py\" -exec sed -i '' 's/# @HTTPClient\\.check_param/@HTTPClient.check_param/g' {} \\; || { echo \"恢复装饰器失败\"; exit 1; }\n    exit 1\nfi\ncd docs/Tools/SphinxSh\necho \"=========================安装依赖=========================\"\n\n\n# 3、删除 build 下的所有文件夹\necho \"================删除 doc/build 下的所有文件夹================\"\necho \"当前路径:\"\npwd\necho \"删除  build 下的所有文件夹及文件:\"\nrm -r build/*\necho \"删除  build 下的所有文件夹及文件完成\"\necho \"==============删除 doc/build  下的所有文件夹完成==============\"\n\n\n# 4、删除  doc/source 下除index.rst的所有.rst文件\necho \"==========删除doc/source下除index.rst的所有.rst文件==========\"\necho \"当前路径:\"\npwd\necho \"删除  source 下除index.rst的所有.rst文件:\"\ncd source\nfind . -maxdepth 1 -type f -name '*.rst' ! -name 'index.rst' -exec rm {} \\;|| { echo \"删除  doc/source 下除index.rst的所有.rst文件失败\"; exit 1; }\ncd ..\necho \"删除  source 下除index.rst的所有.rst文件完成\"\necho \"=========删除doc/source下除index.rst的所有.rst文件完成=========\"\n\n\n# 5、删除原有的 docs/sphinx_md 文件夹及其文件\necho \"============删除原有的 docs/sphinx_md 文件夹及其文件============\"\necho \"当前路径:\"\npwd\nrm -rf ../../API-Reference/Python/*\necho \"===========删除原有的 docs/sphinx_md 文件夹及其文件完成===========\"\n\n\n# 6、在doc目录下下执行命令   sphinx-apidoc -o source ../appbuilder/\necho \"=======执行命令 sphinx-apidoc -o source ../appbuilder/=======\"\necho \"当前路径:\"\npwd\nsphinx-apidoc -o source ../../../appbuilder/\n# 删除多余文档目录\nrm ./source/appbuilder.tests.*\nrm ./source/appbuilder.utils.*\nrm ./source/appbuilder.core.assistant.type.rst\ncp ./appbuilder.core.rst ./source/appbuilder.core.rst\n\ncp update_rst.py source/\ncd source\npython3 update_rst.py\nrm -rf update_rst.py\ncd ..\necho \"======执行命令 sphinx-apidoc -o source ../appbuilder/完成======\"\n\n\n# 7、在doc目录下执行命令 make markdown && make html\necho \"==============在doc目录下执行命令 make markdown================\"\necho \"当前路径:\"\npwd\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"$0\")\" && pwd)\"\n\nDOC_DIR=\"$SCRIPT_DIR\"\ncd \"$DOC_DIR\" || { echo \"无法切换到 $DOC_DIR 目录\"; exit 1; }\n\necho \"当前路径: $(pwd)\"\n\nexport PATH=/path/to/your/python:$PATH\n# 执行 make markdown\nmake markdown || { echo \"make markdown 命令失败\"; exit 1; }\n# 迁移目录文档\ncp PythonAPI.md build/markdown/\ncp -r build/markdown/ ../../API-Reference/Python\necho \"=============在doc目录下执行命令 make markdown 完成==============\"\n\n\n# 8、恢复装饰器\necho \"========================恢复装饰器========================\"\ncd ../../..\necho \"当前路径:\"\npwd\nfind . -name \"*.py\" -exec sed -i '' 's/# @HTTPClient\\.check_param/@HTTPClient.check_param/g' {} \\; || { echo \"恢复装饰器失败\"; exit 1; }\ncd docs/Tools/SphinxSh\necho \"========================恢复装饰器完成========================\"\n\n\n# 9、清理多余文件\necho \"========================清理多余文件========================\"\necho \"当前路径:\"\npwd\ncd source\nfind . -maxdepth 1 -type f -name '*.rst' ! -name 'index.rst' -exec rm {} \\;|| { echo \"删除  doc/source 下除index.rst的所有.rst文件失败\"; exit 1; }\ncd ..\necho \"删除  doc/source 下除index.rst的所有.rst文件完成\"\nrm -rf /build/doctrees/*\ncd ../../..\nif [ -d \"appbuilder\" ]; then\n    mv appbuilder python\n    echo \"Directory 'appbuilder' has been renamed to 'python'.\"\nelse\n    echo \"Directory 'appbuilder' does not exist.\"\n    exit 1\nfi\ncd docs/Tools/SphinxSh\necho \"======================清理多余文件完成======================\"\n\n# 10、拷贝组件README.md文件到docs/BasisModule/Components目录\necho \"====拷贝组件README.md文件到docs/BasisModule/Components目录====\"\necho \"当前路径:\"\npwd\ncd ../../..\ncp -r python/core/components/* docs/BasisModule/Components\ncd docs/BasisModule/Components\nfind . -type f -name \"*.py\" -exec rm {} +\ncd ../../Tools/SphinxSh\n# 运行mkdocs更改文件\npython3 get_components_md.py\n\n# 更改API目录文件结构\npython3 update_lib.py\n\necho \"====拷贝组件README.md文件到docs/BasisModule/Components目录完成====\"\n\n\necho \"========================更新文档完成========================\"\n"
  },
  {
    "path": "docs/Tools/SphinxSh/update_lib.py",
    "content": "import subprocess\n\ndef mv_new_md(input_filename, output_filename):\n    \"\"\"\n    将新生成的Markdown文件移动到目标位置并删除原文件。\n    \n    Args:\n        input_filename (str): 目标文件名。\n        output_filename (str): 新生成的Markdown文件名。\n    \n    Returns:\n        None\n    \n    \"\"\"\n    command  = ['mv', output_filename, input_filename]\n    subprocess.run(command, check=True)\n    command = ['rm', '-rf', output_filename]\n    subprocess.run(command, check=True)\n\ndef process_line_for_assistant(line):\n    \"\"\"\n    处理一行文本以供助手使用。\n    \n    Args:\n        line (str): 要处理的文本行。\n    \n    Returns:\n        str or None: 如果行中包含'module'字段且不包含\"subpackages\"或\"submodules\"，则返回处理后的行。\n                     否则返回None表示应该删除该行。\n    \n    说明：\n        1. 仅提取存在'module'字段且不包含\"subpackages\"或\"submodules\"的行，并返回格式处理之后的行。\n        2. 处理后的行格式为\"- [模块名](链接)\"，其中模块名为文本行中最后一个点后的内容，\n           链接为原文本行中的链接部分。\n        3. 如果模块名在指定的模块列表中（'assistants', 'files', 'messages', 'runs', 'threads'），\n           则返回处理后的行，否则返回None。\n    \"\"\"\n    # 仅提取存在module字段且不包含\"subpackages\"或\"submodules\"的行，并返回格式处理之后的行\n    if 'module' in line.lower() and 'subpackages' not in line.lower() and 'submodules' not in line.lower():\n        open_module = ('assistants', 'files', 'messages', 'runs', 'threads')\n\n        parts = line.split('](')\n\n        new_name = parts[0].split(' module')[0].split('.')[-1]\n        if new_name in open_module:\n            return f\"- [{new_name}]({parts[-1]}\"\n        else:\n            return None\n    else:\n        # 如果行中没有\"module\"，返回None表示应该删除该行\n        return None\n\ndef process_line_for_components(line):\n    \"\"\"\n    对给定的行进行组件处理。\n    \n    Args:\n        line (str): 需要处理的行。\n    \n    Returns:\n        str or None: 处理后的行。如果行中没有包含\"module\"字段，或者包含\"subpackages\"或\"submodules\"，则返回None，表示应该删除该行。\n    \n    \"\"\"\n    # 仅提取存在module字段且不包含\"subpackages\"或\"submodules\"的行，并返回格式处理之后的行\n    if 'module' in line.lower() and 'subpackages' not in line.lower() and 'submodules' not in line.lower():\n        parts = line.split('](')\n        new_names = parts[0].split(' module')[0].split('.')\n        if len(new_names) == 5:\n            return f\"- [{new_names[-2]}]({parts[-1]}\"\n        else: \n            if new_names[-3] == 'llms':\n                return f\"- [{new_names[-2]}--(LLM)]({parts[-1]}\"\n            elif new_names[-3] == 'retriever':\n                return f\"- [{new_names[-2]}--(retriever)]({parts[-1]}\"\n            elif new_names[-3] == 'gbi':\n                return f\"- [{new_names[-2]}--(GBI)]({parts[-1]}\"\n    else:\n        # 如果行中没有\"module\"，返回None表示应该删除该行\n        return None\n\ndef process_line_for_console(line):\n    \"\"\"\n    对给定行进行格式处理，并返回处理后的行。\n    \n    Args:\n        line (str): 需要处理的行文本。\n    \n    Returns:\n        str: 处理后的行文本，如果行应被删除则返回None。\n    \n    说明:\n        该函数仅处理包含\"module\"字段且不包含\"subpackages\"或\"submodules\"的行。\n        对于包含\"module\"的行，会提取模块名并返回格式化后的Markdown链接。\n        如果模块名是\"data_class\"，则直接返回None。\n        如果行中包含\"(appbuilder.core.console.knowledge_base.md)\"，则返回固定的Markdown链接。\n        如果行中不包含\"module\"，则返回None表示该行应被删除。\n    \"\"\"\n    # 仅提取存在module字段且不包含\"subpackages\"或\"submodules\"的行，并返回格式处理之后的行\n    if 'module' in line.lower() and 'subpackages' not in line.lower() and 'submodules' not in line.lower():\n        parts = line.split('](')\n        new_names = parts[0].split(' module')[0].split('.')\n        if new_names[-1] == 'data_class':\n            return None\n        else:\n            return f\"- [{new_names[-1]}]({parts[-1]}\"\n    elif '(appbuilder.core.console.knowledge_base.md)' in line:\n        return \"- [knowledge_base](appbuilder.core.console.knowledge_base.md)\"\n    else:\n        # 如果行中没有\"module\"，返回None表示应该删除该行\n        return None\n    \ndef process_file_for_assistant(input_filename, output_filename):\n    \"\"\"\n    为助手处理文件。\n    \n    Args:\n        input_filename (str): 输入文件名。\n        output_filename (str): 输出文件名。\n    \n    Returns:\n        None\n    \n    \"\"\"\n    with open(input_filename, 'r') as file:\n        lines = file.readlines()\n\n    new_lines = []\n    for line in lines:\n        new_line = process_line_for_assistant(line.strip())\n        if new_line:\n            new_lines.append(new_line)\n\n    with open(output_filename, 'w') as file:\n        for line in new_lines:\n            file.write(line + '\\n')\n\n    mv_new_md(input_filename, output_filename)\n\ndef process_file_for_components(input_filename, output_filename):\n    \"\"\"\n    从文件中读取文本行，处理每行文本以提取组件信息，并将结果写入到新的文件中。\n    \n    Args:\n        input_filename (str): 输入文件的路径。\n        output_filename (str): 输出文件的路径。\n    \n    Returns:\n        None\n    \n    \"\"\"\n    with open(input_filename, 'r') as file:\n        lines = file.readlines()\n\n    new_lines = []\n    for line in lines:\n        new_line = process_line_for_components(line.strip())\n        if new_line:\n            new_lines.append(new_line)\n\n    with open(output_filename, 'w') as file:\n        for line in new_lines:\n            file.write(line + '\\n')\n\n    mv_new_md(input_filename, output_filename)\n\n\ndef process_file_for_console(input_filename, output_filename):\n    \"\"\"\n    将文件内容处理后输出到另一个文件，并移动原文件。\n    \n    Args:\n        input_filename (str): 输入文件名。\n        output_filename (str): 输出文件名。\n    \n    Returns:\n        None\n    \n    \"\"\"\n    with open(input_filename, 'r') as file:\n        lines = file.readlines()\n\n    new_lines = []\n    for line in lines:\n        new_line = process_line_for_console(line.strip())\n        if new_line:\n            new_lines.append(new_line)\n\n    with open(output_filename, 'w') as file:\n        for line in new_lines:\n            file.write(line + '\\n')\n\n    mv_new_md(input_filename, output_filename)\n\n\nif __name__ == \"__main__\":\n    # 处理Assistant.md文件\n    process_file_for_assistant(\"../../API-Reference/Python/appbuilder.core.assistant.md\", \"../../API-Reference/Python/new_appbuilder.core.assistant.md\")\n    # 处理Components.md文件\n    process_file_for_components(\"../../API-Reference/Python/appbuilder.core.components.md\", \"../../API-Reference/Python/new_appbuilder.core.components.md\")\n    # 处理console.md文件\n    process_file_for_console(\"../../API-Reference/Python/appbuilder.core.console.md\", \"../../API-Reference/Python/new_appbuilder.core.console.md\")"
  },
  {
    "path": "docs/Tools/SphinxSh/update_rst.py",
    "content": "import os\n\ndef process_rst_file(filepath):\n    \"\"\"\n    处理rst文件，移除包含特定文本的行。\n    \n    Args:\n        filepath (str): rst文件的路径。\n    \n    Returns:\n        None\n    \n    说明:\n        打开rst文件，读取文件内容到lines列表中。\n        遍历lines列表，根据条件移除包含特定文本的行，\n        这些特定文本包括'base'且'appbuilder.core'、'model'且'appbuilder.core'、\n        'appbuilder.core.utils'且'appbuilder.core'、'data_class'且'appbuilder.core'。\n        每次移除满足条件的行时，最多连续移除8行，防止移除过多内容。\n        将修改后的内容写回原文件。\n    \"\"\"\n    with open(filepath, 'r', encoding='utf-8') as file:\n        lines = file.readlines()\n\n    new_lines = []\n    i = 0\n    while i < len(lines):\n        if 'base' in lines[i] and 'appbuilder.core' in lines[i] and 'knowledge_base' not in lines[i]:\n            i += min(8, len(lines) - i)\n        elif 'model' in lines[i] and 'appbuilder.core' in lines[i]:\n            i += min(8, len(lines) - i)\n        elif 'appbuilder.core.utils' in lines[i]:\n            i += min(8, len(lines) - i)\n        elif 'data_class' in lines[i] and 'appbuilder.core' in lines[i]:\n            i += min(8, len(lines) - i)\n        elif 'basic' in lines[i] and 'appbuilder.core' in lines[i]:\n            i += min(8, len(lines) - i)\n        elif 'parse_rag_pro_response' in lines[i] and 'appbuilder.core' in lines[i]:\n            i += min(8, len(lines) - i)\n        elif 'Module contents' in lines[i]:\n            i += min(8, len(lines) - i)\n        else:\n            new_lines.append(lines[i])\n            i += 1\n\n    # Write the modified content back to the file\n    with open(filepath, 'w', encoding='utf-8') as file:\n        file.writelines(new_lines)\n\ndef main():\n    \"\"\"\n    遍历当前目录下的所有.rst文件\n    \n    Args:\n        无参数\n    \n    Returns:\n        无返回值\n    \n    \"\"\"\n    # Traverse the current directory for all .rst files\n    for root, dirs, files in os.walk('.'):\n        for file in files:\n            if file.endswith('.rst'):\n                filepath = os.path.join(root, file)\n                print(f'Processing {filepath}')\n                process_rst_file(filepath)\n\nif __name__ == \"__main__\":\n    main()"
  },
  {
    "path": "go/appbuilder/agent_builder.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n)\n\n// Deprecated: 请使用AppBuilderClient 代替 AgentBuilder\nfunc NewAgentBuilder(appID string, config *SDKConfig) (*AgentBuilder, error) {\n\tif len(appID) == 0 {\n\t\treturn nil, errors.New(\"appID is empty\")\n\t}\n\tif config == nil {\n\t\treturn nil, errors.New(\"config is nil\")\n\t}\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 1800 * time.Second}\n\t}\n\treturn &AgentBuilder{appID: appID, sdkConfig: config, client: client}, nil\n}\n\ntype AgentBuilder struct {\n\tappID     string\n\tsdkConfig *SDKConfig\n\tclient    HTTPClient\n}\n\nfunc (t *AgentBuilder) CreateConversation() (string, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\treq := map[string]string{\"app_id\": t.appID}\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := make(map[string]any)\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tval, ok := rsp[\"conversation_id\"]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, body=%s\", requestID, string(data))\n\t}\n\treturn val.(string), nil\n}\n\nfunc (t *AgentBuilder) UploadLocalFile(conversationID string, filePath string) (string, error) {\n\tvar data bytes.Buffer\n\tw := multipart.NewWriter(&data)\n\tappIDPart, _ := w.CreateFormField(\"app_id\")\n\tappIDPart.Write([]byte(t.appID))\n\tconversationIDPart, _ := w.CreateFormField(\"conversation_id\")\n\tconversationIDPart.Write([]byte(conversationID))\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\tfilePart, _ := w.CreateFormFile(\"file\", filepath.Base(filePath))\n\tif _, err := io.Copy(filePart, file); err != nil {\n\t\treturn \"\", err\n\t}\n\tw.Close()\n\trequest := http.Request{}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation/file/upload\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader := t.sdkConfig.AuthHeaderV2()\n\theader.Set(\"Content-Type\", w.FormDataContentType())\n\trequest.Header = header\n\trequest.Body = NopCloser(bytes.NewReader(data.Bytes()))\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := make(map[string]any)\n\tif err := json.Unmarshal(body, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tval, ok := rsp[\"id\"]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, body=%s\", requestID, string(body))\n\t}\n\treturn val.(string), nil\n}\n\nfunc (t *AgentBuilder) Run(conversationID string, query string, fileIDS []string, stream bool) (AgentBuilderIterator, error) {\n\tif len(conversationID) == 0 {\n\t\treturn nil, errors.New(\"conversationID mustn't be empty\")\n\t}\n\tm := map[string]any{\"app_id\": t.appID,\n\t\t\"conversation_id\": conversationID,\n\t\t\"query\":           query,\n\t\t\"file_ids\":        fileIDS,\n\t\t\"stream\":          stream,\n\t}\n\trequest := http.Request{}\n\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation/runs\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader := t.sdkConfig.AuthHeaderV2()\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(m)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tr := NewSSEReader(1024*1024, bufio.NewReader(resp.Body))\n\tif stream {\n\t\treturn &AgentBuilderStreamIterator{requestID: requestID, r: r, body: resp.Body}, nil\n\t}\n\treturn &AgentBuilderOnceIterator{body: resp.Body}, nil\n}\n"
  },
  {
    "path": "go/appbuilder/agent_builder_data.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strings\"\n)\n\nfunc (t *AgentBuilderAnswer) transform(inp *AgentBuilderRawResponse) {\n\tt.Answer = inp.Answer\n\tfor _, c := range inp.Content {\n\t\tev := Event{Code: c.EventCode,\n\t\t\tMessage:     c.EventMessage,\n\t\t\tStatus:      c.EventStatus,\n\t\t\tEventType:   c.EventType,\n\t\t\tContentType: c.ContentType,\n\t\t\tDetail:      c.Outputs}\n\t\ttp, ok := TypeToStruct[ev.ContentType]\n\t\tif !ok {\n\t\t\ttp = reflect.TypeOf(DefaultDetail{})\n\t\t}\n\t\tv := reflect.New(tp)\n\t\t_ = json.Unmarshal(c.Outputs, v.Interface())\n\t\tev.Detail = v.Elem().Interface()\n\t\tt.Events = append(t.Events, ev)\n\t}\n}\n\n// AgentBuilderIterator 定义AgentBuilder流式/非流式迭代器接口\n// 初始状态可迭代,如果返回error不为空则代表迭代结束，\n// error为io.EOF，则代表迭代正常结束，其它则为异常结束\ntype AgentBuilderIterator interface {\n\t// Next 获取处理结果，如果返回error不为空，迭代器自动失效，不允许再调用此方法\n\tNext() (*AgentBuilderAnswer, error)\n}\n\ntype AgentBuilderStreamIterator struct {\n\trequestID string\n\tr         *sseReader\n\tbody      io.ReadCloser\n}\n\nfunc (t *AgentBuilderStreamIterator) Next() (*AgentBuilderAnswer, error) {\n\tdata, err := t.r.ReadMessageLine()\n\tif err != nil && !(err == io.EOF) {\n\t\tt.body.Close()\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tif err != nil && err == io.EOF {\n\t\tt.body.Close()\n\t\treturn nil, err\n\t}\n\tif strings.HasPrefix(string(data), \"data:\") {\n\t\tvar resp AgentBuilderRawResponse\n\t\tif err := json.Unmarshal(data[5:], &resp); err != nil {\n\t\t\tt.body.Close()\n\t\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t\t}\n\t\tanswer := &AgentBuilderAnswer{}\n\t\tanswer.transform(&resp)\n\t\treturn answer, nil\n\t}\n\t// 非SSE格式关闭连接，并返回数据\n\tt.body.Close()\n\treturn nil, fmt.Errorf(\"requestID=%s, body=%s\", t.requestID, string(data))\n}\n\n// AgentBuilderOnceIterator 非流式返回时对应的迭代器，只可迭代一次\ntype AgentBuilderOnceIterator struct {\n\tbody      io.ReadCloser\n\trequestID string\n}\n\nfunc (t *AgentBuilderOnceIterator) Next() (*AgentBuilderAnswer, error) {\n\tdata, err := io.ReadAll(t.body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tdefer t.body.Close()\n\tvar resp AgentBuilderRawResponse\n\tif err := json.Unmarshal(data, &resp); err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tanswer := &AgentBuilderAnswer{}\n\tanswer.transform(&resp)\n\treturn answer, nil\n}\n"
  },
  {
    "path": "go/appbuilder/agent_builder_data_test.go",
    "content": "package appbuilder\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n\t\"bufio\"\n\t\"io\"\n\t\"strings\"\n)\n\n// 测试 if !ok 分支\nfunc TestAgentBuilderAnswerTransformWithInvalidContentType(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 构造一个 AgentBuilderRawResponse，其中 ContentType 是不存在的\n\trawResponse := &AgentBuilderRawResponse{\n\t\tAnswer: \"Test Answer\",\n\t\tContent: []RawEventDetail{\n\t\t\t{\n\t\t\t\tEventCode:    111,\n\t\t\t\tEventMessage: \"Test Message\",\n\t\t\t\tEventStatus:  \"Success\",\n\t\t\t\tEventType:    \"TestType\",\n\t\t\t\tContentType:  \"InvalidContentType\", // 模拟不存在的 ContentType\n\t\t\t\tOutputs:      json.RawMessage(`{}`), // 空的输出\n\t\t\t},\n\t\t},\n\t}\n\n\t// 调用 transform 方法\n\tanswer := &AgentBuilderAnswer{}\n\tanswer.transform(rawResponse)\n}\n// 测试 err != nil && !(err == io.EOF) 分支\nfunc TestAgentBuilderStreamIterator_Next_ReadError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 模拟没有数据的输入\n\tmockBody := io.NopCloser(strings.NewReader(\"\"))\n\treader := bufio.NewReader(mockBody)\n\tsseReader := NewSSEReader(1024, reader)\n\n\tstreamIterator := &AgentBuilderStreamIterator{\n\t\trequestID: \"test-request\",\n\t\tr:         sseReader, // 使用 NewSSEReader 初始化的 sseReader\n\t\tbody:      mockBody,\n\t}\n\n\t// 调用 Next 并检查返回的错误\n\t_, err := streamIterator.Next()\n\tif err != io.EOF {\n\t\tt.Fatalf(\"expected io.EOF, got %v\", err)\n\t}\n}\n\n// 测试 json.Unmarshal 解析失败\nfunc TestAgentBuilderStreamIterator_Next_JSONUnmarshalError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 模拟 SSE 消息，data 后面跟着无效 JSON\n\tmockBody := io.NopCloser(strings.NewReader(\"data: invalid-json\"))\n\treader := bufio.NewReader(mockBody)\n\tsseReader := NewSSEReader(1024, reader)\n\n\tstreamIterator := &AgentBuilderStreamIterator{\n\t\trequestID: \"test-request\",\n\t\tr:         sseReader,\n\t\tbody:      mockBody,\n\t}\n\n\t// 调用 Next 并检查返回的错误\n\t_, err := streamIterator.Next()\n\tif err == nil || !strings.Contains(err.Error(), \"invalid character\") {\n\t\t\n\t}\n}\n\n// 测试非 SSE 格式数据\nfunc TestAgentBuilderStreamIterator_Next_NonSSEFormat(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 模拟非 SSE 格式的消息\n\tmockBody := io.NopCloser(strings.NewReader(\"not-sse-format-data\"))\n\treader := bufio.NewReader(mockBody)\n\tsseReader := NewSSEReader(1024, reader)\n\n\tstreamIterator := &AgentBuilderStreamIterator{\n\t\trequestID: \"test-request\",\n\t\tr:         sseReader,\n\t\tbody:      mockBody,\n\t}\n\n\t// 调用 Next 并检查返回的错误\n\tstreamIterator.Next()\n}\n\n// 测试正常的 SSE 数据流\nfunc TestAgentBuilderStreamIterator_Next_ValidSSE(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 模拟有效的 SSE 消息\n\tmockBody := io.NopCloser(strings.NewReader(\"data: {\\\"answer\\\": \\\"Test Answer\\\", \\\"content\\\": []}\"))\n\treader := bufio.NewReader(mockBody)\n\tsseReader := NewSSEReader(1024, reader)\n\n\tstreamIterator := &AgentBuilderStreamIterator{\n\t\trequestID: \"test-request\",\n\t\tr:         sseReader,\n\t\tbody:      mockBody,\n\t}\n\n\t// 调用 Next 并检查返回的结果\n\tstreamIterator.Next()\n}"
  },
  {
    "path": "go/appbuilder/agent_builder_test.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// 模拟返回 400 错误的 HTTP 响应\ntype MockHTTPClient struct{}\n\nfunc (m *MockHTTPClient) Do(req *http.Request) (*http.Response, error) {\n\treturn &http.Response{\n\t\tStatusCode: 400, // 非 2xx 状态码\n\t\tBody:       io.NopCloser(strings.NewReader(`{\"error\": \"Bad Request\"}`)),\n\t}, nil\n}\n\n// FaultyHTTPClient 模拟响应读取时发生错误\ntype FaultyHTTPClient struct{}\n\nfunc (f *FaultyHTTPClient) Do(req *http.Request) (*http.Response, error) {\n\treturn &http.Response{\n\t\tStatusCode: 200,           // 返回成功的状态码\n\t\tBody:       &FaultyBody{}, // 使用 FaultyBody，模拟读取时出错\n\t}, nil\n}\n\n// FaultyBody 模拟响应体读取错误\ntype FaultyBody struct{}\n\nfunc (f *FaultyBody) Read(p []byte) (n int, err error) {\n\treturn 0, fmt.Errorf(\"simulated read error\") // 模拟读取时发生错误\n}\n\nfunc (f *FaultyBody) Close() error {\n\treturn nil\n}\n\n// 模拟无效 JSON 响应\ntype InvalidJSONHTTPClient struct{}\n\nfunc (m *InvalidJSONHTTPClient) Do(req *http.Request) (*http.Response, error) {\n\treturn &http.Response{\n\t\tStatusCode: 200,\n\t\tBody:       io.NopCloser(strings.NewReader(`{invalid_json}`)),\n\t}, nil\n}\n\n// 模拟缺少 id 的 JSON 响应\ntype MissingIDHTTPClient struct{}\n\nfunc (m *MissingIDHTTPClient) Do(req *http.Request) (*http.Response, error) {\n\treturn &http.Response{\n\t\tStatusCode: 200,                                                                                         // 成功的状态码，但缺少 id 字段\n\t\tBody:       io.NopCloser(strings.NewReader(`{\"message\": \"Upload successful\", \"other_field\": \"value\"}`)), // 缺少 id 字段\n\t}, nil\n}\nfunc TestNewAgentBuilderError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\t// NewAgentBuilder测试 1: appID 为空，预期返回错误\n\t_, err := NewAgentBuilder(\"\", &SDKConfig{})\n\tif err == nil || err.Error() != \"appID is empty\" {\n\t\tt.Errorf(\"expected error for empty appID, got %v\", err)\n\t}\n\n\t// NewAgentBuilder测试 2: config 为 nil，预期返回错误\n\t_, err = NewAgentBuilder(\"validAppID\", nil)\n\tif err == nil || err.Error() != \"config is nil\" {\n\t\tt.Errorf(\"expected error for nil config, got %v\", err)\n\t}\n\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\n\t// CreateConversation测试 1: ServiceURLV2 错误\n\tagentBuilder, err := NewAgentBuilder(appID, config)\n\tif err != nil {\n\t\tt.Fatalf(\"new AgentBuilder instance failed\")\n\t}\n\tagentBuilder.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = agentBuilder.CreateConversation()\n\tif err == nil {\n\t\tt.Errorf(\"expected ServiceURLV2 error, got nil\")\n\t}\n\n\t// CreateConversation测试 2: HTTP client do error\n\tagentBuilder.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = agentBuilder.CreateConversation()\n\tif err == nil {\n\t\tt.Errorf(\"expected client error, got nil\")\n\t}\n\n\t// CreateConversation测试 3: checkHTTPResponse 400 错误\n\tagentBuilder.client = &MockHTTPClient{}\n\t_, err = agentBuilder.CreateConversation()\n\tif err == nil {\n\t\tt.Fatalf(\"expected 400 error, got nil\")\n\t}\n\n\t// CreateConversation测试 4: 模拟读取 body 时发生错误\n\tagentBuilder.client = &FaultyHTTPClient{}\n\t_, err = agentBuilder.CreateConversation()\n\tif err == nil {\n\t\tt.Fatalf(\"expected read error, got nil\")\n\t}\n\n\t// CreateConversation测试 5: json.Unmarshal错误\n\tagentBuilder.client = &InvalidJSONHTTPClient{}\n\t_, err = agentBuilder.CreateConversation()\n\tif err == nil {\n\t\tt.Fatalf(\"expected JSON unmarshal error, got nil\")\n\t}\n\n\t// CreateConversation测试 6: 缺少 conversation_id\n\tagentBuilder.client = &MissingIDHTTPClient{}\n\t_, err = agentBuilder.CreateConversation()\n\tif err == nil {\n\t\tt.Fatalf(\"expected missing conversation_id error, got nil\")\n\t}\n\n}\nfunc TestNewAgentBuilderUploadLocalFileError1(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\t//正常的agentBuilder\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tagentBuilder, _ := NewAgentBuilder(appID, config)\n\n\t// 测试 UploadLocalFile 1: 文件打开错误\n\t_, err = agentBuilder.UploadLocalFile(\"validConversationID\", \"invalidFilePath\")\n\tif err == nil || !strings.Contains(err.Error(), \"no such file or directory\") {\n\t\tt.Errorf(\"expected file open error, got %v\", err)\n\t}\n\n\t// 测试 UploadLocalFile 2: 文件复制错误\n\n\t// 测试 UploadLocalFile 4: t.client.Do 错误\n\tagentBuilder.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = agentBuilder.UploadLocalFile(\"5665\", \"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Errorf(\"expected client error, got nil\")\n\t}\n\n\t// 测试 UploadLocalFile 3: 无效的ServiceURLV2\n\tagentBuilder.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = agentBuilder.UploadLocalFile(\"6776\", \"./files/test.pdf\")\n\tif err == nil || !strings.Contains(err.Error(), \"missing protocol scheme\") {\n\t\tt.Errorf(\"expected ServiceURLV2 error, got %v\", err)\n\t}\n\n}\nfunc TestNewAgentBuilderUploadLocalFileError2(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\t//正常的agentBuilder\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tagentBuilder, _ := NewAgentBuilder(appID, config)\n\n\t// 测试 UploadLocalFile 5: checkHTTPResponse 错误\n\tagentBuilder.client = &MockHTTPClient{}\n\t_, err = agentBuilder.UploadLocalFile(\"123321\", \"./files/test.pdf\")\n\tif err == nil || !strings.Contains(err.Error(), \"Bad Request\") {\n\t\tt.Errorf(\"expected Bad Request error, got %v\", err)\n\t}\n\t// 测试 UploadLocalFile 6: io.ReadAll 错误\n\tagentBuilder.client = &FaultyHTTPClient{}\n\t_, err = agentBuilder.UploadLocalFile(\"2332\", \"./files/test.pdf\")\n\tif err == nil || !strings.Contains(err.Error(), \"simulated read error\") {\n\t\tt.Errorf(\"expected read error, got %v\", err)\n\t}\n\n\t// 测试 UploadLocalFile 7: json.Unmarshal 错误\n\tagentBuilder.client = &InvalidJSONHTTPClient{}\n\t_, err = agentBuilder.UploadLocalFile(\"3443\", \"./files/test.pdf\")\n\tif err == nil || !strings.Contains(err.Error(), \"invalid character\") {\n\t\tt.Errorf(\"expected JSON unmarshal error, got %v\", err)\n\t}\n\n\t// 测试 UploadLocalFile 8: 缺少 id 字段\n\tagentBuilder.client = &MissingIDHTTPClient{}\n\t_, err = agentBuilder.UploadLocalFile(\"4554\", \"./files/test.pdf\")\n\n\t// 检查 err 是否为空，并且确保返回的错误信息包含 \"id\" 这个字段\n\tif err == nil || !strings.Contains(err.Error(), \"body\") || !strings.Contains(err.Error(), \"id\") {\n\n\t}\n}\nfunc TestNewAgentBuilderRunError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tagentBuilder, err := NewAgentBuilder(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AgentBuilder instance failed\")\n\t}\n\n\t//测试1   conversationID为空\n\t_, err = agentBuilder.Run(\"\", \"描述简历中的候选人情况\", nil, true)\n\tif err == nil {\n\t\tt.Errorf(\"expected conversationID mustn't be empty, got %v\", err)\n\t}\n\n\t//测试2   ServiceURLV2 error 无效的ServiceURLV2\n\tagentBuilder.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = agentBuilder.Run(\"2135\", \"描述简历中的候选人情况\", nil, true)\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected ServiceURLV2 error, got %v\", err)\n\t}\n\t//测试3   t.client.Do 错误\n\tagentBuilder.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = agentBuilder.Run(\"1221\", \"描述简历中的候选人情况\", nil, true)\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected Bad Request error, got %v\", err)\n\t}\n}\nfunc TestNewAgentBuilder(t *testing.T) {\n\t// 创建缓冲区来存储日志\n\tvar logBuffer bytes.Buffer\n\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\t// 将日志输出重定向到缓冲区\n\tlog := func(format string, args ...interface{}) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tagentBuilder, err := NewAgentBuilder(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AgentBuilder instance failed\")\n\t}\n\n\t//正常测试\n\tconversationID, err := agentBuilder.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\t_, err = agentBuilder.UploadLocalFile(conversationID, \"./files/test.pdf\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload local file failed: %v\", err)\n\t}\n\ti, err := agentBuilder.Run(conversationID, \"描述简历中的候选人情况\", nil, true)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\ttotalAnswer := \"\"\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\ttotalAnswer = totalAnswer + answer.Answer\n\t\tfor _, ev := range answer.Events {\n\t\t\tswitch ev.ContentType {\n\t\t\tcase TextContentType:\n\t\t\t\tdetail := ev.Detail.(TextDetail)\n\t\t\t\tlog(\"---------------TextDetail------------\")\n\t\t\t\tlog(\"%v\", detail)\n\t\t\tcase CodeContentType:\n\t\t\t\tdetail := ev.Detail.(CodeDetail)\n\t\t\t\tlog(\"---------------CodeDetail------------\")\n\t\t\t\tlog(\"%v\", detail)\n\t\t\tcase ImageContentType:\n\t\t\t\tdetail := ev.Detail.(ImageDetail)\n\t\t\t\tlog(\"---------------ImageDetail------------\")\n\t\t\t\tlog(\"%v\", detail)\n\t\t\tcase RAGContentType:\n\t\t\t\tdetail := ev.Detail.(RAGDetail)\n\t\t\t\tlog(\"---------------RAGDetail------------\")\n\t\t\t\tlog(\"%v\", detail)\n\t\t\tcase FunctionCallContentType:\n\t\t\t\tdetail := ev.Detail.(FunctionCallDetail)\n\t\t\t\tlog(\"---------------FunctionCallDetail------------\")\n\t\t\t\tlog(\"%v\", detail)\n\t\t\tcase AudioContentType:\n\t\t\t\tdetail := ev.Detail.(AudioDetail)\n\t\t\t\tlog(\"---------------AudioDetail------------\")\n\t\t\t\tlog(\"%v\", detail.Audio)\n\t\t\tcase VideoContentType:\n\t\t\t\tdetail := ev.Detail.(VideoDetail)\n\t\t\t\tlog(\"---------------VideoDetail------------\")\n\t\t\t\tlog(\"%v\", detail)\n\t\t\tcase StatusContentType:\n\t\t\t\t// No additional detail to log\n\t\t\tdefault:\n\t\t\t\t// 默认是 json.RawMessage\n\t\t\t\tdetail, ok := ev.Detail.(json.RawMessage)\n\t\t\t\tif ok {\n\t\t\t\t\tlog(\"---------------rawMessage------------\")\n\t\t\t\t\tlog(\"%s\", string(detail))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tlog(\"----------------answer-------------------\")\n\tlog(totalAnswer)\n\t//测试4   非流式\n\t_, err = agentBuilder.Run(conversationID, \"描述简历中的候选人情况\", nil, false)\n\tif err != nil {\n\n\t}\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n"
  },
  {
    "path": "go/appbuilder/app_builder_client.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// Deprecated: 将废弃，请使用DescribeApps替代\nfunc GetAppList(req GetAppListRequest, config *SDKConfig) ([]App, error) {\n\trequest := http.Request{}\n\theader := config.AuthHeaderV2()\n\tserviceURL, err := config.ServiceURLV2(\"/apps\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trequest.URL = serviceURL\n\trequest.Method = \"GET\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\n\treqMap := make(map[string]any)\n\treqJson, _ := json.Marshal(req)\n\tjson.Unmarshal(reqJson, &reqMap)\n\tparams := url.Values{}\n\tfor key, value := range reqMap {\n\t\tswitch v := value.(type) {\n\t\tcase float64:\n\t\t\tparams.Add(key, strconv.Itoa(int(v)))\n\t\tcase string:\n\t\t\tif v == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tparams.Add(key, v)\n\t\t}\n\t}\n\tserviceURL.RawQuery = params.Encode()\n\n\tconfig.BuildCurlCommand(&request)\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 1800 * time.Second}\n\t}\n\tresp, err := client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := GetAppListResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp.Data, nil\n}\n\nfunc DescribeApps(req DescribeAppsRequest, config *SDKConfig) (DescribeAppsResponse, error) {\n\trequest := http.Request{}\n\theader := config.AuthHeaderV2()\n\tserviceURL, err := config.ServiceURLV2(\"/app?Action=DescribeApps\")\n\tif err != nil {\n\t\treturn DescribeAppsResponse{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tconfig.BuildCurlCommand(&request)\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 1800 * time.Second}\n\t}\n\tresp, err := client.Do(&request)\n\tif err != nil {\n\t\treturn DescribeAppsResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn DescribeAppsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn DescribeAppsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := DescribeAppsResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn DescribeAppsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n\nfunc DescribeApp(appID string, config *SDKConfig) (DescribeAppResponse, error) {\n\trequest := http.Request{}\n\theader := config.AuthHeaderV2()\n\tserviceURL, err := config.ServiceURLV2(\"/app?Action=DescribeApp\")\n\tif err != nil {\n\t\treturn DescribeAppResponse{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(DescribeAppRequest{ID: appID})\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tconfig.BuildCurlCommand(&request)\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 1800 * time.Second}\n\t}\n\tresp, err := client.Do(&request)\n\tif err != nil {\n\t\treturn DescribeAppResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn DescribeAppResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn DescribeAppResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := DescribeAppResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn DescribeAppResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n\nfunc NewAppBuilderClient(appID string, config *SDKConfig) (*AppBuilderClient, error) {\n\tif appID == \"\" {\n\t\treturn nil, errors.New(\"appID is empty\")\n\t}\n\tif config == nil {\n\t\treturn nil, errors.New(\"config is nil\")\n\t}\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 1800 * time.Second}\n\t}\n\treturn &AppBuilderClient{appID: appID, sdkConfig: config, client: client}, nil\n}\n\ntype AppBuilderClient struct {\n\tappID     string\n\tsdkConfig *SDKConfig\n\tclient    HTTPClient\n}\n\n// 在 AppBuilderClient 结构体中添加 Getter 方法\nfunc (t *AppBuilderClient) GetSdkConfig() *SDKConfig {\n\treturn t.sdkConfig\n}\n\nfunc (t *AppBuilderClient) GetClient() HTTPClient {\n\treturn t.client\n}\n\ntype HTTPClient interface {\n\tDo(req *http.Request) (*http.Response, error)\n}\n\nfunc (t *AppBuilderClient) CreateConversation() (string, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\treq := map[string]string{\"app_id\": t.appID}\n\tdata, _ := json.Marshal(req)\n\trequest.Body = io.NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := make(map[string]any)\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tval, ok := rsp[\"conversation_id\"]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, body=%s\", requestID, string(data))\n\t}\n\treturn val.(string), nil\n}\n\nfunc (t *AppBuilderClient) UploadLocalFile(conversationID string, filePath string) (string, error) {\n\tvar data bytes.Buffer\n\tw := multipart.NewWriter(&data)\n\tappIDPart, _ := w.CreateFormField(\"app_id\")\n\tappIDPart.Write([]byte(t.appID))\n\tconversationIDPart, _ := w.CreateFormField(\"conversation_id\")\n\tconversationIDPart.Write([]byte(conversationID))\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\tfilePart, _ := w.CreateFormFile(\"file\", filepath.Base(filePath))\n\tif _, err := io.Copy(filePart, file); err != nil {\n\t\treturn \"\", err\n\t}\n\tw.Close()\n\trequest := http.Request{}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation/file/upload\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader := t.sdkConfig.AuthHeaderV2()\n\theader.Set(\"Content-Type\", w.FormDataContentType())\n\trequest.Header = header\n\trequest.Body = NopCloser(bytes.NewReader(data.Bytes()))\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := make(map[string]any)\n\tif err := json.Unmarshal(body, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tval, ok := rsp[\"id\"]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, body=%s\", requestID, string(body))\n\t}\n\treturn val.(string), nil\n}\n\nfunc (t *AppBuilderClient) UploadFile(req *AppBuilderClientUploadFileRequest) (string, error) {\n\tvar appID string\n\tif req.AppID != \"\" {\n\t\tappID = req.AppID\n\t} else {\n\t\tappID = t.appID\n\t}\n\tif appID == \"\" {\n\t\treturn \"\", errors.New(\"appID is required\")\n\t}\n\tif req.FilePath == \"\" && req.FileURL == \"\" {\n\t\treturn \"\", errors.New(\"either FilePath or FileURL is required\")\n\t}\n\n\tvar data bytes.Buffer\n\tw := multipart.NewWriter(&data)\n\tappIDPart, _ := w.CreateFormField(\"app_id\")\n\tappIDPart.Write([]byte(appID))\n\tconversationIDPart, _ := w.CreateFormField(\"conversation_id\")\n\tconversationIDPart.Write([]byte(req.ConversationID))\n\tif req.FilePath != \"\" {\n\t\tfile, err := os.Open(req.FilePath)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tdefer file.Close()\n\t\tfilePart, _ := w.CreateFormFile(\"file\", filepath.Base(req.FilePath))\n\t\tif _, err := io.Copy(filePart, file); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t} else {\n\t\tfileURLPart, _ := w.CreateFormField(\"file_url\")\n\t\tfileURLPart.Write([]byte(req.FileURL))\n\t}\n\n\tw.Close()\n\trequest := http.Request{}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation/file/upload\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader := t.sdkConfig.AuthHeaderV2()\n\theader.Set(\"Content-Type\", w.FormDataContentType())\n\trequest.Header = header\n\trequest.Body = NopCloser(bytes.NewReader(data.Bytes()))\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := make(map[string]any)\n\tif err := json.Unmarshal(body, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tval, ok := rsp[\"id\"]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, body=%s\", requestID, string(body))\n\t}\n\treturn val.(string), nil\n}\n\nfunc (t *AppBuilderClient) Run(param ...interface{}) (AppBuilderClientIterator, error) {\n\tif len(param) == 0 {\n\t\treturn nil, errors.New(\"no arguments provided\")\n\t}\n\tvar err error\n\tvar req AppBuilderClientRunRequest\n\n\tif reflect.TypeOf(param[0]) == reflect.TypeOf(AppBuilderClientRunRequest{}) {\n\t\treq = param[0].(AppBuilderClientRunRequest)\n\t} else {\n\t\treq, err = t.buildAppBuilderClientRunRequest(param...)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif len(req.ConversationID) == 0 {\n\t\treturn nil, errors.New(\"conversationID mustn't be empty\")\n\t}\n\n\tif len(req.AppID) == 0 {\n\t\treq.AppID = t.appID\n\t}\n\n\trequest := http.Request{}\n\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation/runs\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theader := t.sdkConfig.AuthHeaderV2()\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\trequest.ContentLength = int64(len(data))\n\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tr := NewSSEReader(1024*1024, bufio.NewReader(resp.Body))\n\tif req.Stream {\n\t\treturn &AppBuilderClientStreamIterator{requestID: requestID, r: r, body: resp.Body}, nil\n\t}\n\treturn &AppBuilderClientOnceIterator{body: resp.Body}, nil\n}\n\nfunc (t *AppBuilderClient) buildAppBuilderClientRunRequest(param ...interface{}) (AppBuilderClientRunRequest, error) {\n\tconversationID, ok := param[0].(string)\n\tif !ok {\n\t\treturn AppBuilderClientRunRequest{}, errors.New(\"conversationID must be string type\")\n\t}\n\tquery, ok := param[1].(string)\n\tif !ok {\n\t\treturn AppBuilderClientRunRequest{}, errors.New(\"query must be string type\")\n\t}\n\n\tvar fileIDS []string\n\tif param[2] != nil {\n\t\tfileIDS, ok = param[2].([]string)\n\t\tif !ok {\n\t\t\tfileIDS = nil\n\t\t}\n\t}\n\n\tstream, ok := param[3].(bool)\n\tif !ok {\n\t\tstream = false\n\t}\n\n\treturn AppBuilderClientRunRequest{\n\t\tAppID:          t.appID,\n\t\tConversationID: conversationID,\n\t\tQuery:          query,\n\t\tStream:         stream,\n\t\tFileIDs:        fileIDS,\n\t}, nil\n}\n\nfunc (t *AppBuilderClient) Feedback(req AppBuilderClientFeedbackRequest) (string, error) {\n\tif len(req.ConversationID) == 0 {\n\t\treturn \"\", errors.New(\"conversationID mustn't be empty\")\n\t}\n\n\tif len(req.AppID) == 0 {\n\t\treq.AppID = t.appID\n\t}\n\n\trequest := http.Request{}\n\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation/feedback\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\theader := t.sdkConfig.AuthHeaderV2()\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\trequest.ContentLength = int64(len(data)) // 手动设置长度\n\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn requestID, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\treturn requestID, nil\n}\n\n// Deprecated: Run方法已兼容此方法\nfunc (t *AppBuilderClient) RunWithToolCall(req AppBuilderClientRunRequest) (AppBuilderClientIterator, error) {\n\tif len(req.ConversationID) == 0 {\n\t\treturn nil, errors.New(\"conversationID mustn't be empty\")\n\t}\n\n\trequest := http.Request{}\n\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/app/conversation/runs\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theader := t.sdkConfig.AuthHeaderV2()\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\trequest.ContentLength = int64(len(data)) // 手动设置长度\n\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tr := NewSSEReader(1024*1024, bufio.NewReader(resp.Body))\n\tif req.Stream {\n\t\treturn &AppBuilderClientStreamIterator{requestID: requestID, r: r, body: resp.Body}, nil\n\t}\n\treturn &AppBuilderClientOnceIterator{body: resp.Body}, nil\n}\n"
  },
  {
    "path": "go/appbuilder/app_builder_client_data.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strings\"\n)\n\nconst (\n\tCodeContentType              = \"code\"\n\tTextContentType              = \"text\"\n\tImageContentType             = \"image\"\n\tRAGContentType               = \"rag\"\n\tFunctionCallContentType      = \"function_call\"\n\tAudioContentType             = \"audio\"\n\tVideoContentType             = \"video\"\n\tStatusContentType            = \"status\"\n\tChatflowInterruptContentType = \"chatflow_interrupt\"\n\tPublishMessageContentType    = \"publish_message\"\n\tJsonContentType              = \"json\"\n\tChatReasoningContentType     = \"chat_reasoning\"\n)\n\nconst (\n\tChatflowEventType      = \"chatflow\"\n\tFollowUpQueryEventType = \"FollowUpQuery\"\n)\n\nvar TypeToStruct = map[string]reflect.Type{\n\tCodeContentType:              reflect.TypeOf(CodeDetail{}),\n\tTextContentType:              reflect.TypeOf(TextDetail{}),\n\tImageContentType:             reflect.TypeOf(ImageDetail{}),\n\tRAGContentType:               reflect.TypeOf(RAGDetail{}),\n\tFunctionCallContentType:      reflect.TypeOf(FunctionCallDetail{}),\n\tAudioContentType:             reflect.TypeOf(AudioDetail{}),\n\tVideoContentType:             reflect.TypeOf(VideoDetail{}),\n\tStatusContentType:            reflect.TypeOf(StatusDetail{}),\n\tChatflowInterruptContentType: reflect.TypeOf(ChatflowInterruptDetail{}),\n\tPublishMessageContentType:    reflect.TypeOf(PublishMessageDetail{}),\n\tJsonContentType:              reflect.TypeOf(JsonDetail{}),\n\tChatReasoningContentType:     reflect.TypeOf(ChatReasoningDetail{}),\n}\n\ntype AppBuilderClientRunRequest struct {\n\tAppID            string                    `json:\"app_id\"`\n\tQuery            string                    `json:\"query\"`\n\tStream           bool                      `json:\"stream\"`\n\tEndUserID        *string                   `json:\"end_user_id\"`\n\tConversationID   string                    `json:\"conversation_id\"`\n\tFileIDs          []string                  `json:\"file_ids\"`\n\tTools            []Tool                    `json:\"tools\"`\n\tToolOutputs      []ToolOutput              `json:\"tool_outputs\"`\n\tToolChoice       *ToolChoice               `json:\"tool_choice\"`\n\tAction           *Action                   `json:\"action\"`\n\tMcpAuthorization *[]map[string]interface{} `json:\"mcp_authorization,omitempty\"`\n\tParameters       map[string]any            `json:\"parameters,omitempty\"`\n\tCustomMetadata   *CustomMetadata           `json:\"custom_metadata,omitempty\"`\n}\n\ntype AppBuilderClientUploadFileRequest struct {\n\tAppID          string `json:\"app_id\"`\n\tConversationID string `json:\"conversation_id\"`\n\tFilePath       string `json:\"file_path\"`\n\tFileURL        string `json:\"file_url\"`\n}\n\ntype AppBuilderClientFeedbackRequest struct {\n\tAppID          string   `json:\"app_id\"`\n\tConversationID string   `json:\"conversation_id\"`\n\tMessageID      string   `json:\"message_id\"`\n\tType           string   `json:\"type\"`\n\tFlag           []string `json:\"flag,omitempty\"`\n\tReason         string   `json:\"reason,omitempty\"`\n}\n\ntype Tool struct {\n\tType     string   `json:\"type\"`\n\tFunction Function `json:\"function\"`\n}\n\ntype Function struct {\n\tName        string         `json:\"name\"`\n\tDescription string         `json:\"description\"`\n\tParameters  map[string]any `json:\"parameters\"`\n}\n\ntype ToolOutput struct {\n\tToolCallID string `json:\"tool_call_id\" description:\"工具调用ID\"`\n\tOutput     string `json:\"output\" description:\"工具输出\"`\n}\n\ntype ToolChoice struct {\n\tType     string             `json:\"type\"`\n\tFunction ToolChoiceFunction `json:\"function\"`\n}\n\ntype ToolChoiceFunction struct {\n\tName  string                 `json:\"name\"`\n\tInput map[string]interface{} `json:\"input\"`\n}\n\ntype Action struct {\n\tActionType string           `json:\"action_type\"`\n\tParamters  *ActionParamters `json:\"parameters\"`\n}\n\ntype ActionParamters struct {\n\tInterruptEvent *ActionInterruptEvent `json:\"interrupt_event\"`\n}\n\ntype ActionInterruptEvent struct {\n\tID   string `json:\"id\"`\n\tType string `json:\"type\"`\n}\n\ntype CustomMetadata struct {\n\tOverrideRoleInstruction string `json:\"override_role_instruction\"`\n}\n\nfunc NewResumeAction(eventId string) *Action {\n\treturn NewAction(\"resume\", eventId, \"chat\")\n}\n\nfunc NewAction(actionType string, eventId string, eventType string) *Action {\n\treturn &Action{\n\t\tActionType: actionType,\n\t\tParamters: &ActionParamters{\n\t\t\tInterruptEvent: &ActionInterruptEvent{\n\t\t\t\tID:   eventId,\n\t\t\t\tType: eventType,\n\t\t\t},\n\t\t},\n\t}\n}\n\ntype AgentBuilderRawResponse struct {\n\tRequestID      string           `json:\"request_id\"`\n\tDate           string           `json:\"date\"`\n\tAnswer         string           `json:\"answer\"`\n\tConversationID string           `json:\"conversation_id\"`\n\tMessageID      string           `json:\"message_id\"`\n\tIsCompletion   bool             `json:\"is_completion\"`\n\tContent        []RawEventDetail `json:\"content\"`\n}\n\ntype RawEventDetail struct {\n\tEventCode    int             `json:\"event_code\"`\n\tEventMessage string          `json:\"event_message\"`\n\tEventType    string          `json:\"event_type\"`\n\tEventID      string          `json:\"event_id\"`\n\tEventStatus  string          `json:\"event_status\"`\n\tContentType  string          `json:\"content_type\"`\n\tOutputs      json.RawMessage `json:\"outputs\"`\n\tUsage        Usage           `json:\"usage\"`\n\tToolCalls    []ToolCall      `json:\"tool_calls\"`\n}\n\ntype Usage struct {\n\tPromptTokens     int    `json:\"prompt_tokens\"`\n\tCompletionTokens int    `json:\"completion_tokens\"`\n\tTotalTokens      int    `json:\"total_tokens\"`\n\tName             string `json:\"name\"`\n}\n\ntype AgentBuilderAnswer struct {\n\tAnswer string\n\tEvents []Event\n}\n\ntype Event struct {\n\tCode        int\n\tMessage     string\n\tStatus      string\n\tEventType   string\n\tContentType string\n\tUsage       Usage\n\tDetail      any\n\tToolCalls   []ToolCall\n}\n\ntype ToolCall struct {\n\tID       string             `json:\"id\"`       // 工具调用ID\n\tType     string             `json:\"type\"`     // 需要输出的工具调用的类型。就目前而言，这始终是function\n\tFunction FunctionCallOption `json:\"function\"` // 函数定义\n}\n\ntype FunctionCallOption struct {\n\tName      string         `json:\"name\"`\n\tArguments map[string]any `json:\"arguments\"`\n}\n\ntype TextDetail struct {\n\tText string `json:\"text\"`\n}\n\ntype CodeDetail struct {\n\tText  string   `json:\"text\"`\n\tCode  string   `json:\"code\"`\n\tFiles []string `json:\"files\"`\n}\n\ntype RAGDetail struct {\n\tText       string      `json:\"text\"`\n\tReferences []Reference `json:\"references\"`\n}\n\ntype Reference struct {\n\tID              string `json:\"id\"`\n\tFrom            string `json:\"from\"`\n\tURL             string `json:\"url\"`\n\tContent         string `json:\"content\"`\n\tSegmentID       string `json:\"segment_id\"`\n\tDocumentID      string `json:\"document_id\"`\n\tDatasetID       string `json:\"dataset_id\"`\n\tDocumentName    string `json:\"document_name\"`\n\tKnowledgeBaseID string `json:\"knowledgebase_id\"`\n}\n\ntype FunctionCallDetail struct {\n\tText  any    `json:\"text\"`\n\tImage string `json:\"image\"`\n\tAudio string `json:\"audio\"`\n\tVideo string `json:\"video\"`\n}\n\ntype ImageDetail struct {\n\tImage string `json:\"image\"`\n}\n\ntype AudioDetail struct {\n\tAudio string `json:\"audio\"`\n}\n\ntype VideoDetail struct {\n\tVideo string `json:\"video\"`\n}\n\ntype StatusDetail struct{}\n\ntype ChatflowInterruptDetail struct {\n\tInterruptEventID   string `json:\"interrupt_event_id\"`\n\tInterruptEventType string `json:\"interrupt_event_type\"`\n}\n\ntype PublishMessageDetail struct {\n\tMessage   string `json:\"message\"`\n\tMessageID string `json:\"message_id\"`\n}\n\ntype ChatReasoningDetail struct {\n\tText string `json:\"text\"`\n}\n\ntype JsonDetail struct {\n\tJson FollowUpQueries `json:\"json\"`\n}\n\ntype FollowUpQueries struct {\n\tFollowUpQueries []string `json:\"follow_up_querys\"`\n}\n\ntype DefaultDetail struct {\n\tText  string   `json:\"text,omitempty\"`\n\tURLS  []string `json:\"urls,omitempty\"`\n\tFiles []string `json:\"files,omitempty\"`\n\tImage string   `json:\"image,omitempty\"`\n\tVideo string   `json:\"video,omitempty\"`\n\tAudio string   `json:\"audio,omitempty\"`\n}\n\ntype AppBuilderClientRawResponse struct {\n\tRequestID      string           `json:\"request_id\"`\n\tDate           string           `json:\"date\"`\n\tAnswer         string           `json:\"answer\"`\n\tConversationID string           `json:\"conversation_id\"`\n\tMessageID      string           `json:\"message_id\"`\n\tIsCompletion   bool             `json:\"is_completion\"`\n\tContent        []RawEventDetail `json:\"content\"`\n\tCode           string           `json:\"code,omitempty\"`\n\tMessage        string           `json:\"message,omitempty\"`\n}\n\ntype GetAppListRequest struct {\n\tLimit  int    `json:\"limit\"`\n\tAfter  string `json:\"after\"`\n\tBefore string `json:\"before\"`\n}\n\ntype GetAppListResponse struct {\n\tRequestID string `json:\"request_id\"`\n\tData      []App  `json:\"data\"`\n\tCode      string `json:\"code\"`\n\tMessage   string `json:\"message\"`\n}\n\ntype DescribeAppsRequest struct {\n\tMarker  *string `json:\"marker,omitempty\"`\n\tMaxKeys *int    `json:\"maxKeys,omitempty\"`\n}\n\ntype DescribeAppsResponse struct {\n\tRequestID   string `json:\"requestId\"`\n\tMarker      string `json:\"marker\"`\n\tIsTruncated bool   `json:\"isTruncated\"`\n\tNextMarker  string `json:\"nextMarker\"`\n\tMaxKeys     int    `json:\"maxKeys\"`\n\tData        []App  `json:\"data\"`\n}\n\ntype DescribeAppRequest struct {\n\tID string `json:\"id\"`\n}\n\ntype DescribeAppResponse struct {\n\tRequestID           string              `json:\"requestId\"`\n\tID                  string              `json:\"id\"`\n\tName                string              `json:\"name\"`\n\tDescription         string              `json:\"description\"`\n\tInstruction         string              `json:\"instruction\"`\n\tPrologue            string              `json:\"prologue\"`\n\tExampleQueries      []string            `json:\"exampleQueries\"`\n\tFollowUpQueries     AppFollowUpQueries  `json:\"followUpQueries\"`\n\tComponents          []Component         `json:\"components\"`\n\tKnowledgeBaseConfig KnowledgeBaseConfig `json:\"knowledgeBaseConfig\"`\n\tModelConfig         ModelConfig         `json:\"modelConfig\"`\n\tBackground          *Background         `json:\"background,omitempty\"`\n}\ntype AppFollowUpQueries struct {\n\tType   string `json:\"type\"`\n\tPrompt string `json:\"prompt\"`\n\tRound  string `json:\"round\"`\n}\ntype Component struct {\n\tName        string `json:\"name,omitempty\"`\n\tDescription string `json:\"description,omitempty\"`\n\tCustomDesc  string `json:\"customDesc,omitempty\"`\n}\ntype KnowledgeBaseConfig struct {\n\tKnowledgeBases []AppKnowledgeBase `json:\"knowledgeBases\"`\n\tRetrieval      RetrievalConfig    `json:\"retrieval\"`\n}\ntype AppKnowledgeBase struct {\n\tID          string `json:\"id,omitempty\"`\n\tName        string `json:\"name,omitempty\"`\n\tDescription string `json:\"description,omitempty\"`\n}\ntype RetrievalConfig struct {\n\tEnableWebSearch bool    `json:\"enableWebSearch,omitempty\"`\n\tOrder           string  `json:\"order,omitempty\"`\n\tStrategy        string  `json:\"strategy,omitempty\"`\n\tTopK            int     `json:\"topK,omitempty\"`\n\tThreshold       float64 `json:\"threshold,omitempty\"`\n}\ntype ModelConfig struct {\n\tPlan PlanConfig `json:\"plan\"`\n\tChat ChatConfig `json:\"chat\"`\n}\ntype PlanConfig struct {\n\tModelID   string      `json:\"modelId\"`\n\tModel     string      `json:\"model\"`\n\tMaxRounds int         `json:\"maxRounds\"`\n\tConfig    ModelParams `json:\"config\"`\n}\ntype ChatConfig struct {\n\tModelID           string      `json:\"modelId\"`\n\tModel             string      `json:\"model\"`\n\tHistoryChatRounds int         `json:\"historyChatRounds\"`\n\tConfig            ModelParams `json:\"config\"`\n}\ntype ModelParams struct {\n\tTemperature float64 `json:\"temperature\"`\n\tTopP        float64 `json:\"topP\"`\n}\ntype Background struct {\n\tID           string        `json:\"id,omitempty\"`\n\tPath         string        `json:\"path,omitempty\"`\n\tMobileConfig *MobileConfig `json:\"mobile_config,omitempty\"`\n\tPCConfig     *PCConfig     `json:\"pc_config,omitempty\"`\n}\ntype MobileConfig struct {\n\tLeft   string `json:\"left,omitempty\"`\n\tTop    string `json:\"top,omitempty\"`\n\tHeight string `json:\"height,omitempty\"`\n\tColor  string `json:\"color,omitempty\"`\n}\ntype PCConfig struct {\n\tLeft   string `json:\"left,omitempty\"`\n\tTop    string `json:\"top,omitempty\"`\n\tHeight string `json:\"height,omitempty\"`\n\tColor  string `json:\"color,omitempty\"`\n}\n\ntype App struct {\n\tID          string `json:\"id\"`\n\tName        string `json:\"name\"`\n\tDescription string `json:\"description\"`\n\tAppType     string `json:\"appType,omitempty\"`\n\tIsPublished bool   `json:\"isPublished,omitempty\"`\n\tUpdateTime  int64  `json:\"updateTime,omitempty\"`\n}\n\ntype AppBuilderClientAnswer struct {\n\tMessageID string\n\tAnswer    string\n\tEvents    []Event\n\tCode      string\n\tMessage   string\n\tRequestID string\n}\n\nfunc (t *AppBuilderClientAnswer) transform(inp *AppBuilderClientRawResponse) {\n\tt.Answer = inp.Answer\n\tt.MessageID = inp.MessageID\n\tt.Code = inp.Code\n\tt.Message = inp.Message\n\tt.RequestID = inp.RequestID\n\tfor _, c := range inp.Content {\n\t\tev := Event{Code: c.EventCode,\n\t\t\tMessage:     c.EventMessage,\n\t\t\tStatus:      c.EventStatus,\n\t\t\tEventType:   c.EventType,\n\t\t\tContentType: c.ContentType,\n\t\t\tUsage:       c.Usage,\n\t\t\tDetail:      c.Outputs,\n\t\t\tToolCalls:   c.ToolCalls}\n\t\t// 这部分新改的\n\t\ttp, ok := TypeToStruct[ev.ContentType]\n\t\tif !ok {\n\t\t\ttp = reflect.TypeOf(DefaultDetail{})\n\t\t}\n\t\tv := reflect.New(tp)\n\t\t_ = json.Unmarshal(c.Outputs, v.Interface())\n\t\tev.Detail = v.Elem().Interface()\n\t\t// 这部分新改的\n\t\tt.Events = append(t.Events, ev)\n\t}\n}\n\n// AppBuilderClientIterator 定义AppBuilderClient流式/非流式迭代器接口\n// 初始状态可迭代,如果返回error不为空则代表迭代结束，\n// error为io.EOF，则代表迭代正常结束，其它则为异常结束\ntype AppBuilderClientIterator interface {\n\t// Next 获取处理结果，如果返回error不为空，迭代器自动失效，不允许再调用此方法\n\tNext() (*AppBuilderClientAnswer, error)\n}\n\ntype AppBuilderClientStreamIterator struct {\n\trequestID string\n\tr         *sseReader\n\tbody      io.ReadCloser\n}\n\nfunc (t *AppBuilderClientStreamIterator) Next() (*AppBuilderClientAnswer, error) {\n\tdata, err := t.r.ReadMessageLine()\n\tif err != nil && !(err == io.EOF) {\n\t\tt.body.Close()\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tif err != nil && err == io.EOF {\n\t\tt.body.Close()\n\t\treturn nil, err\n\t}\n\tif strings.HasPrefix(string(data), \"data:\") {\n\t\tvar resp AppBuilderClientRawResponse\n\t\tif err := json.Unmarshal(data[5:], &resp); err != nil {\n\t\t\tt.body.Close()\n\t\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t\t}\n\t\tanswer := &AppBuilderClientAnswer{}\n\t\tanswer.transform(&resp)\n\t\treturn answer, nil\n\t}\n\t// 非SSE格式关闭连接，并返回数据\n\tt.body.Close()\n\treturn nil, fmt.Errorf(\"requestID=%s, body=%s\", t.requestID, string(data))\n}\n\n// AppBuilderClientOnceIterator 非流式返回时对应的迭代器，只可迭代一次\ntype AppBuilderClientOnceIterator struct {\n\tbody      io.ReadCloser\n\trequestID string\n}\n\nfunc (t *AppBuilderClientOnceIterator) Next() (*AppBuilderClientAnswer, error) {\n\tdata, err := io.ReadAll(t.body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tdefer t.body.Close()\n\tvar resp AppBuilderClientRawResponse\n\tif err := json.Unmarshal(data, &resp); err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tanswer := &AppBuilderClientAnswer{}\n\tanswer.transform(&resp)\n\treturn answer, nil\n}\n"
  },
  {
    "path": "go/appbuilder/app_builder_client_test.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestNewAppBuilderClientError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\t// NewAppBuilderClient测试1\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\t_, err = NewAppBuilderClient(\"\", config)\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t}\n\t// NewAppBuilderClient测试2\n\t_, err = NewAppBuilderClient(appID, nil)\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t}\n\n\t// GetSdkConfig测试\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\tclient.GetSdkConfig()\n\t// GetClient测试\n\tclient.GetClient()\n\n\tvar GatewayURL = config.GatewayURLV2\n\n\t// CreateConversation 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.CreateConversation()\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected ServiceURLV2 error, got %v\", err)\n\t}\n\t// CreateConversation 测试2  Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.CreateConversation()\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected Bad Request error, got %v\", err)\n\t}\n\t// CreateConversation 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\t_, err = client.CreateConversation()\n\tif err == nil {\n\t\tt.Fatalf(\"expected 400 error, got nil\")\n\t}\n\t// CreateConversation 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\t_, err = client.CreateConversation()\n\tif err == nil {\n\t\tt.Fatalf(\"expected read error, got nil\")\n\t}\n\n\t// CreateConversation 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\t_, err = client.CreateConversation()\n\tif err == nil {\n\t\tt.Fatalf(\"expected JSON unmarshal error, got nil\")\n\t}\n\t// CreateConversation 测试 6: 缺少 id 字段\n\tclient.client = &MissingIDHTTPClient{}\n\tclient.CreateConversation()\n\n\t// 测试1  ServiceURLV2 错误\n\tconfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = GetAppList(GetAppListRequest{\n\t\tLimit: 10,\n\t}, config)\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected ServiceURLV2 error, got %v\", err)\n\t}\n\t// 测试2  Do 错误\n\tconfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = GetAppList(GetAppListRequest{\n\t\tLimit: 10,\n\t}, config)\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected Bad Request error, got %v\", err)\n\t}\n\n\t// 测试3  错误的 HTTP 响应\n\tconfig.GatewayURLV2 = GatewayURL\n\tconfig.HTTPClient = &MockHTTPClient{}\n\t_, err = GetAppList(GetAppListRequest{\n\t\tLimit: 10,\n\t}, config)\n\tif err == nil {\n\t\tt.Fatalf(\"expected 400 error, got nil\")\n\t}\n\t// 测试 4: 模拟读取 body 时发生错误\n\tconfig.GatewayURLV2 = GatewayURL\n\tconfig.HTTPClient = &FaultyHTTPClient{}\n\t_, err = GetAppList(GetAppListRequest{\n\t\tLimit: 10,\n\t}, config)\n\tif err == nil {\n\t\tt.Fatalf(\"expected read error, got nil\")\n\t}\n\n\t// 测试 5: json.Unmarshal错误\n\tconfig.GatewayURLV2 = GatewayURL\n\tconfig.HTTPClient = &InvalidJSONHTTPClient{}\n\t_, err = GetAppList(GetAppListRequest{\n\t\tLimit: 10,\n\t}, config)\n\tif err == nil {\n\t\tt.Fatalf(\"expected JSON unmarshal error, got nil\")\n\t}\n}\n\nfunc TestClientUploadLocalFile(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tvar GatewayURL = config.GatewayURLV2\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\t// 测试 UploadLocalFile 1: 文件打开错误\n\t_, err = client.UploadLocalFile(\"validConversationID\", \"invalidFilePath\")\n\tif err == nil || !strings.Contains(err.Error(), \"no such file or directory\") {\n\t\tt.Errorf(\"expected file open error, got %v\", err)\n\t}\n\t// 测试 UploadLocalFile 2: t.client.Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.UploadLocalFile(\"5678987\", \"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Errorf(\"expected client error, got nil\")\n\t}\n\n\t// 测试 UploadLocalFile 3: 无效的ServiceURLV2\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.UploadLocalFile(\"12345\", \"./files/test.pdf\")\n\tif err == nil || !strings.Contains(err.Error(), \"missing protocol scheme\") {\n\t\tt.Errorf(\"expected ServiceURLV2 error, got %v\", err)\n\t}\n\n\t// 测试 UploadLocalFile 4: 错误的 HTTP 响应\n\tclient.client = &MockHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = client.UploadLocalFile(\"21\", \"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Fatalf(\"expected 400 error, got nil\")\n\t}\n\t// 测试 UploadLocalFile 5: 模拟读取 body 时发生错误\n\tclient.client = &FaultyHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = client.UploadLocalFile(\"22\", \"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Fatalf(\"expected read error, got nil\")\n\t}\n\t// 测试 UploadLocalFile 6: json.Unmarshal错误\n\tclient.client = &InvalidJSONHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = client.UploadLocalFile(\"11\", \"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Fatalf(\"expected JSON unmarshal error, got nil\")\n\t}\n\t// 测试 UploadLocalFile 7: 缺少 id 字段\n\tclient.client = &MissingIDHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = client.UploadLocalFile(\"23\", \"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Fatalf(\"expected missing conversation_id error, got nil\")\n\t}\n}\n\nfunc TestClientRun(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tvar GatewayURL = config.GatewayURLV2\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\t// 测试1 conversationID ==0\n\t_, err = client.Run(\"\", \"描述简历中的候选人情况\", nil, true)\n\tif err == nil {\n\t\tt.Errorf(\"expected conversationID mustn't be empty, got %v\", err)\n\t}\n\n\t// 测试2   ServiceURLV2 error 无效的ServiceURLV2\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.Run(\"12\", \"描述简历中的候选人情况\", nil, true)\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected ServiceURLV2 error, got %v\", err)\n\t}\n\t// 测试3   t.client.Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.Run(\"123\", \"描述简历中的候选人情况\", nil, true)\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected Bad Request error, got %v\", err)\n\t}\n\t// 测试4   错误的 HTTP 响应\n\tclient.client = &MockHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = client.Run(\"1234\", \"描述简历中的候选人情况\", nil, true)\n\tif err == nil {\n\t\tt.Fatalf(\"expected 400 error, got nil\")\n\t}\n}\n\nfunc TestClientRunWithToolCallError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tvar GatewayURL = config.GatewayURLV2\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\tjsonStr := `\n\t{\n\t\t\"type\": \"function\",\n\t\t\"function\": {\n\t\t\t\"name\": \"get_cur_whether\",\n\t\t\t\"description\": \"这是一个获得指定地点天气的工具\",\n\t\t\t\"parameters\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"省，市名，例如：河北省\"\n\t\t\t\t\t},\n\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"enum\": [\"摄氏度\", \"华氏度\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\"location\"]\n\t\t\t}\n\t\t}\n\t}`\n\n\tvar tool Tool\n\terr = json.Unmarshal([]byte(jsonStr), &tool)\n\tif err != nil {\n\t\tfmt.Println(\"unmarshal tool error:\", err)\n\t}\n\n\t// 测试1 conversationID ==0\n\tclient.RunWithToolCall(AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: \"\",\n\t\tStream:         false,\n\t\tTools:          []Tool{tool},\n\t})\n\n\t// 测试4   非流式\n\tclient.RunWithToolCall(AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: \"111111\",\n\t\tStream:         false,\n\t\tTools:          []Tool{tool},\n\t})\n\n\t// 测试2   ServiceURLV2 error 无效的ServiceURLV2\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\tclient.RunWithToolCall(AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: \"111111111\",\n\t\tStream:         false,\n\t\tTools:          []Tool{tool},\n\t})\n\n\t// 测试3   t.client.Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\tclient.RunWithToolCall(AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: \"222222\",\n\t\tStream:         false,\n\t\tTools:          []Tool{tool},\n\t})\n\n\t// 测试4   错误的 HTTP 响应\n\tclient.client = &MockHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.RunWithToolCall(AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: \"33333\",\n\t\tStream:         false,\n\t\tTools:          []Tool{tool},\n\t})\n}\n\nfunc TestDescribeApp(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n\tlog := func(format string, args ...any) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tapp, err := DescribeApp(\"b2a972c5-e082-46e5-b313-acbf51792422\", config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"describe app failed: %v\", err)\n\t}\n\tlog(\"Get App Name: %s\", app.Name)\n\tchatflowApp, err := DescribeApp(\"4403205e-fb83-4fac-96d8-943bdb63796f\", config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"describe app failed: %v\", err)\n\t}\n\tlog(\"Get App Name: %s\", chatflowApp.Name)\n}\n\nfunc TestNewAppBuilderClient(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n\t// 定义一个日志函数，将日志写入缓冲区\n\tlog := func(format string, args ...any) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tapps, err := GetAppList(GetAppListRequest{\n\t\tLimit: 10,\n\t}, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"get apps failed: %v\", err)\n\t}\n\tlog(\"Number of apps: %d\", len(apps))\n\n\tmaxKeys := 10\n\tapps2, err := DescribeApps(DescribeAppsRequest{MaxKeys: &maxKeys}, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"describe apps failed: %v\", err)\n\t}\n\tlog(\"Number of apps: %d\", len(apps2.Data))\n\n\tappID := \"fb64d96b-f828-4385-ba1d-835298d635a9\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\t_, err = client.UploadLocalFile(conversationID, \"./files/test.pdf\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload local file failed: %v\", err)\n\t}\n\ti, err := client.Run(conversationID, \"描述简历中的候选人情况\", nil, true)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\ttotalAnswer := \"\"\n\t// test follow up queries\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\ttotalAnswer += answer.Answer\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == JsonContentType {\n\t\t\t\tdetail := ev.Detail.(JsonDetail)\n\t\t\t\tfolllowUpQueries := detail.Json.FollowUpQueries\n\t\t\t\tfmt.Println(folllowUpQueries)\n\t\t\t\tif len(folllowUpQueries[0]) == 0 {\n\t\t\t\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\t\t\t\tt.Fatal(\"follow up queries is empty\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tlog(string(evJSON))\n\t\t}\n\t}\n\tlog(\"----------------answer-------------------\")\n\tlog(totalAnswer)\n\t// 测试4   非流式\n\tclient.Run(conversationID, \"描述简历中的候选人情况\", nil, false)\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestAppBuilderClientRunWithToolCall(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n\tlog := func(format string, args ...any) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AgentBuidler instance failed\")\n\t}\n\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\n\tjsonStr := `\n\t{\n\t\t\"type\": \"function\",\n\t\t\"function\": {\n\t\t\t\"name\": \"get_cur_whether\",\n\t\t\t\"description\": \"这是一个获得指定地点天气的工具\",\n\t\t\t\"parameters\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"省，市名，例如：河北省\"\n\t\t\t\t\t},\n\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"enum\": [\"摄氏度\", \"华氏度\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\"location\"]\n\t\t\t}\n\t\t}\n\t}`\n\n\tvar tool Tool\n\terr = json.Unmarshal([]byte(jsonStr), &tool)\n\tif err != nil {\n\t\tfmt.Println(\"unmarshal tool error:\", err)\n\t}\n\n\ti, err := client.RunWithToolCall(AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"今天北京的天气怎么样?\",\n\t\tConversationID: conversationID,\n\t\tStream:         false,\n\t\tTools:          []Tool{tool},\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\ttotalAnswer := \"\"\n\ttoolCallID := \"\"\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\ttotalAnswer += answer.Answer\n\t\tlastEvent := answer.Events[len(answer.Events)-1]\n\t\ttoolCallID = lastEvent.ToolCalls[len(lastEvent.ToolCalls)-1].ID\n\t}\n\n\ti2, err := client.RunWithToolCall(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tToolOutputs: []ToolOutput{\n\t\t\t{\n\t\t\t\tToolCallID: toolCallID,\n\t\t\t\tOutput:     \"北京今天35\",\n\t\t\t},\n\t\t},\n\t})\n\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\n\tfor answer, err := i2.Next(); err == nil; answer, err = i2.Next() {\n\t\ttotalAnswer += answer.Answer\n\t\tfor _, ev := range answer.Events {\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tlog(string(evJSON))\n\t\t}\n\t}\n\n\tlog(\"----------------answer-------------------\")\n\tlog(totalAnswer)\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tfmt.Printf(\"%s========== FAIL:  %s ==========%s\\n\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestAppBuilderClientRunToolChoice(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n\tlog := func(format string, args ...any) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tappID := \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AgentBuidler instance failed\")\n\t}\n\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\n\tinput := make(map[string]any)\n\tinput[\"city\"] = \"北京\"\n\tend_user_id := \"go_user_id_0\"\n\ti, err := client.Run(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"你能干什么\",\n\t\tEndUserID:      &end_user_id,\n\t\tStream:         false,\n\t\tToolChoice: &ToolChoice{\n\t\t\tType: \"function\",\n\t\t\tFunction: ToolChoiceFunction{\n\t\t\t\tName:  \"WeatherQuery\",\n\t\t\t\tInput: input,\n\t\t\t},\n\t\t},\n\t})\n\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tevJSON, _ := json.Marshal(ev)\n\t\t\tlog(string(evJSON))\n\t\t}\n\t}\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestAppBuilderClientRunChatflow(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tappID := \"4403205e-fb83-4fac-96d8-943bdb63796f\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AgentBuidler instance failed\")\n\t}\n\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\n\ti, err := client.Run(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"查天气\",\n\t\tStream:         true,\n\t})\n\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\n\tvar interruptId string\n\tinterruptStack := make([]string, 0)\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == PublishMessageContentType {\n\t\t\t\tdetail := ev.Detail.(PublishMessageDetail)\n\t\t\t\tmessage := detail.Message\n\t\t\t\tfmt.Println(message)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ev.ContentType == ChatflowInterruptContentType {\n\t\t\t\tdeatil := ev.Detail.(ChatflowInterruptDetail)\n\t\t\t\tinterruptId = deatil.InterruptEventID\n\t\t\t\tinterruptStack = append(interruptStack, interruptId)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif len(interruptId) == 0 {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"interrupt id is empty\")\n\t}\n\n\tinterruptId = \"\"\n\ti2, err := client.Run(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"我先查个航班动态\",\n\t\tStream:         true,\n\t\tAction:         NewResumeAction(interruptStack[len(interruptStack)-1]),\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\tinterruptStack = interruptStack[:len(interruptStack)-1]\n\tfor answer, err := i2.Next(); err == nil; answer, err = i2.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == PublishMessageContentType {\n\t\t\t\tdetail := ev.Detail.(PublishMessageDetail)\n\t\t\t\tmessage := detail.Message\n\t\t\t\tfmt.Println(message)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ev.ContentType == ChatflowInterruptContentType {\n\t\t\t\tdeatil := ev.Detail.(ChatflowInterruptDetail)\n\t\t\t\tinterruptId = deatil.InterruptEventID\n\t\t\t\tinterruptStack = append(interruptStack, interruptId)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif len(interruptId) == 0 {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"interrupt id is empty\")\n\t}\n\n\tinterruptId = \"\"\n\ti3, err := client.Run(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"CA1234\",\n\t\tStream:         true,\n\t\tAction:         NewResumeAction(interruptStack[len(interruptStack)-1]),\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\tinterruptStack = interruptStack[:len(interruptStack)-1]\n\tfor answer, err := i3.Next(); err == nil; answer, err = i3.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == TextContentType {\n\t\t\t\tdetail := ev.Detail.(TextDetail)\n\t\t\t\ttext := detail.Text\n\t\t\t\tfmt.Println(text)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ev.ContentType == ChatflowInterruptContentType {\n\t\t\t\tdeatil := ev.Detail.(ChatflowInterruptDetail)\n\t\t\t\tinterruptId = deatil.InterruptEventID\n\t\t\t\tinterruptStack = append(interruptStack, interruptId)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\ti4, err := client.Run(AppBuilderClientRunRequest{\n\t\tConversationID: conversationID,\n\t\tAppID:          appID,\n\t\tQuery:          \"北京的\",\n\t\tStream:         true,\n\t\tAction:         NewResumeAction(interruptStack[len(interruptStack)-1]),\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\tfor answer, err := i4.Next(); err == nil; answer, err = i4.Next() {\n\t\tfor _, ev := range answer.Events {\n\t\t\tif ev.ContentType == TextContentType {\n\t\t\t\tdetail := ev.Detail.(TextDetail)\n\t\t\t\ttext := detail.Text\n\t\t\t\tfmt.Println(text)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestAppbuilderClientFeedback(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"fb64d96b-f828-4385-ba1d-835298d635a9\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\t_, err = client.UploadLocalFile(conversationID, \"./files/test.pdf\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload local file failed: %v\", err)\n\t}\n\n\ti, err := client.Run(conversationID, \"描述简历中的候选人情况\", nil, false)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run failed:%v\", err)\n\t}\n\n\tvar messageID string\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\tif answer.MessageID != \"\" {\n\t\t\tmessageID = answer.MessageID\n\t\t\tbreak\n\t\t}\n\t}\n\n\t_, err = client.Feedback(AppBuilderClientFeedbackRequest{\n\t\tConversationID: conversationID,\n\t\tMessageID:      messageID,\n\t\tType:           \"downvote\",\n\t\tFlag:           []string{\"没有帮助\"},\n\t\tReason:         \"测试\",\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upvote failed:%v\", err)\n\t}\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestAppBuilderClientUploadFile(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"fb64d96b-f828-4385-ba1d-835298d635a9\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\n\treq := AppBuilderClientUploadFileRequest{\n\t\tConversationID: conversationID,\n\t\tFilePath:       \"./files/test.pdf\",\n\t}\n\t_, err = client.UploadFile(&req)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload local file failed: %v\", err)\n\t}\n\n\treq = AppBuilderClientUploadFileRequest{\n\t\tConversationID: conversationID,\n\t\tFileURL:        \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad6862cf937c03f8c5260d51c6ae\",\n\t}\n\t_, err = client.UploadFile(&req)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload url file failed: %v\", err)\n\t}\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestAppBuilderClientRunParameters(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tappID := \"2313e282-baa6-4db6-92dd-a21e99cfd59e\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\n\tres, err := client.Run(AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"国庆长假\",\n\t\tStream:         false,\n\t\tConversationID: conversationID,\n\t\tParameters: map[string]any{\n\t\t\t\"city\": \"上海\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"run err: %v\", err)\n\t}\n\n\tfor answer, err := res.Next(); err == nil; answer, err = res.Next() {\n\t\tt.Log(answer.Answer)\n\t}\n\n}\nfunc TestAppBuilderClientRunCustomMetadata(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tappID := \"a3654cd9-378a-4b46-a33b-2259ca3b304e\"\n\tclient, err := NewAppBuilderClient(appID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new AppBuilderClient instance failed\")\n\t}\n\n\tconversationID, err := client.CreateConversation()\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create conversation failed: %v\", err)\n\t}\n\n\tres, err := client.Run(AppBuilderClientRunRequest{\n\t\tAppID:          appID,\n\t\tQuery:          \"我要回老家相亲\",\n\t\tStream:         true,\n\t\tConversationID: conversationID,\n\t\tCustomMetadata: &CustomMetadata{\n\t\t\tOverrideRoleInstruction: `# 角色任务\\n\" +\n                \"作为高情商大师，你的主要任务是根据提问，做出最佳的建议。\\n\" +\n                \"\\n\" +\n                \"# 工具能力\\n\" +\n                \"\\n\" +\n                \"无工具集提供\\n\" +\n                \"\\n\" +\n                \"# 要求与限制\\n\" +\n                \"\\n\" +\n                \"1. 输出内容的风格为幽默\\n\" +\n                \"2.输出的字数限制为1000字范围\"`,\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"run err: %v\", err)\n\t}\n\n\tfor answer, err := res.Next(); err == nil; answer, err = res.Next() {\n\t\tt.Log(answer.Answer)\n\t}\n\n}\n"
  },
  {
    "path": "go/appbuilder/component_client.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype ComponentClient struct {\n\tsdkConfig *SDKConfig\n\tclient    HTTPClient\n}\n\nfunc NewComponentClient(config *SDKConfig) (*ComponentClient, error) {\n\tif config == nil {\n\t\treturn nil, errors.New(\"config is nil\")\n\t}\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 1800 * time.Second}\n\t}\n\treturn &ComponentClient{sdkConfig: config, client: client}, nil\n}\n\nfunc (t *ComponentClient) Run(component, version, action string, stream bool, parameters map[string]any) (ComponentClientIterator, error) {\n\trequest := http.Request{}\n\n\turlSuffix := fmt.Sprintf(\"/components/%s\", component)\n\tif version != \"\" {\n\t\turlSuffix += fmt.Sprintf(\"/version/%s\", version)\n\t}\n\tif action != \"\" {\n\t\tif strings.Contains(urlSuffix, \"?\") {\n\t\t\turlSuffix += fmt.Sprintf(\"&action=%s\", action)\n\t\t} else {\n\t\t\turlSuffix += fmt.Sprintf(\"?action=%s\", action)\n\t\t}\n\t}\n\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(urlSuffix)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theader := t.sdkConfig.AuthHeaderV2()\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\theader.Set(\"X-Appbuilder-From\", \"sdk\")\n\trequest.Header = header\n\n\treq := ComponentRunRequest{\n\t\tStream:     stream,\n\t\tParameters: parameters,\n\t}\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\trequest.ContentLength = int64(len(data)) // 手动设置长度\n\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tr := NewSSEReader(1024*1024, bufio.NewReader(resp.Body))\n\tif req.Stream {\n\t\treturn &ComponentClientStreamIterator{requestID: requestID, r: r, body: resp.Body}, nil\n\t}\n\treturn &ComponentClientOnceIterator{body: resp.Body}, nil\n}\n"
  },
  {
    "path": "go/appbuilder/component_client_data.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nconst (\n\tSysOriginQuery    = \"_sys_origin_query\"\n\tSysFileUrls       = \"_sys_file_urls\"\n\tSysConversationID = \"_sys_conversation_id\"\n\tSysEndUserID      = \"_sys_end_user_id\"\n\tSysChatHistory    = \"_sys_chat_history\"\n)\n\ntype ComponentRunRequest struct {\n\tStream     bool           `json:\"stream\"`\n\tParameters map[string]any `json:\"parameters\"`\n}\n\ntype Message struct {\n\tRole    string `json:\"role\"`\n\tContent string `json:\"content\"`\n}\n\ntype ComponentRunResponse struct {\n\tRequestID      string    `json:\"request_id\"`\n\tCode           string    `json:\"code\"`\n\tMessage        string    `json:\"message\"`\n\tConversationID string    `json:\"conversation_id\"`\n\tMessageID      string    `json:\"message_id\"`\n\tTraceID        string    `json:\"trace_id\"`\n\tUserID         string    `json:\"user_id\"`\n\tEndUserID      string    `json:\"end_user_id\"`\n\tStatus         string    `json:\"status\"` // 新增的字段\n\tRole           string    `json:\"role\"`\n\tContent        []Content `json:\"content\"`\n}\n\ntype Content struct {\n\tName         string         `json:\"name\"`\n\tVisibleScope string         `json:\"visible_scope\"`\n\tRawData      map[string]any `json:\"raw_data\"`\n\tUsage        map[string]any `json:\"usage\"`\n\tMetrics      map[string]any `json:\"metrics\"`\n\tType         string         `json:\"type\"`\n\tText         map[string]any `json:\"text\"`\n\tEvent        ComponentEvent `json:\"event\"`\n}\n\ntype ComponentEvent struct {\n\tID           string `json:\"id\"`\n\tStatus       string `json:\"status\"`\n\tName         string `json:\"name\"`\n\tCreatedTime  string `json:\"created_time\"`\n\tErrorCode    string `json:\"error_code\"`\n\tErrorMessage string `json:\"error_message\"`\n}\n\ntype Text struct {\n\tInfo string `json:\"info\"`\n}\n\ntype Code struct {\n\tCode string `json:\"code\"`\n}\n\ntype Files struct {\n\tFilename string `json:\"filename\"`\n\tUrl      string `json:\"url\"`\n}\n\ntype Urls struct {\n\tUrl string `json:\"url\"`\n}\n\ntype OralText struct {\n\tInfo string `json:\"info\"`\n}\n\ntype References struct {\n\tType    string         `json:\"type\"`\n\tSource  string         `json:\"source\"`\n\tDocID   string         `json:\"doc_id\"`\n\tTitle   string         `json:\"title\"`\n\tContent string         `json:\"content\"`\n\tExtra   map[string]any `json:\"extra\"`\n}\n\ntype Image struct {\n\tFilename string `json:\"filename\"`\n\tUrl      string `json:\"url\"`\n\tByte     []byte `json:\"byte\"`\n}\n\ntype Chart struct {\n\tType string `json:\"type\"`\n\tData string `json:\"data\"`\n}\n\ntype Audio struct {\n\tFilename string `json:\"filename\"`\n\tUrl      string `json:\"url\"`\n\tByte     []byte `json:\"byte\"`\n}\n\ntype PlanStep struct {\n\tName      string         `json:\"name\"`\n\tArguments map[string]any `json:\"arguments\"`\n\tThought   string         `json:\"thought\"`\n}\n\ntype Plan struct {\n\tDetail string     `json:\"detail\"`\n\tSteps  []PlanStep `json:\"steps\"`\n}\n\ntype FunctionCall struct {\n\tThought   string         `json:\"thought\"`\n\tName      string         `json:\"name\"`\n\tArguments map[string]any `json:\"arguments\"`\n}\n\ntype Json struct {\n\tData string `json:\"data\"`\n}\n\ntype ComponentClientIterator interface {\n\t// Next 获取处理结果，如果返回error不为空，迭代器自动失效，不允许再调用此方法\n\tNext() (*ComponentRunResponse, error)\n}\n\ntype ComponentClientStreamIterator struct {\n\trequestID string\n\tr         *sseReader\n\tbody      io.ReadCloser\n}\n\nfunc (t *ComponentClientStreamIterator) Next() (*ComponentRunResponse, error) {\n\tdata, err := t.r.ReadMessageLine()\n\tif err != nil && !(err == io.EOF) {\n\t\tt.body.Close()\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tif err != nil && err == io.EOF {\n\t\tt.body.Close()\n\t\treturn nil, err\n\t}\n\tif strings.HasPrefix(string(data), \"data:\") {\n\t\tvar resp ComponentRunResponse\n\t\tif err := json.Unmarshal(data[5:], &resp); err != nil {\n\t\t\tt.body.Close()\n\t\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t\t}\n\t\treturn &resp, nil\n\t}\n\t// 非SSE格式关闭连接，并返回数据\n\tt.body.Close()\n\treturn nil, fmt.Errorf(\"requestID=%s, body=%s\", t.requestID, string(data))\n}\n\n// ComponentClientOnceIterator 非流式返回时对应的迭代器，只可迭代一次\ntype ComponentClientOnceIterator struct {\n\tbody      io.ReadCloser\n\trequestID string\n}\n\nfunc (t *ComponentClientOnceIterator) Next() (*ComponentRunResponse, error) {\n\tdata, err := io.ReadAll(t.body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tdefer t.body.Close()\n\tvar resp ComponentRunResponse\n\tif err := json.Unmarshal(data, &resp); err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\treturn &resp, nil\n}\n"
  },
  {
    "path": "go/appbuilder/component_client_test.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestComponentClient(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tcomponentID := \"44205c67-3980-41f7-aad4-37357b577fd0\"\n\tclient, err := NewComponentClient(config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new ComponentClient instance failed\")\n\t}\n\n\tparameters := map[string]any{\n\t\tSysOriginQuery: \"北京景点推荐\",\n\t}\n\ti, err := client.Run(componentID, \"latest\", \"\", false, parameters)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run component failed: %v\", err)\n\t}\n\n\t// test result\n\tfor answer, err := i.Next(); err == nil; answer, err = i.Next() {\n\t\tdata := answer.Content[0].Text\n\t\tif data == nil {\n\t\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\t\tt.Fatalf(\"run component failed: data is nil\")\n\t\t}\n\t}\n\n\ti2, err := client.Run(componentID, \"latest\", \"\", true, parameters)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run component failed: %v\", err)\n\t}\n\n\t// test stream result\n\tvar answerText any\n\tfor answer, err := i2.Next(); err == nil; answer, err = i2.Next() {\n\t\tif len(answer.Content) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tanswerText = answer.Content[0].Text\n\t}\n\tif answerText == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"run component failed: data is nil\")\n\t}\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestComponentClientHeader(t *testing.T) {\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tcomponentID := \"c-wf-a39ee06c-808f-4a19-9f5f-544044283749\"\n\tparameters := map[string]any{\n\t\tSysOriginQuery: \"梦到巨人，是怎么回事，请仔细分析，写一篇不少于1000字的文章\",\n\t}\n\tcomponentClient, err := NewComponentClient(config)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\tret, err := componentClient.Run(componentID, \"latest\", \"\", false, parameters)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\tfor answer, err := ret.Next(); err == nil; answer, err = ret.Next() {\n\t\tt.Log(answer.Content[0].Text[\"info\"])\n\t}\n\n\tret2, err := componentClient.Run(componentID, \"latest\", \"\", true, parameters)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\tfor answer, err := ret2.Next(); err == nil; answer, err = ret2.Next() {\n\t\tif len(answer.Content) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tt.Log(answer.Content[0].Text[\"info\"])\n\t}\n\n}\n"
  },
  {
    "path": "go/appbuilder/config.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n\n\t\"github.com/google/uuid\"\n)\n\nconst (\n\tGatewayURL            = \"GATEWAY_URL\"\n\tGatewayURLV2          = \"GATEWAY_URL_V2\"\n\tSecretKey             = \"APPBUILDER_TOKEN\"\n\tConsoleOpenAPIVersion = \"CONSOLE_OPENAPI_VERSION\"\n\tConsoleOpenAPIPrefix  = \"CONSOLE_OPENAPI_PREFIX\"\n\tSecretKeyPrefix       = \"SECRET_KEY_PREFIX\"\n\tDatasetID             = \"DATASET_ID\"\n\tSecretKeyV3           = \"APPBUILDER_TOKEN_V3\"\n\tDatasetIDV3           = \"DATASET_ID_V3\"\n\tDocumentIDV3          = \"DOCUMENT_ID_V3\"\n\n\tDefaultSecretKeyPrefix       = \"Bearer\"\n\tDefaultGatewayURL            = \"https://appbuilder.baidu.com\"\n\tDefaultGatewayURLV2          = \"https://qianfan.baidubce.com\"\n\tDefaultConsoleOpenAPIVersion = \"/v2\"\n\tDefaultConsoleOpenAPIPrefix  = \"\"\n)\n\ntype SDKConfig struct {\n\tGatewayURL            string\n\tGatewayURLV2          string\n\tConsoleOpenAPIVersion string\n\tConsoleOpenAPIPrefix  string\n\tSecretKey             string\n\tHTTPClient            HTTPClient // custom HTTP Client, optional\n\tlogger                *log.Logger\n}\n\nfunc NewSDKConfig(gatewayURL, secretKey string) (*SDKConfig, error) {\n\tgatewayURL = getEnvWithDefault(GatewayURL, gatewayURL, DefaultGatewayURL)\n\tgatewayURLV2 := getEnvWithDefault(GatewayURLV2, \"\", DefaultGatewayURLV2)\n\topenAPIVersion := getEnvWithDefault(ConsoleOpenAPIVersion, \"\", DefaultConsoleOpenAPIVersion)\n\topenAPIPrefix := getEnvWithDefault(ConsoleOpenAPIPrefix, \"\", DefaultConsoleOpenAPIPrefix)\n\n\tsecretKey = getEnvWithDefault(SecretKey, secretKey, \"\")\n\tif len(secretKey) == 0 {\n\t\tlog.Println(\"Error: secret key is empty\")\n\t}\n\tsecretKeyPrefix := getEnvWithDefault(SecretKeyPrefix, \"\", DefaultSecretKeyPrefix)\n\tif !strings.HasPrefix(secretKey, secretKeyPrefix) {\n\t\tsecretKey = secretKeyPrefix + \" \" + secretKey\n\t}\n\n\tsdkConfig := &SDKConfig{\n\t\tGatewayURL:            gatewayURL,\n\t\tGatewayURLV2:          gatewayURLV2,\n\t\tConsoleOpenAPIVersion: openAPIVersion,\n\t\tConsoleOpenAPIPrefix:  openAPIPrefix,\n\t\tSecretKey:             secretKey,\n\t}\n\tlogFile := os.Getenv(\"APPBUILDER_LOGFILE\")\n\tif len(logFile) > 0 {\n\t\tf, err := os.OpenFile(logFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)\n\t\tif err != nil {\n\t\t\tsdkConfig.logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\t\t} else {\n\t\t\tsdkConfig.logger = log.New(f, \"\", log.LstdFlags)\n\t\t}\n\t} else {\n\t\tsdkConfig.logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\t}\n\n\treturn sdkConfig, nil\n}\n\nfunc getEnvWithDefault(key, paramValue, defaultValue string) string {\n\tif paramValue != \"\" {\n\t\treturn paramValue\n\t}\n\n\tv := os.Getenv(key)\n\tif v == \"\" {\n\t\treturn defaultValue\n\t}\n\treturn v\n}\n\nfunc (t *SDKConfig) AuthHeader() http.Header {\n\theader := t.authHeader()\n\theader.Set(\"X-Appbuilder-Authorization\", t.SecretKey)\n\tt.logger.Printf(\"Auth Header %v\", header)\n\treturn header\n}\n\n// AuthHeaderV2 适配OpenAPI，当前仅AgentBuilder使用\nfunc (t *SDKConfig) AuthHeaderV2() http.Header {\n\theader := t.authHeader()\n\theader.Set(\"Authorization\", t.SecretKey)\n\tt.logger.Printf(\"Auth Header %v\", header)\n\treturn header\n}\n\nfunc (t *SDKConfig) authHeader() http.Header {\n\theader := make(http.Header)\n\tplatform := os.Getenv(\"APPBUILDER_SDK_PLATFORM\")\n\tif platform == \"\" {\n\t\tplatform = \"unknown\"\n\t}\n\theader.Set(\"X-Appbuilder-Origin\", \"appbuilder_sdk\")\n\theader.Set(\"X-Appbuilder-Sdk-Config\", \"{\\\"appbuilder_sdk_version\\\":\\\"1.1.0\\\",\\\"appbuilder_sdk_language\\\":\\\"go\\\",\\\"appbuilder_sdk_platform\\\":\\\"\"+platform+\"\\\"}\")\n\theader.Set(\"X-Appbuilder-Request-Id\", uuid.New().String())\n\treturn header\n}\n\nfunc (t *SDKConfig) ServiceURL(suffix string) (*url.URL, error) {\n\t// 解析 GatewayURL\n\tparsedURL, err := url.Parse(t.GatewayURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 使用 path.Join 拼接路径\n\tparsedURL.Path = path.Join(parsedURL.Path, suffix)\n\n\t// 将路径直接解析为最终 URL\n\tendpoint, err := url.Parse(suffix)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 解析相对路径\n\tparsedURL = parsedURL.ResolveReference(endpoint)\n\n\t// 返回拼接后的 URL\n\treturn parsedURL, nil\n}\n\n// ServiceURLV2 适配OpenAPI，当前仅AppbuilderClient使用\nfunc (t *SDKConfig) ServiceURLV2(suffix string) (*url.URL, error) {\n\tsuffix = path.Join(t.ConsoleOpenAPIPrefix, t.ConsoleOpenAPIVersion, suffix)\n\treturn t.formatURL(t.GatewayURLV2, suffix)\n}\n\nfunc (t *SDKConfig) formatURL(absolutePath, suffix string) (*url.URL, error) {\n\tt.logger.Printf(\"Service URL %s\", absolutePath)\n\turl, err := url.Parse(absolutePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tendpoint, err := url.Parse(suffix)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\turl = url.ResolveReference(endpoint)\n\n\treturn url, nil\n}\n\ntype nopCloser struct {\n\tio.Reader\n}\n\nfunc (nopCloser) Close() error { return nil }\n\nfunc NopCloser(r io.Reader) io.ReadCloser {\n\treturn nopCloser{Reader: r}\n}\n\nfunc (t *SDKConfig) BuildCurlCommand(req *http.Request) {\n\tcurlCmd := fmt.Sprintf(\"curl -X %s -L '%v' \\\\\\n\", req.Method, req.URL.String())\n\n\tfor k, v := range req.Header {\n\t\theader := fmt.Sprintf(\"-H '%v: %v' \\\\\\n\", k, v[0])\n\t\tcurlCmd = fmt.Sprintf(\"%v %v\", curlCmd, header)\n\t}\n\n\tif req.Method == \"POST\" {\n\t\tbodyBytes, err := io.ReadAll(req.Body)\n\t\tif err != nil {\n\t\t\tt.logger.Println(\"Failed to read request body:\", err)\n\t\t\treturn\n\t\t}\n\t\treq.Body.Close()\n\t\treq.Body = NopCloser(strings.NewReader(string(bodyBytes)))\n\n\t\tbody := fmt.Sprintf(\"-d '%v'\", string(bodyBytes))\n\t\tcurlCmd = fmt.Sprintf(\"%v %v\", curlCmd, body)\n\t} else if req.Method == \"GET\" || req.Method == \"DELETE\" {\n\t\tcurlCmd = strings.TrimSuffix(curlCmd, \" \\\\\\n\")\n\t}\n\tfmt.Println(\"\\n\" + curlCmd + \"\\n\")\n}\n"
  },
  {
    "path": "go/appbuilder/dataset.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n)\n\n// Deprecated: 已废弃，请使用 NewKnowledgeBase\nfunc NewDataset(config *SDKConfig) (*Dataset, error) {\n\tif config == nil {\n\t\treturn nil, errors.New(\"invalid config\")\n\t}\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 60 * time.Second}\n\t}\n\treturn &Dataset{sdkConfig: config, client: client}, nil\n}\n\ntype Dataset struct {\n\tsdkConfig *SDKConfig\n\tclient    HTTPClient\n}\n\nfunc (t *Dataset) Create(name string) (string, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeader()\n\tserviceURL, err := t.sdkConfig.ServiceURL(\"/api/v1/ai_engine/agi_platform/v1/datasets/create\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\treq := map[string]string{\"name\": name}\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := DatasetResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tif rsp.Code != 0 {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, content=%v\", requestID, string(data))\n\t}\n\treturn rsp.Result[\"id\"].(string), nil\n}\n\nfunc (t *Dataset) BatchUploadLocaleFile(datasetID string, localFilePaths []string) ([]string, error) {\n\tvar fileIDs []string\n\tfor _, localFilePath := range localFilePaths {\n\t\tfileID, err := t.uploadLocalFile(localFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfileIDs = append(fileIDs, fileID)\n\t}\n\tdocumentIDS, err := t.addFileToDataset(datasetID, fileIDs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn documentIDS, nil\n}\n\nfunc (t *Dataset) UploadLocalFile(datasetID string, localFilePath string) (string, error) {\n\tfileID, err := t.uploadLocalFile(localFilePath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdocumentIDs, err := t.addFileToDataset(datasetID, []string{fileID})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"add file failed: %v\", err)\n\t}\n\treturn documentIDs[0], nil\n}\n\nfunc (t *Dataset) uploadLocalFile(localFilePath string) (string, error) {\n\tvar data bytes.Buffer\n\tw := multipart.NewWriter(&data)\n\tfile, err := os.Open(localFilePath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\tfilePart, _ := w.CreateFormFile(\"file\", filepath.Base(file.Name()))\n\tif _, err := io.Copy(filePart, file); err != nil {\n\t\treturn \"\", err\n\t}\n\tw.Close()\n\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeader()\n\tserviceURL, err := t.sdkConfig.ServiceURL(\"/api/v1/ai_engine/agi_platform/v1/datasets/files/upload\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", w.FormDataContentType())\n\trequest.Header = header\n\trequest.Body = NopCloser(bytes.NewReader(data.Bytes()))\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trespData, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := DatasetResponse{}\n\tif err := json.Unmarshal(respData, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tif rsp.Code != 0 {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, content=%s\", requestID, string(respData))\n\t}\n\tfileID := rsp.Result[\"id\"].(string)\n\treturn fileID, nil\n}\n\nfunc (t *Dataset) addFileToDataset(datasetID string, fileID []string) ([]string, error) {\n\theader := t.sdkConfig.AuthHeader()\n\tserviceURL, err := t.sdkConfig.ServiceURL(\"/api/v1/ai_engine/agi_platform/v1/datasets/documents\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequest := http.Request{}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tm := map[string]any{\n\t\t\"file_ids\":   fileID,\n\t\t\"dataset_id\": datasetID}\n\tdata, _ := json.Marshal(m)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trespData, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := DatasetBindResponse{}\n\tif err := json.Unmarshal(respData, &rsp); err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tif rsp.Code != 0 {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, content=%s\", requestID, string(respData))\n\t}\n\treturn rsp.Result.DocumentIDs, nil\n}\n\nfunc (t *Dataset) ListDocument(datasetID string, page int, limit int, keyword string) (*ListDocumentResponse, error) {\n\theader := t.sdkConfig.AuthHeader()\n\tserviceURL, err := t.sdkConfig.ServiceURL(\"/api/v1/ai_engine/agi_platform/v1/datasets/documents/list_page\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequest := http.Request{}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tm := map[string]any{\n\t\t\"dataset_id\": datasetID,\n\t\t\"page\":       page,\n\t\t\"limit\":      limit,\n\t\t\"keyword\":    keyword,\n\t}\n\tdata, _ := json.Marshal(m)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trespData, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := ListDocumentResponse{}\n\tif err := json.Unmarshal(respData, &rsp); err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tif rsp.Code != 0 {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, content=%s\", requestID, string(respData))\n\t}\n\treturn &rsp, nil\n}\n\nfunc (t *Dataset) DeleteDocument(datasetID, documentID string) error {\n\tfmt.Println(datasetID, \"  \", documentID)\n\theader := t.sdkConfig.AuthHeader()\n\tserviceURL, err := t.sdkConfig.ServiceURL(\"/api/v1/ai_engine/agi_platform/v1/datasets/document/delete\")\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest := http.Request{}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tm := map[string]string{\n\t\t\"dataset_id\":  datasetID,\n\t\t\"document_id\": documentID,\n\t}\n\tdata, _ := json.Marshal(m)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tresp, err := http.DefaultClient.Do(&request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "go/appbuilder/dataset_data.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\ntype DatasetResponse struct {\n\tCode    int            `json:\"code\"`\n\tMessage string         `json:\"message\"`\n\tResult  map[string]any `json:\"result\"`\n}\n\ntype DatasetBindResponse struct {\n\tCode    int               `json:\"code\"`\n\tMessage string            `json:\"message\"`\n\tResult  DatasetBindResult `json:\"result\"`\n}\n\ntype DatasetBindResult struct {\n\tDocumentIDs []string `json:\"document_ids\"`\n}\n\ntype ListDocumentResponse struct {\n\tCode    int                        `json:\"code\"`\n\tMessage string                     `json:\"message\"`\n\tResult  ListDocumentResponseResult `json:\"result\"`\n}\n\ntype ListDocumentResponseResult struct {\n\tHasMore bool       `json:\"has_more\"`\n\tLimit   int        `json:\"limit\"`\n\tTotal   int        `json:\"total\"`\n\tPage    int        `json:\"page\"`\n\tData    []FileInfo `json:\"data\"`\n}\n\ntype FileInfo struct {\n\tID   string `json:\"id\"`\n\tName string `json:\"name\"`\n}\n"
  },
  {
    "path": "go/appbuilder/dataset_test.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t// \"bytes\"\n\t// \"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestDatasetError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKeyV3))\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tvar GatewayURL = config.GatewayURLV2\n\n\tdataset, _ := NewDataset(config)\n\n\t//dataset.Create测试1 无效的ServiceURLV2\n\tdataset.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = dataset.Create(\"测试集合\")\n\tif err == nil {\n\n\t}\n\n\t// 测试 UploadLocalFile 2: t.client.Do 错误\n\tdataset.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = dataset.Create(\"测试集合\")\n\tif err == nil {\n\n\t}\n\n\t// 测试 UploadLocalFile 4: 错误的 HTTP 响应\n\tdataset.client = &MockHTTPClient{}\n\tdataset.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = dataset.Create(\"测试集合\")\n\tif err == nil {\n\n\t}\n\t// 测试 UploadLocalFile 5: 模拟读取 body 时发生错误\n\tdataset.client = &FaultyHTTPClient{}\n\tdataset.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = dataset.Create(\"测试集合\")\n\tif err == nil {\n\n\t}\n\n\t//NewDataset测试1 config == nil\n\tdataset, _ = NewDataset(nil)\n\t//NewDataset测试2 client == nil\n\tconfig.HTTPClient = nil\n\tdataset, _ = NewDataset(config)\n\n}\n// func TestDataset(t *testing.T) {\n// \tt.Parallel() // 并发运行\n// \t// 创建缓冲区来存储日志\n// \tvar logBuffer bytes.Buffer\n\n// \t// 定义一个日志函数，将日志写入缓冲区\n// \tlog := func(format string, args ...interface{}) {\n// \t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n// \t}\n\n// \t// 测试逻辑\n// \tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKeyV3))\n// \tif err != nil {\n// \t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n// \t\tt.Fatalf(\"new http client config failed: %v\", err)\n// \t}\n// \tdataset, _ := NewDataset(config)\n// \tdatasetID, err := dataset.Create(\"测试集合\")\n// \tif err != nil {\n// \t\tdatasetID = os.Getenv(SecretKeyV3)\n// \t}\n\n// \t_, err = dataset.ListDocument(datasetID, 1, 10, \"\")\n// \tif err != nil {\n// \t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n// \t\tt.Fatalf(\"list document failed: %v\", err)\n// \t}\n// \tlog(\"Listed documents for dataset ID: %s\", datasetID)\n\n// \t// 如果测试失败，则输出缓冲区中的日志\n// \tif t.Failed() {\n// \t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n// \t\tfmt.Println(logBuffer.String())\n// \t} else { // else 紧跟在右大括号后面\n// \t\t// 测试通过，打印文件名和测试函数名\n// \t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n// \t}\n// }\n"
  },
  {
    "path": "go/appbuilder/go.mod",
    "content": "module github.com/baidubce/app-builder/go/appbuilder\n\ngo 1.18\n\nrequire github.com/google/uuid v1.6.0\n"
  },
  {
    "path": "go/appbuilder/go.sum",
    "content": "github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\n"
  },
  {
    "path": "go/appbuilder/knowledge_base.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nfunc NewKnowledgeBase(config *SDKConfig) (*KnowledgeBase, error) {\n\tif config == nil {\n\t\treturn nil, errors.New(\"invalid config\")\n\t}\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 60 * time.Second}\n\t}\n\treturn &KnowledgeBase{sdkConfig: config, client: client}, nil\n}\n\nfunc NewKnowledgeBaseWithKnowledgeBaseID(knowledgeBaseID string, config *SDKConfig) (*KnowledgeBase, error) {\n\tif config == nil {\n\t\treturn nil, errors.New(\"invalid config\")\n\t}\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 60 * time.Second}\n\t}\n\treturn &KnowledgeBase{knowledgeBaseID: knowledgeBaseID, sdkConfig: config, client: client}, nil\n}\n\ntype KnowledgeBase struct {\n\tknowledgeBaseID string\n\tsdkConfig       *SDKConfig\n\tclient          HTTPClient\n}\n\nfunc (t *KnowledgeBase) CreateDocument(req CreateDocumentRequest) (CreateDocumentResponse, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledge_base/document?clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn CreateDocumentResponse{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn CreateDocumentResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn CreateDocumentResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn CreateDocumentResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := CreateDocumentResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn CreateDocumentResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tif rsp.Code != \"\" {\n\t\treturn CreateDocumentResponse{}, fmt.Errorf(\"requestID=%s, code=%s, message=%s\", requestID, rsp.Code, rsp.Message)\n\t}\n\treturn rsp, nil\n}\n\nfunc (t *KnowledgeBase) DeleteDocument(req DeleteDocumentRequest) error {\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledge_base/document?clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treqMap := make(map[string]any)\n\treqJson, _ := json.Marshal(req)\n\tjson.Unmarshal(reqJson, &reqMap)\n\tparams := url.Values{}\n\tfor key, value := range reqMap {\n\t\tswitch v := value.(type) {\n\t\tcase float64:\n\t\t\tparams.Add(key, strconv.Itoa(int(v)))\n\t\tcase string:\n\t\t\tif v == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tparams.Add(key, v)\n\t\t}\n\t}\n\tserviceURL.RawQuery = params.Encode()\n\n\trequest := http.Request{}\n\trequest.URL = serviceURL\n\trequest.Method = \"DELETE\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := http.DefaultClient.Do(&request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\treturn nil\n}\n\n// Deprecated: use DescribeDocuments instead\nfunc (t *KnowledgeBase) GetDocumentList(req GetDocumentListRequest) (*GetDocumentListResponse, error) {\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledge_base/documents\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treqMap := make(map[string]any)\n\treqJson, _ := json.Marshal(req)\n\tjson.Unmarshal(reqJson, &reqMap)\n\tparams := url.Values{}\n\tfor key, value := range reqMap {\n\t\tswitch v := value.(type) {\n\t\tcase float64:\n\t\t\tparams.Add(key, strconv.Itoa(int(v)))\n\t\tcase string:\n\t\t\tif v == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tparams.Add(key, v)\n\t\t}\n\t}\n\tserviceURL.RawQuery = params.Encode()\n\n\trequest := http.Request{}\n\trequest.URL = serviceURL\n\trequest.Method = \"GET\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trespData, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := GetDocumentListResponse{}\n\tif err := json.Unmarshal(respData, &rsp); err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tif rsp.Code != \"\" {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, content=%s\", requestID, string(respData))\n\t}\n\treturn &rsp, nil\n}\n\nfunc (t *KnowledgeBase) DescribeDocuments(req DescribeDocumentsRequest) (DescribeDocumentsResponse, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=DescribeDocuments\")\n\tif err != nil {\n\t\treturn DescribeDocumentsResponse{}, err\n\t}\n\n\tif req.KnowledgeBaseID == \"\" && t.knowledgeBaseID != \"\" {\n\t\treq.KnowledgeBaseID = t.knowledgeBaseID\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn DescribeDocumentsResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn DescribeDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn DescribeDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\trsp := DescribeDocumentsResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn DescribeDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n\n// Deprecated: 此功能即将废弃\nfunc (t *KnowledgeBase) UploadFile(localFilePath string) (string, error) {\n\tvar data bytes.Buffer\n\tw := multipart.NewWriter(&data)\n\tfile, err := os.Open(localFilePath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\tfilePart, _ := w.CreateFormFile(\"file\", filepath.Base(file.Name()))\n\tif _, err := io.Copy(filePart, file); err != nil {\n\t\treturn \"\", err\n\t}\n\tw.Close()\n\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/file\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", w.FormDataContentType())\n\trequest.Header = header\n\trequest.Body = NopCloser(bytes.NewReader(data.Bytes()))\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trespData, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := UploadFileResponse{}\n\tif err := json.Unmarshal(respData, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tif rsp.Code != \"\" {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, content=%s\", requestID, string(respData))\n\t}\n\tfileID := rsp.FileID\n\treturn fileID, nil\n}\n\nfunc (t *KnowledgeBase) CreateKnowledgeBase(req KnowledgeBaseDetail) (KnowledgeBaseDetail, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=CreateKnowledgeBase&clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn KnowledgeBaseDetail{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn KnowledgeBaseDetail{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn KnowledgeBaseDetail{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn KnowledgeBaseDetail{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := KnowledgeBaseDetail{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn KnowledgeBaseDetail{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n\nfunc (t *KnowledgeBase) GetKnowledgeBaseDetail(knowledgeBaseID string) (KnowledgeBaseDetail, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=DescribeKnowledgeBase\")\n\tif err != nil {\n\t\treturn KnowledgeBaseDetail{}, err\n\t}\n\treq := KnowledgeBaseDetail{}\n\treq.ID = knowledgeBaseID\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn KnowledgeBaseDetail{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn KnowledgeBaseDetail{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn KnowledgeBaseDetail{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := KnowledgeBaseDetail{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn KnowledgeBaseDetail{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n\nfunc (t *KnowledgeBase) GetKnowledgeBaseList(req GetKnowledgeBaseListRequest) (GetKnowledgeBaseListResponse, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=DescribeKnowledgeBases\")\n\tif err != nil {\n\t\treturn GetKnowledgeBaseListResponse{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn GetKnowledgeBaseListResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn GetKnowledgeBaseListResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn GetKnowledgeBaseListResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := GetKnowledgeBaseListResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn GetKnowledgeBaseListResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n\nfunc (t *KnowledgeBase) ModifyKnowledgeBase(req ModifyKnowlegeBaseRequest) error {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=ModifyKnowledgeBase&clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\t_, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn nil\n}\n\nfunc (t *KnowledgeBase) DeleteKnowledgeBase(knowledgeBaseID string) error {\n\treturn t.deleteKnowledgeBase(knowledgeBaseID, \"\")\n}\n\nfunc (t *KnowledgeBase) DeleteKnowledgeBaseWithReq(req DeleteKnowlegeBaseRequest) error {\n\treturn t.deleteKnowledgeBase(req.ID, req.ClientToken)\n}\n\nfunc (t *KnowledgeBase) deleteKnowledgeBase(knowledgeBaseID string, clientToken string) error {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif clientToken == \"\" {\n\t\tclientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=DeleteKnowledgeBase&clientToken=\" + clientToken)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq := KnowledgeBaseDetail{}\n\treq.ID = knowledgeBaseID\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\t_, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn nil\n}\n\n// Deprecated: 此功能即将废弃\nfunc (t *KnowledgeBase) CreateDocuments(req CreateDocumentsRequest) error {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=CreateDocuments&clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\t_, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn nil\n}\n\nfunc (t *KnowledgeBase) CreateDocumentsWithResp(req CreateDocumentsRequest) (CreateDocumentsResponse, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=CreateDocuments&clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn CreateDocumentsResponse{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn CreateDocumentsResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn CreateDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn CreateDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := CreateDocumentsResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn CreateDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\treturn rsp, nil\n}\n\nfunc (t *KnowledgeBase) UploadDocuments(localFilePath string, req CreateDocumentsRequest) error {\n\tvar data bytes.Buffer\n\tw := multipart.NewWriter(&data)\n\tfile, err := os.Open(localFilePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\tfilePart, _ := w.CreateFormFile(\"file\", filepath.Base(file.Name()))\n\tif _, err := io.Copy(filePart, file); err != nil {\n\t\treturn err\n\t}\n\n\tjsonData, err := json.Marshal(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to marshal request: %w\", err)\n\t}\n\tjsonPart, err := w.CreateFormField(\"payload\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create form field: %w\", err)\n\t}\n\tif _, err := jsonPart.Write(jsonData); err != nil {\n\t\treturn fmt.Errorf(\"failed to write JSON data: %w\", err)\n\t}\n\tw.Close()\n\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=UploadDocuments&clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\trequest.Header = header\n\theader.Set(\"Content-Type\", w.FormDataContentType())\n\trequest.Body = NopCloser(bytes.NewReader(data.Bytes()))\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\t_, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn nil\n}\n\nfunc (t *KnowledgeBase) UploadDocumentsWithResp(localFilePath string, req CreateDocumentsRequest) (UploadDocumentsResponse, error) {\n\tvar data bytes.Buffer\n\tw := multipart.NewWriter(&data)\n\tfile, err := os.Open(localFilePath)\n\tif err != nil {\n\t\treturn UploadDocumentsResponse{}, err\n\t}\n\tdefer file.Close()\n\tfilePart, _ := w.CreateFormFile(\"file\", filepath.Base(file.Name()))\n\tif _, err := io.Copy(filePart, file); err != nil {\n\t\treturn UploadDocumentsResponse{}, err\n\t}\n\n\tjsonData, err := json.Marshal(req)\n\tif err != nil {\n\t\treturn UploadDocumentsResponse{}, fmt.Errorf(\"failed to marshal request: %w\", err)\n\t}\n\tjsonPart, err := w.CreateFormField(\"payload\")\n\tif err != nil {\n\t\treturn UploadDocumentsResponse{}, fmt.Errorf(\"failed to create form field: %w\", err)\n\t}\n\tif _, err := jsonPart.Write(jsonData); err != nil {\n\t\treturn UploadDocumentsResponse{}, fmt.Errorf(\"failed to write JSON data: %w\", err)\n\t}\n\tw.Close()\n\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=UploadDocuments&clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn UploadDocumentsResponse{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\trequest.Header = header\n\theader.Set(\"Content-Type\", w.FormDataContentType())\n\trequest.Body = NopCloser(bytes.NewReader(data.Bytes()))\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn UploadDocumentsResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn UploadDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tjsonData, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn UploadDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\trsp := UploadDocumentsResponse{}\n\tif err := json.Unmarshal(jsonData, &rsp); err != nil {\n\t\treturn UploadDocumentsResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\treturn rsp, nil\n}\n\nfunc (t *KnowledgeBase) CreateChunk(req CreateChunkRequest) (string, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\n\tif req.KnowledgeBaseID == \"\" && t.knowledgeBaseID != \"\" {\n\t\treq.KnowledgeBaseID = t.knowledgeBaseID\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=CreateChunk&clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\trsp := CreateChunkResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn \"\", fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp.ID, nil\n}\n\nfunc (t *KnowledgeBase) ModifyChunk(req ModifyChunkRequest) error {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif req.ClientToken == \"\" {\n\t\treq.ClientToken = uuid.New().String()\n\t}\n\n\tif req.KnowledgeBaseID == \"\" && t.knowledgeBaseID != \"\" {\n\t\treq.KnowledgeBaseID = t.knowledgeBaseID\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=ModifyChunk&clientToken=\" + req.ClientToken)\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\trsp := CreateChunkResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn nil\n}\n\nfunc (t *KnowledgeBase) DeleteChunk(chunkID string) error {\n\treturn t.deleteChunk(chunkID, \"\")\n}\n\nfunc (t *KnowledgeBase) DeleteChunkWithReq(req DeleteChunkRequest) error {\n\treturn t.deleteChunk(req.ChunkID, req.ClientToken)\n}\n\nfunc (t *KnowledgeBase) deleteChunk(chunkID string, clientToken string) error {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tif clientToken == \"\" {\n\t\tclientToken = uuid.New().String()\n\t}\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=DeleteChunk&clientToken=\" + clientToken)\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\treq := DeleteChunkRequest{\n\t\tChunkID: chunkID,\n\t}\n\n\tif t.knowledgeBaseID != \"\" {\n\t\treq.KnowledgeBaseID = t.knowledgeBaseID\n\t}\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\trsp := CreateChunkResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn nil\n}\n\nfunc (t *KnowledgeBase) DescribeChunk(chunkID string) (DescribeChunkResponse, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=DescribeChunk\")\n\tif err != nil {\n\t\treturn DescribeChunkResponse{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\treq := DescribeChunkRequest{\n\t\tChunkID: chunkID,\n\t}\n\n\tif t.knowledgeBaseID != \"\" {\n\t\treq.KnowledgeBaseID = t.knowledgeBaseID\n\t}\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn DescribeChunkResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn DescribeChunkResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn DescribeChunkResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\trsp := DescribeChunkResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn DescribeChunkResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n\nfunc (t *KnowledgeBase) DescribeChunks(req DescribeChunksRequest) (DescribeChunksResponse, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgeBase?Action=DescribeChunks\")\n\tif err != nil {\n\t\treturn DescribeChunksResponse{}, err\n\t}\n\n\tif req.KnowledgeBaseID == \"\" && t.knowledgeBaseID != \"\" {\n\t\treq.KnowledgeBaseID = t.knowledgeBaseID\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn DescribeChunksResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn DescribeChunksResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn DescribeChunksResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\trsp := DescribeChunksResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn DescribeChunksResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n\nfunc (t *KnowledgeBase) QueryKnowledgeBase(req QueryKnowledgeBaseRequest) (QueryKnowledgeBaseResponse, error) {\n\t// 检查 RankScoreThreshold 是否为 nil，如果是，则设置默认值\n\tif req.RankScoreThreshold == nil {\n\t\tdefaultThreshold := 0.4\n\t\treq.RankScoreThreshold = &defaultThreshold\n\t}\n\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeaderV2()\n\tserviceURL, err := t.sdkConfig.ServiceURLV2(\"/knowledgebases/query\")\n\tif err != nil {\n\t\treturn QueryKnowledgeBaseResponse{}, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn QueryKnowledgeBaseResponse{}, err\n\t}\n\tdefer resp.Body.Close()\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn QueryKnowledgeBaseResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tdata, err = io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn QueryKnowledgeBaseResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\trsp := QueryKnowledgeBaseResponse{}\n\tif err := json.Unmarshal(data, &rsp); err != nil {\n\t\treturn QueryKnowledgeBaseResponse{}, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\n\treturn rsp, nil\n}\n"
  },
  {
    "path": "go/appbuilder/knowledge_base_data.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\ntype QueryType string\n\nconst (\n\tFulltext QueryType = \"fulltext\"\n\tSemantic QueryType = \"semantic\"\n\tHybrid   QueryType = \"hybrid\"\n)\n\nconst (\n\tContentTypeRawText = \"raw_text\"\n\tContentTypeQA      = \"qa\"\n)\n\ntype CreateDocumentRequest struct {\n\tKnowledgeBaseID   string             `json:\"knowledge_base_id\"`\n\tContentType       string             `json:\"content_type\"`\n\tIsEnhanced        bool               `json:\"is_enhanced\"`\n\tFileIDS           []string           `json:\"file_ids,omitempty\"`\n\tCustomProcessRule *CustomProcessRule `json:\"custom_process_rule,omitempty\"`\n\tClientToken       string             `json:\"client_token,omitempty\"`\n}\n\ntype DeleteDocumentRequest struct {\n\tKnowledgeBaseID string `json:\"knowledge_base_id\"`\n\tDocumentID      string `json:\"document_id\"`\n\tClientToken     string `json:\"client_token,omitempty\"`\n}\n\ntype GetDocumentListRequest struct {\n\tKnowledgeBaseID string `json:\"knowledge_base_id\"`\n\tLimit           int    `json:\"limit,omitempty\"`\n\tAfter           string `json:\"after,omitempty\"`\n\tBefore          string `json:\"before,omitempty\"`\n}\n\ntype CustomProcessRule struct {\n\tSeparators   []string `json:\"separators\"`\n\tTargetLength int64    `json:\"target_length\"`\n\tOverlapRate  float64  `json:\"overlap_rate\"`\n}\n\ntype CreateDocumentResponse struct {\n\tRequestID       string   `json:\"request_id\"`\n\tKnowledgeBaseID string   `json:\"knowledge_base_id\"`\n\tDocumentsIDS    []string `json:\"document_ids\"`\n\tCode            string   `json:\"code\"`\n\tMessage         string   `json:\"message\"`\n}\n\ntype GetDocumentListResponse struct {\n\tRequestID string     `json:\"request_id\"`\n\tData      []Document `json:\"data\"`\n\tCode      string     `json:\"code\"`\n\tMessage   string     `json:\"message\"`\n}\n\ntype Document struct {\n\tID        string       `json:\"id\"`\n\tName      string       `json:\"name\"`\n\tCreatedAt any          `json:\"created_at\"`\n\tWordCount int64        `json:\"word_count\"`\n\tEnabled   bool         `json:\"enabled\"`\n\tMeta      DocumentMeta `json:\"meta\"`\n}\n\ntype DocumentMeta struct {\n\tSource string `json:\"source\"`\n\tFileID string `json:\"file_id\"`\n}\n\ntype UploadFileResponse struct {\n\tRequestID string `json:\"request_id\"`\n\tFileID    string `json:\"id\"`\n\tFileName  string `json:\"name\"`\n\tCode      string `json:\"code\"`\n\tMessage   string `json:\"message\"`\n}\n\ntype KnowlegeBaseConfig struct {\n\tIndex     KnowledgeBaseConfigIndex      `json:\"index\"`\n\tCatalogue *KnowledgeBaseConfigCatalogue `json:\"catalogue,omitempty\"`\n}\n\ntype KnowledgeBaseConfigIndex struct {\n\tType      string `json:\"type\"`\n\tClusterId string `json:\"clusterId\"`\n\tUsername  string `json:\"username\"`\n\tPassword  string `json:\"password\"`\n\tLocation  string `json:\"location\"`\n}\n\ntype KnowledgeBaseConfigCatalogue struct {\n\tPathPrefix string `json:\"pathPrefix,omitempty\"`\n}\n\ntype KnowledgeBaseDetail struct {\n\tID          string              `json:\"id,omitempty\"`\n\tName        string              `json:\"name,omitempty\"`\n\tDescription string              `json:\"description,omitempty\"`\n\tConfig      *KnowlegeBaseConfig `json:\"config,omitempty\"`\n\tClientToken string              `json:\"client_token,omitempty\"`\n}\n\ntype ModifyKnowlegeBaseRequest struct {\n\tID          string              `json:\"id\"`\n\tName        *string             `json:\"name,omitempty\"`\n\tDescription *string             `json:\"description,omitempty\"`\n\tConfig      *KnowlegeBaseConfig `json:\"config,omitempty\"`\n\tClientToken string              `json:\"client_token,omitempty\"`\n}\n\ntype DeleteKnowlegeBaseRequest struct {\n\tID          string `json:\"id\"`\n\tClientToken string `json:\"client_token,omitempty\"`\n}\n\ntype GetKnowledgeBaseListRequest struct {\n\tMarker  string `json:\"marker,omitempty\"`\n\tKeyword string `json:\"keyword,omitempty\"`\n\tMaxKeys int    `json:\"maxKeys,omitempty\"`\n}\n\ntype GetKnowledgeBaseListResponse struct {\n\tRequestID   string                `json:\"requestId\"`\n\tData        []KnowledgeBaseDetail `json:\"data\"`\n\tMarker      string                `json:\"marker\"`\n\tIsTruncated bool                  `json:\"isTruncated\"`\n\tNextMarker  string                `json:\"nextMarker\"`\n\tMaxKeys     int                   `json:\"maxKeys\"`\n}\n\ntype DocumentsSourceUrlConfig struct {\n\tFrequency int `json:\"frequency\"`\n}\n\ntype DocumentsSource struct {\n\tType       string                      `json:\"type\"`\n\tUrls       []string                    `json:\"urls,omitempty\"`\n\tUrlDepth   int                         `json:\"url_depth,omitempty\"`\n\tUrlConfigs *[]DocumentsSourceUrlConfig `json:\"url_configs,omitempty\"`\n}\n\ntype DocumentsProcessOptionParser struct {\n\tChoices []string `json:\"choices\"`\n}\n\ntype DocumentsProcessOptionChunkerSeparator struct {\n\tSeparators   []string `json:\"separators\"`\n\tTargetLength int64    `json:\"targetLength\"`\n\tOverlapRate  float64  `json:\"overlapRate\"`\n}\n\ntype DocumentsProcessOptionChunkerPattern struct {\n\tMarkPosition string  `json:\"markPosition\"`\n\tRegex        string  `json:\"regex\"`\n\tTargetLength int64   `json:\"targetLength\"`\n\tOverlapRate  float64 `json:\"overlapRate\"`\n}\n\ntype DocumentsProcessOptionChunker struct {\n\tChoices     []string                                `json:\"choices\"`\n\tPrependInfo []string                                `json:\"prependInfo\"`\n\tSeparator   *DocumentsProcessOptionChunkerSeparator `json:\"separator,omitempty\"`\n\tPattern     *DocumentsProcessOptionChunkerPattern   `json:\"pattern,omitempty\"`\n}\n\ntype DocumentsProcessOptionKnowledgeAugmentation struct {\n\tChoices []string `json:\"choices\"`\n}\n\ntype DocumentsProcessOption struct {\n\tTemplate              string                                       `json:\"template\"`\n\tParser                *DocumentsProcessOptionParser                `json:\"parser,omitempty\"`\n\tChunker               *DocumentsProcessOptionChunker               `json:\"chunker,omitempty\"`\n\tKnowledgeAugmentation *DocumentsProcessOptionKnowledgeAugmentation `json:\"knowledgeAugmentation,omitempty\"`\n}\n\ntype CreateDocumentsRequest struct {\n\tID            string                  `json:\"id\"`\n\tContentFormat string                  `json:\"contentFormat\"`\n\tSource        DocumentsSource         `json:\"source\"`\n\tProcessOption *DocumentsProcessOption `json:\"processOption,omitempty\"`\n\tClientToken   string                  `json:\"client_token,omitempty\"`\n}\n\ntype CreateDocumentsResponse struct {\n\tRequestID   string   `json:\"requestId\"`\n\tDocumentIDS []string `json:\"documentIds\"`\n}\n\ntype UploadDocumentsResponse struct {\n\tRequestID  string `json:\"requestId\"`\n\tDocumentID string `json:\"documentId\"`\n}\n\ntype CreateChunkRequest struct {\n\tKnowledgeBaseID string `json:\"knowledgeBaseId\"`\n\tDocumentID      string `json:\"documentId\"`\n\tContent         string `json:\"content\"`\n\tClientToken     string `json:\"client_token,omitempty\"`\n}\n\ntype CreateChunkResponse struct {\n\tID string `json:\"id\"`\n}\n\ntype ModifyChunkRequest struct {\n\tKnowledgeBaseID string `json:\"knowledgeBaseId\"`\n\tChunkID         string `json:\"chunkId\"`\n\tContent         string `json:\"content\"`\n\tEnable          bool   `json:\"enable\"`\n\tClientToken     string `json:\"client_token,omitempty\"`\n}\n\ntype DeleteChunkRequest struct {\n\tKnowledgeBaseID string `json:\"knowledgeBaseId\"`\n\tChunkID         string `json:\"chunkId\"`\n\tClientToken     string `json:\"client_token,omitempty\"`\n}\n\ntype DescribeChunkRequest struct {\n\tKnowledgeBaseID string `json:\"knowledgeBaseId\"`\n\tChunkID         string `json:\"chunkId\"`\n}\n\ntype DescribeChunkResponse struct {\n\tID              string   `json:\"id\"`\n\tType            string   `json:\"type\"`\n\tKnowledgeBaseID string   `json:\"knowledgeBaseId\"`\n\tDocumentID      string   `json:\"documentId\"`\n\tContent         string   `json:\"content\"`\n\tWordCount       int64    `json:\"wordCount\"`\n\tTokenCount      int64    `json:\"tokenCount\"`\n\tEnabled         bool     `json:\"enabled\"`\n\tStatus          string   `json:\"status\"`\n\tStatusMessage   string   `json:\"statusMessage\"`\n\tImageUrls       []string `json:\"imageUrls\"`\n\tCreatedAt       int64    `json:\"createTime\"`\n\tUpdatedAt       int64    `json:\"updateTime\"`\n}\n\ntype DescribeDocumentsRequest struct {\n\tKnowledgeBaseID string `json:\"knowledgeBaseId\"`\n\tMarker          string `json:\"marker,omitempty\"`\n\tMaxKeys         int    `json:\"maxKeys,omitempty\"`\n}\n\ntype DescribeDocumentResponse struct {\n\tID            string               `json:\"id\"`\n\tName          string               `json:\"name\"`\n\tCreatedAt     string               `json:\"createdAt\"`\n\tDisplayStatus string               `json:\"displayStatus\"`\n\tWordCount     int64                `json:\"wordCount\"`\n\tEnabled       bool                 `json:\"enabled\"`\n\tMeta          DescribeDocumentMeta `json:\"meta\"`\n}\n\ntype DescribeDocumentMeta struct {\n\tSource   string `json:\"source\"`\n\tFileID   string `json:\"fileId\"`\n\tURL      string `json:\"url\"`\n\tMimeType string `json:\"mime_type\"`\n\tFileSize int64  `json:\"file_size\"`\n}\n\ntype DescribeDocumentsResponse struct {\n\tData        []DescribeDocumentResponse `json:\"data\"`\n\tMarker      string                     `json:\"marker\"`\n\tIsTruncated bool                       `json:\"isTruncated\"`\n\tNextMarker  string                     `json:\"nextMarker\"`\n\tMaxKeys     int                        `json:\"maxKeys\"`\n\tRequestID   string                     `json:\"requestId\"`\n}\n\ntype DescribeChunksRequest struct {\n\tKnowledgeBaseID string `json:\"knowledgeBaseId\"`\n\tDocumnetID      string `json:\"documentId\"`\n\tMarker          string `json:\"marker,omitempty\"`\n\tMaxKeys         int    `json:\"maxKeys,omitempty\"`\n\tType            string `json:\"type,omitempty\"`\n\tKeyword         string `json:\"keyword,omitempty\"`\n}\n\ntype DescribeChunksResponse struct {\n\tData        []DescribeChunkResponse `json:\"data\"`\n\tMarker      string                  `json:\"marker\"`\n\tIsTruncated bool                    `json:\"isTruncated\"`\n\tNextMarker  string                  `json:\"nextMarker\"`\n\tMaxKeys     int                     `json:\"maxKeys\"`\n}\n\ntype MetadataFilter struct {\n\tOperator string `json:\"operator\"`\n\tField    string `json:\"field,omitempty\"`\n\tValue    any    `json:\"value\"`\n}\n\ntype MetadataFilters struct {\n\tFilters   []MetadataFilter `json:\"filters\"`\n\tCondition string           `json:\"condition\"`\n}\n\ntype PreRankingConfig struct {\n\tBm25Weight   float64 `json:\"bm25_weight\"`\n\tVecWeight    float64 `json:\"vec_weight\"`\n\tBm25B        float64 `json:\"bm25_b\"`\n\tBm25K1       float64 `json:\"bm25_k1\"`\n\tBm25MaxScore float64 `json:\"bm25_max_score\"`\n}\n\ntype ElasticSearchRetrieveConfig struct {\n\tName      string  `json:\"name\"`\n\tType      string  `json:\"type\"`\n\tThreshold float64 `json:\"threshold\"`\n\tTop       int     `json:\"top\"`\n}\n\ntype VectorDBRetrieveConfig struct {\n\tName      string  `json:\"name\"`\n\tType      string  `json:\"type\"`\n\tThreshold float64 `json:\"threshold\"`\n\tTop       int     `json:\"top\"`\n}\n\ntype SmallToBigConfig struct {\n\tName string `json:\"name\"`\n\tType string `json:\"type\"`\n}\n\ntype RankingConfig struct {\n\tName      string   `json:\"name\"`\n\tType      string   `json:\"type\"`\n\tInputs    []string `json:\"inputs\"`\n\tModelName string   `json:\"model_name\"`\n\tTop       int      `json:\"top\"`\n}\n\ntype QueryPipelineConfig struct {\n\tID       string `json:\"id\"`\n\tPipeline []any  `json:\"pipeline\"`\n}\n\ntype QueryKnowledgeBaseRequest struct {\n\tQuery              string              `json:\"query\"`\n\tKnowledgebaseIDs   []string            `json:\"knowledgebase_ids\"`\n\tType               *QueryType          `json:\"type,omitempty\"`\n\tTop                int                 `json:\"top,omitempty\"`\n\tSkip               int                 `json:\"skip,omitempty\"`\n\tRankScoreThreshold *float64            `json:\"rank_score_threshold,omitempty\"`\n\tMetadataFileters   MetadataFilters     `json:\"metadata_fileters,omitempty\"`\n\tPipelineConfig     QueryPipelineConfig `json:\"pipeline_config,omitempty\"`\n}\n\ntype RowLine struct {\n\tKey            string `json:\"key\"`\n\tIndex          int    `json:\"index\"`\n\tValue          string `json:\"value\"`\n\tEnableIndexing bool   `json:\"enable_indexing\"`\n\tEnableResponse bool   `json:\"enable_response\"`\n}\n\ntype ChunkLocation struct {\n\tPageNum []int   `json:\"paget_num\"`\n\tBox     [][]int `json:\"box\"`\n}\n\ntype Chunk struct {\n\tChunkID             string         `json:\"chunk_id\"`\n\tKnowledgebaseID     string         `json:\"knowledgebase_id\"`\n\tDocumentID          string         `json:\"document_id\"`\n\tDocumentName        string         `json:\"document_name\"`\n\tMeta                map[string]any `json:\"meta\"`\n\tType                string         `json:\"type\"`\n\tContent             string         `json:\"content\"`\n\tCreateTime          string         `json:\"create_time\"`\n\tUpdateTime          string         `json:\"update_time\"`\n\tRetrievalScore      float64        `json:\"retrieval_score\"`\n\tRankScore           float64        `json:\"rank_score\"`\n\tLocations           ChunkLocation  `json:\"locations\"`\n\tChildren            []Chunk        `json:\"children\"`\n\tNeighbourChunks     []Chunk        `json:\"neighbour_chunks\"`\n\tOriginalChunkId     string         `json:\"original_chunk_id\"`\n\tOriginalChunkOffset int            `json:\"original_chunk_offset\"`\n}\n\ntype QueryKnowledgeBaseResponse struct {\n\tRequestId  string  `json:\"requestId\"`\n\tCode       string  `json:\"code\"`\n\tMessage    string  `json:\"message\"`\n\tChunks     []Chunk `json:\"chunks\"`\n\tTotalCount int     `json:\"total_count\"`\n}\n"
  },
  {
    "path": "go/appbuilder/knowledge_base_test.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestAddDocumentError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\t// NewKnowledgeBase测试1 config== nil\n\t_, err := NewKnowledgeBase(nil)\n\tif err == nil {\n\t\tt.Errorf(\"expected config= nil error, got %v\", err)\n\t}\n\n\tknowledgeBaseID := os.Getenv(DatasetIDV3)\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKeyV3))\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBase(config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\n\tvar GatewayURL = client.sdkConfig.GatewayURLV2\n\tvar clientT = client.client\n\t// 测试 UploadLocalFile 1: 文件打开错误\n\t_, err = client.UploadFile(\"invalidFilePath\")\n\tif err == nil || !strings.Contains(err.Error(), \"no such file or directory\") {\n\t\tt.Errorf(\"expected file open error, got %v\", err)\n\t}\n\t// 测试 UploadLocalFile 2: t.client.Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.UploadFile(\"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Errorf(\"expected client error, got nil\")\n\t}\n\n\t// 测试 UploadLocalFile 3: 无效的ServiceURLV2\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.UploadFile(\"./files/test.pdf\")\n\tif err == nil || !strings.Contains(err.Error(), \"missing protocol scheme\") {\n\t\tt.Errorf(\"expected ServiceURLV2 error, got %v\", err)\n\t}\n\n\t// 测试 UploadLocalFile 4: 错误的 HTTP 响应\n\tclient.client = &MockHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = client.UploadFile(\"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Fatalf(\"expected 400 error, got nil\")\n\t}\n\t// 测试 UploadLocalFile 5: 模拟读取 body 时发生错误\n\tclient.client = &FaultyHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = client.UploadFile(\"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Fatalf(\"expected read error, got nil\")\n\t}\n\t// 测试 UploadLocalFile 6: json.Unmarshal错误\n\tclient.client = &InvalidJSONHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\t_, err = client.UploadFile(\"./files/test.pdf\")\n\tif err == nil {\n\t\tt.Fatalf(\"expected JSON unmarshal error, got nil\")\n\t}\n\t// 测试 UploadLocalFile 7: 缺少 id 字段\n\tclient.client = &MissingIDHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.UploadFile(\"./files/test.pdf\")\n\n\t// 正常测试\n\tclient.client = clientT\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tfileID, err := client.UploadFile(\"./files/test.pdf\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload file failed: %v\", err)\n\t}\n\t// CreateDocument 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.CreateDocument(CreateDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tContentType:     ContentTypeRawText,\n\t\tFileIDS:         []string{fileID},\n\t\tCustomProcessRule: &CustomProcessRule{\n\t\t\tSeparators:   []string{\"。\"},\n\t\t\tTargetLength: 300,\n\t\t\tOverlapRate:  0.25,\n\t\t},\n\t})\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected ServiceURLV2 error, got %v\", err)\n\t}\n\t// CreateDocument 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.CreateDocument(CreateDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tContentType:     ContentTypeRawText,\n\t\tFileIDS:         []string{fileID},\n\t\tCustomProcessRule: &CustomProcessRule{\n\t\t\tSeparators:   []string{\"。\"},\n\t\t\tTargetLength: 300,\n\t\t\tOverlapRate:  0.25,\n\t\t},\n\t})\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Errorf(\"expected Bad Request error, got %v\", err)\n\t}\n\t// CreateDocument 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\t_, err = client.CreateDocument(CreateDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tContentType:     ContentTypeRawText,\n\t\tFileIDS:         []string{fileID},\n\t\tCustomProcessRule: &CustomProcessRule{\n\t\t\tSeparators:   []string{\"。\"},\n\t\t\tTargetLength: 300,\n\t\t\tOverlapRate:  0.25,\n\t\t},\n\t})\n\tif err == nil {\n\t\tt.Fatalf(\"expected 400 error, got nil\")\n\t}\n\n\t// CreateDocument 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\t_, err = client.CreateDocument(CreateDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tContentType:     ContentTypeRawText,\n\t\tFileIDS:         []string{fileID},\n\t\tCustomProcessRule: &CustomProcessRule{\n\t\t\tSeparators:   []string{\"。\"},\n\t\t\tTargetLength: 300,\n\t\t\tOverlapRate:  0.25,\n\t\t},\n\t})\n\tif err == nil {\n\t\tt.Fatalf(\"expected read error, got nil\")\n\t}\n\n\t// CreateDocument 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\t_, err = client.CreateDocument(CreateDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tContentType:     ContentTypeRawText,\n\t\tFileIDS:         []string{fileID},\n\t\tCustomProcessRule: &CustomProcessRule{\n\t\t\tSeparators:   []string{\"。\"},\n\t\t\tTargetLength: 300,\n\t\t\tOverlapRate:  0.25,\n\t\t},\n\t})\n\tif err == nil {\n\t\tt.Fatalf(\"expected JSON unmarshal error, got nil\")\n\t}\n\t// CreateDocument 测试 6: 缺少 id 字段\n\tclient.client = &MissingIDHTTPClient{}\n\tclient.CreateDocument(CreateDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tContentType:     ContentTypeRawText,\n\t\tFileIDS:         []string{fileID},\n\t\tCustomProcessRule: &CustomProcessRule{\n\t\t\tSeparators:   []string{\"。\"},\n\t\t\tTargetLength: 300,\n\t\t\tOverlapRate:  0.25,\n\t\t},\n\t})\n\n\t// 还原设置\n\tclient.client = clientT\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tcreateDocumentRes, err := client.CreateDocument(CreateDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tContentType:     ContentTypeRawText,\n\t\tFileIDS:         []string{fileID},\n\t\tCustomProcessRule: &CustomProcessRule{\n\t\t\tSeparators:   []string{\"。\"},\n\t\t\tTargetLength: 300,\n\t\t\tOverlapRate:  0.25,\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create document failed: %v\", err)\n\t}\n\n\t// DeleteDocument 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\terr = client.DeleteDocument(DeleteDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tDocumentID:      createDocumentRes.DocumentsIDS[0]})\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t}\n\t// DeleteDocument 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\terr = client.DeleteDocument(DeleteDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tDocumentID:      createDocumentRes.DocumentsIDS[0]})\n\tif err == nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t}\n\t// DeleteDocument 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\terr = client.DeleteDocument(DeleteDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tDocumentID:      createDocumentRes.DocumentsIDS[0]})\n\tif err == nil {\n\t}\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t}\n}\n\nfunc TestCreateKnowledgeBaseError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKeyV3))\n\tif err != nil {\n\t}\n\n\tclient, err := NewKnowledgeBase(config)\n\tif err != nil {\n\t}\n\n\tvar GatewayURL = client.sdkConfig.GatewayURLV2\n\tvar clientT = client.client\n\t// CreateKnowledgeBase 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.CreateKnowledgeBase(KnowledgeBaseDetail{\n\t\tName:        \"test-go\",\n\t\tDescription: \"test-go\",\n\t\tConfig: &KnowlegeBaseConfig{\n\t\t\tIndex: KnowledgeBaseConfigIndex{\n\t\t\t\tType:     \"public\",\n\t\t\t\tPassword: \"elastic\",\n\t\t\t\tUsername: \"elastic\",\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// CreateKnowledgeBase 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.CreateKnowledgeBase(KnowledgeBaseDetail{\n\t\tName:        \"test-go\",\n\t\tDescription: \"test-go\",\n\t\tConfig: &KnowlegeBaseConfig{\n\t\t\tIndex: KnowledgeBaseConfigIndex{\n\t\t\t\tType:     \"public\",\n\t\t\t\tPassword: \"elastic\",\n\t\t\t\tUsername: \"elastic\",\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// CreateKnowledgeBase 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\t_, err = client.CreateKnowledgeBase(KnowledgeBaseDetail{\n\t\tName:        \"test-go\",\n\t\tDescription: \"test-go\",\n\t\tConfig: &KnowlegeBaseConfig{\n\t\t\tIndex: KnowledgeBaseConfigIndex{\n\t\t\t\tType:     \"public\",\n\t\t\t\tPassword: \"elastic\",\n\t\t\t\tUsername: \"elastic\",\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// CreateKnowledgeBase 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\t_, err = client.CreateKnowledgeBase(KnowledgeBaseDetail{\n\t\tName:        \"test-go\",\n\t\tDescription: \"test-go\",\n\t\tConfig: &KnowlegeBaseConfig{\n\t\t\tIndex: KnowledgeBaseConfigIndex{\n\t\t\t\tType:     \"public\",\n\t\t\t\tPassword: \"elastic\",\n\t\t\t\tUsername: \"elastic\",\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// CreateDocument 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\t_, err = client.CreateKnowledgeBase(KnowledgeBaseDetail{\n\t\tName:        \"test-go\",\n\t\tDescription: \"test-go\",\n\t\tConfig: &KnowlegeBaseConfig{\n\t\t\tIndex: KnowledgeBaseConfigIndex{\n\t\t\t\tType:     \"public\",\n\t\t\t\tPassword: \"elastic\",\n\t\t\t\tUsername: \"elastic\",\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\tclient.client = clientT\n\tvar knowledgeBaseID string\n\tneedDeleteKnowledgeBase := false\n\t// 成功 创建知识库\n\tcreateKnowledgeBaseRes, err := client.CreateKnowledgeBase(KnowledgeBaseDetail{\n\t\tName:        \"test-go\",\n\t\tDescription: \"test-go\",\n\t\tConfig: &KnowlegeBaseConfig{\n\t\t\tIndex: KnowledgeBaseConfigIndex{\n\t\t\t\tType:     \"public\",\n\t\t\t\tPassword: \"elastic\",\n\t\t\t\tUsername: \"elastic\",\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t\tneedDeleteKnowledgeBase = true\n\t\tknowledgeBaseID = createKnowledgeBaseRes.ID\n\t} else {\n\t\tknowledgeBaseID = os.Getenv(SecretKeyV3)\n\t}\n\n\tclient.client = clientT\n\t// GetKnowledgeBaseDetail 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.GetKnowledgeBaseDetail(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\t// GetKnowledgeBaseDetail 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.GetKnowledgeBaseDetail(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\t// GetKnowledgeBaseDetail 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\t_, err = client.GetKnowledgeBaseDetail(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\t// GetKnowledgeBaseDetail 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\t_, err = client.GetKnowledgeBaseDetail(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\t// GetKnowledgeBaseDetail 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\t_, err = client.GetKnowledgeBaseDetail(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\tclient.client = clientT\n\t// GetKnowledgeBaseList 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.GetKnowledgeBaseList(\n\t\tGetKnowledgeBaseListRequest{\n\t\t\tMarker: knowledgeBaseID,\n\t\t},\n\t)\n\tif err == nil {\n\t}\n\n\t// GetKnowledgeBaseList 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.GetKnowledgeBaseList(\n\t\tGetKnowledgeBaseListRequest{\n\t\t\tMarker: knowledgeBaseID,\n\t\t},\n\t)\n\tif err == nil {\n\t}\n\n\t// GetKnowledgeBaseList 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\t_, err = client.GetKnowledgeBaseList(\n\t\tGetKnowledgeBaseListRequest{\n\t\t\tMarker: knowledgeBaseID,\n\t\t},\n\t)\n\tif err == nil {\n\t}\n\n\t// GetKnowledgeBaseList 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\t_, err = client.GetKnowledgeBaseList(\n\t\tGetKnowledgeBaseListRequest{\n\t\t\tMarker: knowledgeBaseID,\n\t\t},\n\t)\n\tif err == nil {\n\t}\n\n\t// GetKnowledgeBaseList 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\t_, err = client.GetKnowledgeBaseList(\n\t\tGetKnowledgeBaseListRequest{\n\t\t\tMarker: knowledgeBaseID,\n\t\t},\n\t)\n\tif err == nil {\n\t}\n\n\tclient.client = clientT\n\t// 导入知识库 测试1\n\t// 导入知识库 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\terr = client.CreateDocuments(CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType:     \"web\",\n\t\t\tUrls:     []string{\"https://baijiahao.baidu.com/s?id=1802527379394162441\"},\n\t\t\tUrlDepth: 1,\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// 导入知识库 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\terr = client.CreateDocuments(CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType:     \"web\",\n\t\t\tUrls:     []string{\"https://baijiahao.baidu.com/s?id=1802527379394162441\"},\n\t\t\tUrlDepth: 1,\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// 导入知识库 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\terr = client.CreateDocuments(CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType:     \"web\",\n\t\t\tUrls:     []string{\"https://baijiahao.baidu.com/s?id=1802527379394162441\"},\n\t\t\tUrlDepth: 1,\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// 导入知识库 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\terr = client.CreateDocuments(CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType:     \"web\",\n\t\t\tUrls:     []string{\"https://baijiahao.baidu.com/s?id=1802527379394162441\"},\n\t\t\tUrlDepth: 1,\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\tclient.client = clientT\n\t// 测试上传知识库文档 UploadDocuments 1: 文件打开错误\n\terr = client.UploadDocuments(\"./files/test.pdf\", CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType: \"file\",\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil || !strings.Contains(err.Error(), \"no such file or directory\") {\n\t}\n\n\t// 测试上传知识库文档 UploadDocuments 2: t.client.Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\terr = client.UploadDocuments(\"./files/test.pdf\", CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType: \"file\",\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// 测试上传知识库文档 UploadDocuments 3: 无效的ServiceURLV2\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\terr = client.UploadDocuments(\"./files/test.pdf\", CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType: \"file\",\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil || !strings.Contains(err.Error(), \"missing protocol scheme\") {\n\t}\n\n\t// 测试上传知识库文档 UploadDocuments 4: 错误的 HTTP 响应\n\tclient.client = &MockHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\terr = client.UploadDocuments(\"./files/test.pdf\", CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType: \"file\",\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\t// 测试上传知识库文档 UploadDocuments 5: 模拟读取 body 时发生错误\n\tclient.client = &FaultyHTTPClient{}\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\terr = client.UploadDocuments(\"./files/test.pdf\", CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType: \"file\",\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err == nil {\n\t}\n\n\tclient.client = clientT\n\tname := \"test-go\"\n\tdescription := \"22\"\n\t// 测试修改知识库 GetKnowledgeBaseDetail 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\terr = client.ModifyKnowledgeBase(ModifyKnowlegeBaseRequest{\n\t\tID:          knowledgeBaseID,\n\t\tName:        &name,\n\t\tDescription: &description,\n\t})\n\tif err == nil {\n\t}\n\n\t// 测试修改知识库 GetKnowledgeBaseDetail 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\terr = client.ModifyKnowledgeBase(ModifyKnowlegeBaseRequest{\n\t\tID:          knowledgeBaseID,\n\t\tName:        &name,\n\t\tDescription: &description,\n\t})\n\tif err == nil {\n\t}\n\n\t// 测试修改知识库 GetKnowledgeBaseDetail 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\terr = client.ModifyKnowledgeBase(ModifyKnowlegeBaseRequest{\n\t\tID:          knowledgeBaseID,\n\t\tName:        &name,\n\t\tDescription: &description,\n\t})\n\tif err == nil {\n\t}\n\n\t// 测试修改知识库 GetKnowledgeBaseDetail 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\terr = client.ModifyKnowledgeBase(ModifyKnowlegeBaseRequest{\n\t\tID:          knowledgeBaseID,\n\t\tName:        &name,\n\t\tDescription: &description,\n\t})\n\tif err == nil {\n\t}\n\n\tclient.client = clientT\n\t// 测试删除知识库 GetKnowledgeBaseDetail 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\terr = client.DeleteKnowledgeBase(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\t// 测试删除知识库 GetKnowledgeBaseDetail 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\terr = client.DeleteKnowledgeBase(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\t// 测试删除知识库 GetKnowledgeBaseDetail 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\terr = client.DeleteKnowledgeBase(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\t// 测试删除知识库 GetKnowledgeBaseDetail 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\terr = client.DeleteKnowledgeBase(knowledgeBaseID)\n\tif err == nil {\n\t}\n\n\tclient.client = clientT\n\t// 删除知识库\n\tif needDeleteKnowledgeBase {\n\t\terr = client.DeleteKnowledgeBase(knowledgeBaseID)\n\t\tif err != nil {\n\t\t}\n\t}\n}\n\nfunc TestChunkError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\tknowledgeBaseID := os.Getenv(DatasetID)\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKey))\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBaseWithKnowledgeBaseID(knowledgeBaseID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\n\tdocumentsRes, err := client.GetDocumentList(GetDocumentListRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"get document list failed: %v\", err)\n\t}\n\tdocumentID := documentsRes.Data[0].ID\n\n\tvar clientT = client.client\n\tvar GatewayURL = client.sdkConfig.GatewayURLV2\n\n\t// 测试创建切片 CreateChunk 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.CreateChunk(CreateChunkRequest{\n\t\tDocumentID: documentID,\n\t\tContent:    \"test\",\n\t})\n\tif err == nil {\n\t}\n\n\t// 测试创建切片 CreateChunk 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.CreateChunk(CreateChunkRequest{\n\t\tDocumentID: documentID,\n\t\tContent:    \"test\",\n\t})\n\tif err == nil {\n\t}\n\n\t// 测试创建切片 CreateChunk 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\t_, err = client.CreateChunk(CreateChunkRequest{\n\t\tDocumentID: documentID,\n\t\tContent:    \"test\",\n\t})\n\tif err == nil {\n\t}\n\n\t// 测试创建切片 CreateChunk 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\t_, err = client.CreateChunk(CreateChunkRequest{\n\t\tDocumentID: documentID,\n\t\tContent:    \"test\",\n\t})\n\tif err == nil {\n\t}\n\n\t// 还原设置\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = clientT\n\t// 创建切片\n\tchunkID, err := client.CreateChunk(CreateChunkRequest{\n\t\tDocumentID: documentID,\n\t\tContent:    \"test23\",\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create chunk failed: %v\", err)\n\t}\n\t// 还原设置\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = clientT\n\n\t// 修改切片 ModifyChunk 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\terr = client.ModifyChunk(ModifyChunkRequest{\n\t\tChunkID: chunkID,\n\t\tContent: \"new test\",\n\t\tEnable:  true,\n\t})\n\tif err == nil {\n\t}\n\n\t// 修改切片 ModifyChunk 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\terr = client.ModifyChunk(ModifyChunkRequest{\n\t\tChunkID: chunkID,\n\t\tContent: \"new test\",\n\t\tEnable:  true,\n\t})\n\tif err == nil {\n\t}\n\n\t// 修改切片 ModifyChunk 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\terr = client.ModifyChunk(ModifyChunkRequest{\n\t\tChunkID: chunkID,\n\t\tContent: \"new test\",\n\t\tEnable:  true,\n\t})\n\tif err == nil {\n\t}\n\n\t// 修改切片 ModifyChunk 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\terr = client.ModifyChunk(ModifyChunkRequest{\n\t\tChunkID: chunkID,\n\t\tContent: \"new test\",\n\t\tEnable:  true,\n\t})\n\tif err == nil {\n\t}\n\n\t// 修改切片 ModifyChunk 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\terr = client.ModifyChunk(ModifyChunkRequest{\n\t\tChunkID: chunkID,\n\t\tContent: \"new test\",\n\t\tEnable:  true,\n\t})\n\tif err == nil {\n\t}\n\n\t// 还原设置\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = clientT\n\n\t// 获取切片详情 DescribeChunk 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.DescribeChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 获取切片详情 DescribeChunk 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.DescribeChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 获取切片详情 DescribeChunk 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\t_, err = client.DescribeChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 获取切片详情 DescribeChunk 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\t_, err = client.DescribeChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 获取切片详情 DescribeChunk 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\t_, err = client.DescribeChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 还原设置\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = clientT\n\n\t// 获取切片详情 DescribeChunk 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = client.DescribeChunks(DescribeChunksRequest{\n\t\tDocumnetID: documentID,\n\t\tMarker:     chunkID,\n\t\tMaxKeys:    10,\n\t})\n\tif err == nil {\n\t}\n\n\t// 获取切片详情 DescribeChunk 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = client.DescribeChunks(DescribeChunksRequest{\n\t\tDocumnetID: documentID,\n\t\tMarker:     chunkID,\n\t\tMaxKeys:    10,\n\t})\n\tif err == nil {\n\t}\n\n\t// 获取切片详情 DescribeChunk 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\t_, err = client.DescribeChunks(DescribeChunksRequest{\n\t\tDocumnetID: documentID,\n\t\tMarker:     chunkID,\n\t\tMaxKeys:    10,\n\t})\n\tif err == nil {\n\t}\n\n\t// 获取切片详情 DescribeChunk 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\t_, err = client.DescribeChunks(DescribeChunksRequest{\n\t\tDocumnetID: documentID,\n\t\tMarker:     chunkID,\n\t\tMaxKeys:    10,\n\t})\n\tif err == nil {\n\t}\n\n\t// 获取切片详情 DescribeChunk 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\t_, err = client.DescribeChunks(DescribeChunksRequest{\n\t\tDocumnetID: documentID,\n\t\tMarker:     chunkID,\n\t\tMaxKeys:    10,\n\t})\n\tif err == nil {\n\t}\n\n\ttime.Sleep(10 * time.Second)\n\n\t// 还原设置\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = clientT\n\n\t// 删除切片 DeleteChunk 测试1 ServiceURLV2 错误\n\tclient.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\terr = client.DeleteChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 删除切片 DeleteChunk 测试2 Do 错误\n\tclient.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\terr = client.DeleteChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 删除切片 DeleteChunk 测试3  错误的 HTTP 响应\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &MockHTTPClient{}\n\terr = client.DeleteChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 删除切片 DeleteChunk 测试 4: 模拟读取 body 时发生错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &FaultyHTTPClient{}\n\terr = client.DeleteChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 删除切片 DeleteChunk 测试 5: json.Unmarshal错误\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = &InvalidJSONHTTPClient{}\n\terr = client.DeleteChunk(chunkID)\n\tif err == nil {\n\t}\n\n\t// 还原设置\n\tclient.sdkConfig.GatewayURLV2 = GatewayURL\n\tclient.client = clientT\n\t// 删除切片\n\terr = client.DeleteChunk(chunkID)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"delete chunk failed: %v\", err)\n\t}\n}\n\nfunc TestAddDocument(t *testing.T) {\n\tt.Parallel() // 并发运行\n\tvar logBuffer bytes.Buffer\n\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\tos.Setenv(\"APPBUILDER_LOGFILE\", \"\")\n\n\t// 定义日志函数\n\tlog := func(format string, args ...any) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\n\tknowledgeBaseID := os.Getenv(DatasetIDV3)\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKeyV3))\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBase(config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\n\tdocumentsRes, err := client.GetDocumentList(GetDocumentListRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"get document list failed: %v\", err)\n\t}\n\tlog(\"Documents retrieved: %+v\", documentsRes)\n\n\tfileID, err := client.UploadFile(\"./files/test.pdf\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload file failed: %v\", err)\n\t}\n\tlog(\"File uploaded with ID: %s\", fileID)\n\n\tcreateDocumentRes, err := client.CreateDocument(CreateDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tContentType:     ContentTypeRawText,\n\t\tFileIDS:         []string{fileID},\n\t\tCustomProcessRule: &CustomProcessRule{\n\t\t\tSeparators:   []string{\"。\"},\n\t\t\tTargetLength: 300,\n\t\t\tOverlapRate:  0.25,\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create document failed: %v\", err)\n\t}\n\tlog(\"Document created: %+v\", createDocumentRes)\n\t// 正常测试部分\n\terr = client.DeleteDocument(DeleteDocumentRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tDocumentID:      createDocumentRes.DocumentsIDS[0]})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"delete document failed: %v\", err)\n\t}\n\tlog(\"Document deleted with ID: %s\", createDocumentRes.DocumentsIDS[0])\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestCreateKnowledgeBase(t *testing.T) {\n\tvar logBuffer bytes.Buffer\n\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\tlog := func(format string, args ...any) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKeyV3))\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBase(config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\n\t// 创建知识库\n\tvar knowledgeBaseID string\n\tneedDeleteKnowledgeBase := false\n\tcreateKnowledgeBaseRes, err := client.CreateKnowledgeBase(KnowledgeBaseDetail{\n\t\tName:        \"test-go\",\n\t\tDescription: \"test-go\",\n\t\tConfig: &KnowlegeBaseConfig{\n\t\t\tIndex: KnowledgeBaseConfigIndex{\n\t\t\t\tType:     \"public\",\n\t\t\t\tPassword: \"elastic\",\n\t\t\t\tUsername: \"elastic\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tknowledgeBaseID = os.Getenv(DatasetIDV3)\n\t} else {\n\t\tneedDeleteKnowledgeBase = true\n\t\tknowledgeBaseID = createKnowledgeBaseRes.ID\n\t}\n\tlog(\"Knowledge base created with ID: %s\", knowledgeBaseID)\n\n\t// 获取知识库详情\n\tgetKnowledgeBaseRes, err := client.GetKnowledgeBaseDetail(knowledgeBaseID)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"get knowledge base failed: %v\", err)\n\t}\n\tlog(\"Knowledge base details: %+v\", getKnowledgeBaseRes)\n\n\t// 获取知识库列表\n\tknowledgeBaseListRes, err := client.GetKnowledgeBaseList(\n\t\tGetKnowledgeBaseListRequest{\n\t\t\tMarker: knowledgeBaseID,\n\t\t},\n\t)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"get knowledge base list failed: %v\", err)\n\t}\n\tlog(\"Knowledge base list: %+v\", knowledgeBaseListRes)\n\n\t// 导入知识库\n\terr = client.CreateDocuments(CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType:     \"web\",\n\t\t\tUrls:     []string{\"https://baijiahao.baidu.com/s?id=1802527379394162441\"},\n\t\t\tUrlDepth: 1,\n\t\t\tUrlConfigs: &[]DocumentsSourceUrlConfig{\n\t\t\t\t{\n\t\t\t\t\tFrequency: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create documents failed: %v\", err)\n\t}\n\tlog(\"Documents imported to knowledge base\")\n\n\t// 导入知识库\n\tcreateDocumentsRes, err := client.CreateDocumentsWithResp(CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType:     \"web\",\n\t\t\tUrls:     []string{\"https://baijiahao.baidu.com/s?id=1802527379394162441\"},\n\t\t\tUrlDepth: 1,\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create documents failed: %v\", err)\n\t}\n\tif len(createDocumentsRes.DocumentIDS) == 0 {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"no documents imported to knowledge base\")\n\t}\n\tlog(\"Documents imported to knowledge base\")\n\n\t// 上传知识库文档\n\terr = client.UploadDocuments(\"./files/test.pdf\", CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType: \"file\",\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload documents failed: %v\", err)\n\t}\n\tlog(\"Documents uploaded to knowledge base\")\n\n\tuploadDocumentsRes, err := client.UploadDocumentsWithResp(\"./files/test.pdf\", CreateDocumentsRequest{\n\t\tID:            knowledgeBaseID,\n\t\tContentFormat: \"rawText\",\n\t\tSource: DocumentsSource{\n\t\t\tType: \"file\",\n\t\t},\n\t\tProcessOption: &DocumentsProcessOption{\n\t\t\tTemplate: \"custom\",\n\t\t\tParser: &DocumentsProcessOptionParser{\n\t\t\t\tChoices: []string{\"layoutAnalysis\", \"ocr\"},\n\t\t\t},\n\t\t\tChunker: &DocumentsProcessOptionChunker{\n\t\t\t\tChoices: []string{\"separator\"},\n\t\t\t\tSeparator: &DocumentsProcessOptionChunkerSeparator{\n\t\t\t\t\tSeparators:   []string{\"。\"},\n\t\t\t\t\tTargetLength: 300,\n\t\t\t\t\tOverlapRate:  0.25,\n\t\t\t\t},\n\t\t\t\tPrependInfo: []string{\"title\", \"filename\"},\n\t\t\t},\n\t\t\tKnowledgeAugmentation: &DocumentsProcessOptionKnowledgeAugmentation{\n\t\t\t\tChoices: []string{\"faq\"},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"upload documents failed: %v\", err)\n\t}\n\tif uploadDocumentsRes.DocumentID == \"\" {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"no documents uploaded to knowledge base\")\n\t}\n\tlog(\"Documents uploaded to knowledge base\")\n\n\t// 修改知识库\n\tname := \"test-go\"\n\tdescription := \"22\"\n\terr = client.ModifyKnowledgeBase(ModifyKnowlegeBaseRequest{\n\t\tID:          knowledgeBaseID,\n\t\tName:        &name,\n\t\tDescription: &description,\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"modify knowledge base failed: %v\", err)\n\t}\n\tlog(\"Knowledge base modified with new name: %s\", name)\n\n\t// 删除知识库\n\tif needDeleteKnowledgeBase {\n\t\terr = client.DeleteKnowledgeBase(knowledgeBaseID)\n\t\tif err != nil {\n\t\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\t\tt.Fatalf(\"delete knowledge base failed: %v\", err)\n\t\t}\n\t\tlog(\"Knowledge base deleted with ID: %s\", knowledgeBaseID)\n\t}\n\n\t// 测试通过，打印文件名和测试函数名\n\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tfmt.Println(logBuffer.String())\n\t}\n}\n\nfunc TestChunk(t *testing.T) {\n\tt.Parallel() // 并发运行\n\tvar logBuffer bytes.Buffer\n\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\tlog := func(format string, args ...any) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\n\tknowledgeBaseID := os.Getenv(DatasetID)\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKey))\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBaseWithKnowledgeBaseID(knowledgeBaseID, config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\n\t_, err = client.GetDocumentList(GetDocumentListRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"get document list failed: %v\", err)\n\t}\n\n\tdocumentsRes, err := client.DescribeDocuments(DescribeDocumentsRequest{KnowledgeBaseID: knowledgeBaseID})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"describe documents failed: %v\", err)\n\t}\n\n\tlog(\"Documents retrieved: %+v\", documentsRes)\n\tdocumentID := documentsRes.Data[0].ID\n\t// 创建切片\n\tchunkID, err := client.CreateChunk(CreateChunkRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tDocumentID:      documentID,\n\t\tContent:         \"test\",\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create chunk failed: %v\", err)\n\t}\n\tlog(\"Chunk created with ID: %s\", chunkID)\n\n\t// 修改切片\n\terr = client.ModifyChunk(ModifyChunkRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tChunkID:         chunkID,\n\t\tContent:         \"new test\",\n\t\tEnable:          true,\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"modify chunk failed: %v\", err)\n\t}\n\tlog(\"Chunk modified with new content\")\n\n\t// 获取切片详情\n\tdescribeChunkRes, err := client.DescribeChunk(chunkID)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"describe chunk failed: %v\", err)\n\t}\n\tlog(\"Chunk details: %+v\", describeChunkRes)\n\n\t// 获取切片列表\n\tdescribeChunksRes, err := client.DescribeChunks(DescribeChunksRequest{\n\t\tKnowledgeBaseID: knowledgeBaseID,\n\t\tDocumnetID:      documentID,\n\t\tMaxKeys:         10,\n\t\tKeyword:         \"test\",\n\t})\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"describe chunks failed: %v\", err)\n\t}\n\tlog(\"Chunks described: %+v\", describeChunksRes)\n\n\ttime.Sleep(10 * time.Second)\n\n\t// 删除切片\n\terr = client.DeleteChunk(chunkID)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"delete chunk failed: %v\", err)\n\t}\n\tlog(\"Chunk deleted with ID: %s\", chunkID)\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n\nfunc TestQueryKnowledgeBase(t *testing.T) {\n\tt.Parallel() // 并发运行\n\tvar logBuffer bytes.Buffer\n\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\tlog := func(format string, args ...any) {\n\t\tfmt.Fprintf(&logBuffer, format+\"\\n\", args...)\n\t}\n\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKey))\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\n\tclient, err := NewKnowledgeBase(config)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new Knowledge base instance failed\")\n\t}\n\n\tjsonStr := `\n{\n    \"type\": \"fulltext\",\n    \"query\": \"民法典第三条\",\n    \"knowledgebase_ids\": [\n        \"70c6375a-1595-41f2-9a3b-e81bc9060b7f\"\n    ],\n    \"metadata_filters\": {\n        \"filters\": [\n        ],\n        \"condition\": \"or\"\n    },\n    \"pipeline_config\": {\n        \"id\": \"pipeline_001\",\n        \"pipeline\": [\n            {\n                \"name\": \"step1\",\n                \"type\": \"elastic_search\",\n                \"threshold\": 0.1,\n                \"top\": 400,\n                \"pre_ranking\": {\n                    \"bm25_weight\": 0.25,\n                    \"vec_weight\": 0.75,\n                    \"bm25_b\": 0.75,\n                    \"bm25_k1\": 1.5,\n                    \"bm25_max_score\": 50\n                }\n            },\n            {\n                \"name\": \"step2\",\n                \"type\": \"ranking\",\n                \"inputs\": [\"step1\"],\n                \"model_name\": \"ranker-v1\",\n                \"top\": 20\n            }\n        ]\n    },\n    \"top\": 5,\n    \"skip\": 0\n}`\n\n\tvar request QueryKnowledgeBaseRequest\n\terr = json.Unmarshal([]byte(jsonStr), &request)\n\tif err != nil {\n\t\tfmt.Println(\"unmarshal tool error:\", err)\n\t}\n\n\tqueryKnowledgeBaseResponse, err := client.QueryKnowledgeBase(request)\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"create chunk failed: %v\", err)\n\t}\n\tchunkID := queryKnowledgeBaseResponse.Chunks[0].ChunkID\n\tlog(\"query got chunk ID: %s\", chunkID)\n\tif len(chunkID) == 0 {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"query knowledge base failed: %v\", err)\n\t}\n\n\t// 如果测试失败，则输出缓冲区中的日志\n\tif t.Failed() {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tfmt.Println(logBuffer.String())\n\t} else { // else 紧跟在右大括号后面\n\t\t// 测试通过，打印文件名和测试函数名\n\t\tt.Logf(\"%s========== OK:  %s ==========%s\", \"\\033[32m\", t.Name(), \"\\033[0m\")\n\t}\n}\n"
  },
  {
    "path": "go/appbuilder/rag.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc NewRAG(appID string, config *SDKConfig) (*RAG, error) {\n\tif len(appID) == 0 {\n\t\treturn nil, errors.New(\"appID is empty\")\n\t}\n\tif config == nil {\n\t\treturn nil, errors.New(\"invalid config\")\n\t}\n\tclient := config.HTTPClient\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: 500 * time.Second}\n\t}\n\treturn &RAG{appID: appID, sdkConfig: config, client: client}, nil\n}\n\ntype RAG struct {\n\tappID     string\n\tsdkConfig *SDKConfig\n\tclient    HTTPClient\n}\n\nfunc (t *RAG) Run(conversationID string, query string, stream bool) (RAGIterator, error) {\n\trequest := http.Request{}\n\theader := t.sdkConfig.AuthHeader()\n\tserviceURL, err := t.sdkConfig.ServiceURL(\"/api/v1/ai_engine/agi_platform/v1/instance/integrated\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequest.URL = serviceURL\n\trequest.Method = \"POST\"\n\theader.Set(\"Content-Type\", \"application/json\")\n\trequest.Header = header\n\treq := map[string]string{\"conversation_id\": conversationID,\n\t\t\"response_mode\": \"blocking\",\n\t\t\"query\":         query,\n\t\t\"app_id\":        t.appID,\n\t}\n\tif stream {\n\t\treq[\"response_mode\"] = \"streaming\"\n\t}\n\tdata, _ := json.Marshal(req)\n\trequest.Body = NopCloser(bytes.NewReader(data))\n\tt.sdkConfig.BuildCurlCommand(&request)\n\tresp, err := t.client.Do(&request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequestID, err := checkHTTPResponse(resp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", requestID, err)\n\t}\n\tr := NewSSEReader(1024*1024, bufio.NewReader(resp.Body))\n\tif stream {\n\t\treturn &RAGStreamIterator{requestID: requestID, r: r, body: resp.Body}, nil\n\t}\n\treturn &RAGOnceIterator{body: resp.Body, requestID: requestID}, nil\n}\n"
  },
  {
    "path": "go/appbuilder/rag_data.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\ntype RAGRunResponse struct {\n\tCode    int       `json:\"code\"`\n\tMessage string    `json:\"message\"`\n\tResult  RAGResult `json:\"result\"`\n}\n\ntype RAGResult struct {\n\tConversationID string     `json:\"conversation_id\"`\n\tAnswer         string     `json:\"answer\"`\n\tContent        []RAGEvent `json:\"content\"`\n}\n\ntype RAGEvent struct {\n\tEvent       string          `json:\"event\"`\n\tEventStatus string          `json:\"event_status\"`\n\tEventID     string          `json:\"event_id\"`\n\tEventType   string          `json:\"type\"`\n\tText        json.RawMessage `json:\"text\"`\n}\n\ntype RAGAnswer struct {\n\tAnswer         string\n\tConversationID string\n\tEvents         []RAGEvent\n}\n\nfunc (t *RAGAnswer) transform(res *RAGRunResponse) {\n\tt.Answer = res.Result.Answer\n\tt.ConversationID = res.Result.ConversationID\n\tt.Events = res.Result.Content\n}\n\n// RAGIterator 定义RAG流式/非流式迭代器接口\n// 初始状态可迭代,如果返回error不为空则代表迭代结束，\n// error为io.EOF，则代表迭代正常结束，其它则为异常结束\ntype RAGIterator interface {\n\t// Next 获取处理结果，如果返回error不为空，迭代器自动失效，不允许再调用此方法\n\tNext() (*RAGAnswer, error)\n}\n\ntype RAGStreamIterator struct {\n\trequestID string\n\tr         *sseReader\n\tbody      io.ReadCloser\n}\n\nfunc (t *RAGStreamIterator) Next() (*RAGAnswer, error) {\n\tdata, err := t.r.ReadMessageLine()\n\tif err != nil && !(err == io.EOF) {\n\t\tt.body.Close()\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tif err != nil && err == io.EOF {\n\t\tt.body.Close()\n\t\treturn nil, err\n\t}\n\tif strings.HasPrefix(string(data), \"data:\") {\n\t\tvar resp RAGRunResponse\n\t\tresp.Code = -1\n\t\tif err := json.Unmarshal(data[5:], &resp); err != nil {\n\t\t\tt.body.Close()\n\t\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t\t}\n\t\tif resp.Code != 0 {\n\t\t\tt.body.Close()\n\t\t\treturn nil, fmt.Errorf(\"requestID=%s, body=%s\", t.requestID, string(data))\n\t\t}\n\t\tanswer := &RAGAnswer{}\n\t\tanswer.transform(&resp)\n\t\treturn answer, nil\n\t}\n\t// 非SSE格式关闭连接，并返回数据\n\tt.body.Close()\n\treturn nil, fmt.Errorf(\"requestID=%s, body=%s\", t.requestID, string(data))\n}\n\n// RAGOnceIterator 非流式返回时对应的迭代器，只可迭代一次\ntype RAGOnceIterator struct {\n\tbody      io.ReadCloser\n\teoi       bool\n\trequestID string\n}\n\nfunc (t *RAGOnceIterator) Next() (*RAGAnswer, error) {\n\tif t.eoi {\n\t\treturn nil, io.EOF\n\t}\n\tdata, err := io.ReadAll(t.body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tdefer t.body.Close()\n\tvar resp RAGRunResponse\n\tresp.Code = -1\n\tif err := json.Unmarshal(data, &resp); err != nil {\n\t\treturn nil, fmt.Errorf(\"requestID=%s, err=%v\", t.requestID, err)\n\t}\n\tif resp.Code != 0 {\n\t\tt.body.Close()\n\t\treturn nil, fmt.Errorf(\"requestID=%s, body=%s\", t.requestID, string(data))\n\t}\n\tt.eoi = true\n\tanswer := &RAGAnswer{}\n\tanswer.transform(&resp)\n\treturn answer, nil\n}\n"
  },
  {
    "path": "go/appbuilder/rag_test.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestNewRAGError(t *testing.T) {\n\tt.Parallel() // 并发运行\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", \"\")\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"06e3f5c9-885d-4f85-af57-97dc85ee4606\"\n\n\t// NewRAG测试 1: appID 为空，预期返回错误\n\t_, err = NewRAG(\"\", &SDKConfig{})\n\tif err == nil || err.Error() != \"appID is empty\" {\n\n\t}\n\n\t// NewRAG测试 2: config 为 nil，预期返回错误\n\t_, err = NewRAG(\"validAppID\", nil)\n\tif err == nil || err.Error() != \"config is nil\" {\n\n\t}\n\t//RAG测试\n\trag, err := NewRAG(appID, config)\n\tif err != nil {\n\n\t}\n\n\t// CreateConversation测试 1: ServiceURLV2 错误\n\trag.sdkConfig.GatewayURLV2 = \"://invalid-url\"\n\t_, err = rag.Run(\"\", \"北京有多少小学生\", true)\n\tif err == nil {\n\n\t}\n\n\t// CreateConversation测试 2: HTTP client do error\n\trag.sdkConfig.GatewayURLV2 = \"http://192.0.2.1\"\n\t_, err = rag.Run(\"\", \"北京有多少小学生\", true)\n\tif err == nil {\n\n\t}\n\n\t// CreateConversation测试 3: checkHTTPResponse 400 错误\n\trag.client = &MockHTTPClient{}\n\t_, err = rag.Run(\"\", \"北京有多少小学生\", true)\n\tif err == nil {\n\n\t}\n\n\t// CreateConversation测试 4: 非流式运行\n\trag.client = &FaultyHTTPClient{}\n\t_, err = rag.Run(\"\", \"北京有多少小学生\", false)\n\tif err == nil {\n\n\t}\n}\nfunc TestNewRAG(t *testing.T) {\n\t// 设置环境变量\n\tos.Setenv(\"APPBUILDER_LOGLEVEL\", \"DEBUG\")\n\n\t// 测试逻辑\n\tconfig, err := NewSDKConfig(\"\", os.Getenv(SecretKey))\n\tif err != nil {\n\t\tt.Logf(\"%s========== FAIL:  %s ==========%s\", \"\\033[31m\", t.Name(), \"\\033[0m\")\n\t\tt.Fatalf(\"new http client config failed: %v\", err)\n\t}\n\tappID := \"06e3f5c9-885d-4f85-af57-97dc85ee4606\"\n\n\t//RAG测试\n\trag, err := NewRAG(appID, config)\n\tif err != nil {\n\t\tt.Fatalf(\"new RAG instance failed\")\n\t}\n\n\ti, err := rag.Run(\"\", \"北京有多少小学生\", true)\n\tif err != nil {\n\t\tt.Fatalf(\"run RAG failed: %v\", err)\n\t}\n\tvar answer *RAGAnswer\n\tfor answer, err = i.Next(); err == nil; answer, err = i.Next() {\n\t\tdata, _ := json.Marshal(answer)\n\t\tfmt.Println(string(data))\n\t\tfmt.Println(answer.ConversationID)\n\t}\n\tif !errors.Is(err, io.EOF) {\n\t\tfmt.Println(err)\n\t}\n}\n"
  },
  {
    "path": "go/appbuilder/util.go",
    "content": "// Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage appbuilder\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n)\n\ntype SSEEvent struct {\n\tLastEventID string\n\tType        string\n\tData        string\n}\n\nfunc checkHTTPResponse(rsp *http.Response) (string, error) {\n\trequestID := rsp.Header.Get(\"X-Appbuilder-Request-Id\")\n\tif rsp.StatusCode == http.StatusOK {\n\t\tlog.Printf(\"Successful HTTP response. RequestID: %s\", requestID)\n\t\treturn requestID, nil\n\t}\n\n\tdata, err := io.ReadAll(rsp.Body)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to read response body. RequestID: %s, Error: %v\", requestID, err)\n\t\treturn requestID, err\n\t}\n\tlog.Printf(\"HTTP response with unexpected status code. RequestID: %s, StatusCode: %d, Content: %s\", requestID, rsp.StatusCode, string(data))\n\treturn requestID, fmt.Errorf(\"http status code is %d, content is %s\", rsp.StatusCode, string(data))\n}\n\nfunc NewSSEReader(bufSize int, reader *bufio.Reader) *sseReader {\n\t//buf := make([]byte, bufSize)\n\treturn &sseReader{reader: reader, buf: bytes.Buffer{}}\n}\n\ntype sseReader struct {\n\treader *bufio.Reader\n\tbuf    bytes.Buffer\n}\n\nfunc (t *sseReader) ReadMessageLine() ([]byte, error) {\n\tt.buf.Reset()\n\tfor {\n\t\tline, isPrefix, err := t.reader.ReadLine()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tt.buf.Grow(len(line))\n\t\tt.buf.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\t// 读取空行\n\tline, _, err := t.reader.ReadLine()\n\tif err != nil || len(line) != 0 {\n\t\tt.buf.Grow(len(line))\n\t\treturn nil, errors.New(t.buf.String())\n\t}\n\treturn t.buf.Bytes(), nil\n}\n"
  },
  {
    "path": "go/run_go_test.sh",
    "content": "#!/bin/bash\n\n# 启用错误检测和管道失败检测\nset -o pipefail\n\n# 初始化错误标志\nerror_flag=0\n\n# 用于存储错误消息\nerror_messages=()\n\n# 检查并添加必要的路径\nexport PATH=\"$HOME/.local/bin:$PATH\"\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n\n\npip install diff-cover || { error_flag=1; error_messages+=(\"Failed to install diff-cover.\"); }\n# 检查 diff-cover 是否已安装\nif ! command -v diff-cover &> /dev/null; then\n    error_flag=1\n    error_messages+=(\"diff-cover installation failed. Please check your Python and pip installation.\")\nfi\n\necho \"diff-cover is installed.\"\n\n# 安装 gocov 和 gocov-xml，如果未安装\nif ! command -v gocov &> /dev/null; then\n    echo \"gocov not found, installing...\"\n    go install github.com/axw/gocov/gocov@latest || { error_flag=1; error_messages+=(\"Failed to install gocov.\"); }\nfi\n\nif ! command -v gocov-xml &> /dev/null; then\n    echo \"gocov-xml not found, installing...\"\n    go install github.com/AlekSi/gocov-xml@latest || { error_flag=1; error_messages+=(\"Failed to install gocov-xml.\"); }\nfi\n\n# 添加 GOPATH/bin 到 PATH，以便找到 gocov 和 gocov-xml\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n\n# 验证 gocov 和 gocov-xml 是否安装成功\nif ! command -v gocov &> /dev/null; then\n    error_flag=1\n    error_messages+=(\"gocov installation failed.\")\nfi\n\nif ! command -v gocov-xml &> /dev/null; then\n    error_flag=1\n    error_messages+=(\"gocov-xml installation failed.\")\nfi\n\necho \"gocov and gocov-xml are installed.\"\n\n# 初始化计数器\ntotal_tests=0\nskipped_tests=0\nfailed_tests=0\npassed_tests=0\n\n# 用于存储跳过和失败的测试函数\nskipped_list=()\nfailed_list=()\n\n# 创建临时文件用于存储测试输出和覆盖率数据\ntest_output=$(mktemp)\ncoverage_file=$(mktemp)\n\n# 确保临时文件创建成功\nif [ ! -f \"$test_output\" ] || [ ! -f \"$coverage_file\" ]; then\n    echo \"无法创建临时文件。\"\n    exit 1\nfi\n\n# 运行所有包的测试并保存输出\necho \"运行所有包的测试并生成覆盖率报告...\"\nset +e\ncd appbuilder\ngo test ./... -coverprofile=\"$coverage_file\" -covermode=atomic -timeout 20m -v > \"$test_output\" 2>&1\nGO_TEST_EXIT_CODE=$?\nset -e\necho \"Go test 退出代码: $GO_TEST_EXIT_CODE\"\n\n# 检查覆盖率文件是否生成且非空\nif [ ! -s \"$coverage_file\" ]; then\n    echo \"覆盖率文件未生成或为空。\"\n    error_flag=1\n    error_messages+=(\"Coverage profile not generated or empty.\")\nfi\n\n# 解析测试结果\ncurrent_test=\"\"\nwhile IFS= read -r line; do\n    if [[ \"$line\" == \"=== RUN\"* ]]; then\n        # 提取测试函数名称\n        test_name=$(echo \"$line\" | awk '{print $3}')\n        # 提取包路径\n        pkg=$(echo \"$line\" | awk '{print $2}' | sed 's/(//;s/)//')\n        current_test=\"$pkg.$test_name\"\n    elif [[ \"$line\" == \"--- PASS:\"* ]]; then\n        echo \"[OK] $current_test\"\n        passed_tests=$((passed_tests + 1))\n        passed_list+=(\"$current_test\")\n    elif [[ \"$line\" == \"--- FAIL:\"* ]]; then\n        echo \"[FAIL] $current_test\"\n        failed_tests=$((failed_tests + 1))\n        failed_list+=(\"$current_test\")\n    elif [[ \"$line\" == \"--- SKIP:\"* ]]; then\n        echo \"[SKIP] $current_test\"\n        skipped_tests=$((skipped_tests + 1))\n        skipped_list+=(\"$current_test\")\n    fi\ndone < \"$test_output\"\n\n# 计算总测试数\ntotal_tests=$((passed_tests + failed_tests + skipped_tests))\n\n# 输出测试总结\necho \"\"\necho \"=== 测试总结 ===\"\necho \"总测试数: $total_tests\"\necho \"成功: $passed_tests\"\necho \"失败: $failed_tests\"\necho \"跳过: $skipped_tests\"\n\n# 检查错误标志，如果有错误则输出错误消息并退出\nif [ $error_flag -ne 0 ]; then\n    echo \"在过程中检测到以下错误：\"\n    for msg in \"${error_messages[@]}\"; do\n        echo \"- $msg\"\n    done\n    exit 1\nfi\n\n# 打印测试失败时的详细日志\nif [ $GO_TEST_EXIT_CODE -ne 0 ]; then\n    echo \"测试运行过程中失败，错误代码: $GO_TEST_EXIT_CODE\"\n    echo \"请查看详细的测试日志：\"\n    echo \"----------------------------------------\"\n    cat \"$test_output\"  # 打印测试的输出日志\n    echo \"----------------------------------------\"\n    exit 1\nfi\n\n# 输出覆盖率摘要\necho \"--------------------------\"\necho \"全量代码覆盖率为：\"\ngo tool cover -func=$coverage_file\n\n# 将覆盖率数据转换为 XML 格式\necho \"Converting coverage data to XML format...\"\nif ! gocov convert $coverage_file | gocov-xml > coverage.xml; then\n    error_flag=1\n    error_messages+=(\"Failed to convert coverage data to XML format.\")\nfi\n\n# 检查 coverage.xml 是否非空\nif [ ! -s coverage.xml ]; then\n    error_flag=1\n    error_messages+=(\"Coverage XML file is empty or invalid.\")\nfi\n\n# 生成包含所有文件的差异文件\necho \"Generating full diff...\"\nif ! git diff $(git hash-object -t tree /dev/null) HEAD > full_diff.patch; then\n    error_flag=1\n    error_messages+=(\"Failed to generate full diff.\")\nfi\n\n# 使用 diff-cover 生成全量覆盖率报告\necho \"Generating full coverage report...\"\nif ! diff-cover coverage.xml --diff-file full_diff.patch --html-report coverage_full.html; then\n    error_flag=1\n    error_messages+=(\"Failed to generate full coverage report.\")\nelse\n    echo \"Full coverage report generated at coverage_full.html\"\nfi\n\n# 计算增量代码的单测覆盖率\nbase_branch=\"upstream/master\"\n\n# 生成增量覆盖率报告\necho \"--------------------------\"\necho \"增量代码覆盖率为：\"\ngit diff $base_branch --name-only -- '*.go' > diff_files.txt\n\n# 检查是否有修改的 go 文件\nif [ -s diff_files.txt ]; then\n    if ! diff-cover coverage.xml --compare-branch=$base_branch --html-report coverage_diff.html; then\n        error_flag=1\n        error_messages+=(\"Failed to generate incremental coverage report.\")\n    else\n        echo \"Incremental coverage report generated at coverage_diff.html\"\n    fi\nelse\n    echo \"No Go files changed relative to $base_branch. Incremental coverage not generated.\"\nfi\n\n# 清理\nrm diff_files.txt\nrm full_diff.patch\n# 清理临时文件\nrm \"$test_output\"\nrm \"$coverage_file\"\n\n# 检查错误标志，如果有错误则输出错误消息并退出\nif [ $error_flag -ne 0 ]; then\n    echo \"Errors were detected during the process:\"\n    for msg in \"${error_messages[@]}\"; do\n        echo \"- $msg\"\n    done\n    exit 1\nfi"
  },
  {
    "path": "java/parse_tests_and_coverage.py",
    "content": "#!/usr/bin/env python3\nimport os\nimport sys\nimport subprocess\nimport glob  # 添加这一行\nfrom lxml import etree\nfrom git import Repo\nfrom collections import defaultdict\n\ndef parse_surefire_reports():\n    \"\"\"解析 Maven Surefire 生成的测试报告，打印每个测试的结果，并汇总测试统计信息。\"\"\"\n    surefire_reports = glob.glob('target/surefire-reports/*.xml')\n    if not surefire_reports:\n        print(\"未找到 Surefire 报告文件（target/surefire-reports/*.xml）。\")\n        sys.stdout.flush()  # 立即刷新输出\n        return None\n\n    total_tests = 0\n    total_failures = 0\n    total_errors = 0\n    total_skipped = 0\n    passed_tests = []\n    failed_tests = []\n\n    print(\"\\n=== 测试结果 ===\")\n    sys.stdout.flush()  # 立即刷新输出\n    for report in surefire_reports:\n        try:\n            tree = etree.parse(report)\n            root = tree.getroot()\n            test_suite_name = root.get('name', 'Unknown Test Suite')\n\n            for test_case in root.findall('testcase'):\n                test_name = test_case.get('name')\n                class_name = test_case.get('classname')\n                status = \"OK\"\n                error_message = \"\"\n                if test_case.find('failure') is not None:\n                    status = \"FAIL\"\n                    error = test_case.find('failure')\n                    error_message = error.text.strip() if error.text else \"未知错误\"\n                    failed_tests.append((class_name, test_name, error_message))\n                    total_failures += 1\n                elif test_case.find('error') is not None:\n                    status = \"ERROR\"\n                    error = test_case.find('error')\n                    error_message = error.text.strip() if error.text else \"未知错误\"\n                    failed_tests.append((class_name, test_name, error_message))\n                    total_errors += 1\n                elif test_case.find('skipped') is not None:\n                    status = \"SKIPPED\"\n                    total_skipped += 1\n                else:\n                    passed_tests.append((class_name, test_name))\n\n                total_tests += 1\n\n                # 打印每个测试的结果\n                if status == \"OK\":\n                    print(f\"[OK] {class_name}.{test_name}\")\n                elif status in [\"FAIL\", \"ERROR\"]:\n                    print(f\"[{status}] {class_name}.{test_name}\")\n                    print(f\"      错误信息: {error_message}\")\n                elif status == \"SKIPPED\":\n                    print(f\"[SKIPPED] {class_name}.{test_name}\")\n                sys.stdout.flush()  # 立即刷新输出\n\n        except etree.XMLSyntaxError as e:\n            print(f\"XML 解析错误在文件 {report}: {e}\")\n            sys.stdout.flush()  # 立即刷新输出\n        except Exception as e:\n            print(f\"解析报告文件 {report} 时发生错误: {e}\")\n            sys.stdout.flush()  # 立即刷新输出\n\n    # 打印测试总结\n    print(\"\\n=== 测试总结 ===\")\n    print(f\"总测试数: {total_tests}\")\n    print(f\"成功: {len(passed_tests)}\")\n    print(f\"失败: {total_failures}\")\n    print(f\"错误: {total_errors}\")\n    print(f\"跳过: {total_skipped}\")\n    sys.stdout.flush()  # 立即刷新输出\n\n    return {\n        \"total_tests\": total_tests,\n        \"passed\": len(passed_tests),\n        \"failures\": total_failures,\n        \"errors\": total_errors,\n        \"skipped\": total_skipped\n    }\n\ndef parse_jacoco():\n    \"\"\"解析 JaCoCo XML 报告，打印覆盖率详情并返回包含类名和未覆盖行号的字典。\"\"\"\n    JACOCO_XML = \"target/site/jacoco/jacoco.xml\"\n    \n    if not os.path.isfile(JACOCO_XML):\n        print(\"jacoco.xml 未找到。请先运行 'mvn jacoco:report' 生成报告。\")\n        sys.stdout.flush()  # 立即刷新输出\n        return {}\n\n    try:\n        parser = etree.XMLParser(load_dtd=False, no_network=True, recover=True)\n        tree = etree.parse(JACOCO_XML, parser)\n        root = tree.getroot()\n    except etree.XMLSyntaxError as e:\n        print(f\"XML 解析错误: {e}\")\n        sys.stdout.flush()  # 立即刷新输出\n        return {}\n    except Exception as e:\n        print(f\"解析 jacoco.xml 时发生错误: {e}\")\n        sys.stdout.flush()  # 立即刷新输出\n        return {}\n\n    # 初始化总计数器\n    total_lines_missed = 0\n    total_lines_covered = 0\n    total_branches_missed = 0\n    total_branches_covered = 0\n\n    # 创建数据表\n    table_data = [[\"Class\", \"Line Coverage (%)\", \"Branch Coverage (%)\", \"Missing Lines\", \"Missing Branches\"]]\n\n    # 初始化存储结果的字典\n    coverage_data = {}\n\n    # 遍历所有 class 元素\n    for class_element in root.findall('.//class'):\n        class_name = class_element.get('name')\n\n        # 行覆盖率\n        counter_line = class_element.find(\"counter[@type='LINE']\")\n        if counter_line is not None:\n            lines_missed = int(counter_line.get('missed', '0'))\n            lines_covered = int(counter_line.get('covered', '0'))\n        else:\n            lines_missed = 0\n            lines_covered = 0\n\n        total_lines_missed += lines_missed\n        total_lines_covered += lines_covered\n\n        # 分支覆盖率\n        counter_branch = class_element.find(\"counter[@type='BRANCH']\")\n        if counter_branch is not None:\n            branches_missed = int(counter_branch.get('missed', '0'))\n            branches_covered = int(counter_branch.get('covered', '0'))\n            total_branches = branches_missed + branches_covered\n            if total_branches > 0:\n                branch_coverage = f\"{(branches_covered / total_branches) * 100:.2f}%\"\n            else:\n                branch_coverage = \"N/A\"\n        else:\n            branches_missed = 0\n            branches_covered = 0\n            branch_coverage = \"N/A\"\n\n        total_lines_missed += lines_missed\n        total_lines_covered += lines_covered\n        total_branches_missed += branches_missed\n        total_branches_covered += branches_covered\n\n        # 获取 sourcefilename 属性\n        sourcefilename = class_element.get('sourcefilename')\n        if sourcefilename:\n            package_element = class_element.getparent()\n            if package_element is not None and package_element.tag == 'package':\n                sourcefile_element = package_element.find(f\"sourcefile[@name='{sourcefilename}']\")\n                if sourcefile_element is not None:\n                    # 查找 mi > 0 的行号（未覆盖的行）\n                    missing_lines = [\n                        int(line.get('nr')) \n                        for line in sourcefile_element.findall('line') \n                        if line.get('mi') and int(line.get('mi')) > 0\n                    ]\n                    missing_lines_str = \",\".join(map(str, missing_lines)) if missing_lines else \"-\"\n                    # 查找 mb > 0 的分支（未覆盖的分支）\n                    missing_branches = [\n                        int(line.get('nr')) \n                        for line in sourcefile_element.findall('line') \n                        if line.get('mb') and int(line.get('mb')) > 0\n                    ]\n                    missing_branches_str = \",\".join(map(str, missing_branches)) if missing_branches else \"-\"\n                else:\n                    missing_lines_str = \"N/A\"\n                    missing_branches_str = \"N/A\"\n            else:\n                missing_lines_str = \"N/A\"\n                missing_branches_str = \"N/A\"\n        else:\n            missing_lines_str = \"N/A\"\n            missing_branches_str = \"N/A\"\n\n        # 计算行覆盖率\n        total_lines = lines_missed + lines_covered\n        if total_lines > 0:\n            line_coverage = (lines_covered / total_lines) * 100\n        else:\n            line_coverage = 0.0\n\n        table_data.append([class_name, f\"{line_coverage:.2f}%\", branch_coverage, missing_lines_str, missing_branches_str])\n\n        # Populate coverage_data dictionary if there are missing lines\n        if missing_lines_str != \"N/A\" and missing_lines_str != \"-\":\n            coverage_data[class_name] = [int(line) for line in missing_lines_str.split(',')]\n\n    # 计算总覆盖率\n    total_lines = total_lines_missed + total_lines_covered\n    if total_lines > 0:\n        total_line_coverage = (total_lines_covered / total_lines) * 100\n    else:\n        total_line_coverage = 0.0\n\n    total_branches = total_branches_missed + total_branches_covered\n    if total_branches > 0:\n        total_branch_coverage = (total_branches_covered / total_branches) * 100\n    else:\n        total_branch_coverage = \"N/A\"\n\n    # 添加总覆盖率到数据表\n    table_data.append([\"-----------------------------\", \"----------------\", \"----------------\", \"----------------\", \"----------------\"])\n    table_data.append([\"Total Coverage:\", f\"{total_line_coverage:.2f}%\", f\"{total_branch_coverage}\", \"\", \"\"])\n\n    # 计算每列的最大宽度\n    num_columns = len(table_data[0])\n    col_widths = [0] * num_columns\n    for row in table_data:\n        for idx, col in enumerate(row):\n            if len(col) > col_widths[idx]:\n                col_widths[idx] = len(col)\n\n    # 打印覆盖率详情\n    print(\"\\n=== 覆盖率详情 ===\")\n    for row in table_data:\n        if len(row) == 1:\n            print(row[0])\n        else:\n            row_str = \"\"\n            for idx, col in enumerate(row):\n                # 左对齐并加上适当的空格\n                row_str += col.ljust(col_widths[idx] + 2)\n            print(row_str)\n        sys.stdout.flush()  # 立即刷新输出\n\n    return coverage_data\n\ndef get_modified_files(repo, base_branch, path_pattern='src/main/**/*.java'):\n    \"\"\"\n    获取相对于 base_branch 的修改文件及其修改的行号\n    返回一个字典：{file_path: set(line_numbers)}\n    \"\"\"\n    # 获取 diff 输出，带有行号\n    diff_command = [\n        'git', 'diff', base_branch, '--unified=0', '--', path_pattern\n    ]\n    try:\n        diff_output = subprocess.check_output(diff_command, stderr=subprocess.STDOUT).decode('utf-8')\n    except subprocess.CalledProcessError as e:\n        print(f\"执行 git diff 失败: {e.output.decode('utf-8')}\")\n        sys.stdout.flush()\n        sys.exit(1)\n    \n    modified_files = defaultdict(set)  # {file_path: set(line_numbers)}\n    current_file = None\n    line_num = 0\n\n    for line in diff_output.splitlines():\n        if line.startswith('diff --git'):\n            parts = line.split()\n            if len(parts) >= 4:\n                a_path = parts[2][2:]\n                b_path = parts[3][2:]\n                current_file = b_path  # 使用新文件路径\n        elif line.startswith('@@'):\n            if current_file:\n                # 解析 hunk header\n                # 格式: @@ -start,count +start,count @@\n                hunk_header = line\n                try:\n                    hunk_info = hunk_header.split(' ')[1:3]\n                    new_hunk = hunk_info[1]\n                    start, count = new_hunk[1:].split(',')\n                    start = int(start)\n                    count = int(count)\n                except Exception as e:\n                    print(f\"解析 hunk header 失败: {hunk_header}, 错误: {e}\")\n                    sys.stdout.flush()\n                    continue\n                line_num = start\n        elif line.startswith('+') and not line.startswith('+++'):\n            if current_file:\n                modified_files[current_file].add(line_num)\n                line_num += 1\n        elif line.startswith('-') and not line.startswith('---'):\n            # 删除的行，不需要增加 line_num\n            pass\n        else:\n            # 其他情况，不处理\n            pass\n\n    return modified_files\n\ndef generate_incremental_coverage_report(modified_files, coverage_data):\n    \"\"\"\n    生成增量代码覆盖率报告\n    \"\"\"\n    total_modified = 0\n    total_uncovered = 0\n    per_file_report = []\n\n    # 遍历修改的文件和行号\n    for file_path, modified_lines in modified_files.items():\n        # 将文件路径转换为类名，去掉 'java/src/main/java/' 和 '.java'\n        class_name = file_path.replace('java/src/main/java/', '').replace('.java', '')\n        # 从 coverage_data 中查找对应的类名\n        missing_lines = coverage_data.get(class_name, [])\n        # 计算被覆盖和未被覆盖的行\n        uncovered_in_modified = modified_lines.intersection(missing_lines)\n        covered_in_modified = modified_lines.difference(missing_lines)\n\n        total_modified += len(modified_lines)\n        total_uncovered += len(uncovered_in_modified)\n\n        # 保存每个文件的报告\n        per_file_report.append({\n            'file': file_path,\n            'modified': sorted(modified_lines),\n            'covered': sorted(covered_in_modified),\n            'uncovered': sorted(uncovered_in_modified)\n        })\n\n    # 计算增量覆盖率\n    coverage_percent = ((total_modified - total_uncovered) / total_modified) * 100 if total_modified > 0 else 0.0\n\n    # 生成报告输出\n    report_lines = []\n    report_lines.append(\"=== 增量代码覆盖率报告 ===\\n\")\n    for file_report in per_file_report:\n        report_lines.append(f\"文件: {file_report['file']}\")\n        report_lines.append(f\"修改的行数: {len(file_report['modified'])}\")\n        report_lines.append(f\"被覆盖的行数: {len(file_report['covered'])}\")\n        report_lines.append(f\"未被覆盖的行数: {len(file_report['uncovered'])}\")\n        if file_report['uncovered']:\n            report_lines.append(f\"未覆盖的行号: {', '.join(map(str, file_report['uncovered']))}\")\n        report_lines.append(\"\\n\")\n\n    # 增量覆盖率总结\n    report_lines.append(\"=== 总结 ===\")\n    report_lines.append(f\"总修改行数: {total_modified}\")\n    report_lines.append(f\"总未被覆盖行数: {total_uncovered}\")\n    report_lines.append(f\"增量覆盖率: {coverage_percent:.2f}%\")\n\n    report = \"\\n\".join(report_lines)\n    print(report)\n    sys.stdout.flush()\n\n    return {\n        'total_modified': total_modified,\n        'total_uncovered': total_uncovered,\n        'coverage_percent': coverage_percent,\n        'details': per_file_report\n    }\n\n\ndef main():\n    \"\"\"主函数，执行所有步骤。\"\"\"\n    parse_surefire_reports()\n    # 假设 parse_jacoco() 已经正确返回了覆盖率数据字典\n    coverage_data = parse_jacoco()\n\n    # 获取增量修改的文件及行号\n    repo = Repo(os.getcwd(), search_parent_directories=True)\n    base_branch = \"upstream/master\"\n    modified_files = get_modified_files(repo, base_branch, path_pattern='src/main/**/*.java')\n\n    # 生成增量覆盖率报告\n    generate_incremental_coverage_report(modified_files, coverage_data)\n\n\nif __name__ == \"__main__\":\n    main()"
  },
  {
    "path": "java/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>com.baidubce</groupId>\n    <artifactId>appbuilder</artifactId>\n    <version>1.1.3</version>\n    <packaging>jar</packaging>\n\n    <name>app-builder</name>\n    <description>The Java SDK for Baidu AppBuilder Platform.</description>\n    <url>https://github.com/baidubce/app-builder</url>\n\n    <licenses>\n        <license>\n            <name>The Apache License, Version 2.0</name>\n            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>\n        </license>\n    </licenses>\n\n    <developers>\n        <developer>\n            <id>bce</id>\n            <organization>Baidu Cloud</organization>\n            <organizationUrl>https://cloud.baidu.com/</organizationUrl>\n        </developer>\n    </developers>\n\n    <scm>\n        <connection>scm:git:git://github.com/baidubce/app-builder.git</connection>\n        <developerConnection>scm:git:ssh://github.com:baidubce/app-builder.git</developerConnection>\n        <url>https://github.com/baidubce/app-builder/tree/master</url>\n    </scm>\n\n    <properties>\n        <java.version>1.8</java.version>\n        <maven.compiler.source>${java.version}</maven.compiler.source>\n        <maven.compiler.target>${java.version}</maven.compiler.target>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    </properties>\n\n    <dependencies>\n        <dependency>\n            <groupId>org.apache.httpcomponents.client5</groupId>\n            <artifactId>httpclient5</artifactId>\n            <version>5.2.1</version>\n        </dependency>\n        <dependency>\n            <groupId>com.google.code.gson</groupId>\n            <artifactId>gson</artifactId>\n            <version>2.10.1</version>\n        </dependency>\n        <dependency>\n            <groupId>junit</groupId>\n            <artifactId>junit</artifactId>\n            <version>4.13.2</version>\n            <scope>test</scope>\n        </dependency>\n        <!-- Mockito -->\n        <dependency>\n            <groupId>org.mockito</groupId>\n            <artifactId>mockito-core</artifactId>\n            <version>4.0.0</version>\n            <scope>test</scope>\n        </dependency>\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <version>3.12.1</version>\n                <configuration>\n                    <source>${java.version}</source>\n                    <target>${java.version}</target>\n                </configuration>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-source-plugin</artifactId>\n                <version>3.3.0</version>\n                <executions>\n                    <execution>\n                        <id>attach-sources</id>\n                        <goals>\n                            <goal>jar-no-fork</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-javadoc-plugin</artifactId>\n                <version>3.6.3</version>\n                <executions>\n                    <execution>\n                        <id>attach-javadocs</id>\n                        <goals>\n                            <goal>jar</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <!-- Jacoco Plugin -->\n            <plugin>\n                <groupId>org.jacoco</groupId>\n                <artifactId>jacoco-maven-plugin</artifactId>\n                <version>0.8.7</version>\n                <executions>\n                    <execution>\n                        <goals>\n                            <goal>prepare-agent</goal>\n                        </goals>\n                    </execution>\n                    <execution>\n                        <id>report</id>\n                        <goals>\n                            <goal>report</goal>\n                        </goals>\n                    </execution>\n                    <execution>\n                        <id>jacoco-check</id>\n                        <goals>\n                            <goal>check</goal>\n                        </goals>\n                    </execution>\n                </executions>\n                <configuration>\n                    <rules>\n                        <rule>\n                            <element>BUNDLE</element>\n                            <limits>\n                                <limit>\n                                    <counter>INSTRUCTION</counter>\n                                    <value>COVEREDRATIO</value>\n                                    <minimum>0.00</minimum>\n                                </limit>\n                                <limit>\n                                    <counter>BRANCH</counter>\n                                    <value>COVEREDRATIO</value>\n                                    <minimum>0.00</minimum>\n                                </limit>\n                                <limit>\n                                    <counter>LINE</counter>\n                                    <value>COVEREDRATIO</value>\n                                    <minimum>0.00</minimum>\n                                </limit>\n                            </limits>\n                        </rule>\n                    </rules>\n                </configuration>\n            </plugin>\n\n            <!-- Maven Exec Plugin to run Java classes -->\n            <plugin>\n                <groupId>org.codehaus.mojo</groupId>\n                <artifactId>exec-maven-plugin</artifactId>\n                <version>3.0.0</version>\n                <executions>\n                    <execution>\n                        <goals>\n                            <goal>java</goal>\n                        </goals>\n                    </execution>\n                </executions>\n                <configuration>\n                    <mainClass>com.baidubce.appbuilder.MainClass</mainClass>\n                </configuration>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-gpg-plugin</artifactId>\n                <version>3.1.0</version>\n                <executions>\n                    <execution>\n                        <id>sign-artifacts</id>\n                        <phase>verify</phase>\n                        <goals>\n                            <goal>sign</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <groupId>org.sonatype.central</groupId>\n                <artifactId>central-publishing-maven-plugin</artifactId>\n                <version>0.9.0</version>\n                <extensions>true</extensions>\n                <configuration>\n                    <publishingServerId>central</publishingServerId>\n                </configuration>\n            </plugin>\n        </plugins>\n    </build>\n\n    <profiles>\n        <profile>\n            <id>central</id>\n            <build>\n                <plugins>\n                    <plugin>\n                        <groupId>org.apache.maven.plugins</groupId>\n                        <artifactId>maven-gpg-plugin</artifactId>\n                        <version>3.1.0</version>\n                        <executions>\n                            <execution>\n                                <id>sign-artifacts</id>\n                                <phase>verify</phase>\n                                <goals>\n                                    <goal>sign</goal>\n                                </goals>\n                            </execution>\n                        </executions>\n                    </plugin>\n                </plugins>\n            </build>\n        </profile>\n    </profiles>\n</project>"
  },
  {
    "path": "java/print_coverage.sh",
    "content": "#!/bin/bash\n\n# 设置脚本退出时错误码\nset -e\n\n# 运行 Maven 测试并生成 JaCoCo 报告，捕获输出\necho \"运行 Maven 测试并生成 JaCoCo 报告...\"\nif mvn clean test jacoco:report jacoco:check > mvn_output.log 2>&1; then\n    echo \"Maven 测试成功。\"\nelse\n    echo \"Maven 测试失败。查看详细错误日志：\"\n    cat mvn_output.log\n    exit 1  # 直接退出\nfi\n\n# 更新 PATH\nexport PATH=\"$HOME/.local/bin:$PATH\"\n\n# 运行 Python 脚本解析测试和覆盖率报告\npython parse_tests_and_coverage.py\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/base/component/Component.java",
    "content": "package com.baidubce.appbuilder.base.component;\n\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.utils.http.HttpClient;\n\npublic class Component {\n    protected HttpClient httpClient;\n\n    public Component() {\n        //从环境变量获取\n        initClient(\"\", \"\");\n    }\n\n    public Component(String secretKey) {\n        initClient(secretKey, \"\");\n    }\n\n    public Component(String secretKey, String gateway) {\n        initClient(secretKey, gateway);\n    }\n\n    private void initClient(String secretKey, String gateway) {\n        gateway = getEnvWithDefault(AppBuilderConfig.APPBUILDER_GATEWAY_URL, gateway, AppBuilderConfig.APPBUILDER_DEFAULT_GATEWAY);\n        String gatewayV2 = getEnvWithDefault(AppBuilderConfig.APPBUILDER_GATEWAY_URL_V2, \"\",\n                AppBuilderConfig.APPBUILDER_DEFAULT_GATEWAY_V2);\n        \n        secretKey = getEnvWithDefault(AppBuilderConfig.APPBUILDER_TOKEN, secretKey, \"\");\n        if (secretKey.isEmpty()) {\n            throw new RuntimeException(\"param secretKey is null and env APPBUILDER_TOKEN not set!\");\n        }\n        String secretKeyPrefix = getEnvWithDefault(AppBuilderConfig.APPBUIDLER_SECRET_KEY_PREFIX, \"\", AppBuilderConfig.APPBUILDER_DEFAULT_SECRET_KEY_PREFIX);\n        if (!secretKey.startsWith(secretKeyPrefix)) {\n            secretKey = String.format(\"%s %s\", secretKeyPrefix, secretKey);\n        }\n        this.httpClient = new HttpClient(secretKey, gateway, gatewayV2);\n        this.httpClient.ConsoleOpenAPIPrefix = getEnvWithDefault(AppBuilderConfig.APPBUILDER_CONSOLE_OPENAPI_PREFIX, \"\",\n                AppBuilderConfig.APPBUILDER_DEFAULT_CONSOLE_OPENAPI_PREFIX);\n        this.httpClient.ConsoleOpenAPIVersion = getEnvWithDefault(AppBuilderConfig.APPBUILDER_CONSOLE_OPENAPI_VERSION, \"\",\n                AppBuilderConfig.APPBUILDER_DEFAULT_CONSOLE_OPENAPI_VERSION);\n    }\n\n\n    private String getEnvWithDefault(String propertyKey, String currentValue, String defaultValue) {\n        if (currentValue == null || currentValue.isEmpty()) {\n            currentValue = System.getProperty(propertyKey);\n            if (currentValue == null) {\n                currentValue = System.getenv(propertyKey);\n            }\n            if (currentValue == null) {\n                currentValue = defaultValue;\n            }\n        }\n        return currentValue;\n    }\n}\n\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/base/config/AppBuilderConfig.java",
    "content": "package com.baidubce.appbuilder.base.config;\n\npublic class AppBuilderConfig {\n    public static final String APPBUILDER_TOKEN = \"APPBUILDER_TOKEN\";\n    public static final String APPBUILDER_GATEWAY_URL = \"GATEWAY_URL\";\n    public static final String APPBUILDER_GATEWAY_URL_V2 = \"GATEWAY_URL_V2\";\n    public static final String APPBUILDER_CONSOLE_OPENAPI_VERSION = \"CONSOLE_OPENAPI_VERSION\";\n    public static final String APPBUILDER_CONSOLE_OPENAPI_PREFIX = \"CONSOLE_OPENAPI_PREFIX\";\n    public static final String APPBUIDLER_SECRET_KEY_PREFIX = \"SECRET_KEY_PREFIX\";\n\n    public static final String APPBUILDER_REQUEST_ID = \"X-Appbuilder-Request-Id\";\n    public static final String APPBUILDER_DEFAULT_GATEWAY = \"https://appbuilder.baidu.com\";\n    public static final String APPBUILDER_DEFAULT_GATEWAY_V2 = \"https://qianfan.baidubce.com\";\n    public static final String APPBUILDER_DEFAULT_CONSOLE_OPENAPI_VERSION = \"/v2\";\n    public static final String APPBUILDER_DEFAULT_CONSOLE_OPENAPI_PREFIX = \"\";\n    public static final String APPBUILDER_DEFAULT_SECRET_KEY_PREFIX = \"Bearer\";\n\n    public static final String APPBUILDER_LOGLEVEL = \"APPBUILDER_LOGLEVEL\";\n    public static final String APPBUILDER_LOGFILE = \"APPBUILDER_LOGFILE\";\n\n    // http client请求超时时间，秒\n    public static final int HTTP_CLIENT_CONNECTION_TIMEOUT = 1800;\n\n    // appbuilderclient\n    // 应用列表\n    public static final String APP_LIST_URL = \"/apps\";\n    public static final String APPS_DESCRIBE_URL = \"/app?Action=DescribeApps\";\n    // 应用详情\n    public static final String APP_DESCRIBE_URL = \"/app?Action=DescribeApp\";\n    // 创建会话\n    public static final String CREATE_CONVERSATION_URL = \"/app/conversation\";\n    // 上传文件\n    public static final String UPLOAD_FILE_URL = \"/app/conversation/file/upload\";\n    // 运行appbuilder\n    public static final String AGENTBUILDER_RUN_URL = \"/app/conversation/runs\";\n    // 点踩点赞\n    public static final String FEEDBACK_URL = \"/app/conversation/feedback\";\n\n    // knowledgebase\n    // 上传文件\n    public static final String KNOWLEDGEBASE_UPLOAD_FILE_URL = \"/file\";\n    // 新增知识库文档\n    public static final String KNOWLEDGEBASE_ADD_DOCUMENT_URL = \"/knowledge_base/document\";\n    // 获取知识库文档列表\n    public static final String KNOWLEDGEBASE_DOCUMENT_LIST_URL = \"/knowledge_base/documents\";\n    public static final String DESCRIBE_DOCUMENTS_URL = \"/knowledgeBase?Action=DescribeDocuments\";\n    // 删除知识库文档\n    public static final String KNOWLEDGEBASE_DELETE_DOCUMENT_URL = \"/knowledge_base/document\";\n    // 创建知识库\n    public static final String KNOWLEDGEBASE_CREATE_URL =\n            \"/knowledgeBase?Action=CreateKnowledgeBase\";\n    // 获取知识库详情\n    public static final String KNOWLEDGEBASE_DETAIL_URL =\n            \"/knowledgeBase?Action=DescribeKnowledgeBase\";\n    // 删除知识库\n    public static final String KNOWLEDGEBASE_DELETE_URL =\n            \"/knowledgeBase?Action=DeleteKnowledgeBase\";\n    // 获取知识库列表\n    public static final String KNOWLEDGEBASE_LIST_URL =\n            \"/knowledgeBase?Action=DescribeKnowledgeBases\";\n    // 更新知识库\n    public static final String KNOWLEDGEBASE_MODIFY_URL =\n            \"/knowledgeBase?Action=ModifyKnowledgeBase\";\n    // 导入知识库\n    public static final String KNOWLEDGEBASE_CREATE_DOCUMENTS_URL =\n            \"/knowledgeBase?Action=CreateDocuments\";\n    // 上传文件到知识库\n    public static final String KNOWLEDGEBASE_UPLOAD_DOCUMENTS_URL =\n            \"/knowledgeBase?Action=UploadDocuments\";\n    // 创建切片\n    public static final String CHUNK_CREATE_URL = \"/knowledgeBase?Action=CreateChunk\";\n    // 修改切片\n    public static final String CHUNK_MODIFY_URL = \"/knowledgeBase?Action=ModifyChunk\";\n    // 获取切片详情\n    public static final String CHUNK_DESCRIBE_URL = \"/knowledgeBase?Action=DescribeChunk\";\n    // 获取切片列表\n    public static final String CHUNKS_DESCRIBE_URL = \"/knowledgeBase?Action=DescribeChunks\";\n    // 删除切片\n    public static final String CHUNK_DELETE_URL = \"/knowledgeBase?Action=DeleteChunk\";\n    // 知识库检索\n    public static final String QUERY_KNOWLEDGEBASE_URL = \"/knowledgebases/query\";\n\n    // 组件调用\n    public static final String COMPONENT_RUN_URL = \"/components\";\n\n    // AI搜索、基础搜索\n    public static final String AI_SEARCH_URL = \"/ai_search/chat/completions\";\n\n    // 运行rag\n    public static final String RAG_RUN_URL =\n            \"/api/v1/ai_engine/agi_platform/v1/instance/integrated\";\n\n    // dataset\n    // 创建数据集\n    public static final String DATASET_CREATE_URL =\n            \"/api/v1/ai_engine/agi_platform/v1/datasets/create\";\n    // 新增文档\n    public static final String DATASET_ADD_FILE_URL =\n            \"/api/v1/ai_engine/agi_platform/v1/datasets/documents\";\n    // 获取文档列表\n    public static final String DATASET_GET_FILE_LIST_URL =\n            \"/api/v1/ai_engine/agi_platform/v1/datasets/documents/list_page\";\n    // 删除文档\n    public static final String DATASET_DELETE_FILE_URL =\n            \"/api/v1/ai_engine/agi_platform/v1/datasets/document/delete\";\n    // 上传文件\n    public static final String DATASET_UPLOAD_FILE_URL =\n            \"/api/v1/ai_engine/agi_platform/v1/datasets/files/upload\";\n\n    private AppBuilderConfig() {}\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/base/exception/AppBuilderServerException.java",
    "content": "package com.baidubce.appbuilder.base.exception;\n\npublic class AppBuilderServerException extends Exception {\n    private final String requestId;\n    private final int code;\n    private final String message;\n    private int appbuilderCode;\n    private String appbuilderMessage;\n    private String responseBody;\n\n    public AppBuilderServerException(String requestId, int code, String message) {\n        this.requestId = requestId;\n        this.code = code;\n        this.message = message;\n    }\n\n    public AppBuilderServerException(String requestId, int code, String message, int appbuilderCode, String appbuilderMessage) {\n        this(requestId, code, message);\n        this.appbuilderCode = appbuilderCode;\n        this.appbuilderMessage = appbuilderMessage;\n    }\n\n    public AppBuilderServerException(String requestId, int code, String message, String responseBody) {\n        this(requestId, code, message);\n        this.responseBody = responseBody;\n    }\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public int getCode() {\n        return code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public int getAppbuilderCode() {\n        return appbuilderCode;\n    }\n\n    public String getAppbuilderMessage() {\n        return appbuilderMessage;\n    }\n\n    public String getResponseBody() {\n        return responseBody;\n    }\n\n    @Override\n    public String toString() {\n        return \"AppBuilderServerException{\" +\n                \"requestId='\" + requestId + '\\'' +\n                \", code=\" + code +\n                \", message='\" + message + '\\'' +\n                \", appbuilderCode=\" + appbuilderCode +\n                \", appbuilderMessage='\" + appbuilderMessage + '\\'' +\n                \", responseBody='\" + responseBody + '\\'' +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/base/utils/http/HttpClient.java",
    "content": "package com.baidubce.appbuilder.base.utils.http;\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport org.apache.hc.client5.http.classic.methods.HttpDelete;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.classic.methods.HttpPost;\nimport org.apache.hc.client5.http.classic.methods.HttpUriRequestBase;\nimport org.apache.hc.client5.http.config.RequestConfig;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.client5.http.impl.classic.HttpClients;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.Header;\nimport org.apache.hc.core5.http.HttpEntity;\nimport org.apache.hc.core5.http.ParseException;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\n\nimport java.io.IOException;\nimport java.lang.reflect.Type;\nimport java.net.URLEncoder;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.concurrent.TimeUnit;\nimport java.util.logging.ConsoleHandler;\nimport java.util.logging.FileHandler;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\n\npublic class HttpClient {\n    public String SecretKey;\n    public String Gateway;\n    public String GatewayV2;\n    public String ConsoleOpenAPIVersion;\n    public String ConsoleOpenAPIPrefix;\n\n\n    private final CloseableHttpClient client;\n    private static final Logger LOGGER = Logger.getLogger(Component.class.getName());\n\n    public HttpClient(String secretKey, String gateway, String gatewayV2) {\n        RequestConfig requestConfig = RequestConfig.custom().setResponseTimeout(\n                AppBuilderConfig.HTTP_CLIENT_CONNECTION_TIMEOUT, TimeUnit.SECONDS).build();\n        this.client = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();\n        this.SecretKey = secretKey;\n        this.Gateway = gateway;\n        this.GatewayV2 = gatewayV2;\n\n        ConsoleHandler handler = new ConsoleHandler();\n        String systemLogLevel = System.getProperty(AppBuilderConfig.APPBUILDER_LOGLEVEL);\n        if (systemLogLevel == null || systemLogLevel.isEmpty()) {\n            systemLogLevel = System.getenv(AppBuilderConfig.APPBUILDER_LOGLEVEL);\n        }\n        if (systemLogLevel == null || systemLogLevel.isEmpty()) {\n            LOGGER.setLevel(Level.INFO);\n            handler.setLevel(Level.INFO);\n        } else {\n            switch (systemLogLevel.toLowerCase()) {\n                case \"debug\":\n                    LOGGER.setLevel(Level.FINE);\n                    handler.setLevel(Level.FINE);\n                    break;\n                case \"warning\":\n                    LOGGER.setLevel(Level.WARNING);\n                    handler.setLevel(Level.WARNING);\n                    break;\n                case \"error\":\n                    LOGGER.setLevel(Level.SEVERE);\n                    handler.setLevel(Level.SEVERE);\n                    break;\n                default:\n                    LOGGER.setLevel(Level.INFO);\n                    handler.setLevel(Level.INFO);\n                    break;\n            }\n        }\n        LOGGER.addHandler(handler);\n\n        String systemLogFile = System.getProperty(AppBuilderConfig.APPBUILDER_LOGFILE);\n        if (systemLogFile == null || systemLogFile.isEmpty()) {\n            systemLogFile = System.getenv(AppBuilderConfig.APPBUILDER_LOGFILE);\n        }\n\n        if (systemLogFile != null && !systemLogFile.isEmpty()) {\n            try {\n                FileHandler fileHandler = new FileHandler(systemLogFile);\n                LOGGER.addHandler(fileHandler);\n            } catch (Exception e) {\n                throw new RuntimeException(\"Failed to create log file: \" + systemLogFile, e);\n            }\n        }\n    }\n\n    public ClassicHttpRequest createPostRequest(String url, HttpEntity entity) {\n        String requestURL = Gateway + url;\n        LOGGER.log(Level.FINE, \"requestURL: \" + requestURL);\n        HttpPost httpPost = new HttpPost(requestURL);\n        httpPost.setHeader(\"X-Appbuilder-Authorization\", this.SecretKey);\n        httpPost.setHeader(\"X-Appbuilder-Origin\", \"appbuilder_sdk\");\n        String platform = System.getenv(\"APPBUILDER_SDK_PLATFORM\") != null\n                ? System.getenv(\"APPBUILDER_SDK_PLATFORM\")\n                : \"unknown\";\n        httpPost.setHeader(\"X-Appbuilder-Sdk-Config\",\n                \"{\\\"appbuilder_sdk_version\\\":\\\"1.1.0\\\",\\\"appbuilder_sdk_language\\\":\\\"java\\\",\\\"appbuilder_sdk_platform\\\":\\\"\"\n                        + platform + \"\\\"}\");\n        httpPost.setHeader(\"X-Appbuilder-Request-Id\", java.util.UUID.randomUUID().toString());\n        httpPost.setEntity(entity);\n        String headers = \"headers: \\n\";\n        for (Header header : httpPost.getHeaders()) {\n            headers += header + \"\\n\";\n        }\n        LOGGER.log(Level.FINE, \"\\n\" + headers);\n        return httpPost;\n    }\n\n    /**\n     * 创建一个用于发送 POST 请求的 ClassicHttpRequest 对象 适配OpenAPI，目前仅AgentBuilder使用\n     *\n     * @param url 请求的 URL\n     * @param entity 请求的实体\n     * @return 返回创建的 ClassicHttpRequest 对象\n     */\n    public ClassicHttpRequest createPostRequestV2(String url, HttpEntity entity) {\n        String requestURL = GatewayV2 + ConsoleOpenAPIPrefix + ConsoleOpenAPIVersion + url;\n        LOGGER.log(Level.FINE, \"requestURL: \" + requestURL);\n        HttpPost httpPost = new HttpPost(requestURL);\n        httpPost.setHeader(\"Authorization\", this.SecretKey);\n        httpPost.setHeader(\"X-Appbuilder-Origin\", \"appbuilder_sdk\");\n        String platform = System.getenv(\"APPBUILDER_SDK_PLATFORM\") != null\n                ? System.getenv(\"APPBUILDER_SDK_PLATFORM\")\n                : \"unknown\";\n        httpPost.setHeader(\"X-Appbuilder-Sdk-Config\",\n                \"{\\\"appbuilder_sdk_version\\\":\\\"1.1.0\\\",\\\"appbuilder_sdk_language\\\":\\\"java\\\",\\\"appbuilder_sdk_platform\\\":\\\"\"\n                        + platform + \"\\\"}\");\n        httpPost.setHeader(\"X-Appbuilder-Request-Id\", java.util.UUID.randomUUID().toString());\n        httpPost.setEntity(entity);\n        String headers = \"headers: \\n\";\n        for (Header header : httpPost.getHeaders()) {\n            headers += header + \"\\n\";\n        }\n        LOGGER.log(Level.FINE, \"\\n\" + headers);\n        return httpPost;\n    }\n\n    public ClassicHttpRequest createGetRequestV2(String url, Map<String, Object> map) {\n        String urlParams = toQueryString(map);\n        String requestURL =\n                GatewayV2 + ConsoleOpenAPIPrefix + ConsoleOpenAPIVersion + url + \"?\" + urlParams;\n        LOGGER.log(Level.FINE, \"requestURL: \" + requestURL);\n        HttpGet httpGet = new HttpGet(requestURL);\n        httpGet.setHeader(\"Authorization\", this.SecretKey);\n        httpGet.setHeader(\"X-Appbuilder-Origin\", \"appbuilder_sdk\");\n        String platform = System.getenv(\"APPBUILDER_SDK_PLATFORM\") != null\n                ? System.getenv(\"APPBUILDER_SDK_PLATFORM\")\n                : \"unknown\";\n        httpGet.setHeader(\"X-Appbuilder-Sdk-Config\",\n                \"{\\\"appbuilder_sdk_version\\\":\\\"1.1.0\\\",\\\"appbuilder_sdk_language\\\":\\\"java\\\",\\\"appbuilder_sdk_platform\\\":\\\"\"\n                        + platform + \"\\\"}\");\n        httpGet.setHeader(\"X-Appbuilder-Request-Id\", java.util.UUID.randomUUID().toString());\n        String headers = \"headers: \\n\";\n        for (Header header : httpGet.getHeaders()) {\n            headers += header + \"\\n\";\n        }\n        LOGGER.log(Level.FINE, \"\\n\" + headers);\n        return httpGet;\n    }\n\n    public ClassicHttpRequest createDeleteRequestV2(String url, Map<String, Object> map) {\n        // 处理查询参数\n        String urlParams = toQueryString(map);\n        // 如果 URL 已经包含 '?', 不需要再添加\n        String requestURL = GatewayV2 + ConsoleOpenAPIPrefix + ConsoleOpenAPIVersion + url\n                    + (url.contains(\"?\") ? \"&\" : \"?\") + urlParams;\n\n        LOGGER.log(Level.FINE, \"requestURL: \" + requestURL);\n        HttpDelete httpDelete = new HttpDelete(requestURL);\n        httpDelete.setHeader(\"Authorization\", this.SecretKey);\n        httpDelete.setHeader(\"X-Appbuilder-Origin\", \"appbuilder_sdk\");\n        String platform = System.getenv(\"APPBUILDER_SDK_PLATFORM\") != null\n                ? System.getenv(\"APPBUILDER_SDK_PLATFORM\")\n                : \"unknown\";\n        httpDelete.setHeader(\"X-Appbuilder-Sdk-Config\",\n                \"{\\\"appbuilder_sdk_version\\\":\\\"1.1.0\\\",\\\"appbuilder_sdk_language\\\":\\\"java\\\",\\\"appbuilder_sdk_platform\\\":\\\"\"\n                        + platform + \"\\\"}\");\n        httpDelete.setHeader(\"X-Appbuilder-Request-Id\", java.util.UUID.randomUUID().toString());\n        String headers = \"headers: \\n\";\n        for (Header header : httpDelete.getHeaders()) {\n            headers += header + \"\\n\";\n        }\n        LOGGER.log(Level.FINE, \"\\n\" + headers);\n        return httpDelete;\n    }\n\n    public <T> HttpResponse<T> execute(ClassicHttpRequest request, Type bodyType)\n            throws IOException, AppBuilderServerException {\n        if (LOGGER.getLevel() == Level.FINE) {\n            buildCurlCommand(request);\n        }\n        HttpResponse<T> httpResponse = client.execute(request, resp -> {\n            Map<String, String> headers = new LinkedHashMap<>();\n            for (Header header : resp.getHeaders()) {\n                headers.put(header.getName(), header.getValue());\n            }\n            String requestId = headers.get(AppBuilderConfig.APPBUILDER_REQUEST_ID);\n            String stringBody = EntityUtils.toString(resp.getEntity());\n            HttpResponse<T> response =\n                    new HttpResponse<T>().setCode(resp.getCode()).setMessage(resp.getReasonPhrase())\n                            .setRequestId(requestId).setHeaders(headers).setStringBody(stringBody);\n            if (resp.getCode() == 200) {\n                LOGGER.log(Level.FINE, \"Successful response with code 200 for request ID: {0}\", new Object[]{requestId});\n                if (bodyType != null) {\n                    response.setBody(JsonUtils.deserialize(stringBody, bodyType));\n                }\n            } else {\n                LOGGER.log(Level.SEVERE, \"Error response with code {0} for request ID: {1}, message: {2}\", new Object[]{resp.getCode(), requestId, resp.getReasonPhrase()});\n            }\n            return response;\n        });\n        if (httpResponse.getCode() != 200) {\n            String errorMessage = String.format(\n                    \"Error after processing response with code %d for request ID: %s, message: %s\",\n                    httpResponse.getCode(),\n                    httpResponse.getRequestId(),\n                    httpResponse.getMessage()\n            );\n            LOGGER.log(Level.SEVERE, errorMessage);\n            throw new AppBuilderServerException(httpResponse.getRequestId(), httpResponse.getCode(),\n                    httpResponse.getMessage(), httpResponse.getStringBody());\n        }\n        return httpResponse;\n    }\n\n    public <T> HttpResponse<StreamIterator<T>> executeSSE(ClassicHttpRequest request, Type bodyType)\n            throws IOException, AppBuilderServerException {\n        if (LOGGER.getLevel() == Level.FINE) {\n            buildCurlCommand(request);\n        }\n        CloseableHttpResponse resp = client.execute(request);\n        Map<String, String> headers = new LinkedHashMap<>();\n        for (Header header : resp.getHeaders()) {\n            headers.put(header.getName(), header.getValue());\n        }\n        String requestId = headers.get(AppBuilderConfig.APPBUILDER_REQUEST_ID);\n        if (resp.getCode() != 200) {\n            String stringBody = \"\";\n            try {\n                stringBody = EntityUtils.toString(resp.getEntity());\n            } catch (ParseException ignored) {\n            }\n            throw new AppBuilderServerException(requestId, resp.getCode(), resp.getReasonPhrase(),\n                    stringBody);\n        }\n        return new HttpResponse<StreamIterator<T>>().setCode(resp.getCode())\n                .setMessage(resp.getReasonPhrase()).setRequestId(requestId).setHeaders(headers)\n                .setBody(new StreamIterator<>(resp, bodyType, (HttpUriRequestBase) request));\n    }\n\n    private String toQueryString(Map<String, Object> map) {\n        StringBuilder stringBuilder = new StringBuilder();\n        for (Map.Entry<String, Object> entry : map.entrySet()) {\n            if (entry.getValue() != null) {\n                if (stringBuilder.length() != 0) {\n                    stringBuilder.append('&');\n                }\n                try {\n                    stringBuilder.append(URLEncoder.encode(entry.getKey(), \"UTF-8\"));\n                    stringBuilder.append('=');\n                    stringBuilder.append(URLEncoder.encode(entry.getValue().toString(), \"UTF-8\"));\n                } catch (Exception e) {\n                    // Should never happen.\n                }\n            }\n        }\n        return stringBuilder.toString();\n    }\n\n    private void buildCurlCommand(ClassicHttpRequest request) {\n        StringBuilder curlCmd = new StringBuilder(\"curl\");\n\n        // Append method\n        curlCmd.append(\" -X \").append(request.getMethod());\n        curlCmd.append(\" -L\");\n        try {\n            curlCmd.append(\" \").append(\"\\'\").append(request.getUri()).append(\"\\'\").append(\" \\\\\\n\");\n        } catch (Exception e) {\n            LOGGER.log(Level.SEVERE, \"Invalid URL: \", e);\n        }\n\n        // Append headers\n        for (Header header : request.getHeaders()) {\n            curlCmd.append(\"-H \\'\").append(header.getName()).append(\": \").append(header.getValue())\n                    .append(\"\\'\");\n            curlCmd.append(\" \\\\\\n\");\n        }\n\n\n        if (\"GET\".equals(request.getMethod()) || \"DELETE\".equals(request.getMethod())) {\n            curlCmd = new StringBuilder(curlCmd.toString().replaceAll(\" \\\\\\\\\\n$\", \"\"));\n        }\n\n        // Append body\n        HttpEntity entity = request.getEntity();\n        if (entity != null && entity.isRepeatable()) {\n            try {\n                String body = EntityUtils.toString(entity);\n                curlCmd.append(\" -d '\").append(body).append(\"'\");\n            } catch (ParseException | IOException e) {\n            }\n        }\n\n        LOGGER.log(Level.FINE, \"Curl Command: \\n\" + curlCmd.toString() + \"\\n\");\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/base/utils/http/HttpResponse.java",
    "content": "package com.baidubce.appbuilder.base.utils.http;\n\nimport java.util.Map;\n\npublic class HttpResponse<T> {\n    private int code;\n    private String message;\n    private String requestId;\n    private Map<String, String> headers;\n\n    private T body;\n\n    private String stringBody;\n\n    public int getCode() {\n        return code;\n    }\n\n    protected HttpResponse<T> setCode(int code) {\n        this.code = code;\n        return this;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public HttpResponse<T> setMessage(String message) {\n        this.message = message;\n        return this;\n    }\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public HttpResponse<T> setRequestId(String requestId) {\n        this.requestId = requestId;\n        return this;\n    }\n\n    public Map<String, String> getHeaders() {\n        return headers;\n    }\n\n    protected HttpResponse<T> setHeaders(Map<String, String> headers) {\n        this.headers = headers;\n        return this;\n    }\n\n    public T getBody() {\n        return body;\n    }\n\n    protected HttpResponse<T> setBody(T body) {\n        this.body = body;\n        return this;\n    }\n\n    public String getStringBody() {\n        return stringBody;\n    }\n\n    protected HttpResponse<T> setStringBody(String stringBody) {\n        this.stringBody = stringBody;\n        return this;\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/base/utils/iterator/StreamIterator.java",
    "content": "package com.baidubce.appbuilder.base.utils.iterator;\n\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport org.apache.hc.client5.http.classic.methods.HttpUriRequestBase;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.lang.reflect.Type;\nimport java.util.Iterator;\nimport java.util.NoSuchElementException;\n\npublic class StreamIterator<T> implements Iterator<T>, AutoCloseable {\n    private final CloseableHttpResponse resp;\n    private final BufferedReader reader;\n    private final Type bodyType;\n    private final HttpUriRequestBase request;\n    private String nextLine;\n\n    public StreamIterator(CloseableHttpResponse resp, Type type, HttpUriRequestBase request) throws IOException {\n        this.resp = resp;\n        this.reader = new BufferedReader(new InputStreamReader(resp.getEntity().getContent()));\n        this.bodyType = type;\n        this.request = request;\n    }\n\n    @Override\n    public boolean hasNext() {\n        if (this.nextLine != null) {\n            return true;\n        }\n        try {\n            this.nextLine = this.reader.readLine();\n            // 跳过空白行\n            this.reader.readLine();\n        } catch (IOException e) {\n            close();\n            return false;\n        }\n        if (this.nextLine == null) {\n            close();\n            return false;\n        }\n        return true;\n    }\n\n    @Override\n    public T next() {\n        if (hasNext()) {\n            String currentLine = this.nextLine;\n            this.nextLine = null;\n            String respBody = currentLine.replaceFirst(\"data: \", \"\");\n            return JsonUtils.deserialize(respBody, this.bodyType);\n        } else {\n            close();\n            throw new NoSuchElementException(\"No more lines available\");\n        }\n    }\n\n    @Override\n    public void close() {\n        if (request != null) {\n            request.abort();\n        }\n        try {\n            if (reader != null) {\n                reader.close();\n            }\n        } catch (Exception ignored) {\n            // ignore\n        } finally {\n            try {\n                if (resp != null) {\n                    resp.close();\n                }\n            } catch (Exception ignored) {\n                // ignore\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/base/utils/json/JsonUtils.java",
    "content": "package com.baidubce.appbuilder.base.utils.json;\n\nimport com.google.gson.Gson;\n\nimport java.lang.reflect.Type;\n\n\npublic class JsonUtils {\n    private static final Gson gson = new Gson();\n\n    public static String serialize(Object object) {\n        return gson.toJson(object);\n    }\n\n    public static <T> T deserialize(String json, Type type) {\n        return gson.fromJson(json, type);\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/agentbuilder/AgentBuilder.java",
    "content": "package com.baidubce.appbuilder.console.agentbuilder;\n\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport com.baidubce.appbuilder.model.agentbuilder.*;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.lang.Deprecated;\nimport java.nio.charset.StandardCharsets;\nimport java.util.*;\n\nimport org.apache.hc.client5.http.entity.mime.HttpMultipartMode;\nimport org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\npublic class AgentBuilder extends Component {\n    public String appID;\n\n    @Deprecated\n    public AgentBuilder(String appID) {\n        super();\n        this.appID = appID;\n    }\n\n    @Deprecated\n    public AgentBuilder(String appID, String secretKey) {\n        super(secretKey);\n        this.appID = appID;\n    }\n\n    @Deprecated\n    public AgentBuilder(String appID, String secretKey, String gateway) {\n        super(secretKey, gateway);\n        this.appID = appID;\n    }\n\n    /**\n     * 创建会话\n     *\n     * @return 返回会话ID\n     * @throws IOException               当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public String createConversation() throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.CREATE_CONVERSATION_URL;\n        if (this.appID == null || this.appID.isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n        Map<String, String> requestBody = new HashMap<>();\n        requestBody.put(\"app_id\", this.appID);\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url, new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<ConversationResponse> response = httpClient.execute(postRequest, ConversationResponse.class);\n        ConversationResponse respBody = response.getBody();\n\n        return respBody.getConversationId();\n    }\n\n    /**\n     * 上传本地文件到指定会话中\n     *\n     * @param conversationId 会话ID\n     * @param filePath       文件路径\n     * @return 上传后的文件ID\n     * @throws IOException               当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public String uploadLocalFile(String conversationId, String filePath) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.UPLOAD_FILE_URL;\n        if (this.appID == null || this.appID.isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n        MultipartEntityBuilder builder = MultipartEntityBuilder.create()\n                .setMode(HttpMultipartMode.LEGACY)\n                .setCharset(StandardCharsets.UTF_8);\n        builder.addBinaryBody(\"file\", new File(filePath));\n        builder.addTextBody(\"app_id\", this.appID);\n        builder.addTextBody(\"conversation_id\", conversationId);\n        builder.addTextBody(\"scenario\", \"assistant\");\n\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url, builder.build());\n        HttpResponse<FileUploadResponse> response = httpClient.execute(postRequest, FileUploadResponse.class);\n\n        FileUploadResponse respBody = response.getBody();\n        return respBody.getFileId();\n    }\n\n    /**\n     * 运行AgentBuilder，根据输入的问题、会话ID、文件ID数组以及是否以流模式返回结果，返回AgentBuilderIterator迭代器。\n     *\n     * @param query          查询字符串\n     * @param conversationId 会话ID\n     * @param fileIds        文件ID数组\n     * @param stream         是否以流的形式返回结果\n     * @return AgentBuilderIterator 迭代器，包含 AgentBuilder 的运行结果\n     * @throws IOException               如果在 I/O 操作过程中发生错误\n     * @throws AppBuilderServerException 如果 AppBuilder 服务器返回错误\n     */\n    public AgentBuilderIterator run(String query, String conversationId, String[] fileIds, boolean stream) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.AGENTBUILDER_RUN_URL;\n        if (this.appID == null || this.appID.isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n        Map<String, Object> requestBody = new HashMap<>();\n        requestBody.put(\"app_id\", this.appID);\n        requestBody.put(\"query\", query);\n        requestBody.put(\"conversation_id\", conversationId);\n        requestBody.put(\"file_ids\", fileIds);\n        requestBody.put(\"stream\", stream);\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url, new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<StreamIterator<AgentBuilderResponse>> response = httpClient.executeSSE(postRequest, AgentBuilderResponse.class);\n        return new AgentBuilderIterator(response.getBody());\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/aisearch/AISearch.java",
    "content": "package com.baidubce.appbuilder.console.aisearch;\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\n\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport com.baidubce.appbuilder.model.aisearch.*;\n\npublic class AISearch extends Component {\n    public AISearch() {\n        super();\n    }\n\n    public AISearch(String secretKey) {\n        super(secretKey);\n    }\n\n    public AISearch(String secretKey, String gateway) {\n        super(secretKey, gateway);\n    }\n\n\n    public AISearchIterator run(AISearchRequest request)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.AI_SEARCH_URL;\n\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<StreamIterator<AISearchResponse>> response =\n                httpClient.executeSSE(postRequest, AISearchResponse.class);\n        return new AISearchIterator(response.getBody());\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/appbuilderclient/App.java",
    "content": "package com.baidubce.appbuilder.console.appbuilderclient;\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\n\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppDescribeRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppDescribeResponse;\n\npublic class App extends Component {\n    public App() {\n        super();\n    }\n    \n    /**\n     * 描述应用程序信息\n     *\n     * @param appId 应用ID\n     * @return 包含应用程序描述信息的响应对象\n     * @throws IOException 如果发生I/O异常\n     * @throws AppBuilderServerException 如果发生AppBuilder服务器异常\n     */\n    public AppDescribeResponse describeApp(String appId) \n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.APP_DESCRIBE_URL;\n\n        AppDescribeRequest request = new AppDescribeRequest();\n        request.setId(appId);\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<AppDescribeResponse> response = httpClient.execute(postRequest,\n                AppDescribeResponse.class);\n        AppDescribeResponse respBody = response.getBody();\n        return respBody;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/appbuilderclient/AppBuilderClient.java",
    "content": "package com.baidubce.appbuilder.console.appbuilderclient;\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport com.baidubce.appbuilder.model.appbuilderclient.*;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.util.*;\n\nimport org.apache.hc.client5.http.entity.mime.HttpMultipartMode;\nimport org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\npublic class AppBuilderClient extends Component {\n    public String appID;\n\n    public AppBuilderClient(String appID) {\n        super();\n        this.appID = appID;\n    }\n\n    public AppBuilderClient(String appID, String secretKey) {\n        super(secretKey);\n        this.appID = appID;\n    }\n\n    public AppBuilderClient(String appID, String secretKey, String gateway) {\n        super(secretKey, gateway);\n        this.appID = appID;\n    }\n\n    /**\n     * 创建会话\n     *\n     * @return 返回会话ID\n     * @throws IOException 当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public String createConversation() throws IOException, AppBuilderServerException {\n        return innerCreateConversation();\n    }\n\n    private String innerCreateConversation() throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.CREATE_CONVERSATION_URL;\n        if (this.appID == null || this.appID.isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n        Map<String, String> requestBody = new HashMap<>();\n        requestBody.put(\"app_id\", this.appID);\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<ConversationResponse> response =\n                httpClient.execute(postRequest, ConversationResponse.class);\n        ConversationResponse respBody = response.getBody();\n\n        return respBody.getConversationId();\n    }\n\n    /**\n     * 上传本地文件到指定会话中\n     *\n     * @param conversationId 会话ID\n     * @param filePath 文件路径\n     * @return 上传后的文件ID\n     * @throws IOException 当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public String uploadLocalFile(String conversationId, String filePath)\n            throws IOException, AppBuilderServerException {\n        return innerUploadLocalFile(conversationId, filePath, \"\");\n    }\n\n    public String uploadFile(String conversationId, String filePath, String fileUrl)\n            throws IOException, AppBuilderServerException {\n        return innerUploadLocalFile(conversationId, filePath, fileUrl);\n    }\n\n    private String innerUploadLocalFile(String conversationId, String filePath, String fileUrl)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.UPLOAD_FILE_URL;\n        if (this.appID == null || this.appID.isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n        MultipartEntityBuilder builder = MultipartEntityBuilder.create()\n                .setMode(HttpMultipartMode.LEGACY).setCharset(StandardCharsets.UTF_8);\n\n        if(filePath != null && !filePath.isEmpty()) {\n            builder.addBinaryBody(\"file\", new File(filePath));\n        } else if (fileUrl != null && !fileUrl.isEmpty()) {\n            builder.addTextBody(\"file_url\", fileUrl);\n        }\n        builder.addTextBody(\"app_id\", this.appID);\n        builder.addTextBody(\"conversation_id\", conversationId);\n        builder.addTextBody(\"scenario\", \"assistant\");\n\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url, builder.build());\n        HttpResponse<FileUploadResponse> response =\n                httpClient.execute(postRequest, FileUploadResponse.class);\n\n        FileUploadResponse respBody = response.getBody();\n        return respBody.getFileId();\n    }\n\n    /**\n     * 运行AppBuilderClient，根据输入的问题、会话ID、文件ID数组以及是否以流模式返回结果，返回AgentBuilderIterator迭代器。\n     *\n     * @param query 查询字符串\n     * @param conversationId 会话ID\n     * @param fileIds 文件ID数组\n     * @param stream 是否以流的形式返回结果\n     * @return AgentBuilderIterator 迭代器，包含 AgentBuilder 的运行结果\n     * @throws IOException 如果在 I/O 操作过程中发生错误\n     * @throws AppBuilderServerException 如果 AppBuilder 服务器返回错误\n     */\n    public AppBuilderClientIterator run(String query, String conversationId, String[] fileIds,\n            boolean stream) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.AGENTBUILDER_RUN_URL;\n        if (this.appID == null || this.appID.isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n        Map<String, Object> requestBody = new HashMap<>();\n        requestBody.put(\"app_id\", this.appID);\n        requestBody.put(\"query\", query);\n        requestBody.put(\"conversation_id\", conversationId);\n        requestBody.put(\"file_ids\", fileIds);\n        requestBody.put(\"stream\", stream);\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<StreamIterator<AppBuilderClientResponse>> response =\n                httpClient.executeSSE(postRequest, AppBuilderClientResponse.class);\n        return new AppBuilderClientIterator(response.getBody());\n    }\n\n    /**\n     * 执行应用构建客户端运行请求\n     *\n     * @param requestBody 请求体，包含运行所需的所有信息\n     * @return 返回包含构建客户端响应的迭代器\n     * @throws IOException 如果在执行请求时发生I/O错误\n     * @throws AppBuilderServerException 如果应用构建服务器返回错误响应\n     */\n    public AppBuilderClientIterator run(AppBuilderClientRunRequest requestBody)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.AGENTBUILDER_RUN_URL;\n        if (this.appID == null || this.appID.isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<StreamIterator<AppBuilderClientResponse>> response = httpClient.executeSSE(postRequest,\n                AppBuilderClientResponse.class);\n        return new AppBuilderClientIterator(response.getBody());\n    }\n\n    /**\n     * 对对话结果进行点踩点赞\n     *\n     * @param requestBody 请求体，包含运行所需的所有信息\n     * @return 返回包含构建客户端响应的迭代器\n     * @throws IOException               如果在执行请求时发生I/O错误\n     * @throws AppBuilderServerException 如果应用构建服务器返回错误响应\n     */\n    public AppBuilderClientFeedbackResponse feedback(AppBuilderClientFeedbackRequest requestBody)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.FEEDBACK_URL;\n\n        if (requestBody.getAppId() == null || requestBody.getAppId().isEmpty()) {\n            requestBody.setAppId(this.appID);\n        }\n\n        if (requestBody.getAppId() == null || requestBody.getAppId().isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<AppBuilderClientFeedbackResponse> response = httpClient.execute(postRequest, AppBuilderClientFeedbackResponse.class);\n        AppBuilderClientFeedbackResponse respBody = response.getBody();\n        return respBody;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/appbuilderclient/AppList.java",
    "content": "package com.baidubce.appbuilder.console.appbuilderclient;\n\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\n\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport com.baidubce.appbuilder.model.appbuilderclient.App;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppListResponse;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppsDescribeRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppsDescribeResponse;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppListRequest;\n\npublic class AppList extends Component {\n    public AppList() {\n        super();\n    }\n\n    /**\n     * @deprecated 该方法已被弃用，请改用新方法\n     *\n     * 根据请求获取应用列表\n     *\n     * @param request 请求参数\n     * @return 应用列表数组\n     * @throws IOException 如果发生输入输出异常\n     * @throws AppBuilderServerException 如果发生应用构建服务器异常\n     */\n    @Deprecated\n    public App[] getAppList(AppListRequest request) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.APP_LIST_URL;\n\n        ClassicHttpRequest getRequest = httpClient.createGetRequestV2(url, request.toMap());\n        getRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<AppListResponse> response = httpClient.execute(getRequest, AppListResponse.class);\n        AppListResponse respBody = response.getBody();\n        return respBody.getData();\n    }\n    \n    /**\n     * 描述应用程序信息\n     *\n     * @param request 包含应用程序描述信息的请求对象\n     * @return 包含应用程序描述信息的响应对象\n     * @throws IOException 如果发生I/O异常\n     * @throws AppBuilderServerException 如果发生AppBuilder服务器异常\n     */\n    public AppsDescribeResponse describeApps(AppsDescribeRequest request) \n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.APPS_DESCRIBE_URL;\n\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<AppsDescribeResponse> response = httpClient.execute(postRequest,\n                AppsDescribeResponse.class);\n        AppsDescribeResponse respBody = response.getBody();\n        return respBody;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/componentclient/ComponentClient.java",
    "content": "package com.baidubce.appbuilder.console.componentclient;\n\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.Map;\nimport java.nio.charset.StandardCharsets;\n\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport com.baidubce.appbuilder.model.componentclient.ComponentClientIterator;\nimport com.baidubce.appbuilder.model.componentclient.ComponentClientRunResponse;\n\npublic class ComponentClient extends Component {\n    public ComponentClient() {\n        super();\n    }\n\n    public ComponentClient(String secretKey) {\n        super(secretKey);\n    }\n\n    public ComponentClient(String secretKey, String gateway) {\n        super(secretKey, gateway);\n    }\n\n    /**\n     * 运行Component，根据输入的问题、会话ID、文件ID数组以及是否以流模式等信息返回结果，返回ComponentClientIterator迭代器。\n     *\n     * \n     * @param componentId 组件ID\n     * @param version     组件版本\n     * @param action      参数动作\n     * @param stream      是否以流的形式返回结果\n     * @param parameters  参数列表\n     * @return ComponentCientIterator 迭代器，包含 ComponentCientIterator 的运行结果\n     * @throws IOException               如果在 I/O 操作过程中发生错误\n     * @throws AppBuilderServerException 如果 AppBuilder 服务器返回错误\n     */\n    public ComponentClientIterator run(String componentId, String version, String action, boolean stream,  Map<String, Object> parameters)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.COMPONENT_RUN_URL;\n        String urlSuffix = String.format(\"%s/%s\", url, componentId);\n        if (!version.isEmpty()) {\n            urlSuffix += String.format(\"/version/%s\", version);\n        }\n        if (!action.isEmpty()) {\n            if (urlSuffix.contains(\"?\")) {\n                urlSuffix += String.format(\"&action=%s\", action);\n            } else {\n                urlSuffix += String.format(\"?action=%s\", action);\n            }\n        }\n\n        Map<String, Object> requestBody = new HashMap<>();\n        requestBody.put(\"parameters\", parameters);\n        requestBody.put(\"stream\", stream);\n        String jsonBody = JsonUtils.serialize(requestBody);\n\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(urlSuffix,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        postRequest.setHeader(\"X-Appbuilder-From\", \"sdk\");\n        HttpResponse<StreamIterator<ComponentClientRunResponse>> response =\n                httpClient.executeSSE(postRequest, ComponentClientRunResponse.class);\n        return new ComponentClientIterator(response.getBody());\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/dataset/Dataset.java",
    "content": "package com.baidubce.appbuilder.console.dataset;\n\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.util.*;\n\nimport com.baidubce.appbuilder.model.dataset.*;\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport org.apache.hc.client5.http.entity.mime.HttpMultipartMode;\nimport org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\npublic class Dataset extends Component {\n    String datasetId;\n\n    @Deprecated\n    public Dataset() {\n        super();\n    }\n\n    @Deprecated\n    public Dataset(String secretKey) {\n        super(secretKey);\n    }\n\n    @Deprecated\n    public Dataset(String secretKey, String datasetId) {\n        super(secretKey);\n        this.datasetId = datasetId;\n    }\n\n    public void setDatasetId(String datasetId) {\n        this.datasetId = datasetId;\n    }\n\n    /**\n     * 创建数据集\n     *\n     * @param datasetName 数据集名称\n     * @return 返回创建成功后的数据集ID\n     * @throws IOException               当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public String createDataset(String datasetName) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.DATASET_CREATE_URL;\n\n        Map<String, String> requestBody = new HashMap<>();\n        requestBody.put(\"name\", datasetName);\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequest(url, new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<DatasetCreateResponse> response = httpClient.execute(postRequest, DatasetCreateResponse.class);\n        DatasetCreateResponse respBody = response.getBody();\n        if (respBody.getCode() != 0) {\n            throw new AppBuilderServerException(response.getRequestId(), response.getCode(), response.getMessage(),\n                    respBody.getCode(), respBody.getMessage());\n        }\n        this.datasetId = respBody.getResult().getId();\n        return this.datasetId;\n    }\n\n    /**\n     * 上传文档\n     *\n     * @param filePath 文件路径\n     * @return 上传成功后的文档ID\n     * @throws IOException               当文件上传失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    private String uploadDocument(String filePath) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.DATASET_UPLOAD_FILE_URL;\n\n        MultipartEntityBuilder builder = MultipartEntityBuilder.create()\n                .setMode(HttpMultipartMode.LEGACY)\n                .setCharset(StandardCharsets.UTF_8);\n        builder.addBinaryBody(\"file\", new File(filePath));\n\n        ClassicHttpRequest postRequest = httpClient.createPostRequest(url, builder.build());\n        HttpResponse<FileUploadResponse> response = httpClient.execute(postRequest, FileUploadResponse.class);\n        FileUploadResponse respBody = response.getBody();\n        if (respBody.getCode() != 0) {\n            throw new AppBuilderServerException(response.getRequestId(), response.getCode(), response.getMessage(),\n                    respBody.getCode(), respBody.getMessage());\n        }\n        return respBody.getResult().getId();\n    }\n\n    /**\n     * 向数据集中添加文档\n     *\n     * @param filePaths           要添加的文档文件路径列表\n     * @param isCustomProcessRule 是否使用自定义处理规则\n     * @param customProcessRule   自定义处理规则，当isCustomProcessRule为true时，该参数不为空\n     * @param isEnhanced          是否开启增强模式\n     * @throws IOException               当文件上传失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public String[] addDocuments(List<String> filePaths, boolean isCustomProcessRule, Map<String,\n            Object> customProcessRule, boolean isEnhanced) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.DATASET_ADD_FILE_URL;\n        if (this.datasetId == null || this.datasetId.isEmpty()) {\n            throw new RuntimeException(\"Param 'datasetId' is required! Please set param or call createDataset() first\");\n        }\n        ArrayList<String> fileIds = new ArrayList<>(filePaths.size());\n        for (String filePath : filePaths) {\n            String fileId = uploadDocument(filePath);\n            fileIds.add(fileId);\n        }\n        Map<String, Object> requestBody = new HashMap<>();\n        requestBody.put(\"dataset_id\", this.datasetId);\n        requestBody.put(\"file_ids\", fileIds);\n        requestBody.put(\"is_custom_process_rule\", isCustomProcessRule);\n        requestBody.put(\"is_enhanced\", isEnhanced);\n        if (isCustomProcessRule && customProcessRule != null) {\n            requestBody.put(\"custom_process_rule\", customProcessRule);\n        }\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequest(url, new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<DocumentAddResponse> response = httpClient.execute(postRequest, DocumentAddResponse.class);\n        DocumentAddResponse respBody = response.getBody();\n        if (respBody.getCode() != 0) {\n            throw new AppBuilderServerException(response.getRequestId(), response.getCode(), response.getMessage(),\n                    respBody.getCode(), respBody.getMessage());\n        }\n        return respBody.getResult().getDocumentIds();\n    }\n\n    /**\n     * 获取文档列表\n     *\n     * @param page    页码\n     * @param limit   每页文档数量\n     * @param keywork 搜索关键字\n     * @return 文档列表\n     * @throws IOException               当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public DocumentListResponse getDocumentList(int page, int limit, String keywork) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.DATASET_GET_FILE_LIST_URL;\n        if (this.datasetId == null || this.datasetId.isEmpty()) {\n            throw new RuntimeException(\"Param 'datasetId' is required! Please set param or call createDataset() first\");\n        }\n        Map<String, Object> requestBody = new HashMap<>();\n        requestBody.put(\"dataset_id\", this.datasetId);\n        requestBody.put(\"page\", page);\n        requestBody.put(\"limit\", limit);\n        requestBody.put(\"keyword\", keywork);\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequest(url, new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<DocumentListResponse> response = httpClient.execute(postRequest, DocumentListResponse.class);\n        DocumentListResponse respBody = response.getBody();\n        if (respBody.getCode() != 0) {\n            throw new AppBuilderServerException(response.getRequestId(), response.getCode(), response.getMessage(),\n                    respBody.getCode(), respBody.getMessage());\n        }\n        return respBody;\n    }\n\n    /**\n     * 从数据集中删除文档\n     *\n     * @param documentId 要删除的文档ID\n     * @throws IOException               当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public void deleteDocument(String documentId) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.DATASET_DELETE_FILE_URL;\n        if (this.datasetId == null || this.datasetId.isEmpty()) {\n            throw new RuntimeException(\"Param 'datasetId' is required! Please set param or call createDataset() first\");\n        }\n        Map<String, Object> requestBody = new HashMap<>();\n        requestBody.put(\"dataset_id\", this.datasetId);\n        requestBody.put(\"document_id\", documentId);\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequest(url, new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<DocumentDeleteResponse> response = httpClient.execute(postRequest, DocumentDeleteResponse.class);\n        DocumentDeleteResponse respBody = response.getBody();\n        if (respBody.getCode() != 0) {\n            throw new AppBuilderServerException(response.getRequestId(), response.getCode(), response.getMessage(),\n                    respBody.getCode(), respBody.getMessage());\n        }\n    }\n\n    /**\n     * 从数据集中批量删除多个文档\n     *\n     * @param documentIds 要删除的文档ID数组\n     * @throws IOException               当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public void deleteDocuments(String[] documentIds) throws IOException, AppBuilderServerException {\n        for (String documentId : documentIds) {\n            deleteDocument(documentId);\n        }\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/knowledgebase/Knowledgebase.java",
    "content": "package com.baidubce.appbuilder.console.knowledgebase;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\n\nimport org.apache.hc.client5.http.entity.mime.HttpMultipartMode;\nimport org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport com.baidubce.appbuilder.model.knowledgebase.*;\n\npublic class Knowledgebase extends Component {\n    private String knowledgeBaseId;\n\n    public Knowledgebase() {\n        super();\n    }\n\n    public Knowledgebase(String SecretKey) {\n        super(SecretKey);\n    }\n\n    public Knowledgebase(String knowledgeBaseId, String SecretKey) {\n        super(SecretKey);\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    /**\n     * 上传文档\n     *\n     * @param filePath 文件路径\n     * @return 上传成功后的文档ID\n     * @throws IOException               当文件上传失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    @Deprecated\n    public String uploadFile(String filePath) throws IOException, AppBuilderServerException {\n        return innerUploadFile(filePath, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 上传文件\n     *\n     * @param filePath 文件路径\n     * @param clientToken 客户端令牌\n     * @return 上传文件的结果\n     * @throws IOException 如果发生I/O错误\n     * @throws AppBuilderServerException 如果应用构建服务器发生错误\n     */\n    @Deprecated\n    public String uploadFile(String filePath, String clientToken) throws IOException, AppBuilderServerException {\n        return innerUploadFile(filePath, clientToken);\n    }\n\n    /**\n     * 上传文件到指定服务器。\n     *\n     * @param filePath 文件路径\n     * @param clientToken 客户端令牌\n     * @return 文件ID\n     * @throws IOException 当发生输入输出异常时抛出\n     * @throws AppBuilderServerException 当发生应用构建服务器异常时抛出\n     */\n    private String innerUploadFile(String filePath, String clientToken) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_UPLOAD_FILE_URL;\n\n        MultipartEntityBuilder builder = MultipartEntityBuilder.create()\n                .setMode(HttpMultipartMode.LEGACY).setCharset(StandardCharsets.UTF_8);\n        builder.addBinaryBody(\"file\", new File(filePath));\n\n        url = url + \"?clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url, builder.build());\n        HttpResponse<FileUploadResponse> response = httpClient.execute(postRequest, FileUploadResponse.class);\n        FileUploadResponse respBody = response.getBody();\n        if (!(respBody.getCode() == null)) {\n            throw new AppBuilderServerException(response.getRequestId(), response.getCode(),\n                    response.getMessage(), respBody.toString());\n        }\n        return respBody.getId();\n    }\n\n    /**\n     * 新增知识库文档\n     *\n     * @param req 请求参数\n     * @return documentIds 文档ID\n     * \n     * @throws IOException               当文件上传失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    @Deprecated\n    public String[] addDocument(DocumentAddRequest req)\n            throws IOException, AppBuilderServerException {\n        return innerAddDocument(req, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 向应用程序中添加文档\n     *\n     * @param req 文档添加请求对象，包含需要添加的文档信息\n     * @param clientToken 客户端令牌，用于验证请求来源\n     * @return 返回一个字符串数组，包含操作结果\n     * @throws IOException 如果发生输入/输出异常，抛出此异常\n     * @throws AppBuilderServerException 如果应用程序构建服务器发生异常，抛出此异常\n     */\n    @Deprecated\n    public String[] addDocument(DocumentAddRequest req, String clientToken)\n            throws IOException, AppBuilderServerException {\n        return innerAddDocument(req, clientToken);\n    }\n\n    /**\n     * 向知识库中添加文档\n     *\n     * @param req 文档添加请求对象\n     * @param clientToken 客户端令牌\n     * @return 文档ID数组\n     * @throws IOException 如果发生I/O异常\n     * @throws AppBuilderServerException 如果应用构建服务器异常\n     */\n    private String[] innerAddDocument(DocumentAddRequest req, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_ADD_DOCUMENT_URL;\n\n        String jsonBody = JsonUtils.serialize(req);\n        url = url + \"?clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<DocumentAddResponse> response = httpClient.execute(postRequest, DocumentAddResponse.class);\n        DocumentAddResponse respBody = response.getBody();\n        if (!(respBody.getCode() == null)) {\n            throw new AppBuilderServerException(response.getRequestId(), response.getCode(),\n                    response.getMessage(), respBody.toString());\n        }\n        return respBody.getDocumentIds();\n    }\n\n    /**\n     * 获取文档列表\n     *\n     * @param request 文档列表请求对象，包含请求参数\n     * @return 文档数组\n     * @throws IOException 当发生输入输出异常时抛出\n     * @throws AppBuilderServerException 当应用构建服务器发生异常时抛出\n     */\n    @Deprecated\n    public Document[] getDocumentList(DocumentListRequest request)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_DOCUMENT_LIST_URL;\n\n        ClassicHttpRequest getRequest = httpClient.createGetRequestV2(url, request.toMap());\n        getRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<DocumentListResponse> response = httpClient.execute(getRequest, DocumentListResponse.class);\n        DocumentListResponse respBody = response.getBody();\n        return respBody.getData();\n    }\n\n    public DocumentsDescribeResponse describeDocuments(DocumentsDescribeRequest request)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.DESCRIBE_DOCUMENTS_URL;\n\n        if (request.getKnowledgeBaseId().isEmpty() && !this.knowledgeBaseId.isEmpty()) {\n            request.setKnowledgeBaseId(this.knowledgeBaseId);\n        }\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<DocumentsDescribeResponse> response = httpClient.execute(postRequest,\n                DocumentsDescribeResponse.class);\n        DocumentsDescribeResponse respBody = response.getBody();\n        return respBody;\n    }\n\n    /**\n     * 删除文档\n     *\n     * @param request 文档删除请求对象\n     * @throws IOException                 如果在删除文档过程中发生I/O异常\n     * @throws AppBuilderServerException 如果在删除文档过程中发生AppBuilder服务器异常\n     */\n    public void deleteDocument(DocumentDeleteRequest request)\n            throws IOException, AppBuilderServerException {\n        innerDeleteDocument(request, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 删除文档\n     *\n     * @param request       删除文档的请求对象，包含要删除的文档ID等信息\n     * @param clientToken   客户端令牌，用于验证请求合法性\n     * @throws IOException   如果发生输入输出异常\n     * @throws AppBuilderServerException 如果发生应用构建服务器异常\n     */\n    public void deleteDocument(DocumentDeleteRequest request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        innerDeleteDocument(request, clientToken);\n    }\n\n    /**\n     * 删除文档\n     *\n     * @param request 删除文档请求\n     * @param clientToken 客户端令牌\n     * @throws IOException IO异常\n     * @throws AppBuilderServerException 应用构建服务器异常\n     */\n    private void innerDeleteDocument(DocumentDeleteRequest request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_DELETE_DOCUMENT_URL;\n        url = url + \"?clientToken=\" + clientToken;\n        ClassicHttpRequest getRequest = httpClient.createDeleteRequestV2(url, request.toMap());\n        getRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<DocumentDeleteResponse> response = httpClient.execute(getRequest, DocumentDeleteResponse.class);\n        DocumentDeleteResponse respBody = response.getBody();\n        if (!(respBody.getCode() == null)) {\n            throw new AppBuilderServerException(response.getRequestId(), response.getCode(),\n                    response.getMessage(), respBody.toString());\n        }\n    }\n\n    /**\n     * 创建知识库详情\n     *\n     * @param request 请求体，包含创建知识库所需的信息\n     * @return 创建成功后的知识库详情\n     * @throws IOException 当输入输出操作发生错误时抛出\n     * @throws AppBuilderServerException 当应用构建服务器发生错误时抛出\n     */\n    public KnowledgeBaseDetail createKnowledgeBase(KnowledgeBaseDetail request)\n            throws IOException, AppBuilderServerException {\n        return innerCreateKnowledgeBase(request, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 创建知识库详情\n     *\n     * @param request        包含创建知识库详情所需的参数\n     * @param clientToken    客户端令牌，用于身份验证\n     * @return 创建成功后的知识库详情对象\n     * @throws IOException                 如果发生I/O错误\n     * @throws AppBuilderServerException   如果发生应用程序构建服务器异常\n     */\n    public KnowledgeBaseDetail createKnowledgeBase(KnowledgeBaseDetail request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        return innerCreateKnowledgeBase(request, clientToken);\n    }\n\n    /**\n     * 创建一个知识库详情\n     *\n     * @param request 知识库详情请求对象\n     * @param clientToken 客户端令牌\n     * @return 创建成功后的知识库详情对象\n     * @throws IOException IO异常\n     * @throws AppBuilderServerException AppBuilder服务器异常\n     */\n    private KnowledgeBaseDetail innerCreateKnowledgeBase(KnowledgeBaseDetail request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_CREATE_URL;\n        url = url + \"&clientToken=\" + clientToken;\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<KnowledgeBaseDetail> response = httpClient.execute(postRequest, KnowledgeBaseDetail.class);\n        KnowledgeBaseDetail respBody = response.getBody();\n        return respBody;\n    }\n\n    /**\n     * 根据知识库ID获取知识库详情\n     *\n     * @param knowledgeBaseId 知识库ID\n     * @return KnowledgeBaseDetail 知识库详情对象\n     * @throws IOException 如果在发送HTTP请求或解析响应时发生IO异常\n     * @throws AppBuilderServerException 如果发生AppBuilder服务器异常\n     */\n    public KnowledgeBaseDetail getKnowledgeBaseDetail(String knowledgeBaseId)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_DETAIL_URL;\n\n        KnowledgeBaseDetailRequest request = new KnowledgeBaseDetailRequest();\n        request.setKnowledgeBaseId(knowledgeBaseId);\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<KnowledgeBaseDetail> response = httpClient.execute(postRequest, KnowledgeBaseDetail.class);\n        KnowledgeBaseDetail respBody = response.getBody();\n        return respBody;\n    }\n\n    /**\n     * 删除知识库\n     *\n     * @param knowledgeBaseId 知识库ID\n     * @throws IOException      当发生输入输出异常时抛出\n     * @throws AppBuilderServerException 当应用构建服务器异常时抛出\n     */\n    public void deleteKnowledgeBase(String knowledgeBaseId)\n            throws IOException, AppBuilderServerException {\n        innerDeleteKnowledgeBase(knowledgeBaseId, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 删除知识库\n     *\n     * @param knowledgeBaseId 知识库ID\n     * @param clientToken     客户端令牌\n     * @throws IOException              如果发生输入输出异常\n     * @throws AppBuilderServerException 如果发生应用构建服务器异常\n     */\n    public void deleteKnowledgeBase(String knowledgeBaseId, String clientToken)\n            throws IOException, AppBuilderServerException {\n        innerDeleteKnowledgeBase(knowledgeBaseId, clientToken);\n    }\n\n    /**\n     * 删除知识库\n     *\n     * @param knowledgeBaseId 知识库ID\n     * @param clientToken     客户端令牌\n     * @throws IOException                 IO异常\n     * @throws AppBuilderServerException   AppBuilder服务器异常\n     */\n    private void innerDeleteKnowledgeBase(String knowledgeBaseId, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_DELETE_URL;\n\n        KnowledgeBaseDetailRequest request = new KnowledgeBaseDetailRequest();\n        request.setKnowledgeBaseId(knowledgeBaseId);\n        String jsonBody = JsonUtils.serialize(request);\n        url = url + \"&clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        httpClient.execute(postRequest, null);\n    }\n\n    /**\n     * 修改知识库。\n     *\n     * @param request 知识库修改请求对象\n     * @throws IOException 如果在I/O操作过程中发生错误，则抛出此异常\n     * @throws AppBuilderServerException 如果应用构建服务器发生错误，则抛出此异常\n     */\n    public void modifyKnowledgeBase(KnowledgeBaseModifyRequest request)\n            throws IOException, AppBuilderServerException {\n        modifyKnowledgeBase(request, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 修改知识库\n     *\n     * @param request 修改请求对象，包含需要修改的内容\n     * @param clientToken 客户端令牌，用于验证请求来源的合法性\n     * @throws IOException 如果发生输入输出异常\n     * @throws AppBuilderServerException 如果应用构建服务器发生异常\n     */\n    public void modifyKnowledgeBase(KnowledgeBaseModifyRequest request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        innerModifyKnowledgeBase(request, clientToken);\n    }\n\n    /**\n     * 修改知识库\n     *\n     * @param request  修改知识库的请求对象\n     * @param clientToken 客户端令牌\n     * @throws IOException                  当请求过程中发生I/O异常时抛出\n     * @throws AppBuilderServerException    当请求过程中发生服务器异常时抛出\n     */\n    private void innerModifyKnowledgeBase(KnowledgeBaseModifyRequest request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_MODIFY_URL;\n\n        String jsonBody = JsonUtils.serialize(request);\n        url = url + \"&clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        httpClient.execute(postRequest, null);\n    }\n\n    /**\n     * 获取知识库列表\n     *\n     * @param request 包含请求参数的知识库列表请求对象\n     * @return 知识库列表响应对象\n     * @throws IOException 如果发生I/O异常，抛出此异常\n     * @throws AppBuilderServerException 如果应用构建服务器发生异常，抛出此异常\n     */\n    public KnowledgeBaseListResponse getKnowledgeBaseList(KnowledgeBaseListRequest request)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_LIST_URL;\n\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<KnowledgeBaseListResponse> response = httpClient.execute(postRequest,\n                KnowledgeBaseListResponse.class);\n        KnowledgeBaseListResponse respBody = response.getBody();\n        return respBody;\n    }\n\n    /**\n     * 创建文档\n     *\n     * @param request 文档创建请求\n     * @return 创建文档的响应结果\n     * @throws IOException          当发生输入输出异常时抛出\n     * @throws AppBuilderServerException 当应用构建服务器发生异常时抛出\n     */\n    public DocumentsCreateResponse createDocuments(DocumentsCreateRequest request)\n            throws IOException, AppBuilderServerException {\n        return innerCreateDocuments(request, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 创建文档\n     *\n     * @param request 包含创建文档所需信息的请求对象\n     * @param clientToken 客户端令牌，用于身份验证\n     * @return 包含创建文档结果的响应对象\n     * @throws IOException 如果发生输入/输出错误\n     * @throws AppBuilderServerException 如果应用程序构建服务器发生错误\n     */\n    public DocumentsCreateResponse createDocuments(DocumentsCreateRequest request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        return innerCreateDocuments(request, clientToken);\n    }\n\n    /**\n     * 创建文档的内部方法\n     *\n     * @param request    创建文档的请求参数\n     * @param clientToken 客户端令牌\n     * @return 创建文档的响应结果\n     * @throws IOException              如果发生输入输出异常\n     * @throws AppBuilderServerException 如果应用构建服务器发生异常\n     */\n    private DocumentsCreateResponse innerCreateDocuments(DocumentsCreateRequest request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_CREATE_DOCUMENTS_URL;\n\n        String jsonBody = JsonUtils.serialize(request);\n        url = url + \"&clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        httpClient.execute(postRequest, null);\n\n        HttpResponse<DocumentsCreateResponse> response = httpClient.execute(postRequest,\n                DocumentsCreateResponse.class);\n        DocumentsCreateResponse respBody = response.getBody();\n        return respBody;\n    }\n\n    /**\n     * 上传文档\n     *\n     * @param filePath 文件路径\n     * @param request 文档创建请求\n     * @return 文档上传响应\n     * @throws IOException            如果发生I/O错误，则抛出此异常\n     * @throws AppBuilderServerException 如果发生应用程序构建服务器错误，则抛出此异常\n     */\n    public DocumentsUploadResponse uploadDocuments(String filePath, DocumentsCreateRequest request)\n            throws IOException, AppBuilderServerException {\n        return innerUploadDocuments(filePath, request, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 上传文档\n     *\n     * @param filePath 文件路径\n     * @param request  文档上传请求对象\n     * @param clientToken 客户端Token\n     * @return 文档上传响应对象\n     * @throws IOException 抛出IO异常\n     * @throws AppBuilderServerException 抛出应用构建服务器异常\n     */\n    public DocumentsUploadResponse uploadDocuments(String filePath, DocumentsCreateRequest request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        return innerUploadDocuments(filePath, request, clientToken);\n    }\n\n    /**\n     * 上传文档到知识库\n     *\n     * @param filePath 要上传的文件的路径\n     * @param request 文档上传请求对象\n     * @param clientToken 客户端令牌\n     * @return 上传文档响应对象\n     * @throws IOException 如果在IO操作过程中发生错误\n     * @throws AppBuilderServerException 如果在应用构建服务器操作过程中发生错误\n     */\n    private DocumentsUploadResponse innerUploadDocuments(String filePath, DocumentsCreateRequest request, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.KNOWLEDGEBASE_UPLOAD_DOCUMENTS_URL;\n\n        MultipartEntityBuilder builder = MultipartEntityBuilder.create()\n                .setMode(HttpMultipartMode.LEGACY).setCharset(StandardCharsets.UTF_8);\n        builder.addBinaryBody(\"file\", new File(filePath));\n\n        String jsonBody = JsonUtils.serialize(request);\n        builder.addTextBody(\"payload\", jsonBody);\n\n        url = url + \"&clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url, builder.build());\n        HttpResponse<DocumentsUploadResponse> response = httpClient.execute(postRequest,\n                DocumentsUploadResponse.class);\n        DocumentsUploadResponse respBody = response.getBody();\n        return respBody;\n    }\n\n    /**\n     * 根据给定的文档ID和内容创建一个块\n     *\n     * @param documentId 文档ID\n     * @param content    块的内容\n     * @return 创建的块的字符串表示\n     * @throws IOException 如果在文件操作中发生错误\n     * @throws AppBuilderServerException 如果在应用程序构建服务器操作中发生错误\n     */\n    public String createChunk(String documentId, String content)\n            throws IOException, AppBuilderServerException {\n        return innerCreateChunk(documentId, content, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 创建文档块\n     *\n     * @param documentId 文档ID\n     * @param content    文档内容\n     * @param clientToken 客户端令牌\n     * @return 创建的文档块字符串\n     * @throws IOException          如果发生I/O错误\n     * @throws AppBuilderServerException 如果应用程序构建服务器异常\n     */\n    public String createChunk(String documentId, String content, String clientToken)\n            throws IOException, AppBuilderServerException {\n        return innerCreateChunk(documentId, content, clientToken);\n    }\n\n    /**\n     * 内部创建文档片段的方法\n     *\n     * @param documentId 文档ID\n     * @param content 文档内容\n     * @param clientToken 客户端令牌\n     * @return 创建的文档片段ID\n     * @throws IOException IO异常\n     * @throws AppBuilderServerException 应用构建服务器异常\n     */\n    private String innerCreateChunk(String documentId, String content, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.CHUNK_CREATE_URL;\n        \n        ChunkCreateRequest request;\n        if(this.knowledgeBaseId.isEmpty()) {\n            request = new ChunkCreateRequest(documentId, content);\n        } else {\n            request = new ChunkCreateRequest(this.knowledgeBaseId, documentId, content);\n        }\n        \n        String jsonBody = JsonUtils.serialize(request);\n        url = url + \"&clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<ChunkCreateResponse> response = httpClient.execute(postRequest, ChunkCreateResponse.class);\n        ChunkCreateResponse respBody = response.getBody();\n        return respBody.getChunkId();\n    }\n\n    /**\n     * 修改指定块的内容\n     *\n     * @param chunkId 块标识符\n     * @param content 要设置的内容\n     * @param enable 是否启用块\n     * @throws IOException 当发生输入输出异常时抛出\n     * @throws AppBuilderServerException 当发生应用构建服务器异常时抛出\n     */\n    public void modifyChunk(String chunkId, String content, boolean enable)\n            throws IOException, AppBuilderServerException {\n        innerModifyChunk(chunkId, content, enable, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 修改指定区块的内容及其启用状态\n     *\n     * @param chunkId      区块的ID\n     * @param content      需要设置的新内容\n     * @param enable       是否启用该区块，true表示启用，false表示禁用\n     * @param clientToken  客户端令牌，用于验证客户端身份\n     * @throws IOException           如果发生I/O错误\n     * @throws AppBuilderServerException 如果发生应用构建服务器错误\n     */\n    public void modifyChunk(String chunkId, String content, boolean enable, String clientToken)\n            throws IOException, AppBuilderServerException {\n        innerModifyChunk(chunkId, content, enable, clientToken);\n    }\n\n    /**\n     * 修改指定的块内容\n     *\n     * @param chunkId    块的ID\n     * @param content    块的新内容\n     * @param enable     是否启用块，true 表示启用，false 表示禁用\n     * @param clientToken 客户端令牌\n     * @throws IOException              如果发生I/O错误\n     * @throws AppBuilderServerException 如果应用构建服务器发生错误\n     */\n    private void innerModifyChunk(String chunkId, String content, boolean enable, String clientToken)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.CHUNK_MODIFY_URL;\n\n        ChunkModifyRequest request;\n        if (this.knowledgeBaseId.isEmpty()) {\n            request = new ChunkModifyRequest(chunkId, content, enable);\n        } else {\n            request = new ChunkModifyRequest(this.knowledgeBaseId, chunkId, content, enable);\n        }\n        String jsonBody = JsonUtils.serialize(request);\n        url = url + \"&clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        httpClient.execute(postRequest, ChunkCreateResponse.class);\n    }\n\n    /**\n     * 删除指定的文件块。\n     *\n     * @param chunkId 要删除的文件块的ID\n     * @throws IOException 如果发生I/O错误\n     * @throws AppBuilderServerException 如果发生应用构建服务器异常\n     */\n    public void deleteChunk(String chunkId) throws IOException, AppBuilderServerException {\n        innderDeleteChunk(chunkId, java.util.UUID.randomUUID().toString());\n    }\n\n    /**\n     * 删除指定的块。\n     *\n     * @param chunkId 块标识\n     * @param clientToken 客户端令牌\n     * @throws IOException 如果发生输入输出异常\n     * @throws AppBuilderServerException 如果发生应用程序构建服务器异常\n     */\n    public void deleteChunk(String chunkId, String clientToken) throws IOException, AppBuilderServerException {\n        innderDeleteChunk(chunkId, clientToken);\n    }\n\n    /**\n     * 删除指定块\n     *\n     * @param chunkId 块ID\n     * @param clientToken 客户端令牌\n     * @throws IOException 当I/O操作失败时抛出\n     * @throws AppBuilderServerException 当应用构建服务器异常时抛出\n     */\n    private void innderDeleteChunk(String chunkId, String clientToken) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.CHUNK_DELETE_URL;\n        \n        ChunkDeleteRequest request = new ChunkDeleteRequest();\n        request.setChunkId(chunkId);\n        if (!this.knowledgeBaseId.isEmpty()) {\n            request.setKnowledgeBaseId(this.knowledgeBaseId);\n        }\n        String jsonBody = JsonUtils.serialize(request);\n        url = url + \"&clientToken=\" + clientToken;\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        httpClient.execute(postRequest, ChunkCreateResponse.class);\n    }\n\n    /**\n     * 根据块ID描述块\n     *\n     * @param chunkId 块ID\n     * @return 描述块的响应对象\n     * @throws IOException 如果发生输入输出异常\n     * @throws AppBuilderServerException 如果发生应用构建服务器异常\n     */\n    public ChunkDescribeResponse describeChunk(String chunkId)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.CHUNK_DESCRIBE_URL;\n\n        ChunkDescribeRequest request = new ChunkDescribeRequest();\n        request.setChunkId(chunkId);\n        if (!this.knowledgeBaseId.isEmpty()) {\n            request.setKnowledgeBaseId(this.knowledgeBaseId);\n        }\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<ChunkDescribeResponse> response = httpClient.execute(postRequest, ChunkDescribeResponse.class);\n        ChunkDescribeResponse respBody = response.getBody();\n        return respBody;\n    }\n\n    /**\n     * 描述文档的分块信息\n     *\n     * @param documentId 文档ID\n     * @param marker     分页标记\n     * @param maxKeys    返回的最大分块数量\n     * @param type       分块类型\n     * @return 返回包含文档分块信息的ChunksDescribeResponse对象\n     * @throws IOException             如果发生I/O异常\n     * @throws AppBuilderServerException 如果发生AppBuilder服务器异常\n     */\n    public ChunksDescribeResponse describeChunks(String documentId, String marker, Integer maxKeys,\n            String type) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.CHUNKS_DESCRIBE_URL;\n\n        ChunksDescribeRequest request = new ChunksDescribeRequest(documentId, marker, maxKeys, type);\n        if (!this.knowledgeBaseId.isEmpty()) {\n            request.setKnowledgeBaseId(this.knowledgeBaseId);\n        }\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<ChunksDescribeResponse> response = httpClient.execute(postRequest, ChunksDescribeResponse.class);\n        ChunksDescribeResponse respBody = response.getBody();\n        return respBody;\n    }\n\n    public ChunksDescribeResponse describeChunks(ChunksDescribeRequest request)\n            throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.CHUNKS_DESCRIBE_URL;\n\n        if (!this.knowledgeBaseId.isEmpty()) {\n            request.setKnowledgeBaseId(this.knowledgeBaseId);\n        }\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<ChunksDescribeResponse> response = httpClient.execute(postRequest, ChunksDescribeResponse.class);\n        ChunksDescribeResponse respBody = response.getBody();\n        return respBody;\n    }\n\n    public QueryKnowledgeBaseResponse queryKnowledgeBase(QueryKnowledgeBaseRequest request)\n            throws IOException, AppBuilderServerException {\n        if (request.getRank_score_threshold() == null) {\n            request.setRank_score_threshold(0.4f);\n        }\n        String url = AppBuilderConfig.QUERY_KNOWLEDGEBASE_URL;\n\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<QueryKnowledgeBaseResponse> response = httpClient.execute(postRequest,\n                QueryKnowledgeBaseResponse.class);\n        QueryKnowledgeBaseResponse respBody = response.getBody();\n        return respBody;\n    }\n\n    public QueryKnowledgeBaseResponse queryKnowledgeBase(String query, String type, Integer top, Integer skip,\n            String[] knowledgebaseIDs, QueryKnowledgeBaseRequest.MetadataFilters filters,\n            QueryKnowledgeBaseRequest.QueryPipelineConfig pipelineConfig) \n            throws IOException, AppBuilderServerException {\n                \n        float rank_score_threshold = 0.4f;\n\n        String url = AppBuilderConfig.QUERY_KNOWLEDGEBASE_URL;\n        QueryKnowledgeBaseRequest request = new QueryKnowledgeBaseRequest(query, type, rank_score_threshold, top, skip, knowledgebaseIDs, filters, pipelineConfig);\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<QueryKnowledgeBaseResponse> response = httpClient.execute(postRequest,\n                QueryKnowledgeBaseResponse.class);\n        QueryKnowledgeBaseResponse respBody = response.getBody();\n        return respBody;\n    }\n    \n    public QueryKnowledgeBaseResponse queryKnowledgeBase(String query, String type, Float rank_score_threshold, Integer top, Integer skip,\n            String[] knowledgebaseIDs, QueryKnowledgeBaseRequest.MetadataFilters filters,\n            QueryKnowledgeBaseRequest.QueryPipelineConfig pipelineConfig) \n            throws IOException, AppBuilderServerException {\n        if (rank_score_threshold == null) {\n            rank_score_threshold = 0.4f;\n        }\n\n        String url = AppBuilderConfig.QUERY_KNOWLEDGEBASE_URL;\n        QueryKnowledgeBaseRequest request = new QueryKnowledgeBaseRequest(query, type, rank_score_threshold, top, skip, knowledgebaseIDs, filters, pipelineConfig);\n        String jsonBody = JsonUtils.serialize(request);\n        ClassicHttpRequest postRequest = httpClient.createPostRequestV2(url,\n                new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<QueryKnowledgeBaseResponse> response = httpClient.execute(postRequest,\n                QueryKnowledgeBaseResponse.class);\n        QueryKnowledgeBaseResponse respBody = response.getBody();\n        return respBody;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/console/rag/RAG.java",
    "content": "package com.baidubce.appbuilder.console.rag;\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport com.baidubce.appbuilder.base.component.Component;\nimport com.baidubce.appbuilder.base.config.AppBuilderConfig;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\nimport com.baidubce.appbuilder.model.rag.RAGIterator;\nimport com.baidubce.appbuilder.model.rag.RAGResponse;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.json.JsonUtils;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\n\npublic class RAG extends Component {\n    public String appID;\n\n    public RAG(String appID) {\n        super();\n        this.appID = appID;\n    }\n\n    public RAG(String appID, String secretKey) {\n        super(secretKey);\n        this.appID = appID;\n    }\n\n    public RAG(String appID, String secretKey, String gateway) {\n        super(secretKey, gateway);\n        this.appID = appID;\n    }\n\n    /**\n     * 运行RAG模型，根据输入的问题、会话ID以及是否以流模式返回结果，返回RAGResponse的迭代器。\n     *\n     * @param query          问题\n     * @param conversationId 会话ID\n     * @param stream         是否以流模式返回结果\n     * @return RAGResponse的迭代器\n     * @throws IOException               当请求失败时抛出IOException\n     * @throws AppBuilderServerException 当服务器返回错误码时抛出AppBuilderServerException\n     */\n    public RAGIterator run(String query, String conversationId, boolean stream) throws IOException, AppBuilderServerException {\n        String url = AppBuilderConfig.RAG_RUN_URL;\n        if (this.appID == null || this.appID.isEmpty()) {\n            throw new RuntimeException(\"Param 'appID' is required!\");\n        }\n        Map<String, Object> requestBody = new HashMap<>();\n        requestBody.put(\"app_id\", this.appID);\n        requestBody.put(\"query\", query);\n        requestBody.put(\"conversation_id\", conversationId);\n        requestBody.put(\"response_mode\", stream ? \"streaming\" : \"blocking\");\n        String jsonBody = JsonUtils.serialize(requestBody);\n        ClassicHttpRequest postRequest = httpClient.createPostRequest(url, new StringEntity(jsonBody, StandardCharsets.UTF_8));\n        postRequest.setHeader(\"Content-Type\", \"application/json\");\n        HttpResponse<StreamIterator<RAGResponse>> response = httpClient.executeSSE(postRequest, RAGResponse.class);\n        return new RAGIterator(response);\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/agentbuilder/AgentBuilderIterator.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\nimport java.util.stream.IntStream;\n\npublic class AgentBuilderIterator {\n    private final StreamIterator<AgentBuilderResponse> iterator;\n\n    public AgentBuilderIterator(StreamIterator<AgentBuilderResponse> iterator) {\n        this.iterator = iterator;\n    }\n\n    public boolean hasNext() {\n        return iterator.hasNext();\n    }\n\n    public AgentBuilderResult next() {\n        AgentBuilderResponse response = iterator.next();\n        Event[] events = new Event[response.getContent().length];\n        EventContent[] contents = response.getContent();\n        IntStream.range(0, contents.length).forEach(i -> {\n            events[i] = new Event()\n                    .setCode(contents[i].getEventCode())\n                    .setMessage(contents[i].getEnentMessage())\n                    .setStatus(contents[i].getEventStatus())\n                    .setEventType(contents[i].getEventType())\n                    .setContentType(contents[i].getContentType())\n                    .setDetail(contents[i].getOutputs());\n        });\n        return new AgentBuilderResult()\n                .setAnswer(response.getAnswer())\n                .setEvents(events);\n    }\n\n    public void close(){\n        iterator.close();\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/agentbuilder/AgentBuilderResponse.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.Arrays;\n\npublic class AgentBuilderResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n    private String data;\n    private String answer;\n    @SerializedName(\"conversation_id\")\n    private String conversationId;\n    @SerializedName(\"message_id\")\n    private String messageId;\n    @SerializedName(\"is_completion\")\n    private boolean isCompletion;\n    private EventContent[] content;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getData() {\n        return data;\n    }\n\n    public void setData(String data) {\n        this.data = data;\n    }\n\n    public String getAnswer() {\n        return answer;\n    }\n\n    public void setAnswer(String answer) {\n        this.answer = answer;\n    }\n\n    public String getConversationId() {\n        return conversationId;\n    }\n\n    public void setConversationId(String conversationId) {\n        this.conversationId = conversationId;\n    }\n\n    public String getMessageId() {\n        return messageId;\n    }\n\n    public void setMessageId(String messageId) {\n        this.messageId = messageId;\n    }\n\n    public boolean isCompletion() {\n        return isCompletion;\n    }\n\n    public void setCompletion(boolean completion) {\n        isCompletion = completion;\n    }\n\n    public EventContent[] getContent() {\n        return content;\n    }\n\n    public void setContent(EventContent[] content) {\n        this.content = content;\n    }\n\n    @Override\n    public String toString() {\n        return \"AgentBuilderResponse{\" +\n                \"requestId='\" + requestId + '\\'' +\n                \", data='\" + data + '\\'' +\n                \", answer='\" + answer + '\\'' +\n                \", conversationId='\" + conversationId + '\\'' +\n                \", messageId='\" + messageId + '\\'' +\n                \", isCompletion=\" + isCompletion +\n                \", content=\" + Arrays.toString(content) +\n                '}';\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/agentbuilder/AgentBuilderResult.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\n\nimport java.util.Arrays;\n\npublic class AgentBuilderResult {\n    private String answer;\n    private Event[] events;\n\n    public String getAnswer() {\n        return answer;\n    }\n\n    public AgentBuilderResult setAnswer(String answer) {\n        this.answer = answer;\n        return this;\n    }\n\n    public Event[] getEvents() {\n        return events;\n    }\n\n    public AgentBuilderResult setEvents(Event[] events) {\n        this.events = events;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"AgentBuilderResult{\" +\n                \"answer='\" + answer + '\\'' +\n                \", events=\" + Arrays.toString(events) +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/agentbuilder/ConversationResponse.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class ConversationResponse {\n    private String requestId;\n\n    @SerializedName(\"conversation_id\")\n    private String conversationId;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getConversationId() {\n        return conversationId;\n    }\n\n    public void setConversationId(String conversationId) {\n        this.conversationId = conversationId;\n    }\n\n    @Override\n    public String toString() {\n        return \"ConversationResponse{\" +\n                \"requestId='\" + requestId + '\\'' +\n                \", conversationId='\" + conversationId + '\\'' +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/agentbuilder/Event.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport java.util.Map;\n\npublic class Event {\n    private String code;\n    private String message;\n    private String eventType;\n    private String status;\n    private String contentType;\n    private Map<String, Object> detail;\n\n    public String getCode() {\n        return code;\n    }\n\n    public Event setCode(String code) {\n        this.code = code;\n        return this;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public Event setMessage(String message) {\n        this.message = message;\n        return this;\n    }\n\n    public String getEventType() {\n        return eventType;\n    }\n\n    public Event setEventType(String eventType) {\n        this.eventType = eventType;\n        return this;\n    }\n\n    public String getStatus() {\n        return status;\n    }\n\n    public Event setStatus(String status) {\n        this.status = status;\n        return this;\n    }\n\n    public String getContentType() {\n        return contentType;\n    }\n\n    public Event setContentType(String contentType) {\n        this.contentType = contentType;\n        return this;\n    }\n\n    public Map<String, Object> getDetail() {\n        return detail;\n    }\n\n    public Event setDetail(Map<String, Object> detail) {\n        this.detail = detail;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"Event{\" +\n                \"code='\" + code + '\\'' +\n                \", message='\" + message + '\\'' +\n                \", eventType='\" + eventType + '\\'' +\n                \", status='\" + status + '\\'' +\n                \", contentType='\" + contentType + '\\'' +\n                \", detail=\" + detail +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/agentbuilder/EventContent.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class EventContent {\n    @SerializedName(\"event_code\")\n    private String eventCode;\n    @SerializedName(\"event_message\")\n    private String enentMessage;\n    @SerializedName(\"event_type\")\n    private String eventType;\n    @SerializedName(\"event_id\")\n    private String eventId;\n    @SerializedName(\"event_status\")\n    private String eventStatus;\n    @SerializedName(\"content_type\")\n    private String contentType;\n    private Map<String, Object> outputs;\n\n    public String getEventCode() {\n        return eventCode;\n    }\n\n    public void setEventCode(String eventCode) {\n        this.eventCode = eventCode;\n    }\n\n    public String getEnentMessage() {\n        return enentMessage;\n    }\n\n    public void setEnentMessage(String enentMessage) {\n        this.enentMessage = enentMessage;\n    }\n\n    public String getEventType() {\n        return eventType;\n    }\n\n    public void setEventType(String eventType) {\n        this.eventType = eventType;\n    }\n\n    public String getEventId() {\n        return eventId;\n    }\n\n    public void setEventId(String eventId) {\n        this.eventId = eventId;\n    }\n\n    public String getEventStatus() {\n        return eventStatus;\n    }\n\n    public void setEventStatus(String eventStatus) {\n        this.eventStatus = eventStatus;\n    }\n\n    public String getContentType() {\n        return contentType;\n    }\n\n    public void setContentType(String contentType) {\n        this.contentType = contentType;\n    }\n\n    public Map<String, Object> getOutputs() {\n        return outputs;\n    }\n\n    public void setOutputs(Map<String, Object> outputs) {\n        this.outputs = outputs;\n    }\n\n    @Override\n    public String toString() {\n        return \"EventContent{\" +\n                \"eventCode='\" + eventCode + '\\'' +\n                \", enentMessage='\" + enentMessage + '\\'' +\n                \", eventType='\" + eventType + '\\'' +\n                \", eventId='\" + eventId + '\\'' +\n                \", eventStatus='\" + eventStatus + '\\'' +\n                \", contentType='\" + contentType + '\\'' +\n                \", outputs=\" + outputs +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/agentbuilder/FileUploadResponse.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class FileUploadResponse {\n    private String requestId;\n    @SerializedName(\"id\")\n    private String fileId;\n    @SerializedName(\"conversation_id\")\n    private String conversationId;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getFileId() {\n        return fileId;\n    }\n\n    @Override\n    public String toString() {\n        return \"FileUploadResponse{\" +\n                \"requestId='\" + requestId + '\\'' +\n                \", fileId='\" + fileId + '\\'' +\n                \", conversationId='\" + conversationId + '\\'' +\n                '}';\n    }\n\n    public void setFileId(String fileId) {\n        this.fileId = fileId;\n    }\n\n    public String getConversationId() {\n        return conversationId;\n    }\n\n    public void setConversationId(String conversationId) {\n        this.conversationId = conversationId;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/aisearch/AISearchIterator.java",
    "content": "package com.baidubce.appbuilder.model.aisearch;\n\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\n\npublic class AISearchIterator {\n        private final StreamIterator<AISearchResponse> iterator;\n\n    public AISearchIterator(StreamIterator<AISearchResponse> iterator) {\n        this.iterator = iterator;\n    }\n\n    public boolean hasNext() {\n        return iterator.hasNext();\n    }\n\n    public AISearchResponse next() {\n        return iterator.next();\n    }\n\n    public void close(){\n        iterator.close();\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/aisearch/AISearchRequest.java",
    "content": "package com.baidubce.appbuilder.model.aisearch;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class AISearchRequest {\n    // region 主字段\n    @SerializedName(\"messages\")\n    private Message[] messages;\n    @SerializedName(\"search_source\")\n    private String searchSource = \"baidu_search_v1\";\n    @SerializedName(\"resource_type_filter\")\n    private SearchResource[] resourceTypeFilter;\n    @SerializedName(\"search_filter\")\n    private SearchFilter searchFilter;\n    @SerializedName(\"search_recency_filter\")\n    private String searchRecencyFilter;\n    @SerializedName(\"search_domain_filter\")\n    private String[] searchDomainFilter;\n    @SerializedName(\"model\")\n    private String model;\n    @SerializedName(\"instruction\")\n    private String instruction = \"\";\n    @SerializedName(\"temperature\")\n    private Double temperature = 1e-10;\n    @SerializedName(\"top_p\")\n    private Double topP = 1e-10;\n    @SerializedName(\"prompt_template\")\n    private String promptTemplate;\n    @SerializedName(\"search_mode\")\n    private String searchMode = \"auto\";\n    @SerializedName(\"enable_reasoning\")\n    private Boolean enableReasoning = true;\n    @SerializedName(\"enable_deep_search\")\n    private Boolean enableDeepSearch = false;\n    @SerializedName(\"additional_knowledge\")\n    private Knowledge[] additionalKnowledge;\n    @SerializedName(\"max_completion_tokens\")\n    private Integer maxCompletionTokens = 2048;\n    @SerializedName(\"response_format\")\n    private String responseFormat = \"auto\";\n    @SerializedName(\"enable_corner_markers\")\n    private Boolean enableCornerMarkers = true;\n    @SerializedName(\"enable_followup_queries\")\n    private Boolean enableFollowupQueries = false;\n    @SerializedName(\"stream\")\n    private Boolean stream = false;\n    @SerializedName(\"safety_level\")\n    private String safetyLevel;\n    @SerializedName(\"max_refer_search_items\")\n    private Integer maxReferSearchItems = 100;\n    @SerializedName(\"config_id\")\n    private String configId = \"\";\n    @SerializedName(\"model_appid\")\n    private String modelAppid = \"\";\n\n    public static class Message {\n        @SerializedName(\"role\")\n        private String role;\n\n        @SerializedName(\"content\")\n        private Object content; // String or List<MessageContent>\n\n        public Message(String role, Object content) {\n            this.role = role;\n            this.content = content;\n        }\n        \n        public void setRole(String role) {\n            this.role = role;\n        }\n\n        public void setContent(Object content) {\n            this.content = content;\n        }\n\n        public String getRole() {\n            return role;\n        }\n\n        public Object getContent() {\n            return content;\n        }\n    }\n\n    public static class SearchResource {\n        @SerializedName(\"top_k\")\n        private int topK;\n\n        @SerializedName(\"type\")\n        private String type;\n\n        public SearchResource(int topK, String type) {\n            this.topK = topK;\n            this.type = type;\n        }\n\n        public int getTopK() {\n            return topK;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public void setTopK(int topK) {\n            this.topK = topK;\n        }\n\n        public void setType(String type) {\n            this.type = type;\n        }\n    }\n\n    public static class SearchFilter {\n        @SerializedName(\"range\")\n        private Range range;\n\n        @SerializedName(\"match\")\n        private Match match;\n\n        public SearchFilter(Range range, Match match) {\n            this.range = range;\n            this.match = match;\n        }\n\n        public Range getRange() {\n            return range;\n        }\n\n        public Match getMatch() {\n            return match;\n        }\n\n        public void setRange(Range range) {\n            this.range = range;\n        }\n\n        public void setMatch(Match match) {\n            this.match = match;\n        }\n    }\n\n    public static class Range {\n        @SerializedName(\"page_time\")\n        private PageTime pageTime;\n        \n        public Range(PageTime pageTime) {\n            this.pageTime = pageTime;\n        }\n\n        public PageTime getPageTime() {\n            return pageTime;\n        }\n\n        public void setPageTime(PageTime pageTime) {\n            this.pageTime = pageTime;\n        }\n    }\n\n    public static class PageTime {\n        @SerializedName(\"gth\")\n        private String gth = \"\";\n        @SerializedName(\"gt\")\n        private String gt = \"\";\n        @SerializedName(\"lth\")\n        private String lth = \"\";\n        @SerializedName(\"lt\")\n        private String lt = \"\";\n\n        public PageTime(String gth, String gt, String lth, String lt) {\n            this.gth = gth;\n            this.gt = gt;\n            this.lth = lth;\n            this.lt = lt;\n        }\n\n\n        public String getGth() {\n            return gth;\n        }\n\n        public String getGt() {\n            return gt;\n        }\n\n        public String getLth() {\n            return lth;\n        }\n\n        public String getLt() {\n            return lt;\n        }\n\n        public void setGth(String gth) {\n            this.gth = gth;\n        }\n\n        public void setGt(String gt) {\n            this.gt = gt;\n        }\n\n        public void setLth(String lth) {\n            this.lth = lth;\n        }\n\n        public void setLt(String lt) {\n            this.lt = lt;\n        }\n    }\n\n    public static class Match {\n        @SerializedName(\"site\")\n        private String[] site;\n\n        public Match(String[] site) {\n            this.site = site;\n        }\n\n        public String[] getSite() {\n            return site;\n        }\n\n        public void setSite(String[] site) {\n            this.site = site;\n        }\n    }\n\n    public static class Knowledge {\n        @SerializedName(\"priority\")\n        private Integer priority = 0;\n\n        @SerializedName(\"data_type\")\n        private String dataType;\n\n        @SerializedName(\"data\")\n        private KnowledgeData data;\n\n        public Knowledge(Integer priority, String dataType, KnowledgeData data) {\n            this.priority = priority;\n            this.dataType = dataType;\n            this.data = data;\n        }\n\n        public Integer getPriority() {\n            return priority;\n        }\n\n        public String getDataType() {\n            return dataType;\n        }\n\n        public KnowledgeData getData() {\n            return data;\n        }\n\n        public void setPriority(Integer priority) {\n            this.priority = priority;\n        }\n\n        public void setDataType(String dataType) {\n            this.dataType = dataType;\n        }\n\n        public void setData(KnowledgeData data) {\n            this.data = data;\n        }\n    }\n\n    public static class KnowledgeData {\n        @SerializedName(\"content\")\n        private String content;\n\n        @SerializedName(\"title\")\n        private String title;\n\n        @SerializedName(\"url\")\n        private String url;\n\n        @SerializedName(\"release_date\")\n        private String releaseDate;\n\n        public KnowledgeData(String content, String title, String url, String releaseDate) {\n            this.content = content;\n            this.title = title;\n            this.url = url;\n            this.releaseDate = releaseDate;\n        }\n\n        public String getContent() {\n            return content;\n        }\n\n        public String getTitle() {\n            return title;\n        }\n\n        public String getUrl() {\n            return url;\n        }\n\n        public String getReleaseDate() {\n            return releaseDate;\n        }\n\n        public void setContent(String content) {\n            this.content = content;\n        }\n\n        public void setTitle(String title) {\n            this.title = title;\n        }\n\n        public void setUrl(String url) {\n            this.url = url;\n        }\n\n        public void setReleaseDate(String releaseDate) {\n            this.releaseDate = releaseDate;\n        }\n    }\n\n\n    public Message[] getMessages() {\n        return messages;\n    }\n\n    public AISearchRequest setMessages(Message[] messages) {\n        this.messages = messages;\n        return this;\n    }\n\n    public String getSearchSource() {\n        return searchSource;\n    }\n\n    public AISearchRequest setSearchSource(String searchSource) {\n        this.searchSource = searchSource;\n        return this;\n    }\n\n    public SearchResource[] getResourceTypeFilter() {\n        return resourceTypeFilter;\n    }\n\n    public AISearchRequest setResourceTypeFilter(SearchResource[] resourceTypeFilter) {\n        this.resourceTypeFilter = resourceTypeFilter;\n        return this;\n    }\n\n    public SearchFilter getSearchFilter() {\n        return searchFilter;\n    }\n\n    public AISearchRequest setSearchFilter(SearchFilter searchFilter) {\n        this.searchFilter = searchFilter;\n        return this;\n    }\n\n    public String getSearchRecencyFilter() {\n        return searchRecencyFilter;\n    }\n\n    public AISearchRequest setSearchRecencyFilter(String searchRecencyFilter) {\n        this.searchRecencyFilter = searchRecencyFilter;\n        return this;\n    }\n\n    public String[] getSearchDomainFilter() {\n        return searchDomainFilter;\n    }\n\n    public AISearchRequest setSearchDomainFilter(String[] searchDomainFilter) {\n        this.searchDomainFilter = searchDomainFilter;\n        return this;\n    }\n\n    public String getModel() {\n        return model;\n    }\n\n    public AISearchRequest setModel(String model) {\n        this.model = model;\n        return this;\n    }\n\n    public String getInstruction() {\n        return instruction;\n    }\n\n    public AISearchRequest setInstruction(String instruction) {\n        this.instruction = instruction;\n        return this;\n    }\n\n    public Double getTemperature() {\n        return temperature;\n    }\n\n    public AISearchRequest setTemperature(Double temperature) {\n        this.temperature = temperature;\n        return this;\n    }\n\n    public Double getTopP() {\n        return topP;\n    }\n\n    public AISearchRequest setTopP(Double topP) {\n        this.topP = topP;\n        return this;\n    }\n\n    public String getPromptTemplate() {\n        return promptTemplate;\n    }\n\n    public AISearchRequest setPromptTemplate(String promptTemplate) {\n        this.promptTemplate = promptTemplate;\n        return this;\n    }\n\n    public String getSearchMode() {\n        return searchMode;\n    }\n\n    public AISearchRequest setSearchMode(String searchMode) {\n        this.searchMode = searchMode;\n        return this;\n    }\n\n    public Boolean getEnableReasoning() {\n        return enableReasoning;\n    }\n\n    public AISearchRequest setEnableReasoning(Boolean enableReasoning) {\n        this.enableReasoning = enableReasoning;\n        return this;\n    }\n\n    public Boolean getEnableDeepSearch() {\n        return enableDeepSearch;\n    }\n\n    public AISearchRequest setEnableDeepSearch(Boolean enableDeepSearch) {\n        this.enableDeepSearch = enableDeepSearch;\n        return this;\n    }\n\n    public Knowledge[] getAdditionalKnowledge() {\n        return additionalKnowledge;\n    }\n\n    public AISearchRequest setAdditionalKnowledge(Knowledge[] additionalKnowledge) {\n        this.additionalKnowledge = additionalKnowledge;\n        return this;\n    }\n\n    public Integer getMaxCompletionTokens() {\n        return maxCompletionTokens;\n    }\n\n    public AISearchRequest setMaxCompletionTokens(Integer maxCompletionTokens) {\n        this.maxCompletionTokens = maxCompletionTokens;\n        return this;\n    }\n\n    public String getResponseFormat() {\n        return responseFormat;\n    }\n\n    public AISearchRequest setResponseFormat(String responseFormat) {\n        this.responseFormat = responseFormat;\n        return this;\n    }\n\n    public Boolean getEnableCornerMarkers() {\n        return enableCornerMarkers;\n    }\n\n    public AISearchRequest setEnableCornerMarkers(Boolean enableCornerMarkers) {\n        this.enableCornerMarkers = enableCornerMarkers;\n        return this;\n    }\n\n    public Boolean getEnableFollowupQueries() {\n        return enableFollowupQueries;\n    }\n\n    public AISearchRequest setEnableFollowupQueries(Boolean enableFollowupQueries) {\n        this.enableFollowupQueries = enableFollowupQueries;\n        return this;\n    }\n\n    public Boolean getStream() {\n        return stream;\n    }\n\n    public AISearchRequest setStream(Boolean stream) {\n        this.stream = stream;\n        return this;\n    }\n\n    public String getSafetyLevel() {\n        return safetyLevel;\n    }\n\n    public AISearchRequest setSafetyLevel(String safetyLevel) {\n        this.safetyLevel = safetyLevel;\n        return this;\n    }\n\n    public Integer getMaxReferSearchItems() {\n        return maxReferSearchItems;\n    }\n\n    public AISearchRequest setMaxReferSearchItems(Integer maxReferSearchItems) {\n        this.maxReferSearchItems = maxReferSearchItems;\n        return this;\n    }\n\n    public String getConfigId() {\n        return configId;\n    }\n\n    public AISearchRequest setConfigId(String configId) {\n        this.configId = configId;\n        return this;\n    }\n\n    public String getModelAppid() {\n        return modelAppid;\n    }\n\n    public AISearchRequest setModelAppid(String modelAppid) {\n        this.modelAppid = modelAppid;\n        return this;\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/aisearch/AISearchResponse.java",
    "content": "package com.baidubce.appbuilder.model.aisearch;\n\nimport com.google.gson.annotations.SerializedName;\nimport java.util.List;\n\npublic class AISearchResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n\n    @SerializedName(\"is_safe\")\n    private Boolean isSafe;\n\n    private List<Choice> choices;\n\n    private String code;\n\n    private String message;\n\n    private Usage usage;\n\n    private List<Reference> references;\n\n    @SerializedName(\"followup_queries\")\n    private List<String> followupQueries;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public AISearchResponse setRequestId(String requestId) {\n        this.requestId = requestId;\n        return this;\n    }\n\n    public Boolean getIsSafe() {\n        return isSafe;\n    }\n\n    public AISearchResponse setIsSafe(Boolean isSafe) {\n        this.isSafe = isSafe;\n        return this;\n    }\n\n    public List<Choice> getChoices() {\n        return choices;\n    }\n\n    public AISearchResponse setChoices(List<Choice> choices) {\n        this.choices = choices;\n        return this;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public AISearchResponse setCode(String code) {\n        this.code = code;\n        return this;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public AISearchResponse setMessage(String message) {\n        this.message = message;\n        return this;\n    }\n\n    public Usage getUsage() {\n        return usage;\n    }\n\n    public AISearchResponse setUsage(Usage usage) {\n        this.usage = usage;\n        return this;\n    }\n\n    public List<Reference> getReferences() {\n        return references;\n    }\n\n    public AISearchResponse setReferences(List<Reference> references) {\n        this.references = references;\n        return this;\n    }\n\n    public List<String> getFollowupQueries() {\n        return followupQueries;\n    }\n\n    public AISearchResponse setFollowupQueries(List<String> followupQueries) {\n        this.followupQueries = followupQueries;\n        return this;\n    }\n\n    // region 内部类\n    public static class Usage {\n        @SerializedName(\"completion_tokens\")\n        private Integer completionTokens;\n\n        @SerializedName(\"prompt_tokens\")\n        private Integer promptTokens;\n\n        @SerializedName(\"total_tokens\")\n        private Integer totalTokens;\n        // getters/setters\n        public Integer getCompletionTokens() {\n            return completionTokens;\n        }\n\n        public Usage setCompletionTokens(Integer completionTokens) {\n            this.completionTokens = completionTokens;\n            return this;\n        }\n\n        public Integer getPromptTokens() {\n            return promptTokens;\n        }\n\n        public Usage setPromptTokens(Integer promptTokens) {\n            this.promptTokens = promptTokens;\n            return this;\n        }\n\n        public Integer getTotalTokens() {\n            return totalTokens;\n        }\n\n        public Usage setTotalTokens(Integer totalTokens) {\n            this.totalTokens = totalTokens;\n            return this;\n        }\n    }\n\n    public static class VideoDetail {\n        private String url;\n        private String height;\n        private String width;\n        private String size;\n        private String duration;\n\n        @SerializedName(\"hover_pic\")\n        private String hoverPic;\n        // getters/setters\n        public String getUrl() {\n            return url;\n        }\n\n        public VideoDetail setUrl(String url) {\n            this.url = url;\n            return this;\n        }\n\n        public String getHeight() {\n            return height;\n        }\n\n        public VideoDetail setHeight(String height) {\n            this.height = height;\n            return this;\n        }\n\n        public String getWidth() {\n            return width;\n        }\n\n        public VideoDetail setWidth(String width) {\n            this.width = width;\n            return this;\n        }\n\n        public String getSize() {\n            return size;\n        }\n\n        public VideoDetail setSize(String size) {\n            this.size = size;\n            return this;\n        }\n\n        public String getDuration() {\n            return duration;\n        }\n\n        public VideoDetail setDuration(String duration) {\n            this.duration = duration;\n            return this;\n        }\n\n        @SerializedName(\"hover_pic\")\n        public String getHoverPic() {\n            return hoverPic;\n        }\n\n        public VideoDetail setHoverPic(String hoverPic) {\n            this.hoverPic = hoverPic;\n            return this;\n        }\n    }\n\n    public static class ImageDetail {\n        private String url;\n        private String height;\n        private String width;\n        // getters/setters\n        public String getUrl() {\n            return url;\n        }\n\n        public ImageDetail setUrl(String url) {\n            this.url = url;\n            return this;\n        }\n\n        public String getHeight() {\n            return height;\n        }\n\n        public ImageDetail setHeight(String height) {\n            this.height = height;\n            return this;\n        }\n\n        public String getWidth() {\n            return width;\n        }\n\n        public ImageDetail setWidth(String width) {\n            this.width = width;\n            return this;\n        }\n    }\n\n    public static class Reference {\n        private Integer id;\n\n        private String title;\n\n        private String url;\n\n        @SerializedName(\"web_anchor\")\n        private String webAnchor;\n        private String icon;\n        private String content;\n        private String date;\n        private String type;\n        private ImageDetail image;\n        private VideoDetail video;\n        // getters/setters\n\n        public Integer getId() {\n            return id;\n        }\n\n        public Reference setId(Integer id) {\n            this.id = id;\n            return this;\n        }\n\n        public String getTitle() {\n            return title;\n        }\n\n        public Reference setTitle(String title) {\n            this.title = title;\n            return this;\n        }\n\n        public String getUrl() {\n            return url;\n        }\n\n        public Reference setUrl(String url) {\n            this.url = url;\n            return this;\n        }\n\n        public String getWebAnchor() {\n            return webAnchor;\n        }\n\n        public Reference setWebAnchor(String webAnchor) {\n            this.webAnchor = webAnchor;\n            return this;\n        }\n\n        public String getIcon() {\n            return icon;\n        }\n\n        public Reference setIcon(String icon) {\n            this.icon = icon;\n            return this;\n        }\n\n        public String getContent() {\n            return content;\n        }\n\n        public Reference setContent(String content) {\n            this.content = content;\n            return this;\n        }\n\n        public String getDate() {\n            return date;\n        }\n\n        public Reference setDate(String date) {\n            this.date = date;\n            return this;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public Reference setType(String type) {\n            this.type = type;\n            return this;\n        }\n\n        public ImageDetail getImage() {\n            return image;\n        }\n\n        public Reference setImage(ImageDetail image) {\n            this.image = image;\n            return this;\n        }\n\n        public VideoDetail getVideo() {\n            return video;\n        }\n\n        public Reference setVideo(VideoDetail video) {\n            this.video = video;\n            return this;\n        }\n    }\n\n    public static class Delta {\n        private String content;\n\n        private String role;\n\n        @SerializedName(\"reasoning_content\")\n        private String reasoningContent;\n        // getters/setters\n\n        public Delta setContent(String content) {\n            this.content = content;\n            return this;\n        }\n\n        public String getContent() {\n            return content;\n        }\n\n        public String getRole() {\n            return role;\n        }\n\n        public Delta setRole(String role) {\n            this.role = role;\n            return this;\n        }\n\n        public String getReasoningContent() {\n            return reasoningContent;\n        }\n\n        public Delta setReasoningContent(String reasoningContent) {\n            this.reasoningContent = reasoningContent;\n            return this;\n        }\n    }\n\n    public static class ChoiceMessage {\n        private String content;\n\n        private String role;\n\n        @SerializedName(\"reasoning_content\")\n        private String reasoningContent;\n\n        public String getContent() {\n            return content;\n        }\n\n        public ChoiceMessage setContent(String content) {\n            this.content = content;\n            return this;\n        }\n\n        public String getRole() {\n            return role;\n        }\n\n        public ChoiceMessage setRole(String role) {\n            this.role = role;\n            return this;\n        }\n\n        public String getReasoningContent() {\n            return reasoningContent;\n        }\n\n        public ChoiceMessage setReasoningContent(String reasoningContent) {\n            this.reasoningContent = reasoningContent;\n            return this;\n        }\n    }\n\n    public static class Choice {\n        private int index;\n\n        @SerializedName(\"finish_reason\")\n        private String finishReason;\n\n        private ChoiceMessage message;\n        private Delta delta;\n        \n        public int getIndex() {\n            return index;\n        }\n\n        public Choice setIndex(int index) {\n            this.index = index;\n            return this;\n        }\n\n        public String getFinishReason() {\n            return finishReason;\n        }\n\n        public Choice setFinishReason(String finishReason) {\n            this.finishReason = finishReason;\n            return this;\n        }\n\n        public ChoiceMessage getMessage() {\n            return message;\n        }\n\n        public Choice setMessage(ChoiceMessage message) {\n            this.message = message;\n            return this;\n        }\n\n        public Delta getDelta() {\n            return delta;\n        }\n\n        public Choice setDelta(Delta delta) {\n            this.delta = delta;\n            return this;\n        }\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/App.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\npublic class App {\n    private String id;\n    private String name;\n    private String description;\n    private String appType;\n    private boolean isPublic;\n    private Integer updateTime;\n\n    // getters\n    public String getId() {\n        return id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public String getDescription() {\n        return description;\n    }\n\n    // setters\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public void setDescription(String description) {\n        this.description = description;\n    }\n\n    public String getAppType() {\n        return appType;\n    }\n\n    public void setAppType(String appType) {\n        this.appType = appType;\n    }\n\n    public boolean isPublic() {\n        return isPublic;\n    }\n\n    public void setPublic(boolean aPublic) {\n        isPublic = aPublic;\n    }\n\n    public Integer getUpdateTime() {\n        return updateTime;\n    }\n\n    public void setUpdateTime(Integer updateTime) {\n        this.updateTime = updateTime;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppBuilderClientFeedbackRequest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class AppBuilderClientFeedbackRequest {\n    @SerializedName(\"app_id\")\n    private String appId;\n    @SerializedName(\"conversation_id\")\n    private String conversationId;\n    @SerializedName(\"message_id\")\n    private String messageId;\n    private String type;\n    private String[] flag;\n    private String reason;\n\n    public AppBuilderClientFeedbackRequest(String appId, String conversationId, String messageId, String type,\n            String[] flag, String reason) {\n        this.appId = appId;\n        this.conversationId = conversationId;\n        this.messageId = messageId;\n        this.type = type;\n        this.flag = flag;\n        this.reason = reason;\n    }\n\n    public String getAppId() {\n        return appId;\n    }\n\n    public void setAppId(String appId) {\n        this.appId = appId;\n    }\n\n    public String getConversationId() {\n        return conversationId;\n    }\n\n    public void setConversationId(String conversationId) {\n        this.conversationId = conversationId;\n    }\n\n    public String getMessageId() {\n        return messageId;\n    }\n\n    public void setMessageId(String messageId) {\n        this.messageId = messageId;\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n\n    public String[] getFlag() {\n        return flag;\n    }\n\n    public void setFlag(String[] flag) {\n        this.flag = flag;\n    }\n\n    public String getReason() {\n        return reason;\n    }\n\n    public void setReason(String reason) {\n        this.reason = reason;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppBuilderClientFeedbackResponse.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class AppBuilderClientFeedbackResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n    private String code;\n    private String message;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppBuilderClientIterator.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\nimport java.util.stream.IntStream;\n\npublic class AppBuilderClientIterator {\n    private final StreamIterator<AppBuilderClientResponse> iterator;\n\n    public AppBuilderClientIterator(StreamIterator<AppBuilderClientResponse> iterator) {\n        this.iterator = iterator;\n    }\n\n    public boolean hasNext() {\n        return iterator.hasNext();\n    }\n\n    public AppBuilderClientResult next() {\n        AppBuilderClientResponse response = iterator.next();\n        if(response.getContent() == null) {\n            return new AppBuilderClientResult().setAnswer(response.getAnswer()).setMessageId(response.getMessageId()).setRequestId(response.getRequestId()).setCode(response.getCode()).setMessage(response.getMessage());\n        }\n        Event[] events = new Event[response.getContent().length];\n        EventContent[] contents = response.getContent();\n        IntStream.range(0, contents.length).forEach(i -> {\n            events[i] = new Event().setCode(contents[i].getEventCode())\n                    .setMessage(contents[i].getEnentMessage())\n                    .setStatus(contents[i].getEventStatus())\n                    .setEventType(contents[i].getEventType())\n                    .setContentType(contents[i].getContentType())\n                    .setDetail(contents[i].getOutputs()).setUsage(contents[i].getUsage())\n                    .setToolCalls(contents[i].getToolCalls());\n        });\n        return new AppBuilderClientResult().setAnswer(response.getAnswer()).setMessageId(response.getMessageId()).setEvents(events).setRequestId(response.getRequestId());\n    }\n\n    public void close() {\n        iterator.close();\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppBuilderClientResponse.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.Arrays;\n\npublic class AppBuilderClientResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n    private String data;\n    private String date;\n    private String answer;\n    @SerializedName(\"conversation_id\")\n    private String conversationId;\n    @SerializedName(\"message_id\")\n    private String messageId;\n    @SerializedName(\"is_completion\")\n    private boolean isCompletion;\n    private EventContent[] content;\n    private String code;\n    private String message;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getData() {\n        return data;\n    }\n\n    public void setData(String data) {\n        this.data = data;\n    }\n\n    public String getAnswer() {\n        return answer;\n    }\n\n    public void setAnswer(String answer) {\n        this.answer = answer;\n    }\n\n    public String getConversationId() {\n        return conversationId;\n    }\n\n    public void setConversationId(String conversationId) {\n        this.conversationId = conversationId;\n    }\n\n    public String getMessageId() {\n        return messageId;\n    }\n\n    public void setMessageId(String messageId) {\n        this.messageId = messageId;\n    }\n\n    public boolean isCompletion() {\n        return isCompletion;\n    }\n\n    public void setCompletion(boolean completion) {\n        isCompletion = completion;\n    }\n\n    public EventContent[] getContent() {\n        return content;\n    }\n\n    public void setContent(EventContent[] content) {\n        this.content = content;\n    }\n\n    public String getDate() {\n        return date;\n    }\n\n    public void setDate(String date) {\n        this.date = date;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    @Override\n    public String toString() {\n        return \"AgentBuilderResponse{\" +\n                \"requestId='\" + requestId + '\\'' +\n                \", date='\" + date + '\\'' +\n                \", answer='\" + answer + '\\'' +\n                \", conversationId='\" + conversationId + '\\'' +\n                \", messageId='\" + messageId + '\\'' +\n                \", isCompletion=\" + isCompletion +\n                \", content=\" + Arrays.toString(content) +\n                '}';\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppBuilderClientResult.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\n\nimport java.util.Arrays;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class AppBuilderClientResult {\n    private String requestId;\n    private String answer;\n    @SerializedName(\"message_id\")\n    private String messageId;\n    private Event[] events;\n    private String code;\n    private String message;\n\n\n    public String getAnswer() {\n        return answer;\n    }\n\n    public AppBuilderClientResult setAnswer(String answer) {\n        this.answer = answer;\n        return this;\n    }\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public AppBuilderClientResult setRequestId(String requestId) {\n        this.requestId = requestId;\n        return this;\n    }\n\n    public String getMessageId() {\n        return messageId;\n    }\n\n    public AppBuilderClientResult setMessageId(String messageId) {\n        this.messageId = messageId;\n        return this;\n    }\n\n    public Event[] getEvents() {\n        return events;\n    }\n\n    public AppBuilderClientResult setEvents(Event[] events) {\n        this.events = events;\n        return this;\n    }\n\n\n    public String getCode() {\n        return code;\n    }\n\n    public AppBuilderClientResult setCode(String code) {\n        this.code = code;\n        return this;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public AppBuilderClientResult setMessage(String message) {\n        this.message = message;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"AppBuilderClientResult{\" +\n                \"answer='\" + answer + '\\'' +\n                \", events=\" + Arrays.toString(events) +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppBuilderClientRunRequest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport com.google.gson.Gson;\nimport com.google.gson.annotations.SerializedName;\n\npublic class AppBuilderClientRunRequest {\n    @SerializedName(\"app_id\")\n    private String appId;\n    private String query;\n    private boolean stream;\n    @SerializedName(\"conversation_id\")\n    private String conversationID;\n    @SerializedName(\"end_user_id\")\n    private String endUserId;\n    private Tool[] tools;\n    @SerializedName(\"tool_outputs\")\n    private ToolOutput[] ToolOutputs;\n    @SerializedName(\"tool_choice\")\n    private ToolChoice ToolChoice;\n    private Action action;\n    @SerializedName(\"mcp_authorization\")\n    private List<Map<String, Object>> mcpAuthorization = null;\n\n    private Map<String,Object> parameters;\n\n    @SerializedName(\"custom_metadata\")\n    private CustomMetadata customMetadata;\n\n    public AppBuilderClientRunRequest() {\n    }\n\n    public AppBuilderClientRunRequest(String appID) {\n        this.appId = appID;\n    }\n\n    public AppBuilderClientRunRequest(String appID, String conversationID) {\n        this.appId = appID;\n        this.conversationID = conversationID;\n    }\n\n    public AppBuilderClientRunRequest(String appID, String conversationID, String query, Boolean stream) {\n        this.appId = appID;\n        this.conversationID = conversationID;\n        this.query = query;\n        this.stream = stream;\n    }\n\n    public String getAppId() {\n        return appId;\n    }\n\n    public void setAppId(String appId) {\n        this.appId = appId;\n    }\n\n    public String getQuery() {\n        return query;\n    }\n\n    public void setQuery(String query) {\n        this.query = query;\n    }\n\n    public boolean isStream() {\n        return stream;\n    }\n\n    public void setStream(boolean stream) {\n        this.stream = stream;\n    }\n\n    public String getConversationID() {\n        return conversationID;\n    }\n\n    public void setConversationID(String conversationID) {\n        this.conversationID = conversationID;\n    }\n\n    public String getEndUserId() {\n        return endUserId;\n    }\n\n    public void setEndUserId(String endUserId) {\n        this.endUserId = endUserId;\n    }\n\n    public Tool[] getTools() {\n        return tools;\n    }\n\n    public void setTools(Tool[] tools) {\n        this.tools = tools;\n    }\n\n    public void setTools(String toolJson) {\n        Gson gson = new Gson();\n        Tool tool = gson.fromJson(toolJson, Tool.class);\n        this.tools = new Tool[] { tool };\n    }\n    \n    public void setTools(String[] toolJsons) {\n        Gson gson = new Gson();\n        this.tools = new Tool[toolJsons.length];\n        for (int i = 0; i < toolJsons.length; i++) {\n            Tool tool = gson.fromJson(toolJsons[i], Tool.class);\n            this.tools[i] = tool;\n        }\n    }\n\n    public ToolOutput[] getToolOutputs() {\n        return ToolOutputs;\n    }\n\n    public void setToolOutputs(ToolOutput[] toolOutputs) {\n        this.ToolOutputs = toolOutputs;\n    }\n\n    public void setToolOutputs(String toolCallID, String outputString) {\n        ToolOutput output = new ToolOutput(toolCallID, outputString);\n        this.ToolOutputs = new ToolOutput[] { output };\n    }\n\n    public ToolChoice getToolChoice() {\n        return ToolChoice;\n    }\n\n    public void setToolChoice(ToolChoice toolChoice) {\n        this.ToolChoice = toolChoice;\n    }\n\n    public Action getAction() {\n        return action;\n    }\n\n    public void setAction(Action action) {\n        this.action = action;\n    }\n\n    public AppBuilderClientRunRequest setMcpAuthorization(List<Map<String, Object>> mcpAuthorization) {\n        this.mcpAuthorization = mcpAuthorization;\n        return this;\n    }\n\n    public List<Map<String, Object>> getMcpAuthorization() {\n        return mcpAuthorization;\n    }\n\n    public Map<String, Object> getParameters() {\n        return parameters;\n    }\n\n    public void setParameters(Map<String, Object> parameters) {\n        this.parameters = parameters;\n    }\n\n    public void setCustomMetadata(CustomMetadata customMetadata) {\n        this.customMetadata = customMetadata;\n    }\n\n    public static class Tool {\n        private String type;\n        private Function function;\n\n        public Tool(String type, Function function) {\n            this.type = type;\n            this.function = function;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public Function getFunction() {\n            return function;\n        }\n\n\n        public static class Function {\n            private String name;\n            private String description;\n            private Map<String, Object> parameters;\n\n            public Function(String name, String description, Map<String, Object> parameters) {\n                this.name = name;\n                this.description = description;\n                this.parameters = parameters;\n            }\n\n            public String getName() {\n                return name;\n            }\n\n            public String getDescription() {\n                return description;\n            }\n\n            public Map<String, Object> getParameters() {\n                return parameters;\n            }\n        }\n    }\n\n    public static class ToolOutput {\n        @SerializedName(\"tool_call_id\")\n        private String toolCallID;\n        private String output;\n\n        public ToolOutput(String toolCallID, String output) {\n            this.toolCallID = toolCallID;\n            this.output = output;\n        }\n\n        public String getToolCallID() {\n            return toolCallID;\n        }\n\n        public String getOutput() {\n            return output;\n        }\n    }\n\n    public static class ToolChoice {\n        private String type;\n        private Function function;\n\n        public ToolChoice(String type, Function function) {\n            this.type = type;\n            this.function = function;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public Function getFunction() {\n            return function;\n        }\n\n        public static class Function {\n            private String name;\n            private Map<String, Object> input;\n\n            public Function(String name, Map<String, Object> input) {\n                this.name = name;\n                this.input = input;\n            }\n\n            public String getName() {\n                return name;\n            }\n\n            public Map<String, Object> getInput() {\n                return input;\n            }\n        }\n    }\n    \n    public static class Action {\n        @SerializedName(\"action_type\")\n        private String actionType;\n        private Parameters parameters;\n\n        // 回复消息节点构造方法\n        public static Action createAction(String interruptId) {\n            return createAction(\"resume\", interruptId, \"chat\");\n        }\n\n        public static Action createAction(String actionType, String id, String type) {\n            Parameters.InterruptEvent interruptEvent = new Parameters.InterruptEvent(id, type);\n            Parameters parameters = new Parameters(interruptEvent);\n            return new Action(actionType, parameters);\n        }\n\n        public Action(String actionType, Parameters parameters) {\n            this.actionType = actionType;\n            this.parameters = parameters;\n        }\n\n        public String getActionType() {\n            return actionType;\n        }\n\n        public Parameters getParameters() {\n            return parameters;\n        }\n\n        public static class Parameters {\n            @SerializedName(\"interrupt_event\")\n            private InterruptEvent interruptEvent;\n\n            public Parameters(InterruptEvent interruptEvent) {\n                this.interruptEvent = interruptEvent;\n            }\n\n            public InterruptEvent getInterruptEvent() {\n                return interruptEvent;\n            }\n\n            public static class InterruptEvent {\n                private String id;\n                private String type;\n\n                public InterruptEvent(String id, String type) {\n                    this.id = id;\n                    this.type = type;\n                }\n\n                public String getId() {\n                    return id;\n                }\n\n                public String getType() {\n                    return type;\n                }\n            }\n        }\n    }\n\n    public static class CustomMetadata{\n        @SerializedName(\"override_role_instruction\")\n        private String overrideRoleInstruction;\n\n        public CustomMetadata(String overrideRoleInstruction) {\n            this.overrideRoleInstruction = overrideRoleInstruction;\n        }\n\n        public void setOverrideRoleInstruction(String overrideRoleInstruction) {\n            this.overrideRoleInstruction = overrideRoleInstruction;\n        }\n\n        public String getOverrideRoleInstruction() {\n            return overrideRoleInstruction;\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppDescribeRequest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\npublic class AppDescribeRequest {\n    private String id;\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppDescribeResponse.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\npublic class AppDescribeResponse {\n    private String requestId;\n    private String id;\n    private String name;\n    private String description;\n    private String instruction;\n    private String prologue;\n    private String[] exampleQueries;\n    private FollowUpQueries followUpQueries;\n    private Component[] components;\n    private KnowledgeBaseConfig knowledgeBaseConfig;\n    private ModelConfig modelConfig;\n    private BackgroundConfig background;\n\n    // Getters and Setters\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getDescription() {\n        return description;\n    }\n\n    public void setDescription(String description) {\n        this.description = description;\n    }\n\n    public String getInstruction() {\n        return instruction;\n    }\n\n    public void setInstruction(String instruction) {\n        this.instruction = instruction;\n    }\n\n    public String getPrologue() {\n        return prologue;\n    }\n\n    public void setPrologue(String prologue) {\n        this.prologue = prologue;\n    }\n\n    public String[] getExampleQueries() {\n        return exampleQueries;\n    }\n\n    public void setExampleQueries(String[] exampleQueries) {\n        this.exampleQueries = exampleQueries;\n    }\n\n    public FollowUpQueries getFollowUpQueries() {\n        return followUpQueries;\n    }\n\n    public void setFollowUpQueries(FollowUpQueries followUpQueries) {\n        this.followUpQueries = followUpQueries;\n    }\n\n    public Component[] getComponents() {\n        return components;\n    }\n\n    public void setComponents(Component[] components) {\n        this.components = components;\n    }\n\n    public KnowledgeBaseConfig getKnowledgeBaseConfig() {\n        return knowledgeBaseConfig;\n    }\n\n    public void setKnowledgeBaseConfig(KnowledgeBaseConfig knowledgeBaseConfig) {\n        this.knowledgeBaseConfig = knowledgeBaseConfig;\n    }\n\n    public ModelConfig getModelConfig() {\n        return modelConfig;\n    }\n\n    public void setModelConfig(ModelConfig modelConfig) {\n        this.modelConfig = modelConfig;\n    }\n\n    public BackgroundConfig getBackground() {\n        return background;\n    }\n\n    public void setBackground(BackgroundConfig background) {\n        this.background = background;\n    }\n\n    public static class FollowUpQueries {\n        private String type;\n        private String prompt;\n        private String round;\n\n        // Getters and Setters\n        public String getType() {\n            return type;\n        }\n\n        public void setType(String type) {\n            this.type = type;\n        }\n        \n        public String getPrompt() {\n            return prompt;\n        }\n\n        public void setPrompt(String prompt) {\n            this.prompt = prompt;\n        }\n\n        public String getRound() {\n            return round;\n        }\n\n        public void setRound(String round) {\n            this.round = round;\n        }\n    }\n\n    public static class Component {\n        private String name;\n        private String description;\n        private String customDesc;\n\n        // Getters and Setters\n        public String getName() {\n            return name;\n        }\n\n        public void setName(String name) {\n            this.name = name;\n        }\n        \n        public String getDescription() {\n            return description;\n        }\n\n        public void setDescription(String description) {\n            this.description = description;\n        }\n\n        public String getCustomDesc() {\n            return customDesc;\n        }\n\n        public void setCustomDesc(String customDesc) {\n            this.customDesc = customDesc;\n        }\n    }\n\n    public static class KnowledgeBaseConfig {\n        private KnowledgeBase[] knowledgeBases;\n        private RetrievalConfig retrieval;\n\n        // Getters and Setters\n        public KnowledgeBase[] getKnowledgeBases() {\n            return knowledgeBases;\n        }\n\n        public void setKnowledgeBases(KnowledgeBase[] knowledgeBases) {\n            this.knowledgeBases = knowledgeBases;\n        }\n\n        public RetrievalConfig getRetrieval() {\n            return retrieval;\n        }\n\n        public void setRetrieval(RetrievalConfig retrieval) {\n            this.retrieval = retrieval;\n        }\n\n        public static class KnowledgeBase {\n            private String id;\n            private String name;\n            private String description;\n\n            // Getters and Setters\n            public String getId() {\n                return id;\n            }\n\n            public void setId(String id) {\n                this.id = id;\n            }\n            \n            public String getName() {\n                return name;\n            }\n\n            public void setName(String name) {\n                this.name = name;\n            }\n\n            public String getDescription() {\n                return description;\n            }\n\n            public void setDescription(String description) {\n                this.description = description;\n            }\n        }\n\n        public static class RetrievalConfig {\n            private Boolean enableWebSearch;\n            private String order;\n            private String strategy;\n            private Integer topK;\n            private Float threshold;\n\n            // Getters and Setters\n            public Boolean getEnableWebSearch() {\n                return enableWebSearch;\n            }\n\n            public void setEnableWebSearch(Boolean enableWebSearch) {\n                this.enableWebSearch = enableWebSearch;\n            }\n\n            public String getOrder() {\n                return order;\n            }\n\n            public void setOrder(String order) {\n                this.order = order;\n            }\n\n            public String getStrategy() {\n                return strategy;\n            }\n\n            public void setStrategy(String strategy) {\n                this.strategy = strategy;\n            }\n\n            public Integer getTopK() {\n                return topK;\n            }\n\n            public void setTopK(Integer topK) {\n                this.topK = topK;\n            }\n\n            public Float getThreshold() {\n                return threshold;\n            }\n\n            public void setThreshold(Float threshold) {\n                this.threshold = threshold;\n            }\n        }\n    }\n\n    public static class ModelConfig {\n        private PlanConfig plan;\n        private ChatConfig chat;\n\n        // Getters and Setters\n        public PlanConfig getPlan() {\n            return plan;\n        }\n\n        public void setPlan(PlanConfig plan) {\n            this.plan = plan;\n        }\n\n        public ChatConfig getChat() {\n            return chat;\n        }\n\n        public void setChat(ChatConfig chat) {\n            this.chat = chat;\n        }\n\n        public static class PlanConfig {\n            private String modelId;\n            private String model;\n            private Integer maxRounds;\n            private Config config;\n\n            // Getters and Setters\n            public String getModelId() {\n                return modelId;\n            }\n\n            public void setModelId(String modelId) {\n                this.modelId = modelId;\n            }\n\n            public String getModel() {\n                return model;\n            }\n\n            public void setModel(String model) {\n                this.model = model;\n            }\n\n            public Integer getMaxRounds() {\n                return maxRounds;\n            }\n\n            public void setMaxRounds(Integer maxRounds) {\n                this.maxRounds = maxRounds;\n            }\n\n            public Config getConfig() {\n                return config;\n            }\n\n            public void setConfig(Config config) {\n                this.config = config;\n            }\n\n            public static class Config {\n                private Float temperature;\n                private Float topP;\n\n                // Getters and Setters\n                public Float getTemperature() {\n                    return temperature;\n                }\n\n                public void setTemperature(Float temperature) {\n                    this.temperature = temperature;\n                }\n                \n                public Float getTopP() {\n                    return topP;\n                }\n\n                public void setTopP(Float topP) {\n                    this.topP = topP;\n                }\n            }\n        }\n\n        public static class ChatConfig {\n            private String modelId;\n            private String model;\n            private Integer historyChatRounds;\n            private Config config;\n            // Getters and Setters...\n\n            public String getModelId() {\n                return modelId;\n            }\n\n            public void setModelId(String modelId) {\n                this.modelId = modelId;\n            }\n\n            public String getModel() {\n                return model;\n            }\n\n            public void setModel(String model) {\n                this.model = model;\n            }\n\n            public Integer getHistoryChatRounds() {\n                return historyChatRounds;\n            }\n\n            public void setHistoryChatRounds(Integer historyChatRounds) {\n                this.historyChatRounds = historyChatRounds;\n            }\n\n            public Config getConfig() {\n                return config;\n            }\n\n            public void setConfig(Config config) {\n                this.config = config;\n            }\n\n            public static class Config {\n                private Float temperature;\n                private Float topP;\n\n                // Getters and Setters\n                public Float getTemperature() {\n                    return temperature;\n                }\n\n                public void setTemperature(Float temperature) {\n                    this.temperature = temperature;\n                }\n\n                public Float getTopP() {\n                    return topP;\n                }\n\n                public void setTopP(Float topP) {\n                    this.topP = topP;\n                }\n            }\n        }\n    }\n\n    public static class BackgroundConfig {\n        private String id;\n        private String path;\n        private MobileConfig mobileConfig;\n        private PcConfig pcConfig;\n\n        // Getters and Setters\n        public String getId() {\n            return id;\n        }\n\n        public void setId(String id) {\n            this.id = id;\n        }\n\n        public String getPath() {\n            return path;\n        }\n\n        public void setPath(String path) {\n            this.path = path;\n        }\n\n        public MobileConfig getMobileConfig() {\n            return mobileConfig;\n        }\n\n        public void setMobileConfig(MobileConfig mobileConfig) {\n            this.mobileConfig = mobileConfig;\n        }\n\n        public PcConfig getPcConfig() {\n            return pcConfig;\n        }\n\n        public void setPcConfig(PcConfig pcConfig) {\n            this.pcConfig = pcConfig;\n        }\n\n        public static class MobileConfig {\n            private String left;\n            private String top;\n            private String height;\n            private String color;\n            // Getters and Setters...\n\n            public String getLeft() {\n                return left;\n            }\n\n            public void setLeft(String left) {\n                this.left = left;\n            }\n\n            public String getTop() {\n                return top;\n            }\n            \n            public void setTop(String top) {\n                this.top = top;\n            }\n\n            public String getHeight() {\n                return height;\n            }\n\n            public void setHeight(String height) {\n                this.height = height;\n            }\n\n            public String getColor() {\n                return color;\n            }\n\n            public void setColor(String color) {\n                this.color = color;\n            }\n        }\n\n        public static class PcConfig {\n            private String left;\n            private String top;\n            private String height;\n            private String color;\n            // Getters and Setters...\n\n            public String getLeft() {\n                return left;\n            }\n\n            public void setLeft(String left) {\n                this.left = left;\n            }\n\n            public String getTop() {\n                return top;\n            }\n\n            public void setTop(String top) {\n                this.top = top;\n            }\n\n            public String getHeight() {\n                return height;\n            }\n\n            public void setHeight(String height) {\n                this.height = height;\n            }\n\n            public String getColor() {\n                return color;\n            }\n\n            public void setColor(String color) {\n                this.color = color;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppListRequest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class AppListRequest {\n    private int limit;\n    private String after;\n    private String before;\n\n    // getters and setters\n    public int getLimit() {\n        return limit;\n    }\n\n    public void setLimit(int limit) {\n        this.limit = limit;\n    }\n\n    public String getAfter() {\n        return after;\n    }\n\n    public void setAfter(String after) {\n        this.after = after;\n    }\n\n    public String getBefore() {\n        return before;\n    }\n\n    public void setBefore(String before) {\n        this.before = before;\n    }\n\n    public Map<String, Object> toMap() {\n        Map<String, Object> map = new HashMap<>();\n        if (limit != 0) {\n            map.put(\"limit\", limit);\n        }\n        map.put(\"after\", after);\n        map.put(\"before\", before);\n        return map;\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppListResponse.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class AppListResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n    private App[] data;\n    private String code;\n    private String message;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public App[] getData() {\n        return data;\n    }\n\n    public void setData(App[] data) {\n        this.data = data;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n}\n    \n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppsDescribeRequest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\npublic class AppsDescribeRequest {\n    private String marker;\n    private Integer maxKeys;\n    \n    public AppsDescribeRequest(String marker, Integer maxKeys) {\n        this.marker = marker;\n        this.maxKeys = maxKeys;\n    }\n\n    public AppsDescribeRequest() {\n        this.maxKeys = 10;\n    }\n\n    public AppsDescribeRequest(Integer maxKeys) {\n        this.maxKeys = maxKeys;\n    }\n\n    public AppsDescribeRequest(String marker) {\n        this.marker = marker;\n    }\n    \n    public String getMarker() {\n        return marker;\n    }\n\n    public Integer getMaxKeys() {\n        return maxKeys;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/AppsDescribeResponse.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\npublic class AppsDescribeResponse {\n    private String requestId;\n    private String marker;\n    private Boolean isTruncated;\n    private String nextMarker;\n    private Integer maxKeys;\n    private App[] data;\n    \n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getMarker() {\n        return marker;\n    }\n\n    public void setMarker(String marker) {\n        this.marker = marker;\n    }\n\n    public Boolean getIsTruncated() {\n        return isTruncated;\n    }\n\n    public void setIsTruncated(Boolean isTruncated) {\n        this.isTruncated = isTruncated;\n    }\n\n    public String getNextMarker() {\n        return nextMarker;\n    }\n\n    public void setNextMarker(String nextMarker) {\n        this.nextMarker = nextMarker;\n    }\n\n    public Integer getMaxKeys() {\n        return maxKeys;\n    }\n\n    public void setMaxKeys(Integer maxKeys) {\n        this.maxKeys = maxKeys;\n    }\n\n    public App[] getData() {\n        return data;\n    }\n\n    public void setData(App[] data) {\n        this.data = data;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/ConversationResponse.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class ConversationResponse {\n    private String requestId;\n\n    @SerializedName(\"conversation_id\")\n    private String conversationId;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getConversationId() {\n        return conversationId;\n    }\n\n    public void setConversationId(String conversationId) {\n        this.conversationId = conversationId;\n    }\n\n    @Override\n    public String toString() {\n        return \"ConversationResponse{\" +\n                \"requestId='\" + requestId + '\\'' +\n                \", conversationId='\" + conversationId + '\\'' +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/Event.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport java.util.Map;\nimport com.google.gson.annotations.SerializedName;\n\npublic class Event {\n    public static final String ChatflowEventType = \"chatflow\";\n    public static final String FollowUpQueryEventType = \"FollowUpQuery\";\n    \n    private String code;\n    private String message;\n    private String eventType;\n    private String status;\n    private String contentType;\n    private Map<String, Object> detail;\n    private Map<String, Object> usage;\n    @SerializedName(\"tool_calls\")\n    private ToolCall[] toolCalls;\n\n    public String getCode() {\n        return code;\n    }\n\n    public Event setCode(String code) {\n        this.code = code;\n        return this;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public Event setMessage(String message) {\n        this.message = message;\n        return this;\n    }\n\n    public String getEventType() {\n        return eventType;\n    }\n\n    public Event setEventType(String eventType) {\n        this.eventType = eventType;\n        return this;\n    }\n\n    public String getStatus() {\n        return status;\n    }\n\n    public Event setStatus(String status) {\n        this.status = status;\n        return this;\n    }\n\n    public String getContentType() {\n        return contentType;\n    }\n\n    public Event setContentType(String contentType) {\n        this.contentType = contentType;\n        return this;\n    }\n\n    public Map<String, Object> getDetail() {\n        return detail;\n    }\n\n    public Event setDetail(Map<String, Object> detail) {\n        this.detail = detail;\n        return this;\n    }\n\n    public Map<String, Object> getUsage() {\n        return usage;\n    }\n\n    public Event setUsage(Map<String, Object> usage) {\n        this.usage = usage;\n        return this;\n    }\n\n    public ToolCall[] getToolCalls() {\n        return toolCalls;\n    }\n\n    public Event setToolCalls(ToolCall[] toolCalls) {\n        this.toolCalls = toolCalls;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"Event{\" + \"code='\" + code + '\\'' + \", message='\" + message + '\\'' + \", eventType='\"\n                + eventType + '\\'' + \", status='\" + status + '\\'' + \", contentType='\" + contentType\n                + '\\'' + \", detail=\" + detail + '\\'' + \", usage=\" + usage + '\\'' + \", toolCalls=\"\n                + toolCalls + '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/EventContent.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.Map;\n\npublic class EventContent {\n    public static final String CodeContentType = \"code\";\n    public static final String TextContentType = \"text\";\n    public static final String ImageContentType = \"image\";\n    public static final String RAGContentType = \"rag\";\n    public static final String FunctionCallContentType = \"function_call\";\n    public static final String AudioContentType = \"audio\";\n    public static final String VideoContentType = \"video\";\n    public static final String StatusContentType = \"status\";\n    public static final String ChatflowInterruptContentType = \"chatflow_interrupt\";\n    public static final String PublishMessageContentType = \"publish_message\";\n    public static final String MultipleDialogEventContentType = \"multiple_dialog_event\";\n    public static final String JsonContentType = \"json\";\n\n    @SerializedName(\"event_code\")\n    private String eventCode;\n    @SerializedName(\"event_message\")\n    private String enentMessage;\n    @SerializedName(\"event_type\")\n    private String eventType;\n    @SerializedName(\"event_id\")\n    private String eventId;\n    @SerializedName(\"event_status\")\n    private String eventStatus;\n    @SerializedName(\"content_type\")\n    private String contentType;\n    private Map<String, Object> outputs;\n    private Map<String, Object> usage;\n    @SerializedName(\"tool_calls\")\n    private ToolCall[] toolCalls;\n\n    public String getEventCode() {\n        return eventCode;\n    }\n\n    public void setEventCode(String eventCode) {\n        this.eventCode = eventCode;\n    }\n\n    public String getEnentMessage() {\n        return enentMessage;\n    }\n\n    public void setEnentMessage(String enentMessage) {\n        this.enentMessage = enentMessage;\n    }\n\n    public String getEventType() {\n        return eventType;\n    }\n\n    public void setEventType(String eventType) {\n        this.eventType = eventType;\n    }\n\n    public String getEventId() {\n        return eventId;\n    }\n\n    public void setEventId(String eventId) {\n        this.eventId = eventId;\n    }\n\n    public String getEventStatus() {\n        return eventStatus;\n    }\n\n    public void setEventStatus(String eventStatus) {\n        this.eventStatus = eventStatus;\n    }\n\n    public String getContentType() {\n        return contentType;\n    }\n\n    public void setContentType(String contentType) {\n        this.contentType = contentType;\n    }\n\n    public Map<String, Object> getOutputs() {\n        return outputs;\n    }\n\n    public void setOutputs(Map<String, Object> outputs) {\n        this.outputs = outputs;\n    }\n\n    public Map<String, Object> getUsage() {\n        return usage;\n    }\n\n    public void setUsage(Map<String, Object> usage) {\n        this.usage = usage;\n    }\n\n    public ToolCall[] getToolCalls() {\n        return toolCalls;\n    }\n\n    public void setToolCalls(ToolCall[] toolCalls) {\n        this.toolCalls = toolCalls;\n    }\n\n    @Override\n    public String toString() {\n        return \"EventContent{\" + \"eventCode='\" + eventCode + '\\'' + \", eventMessage='\"\n                + enentMessage + '\\'' + \", eventType='\" + eventType + '\\'' + \", eventId='\" + eventId\n                + '\\'' + \", eventStatus='\" + eventStatus + '\\'' + \", contentType='\" + contentType\n                + '\\'' + \", outputs=\" + outputs + '\\'' + \"usage=\" + usage + '\\'' + \", toolCalls=\"\n                + toolCalls + '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/FileUploadResponse.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class FileUploadResponse {\n    private String requestId;\n    @SerializedName(\"id\")\n    private String fileId;\n    @SerializedName(\"conversation_id\")\n    private String conversationId;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getFileId() {\n        return fileId;\n    }\n\n    @Override\n    public String toString() {\n        return \"FileUploadResponse{\" +\n                \"requestId='\" + requestId + '\\'' +\n                \", fileId='\" + fileId + '\\'' +\n                \", conversationId='\" + conversationId + '\\'' +\n                '}';\n    }\n\n    public void setFileId(String fileId) {\n        this.fileId = fileId;\n    }\n\n    public String getConversationId() {\n        return conversationId;\n    }\n\n    public void setConversationId(String conversationId) {\n        this.conversationId = conversationId;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/appbuilderclient/ToolCall.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\npublic class ToolCall {\n    private String id;\n    private String type;\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/componentclient/ComponentClientIterator.java",
    "content": "package com.baidubce.appbuilder.model.componentclient;\n\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\n\n\npublic class ComponentClientIterator {\n    private final StreamIterator<ComponentClientRunResponse> iterator;\n\n    public ComponentClientIterator(StreamIterator<ComponentClientRunResponse> iterator) {\n        this.iterator = iterator;\n    }\n\n    public boolean hasNext() {\n        return iterator.hasNext();\n    }\n\n    public ComponentClientRunResponse next() {\n        return iterator.next();\n    }\n\n    public void close(){\n        iterator.close();\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/componentclient/ComponentClientRunRequest.java",
    "content": "package com.baidubce.appbuilder.model.componentclient;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class ComponentClientRunRequest {\n    public static final String SysOriginQuery = \"_sys_origin_query\";\n    public static final String SysFileUrls = \"_sys_file_urls\";\n    public static final String SysConversationID = \"_sys_conversation_id\";\n    public static final String SysEndUserID = \"_sys_end_user_id\";\n    public static final String SysChatHistory = \"_sys_chat_history\";\n\n    private boolean stream;\n    private Map<String, Object> parameters = new HashMap<>();\n\n    public boolean isStream() {\n        return stream;\n    }\n\n    public void setStream(boolean stream) {\n        this.stream = stream;\n    }\n\n    public Map<String, Object> getParameters() {\n        return parameters;\n    }\n\n    public void setParameters(Map<String, Object> parameters) {\n        this.parameters = parameters;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/componentclient/ComponentClientRunResponse.java",
    "content": "package com.baidubce.appbuilder.model.componentclient;\n\nimport java.util.Map;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.HashMap;\n\npublic class ComponentClientRunResponse {\n    @SerializedName(\"request_id\")\n    private String requestID;\n    private String code;\n    private String message;\n    @SerializedName(\"conversation_id\")\n    private String conversationID;\n    @SerializedName(\"message_id\")\n    private String messageID;\n    @SerializedName(\"trace_id\")\n    private String traceID;\n    @SerializedName(\"user_id\")\n    private String userID;\n    @SerializedName(\"end_user_id\")\n    private String endUserID;\n    private String status; // 新增的字段\n    private String role;\n    private Content[] content;\n\n    // Getters and Setters\n    public String getRequestID() {\n        return requestID;\n    }\n\n    public void setRequestID(String requestID) {\n        this.requestID = requestID;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    public String getConversationID() {\n        return conversationID;\n    }\n\n    public void setConversationID(String conversationID) {\n        this.conversationID = conversationID;\n    }\n\n    public String getMessageID() {\n        return messageID;\n    }\n\n    public void setMessageID(String messageID) {\n        this.messageID = messageID;\n    }\n\n    public String getTraceID() {\n        return traceID;\n    }\n\n    public void setTraceID(String traceID) {\n        this.traceID = traceID;\n    }\n\n    public String getUserID() {\n        return userID;\n    }\n\n    public void setUserID(String userID) {\n        this.userID = userID;\n    }\n\n    public String getEndUserID() {\n        return endUserID;\n    }\n\n    public void setEndUserID(String endUserID) {\n        this.endUserID = endUserID;\n    }\n\n    public String getStatus() {\n        return status;\n    }\n\n    public void setStatus(String status) {\n        this.status = status;\n    }\n\n    public String getRole() {\n        return role;\n    }\n\n    public void setRole(String role) {\n        this.role = role;\n    }\n\n    public Content[] getContent() {\n        return content;\n    }\n\n    public void setContent(Content[] content) {\n        this.content = content;\n    }\n\n    public static class Content {\n        private String name;\n        @SerializedName(\"visible_scope\")\n        private String visibleScope;\n        @SerializedName(\"raw_data\")\n        private Map<String, Object> rawData = new HashMap<>();\n        private Map<String, Object> usage = new HashMap<>();\n        private Map<String, Object> metrics = new HashMap<>();\n        private String type;\n        private Map<String, Object> text = new HashMap<>();\n        private ComponentEvent event;\n\n        // Getters and Setters\n        public String getName() {\n            return name;\n        }\n\n        public void setName(String name) {\n            this.name = name;\n        }\n\n        public String getVisibleScope() {\n            return visibleScope;\n        }\n\n        public void setVisibleScope(String visibleScope) {\n            this.visibleScope = visibleScope;\n        }\n\n        public Map<String, Object> getRawData() {\n            return rawData;\n        }\n\n        public void setRawData(Map<String, Object> rawData) {\n            this.rawData = rawData;\n        }\n\n        public Map<String, Object> getUsage() {\n            return usage;\n        }\n\n        public void setUsage(Map<String, Object> usage) {\n            this.usage = usage;\n        }\n\n        public Map<String, Object> getMetrics() {\n            return metrics;\n        }\n\n        public void setMetrics(Map<String, Object> metrics) {\n            this.metrics = metrics;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public void setType(String type) {\n            this.type = type;\n        }\n\n        public Map<String, Object> getText() {\n            return text;\n        }\n\n        public void setText(Map<String, Object> text) {\n            this.text = text;\n        }\n\n        public ComponentEvent getEvent() {\n            return event;\n        }\n\n        public void setEvent(ComponentEvent event) {\n            this.event = event;\n        }\n\n        public static class ComponentEvent {\n            private String id;\n            private String status;\n            private String name;\n            @SerializedName(\"created_time\")\n            private String createdTime;\n            @SerializedName(\"error_code\")\n            private String errorCode;\n            @SerializedName(\"error_message\")\n            private String errorMessage;\n\n            // Getters and Setters\n            public String getId() {\n                return id;\n            }\n\n            public void setId(String id) {\n                this.id = id;\n            }\n\n            public String getStatus() {\n                return status;\n            }\n\n            public void setStatus(String status) {\n                this.status = status;\n            }\n\n            public String getName() {\n                return name;\n            }\n\n            public void setName(String name) {\n                this.name = name;\n            }\n\n            public String getCreatedTime() {\n                return createdTime;\n            }\n\n            public void setCreatedTime(String createdTime) {\n                this.createdTime = createdTime;\n            }\n\n            public String getErrorCode() {\n                return errorCode;\n            }\n\n            public void setErrorCode(String errorCode) {\n                this.errorCode = errorCode;\n            }\n\n            public String getErrorMessage() {\n                return errorMessage;\n            }\n\n            public void setErrorMessage(String errorMessage) {\n                this.errorMessage = errorMessage;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/DatasetCreateResponse.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\npublic class DatasetCreateResponse {\n    private int code;\n    private String message;\n    private DatasetCreateResult result;\n\n    public int getCode() {\n        return code;\n    }\n\n    public void setCode(int code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    public DatasetCreateResult getResult() {\n        return result;\n    }\n\n    public void setResult(DatasetCreateResult result) {\n        this.result = result;\n    }\n\n    @Override\n    public String toString() {\n        return \"DatasetCreateResponse{\" +\n                \"code=\" + code +\n                \", message='\" + message + '\\'' +\n                \", result=\" + result +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/DatasetCreateResult.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class DatasetCreateResult {\n    private String id;\n    private String name;\n    private String description;\n    @SerializedName(\"indexing_technique\")\n    private String indexingTechnique;\n    @SerializedName(\"document_count\")\n    private int documentCount;\n    @SerializedName(\"word_count\")\n    private int wordCount;\n    @SerializedName(\"created_by\")\n    private String createdBy;\n    @SerializedName(\"created_at\")\n    private long createdAt;\n    @SerializedName(\"updated_by\")\n    private String updatedBy;\n    @SerializedName(\"updated_at\")\n    private long updatedAt;\n    @SerializedName(\"is_priority\")\n    private boolean isPriority;\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getDescription() {\n        return description;\n    }\n\n    public void setDescription(String description) {\n        this.description = description;\n    }\n\n    public String getIndexingTechnique() {\n        return indexingTechnique;\n    }\n\n    public void setIndexingTechnique(String indexingTechnique) {\n        this.indexingTechnique = indexingTechnique;\n    }\n\n    public int getDocumentCount() {\n        return documentCount;\n    }\n\n    public void setDocumentCount(int documentCount) {\n        this.documentCount = documentCount;\n    }\n\n    public int getWordCount() {\n        return wordCount;\n    }\n\n    public void setWordCount(int wordCount) {\n        this.wordCount = wordCount;\n    }\n\n    public String getCreatedBy() {\n        return createdBy;\n    }\n\n    public void setCreatedBy(String createdBy) {\n        this.createdBy = createdBy;\n    }\n\n    public long getCreatedAt() {\n        return createdAt;\n    }\n\n    public void setCreatedAt(long createdAt) {\n        this.createdAt = createdAt;\n    }\n\n    public String getUpdatedBy() {\n        return updatedBy;\n    }\n\n    public void setUpdatedBy(String updatedBy) {\n        this.updatedBy = updatedBy;\n    }\n\n    public long getUpdatedAt() {\n        return updatedAt;\n    }\n\n    public void setUpdatedAt(long updatedAt) {\n        this.updatedAt = updatedAt;\n    }\n\n    public boolean isPriority() {\n        return isPriority;\n    }\n\n    public void setPriority(boolean priority) {\n        isPriority = priority;\n    }\n\n    @Override\n    public String toString() {\n        return \"DatasetCreateResult{\" +\n                \"id='\" + id + '\\'' +\n                \", name='\" + name + '\\'' +\n                \", description='\" + description + '\\'' +\n                \", indexingTechnique='\" + indexingTechnique + '\\'' +\n                \", documentCount=\" + documentCount +\n                \", wordCount=\" + wordCount +\n                \", createdBy='\" + createdBy + '\\'' +\n                \", createdAt=\" + createdAt +\n                \", updatedBy='\" + updatedBy + '\\'' +\n                \", updatedAt=\" + updatedAt +\n                \", isPriority=\" + isPriority +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/DocumentAddResponse.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\npublic class DocumentAddResponse {\n    private int code;\n    private String message;\n    private DocumentAddResult result;\n\n    public int getCode() {\n        return code;\n    }\n\n    public void setCode(int code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    public DocumentAddResult getResult() {\n        return result;\n    }\n\n    public void setResult(DocumentAddResult result) {\n        this.result = result;\n    }\n\n    @Override\n    public String toString() {\n        return \"DocumentAddResponse{\" +\n                \"code=\" + code +\n                \", message='\" + message + '\\'' +\n                \", result=\" + result +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/DocumentAddResult.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.Arrays;\n\npublic class DocumentAddResult {\n    @SerializedName(\"dataset_id\")\n    private String datasetId;\n    @SerializedName(\"document_ids\")\n    private String[] documentIds;\n\n    public String getDatasetId() {\n        return datasetId;\n    }\n\n    public void setDatasetId(String datasetId) {\n        this.datasetId = datasetId;\n    }\n\n    public String[] getDocumentIds() {\n        return documentIds;\n    }\n\n    public void setDocumentIds(String[] documentIds) {\n        this.documentIds = documentIds;\n    }\n\n    @Override\n    public String toString() {\n        return \"DocumentAddResult{\" +\n                \"datasetId='\" + datasetId + '\\'' +\n                \", documentIds=\" + Arrays.toString(documentIds) +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/DocumentDeleteResponse.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\npublic class DocumentDeleteResponse {\n    private int code;\n    private String message;\n    private Object result;\n\n    public int getCode() {\n        return code;\n    }\n\n    public void setCode(int code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    public Object getResult() {\n        return result;\n    }\n\n    public void setResult(Object result) {\n        this.result = result;\n    }\n\n    @Override\n    public String toString() {\n        return \"DocumentDeleteResponse{\" +\n                \"code=\" + code +\n                \", message='\" + message + '\\'' +\n                \", result=\" + result +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/DocumentListData.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.Map;\n\npublic class DocumentListData {\n    private String id;\n    private String name;\n    @SerializedName(\"dataset_process_rule_id\")\n    private String datasetProcessRuleId;\n    @SerializedName(\"data_source_type\")\n    private String dataSourceType;\n    private int position;\n    @SerializedName(\"data_source_info\")\n    private Map<String, String> dataSourceInfo;\n    @SerializedName(\"created_from\")\n    private String createdFrom;\n    @SerializedName(\"created_by\")\n    private String createdBy;\n    @SerializedName(\"created_at\")\n    private long createdAt;\n    @SerializedName(\"indexing_status\")\n    private String indexingStatus;\n    private Object error;\n    private boolean enabled;\n    @SerializedName(\"display_status\")\n    private String displayStatus;\n    @SerializedName(\"word_count\")\n    private int wordCount;\n    @SerializedName(\"estimated_waiting_minutes\")\n    private int estimatedWaitingMinutes;\n    @SerializedName(\"disabled_at\")\n    private Object disabledAt;\n    @SerializedName(\"disabled_by\")\n    private Object disabledBy;\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getDatasetProcessRuleId() {\n        return datasetProcessRuleId;\n    }\n\n    public void setDatasetProcessRuleId(String datasetProcessRuleId) {\n        this.datasetProcessRuleId = datasetProcessRuleId;\n    }\n\n    public String getDataSourceType() {\n        return dataSourceType;\n    }\n\n    public void setDataSourceType(String dataSourceType) {\n        this.dataSourceType = dataSourceType;\n    }\n\n    public int getPosition() {\n        return position;\n    }\n\n    public void setPosition(int position) {\n        this.position = position;\n    }\n\n    public Map<String, String> getDataSourceInfo() {\n        return dataSourceInfo;\n    }\n\n    public void setDataSourceInfo(Map<String, String> dataSourceInfo) {\n        this.dataSourceInfo = dataSourceInfo;\n    }\n\n    public String getCreatedFrom() {\n        return createdFrom;\n    }\n\n    public void setCreatedFrom(String createdFrom) {\n        this.createdFrom = createdFrom;\n    }\n\n    public String getCreatedBy() {\n        return createdBy;\n    }\n\n    public void setCreatedBy(String createdBy) {\n        this.createdBy = createdBy;\n    }\n\n    public long getCreatedAt() {\n        return createdAt;\n    }\n\n    public void setCreatedAt(long createdAt) {\n        this.createdAt = createdAt;\n    }\n\n    public String getIndexingStatus() {\n        return indexingStatus;\n    }\n\n    public void setIndexingStatus(String indexingStatus) {\n        this.indexingStatus = indexingStatus;\n    }\n\n    public Object getError() {\n        return error;\n    }\n\n    public void setError(Object error) {\n        this.error = error;\n    }\n\n    public boolean isEnabled() {\n        return enabled;\n    }\n\n    public void setEnabled(boolean enabled) {\n        this.enabled = enabled;\n    }\n\n    public String getDisplayStatus() {\n        return displayStatus;\n    }\n\n    public void setDisplayStatus(String displayStatus) {\n        this.displayStatus = displayStatus;\n    }\n\n    public int getWordCount() {\n        return wordCount;\n    }\n\n    public void setWordCount(int wordCount) {\n        this.wordCount = wordCount;\n    }\n\n    public int getEstimatedWaitingMinutes() {\n        return estimatedWaitingMinutes;\n    }\n\n    public void setEstimatedWaitingMinutes(int estimatedWaitingMinutes) {\n        this.estimatedWaitingMinutes = estimatedWaitingMinutes;\n    }\n\n    public Object getDisabledAt() {\n        return disabledAt;\n    }\n\n    public void setDisabledAt(Object disabledAt) {\n        this.disabledAt = disabledAt;\n    }\n\n    public Object getDisabledBy() {\n        return disabledBy;\n    }\n\n    public void setDisabledBy(Object disabledBy) {\n        this.disabledBy = disabledBy;\n    }\n\n    @Override\n    public String toString() {\n        return \"DocumentListData{\" +\n                \"id='\" + id + '\\'' +\n                \", name='\" + name + '\\'' +\n                \", datasetProcessRuleId='\" + datasetProcessRuleId + '\\'' +\n                \", dataSourceType='\" + dataSourceType + '\\'' +\n                \", position=\" + position +\n                \", dataSourceInfo=\" + dataSourceInfo +\n                \", createdFrom='\" + createdFrom + '\\'' +\n                \", createdBy='\" + createdBy + '\\'' +\n                \", createdAt=\" + createdAt +\n                \", indexingStatus='\" + indexingStatus + '\\'' +\n                \", error=\" + error +\n                \", enabled=\" + enabled +\n                \", displayStatus='\" + displayStatus + '\\'' +\n                \", wordCount=\" + wordCount +\n                \", estimatedWaitingMinutes=\" + estimatedWaitingMinutes +\n                \", disabledAt=\" + disabledAt +\n                \", disabledBy=\" + disabledBy +\n                '}';\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/DocumentListResponse.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\npublic class DocumentListResponse {\n    private int code;\n    private String message;\n    private DocumentListResult result;\n\n    public int getCode() {\n        return code;\n    }\n\n    public void setCode(int code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    public DocumentListResult getResult() {\n        return result;\n    }\n\n    public void setResult(DocumentListResult result) {\n        this.result = result;\n    }\n\n    @Override\n    public String toString() {\n        return \"DocumentListResponse{\" +\n                \"code=\" + code +\n                \", message='\" + message + '\\'' +\n                \", result=\" + result +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/DocumentListResult.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.Arrays;\n\npublic class DocumentListResult {\n    @SerializedName(\"has_more\")\n    private boolean hasMore;\n    private int limit;\n    private int page;\n    private int total;\n    private DocumentListData[] data;\n\n    public boolean isHasMore() {\n        return hasMore;\n    }\n\n    public void setHasMore(boolean hasMore) {\n        this.hasMore = hasMore;\n    }\n\n    public int getLimit() {\n        return limit;\n    }\n\n    public void setLimit(int limit) {\n        this.limit = limit;\n    }\n\n    public int getPage() {\n        return page;\n    }\n\n    public void setPage(int page) {\n        this.page = page;\n    }\n\n    public int getTotal() {\n        return total;\n    }\n\n    public void setTotal(int total) {\n        this.total = total;\n    }\n\n    public DocumentListData[] getData() {\n        return data;\n    }\n\n    public void setData(DocumentListData[] data) {\n        this.data = data;\n    }\n\n    @Override\n    public String toString() {\n        return \"DocumentListResult{\" +\n                \"hasMore=\" + hasMore +\n                \", limit=\" + limit +\n                \", page=\" + page +\n                \", total=\" + total +\n                \", data=\" + Arrays.toString(data) +\n                '}';\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/FileUploadResponse.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\npublic class FileUploadResponse {\n    private int code;\n    private String message;\n    private FileUploadResult result;\n\n    public int getCode() {\n        return code;\n    }\n\n    public void setCode(int code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    public FileUploadResult getResult() {\n        return result;\n    }\n\n    public void setResult(FileUploadResult result) {\n        this.result = result;\n    }\n\n    @Override\n    public String toString() {\n        return \"FileUploadResponse{\" +\n                \"code=\" + code +\n                \", message='\" + message + '\\'' +\n                \", result=\" + result +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/dataset/FileUploadResult.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class FileUploadResult {\n    private String id;\n    private String name;\n    private int size;\n    private String extension;\n    @SerializedName(\"mime_type\")\n    private String mimeType;\n    @SerializedName(\"created_by\")\n    private String createdBy;\n    @SerializedName(\"created_at\")\n    protected long createdAt;\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public int getSize() {\n        return size;\n    }\n\n    public void setSize(int size) {\n        this.size = size;\n    }\n\n    public String getExtension() {\n        return extension;\n    }\n\n    public void setExtension(String extension) {\n        this.extension = extension;\n    }\n\n    public String getMimeType() {\n        return mimeType;\n    }\n\n    public void setMimeType(String mimeType) {\n        this.mimeType = mimeType;\n    }\n\n    public String getCreatedBy() {\n        return createdBy;\n    }\n\n    public void setCreatedBy(String createdBy) {\n        this.createdBy = createdBy;\n    }\n\n    public long getCreatedAt() {\n        return createdAt;\n    }\n\n    public void setCreatedAt(long createdAt) {\n        this.createdAt = createdAt;\n    }\n\n    @Override\n    public String toString() {\n        return \"FileUploadResult{\" +\n                \"id='\" + id + '\\'' +\n                \", name='\" + name + '\\'' +\n                \", size=\" + size +\n                \", extension='\" + extension + '\\'' +\n                \", mimeType='\" + mimeType + '\\'' +\n                \", createdBy='\" + createdBy + '\\'' +\n                \", createdAt=\" + createdAt +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/ChunkCreateRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class ChunkCreateRequest {\n    private String knowledgeBaseId;\n    private String documentId;\n    private String content;\n\n\n    public ChunkCreateRequest(String documetId, String content) {\n        this.documentId = documetId;\n        this.content = content;\n    }\n\n    public ChunkCreateRequest(String knowledgeBaseId, String documetId, String content) {\n        this.knowledgeBaseId = knowledgeBaseId;\n        this.documentId = documetId;\n        this.content = content;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getDocumentId() {\n        return documentId;\n    }\n\n    public void setDocumentId(String documentId) {\n        this.documentId = documentId;\n    }\n\n    public String getContent() {\n        return content;\n    }\n\n    public void setContent(String content) {\n        this.content = content;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/ChunkCreateResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class ChunkCreateResponse {\n    @SerializedName(\"id\")\n    private String chunkId;\n\n    public void setChunkId(String chunkId) {\n        this.chunkId = chunkId;\n    }\n\n    public String getChunkId() {\n        return chunkId;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/ChunkDeleteRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class ChunkDeleteRequest {\n    private String knowledgeBaseId;\n    private String chunkId;\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setChunkId(String chunkId) {\n        this.chunkId = chunkId;\n    }\n\n    public String getChunkId() {\n        return chunkId;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/ChunkDescribeRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class ChunkDescribeRequest {\n    private String knowledgeBaseId;\n    private String chunkId;\n\n    public void setChunkId(String chunkId) {\n        this.chunkId = chunkId;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getChunkId() {\n        return chunkId;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/ChunkDescribeResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class ChunkDescribeResponse {\n    @SerializedName(\"id\")\n    private String chunkId;\n    private String type;\n    private String knowledgeBaseId;\n    private String documentId;\n    private String content;\n    private Integer wordCount;\n    private Integer tokenCount;\n    private boolean enabled;\n    private String status;\n    private String statusMessage;\n    private String[] imageUrls;\n    private Integer createTime;\n    private Integer updateTime;\n\n    public void setChunkId(String chunkId) {\n        this.chunkId = chunkId;\n    }\n\n    public String getChunkId() {\n        return chunkId;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setDocumentId(String documentId) {\n        this.documentId = documentId;\n    }\n\n    public String getDocumentId() {\n        return documentId;\n    }\n\n    public void setContent(String content) {\n        this.content = content;\n    }\n\n    public String getContent() {\n        return content;\n    }\n\n    public void setWordCount(Integer wordCount) {\n        this.wordCount = wordCount;\n    }\n\n    public Integer getWordCount() {\n        return wordCount;\n    }\n\n    public void setTokenCount(Integer tokenCount) {\n        this.tokenCount = tokenCount;\n    }\n\n    public Integer getTokenCount() {\n        return tokenCount;\n    }\n\n    public void setEnabled(boolean enabled) {\n        this.enabled = enabled;\n    }\n\n    public boolean getEnabled() {\n        return enabled;\n    }\n\n    public void setStatus(String status) {\n        this.status = status;\n    }\n\n    public String getStatus() {\n        return status;\n    }\n\n    public void setStatusMessage(String statusMessage) {\n        this.statusMessage = statusMessage;\n    }\n\n    public String getStatusMessage() {\n        return statusMessage;\n    }\n\n    public void setImageUrls(String[] imageUrls) {\n        this.imageUrls = imageUrls;\n    }\n\n    public String[] getImageUrls() {\n        return imageUrls;\n    }\n\n    public void setCreateTime(Integer createTime) {\n        this.createTime = createTime;\n    }\n\n    public Integer getCreateTime() {\n        return createTime;\n    }\n\n    public void setUpdateTime(Integer updateTime) {\n        this.updateTime = updateTime;\n    }\n\n    public Integer getUpdateTime() {\n        return updateTime;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/ChunkModifyRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class ChunkModifyRequest {\n    private String knowledgeBaseId;\n    private String chunkId;\n    private String content;\n    private boolean enable;\n\n    public ChunkModifyRequest(String chunkId, String content, boolean enable) {\n        this.chunkId = chunkId;\n        this.content = content;\n        this.enable = enable;\n    }\n\n    public ChunkModifyRequest(String knowledgeBaseId, String chunkId, String content, boolean enable) {\n        this.knowledgeBaseId = knowledgeBaseId;\n        this.chunkId = chunkId;\n        this.content = content;\n        this.enable = enable;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getChunkId() {\n        return chunkId;\n    }\n\n    public void setChunkId(String chunkId) {\n        this.chunkId = chunkId;\n    }\n\n    public String getContent() {\n        return content;\n    }\n\n    public void setContent(String content) {\n        this.content = content;\n    }\n\n    public boolean getEnable() {\n        return enable;\n    }\n\n    public void setEnable(boolean enable) {\n        this.enable = enable;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/ChunksDescribeRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class ChunksDescribeRequest {\n    private String knowledgeBaseId;\n    private String documentId;\n    private String marker;\n    private Integer maxKeys;\n    private String type;\n    private String keyword;\n\n    public ChunksDescribeRequest(String documentId, String marker, Integer maxKeys, String type) {\n        this.documentId = documentId;\n        this.marker = marker;\n        this.maxKeys = maxKeys;\n        this.type = type;\n    }\n\n    public ChunksDescribeRequest(String knowledgeBaseId, String documentId, String marker, Integer maxKeys,\n            String type) {\n        this.knowledgeBaseId = knowledgeBaseId;\n        this.documentId = documentId;\n        this.marker = marker;\n        this.maxKeys = maxKeys;\n        this.type = type;\n    }\n\n    public ChunksDescribeRequest(String knowledgeBaseId, String documentId, String marker, Integer maxKeys,\n            String type, String keyword) {\n        this.knowledgeBaseId = knowledgeBaseId;\n        this.documentId = documentId;\n        this.marker = marker;\n        this.maxKeys = maxKeys;\n        this.type = type;\n        this.keyword = keyword;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getDocumentId() {\n        return documentId;\n    }\n\n    public void setDocumentId(String documentId) {\n        this.documentId = documentId;\n    }\n\n    public String getMarker() {\n        return marker;\n    }\n\n    public void setMarker(String marker) {\n        this.marker = marker;\n    }\n\n    public Integer getMaxKeys() {\n        return maxKeys;\n    }\n\n    public void setMaxKeys(Integer maxKeys) {\n        this.maxKeys = maxKeys;\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n\n    public void setKeyword(String keyword) {\n        this.keyword = keyword;\n    }\n\n    public String getKeyword() {\n        return keyword;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/ChunksDescribeResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class ChunksDescribeResponse {\n    private ChunkDescribeResponse[] data;\n    private String marker;\n    private boolean isTruncated;\n    private String nextMarker;\n    private Integer maxKeys;\n\n    public ChunkDescribeResponse[] getData() {\n        return data;\n    }\n\n    public void setData(ChunkDescribeResponse[] data) {\n        this.data = data;\n    }\n\n    public String getMarker() {\n        return marker;\n    }\n\n    public void setMarker(String marker) {\n        this.marker = marker;\n    }\n\n    public boolean isTruncated() {\n        return isTruncated;\n    }\n\n    public void setTruncated(boolean isTruncated) {\n        this.isTruncated = isTruncated;\n    }\n\n    public String getNextMarker() {\n        return nextMarker;\n    }\n\n    public void setNextMarker(String nextMarker) {\n        this.nextMarker = nextMarker;\n    }\n\n    public Integer getMaxKeys() {\n        return maxKeys;\n    }\n\n    public void setMaxKeys(Integer maxKeys) {\n        this.maxKeys = maxKeys;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/Document.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class Document {\n    private String id;\n    private String name;\n    @SerializedName(\"created_at\")\n    private String createdAt;\n    @SerializedName(\"word_count\")\n    private int wordCount;\n    private boolean enabled;\n    private Meta meta;\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getCreatedAt() {\n        return createdAt;\n    }\n\n    public void setCreatedAt(String createdAt) {\n        this.createdAt = createdAt;\n    }\n\n    public int getWordCount() {\n        return wordCount;\n    }\n\n    public void setWordCount(int wordCount) {\n        this.wordCount = wordCount;\n    }\n\n    public boolean isEnabled() {\n        return enabled;\n    }\n\n    public void setEnabled(boolean enabled) {\n        this.enabled = enabled;\n    }\n\n    public Meta getMeta() {\n        return meta;\n    }\n\n    public void setMeta(Meta meta) {\n        this.meta = meta;\n    }\n\n    public static class Meta {\n        private String source;\n        @SerializedName(\"file_id\")\n        private String fileId;\n\n        public String getSource() {\n            return source;\n        }\n\n        public void setSource(String source) {\n            this.source = source;\n        }\n\n        public String getFileId() {\n            return fileId;\n        }\n\n        public void setFileId(String fileId) {\n            this.fileId = fileId;\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentAddRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class DocumentAddRequest {\n    @SerializedName(\"knowledge_base_id\")\n    private String knowledgeBaseId;\n    @SerializedName(\"content_type\")\n    private String contentType;\n    @SerializedName(\"is_enhanced\")\n    private boolean isEnhanced;\n    @SerializedName(\"file_ids\")\n    private String[] fileIds;\n    @SerializedName(\"custom_process_rule\")\n    private CustomProcessRule customProcessRule;\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getContentType() {\n        return contentType;\n    }\n\n    public void setContentType(String contentType) {\n        this.contentType = contentType;\n    }\n\n    public boolean isEnhanced() {\n        return isEnhanced;\n    }\n\n    public void setEnhanced(boolean enhanced) {\n        isEnhanced = enhanced;\n    }\n\n    public String[] getFileIds() {\n        return fileIds;\n    }\n\n    public void setFileIds(String[] fileIds) {\n        this.fileIds = fileIds;\n    }\n\n    public CustomProcessRule getCustomProcessRule() {\n        return customProcessRule;\n    }\n\n    public void setCustomProcessRule(CustomProcessRule customProcessRule) {\n        this.customProcessRule = customProcessRule;\n    }\n\n    public static class CustomProcessRule {\n        @SerializedName(\"separators\")\n        private String[] separators;\n        @SerializedName(\"target_length\")\n        private int targetLength;\n        @SerializedName(\"overlap_rate\")\n        private double overlapRate;\n\n        public String[] getSeparators() {\n            return separators;\n        }\n\n        public void setSeparators(String[] separators) {\n            this.separators = separators;\n        }\n\n        public int getTargetLength() {\n            return targetLength;\n        }\n\n        public void setTargetLength(int targetLength) {\n            this.targetLength = targetLength;\n        }\n\n        public double getOverlapRate() {\n            return overlapRate;\n        }\n\n        public void setOverlapRate(double overlapRate) {\n            this.overlapRate = overlapRate;\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentAddResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class DocumentAddResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n    @SerializedName(\"knowledge_base_id\")\n    private String knowledgeBaseId;\n    @SerializedName(\"document_ids\")\n    private String[] documentIds;\n    private String code;\n    private String message;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setKnowledgeBaseId(String id) {\n        this.knowledgeBaseId = id;\n    }\n\n    public String[] getDocumentIds() {\n        return documentIds;\n    }\n\n    public void setDocumentIds(String[] documentIds) {\n        this.documentIds = documentIds;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    @Override\n    public String toString() {\n        return \"FileUploadResponse{\" + \"request_id=\" + requestId + \", code='\" + code + '\\''\n                + \", message='\" + message + '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentDeleteRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class DocumentDeleteRequest {\n    @SerializedName(\"knowledge_base_id\")\n    private String konwledgeBaseId;\n    @SerializedName(\"document_id\")\n    private String documentId;\n\n    // getters and setters\n    public String getKonwledgeBaseId() {\n        return konwledgeBaseId;\n    }\n\n    public void setKonwledgeBaseId(String konwledgeBaseId) {\n        this.konwledgeBaseId = konwledgeBaseId;\n    }\n\n    public String getDocumentId() {\n        return documentId;\n    }\n\n    public void setDocumentId(String documentId) {\n        this.documentId = documentId;\n    }\n\n    public Map<String, Object> toMap() {\n        Map<String, Object> map = new HashMap<>();\n        map.put(\"knowledge_base_id\", konwledgeBaseId);\n        map.put(\"document_id\", documentId);\n        return map;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentDeleteResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class DocumentDeleteResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n    private String code;\n    private String message;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    @Override\n    public String toString() {\n        return \"DocumentDeleteResponse{\" +\n                \"request_id=\" + requestId +\n                \", code='\" + code + '\\'' +\n                \", message='\" + message +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentDescribeResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class DocumentDescribeResponse {\n    private String id;\n    private String name;\n    private String createdAt;\n    private String displayStatus;\n    private Integer wordCount;\n    private Boolean enabled;\n    private Meta meta;\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getCreatedAt() {\n        return createdAt;\n    }\n\n    public void setCreatedAt(String createdAt) {\n        this.createdAt = createdAt;\n    }\n\n    public String getDisplayStatus() {\n        return displayStatus;\n    }\n\n    public void setDisplayStatus(String displayStatus) {\n        this.displayStatus = displayStatus;\n    }\n\n    public Integer getWordCount() {\n        return wordCount;\n    }\n\n    public void setWordCount(Integer wordCount) {\n        this.wordCount = wordCount;\n    }\n\n    public Boolean getEnabled() {\n        return enabled;\n    }\n\n    public void setEnabled(Boolean enabled) {\n        this.enabled = enabled;\n    }\n\n    public Meta getMeta() {\n        return meta;\n    }\n\n    public void setMeta(Meta meta) {\n        this.meta = meta;\n    }\n\n    public static class Meta {\n        private String source;\n        private String fileId;\n        private String url;\n        private String mime_type;\n        private Integer file_size;\n\n\n        public String getSource() {\n            return source;\n        }\n\n        public void setSource(String source) {\n            this.source = source;\n        }\n\n        public String getFileId() {\n            return fileId;\n        }\n\n        public void setFileId(String fileId) {\n            this.fileId = fileId;\n        }\n\n        public String getUrl() {\n            return url;\n        }\n\n        public void setUrl(String url) {\n            this.url = url;\n        }\n        \n        public String getMimeType() {\n            return mime_type;\n        }\n\n        public void setMimeType(String mime_type) {\n            this.mime_type = mime_type;\n        }\n\n        public Integer getFileSize() {\n            return file_size;\n        }\n\n        public void setFileSize(Integer file_size) {\n            this.file_size = file_size;\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentListRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class DocumentListRequest {\n    @SerializedName(\"knowledge_base_id\")\n    private String konwledgeBaseId;\n    private int limit;\n    private String after;\n    private String before;\n\n    // getters and setters\n    public String getKonwledgeBaseId() {\n        return konwledgeBaseId;\n    }\n\n    public void setKonwledgeBaseId(String konwledgeBaseId) {\n        this.konwledgeBaseId = konwledgeBaseId;\n    }\n\n    public int getLimit() {\n        return limit;\n    }\n\n    public void setLimit(int limit) {\n        this.limit = limit;\n    }\n\n    public String getAfter() {\n        return after;\n    }\n\n    public void setAfter(String after) {\n        this.after = after;\n    }\n\n    public String getBefore() {\n        return before;\n    }\n\n    public void setBefore(String before) {\n        this.before = before;\n    }\n\n    public Map<String, Object> toMap() {\n        Map<String, Object> map = new HashMap<>();\n        map.put(\"knowledge_base_id\", konwledgeBaseId);\n        if (limit != 0) {\n            map.put(\"limit\", limit);\n        }\n        map.put(\"after\", after);\n        map.put(\"before\", before);\n        return map;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentListResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class DocumentListResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n    private Document[] data;\n    private String code;\n    private String message;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public Document[] getData() {\n        return data;\n    }\n\n    public void setData(Document[] data) {\n        this.data = data;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentsCreateRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class DocumentsCreateRequest {\n    @SerializedName(\"id\")\n    private String knowledgeBaseId;\n    private String contentFormat;\n    private Source source;\n    private ProcessOption processOption;\n\n    public DocumentsCreateRequest(String knowledgeBaseId, String contentFormat, Source source,\n            ProcessOption processOption) {\n        this.knowledgeBaseId = knowledgeBaseId;\n        this.contentFormat = contentFormat;\n        this.source = source;\n        this.processOption = processOption;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public String getContentFormat() {\n        return contentFormat;\n    }\n\n    public Source getSource() {\n        return source;\n    }\n\n    public ProcessOption getProcessOption() {\n        return processOption;\n    }\n\n    public static class Source {\n        private String type;\n        private String[] urls;\n        private Integer urlDepth;\n        private UrlConfig[] urlConfigs;\n\n        public Source(String type, String[] urls, Integer urlDepth) {\n            this.type = type;\n            this.urls = urls;\n            this.urlDepth = urlDepth;\n        }\n\n        public Source(String type, String[] urls, Integer urlDepth, UrlConfig[] urlConfigs) {\n            this.type = type;\n            this.urls = urls;\n            this.urlDepth = urlDepth;\n            this.urlConfigs = urlConfigs;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public String[] getUrls() {\n            return urls;\n        }\n\n        public Integer getUrlDepth() {\n            return urlDepth;\n        }\n\n        public UrlConfig[] getUrlConfigs() {\n            return urlConfigs;\n        }\n\n        public void setUrlConfigs(UrlConfig[] urlConfigs) {\n            this.urlConfigs = urlConfigs;\n        }\n\n        public static class UrlConfig {\n            private Integer frequency;\n\n            public UrlConfig(Integer frequency) {\n                this.frequency = frequency;\n            }\n\n            public Integer getFrequency() {\n                return frequency;\n            }\n\n            public void setFrequency(Integer frequency) {\n                this.frequency = frequency;\n            }\n        }\n    }\n\n    public static class ProcessOption {\n        private String template;\n        private Parser parser;\n        private Chunker chunker;\n        private KnowledgeAugmentation knowledgeAugmentation;\n\n        public ProcessOption(String template, Parser parser, Chunker chunker,\n                KnowledgeAugmentation knowledgeAugmentation) {\n            this.template = template;\n            this.parser = parser;\n            this.chunker = chunker;\n            this.knowledgeAugmentation = knowledgeAugmentation;\n        }\n\n        public String getTemplate() {\n            return template;\n        }\n\n        public Parser getParser() {\n            return parser;\n        }\n\n        public Chunker getChunker() {\n            return chunker;\n        }\n\n        public KnowledgeAugmentation getKnowledgeAugmentation() {\n            return knowledgeAugmentation;\n        }\n\n        public static class Parser {\n            private String[] choices;\n\n            public Parser(String[] choices) {\n                this.choices = choices;\n            }\n\n            public String[] getChoices() {\n                return choices;\n            }\n        }\n\n        public static class Chunker {\n            private String[] choices;\n            private Separator separator;\n            private Pattern pattern;\n            private String[] prependInfo;\n\n            public Chunker(String[] choices, Separator separator, Pattern pattern,\n                    String[] prependInfo) {\n                this.choices = choices;\n                this.separator = separator;\n                this.pattern = pattern;\n                this.prependInfo = prependInfo;\n            }\n\n            public String[] getChoices() {\n                return choices;\n            }\n\n            public Separator getSeparator() {\n                return separator;\n            }\n\n            public Pattern getPattern() {\n                return pattern;\n            }\n\n            public String[] getPrependInfo() {\n                return prependInfo;\n            }\n\n            public static class Separator {\n                private String[] separators;\n                private Integer targetLength;\n                private Double overlapRate;\n\n                public Separator(String[] separators, Integer targetLength, Double overlapRate) {\n                    this.separators = separators;\n                    this.targetLength = targetLength;\n                    this.overlapRate = overlapRate;\n                }\n\n                public String[] getSeparators() {\n                    return separators;\n                }\n\n                public Integer getTargetLength() {\n                    return targetLength;\n                }\n\n                public Double getOverlapRate() {\n                    return overlapRate;\n                }\n            }\n\n            public static class Pattern {\n                private String markPosition;\n                private String regex;\n                private Integer targetLength;\n                private Double overlapRate;\n\n                public Pattern(String markPosition, String regex, Integer targetLength,\n                        Double overlapRate) {\n                    this.markPosition = markPosition;\n                    this.regex = regex;\n                    this.targetLength = targetLength;\n                    this.overlapRate = overlapRate;\n                }\n\n                public String getMarkPosition() {\n                    return markPosition;\n                }\n\n                public String getRegex() {\n                    return regex;\n                }\n\n                public Integer getTargetLength() {\n                    return targetLength;\n                }\n\n                public Double getOverlapRate() {\n                    return overlapRate;\n                }\n            }\n        }\n\n        public static class KnowledgeAugmentation {\n            private String[] choices;\n\n            public KnowledgeAugmentation(String[] choices) {\n                this.choices = choices;\n            }\n\n            public String[] getChoices() {\n                return choices;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentsCreateResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class DocumentsCreateResponse {\n    private String requestId;\n    private String[] documentIds;\n    public String getRequestId() {\n        return requestId;\n    }\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n    public String[] getDocumentIds() {\n        return documentIds;\n    }\n    public void setDocumentIds(String[] documentIds) {\n        this.documentIds = documentIds;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentsDescribeRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class DocumentsDescribeRequest {\n    private String knowledgeBaseId;\n    private String marker;\n    private Integer maxKeys;\n\n    public DocumentsDescribeRequest(String marker, Integer maxKeys) {\n        this.marker = marker;\n        this.maxKeys = maxKeys;\n    }\n\n    public DocumentsDescribeRequest(String knowledgeBaseId, String marker, Integer maxKeys) {\n        this.knowledgeBaseId = knowledgeBaseId;\n        this.marker = marker;\n        this.maxKeys = maxKeys;\n    }\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getMarker() {\n        return marker;\n    }\n\n    public void setMarker(String marker) {\n        this.marker = marker;\n    }\n\n    public Integer getMaxKeys() {\n        return maxKeys;\n    }\n\n    public void setMaxKeys(Integer maxKeys) {\n        this.maxKeys = maxKeys;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentsDescribeResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class DocumentsDescribeResponse {\n    private DocumentDescribeResponse[] data;\n    private String marker;\n    private boolean isTruncated;\n    private String nextMarker;\n    private Integer maxKeys;\n\n    public DocumentDescribeResponse[] getData() {\n        return data;\n    }\n\n    public void setData(DocumentDescribeResponse[] data) {\n        this.data = data;\n    }\n\n    public String getMarker() {\n        return marker;\n    }\n\n    public void setMarker(String marker) {\n        this.marker = marker;\n    }\n\n    public boolean isTruncated() {\n        return isTruncated;\n    }\n\n    public void setTruncated(boolean isTruncated) {\n        this.isTruncated = isTruncated;\n    }\n\n    public String getNextMarker() {\n        return nextMarker;\n    }\n\n    public void setNextMarker(String nextMarker) {\n        this.nextMarker = nextMarker;\n    }\n\n    public Integer getMaxKeys() {\n        return maxKeys;\n    }\n\n    public void setMaxKeys(Integer maxKeys) {\n        this.maxKeys = maxKeys;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/DocumentsUploadResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class DocumentsUploadResponse {\n    private String requestId;\n    private String documentId;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getDocumentId() {\n        return documentId;\n    }\n\n    public void setDocumentId(String documentId) {\n        this.documentId = documentId;\n    }\n}"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/FileUploadResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class FileUploadResponse {\n    @SerializedName(\"request_id\")\n    private String requestId;\n    private String id;\n    private String code;\n    private String message;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public String getCode() {\n        return code;\n    }\n\n    public void setCode(String code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    @Override\n    public String toString() {\n        return \"FileUploadResponse{\" +\n                \"request_id=\" + requestId +\n                \", code='\" + code + '\\'' +\n                \", message='\" + message +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseConfig.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class KnowledgeBaseConfig {\n    private Index index;\n    private Catalogue catalogue;\n\n    public KnowledgeBaseConfig(Index index) {\n        this.index = index;\n    }\n\n    public KnowledgeBaseConfig(Index index, Catalogue catalogue) {\n        this.index = index;\n        this.catalogue = catalogue;\n    }\n\n    public Index getIndex() {\n        return index;\n    }\n\n    public void setIndex(Index index) {\n        this.index = index;\n    }\n\n    public void setCatalogue(Catalogue catalogue) {\n        this.catalogue = catalogue;\n    }\n\n    public Catalogue getCatalogue() {\n        return catalogue;\n    }\n\n    public static class Index {\n        private String type;\n        private String clusterId;\n        private String username;\n        private String password;\n        private String location;\n\n        public Index(String type, String clusterId, String username, String password, String location) {\n            this.type = type;\n            this.clusterId = clusterId;\n            this.username = username;\n            this.password = password;\n            this.location = location;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public String getClusterId() {\n            return clusterId;\n        }\n\n        public String getUsername() {\n            return username;\n        }\n\n        public String getPassword() {\n            return password;\n        }\n\n        public String getLocation() {\n            return location;\n        }\n    }\n\n    public static class Catalogue {\n        private String pathPrefix;\n        \n        public void setPathPrefix(String pathPrefix) {\n            this.pathPrefix = pathPrefix;\n        }\n\n        public String getPathPrefix() {\n            return pathPrefix;\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseDetail.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class KnowledgeBaseDetail {\n    private String id;\n    private String name;\n    private String description;\n    private KnowledgeBaseConfig config;\n\n    public String getId() {\n        return id;\n    }\n\n    public void setId(String id) {\n        this.id = id;\n    }\n\n    public KnowledgeBaseConfig getConfig() {\n        return config;\n    }\n\n    public void setConfig(KnowledgeBaseConfig config) {\n        this.config = config;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getDescription() {\n        return description;\n    }\n\n    public void setDescription(String description) {\n        this.description = description;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseDetailRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class KnowledgeBaseDetailRequest {\n    @SerializedName(\"id\")\n    private String knowledgeBaseId;\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseListRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class KnowledgeBaseListRequest {\n    // 起始位置\n    private String marker;\n    // 数据大小，默认10，最大值100\n    private Integer maxKeys;\n    // 搜索关键字\n    private String keyword;\n\n    public KnowledgeBaseListRequest(String marker, Integer maxKeys, String keyword) {\n        this.maxKeys = maxKeys;\n        this.marker = marker;\n        this.keyword = keyword;\n    }\n\n    public String getMarker() {\n        return marker;\n    }\n\n    public int getMaxKeys() {\n        return maxKeys;\n    }\n\n    public String getKeyword() {\n        return keyword;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseListResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\npublic class KnowledgeBaseListResponse {\n    private String requestId;\n    private KnowledgeBaseDetail[] data;\n    private String marker;\n    private boolean isTruncated;\n    private String nextMarker;\n    private int maxKeys;\n\n    public String getRequestId() {\n        return requestId;\n    }\n\n    public void setRequestId(String requestId) {\n        this.requestId = requestId;\n    }\n\n    public KnowledgeBaseDetail[] getData() {\n        return data;\n    }\n\n    public void setData(KnowledgeBaseDetail[] data) {\n        this.data = data;\n    }\n\n    public String getMarker() {\n        return marker;\n    }\n\n    public void setMarker(String marker) {\n        this.marker = marker;\n    }\n\n    public boolean isTruncated() {\n        return isTruncated;\n    }\n\n    public void setTruncated(boolean isTruncated) {\n        this.isTruncated = isTruncated;\n    }\n\n    public String getNextMarker() {\n        return nextMarker;\n    }\n\n    public void setNextMarker(String nextMarker) {\n        this.nextMarker = nextMarker;\n    }\n\n    public int getMaxKeys() {\n        return maxKeys;\n    }\n\n    public void setMaxKeys(int maxKeys) {\n        this.maxKeys = maxKeys;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseModifyRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class KnowledgeBaseModifyRequest {\n    @SerializedName(\"id\")\n    private String knowledgeBaseId;\n    private String name;\n    private String description;\n    private KnowledgeBaseConfig config;\n\n    public String getKnowledgeBaseId() {\n        return knowledgeBaseId;\n    }\n\n    public void setKnowledgeBaseId(String knowledgeBaseId) {\n        this.knowledgeBaseId = knowledgeBaseId;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getDescription() {\n        return description;\n    }\n\n    public void setDescription(String description) {\n        this.description = description;\n    }\n\n    public KnowledgeBaseConfig getConfig() {\n        return config;\n    }\n\n    public void setConfig(KnowledgeBaseConfig config) {\n        this.config = config;\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/QueryKnowledgeBaseRequest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport java.util.List;\n\npublic class QueryKnowledgeBaseRequest {\n    private String query;\n    private String type;\n    private Float rank_score_threshold;\n    private Integer top;\n    private Integer skip;\n    private String[] knowledgebase_ids;\n    private MetadataFilters metadata_filters;\n    private QueryPipelineConfig pipeline_config;\n\n    public QueryKnowledgeBaseRequest(String query, String type, Float rank_score_threshold, Integer top, Integer skip,\n            String[] knowledgebase_ids, MetadataFilters metadata_filters,\n            QueryPipelineConfig pipeline_config) {\n        this.query = query;\n        this.type = type;\n        this.rank_score_threshold = rank_score_threshold;\n        this.top = top;\n        this.skip = skip;\n        this.knowledgebase_ids = knowledgebase_ids;\n        this.metadata_filters = metadata_filters;\n        this.pipeline_config = pipeline_config;\n    }\n\n    public String getQuery() {\n        return query;\n    }\n\n    public void setQuery(String query) {\n        this.query = query;\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n\n    public Float getRank_score_threshold() {\n        return rank_score_threshold;\n    }\n\n    public void setRank_score_threshold(Float rank_score_threshold) {\n        this.rank_score_threshold = rank_score_threshold;\n    }\n\n    public Integer getTop() {\n        return top;\n    }\n\n    public void setTop(Integer top) {\n        this.top = top;\n    }\n\n    public Integer getSkip() {\n        return skip;\n    }\n\n    public void setSkip(Integer skip) {\n        this.skip = skip;\n    }\n\n    public String[] getKnowledgebase_ids() {\n        return knowledgebase_ids;\n    }\n\n    public void setKnowledgebase_ids(String[] knowledgebase_ids) {\n        this.knowledgebase_ids = knowledgebase_ids;\n    }\n\n    public MetadataFilters getMetadata_filters() {\n        return metadata_filters;\n    }\n\n    public void setMetadata_filters(MetadataFilters metadata_filters) {\n        this.metadata_filters = metadata_filters;\n    }\n\n    public QueryPipelineConfig getPipeline_config() {\n        return pipeline_config;\n    }\n\n    public void setPipeline_config(QueryPipelineConfig pipeline_config) {\n        this.pipeline_config = pipeline_config;\n    }\n\n    public static class MetadataFilter {\n        private String operator;\n        private String field;\n        private Object value;\n\n        public String getOperator() {\n            return operator;\n        }\n\n        public void setOperator(String operator) {\n            this.operator = operator;\n        }\n\n        public String getField() {\n            return field;\n        }\n\n        public void setField(String field) {\n            this.field = field;\n        }\n\n        public Object getValue() {\n            return value;\n        }\n\n        public void setValue(Object value) {\n            this.value = value;\n        }\n    }\n\n    public static class MetadataFilters {\n        private List<MetadataFilter> filters;\n        private String condition;\n\n        public List<MetadataFilter> getFilters() {\n            return filters;\n        }\n\n        public void setFilters(List<MetadataFilter> filters) {\n            this.filters = filters;\n        }\n\n        public String getCondition() {\n            return condition;\n        }\n\n        public void setCondition(String condition) {\n            this.condition = condition;\n        }\n    }\n\n    public static class PreRankingConfig {\n        private Double bm25_weight;\n        private Double vec_weight;\n        private Double bm25_b;\n        private Double bm25_k1;\n        private Double bm25_max_score;\n\n        public Double getBm25_weight() {\n            return bm25_weight;\n        }\n\n        public void setBm25_weight(Double bm25_weight) {\n            this.bm25_weight = bm25_weight;\n        }\n\n        public Double getVec_weight() {\n            return vec_weight;\n        }\n\n        public void setVec_weight(Double vec_weight) {\n            this.vec_weight = vec_weight;\n        }\n\n        public Double getBm25_b() {\n            return bm25_b;\n        }\n\n        public void setBm25_b(Double bm25_b) {\n            this.bm25_b = bm25_b;\n        }\n\n        public Double getBm25_k1() {\n            return bm25_k1;\n        }\n\n        public void setBm25_k1(Double bm25_k1) {\n            this.bm25_k1 = bm25_k1;\n        }\n\n        public Double getBm25_max_score() {\n            return bm25_max_score;\n        }\n\n        public void setBm25_max_score(Double bm25_max_score) {\n            this.bm25_max_score = bm25_max_score;\n        }\n    }\n\n    public static class ElasticSearchRetrieveConfig {\n        private String name;\n        private String type;\n        private Double threshold;\n        private Integer top;\n\n        public String getName() {\n            return name;\n        }\n\n        public void setName(String name) {\n            this.name = name;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public void setType(String type) {\n            this.type = type;\n        }\n\n        public Double getThreshold() {\n            return threshold;\n        }\n\n        public void setThreshold(Double threshold) {\n            this.threshold = threshold;\n        }\n\n        public Integer getTop() {\n            return top;\n        }\n\n        public void setTop(Integer top) {\n            this.top = top;\n        }\n    }\n\n    public static class VectorDBRetrieveConfig {\n        private String name;\n        private String type;\n        private Double threshold;\n        private Integer top;\n\n        public String getName() {\n            return name;\n        }\n\n        public void setName(String name) {\n            this.name = name;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public void setType(String type) {\n            this.type = type;\n        }\n\n        public Double getThreshold() {\n            return threshold;\n        }\n\n        public void setThreshold(Double threshold) {\n            this.threshold = threshold;\n        }\n\n        public Integer getTop() {\n            return top;\n        }\n\n        public void setTop(Integer top) {\n            this.top = top;\n        }\n    }\n\n\n    public static class RankingConfig {\n        private String name;\n        private String type;\n        private List<String> inputs;\n        private String model_name;\n        private Integer top;\n\n        public String getName() {\n            return name;\n        }\n\n        public void setName(String name) {\n            this.name = name;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public void setType(String type) {\n            this.type = type;\n        }\n\n        public List<String> getInputs() {\n            return inputs;\n        }\n\n        public void setInputs(List<String> inputs) {\n            this.inputs = inputs;\n        }\n\n        public String getModel_name() {\n            return model_name;\n        }\n\n        public void setModel_name(String model_name) {\n            this.model_name = model_name;\n        }\n\n        public Integer getTop() {\n            return top;\n        }\n\n        public void setTop(Integer top) {\n            this.top = top;\n        }\n    }\n\n    public static class SmallToBigConfig {\n        private String name;\n        private String type;\n\n        public String getName() {\n            return name;\n        }\n\n        public void setName(String name) {\n            this.name = name;\n        }\n\n        public String getType() {\n            return type;\n        }\n\n        public void setType(String type) {\n            this.type = type;\n        }\n\n    }\n\n    public static class QueryPipelineConfig {\n        private String id;\n        private List<Object> pipeline; \n\n        public String getId() {\n            return id;\n        }\n\n        public void setId(String id) {\n            this.id = id;\n        }\n\n        public List<Object> getPipeline() {\n            return pipeline;\n        }\n\n        public void setPipeline(List<Object> pipeline) {\n            this.pipeline = pipeline;\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/knowledgebase/QueryKnowledgeBaseResponse.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport java.util.List;\nimport java.util.Map;\n\npublic class QueryKnowledgeBaseResponse {\n    private String requestId;\n    private String code;\n    private String message;\n    private List<Chunk> chunks;\n    private int total_count;\n\n    public String getRequestId() { return requestId; }\n\n    public void setRequestId(String requestId) { this.requestId = requestId; }\n\n    public String getCode() { return code; }\n\n    public void setCode(String code) { this.code = code; }\n\n    public String getMessage() { return message; }\n\n    public void setMessage(String message) { this.message = message; }\n\n    public List<Chunk> getChunks() { return chunks; }\n\n    public void setChunks(List<Chunk> chunks) { this.chunks = chunks; }\n\n    public int getTotal_count() { return total_count; }\n\n    public void setTotal_count(int total_count) { this.total_count = total_count; }\n\n    public static class Chunk {\n        private String chunk_id;\n        private String knowledgebase_id;\n        private String document_id;\n        private String document_name;\n        private Map<String, Object> meta;\n        private String type;\n        private String content;\n        private String create_time;\n        private String update_time;\n        private float retrieval_score;\n        private float rank_score;\n        private ChunkLocation locations;\n        private List<Chunk> children;\n        private List<Chunk> neighbour_chunks;\n        private String original_chunk_id;\n        private Integer original_chunk_offset;\n\n        public String getChunk_id() { return chunk_id; }\n\n        public void setChunk_id(String chunk_id) { this.chunk_id = chunk_id; }\n\n        public String getKnowledgebase_id() { return knowledgebase_id; }\n\n        public void setKnowledgebase_id(String knowledgebase_id) { this.knowledgebase_id = knowledgebase_id; }\n\n        public String getDocument_id() { return document_id; }\n\n        public void setDocument_id(String document_id) { this.document_id = document_id; }\n\n        public String getDocument_name() { return document_name; }\n\n        public void setDocument_name(String document_name) { this.document_name = document_name; }\n\n        public Map<String, Object> getMeta() { return meta; }\n\n        public void setMeta(Map<String, Object> meta) { this.meta = meta; }\n\n        public String getType() { return type; }\n\n        public void setType(String type) { this.type = type; }\n\n        public String getContent() { return content; }\n\n        public void setContent(String content) { this.content = content; }\n\n        public String getCreate_time() { return create_time; }\n\n        public void setCreate_time(String create_time) { this.create_time = create_time; }\n\n        public String getUpdate_time() { return update_time; }\n\n        public void setUpdate_time(String update_time) { this.update_time = update_time; }\n\n        public float getRetrieval_score() { return retrieval_score; }\n\n        public void setRetrieval_score(float retrieval_score) { this.retrieval_score = retrieval_score; }\n\n        public float getRank_score() { return rank_score; }\n\n        public void setRank_score(float rank_score) { this.rank_score = rank_score; }\n\n        public ChunkLocation getLocations() { return locations; }\n\n        public void setLocations(ChunkLocation locations) { this.locations = locations; }\n\n        public List<Chunk> getChildren() { return children; }\n\n        public void setChildren(List<Chunk> children) { this.children = children; }\n\n        public List<Chunk> getNeighbour_chunks() { return neighbour_chunks; }\n\n        public void setNeighbour_chunks(List<Chunk> neighbour_chunks) { this.neighbour_chunks = neighbour_chunks; }\n\n        public String getOriginal_chunk_id() { return original_chunk_id; }\n\n        public void setOriginal_chunk_id(String original_chunk_id) { this.original_chunk_id = original_chunk_id; }\n\n        public Integer getOriginal_chunk_offset() { return original_chunk_offset; }\n\n        public void setOriginal_chunk_offset(Integer original_chunk_offset) { this.original_chunk_offset = original_chunk_offset; }\n    }\n\n    public static class ChunkLocation {\n        private List<Integer> paget_num;\n        private List<List<Integer>> box;\n\n        public List<Integer> getPaget_num() {\n            return paget_num;\n        }\n\n        public void setPaget_num(List<Integer> paget_num) {\n            this.paget_num = paget_num;\n        }\n\n        public List<List<Integer>> getBox() {\n            return box;\n        }\n\n        public void setBox(List<List<Integer>> box) {\n            this.box = box;\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/rag/EventContent.java",
    "content": "package com.baidubce.appbuilder.model.rag;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class EventContent {\n    @SerializedName(\"event_code\")\n    String eventCode;\n    @SerializedName(\"event_message\")\n    String enentMessage;\n    @SerializedName(\"node_name\")\n    String nodeName;\n    @SerializedName(\"dependency_nodes\")\n    String[] dependencyNodes;\n    @SerializedName(\"event_type\")\n    String eventType;\n    @SerializedName(\"event_id\")\n    String eventId;\n    @SerializedName(\"event_status\")\n    String eventStatus;\n\n    @SerializedName(\"content_type\")\n    String contentType;\n\n    Map<String, Object> outputs;\n\n    HashMap<String, String> detail;\n\n    public String getEventCode() {\n        return eventCode;\n    }\n\n    public void setEventCode(String eventCode) {\n        this.eventCode = eventCode;\n    }\n\n    public String getEnentMessage() {\n        return enentMessage;\n    }\n\n    public void setEnentMessage(String enentMessage) {\n        this.enentMessage = enentMessage;\n    }\n\n    public String getNodeName() {\n        return nodeName;\n    }\n\n    public void setNodeName(String nodeName) {\n        this.nodeName = nodeName;\n    }\n\n    public String[] getDependencyNodes() {\n        return dependencyNodes;\n    }\n\n    public void setDependencyNodes(String[] dependencyNodes) {\n        this.dependencyNodes = dependencyNodes;\n    }\n\n    public String getEventType() {\n        return eventType;\n    }\n\n    public void setEventType(String eventType) {\n        this.eventType = eventType;\n    }\n\n    public String getEventId() {\n        return eventId;\n    }\n\n    public void setEventId(String eventId) {\n        this.eventId = eventId;\n    }\n\n    public String getEventStatus() {\n        return eventStatus;\n    }\n\n    public void setEventStatus(String eventStatus) {\n        this.eventStatus = eventStatus;\n    }\n\n    public String getContentType() {\n        return contentType;\n    }\n\n    public void setContentType(String contentType) {\n        this.contentType = contentType;\n    }\n\n    public Map<String, Object> getOutputs() {\n        return outputs;\n    }\n\n    public void setOutputs(Map<String, Object> outputs) {\n        this.outputs = outputs;\n    }\n\n    public HashMap<String, String> getDetail() {\n        return detail;\n    }\n\n    public void setDetail(HashMap<String, String> detail) {\n        this.detail = detail;\n    }\n\n    @Override\n    public String toString() {\n        return \"EventContent{\" +\n                \"eventCode='\" + eventCode + '\\'' +\n                \", enentMessage='\" + enentMessage + '\\'' +\n                \", nodeName='\" + nodeName + '\\'' +\n                \", dependencyNodes=\" + Arrays.toString(dependencyNodes) +\n                \", eventType='\" + eventType + '\\'' +\n                \", eventId='\" + eventId + '\\'' +\n                \", eventStatus='\" + eventStatus + '\\'' +\n                \", contentType='\" + contentType + '\\'' +\n                \", outputs=\" + outputs +\n                \", detail=\" + detail +\n                '}';\n    }\n}\n\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/rag/RAGIterator.java",
    "content": "package com.baidubce.appbuilder.model.rag;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.base.utils.http.HttpResponse;\nimport com.baidubce.appbuilder.base.utils.iterator.StreamIterator;\n\npublic class RAGIterator {\n    private final HttpResponse<StreamIterator<RAGResponse>> resp;\n    private final StreamIterator<RAGResponse> iterator;\n\n    public RAGIterator(HttpResponse<StreamIterator<RAGResponse>> resp) {\n        this.resp = resp;\n        this.iterator = resp.getBody();\n    }\n\n    public boolean hasNext() {\n        return iterator.hasNext();\n    }\n\n    public RAGResponse next() throws AppBuilderServerException {\n        RAGResponse ragResponse = iterator.next();\n        if (ragResponse.getCode() != 0) {\n            throw new AppBuilderServerException(resp.getRequestId(), resp.getCode(), resp.getMessage(),\n                    ragResponse.getCode(), ragResponse.getMessage());\n        }\n        return ragResponse;\n    }\n\n    public void close(){\n        iterator.close();\n    }\n}\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/rag/RAGResponse.java",
    "content": "package com.baidubce.appbuilder.model.rag;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic class RAGResponse {\n    private int code;\n    private String message;\n    @SerializedName(\"trace_id\")\n    private String traceId;\n    private long time;\n    private RAGResult result;\n\n    public String getTraceId() {\n        return traceId;\n    }\n\n    public void setTraceId(String traceId) {\n        this.traceId = traceId;\n    }\n\n    public long getTime() {\n        return time;\n    }\n\n    public void setTime(int time) {\n        this.time = time;\n    }\n\n    public RAGResult getResult() {\n        return result;\n    }\n\n    public void setResult(RAGResult result) {\n        this.result = result;\n    }\n\n    public int getCode() {\n        return code;\n    }\n\n    public void setCode(int code) {\n        this.code = code;\n    }\n\n    public String getMessage() {\n        return message;\n    }\n\n    public void setMessage(String message) {\n        this.message = message;\n    }\n\n    @Override\n    public String toString() {\n        return \"RAGResponse{\" +\n                \"code=\" + code +\n                \", message='\" + message + '\\'' +\n                \", traceId='\" + traceId + '\\'' +\n                \", time=\" + time +\n                \", result=\" + result +\n                '}';\n    }\n}\n\n"
  },
  {
    "path": "java/src/main/java/com/baidubce/appbuilder/model/rag/RAGResult.java",
    "content": "package com.baidubce.appbuilder.model.rag;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.Arrays;\n\npublic class RAGResult {\n    private String answer;\n    @SerializedName(\"conversation_id\")\n    private String conversationId;\n    @SerializedName(\"message_id\")\n    private String messageId;\n    @SerializedName(\"is_completion\")\n    private Object isCompletion;\n\n    private String prototype;\n\n    private EventContent[] content;\n\n    public String getAnswer() {\n        return answer;\n    }\n\n    public void setAnswer(String answer) {\n        this.answer = answer;\n    }\n\n    public String getConversationId() {\n        return conversationId;\n    }\n\n    public void setConversationId(String conversationId) {\n        this.conversationId = conversationId;\n    }\n\n    public String getMessageId() {\n        return messageId;\n    }\n\n    public void setMessageId(String messageId) {\n        this.messageId = messageId;\n    }\n\n    public Object getIsCompletion() {\n        return isCompletion;\n    }\n\n    public void setIsCompletion(Object isCompletion) {\n        this.isCompletion = isCompletion;\n    }\n\n    public String getPrototype() {\n        return prototype;\n    }\n\n    public void setPrototype(String prototype) {\n        this.prototype = prototype;\n    }\n\n    public EventContent[] getContent() {\n        return content;\n    }\n\n    public void setContent(EventContent[] content) {\n        this.content = content;\n    }\n\n    @Override\n    public String toString() {\n        return \"RAGResult{\" +\n                \"answer='\" + answer + '\\'' +\n                \", conversationId='\" + conversationId + '\\'' +\n                \", messageId='\" + messageId + '\\'' +\n                \", isCompletion=\" + isCompletion +\n                \", prototype='\" + prototype + '\\'' +\n                \", content=\" + Arrays.toString(content) +\n                '}';\n    }\n}\n"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/AISearchTest.java",
    "content": "package com.baidubce.appbuilder;\n\nimport static org.junit.Assert.assertTrue;\n\nimport java.io.IOException;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport com.google.gson.Gson;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.aisearch.AISearch;\nimport com.baidubce.appbuilder.model.aisearch.AISearchIterator;\nimport com.baidubce.appbuilder.model.aisearch.AISearchRequest;\nimport com.baidubce.appbuilder.model.aisearch.AISearchResponse;\n\npublic class AISearchTest {\n    @Before\n    public void setUp() {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN\"));\n        System.setProperty(\"APPBUILDER_LOGLEVEL\", \"DEBUG\");\n    }\n\n    @Test\n    public void TestBaseSearch() throws IOException, AppBuilderServerException {\n        AISearch client = new AISearch();\n        AISearchRequest request = new AISearchRequest();\n        AISearchRequest.Message[] messages = { new AISearchRequest.Message(\"user\", \"查询今天天气\") };\n        request.setMessages(messages);\n        AISearchIterator iter = client.run(request);\n        while (iter.hasNext()) {\n            AISearchResponse response = iter.next();\n            Gson gson = new Gson();\n            String json = gson.toJson(response);\n            System.out.println(json);\n            assertTrue(response.getReferences().size() > 0);\n        }\n    }\n\n    @Test\n    public void TestAISearch() throws IOException, AppBuilderServerException {\n        AISearch client = new AISearch();\n        AISearchRequest request = new AISearchRequest();\n        AISearchRequest.Message[] messages = { new AISearchRequest.Message(\"user\", \"查询今天天气\") };\n        request.setMessages(messages).setModel(\"deepseek-v3.1-250821\");\n        AISearchIterator iter = client.run(request);\n        while (iter.hasNext()) {\n            AISearchResponse response = iter.next();\n            Gson gson = new Gson();\n            String json = gson.toJson(response);\n            System.out.println(json);\n            assertTrue(response.getReferences().size() > 0);\n        }\n    }\n\n    @Test\n    public void TestAISearchStream() throws IOException, AppBuilderServerException {\n        AISearch client = new AISearch();\n        AISearchRequest request = new AISearchRequest();\n        AISearchRequest.Message[] messages = { new AISearchRequest.Message(\"user\", \"查询今天天气\") };\n        request.setMessages(messages).setModel(\"deepseek-v3.1-250821\").setStream(true);\n        AISearchIterator iter = client.run(request);\n        while (iter.hasNext()) {\n            AISearchResponse response = iter.next();\n            Gson gson = new Gson();\n            String json = gson.toJson(response);\n            System.out.println(json);\n        }\n    }\n}\n"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/AgentBuilderTest.java",
    "content": "package com.baidubce.appbuilder;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.model.agentbuilder.AgentBuilderIterator;\n\nimport java.io.IOException;\n\nimport com.baidubce.appbuilder.model.agentbuilder.AgentBuilderResult;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\nimport com.baidubce.appbuilder.console.agentbuilder.AgentBuilder;\n\npublic class AgentBuilderTest{\n    String appId;\n\n    @Before\n    public void setUp() {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN\"));\n        System.setProperty(\"APPBUILDER_LOGLEVEL\", \"INFO\");\n        appId = \"aa8af334-df27-4855-b3d1-0d249c61fc08\";\n    }\n\n    @Test\n    public void testAgentBuilder() throws IOException, AppBuilderServerException {\n        AgentBuilder builder = new AgentBuilder(appId);\n        String conversationId = builder.createConversation();\n        assertNotNull(conversationId);\n        String fileId = builder.uploadLocalFile(conversationId, \"src/test/java/com/baidubce/appbuilder/files/test.pdf\");\n        assertNotNull(fileId);\n        AgentBuilderIterator itor = builder.run(\"北京有多少小学生\", conversationId, new String[]{fileId}, true);\n        assertTrue(itor.hasNext());\n        while (itor.hasNext()) {\n            AgentBuilderResult result = itor.next();\n            System.out.println(result);\n\n        }\n    }\n\n    @Test(expected = AppBuilderServerException.class)\n    public void testCreateConversation_AppBuilderServerException() throws IOException, AppBuilderServerException {\n        AgentBuilder builder = new AgentBuilder(\"appId\");\n        builder.createConversation();\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/AppBuilderClientTest.java",
    "content": "package com.baidubce.appbuilder;\n\nimport java.io.IOException;\nimport java.nio.file.Paths;\nimport java.nio.file.Files;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Stack;\nimport java.util.List;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientIterator;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientResult;\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppBuilderClient;\nimport com.baidubce.appbuilder.console.appbuilderclient.AppList;\nimport com.baidubce.appbuilder.console.appbuilderclient.App;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppListRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppsDescribeRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.Event;\nimport com.baidubce.appbuilder.model.appbuilderclient.EventContent;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientRunRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppDescribeResponse;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientFeedbackRequest;\nimport com.baidubce.appbuilder.model.appbuilderclient.AppBuilderClientFeedbackResponse;\n\n\nimport static org.junit.Assert.*;\n\npublic class AppBuilderClientTest {\n    String appId;\n    String chatflowAppId;\n    String followupqueryId;\n    String describeAppId;\n\n    @Before\n    public void setUp() {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN\"));\n        System.setProperty(\"APPBUILDER_LOGLEVEL\", \"DEBUG\");\n        appId = \"aa8af334-df27-4855-b3d1-0d249c61fc08\";\n        describeAppId = \"b2a972c5-e082-46e5-b313-acbf51792422\";\n        chatflowAppId = \"4403205e-fb83-4fac-96d8-943bdb63796f\";\n        followupqueryId = \"fb64d96b-f828-4385-ba1d-835298d635a9\";\n    }\n\n    @Test\n    public void GetAppsTest() throws IOException, AppBuilderServerException {\n        AppList builder = new AppList();\n        AppListRequest request = new AppListRequest();\n        request.setLimit(10);\n        assertNotNull(builder.getAppList(request)[0].getId());\n    }\n\n    @Test\n    public void DescribeAppTest() throws IOException, AppBuilderServerException {\n        App app = new App();\n        AppDescribeResponse appInfo = app.describeApp(describeAppId);\n        System.out.println(appInfo);\n        assertNotNull(appInfo);\n        AppDescribeResponse chatflowAppInfo = app.describeApp(chatflowAppId);\n        System.out.println(chatflowAppInfo);\n        assertNotNull(chatflowAppInfo);\n    }\n\n    @Test\n    public void DescribeAppsTest() throws IOException, AppBuilderServerException {\n        AppList appList = new AppList();\n        AppsDescribeRequest request = new AppsDescribeRequest();\n        assertNotNull(appList.describeApps(request).getData()[0].getId());\n    }\n\n    @Test\n    public void AppBuilderClientRunTest() throws IOException, AppBuilderServerException {\n        AppBuilderClient builder = new AppBuilderClient(followupqueryId);\n        String conversationId = builder.createConversation();\n        assertNotNull(conversationId);\n        builder.uploadFile(conversationId, \"src/test/java/com/baidubce/appbuilder/files/test.pdf\", \"\");\n        builder.uploadFile(conversationId, \"\", \n                \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad6862cf937c03f8c5260d51c6ae\");\n        String fileId = builder.uploadLocalFile(conversationId,\n                \"src/test/java/com/baidubce/appbuilder/files/test.pdf\");\n        assertNotNull(fileId);\n        AppBuilderClientIterator itor =\n                builder.run(\"北京有多少小学生\", conversationId, new String[] {fileId}, true);\n        assertTrue(itor.hasNext());\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            for (Event event : result.getEvents()) {\n                if (!event.getContentType().equals(EventContent.JsonContentType)\n                        || !event.getEventType().equals(Event.FollowUpQueryEventType)) {\n                    continue;\n                }\n                Object json = event.getDetail().get(\"json\");\n                if (!(json instanceof Map)) {\n                    continue;\n                }\n\n                for (Map.Entry<?, ?> entry : ((Map<?, ?>) json).entrySet()) {\n                    if (!(entry.getKey() instanceof String && entry.getValue() instanceof List\n                            && !((List<?>) entry.getValue()).isEmpty()\n                            && ((List<?>) entry.getValue()).get(0) instanceof String)) {\n                        continue;\n                    }\n\n                    String key = (String) entry.getKey();\n                    String stringValue = (String) ((List<?>) entry.getValue()).get(0);\n\n                    if (key.equals(\"follow_up_querys\")) {\n                        System.out.println(stringValue);\n                        assert !stringValue.isEmpty();\n                    }\n                }\n            }\n        }\n    }\n\n    @Test(expected = AppBuilderServerException.class)\n    public void testCreateConversation_AppBuilderServerException()\n            throws IOException, AppBuilderServerException {\n        AppBuilderClient builder = new AppBuilderClient(\"appId\");\n        builder.createConversation();\n    }\n\n    @Test\n    public void AppBuilderClientRunFuncTest() throws IOException, AppBuilderServerException {\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n        assertNotNull(conversationId);\n        \n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(appId, conversationId, \"今天北京的天气怎么样?\", false);\n\n        String toolJson = new String(Files.readAllBytes(Paths.get(\"src/test/java/com/baidubce/appbuilder/files/toolcall.json\")));\n        request.setTools(toolJson);\n\n        AppBuilderClientIterator itor = builder.run(request);\n        assertTrue(itor.hasNext());\n        String ToolCallID = \"\";\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n        \n            Event lastEvent = result.getEvents()[result.getEvents().length - 1];\n            ToolCallID = lastEvent.getToolCalls()[lastEvent.getToolCalls().length - 1].getId();\n            System.out.println(result);\n        }\n\n        AppBuilderClientRunRequest request2 = new AppBuilderClientRunRequest(appId, conversationId);\n        request2.setToolOutputs(ToolCallID, \"北京今天35度\");\n        AppBuilderClientIterator itor2 = builder.run(request2);\n        assertTrue(itor2.hasNext());\n        while (itor2.hasNext()) {\n            AppBuilderClientResult result = itor2.next();\n            System.out.println(result);\n        }\n    }\n    \n    @Test\n    public void AppBuilderClientRunToolChoiceTest() throws IOException, AppBuilderServerException {\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n        assertNotNull(conversationId);\n\n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(appId, conversationId, \"你能干什么\", false);\n        request.setEndUserId(\"java_test_user_0\");\n        Map<String, Object> input = new HashMap<>();\n        input.put(\"city\", \"北京\");\n        AppBuilderClientRunRequest.ToolChoice.Function func = new AppBuilderClientRunRequest.ToolChoice.Function(\n                \"WeatherQuery\", input);\n        AppBuilderClientRunRequest.ToolChoice choice = new AppBuilderClientRunRequest.ToolChoice(\"function\", func);\n        request.setToolChoice(choice);\n\n        AppBuilderClientIterator itor = builder.run(request);\n        assertTrue(itor.hasNext());\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            System.out.println(result);\n        }\n    }\n    @Test\n    public void AppBuilderClientRunParametersTest() throws IOException, AppBuilderServerException {\n        appId = \"2313e282-baa6-4db6-92dd-a21e99cfd59e\";\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n        assertNotNull(conversationId);\n\n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(appId, conversationId, \"国庆假期我要回老家\", false);\n\n        Map<String, Object> parameters = new HashMap<>();\n        parameters.put(\"city\", \"信阳\");\n        request.setParameters(parameters);\n\n        AppBuilderClientIterator itor = builder.run(request);\n        assertTrue(itor.hasNext());\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            System.out.println(result);\n        }\n    }\n\n    @Test\n    public void AppBuilderClientRunChatflowTest() throws IOException, AppBuilderServerException {\n        AppBuilderClient builder = new AppBuilderClient(chatflowAppId);\n        String conversationId = builder.createConversation();\n        assertNotNull(conversationId);\n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(chatflowAppId, conversationId, \"查天气\", true);\n        AppBuilderClientIterator itor = builder.run(request);\n        assertTrue(itor.hasNext());\n        Stack<String> interruptStack = new Stack<String>();\n        String interruptEventId = \"\";\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            for (Event event : result.getEvents()) {\n                if (event.getContentType().equals(EventContent.PublishMessageContentType)) {\n                    String message = event.getDetail().get(\"message\").toString();\n                    System.out.println(message);\n                }\n                if (event.getContentType().equals(EventContent.ChatflowInterruptContentType)) {\n                    assertEquals(event.getEventType(), Event.ChatflowEventType);\n                    interruptEventId = event.getDetail().get(\"interrupt_event_id\").toString();\n                    interruptStack.push(interruptEventId);\n                    break;\n                }\n            }\n        }\n        assert interruptEventId != null && !interruptEventId.isEmpty();\n\n        interruptEventId = \"\";\n        AppBuilderClientRunRequest request2 = new AppBuilderClientRunRequest(chatflowAppId, conversationId, \"我先查个航班动态\",\n                true);\n        request2.setAction(AppBuilderClientRunRequest.Action.createAction(interruptStack.pop()));\n        AppBuilderClientIterator itor2 = builder.run(request2);\n        assertTrue(itor2.hasNext());\n        while (itor2.hasNext()) {\n            AppBuilderClientResult result2 = itor2.next();\n            for (Event event : result2.getEvents()) {\n                if (event.getContentType().equals(EventContent.PublishMessageContentType)) {\n                    String message = event.getDetail().get(\"message\").toString();\n                    System.out.println(message);\n                }\n                if (event.getContentType().equals(EventContent.ChatflowInterruptContentType)) {\n                    assertEquals(event.getEventType(), Event.ChatflowEventType);\n                    interruptEventId = event.getDetail().get(\"interrupt_event_id\").toString();\n                    interruptStack.push(interruptEventId);\n                    break;\n                }\n            }\n        }\n        assert interruptEventId != null && !interruptEventId.isEmpty();\n\n        interruptEventId = \"\";\n        AppBuilderClientRunRequest request3 = new AppBuilderClientRunRequest(chatflowAppId, conversationId, \"CA1234\",\n                true);\n        request3.setAction(AppBuilderClientRunRequest.Action.createAction(interruptStack.pop()));\n        AppBuilderClientIterator itor3 = builder.run(request3);\n        assertTrue(itor3.hasNext());\n        while (itor3.hasNext()) {\n            AppBuilderClientResult result3 = itor3.next();\n            for (Event event : result3.getEvents()) {\n                if (event.getContentType().equals(EventContent.TextContentType)) {\n                    String text = event.getDetail().get(\"text\").toString();\n                    System.out.println(text);\n                }\n                if (event.getContentType().equals(EventContent.ChatflowInterruptContentType)) {\n                    assertEquals(event.getEventType(), Event.ChatflowEventType);\n                    interruptEventId = event.getDetail().get(\"interrupt_event_id\").toString();\n                    interruptStack.push(interruptEventId);\n                    break;\n                }\n            }\n        }\n        assert interruptEventId != null && !interruptEventId.isEmpty();\n\n        boolean hasMultipleContentType = false;\n        AppBuilderClientRunRequest request4 = new AppBuilderClientRunRequest(chatflowAppId, conversationId, \"北京的\",\n                true);\n        request4.setAction(AppBuilderClientRunRequest.Action.createAction(interruptStack.pop()));\n        AppBuilderClientIterator itor4 = builder.run(request4);\n        assertTrue(itor4.hasNext());\n        while (itor4.hasNext()) {\n            AppBuilderClientResult result4 = itor4.next();\n            for (Event event : result4.getEvents()) {\n                if (event.getContentType().equals(EventContent.TextContentType)) {\n                    String text = event.getDetail().get(\"text\").toString();\n                    System.out.println(text);\n                }\n                if (event.getContentType().equals(EventContent.MultipleDialogEventContentType)) {\n                    assertEquals(event.getEventType(), Event.ChatflowEventType);\n                    hasMultipleContentType = true;\n                    break;\n                }\n            }\n        }\n        assertTrue(hasMultipleContentType);\n    }\n\n    @Test\n    public void AppBuilderClientFeedbackTest() throws IOException, AppBuilderServerException {\n        AppBuilderClient builder = new AppBuilderClient(followupqueryId);\n        String conversationId = builder.createConversation();\n        assertNotNull(conversationId);\n        String fileId = builder.uploadLocalFile(conversationId,\n                \"src/test/java/com/baidubce/appbuilder/files/test.pdf\");\n        assertNotNull(fileId);\n        AppBuilderClientIterator itor = builder.run(\"北京有多少小学生\", conversationId, new String[] { fileId }, true);\n        assertTrue(itor.hasNext());\n        String messageId = \"\";\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            messageId = result.getMessageId();\n            if (messageId != null && !messageId.isEmpty()) {\n                break;\n            }\n        }\n\n        AppBuilderClientFeedbackRequest request = new AppBuilderClientFeedbackRequest(followupqueryId, conversationId,\n                messageId, \"downvote\", new String[] { \"没有帮助\" }, \"测试\");\n        AppBuilderClientFeedbackResponse result = builder.feedback(request);\n        assertNotNull(result.getRequestId());\n    }\n\n    @Test\n    public void AppBuilderClientRunCustomMetadataTest() throws IOException, AppBuilderServerException {\n        appId = \"a3654cd9-378a-4b46-a33b-2259ca3b304e\";\n        AppBuilderClient builder = new AppBuilderClient(appId);\n        String conversationId = builder.createConversation();\n        assertNotNull(conversationId);\n\n        AppBuilderClientRunRequest request = new AppBuilderClientRunRequest(appId, conversationId, \"我要回老家相亲\", false);\n\n        AppBuilderClientRunRequest.CustomMetadata customMetadata = new AppBuilderClientRunRequest.CustomMetadata(\"这是自定义的role instruction\");\n        customMetadata.setOverrideRoleInstruction(\"# 角色任务\\n\" +\n                \"作为高情商大师，你的主要任务是根据提问，做出最佳的建议。\\n\" +\n                \"\\n\" +\n                \"# 工具能力\\n\" +\n                \"\\n\" +\n                \"无工具集提供\\n\" +\n                \"\\n\" +\n                \"# 要求与限制\\n\" +\n                \"\\n\" +\n                \"1. 输出内容的风格为幽默\\n\" +\n                \"2.输出的字数限制为100字以内\");\n        request.setCustomMetadata(customMetadata);\n        AppBuilderClientIterator itor = builder.run(request);\n        assertTrue(itor.hasNext());\n        while (itor.hasNext()) {\n            AppBuilderClientResult result = itor.next();\n            System.out.println(result.getAnswer());\n        }\n    }\n\n    @Test\n    public void AppBuilderClientClose()throws IOException, AppBuilderServerException{\n\n            String appId = \"8badfd05-5e95-4115-9b21-4c86137f1fb9\";\n\n            String text = \"你是一位顶尖的跨学科专家，任务是解决一个高度复杂、信息不完整且具有现实模糊性的问题。请遵循以下原则进行深度、严谨、分阶段的思考：\\n\" +\n                    \"不要急于给出结论。首先识别问题中的关键变量、隐含假设、潜在矛盾与信息缺口。\\n\" +\n                    \"分阶段推理：\\n\" +\n                    \"阶段一：解构问题，列出所有可能的解释框架（如经济学、系统论、博弈论、伦理学等）；\\n\" +\n                    \"阶段二：为每个框架构建逻辑链条，评估其适用性与局限性；\\n\" +\n                    \"阶段三：整合多视角，识别交叉点与冲突点；\\n\" +\n                    \"阶段四：提出一个稳健的综合方案，并明确其前提条件与风险边界。\\n\" +\n                    \"主动质疑自身推理：在每一步，问自己：“这个假设是否可靠？是否有反例？是否有更底层的机制？”\\n\" +\n                    \"量化不确定性：对关键判断标注置信度（如高/中/低），并说明依据。\\n\" +\n                    \"最终输出必须包含：\\n\" +\n                    \"核心洞见（1–2 句）\\n\" +\n                    \"完整推理路径（分步骤，带编号）\\n\" +\n                    \"未解决问题与进一步研究建议\\n\" +\n                    \"对初始问题的重新定义（如果发现原问题表述有缺陷）\\n\" +\n                    \"现在，请针对以下问题展开深度思考：在全球供应链高度脆弱的背景下，一家中国新能源车企应如何重构其电池原材料采购策略，以同时满足成本控制、地缘政治风险规避、ESG 合规与技术迭代加速四大目标？\";\n            AppBuilderClient builder = new AppBuilderClient(appId);\n            String conversationId = builder.createConversation();\n            AppBuilderClientIterator itor = builder.run(text, conversationId, new String[] {}, true);\n            StringBuilder answer = new StringBuilder();\n            int a=1;\n            while (itor.hasNext()) {\n                if (a==50) {\n                    long start = System.currentTimeMillis();\n                    itor.close();\n                    long duration = System.currentTimeMillis() - start;\n                    System.out.println(\"duration: \" + duration + \"ms\");\n                    break;\n                }\n                AppBuilderClientResult response = itor.next();\n                answer.append(response.getAnswer());\n\n                a++;\n            }\n            System.out.println(answer);\n        }\n\n\n}\n"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/ComponentClientTest.java",
    "content": "package com.baidubce.appbuilder;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport static org.junit.Assert.*;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.componentclient.ComponentClient;\nimport com.baidubce.appbuilder.model.componentclient.ComponentClientIterator;\nimport com.baidubce.appbuilder.model.componentclient.ComponentClientRunRequest;\nimport com.baidubce.appbuilder.model.componentclient.ComponentClientRunResponse;\n\npublic class ComponentClientTest {\n    String componentId;\n\n    @Before\n    public void setUp() {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN\"));\n        System.setProperty(\"APPBUILDER_LOGLEVEL\", \"DEBUG\");\n        componentId = \"44205c67-3980-41f7-aad4-37357b577fd0\";\n    }\n\n    @Test\n    public void TestComponentClientRun() throws IOException, AppBuilderServerException {\n        ComponentClient client = new ComponentClient();\n        Map<String, Object> parameters = new HashMap<>();\n        parameters.put(ComponentClientRunRequest.SysOriginQuery, \"北京景点推荐\");\n        ComponentClientIterator iter = client.run(componentId, \"latest\", \"\", false, parameters);\n        while (iter.hasNext()) {\n            ComponentClientRunResponse response = iter.next();\n            assertNotNull(response.getContent()[0].getText());\n        }\n    }\n\n    @Test\n    public void TestComponentClientRunStream() throws IOException, AppBuilderServerException {\n        ComponentClient client = new ComponentClient();\n        Map<String, Object> parameters = new HashMap<>();\n        parameters.put(ComponentClientRunRequest.SysOriginQuery, \"北京景点推荐\");\n        ComponentClientIterator iter = client.run(componentId, \"latest\", \"\", true, parameters);\n        Object text = null;\n        while (iter.hasNext()) {\n            ComponentClientRunResponse response = iter.next();\n            if (response.getContent().length > 0) {\n                text = response.getContent()[0].getText();\n            }\n        }\n        assertNotNull(text);\n    }\n\n    @Test\n    public void TestComponentClientHeaderRun() throws IOException, AppBuilderServerException {\n        this.componentId = \"c-wf-a39ee06c-808f-4a19-9f5f-544044283749\";\n        ComponentClient client = new ComponentClient();\n        Map<String, Object> parameters = new HashMap<>();\n        parameters.put(ComponentClientRunRequest.SysOriginQuery, \"梦到巨人\");\n        ComponentClientIterator iter = client.run(componentId, \"latest\", \"\", false, parameters);\n        while (iter.hasNext()) {\n            ComponentClientRunResponse response = iter.next();\n            System.out.println((response.getContent()[0].getText().get(\"info\")));\n        }\n    }\n\n    @Test\n    public void TestComponentClientHeaderRunStream() throws IOException, AppBuilderServerException {\n        this.componentId = \"c-wf-a39ee06c-808f-4a19-9f5f-544044283749\";\n        ComponentClient client = new ComponentClient();\n        Map<String, Object> parameters = new HashMap<>();\n        parameters.put(ComponentClientRunRequest.SysOriginQuery, \"梦到巨人\");\n        ComponentClientIterator iter = client.run(componentId, \"latest\", \"\", true, parameters);\n\n        while (iter.hasNext()) {\n            ComponentClientRunResponse response = iter.next();\n            if (response.getContent().length > 0) {\n                System.out.println((response.getContent()[0].getText().get(\"info\")));\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/DatasetTest.java",
    "content": "package com.baidubce.appbuilder;\n\nimport static org.junit.Assert.*;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.dataset.Dataset;\nimport com.baidubce.appbuilder.model.dataset.DocumentListResponse;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\n\npublic class DatasetTest {\n\n    @Before\n    public void setUp()  {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN_V3\"));\n    }\n\n    // @Test\n    // public void testCreateDataset() throws IOException, AppBuilderServerException {\n    //     Dataset dataset = new Dataset();\n        \n    //     String datasetId = \"\";\n    //     try {\n    //         datasetId = dataset.createDataset(\"dataset_name\");\n    //         assertNotNull(datasetId);\n    //     } catch (Exception e) {\n    //         datasetId = System.getenv(\"DATASET_ID_V3\");\n    //         dataset.setDatasetId(datasetId);\n    //     }\n        \n    //     String filePath = \"src/test/java/com/baidubce/appbuilder/files/test.pdf\";\n\n    //     String[] documentIds = dataset.addDocuments(new ArrayList<>(Collections.singletonList(filePath)), false, null, false);\n    //     assertNotEquals(documentIds.length, 0);\n\n    //     DocumentListResponse resp = dataset.getDocumentList(1, 20, \"\");\n    //     assertNotEquals(resp.getResult().getTotal(), 0);\n\n    //     dataset.deleteDocuments(documentIds);\n    // }\n}\n"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/KnowledgebaseTest.java",
    "content": "package com.baidubce.appbuilder;\n\nimport static org.junit.Assert.assertNotNull;\n\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.knowledgebase.Knowledgebase;\nimport com.baidubce.appbuilder.model.knowledgebase.*;\nimport com.google.gson.Gson;\n\nimport static org.junit.Assert.assertTrue;\n\n\npublic class KnowledgebaseTest {\n    @Before\n    public void setUp() {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN_V3\"));\n        System.setProperty(\"APPBUILDER_LOGLEVEL\", \"DEBUG\");\n    }\n\n    @Test\n    public void testAddDocument() throws IOException, AppBuilderServerException {\n        String knowledgeBaseId = System.getenv(\"DATASET_ID_V3\");\n        Knowledgebase knowledgebase = new Knowledgebase();\n\n        DocumentsDescribeRequest desribeDocumentsRequest = new DocumentsDescribeRequest(knowledgeBaseId, null, 10);\n        knowledgebase.describeDocuments(desribeDocumentsRequest);\n        \n        DocumentListRequest listRequest = new DocumentListRequest();\n        listRequest.setKonwledgeBaseId(knowledgeBaseId);\n        listRequest.setLimit(10);\n        Document[] documents = knowledgebase.getDocumentList(listRequest);\n        assertTrue(documents.length > 0);\n        assertNotNull(documents[0].getId());\n\n        String fileId = knowledgebase.uploadFile(\"src/test/java/com/baidubce/appbuilder/files/test.pdf\");\n        System.out.println(fileId);\n        assertNotNull(fileId);\n\n        DocumentAddRequest request = new DocumentAddRequest();\n        request.setKnowledgeBaseId(knowledgeBaseId);\n        request.setContentType(\"raw_text\");\n        request.setFileIds(new String[] {fileId});\n        DocumentAddRequest.CustomProcessRule customProcessRule =\n                new DocumentAddRequest.CustomProcessRule();\n        customProcessRule.setSeparators(new String[] {\"。\"});\n        customProcessRule.setTargetLength(300);\n        customProcessRule.setOverlapRate(0.25);\n        request.setCustomProcessRule(customProcessRule);\n\n        String[] documentsRes = knowledgebase.addDocument(request);\n\n        // Ensure that documentsRes array is not empty\n        assertTrue(documentsRes.length > 0);\n        assertNotNull(documentsRes);\n\n        DocumentDeleteRequest deleteRequest = new DocumentDeleteRequest();\n        deleteRequest.setKonwledgeBaseId(knowledgeBaseId);\n        deleteRequest.setDocumentId(documentsRes[0]);\n\n        knowledgebase.deleteDocument(deleteRequest);\n    }\n\n    @Test\n    public void testCreateKnowledgebase() throws IOException, AppBuilderServerException {\n        Knowledgebase knowledgebase = new Knowledgebase();\n        KnowledgeBaseDetail request = new KnowledgeBaseDetail();\n        request.setName(\"test_knowledgebase\");\n        request.setDescription(\"test_knowledgebase\");\n\n        // 创建知识库\n        KnowledgeBaseConfig.Index index = new KnowledgeBaseConfig.Index(\"public\",\n                \"\", \"\", \"\", \"\");\n        KnowledgeBaseConfig config = new KnowledgeBaseConfig(index);\n        request.setConfig(config);\n\n        String knowledgeBaseId = \"\";\n        boolean needDeleteKnowledgebase = false;\n        try {\n            KnowledgeBaseDetail response = knowledgebase.createKnowledgeBase(request);\n            knowledgeBaseId = response.getId();\n            assertNotNull(response.getId());\n            needDeleteKnowledgebase = true;\n        } catch (Exception e) {\n            knowledgeBaseId = System.getenv(\"DATASET_ID_V3\");\n        }\n\n        // 获取知识库详情\n        KnowledgeBaseDetail detail = knowledgebase.getKnowledgeBaseDetail(knowledgeBaseId);\n        System.out.println(detail.getId());\n        assertNotNull(detail.getId());\n\n        // 获取知识库列表\n        KnowledgeBaseListRequest listRequest =\n                new KnowledgeBaseListRequest(knowledgeBaseId, 10, null);\n        KnowledgeBaseListResponse knowledgeBases = knowledgebase.getKnowledgeBaseList(listRequest);\n        System.out.println(knowledgeBases.getMarker());\n        assertNotNull(knowledgeBases.getMarker());\n\n        // 更新知识库\n        KnowledgeBaseModifyRequest modifyRequest = new KnowledgeBaseModifyRequest();\n        modifyRequest.setKnowledgeBaseId(knowledgeBaseId);\n        modifyRequest.setName(\"test_knowledgebase2\");\n        modifyRequest.setDescription(knowledgeBaseId);\n        knowledgebase.modifyKnowledgeBase(modifyRequest);\n\n        // 导入知识库\n        DocumentsCreateRequest.Source.UrlConfig[] urlConfigs = {new DocumentsCreateRequest.Source.UrlConfig(1)};\n        DocumentsCreateRequest.Source source = new DocumentsCreateRequest.Source(\"web\",\n                new String[] {\"https://baijiahao.baidu.com/s?id=1802527379394162441\"}, 1, urlConfigs);\n        DocumentsCreateRequest.ProcessOption.Parser parser =\n                new DocumentsCreateRequest.ProcessOption.Parser(\n                        new String[] {\"layoutAnalysis\", \"ocr\"});\n        DocumentsCreateRequest.ProcessOption.Chunker.Separator separator =\n                new DocumentsCreateRequest.ProcessOption.Chunker.Separator(new String[] {\"。\"}, 300,\n                        0.25);\n        DocumentsCreateRequest.ProcessOption.Chunker chunker =\n                new DocumentsCreateRequest.ProcessOption.Chunker(new String[] {\"separator\"},\n                        separator, null, new String[] {\"title\", \"filename\"});\n        DocumentsCreateRequest.ProcessOption.KnowledgeAugmentation knowledgeAugmentation =\n                new DocumentsCreateRequest.ProcessOption.KnowledgeAugmentation(\n                        new String[] {\"faq\"});\n        DocumentsCreateRequest.ProcessOption processOption =\n                new DocumentsCreateRequest.ProcessOption(\"custom\", parser, chunker,\n                        knowledgeAugmentation);\n        DocumentsCreateRequest documentsCreateRequest =\n                new DocumentsCreateRequest(knowledgeBaseId, \"rawText\", source, processOption);\n        DocumentsCreateResponse documentsCreateResponse = knowledgebase.createDocuments(documentsCreateRequest);\n        assertNotNull(documentsCreateResponse.getDocumentIds());\n\n        // 上传文档\n        String filePath = \"src/test/java/com/baidubce/appbuilder/files/test.pdf\";\n        DocumentsCreateRequest.Source source2 =\n                new DocumentsCreateRequest.Source(\"file\", null, null);\n        DocumentsCreateRequest documentsCreateRequest2 =\n                new DocumentsCreateRequest(knowledgeBaseId, \"rawText\", source2, processOption);\n        DocumentsUploadResponse documentsUploadResponse = knowledgebase.uploadDocuments(filePath,\n                documentsCreateRequest2);\n        assertNotNull(documentsUploadResponse.getDocumentId());\n\n        // 删除知识库\n        if(needDeleteKnowledgebase) {\n            knowledgebase.deleteKnowledgeBase(knowledgeBaseId);\n        }\n    }\n    \n    @Test\n    public void testCreateChunk() throws IOException, AppBuilderServerException {\n        String knowledgeBaseID = System.getenv(\"DATASET_ID\");\n        String secretKey = System.getenv(\"APPBUILDER_TOKEN\");\n\n        Knowledgebase knowledgebase = new Knowledgebase(knowledgeBaseID, secretKey);\n        DocumentListRequest listRequest = new DocumentListRequest();\n        listRequest.setKonwledgeBaseId(knowledgeBaseID);\n        listRequest.setLimit(10);\n        Document[] documents = knowledgebase.getDocumentList(listRequest);\n        String documentId = documents[0].getId();\n        // 创建切片\n        String chunkId = knowledgebase.createChunk(documentId, \"test\");\n        // 修改切片\n        knowledgebase.modifyChunk(chunkId, \"new test\", true);\n        // 获取切片详情\n        knowledgebase.describeChunk(chunkId);\n        // 获取切片列表\n        knowledgebase.describeChunks(documentId, chunkId, 10, null);\n        // 获取切片列表\n        ChunksDescribeRequest request = new ChunksDescribeRequest(knowledgeBaseID, documentId, null, 10, null, \"test\");\n        knowledgebase.describeChunks(request);\n        try {\n            // 延时 \n            Thread.sleep(10000);\n        } catch (InterruptedException e) {\n            e.printStackTrace();\n        }\n        // 删除切片\n        knowledgebase.deleteChunk(chunkId);\n    }\n\n    @Test\n    public void testQueryKnowledgeBase() throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN\"));\n        Knowledgebase knowledgebase = new Knowledgebase();\n        // 查询知识库\n        Gson gson = new Gson();\n        String requestJson = new String(\n                Files.readAllBytes(Paths.get(\"src/test/java/com/baidubce/appbuilder/files/query_knowledgebase.json\")));\n        QueryKnowledgeBaseRequest request = gson.fromJson(requestJson, QueryKnowledgeBaseRequest.class);\n        QueryKnowledgeBaseResponse response = knowledgebase.queryKnowledgeBase(request);\n        assertNotNull(response.getChunks().get(0).getChunk_id());\n    }\n    \n    @Test\n    public void testQueryKnowledgeBaseV2() throws IOException, AppBuilderServerException {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN\"));\n        Knowledgebase knowledgebase = new Knowledgebase();\n        // 查询知识库\n        Gson gson = new Gson();\n        String requestJson = new String(\n                Files.readAllBytes(Paths.get(\"src/test/java/com/baidubce/appbuilder/files/query_knowledgebase.json\")));\n        QueryKnowledgeBaseRequest request = gson.fromJson(requestJson, QueryKnowledgeBaseRequest.class);\n        QueryKnowledgeBaseResponse response = knowledgebase.queryKnowledgeBase(request.getQuery(),\n                request.getType(), request.getRank_score_threshold(), request.getTop(), request.getSkip(),\n                request.getKnowledgebase_ids(), request.getMetadata_filters(), request.getPipeline_config());\n        assertNotNull(response.getChunks().get(0).getChunk_id());\n    }\n}\n"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/RAGTest.java",
    "content": "package com.baidubce.appbuilder;\n\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertTrue;\n\nimport java.io.IOException;\n\nimport com.baidubce.appbuilder.base.exception.AppBuilderServerException;\nimport com.baidubce.appbuilder.console.rag.RAG;\nimport com.baidubce.appbuilder.model.rag.RAGResponse;\nimport com.baidubce.appbuilder.model.rag.RAGIterator;\nimport com.baidubce.appbuilder.console.agentbuilder.AgentBuilder;\n\npublic class RAGTest {\n    String appId;\n\n    @Before\n    public void setUp() {\n        System.setProperty(\"APPBUILDER_TOKEN\", System.getenv(\"APPBUILDER_TOKEN_V3\"));\n\n        appId = \"aa8af334-df27-4855-b3d1-0d249c61fc08\";\n    }\n    /*\n    @Test\n    public void testRAG() throws IOException, AppBuilderServerException {\n        AgentBuilder builder = new AgentBuilder(appId);\n        String conversationId = builder.createConversation();\n        RAG rag = new RAG(appId);\n        RAGIterator itor = rag.run(\"合同中的甲方是谁？\", conversationId, true);\n        assertTrue(itor.hasNext());\n        while (itor.hasNext()) {\n            RAGResponse response = itor.next();\n        }\n    }*/\n}\n"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/base/exception/AppBuilderServerExceptionTest.java",
    "content": "package com.baidubce.appbuilder.base.exception;\n\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class AppBuilderServerExceptionTest {\n    \n    @Test\n    public void testConstructorWithBasicFields() {\n        AppBuilderServerException exception = new AppBuilderServerException(\"request123\", 500, \"Internal Server Error\");\n\n        assertEquals(\"request123\", exception.getRequestId());\n        assertEquals(500, exception.getCode());\n        assertEquals(\"Internal Server Error\", exception.getMessage());\n        assertEquals(0, exception.getAppbuilderCode()); // default value\n        assertNull(exception.getAppbuilderMessage());\n        assertNull(exception.getResponseBody());\n    }\n\n    @Test\n    public void testConstructorWithAppbuilderFields() {\n        AppBuilderServerException exception = new AppBuilderServerException(\"request456\", 400, \"Bad Request\", 1001, \"Invalid parameter\");\n\n        assertEquals(\"request456\", exception.getRequestId());\n        assertEquals(400, exception.getCode());\n        assertEquals(\"Bad Request\", exception.getMessage());\n        assertEquals(1001, exception.getAppbuilderCode());\n        assertEquals(\"Invalid parameter\", exception.getAppbuilderMessage());\n        assertNull(exception.getResponseBody());\n    }\n\n    @Test\n    public void testConstructorWithResponseBody() {\n        AppBuilderServerException exception = new AppBuilderServerException(\"request789\", 404, \"Not Found\", \"Response body content\");\n\n        assertEquals(\"request789\", exception.getRequestId());\n        assertEquals(404, exception.getCode());\n        assertEquals(\"Not Found\", exception.getMessage());\n        assertEquals(\"Response body content\", exception.getResponseBody());\n        assertEquals(0, exception.getAppbuilderCode()); // default value\n        assertNull(exception.getAppbuilderMessage());\n    }\n\n    @Test\n    public void testToString() {\n        AppBuilderServerException exception = new AppBuilderServerException(\"request101\", 401, \"Unauthorized\", 2002, \"Access denied\");\n        exception.toString();\n        \n        String expectedString = \"AppBuilderServerException{\" +\n                \"requestId='request101'\" +\n                \", code=401\" +\n                \", message='Unauthorized'\" +\n                \", appbuilderCode=2002\" +\n                \", appbuilderMessage='Access denied'\" +\n                \", responseBody='null'\" +\n                '}';\n        assertEquals(expectedString, exception.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/base/utils/json/JsonUtilsTest.java",
    "content": "package com.baidubce.appbuilder.base.utils.json;\n\nimport com.google.gson.reflect.TypeToken;\nimport org.junit.Test;\nimport static org.junit.Assert.assertEquals;\nimport java.util.Map;\n\npublic class JsonUtilsTest {\n\n    @Test\n    public void testSerialize() {\n        // 准备测试数据\n        TestObject testObject = new TestObject(\"example\", 123);\n        \n        // 进行序列化\n        String json = JsonUtils.serialize(testObject);\n        \n        // 期望的JSON字符串\n        String expectedJson = \"{\\\"name\\\":\\\"example\\\",\\\"value\\\":123}\";\n        \n        // 验证结果\n        assertEquals(expectedJson, json);\n    }\n\n    @Test\n    public void testDeserialize() {\n        // 准备JSON字符串\n        String json = \"{\\\"name\\\":\\\"example\\\",\\\"value\\\":123}\";\n        \n        // 进行反序列化\n        TestObject testObject = JsonUtils.deserialize(json, TestObject.class);\n        \n        // 验证结果\n        assertEquals(\"example\", testObject.getName());\n        assertEquals(123, testObject.getValue());\n    }\n\n    @Test\n    public void testDeserializeToMap() {\n        // 准备JSON字符串\n        String json = \"{\\\"key1\\\":\\\"value1\\\",\\\"key2\\\":\\\"value2\\\"}\";\n        \n        // 进行反序列化到Map\n        Map<String, String> map = JsonUtils.deserialize(json, new TypeToken<Map<String, String>>(){}.getType());\n        \n        // 验证结果\n        assertEquals(\"value1\", map.get(\"key1\"));\n        assertEquals(\"value2\", map.get(\"key2\"));\n    }\n\n    // 内部类用于测试对象\n    static class TestObject {\n        private String name;\n        private int value;\n\n        public TestObject(String name, int value) {\n            this.name = name;\n            this.value = value;\n        }\n\n        public String getName() {\n            return name;\n        }\n\n        public int getValue() {\n            return value;\n        }\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/files/query_knowledgebase.json",
    "content": "{\n    \"type\": \"fulltext\",\n    \"query\": \"民法典第三条\",\n    \"knowledgebase_ids\": [\n        \"70c6375a-1595-41f2-9a3b-e81bc9060b7f\"\n    ],\n    \"metadata_filters\": {\n        \"filters\": [],\n        \"condition\": \"or\"\n    },\n    \"pipeline_config\": {\n        \"id\": \"pipeline_001\",\n        \"pipeline\": [\n            {\n                \"name\": \"step1\",\n                \"type\": \"elastic_search\",\n                \"threshold\": 0.1,\n                \"top\": 400,\n                \"pre_ranking\": {\n                    \"bm25_weight\": 0.25,\n                    \"vec_weight\": 0.75,\n                    \"bm25_b\": 0.75,\n                    \"bm25_k1\": 1.5,\n                    \"bm25_max_score\": 50\n                }\n            },\n            {\n                \"name\": \"step2\",\n                \"type\": \"ranking\",\n                \"inputs\": [\n                    \"step1\"\n                ],\n                \"model_name\": \"ranker-v1\",\n                \"top\": 20\n            }\n        ]\n    },\n    \"top\": 5,\n    \"skip\": 0\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/files/toolcall.json",
    "content": "{\n    \"type\": \"function\",\n    \"function\": {\n        \"name\": \"get_cur_whether\",\n        \"description\": \"这是一个获得指定地点天气的工具\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n            \"required\": [\n                \"location\"\n            ]\n        }\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/agentbuilder/AgentBuilderResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class AgentBuilderResponseTest {\n    private AgentBuilderResponse response;\n\n    @Before\n    public void setUp() {\n        response = new AgentBuilderResponse();\n    }\n\n    @Test\n    public void testRequestId() {\n        response.setRequestId(\"test_request_id\");\n        assertEquals(\"test_request_id\", response.getRequestId());\n    }\n\n    @Test\n    public void testData() {\n        response.setData(\"test_data\");\n        assertEquals(\"test_data\", response.getData());\n    }\n\n    @Test\n    public void testAnswer() {\n        response.setAnswer(\"test_answer\");\n        assertEquals(\"test_answer\", response.getAnswer());\n    }\n\n    @Test\n    public void testConversationId() {\n        response.setConversationId(\"test_conversation_id\");\n        assertEquals(\"test_conversation_id\", response.getConversationId());\n    }\n\n    @Test\n    public void testMessageId() {\n        response.setMessageId(\"test_message_id\");\n        assertEquals(\"test_message_id\", response.getMessageId());\n    }\n\n    @Test\n    public void testIsCompletion() {\n        response.setCompletion(true);\n        assertTrue(response.isCompletion());\n\n        response.setCompletion(false);\n        assertFalse(response.isCompletion());\n    }\n\n    @Test\n    public void testContent() {\n        EventContent[] contentArray = new EventContent[1];\n        response.setContent(contentArray);\n        assertArrayEquals(contentArray, response.getContent());\n    }\n\n    @Test\n    public void testToString() {\n        response.setRequestId(\"test_request_id\");\n        response.setData(\"test_data\");\n        response.setAnswer(\"test_answer\");\n        response.setConversationId(\"test_conversation_id\");\n        response.setMessageId(\"test_message_id\");\n        response.setCompletion(true);\n        EventContent[] contentArray = new EventContent[1];\n        response.setContent(contentArray);\n\n        String expectedString = \"AgentBuilderResponse{\" +\n                \"requestId='test_request_id', data='test_data', answer='test_answer', \" +\n                \"conversationId='test_conversation_id', messageId='test_message_id', \" +\n                \"isCompletion=true, content=[null]}\";\n        assertEquals(expectedString, response.toString());\n    }\n\n    @Test\n    public void testNullContent() {\n        response.setContent(null);\n        assertNull(response.getContent());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/agentbuilder/AgentBuilderResultTest.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class AgentBuilderResultTest {\n    private AgentBuilderResult agentBuilderResult;\n    private Event event1;\n    private Event event2;\n\n    @Before\n    public void setUp() {\n        agentBuilderResult = new AgentBuilderResult();\n\n        // Initialize Event objects\n        event1 = new Event().setCode(\"eventCode1\").setMessage(\"First event\");\n        event2 = new Event().setCode(\"eventCode2\").setMessage(\"Second event\");\n\n        agentBuilderResult.setAnswer(\"This is an answer\")\n                          .setEvents(new Event[]{event1, event2});\n    }\n\n    @Test\n    public void testGetAnswer() {\n        assertEquals(\"This is an answer\", agentBuilderResult.getAnswer());\n    }\n\n    @Test\n    public void testGetEvents() {\n        Event[] events = agentBuilderResult.getEvents();\n        assertNotNull(events);\n        assertEquals(2, events.length);\n        assertEquals(\"eventCode1\", events[0].getCode());\n        assertEquals(\"First event\", events[0].getMessage());\n        assertEquals(\"eventCode2\", events[1].getCode());\n        assertEquals(\"Second event\", events[1].getMessage());\n    }\n\n    @Test\n    public void testToString() {\n        String expectedString = \"AgentBuilderResult{\" +\n                \"answer='This is an answer'\" +\n                \", events=[Event{code='eventCode1', message='First event', eventType='null', status='null', contentType='null', detail=null}, \" +\n                \"Event{code='eventCode2', message='Second event', eventType='null', status='null', contentType='null', detail=null}]\" +\n                '}';\n        assertEquals(expectedString, agentBuilderResult.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/agentbuilder/ConversationResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ConversationResponseTest {\n    private ConversationResponse conversationResponse;\n\n    @Before\n    public void setUp() {\n        conversationResponse = new ConversationResponse();\n        conversationResponse.setRequestId(\"testRequestId\");\n        conversationResponse.setConversationId(\"testConversationId\");\n    }\n\n    @Test\n    public void testRequestId() {\n        assertEquals(\"testRequestId\", conversationResponse.getRequestId());\n    }\n\n    @Test\n    public void testConversationId() {\n        assertEquals(\"testConversationId\", conversationResponse.getConversationId());\n    }\n\n    @Test\n    public void testToString() {\n        String expectedString = \"ConversationResponse{\" +\n                \"requestId='testRequestId', conversationId='testConversationId'}\";\n        assertEquals(expectedString, conversationResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/agentbuilder/EventContentTest.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport static org.junit.Assert.*;\n\npublic class EventContentTest {\n    private EventContent eventContent;\n\n    @Before\n    public void setUp() {\n        eventContent = new EventContent();\n\n        Map<String, Object> outputs = new HashMap<>();\n        outputs.put(\"key1\", \"value1\");\n        outputs.put(\"key2\", 100);\n\n        eventContent.setEventCode(\"event123\");\n        eventContent.setEnentMessage(\"Event message\");\n        eventContent.setEventType(\"EventType\");\n        eventContent.setEventId(\"eventId123\");\n        eventContent.setEventStatus(\"success\");\n        eventContent.setContentType(\"application/json\");\n        eventContent.setOutputs(outputs);\n    }\n\n    @Test\n    public void testEventCode() {\n        assertEquals(\"event123\", eventContent.getEventCode());\n    }\n\n    @Test\n    public void testEnentMessage() {\n        assertEquals(\"Event message\", eventContent.getEnentMessage());\n    }\n\n    @Test\n    public void testEventType() {\n        assertEquals(\"EventType\", eventContent.getEventType());\n    }\n\n    @Test\n    public void testEventId() {\n        assertEquals(\"eventId123\", eventContent.getEventId());\n    }\n\n    @Test\n    public void testEventStatus() {\n        assertEquals(\"success\", eventContent.getEventStatus());\n    }\n\n    @Test\n    public void testContentType() {\n        assertEquals(\"application/json\", eventContent.getContentType());\n    }\n\n    @Test\n    public void testOutputs() {\n        Map<String, Object> outputs = eventContent.getOutputs();\n        assertNotNull(outputs);\n        assertEquals(2, outputs.size());\n        assertEquals(\"value1\", outputs.get(\"key1\"));\n        assertEquals(100, outputs.get(\"key2\"));\n    }\n\n    @Test\n    public void testToString() {\n        String expectedString = \"EventContent{\" +\n                \"eventCode='event123'\" +\n                \", enentMessage='Event message'\" +\n                \", eventType='EventType'\" +\n                \", eventId='eventId123'\" +\n                \", eventStatus='success'\" +\n                \", contentType='application/json'\" +\n                \", outputs={key1=value1, key2=100}\" +\n                '}';\n        assertEquals(expectedString, eventContent.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/agentbuilder/EventTest.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport static org.junit.Assert.*;\n\npublic class EventTest {\n    private Event event;\n\n    @Before\n    public void setUp() {\n        event = new Event();\n\n        Map<String, Object> detail = new HashMap<>();\n        detail.put(\"key1\", \"value1\");\n        detail.put(\"key2\", 100);\n\n        event.setCode(\"eventCode123\")\n             .setMessage(\"Event occurred\")\n             .setEventType(\"eventType\")\n             .setStatus(\"success\")\n             .setContentType(\"application/json\")\n             .setDetail(detail);\n    }\n\n    @Test\n    public void testCode() {\n        assertEquals(\"eventCode123\", event.getCode());\n    }\n\n    @Test\n    public void testMessage() {\n        assertEquals(\"Event occurred\", event.getMessage());\n    }\n\n    @Test\n    public void testEventType() {\n        assertEquals(\"eventType\", event.getEventType());\n    }\n\n    @Test\n    public void testStatus() {\n        assertEquals(\"success\", event.getStatus());\n    }\n\n    @Test\n    public void testContentType() {\n        assertEquals(\"application/json\", event.getContentType());\n    }\n\n    @Test\n    public void testDetail() {\n        Map<String, Object> detail = event.getDetail();\n        assertNotNull(detail);\n        assertEquals(2, detail.size());\n        assertEquals(\"value1\", detail.get(\"key1\"));\n        assertEquals(100, detail.get(\"key2\"));\n    }\n\n    @Test\n    public void testToString() {\n        String expectedString = \"Event{\" +\n                \"code='eventCode123'\" +\n                \", message='Event occurred'\" +\n                \", eventType='eventType'\" +\n                \", status='success'\" +\n                \", contentType='application/json'\" +\n                \", detail={key1=value1, key2=100}\" +\n                '}';\n        assertEquals(expectedString, event.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/agentbuilder/FileUploadResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.agentbuilder;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class FileUploadResponseTest {\n    private FileUploadResponse fileUploadResponse;\n\n    @Before\n    public void setUp() {\n        fileUploadResponse = new FileUploadResponse();\n        fileUploadResponse.setRequestId(\"testRequestId\");\n        fileUploadResponse.setFileId(\"testFileId\");\n        fileUploadResponse.setConversationId(\"testConversationId\");\n    }\n\n    @Test\n    public void testGetRequestId() {\n        assertEquals(\"testRequestId\", fileUploadResponse.getRequestId());\n    }\n\n    @Test\n    public void testGetFileId() {\n        assertEquals(\"testFileId\", fileUploadResponse.getFileId());\n    }\n\n    @Test\n    public void testGetConversationId() {\n        assertEquals(\"testConversationId\", fileUploadResponse.getConversationId());\n    }\n\n    @Test\n    public void testToString() {\n        String expectedString = \"FileUploadResponse{\" +\n                \"requestId='testRequestId'\" +\n                \", fileId='testFileId'\" +\n                \", conversationId='testConversationId'\" +\n                '}';\n        assertEquals(expectedString, fileUploadResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/AppBuilderClientResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class AppBuilderClientResponseTest {\n    private AppBuilderClientResponse response;\n\n    @Before\n    public void setUp() {\n        response = new AppBuilderClientResponse();\n    }\n\n    @Test\n    public void testRequestId() {\n        response.setRequestId(\"test_request_id\");\n        assertEquals(\"test_request_id\", response.getRequestId());\n    }\n\n    @Test\n    public void testData() {\n        response.setData(\"test_data\");\n        assertEquals(\"test_data\", response.getData());\n    }\n\n    @Test\n    public void testAnswer() {\n        response.setAnswer(\"test_answer\");\n        assertEquals(\"test_answer\", response.getAnswer());\n    }\n\n    @Test\n    public void testConversationId() {\n        response.setConversationId(\"test_conversation_id\");\n        assertEquals(\"test_conversation_id\", response.getConversationId());\n    }\n\n    @Test\n    public void testMessageId() {\n        response.setMessageId(\"test_message_id\");\n        assertEquals(\"test_message_id\", response.getMessageId());\n    }\n\n    @Test\n    public void testIsCompletion() {\n        response.setCompletion(true);\n        assertTrue(response.isCompletion());\n    }\n\n    @Test\n    public void testContent() {\n        EventContent[] contentArray = new EventContent[1];\n        response.setContent(contentArray);\n        assertArrayEquals(contentArray, response.getContent());\n    }\n\n    @Test\n    public void testToString() {\n        response.setRequestId(\"test_request_id\");\n        response.setDate(\"test_date\");\n        response.setAnswer(\"test_answer\");\n        response.setConversationId(\"test_conversation_id\");\n        response.setMessageId(\"test_message_id\");\n        response.setCompletion(true);\n        EventContent[] contentArray = new EventContent[1];\n        response.setContent(contentArray);\n\n        String expectedString = \"AgentBuilderResponse{\" +\n                \"requestId='test_request_id', date='test_date', answer='test_answer', \" +\n                \"conversationId='test_conversation_id', messageId='test_message_id', \" +\n                \"isCompletion=true, content=[null]}\";\n        assertEquals(expectedString, response.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/AppBuilderClientRunRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class AppBuilderClientRunRequestTest {\n    private AppBuilderClientRunRequest request;\n    private AppBuilderClientRunRequest.Tool tool;\n    private AppBuilderClientRunRequest.Tool.Function toolFunction;\n    private AppBuilderClientRunRequest.ToolOutput toolOutput;\n    private AppBuilderClientRunRequest.ToolChoice toolChoice;\n    private AppBuilderClientRunRequest.ToolChoice.Function toolChoiceFunction;\n\n    @Before\n    public void setUp() {\n        // Initialize Tool and Tool.Function\n        Map<String, Object> parameters = new HashMap<>();\n        parameters.put(\"param1\", \"value1\");\n        toolFunction = new AppBuilderClientRunRequest.Tool.Function(\"testFunction\", \"testDescription\", parameters);\n        tool = new AppBuilderClientRunRequest.Tool(\"testType\", toolFunction);\n\n        // Initialize ToolOutput\n        toolOutput = new AppBuilderClientRunRequest.ToolOutput(\"toolCallID1\", \"output1\");\n\n        // Initialize ToolChoice and ToolChoice.Function\n        Map<String, Object> input = new HashMap<>();\n        input.put(\"input1\", \"value1\");\n        toolChoiceFunction = new AppBuilderClientRunRequest.ToolChoice.Function(\"choiceFunction\", input);\n        toolChoice = new AppBuilderClientRunRequest.ToolChoice(\"choiceType\", toolChoiceFunction);\n\n        // Initialize main class\n        request = new AppBuilderClientRunRequest();\n        request.setAppId(\"testAppId\");\n        request.setQuery(\"testQuery\");\n        request.setStream(true);\n        request.setConversationID(\"testConversationId\");\n        request.setEndUserId(\"testEndUserId\");\n        request.setTools(new AppBuilderClientRunRequest.Tool[]{tool});\n        request.setToolOutputs(new AppBuilderClientRunRequest.ToolOutput[]{toolOutput});\n        request.setToolChoice(toolChoice);\n    }\n\n    @Test\n    public void testAppId() {\n        assertEquals(\"testAppId\", request.getAppId());\n    }\n\n    @Test\n    public void testQuery() {\n        assertEquals(\"testQuery\", request.getQuery());\n    }\n\n    @Test\n    public void testStream() {\n        assertTrue(request.isStream());\n    }\n\n    @Test\n    public void testConversationID() {\n        assertEquals(\"testConversationId\", request.getConversationID());\n    }\n\n    @Test\n    public void testEndUserId() {\n        assertEquals(\"testEndUserId\", request.getEndUserId());\n    }\n\n    @Test\n    public void testTools() {\n        assertEquals(1, request.getTools().length);\n        assertEquals(\"testType\", request.getTools()[0].getType());\n        assertEquals(\"testFunction\", request.getTools()[0].getFunction().getName());\n        assertEquals(\"testDescription\", request.getTools()[0].getFunction().getDescription());\n        assertEquals(\"value1\", request.getTools()[0].getFunction().getParameters().get(\"param1\"));\n    }\n\n    @Test\n    public void testToolOutputs() {\n        assertEquals(1, request.getToolOutputs().length);\n        assertEquals(\"toolCallID1\", request.getToolOutputs()[0].getToolCallID());\n        assertEquals(\"output1\", request.getToolOutputs()[0].getOutput());\n    }\n\n    @Test\n    public void testToolChoice() {\n        assertEquals(\"choiceType\", request.getToolChoice().getType());\n        assertEquals(\"choiceFunction\", request.getToolChoice().getFunction().getName());\n        assertEquals(\"value1\", request.getToolChoice().getFunction().getInput().get(\"input1\"));\n    }\n\n    @Test\n    public void testToolFunction() {\n        assertEquals(\"testFunction\", toolFunction.getName());\n        assertEquals(\"testDescription\", toolFunction.getDescription());\n        assertEquals(\"value1\", toolFunction.getParameters().get(\"param1\"));\n    }\n\n    @Test\n    public void testToolChoiceFunction() {\n        assertEquals(\"choiceFunction\", toolChoiceFunction.getName());\n        assertEquals(\"value1\", toolChoiceFunction.getInput().get(\"input1\"));\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/AppListRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.util.Map;\n\nimport static org.junit.Assert.*;\n\npublic class AppListRequestTest {\n\n    private AppListRequest appListRequest;\n\n    @Before\n    public void setUp() {\n        appListRequest = new AppListRequest();\n    }\n\n    @Test\n    public void testGetLimit() {\n        appListRequest.setLimit(10);\n        assertEquals(10, appListRequest.getLimit());\n    }\n\n    @Test\n    public void testSetLimit() {\n        appListRequest.setLimit(20);\n        assertEquals(20, appListRequest.getLimit());\n    }\n\n    @Test\n    public void testGetAfter() {\n        appListRequest.setAfter(\"afterValue\");\n        assertEquals(\"afterValue\", appListRequest.getAfter());\n    }\n\n    @Test\n    public void testSetAfter() {\n        appListRequest.setAfter(\"newAfterValue\");\n        assertEquals(\"newAfterValue\", appListRequest.getAfter());\n    }\n\n    @Test\n    public void testGetBefore() {\n        appListRequest.setBefore(\"beforeValue\");\n        assertEquals(\"beforeValue\", appListRequest.getBefore());\n    }\n\n    @Test\n    public void testSetBefore() {\n        appListRequest.setBefore(\"newBeforeValue\");\n        assertEquals(\"newBeforeValue\", appListRequest.getBefore());\n    }\n\n    @Test\n    public void testToMap_WithLimit() {\n        appListRequest.setLimit(15);\n        appListRequest.setAfter(\"afterExample\");\n        appListRequest.setBefore(\"beforeExample\");\n\n        Map<String, Object> resultMap = appListRequest.toMap();\n\n        assertNotNull(resultMap);\n        assertEquals(3, resultMap.size());\n        assertEquals(15, resultMap.get(\"limit\"));\n        assertEquals(\"afterExample\", resultMap.get(\"after\"));\n        assertEquals(\"beforeExample\", resultMap.get(\"before\"));\n    }\n\n    @Test\n    public void testToMap_WithoutLimit() {\n        appListRequest.setAfter(\"afterExample\");\n        appListRequest.setBefore(\"beforeExample\");\n\n        Map<String, Object> resultMap = appListRequest.toMap();\n\n        assertNotNull(resultMap);\n        assertEquals(2, resultMap.size());\n        assertNull(resultMap.get(\"limit\"));\n        assertEquals(\"afterExample\", resultMap.get(\"after\"));\n        assertEquals(\"beforeExample\", resultMap.get(\"before\"));\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/AppListResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.assertEquals;\n\npublic class AppListResponseTest {\n\n    private AppListResponse appListResponse;\n\n    @Before\n    public void setUp() {\n        appListResponse = new AppListResponse();\n    }\n\n    @Test\n    public void testGetSetRequestId() {\n        appListResponse.setRequestId(\"req123\");\n        assertEquals(\"req123\", appListResponse.getRequestId());\n    }\n\n    @Test\n    public void testGetSetData() {\n        App[] apps = new App[2];\n        apps[0] = new App();  // Assuming App class has a default constructor\n        apps[1] = new App();\n        appListResponse.setData(apps);\n        assertEquals(apps, appListResponse.getData());\n    }\n\n    @Test\n    public void testGetSetCode() {\n        appListResponse.setCode(\"200\");\n        assertEquals(\"200\", appListResponse.getCode());\n    }\n\n    @Test\n    public void testGetSetMessage() {\n        appListResponse.setMessage(\"Success\");\n        assertEquals(\"Success\", appListResponse.getMessage());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/AppTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.assertEquals;\n\npublic class AppTest {\n\n    private App app;\n\n    @Before\n    public void setUp() {\n        app = new App();\n    }\n\n    @Test\n    public void testSetGetId() {\n        app.setId(\"app123\");\n        assertEquals(\"app123\", app.getId());\n    }\n\n    @Test\n    public void testSetGetName() {\n        app.setName(\"Test App\");\n        assertEquals(\"Test App\", app.getName());\n    }\n\n    @Test\n    public void testSetGetDescription() {\n        app.setDescription(\"This is a test app.\");\n        assertEquals(\"This is a test app.\", app.getDescription());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/ConversationResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.assertEquals;\n\npublic class ConversationResponseTest {\n\n    private ConversationResponse conversationResponse;\n\n    @Before\n    public void setUp() {\n        conversationResponse = new ConversationResponse();\n    }\n\n    @Test\n    public void testSetGetRequestId() {\n        conversationResponse.setRequestId(\"req123\");\n        assertEquals(\"req123\", conversationResponse.getRequestId());\n    }\n\n    @Test\n    public void testSetGetConversationId() {\n        conversationResponse.setConversationId(\"conv456\");\n        assertEquals(\"conv456\", conversationResponse.getConversationId());\n    }\n\n    @Test\n    public void testToString() {\n        conversationResponse.setRequestId(\"req123\");\n        conversationResponse.setConversationId(\"conv456\");\n\n        String expected = \"ConversationResponse{\" +\n                \"requestId='req123'\" +\n                \", conversationId='conv456'\" +\n                '}';\n\n        assertEquals(expected, conversationResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/EventContentTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport static org.junit.Assert.*;\n\npublic class EventContentTest {\n\n    private EventContent eventContent;\n    private ToolCall[] toolCalls;\n\n    @Before\n    public void setUp() {\n        eventContent = new EventContent();\n        toolCalls = new ToolCall[]{new ToolCall(), new ToolCall()};\n    }\n\n    @Test\n    public void testGetSetEventCode() {\n        eventContent.setEventCode(\"event123\");\n        assertEquals(\"event123\", eventContent.getEventCode());\n    }\n\n    @Test\n    public void testGetSetEventMessage() {\n        eventContent.setEnentMessage(\"message123\");\n        assertEquals(\"message123\", eventContent.getEnentMessage());\n    }\n\n    @Test\n    public void testGetSetEventType() {\n        eventContent.setEventType(\"eventType123\");\n        assertEquals(\"eventType123\", eventContent.getEventType());\n    }\n\n    @Test\n    public void testGetSetEventId() {\n        eventContent.setEventId(\"eventId123\");\n        assertEquals(\"eventId123\", eventContent.getEventId());\n    }\n\n    @Test\n    public void testGetSetEventStatus() {\n        eventContent.setEventStatus(\"status123\");\n        assertEquals(\"status123\", eventContent.getEventStatus());\n    }\n\n    @Test\n    public void testGetSetContentType() {\n        eventContent.setContentType(\"contentType123\");\n        assertEquals(\"contentType123\", eventContent.getContentType());\n    }\n\n    @Test\n    public void testGetSetOutputs() {\n        Map<String, Object> outputs = new HashMap<>();\n        outputs.put(\"key\", \"value\");\n        eventContent.setOutputs(outputs);\n        assertEquals(outputs, eventContent.getOutputs());\n    }\n\n    @Test\n    public void testGetSetUsage() {\n        Map<String, Object> usage = new HashMap<>();\n        usage.put(\"cpu\", \"80%\");\n        eventContent.setUsage(usage);\n        assertEquals(usage, eventContent.getUsage());\n    }\n\n    @Test\n    public void testGetSetToolCalls() {\n        eventContent.setToolCalls(toolCalls);\n        assertArrayEquals(toolCalls, eventContent.getToolCalls());\n    }\n\n    @Test\n    public void testToString() {\n        eventContent.setEventCode(\"event123\");\n        eventContent.setEnentMessage(\"message123\");\n        eventContent.setEventType(\"eventType123\");\n        eventContent.setEventId(\"eventId123\");\n        eventContent.setEventStatus(\"status123\");\n        eventContent.setContentType(\"contentType123\");\n\n        String expected = \"EventContent{eventCode='event123', eventMessage='message123', eventType='eventType123', eventId='eventId123', eventStatus='status123', contentType='contentType123', outputs=null'usage=null', toolCalls=null}\";\n        assertEquals(expected, eventContent.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/EventTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class EventTest {\n\n    private Event event;\n    private Map<String, Object> detail;\n    private Map<String, Object> usage;\n    private ToolCall[] toolCalls;\n\n    @Before\n    public void setUp() {\n        detail = new HashMap<>();\n        detail.put(\"key1\", \"value1\");\n\n        usage = new HashMap<>();\n        usage.put(\"usageKey\", \"usageValue\");\n\n        toolCalls = new ToolCall[2];\n        toolCalls[0] = new ToolCall();  // 假设 ToolCall 类有默认构造函数\n        toolCalls[1] = new ToolCall();\n\n        event = new Event()\n                .setCode(\"200\")\n                .setMessage(\"Success\")\n                .setEventType(\"eventType\")\n                .setStatus(\"completed\")\n                .setContentType(\"application/json\")\n                .setDetail(detail)\n                .setUsage(usage)\n                .setToolCalls(toolCalls);\n    }\n\n    @Test\n    public void testGetCode() {\n        assertEquals(\"200\", event.getCode());\n    }\n\n    @Test\n    public void testGetMessage() {\n        assertEquals(\"Success\", event.getMessage());\n    }\n\n    @Test\n    public void testGetEventType() {\n        assertEquals(\"eventType\", event.getEventType());\n    }\n\n    @Test\n    public void testGetStatus() {\n        assertEquals(\"completed\", event.getStatus());\n    }\n\n    @Test\n    public void testGetContentType() {\n        assertEquals(\"application/json\", event.getContentType());\n    }\n\n    @Test\n    public void testGetDetail() {\n        assertEquals(detail, event.getDetail());\n    }\n\n    @Test\n    public void testGetUsage() {\n        assertEquals(usage, event.getUsage());\n    }\n\n    @Test\n    public void testGetToolCalls() {\n        assertEquals(toolCalls, event.getToolCalls());\n    }\n\n    @Test\n    public void testToString() {\n        String expected = \"Event{\" +\n                \"code='200'\" +\n                \", message='Success'\" +\n                \", eventType='eventType'\" +\n                \", status='completed'\" +\n                \", contentType='application/json'\" +\n                \", detail=\" + detail + '\\'' +\n                \", usage=\" + usage + '\\'' +\n                \", toolCalls=\" + toolCalls + '}';\n        assertEquals(expected, event.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/FileUploadResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class FileUploadResponseTest {\n\n    private FileUploadResponse fileUploadResponse;\n\n    @Before\n    public void setUp() {\n        fileUploadResponse = new FileUploadResponse();\n    }\n\n    @Test\n    public void testSetGetRequestId() {\n        fileUploadResponse.setRequestId(\"request123\");\n        assertEquals(\"request123\", fileUploadResponse.getRequestId());\n    }\n\n    @Test\n    public void testSetGetFileId() {\n        fileUploadResponse.setFileId(\"file456\");\n        assertEquals(\"file456\", fileUploadResponse.getFileId());\n    }\n\n    @Test\n    public void testSetGetConversationId() {\n        fileUploadResponse.setConversationId(\"conversation789\");\n        assertEquals(\"conversation789\", fileUploadResponse.getConversationId());\n    }\n\n    @Test\n    public void testToString() {\n        fileUploadResponse.setRequestId(\"request123\");\n        fileUploadResponse.setFileId(\"file456\");\n        fileUploadResponse.setConversationId(\"conversation789\");\n\n        String expected = \"FileUploadResponse{\" +\n                \"requestId='request123'\" +\n                \", fileId='file456'\" +\n                \", conversationId='conversation789'\" +\n                '}';\n\n        assertEquals(expected, fileUploadResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/appbuilderclient/ToolCallTest.java",
    "content": "package com.baidubce.appbuilder.model.appbuilderclient;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\npublic class ToolCallTest {\n\n    private ToolCall toolCall;\n\n    @Before\n    public void setUp() {\n        toolCall = new ToolCall();\n    }\n\n    @Test\n    public void testGetId() {\n        toolCall.setId(\"testId\");\n        assertEquals(\"testId\", toolCall.getId());\n    }\n\n    @Test\n    public void testSetId() {\n        toolCall.setId(\"newTestId\");\n        assertEquals(\"newTestId\", toolCall.getId());\n    }\n\n    @Test\n    public void testGetType() {\n        toolCall.setType(\"testType\");\n        assertEquals(\"testType\", toolCall.getType());\n    }\n\n    @Test\n    public void testSetType() {\n        toolCall.setType(\"newTestType\");\n        assertEquals(\"newTestType\", toolCall.getType());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/dataset/DatasetCreateResultTest.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class DatasetCreateResultTest {\n    private DatasetCreateResult datasetCreateResult;\n\n    @Before\n    public void setUp() {\n        datasetCreateResult = new DatasetCreateResult();\n    }\n\n    @Test\n    public void testId() {\n        datasetCreateResult.setId(\"test_id\");\n        assertEquals(\"test_id\", datasetCreateResult.getId());\n    }\n\n    @Test\n    public void testName() {\n        datasetCreateResult.setName(\"test_name\");\n        assertEquals(\"test_name\", datasetCreateResult.getName());\n    }\n\n    @Test\n    public void testDescription() {\n        datasetCreateResult.setDescription(\"test_description\");\n        assertEquals(\"test_description\", datasetCreateResult.getDescription());\n    }\n\n    @Test\n    public void testIndexingTechnique() {\n        datasetCreateResult.setIndexingTechnique(\"test_indexing_technique\");\n        assertEquals(\"test_indexing_technique\", datasetCreateResult.getIndexingTechnique());\n    }\n\n    @Test\n    public void testDocumentCount() {\n        datasetCreateResult.setDocumentCount(123);\n        assertEquals(123, datasetCreateResult.getDocumentCount());\n    }\n\n    @Test\n    public void testWordCount() {\n        datasetCreateResult.setWordCount(456);\n        assertEquals(456, datasetCreateResult.getWordCount());\n    }\n\n    @Test\n    public void testCreatedBy() {\n        datasetCreateResult.setCreatedBy(\"test_created_by\");\n        assertEquals(\"test_created_by\", datasetCreateResult.getCreatedBy());\n    }\n\n    @Test\n    public void testCreatedAt() {\n        datasetCreateResult.setCreatedAt(123456789L);\n        assertEquals(123456789L, datasetCreateResult.getCreatedAt());\n    }\n\n    @Test\n    public void testUpdatedBy() {\n        datasetCreateResult.setUpdatedBy(\"test_updated_by\");\n        assertEquals(\"test_updated_by\", datasetCreateResult.getUpdatedBy());\n    }\n\n    @Test\n    public void testUpdatedAt() {\n        datasetCreateResult.setUpdatedAt(987654321L);\n        assertEquals(987654321L, datasetCreateResult.getUpdatedAt());\n    }\n\n    @Test\n    public void testIsPriority() {\n        datasetCreateResult.setPriority(true);\n        assertTrue(datasetCreateResult.isPriority());\n\n        datasetCreateResult.setPriority(false);\n        assertFalse(datasetCreateResult.isPriority());\n    }\n\n    @Test\n    public void testToString() {\n        datasetCreateResult.setId(\"test_id\");\n        datasetCreateResult.setName(\"test_name\");\n        datasetCreateResult.setDescription(\"test_description\");\n        datasetCreateResult.setIndexingTechnique(\"test_indexing_technique\");\n        datasetCreateResult.setDocumentCount(123);\n        datasetCreateResult.setWordCount(456);\n        datasetCreateResult.setCreatedBy(\"test_created_by\");\n        datasetCreateResult.setCreatedAt(123456789L);\n        datasetCreateResult.setUpdatedBy(\"test_updated_by\");\n        datasetCreateResult.setUpdatedAt(987654321L);\n        datasetCreateResult.setPriority(true);\n\n        String expectedString = \"DatasetCreateResult{\" +\n                \"id='test_id', name='test_name', description='test_description', \" +\n                \"indexingTechnique='test_indexing_technique', documentCount=123, wordCount=456, \" +\n                \"createdBy='test_created_by', createdAt=123456789, updatedBy='test_updated_by', \" +\n                \"updatedAt=987654321, isPriority=true}\";\n\n        assertEquals(expectedString, datasetCreateResult.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/dataset/DocumentAddResultTest.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\nimport java.util.Arrays;\n\npublic class DocumentAddResultTest {\n    private DocumentAddResult documentAddResult;\n\n    @Before\n    public void setUp() {\n        documentAddResult = new DocumentAddResult();\n        documentAddResult.setDatasetId(\"testDatasetId\");\n        documentAddResult.setDocumentIds(new String[] { \"doc1\", \"doc2\", \"doc3\" });\n    }\n\n    @Test\n    public void testGetDatasetId() {\n        assertEquals(\"testDatasetId\", documentAddResult.getDatasetId());\n    }\n\n    @Test\n    public void testSetDatasetId() {\n        documentAddResult.setDatasetId(\"newDatasetId\");\n        assertEquals(\"newDatasetId\", documentAddResult.getDatasetId());\n    }\n\n    @Test\n    public void testGetDocumentIds() {\n        String[] documentIds = documentAddResult.getDocumentIds();\n        assertNotNull(documentIds);\n        assertArrayEquals(new String[] { \"doc1\", \"doc2\", \"doc3\" }, documentIds);\n    }\n\n    @Test\n    public void testSetDocumentIds() {\n        documentAddResult.setDocumentIds(new String[] { \"docA\", \"docB\" });\n        assertArrayEquals(new String[] { \"docA\", \"docB\" }, documentAddResult.getDocumentIds());\n    }\n\n    @Test\n    public void testToString() {\n        String expectedString = \"DocumentAddResult{\" +\n                \"datasetId='testDatasetId'\" +\n                \", documentIds=\" + Arrays.toString(new String[] { \"doc1\", \"doc2\", \"doc3\" }) +\n                '}';\n        assertEquals(expectedString, documentAddResult.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/dataset/DocumentListDataTest.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class DocumentListDataTest {\n    private DocumentListData documentListData;\n\n    @Before\n    public void setUp() {\n        documentListData = new DocumentListData();\n    }\n\n    @Test\n    public void testId() {\n        documentListData.setId(\"test_id\");\n        assertEquals(\"test_id\", documentListData.getId());\n    }\n\n    @Test\n    public void testName() {\n        documentListData.setName(\"test_name\");\n        assertEquals(\"test_name\", documentListData.getName());\n    }\n\n    @Test\n    public void testDatasetProcessRuleId() {\n        documentListData.setDatasetProcessRuleId(\"test_rule_id\");\n        assertEquals(\"test_rule_id\", documentListData.getDatasetProcessRuleId());\n    }\n\n    @Test\n    public void testDataSourceType() {\n        documentListData.setDataSourceType(\"test_source_type\");\n        assertEquals(\"test_source_type\", documentListData.getDataSourceType());\n    }\n\n    @Test\n    public void testPosition() {\n        documentListData.setPosition(5);\n        assertEquals(5, documentListData.getPosition());\n    }\n\n    @Test\n    public void testDataSourceInfo() {\n        Map<String, String> dataSourceInfo = new HashMap<>();\n        dataSourceInfo.put(\"key1\", \"value1\");\n        documentListData.setDataSourceInfo(dataSourceInfo);\n        assertEquals(dataSourceInfo, documentListData.getDataSourceInfo());\n    }\n\n    @Test\n    public void testCreatedFrom() {\n        documentListData.setCreatedFrom(\"test_created_from\");\n        assertEquals(\"test_created_from\", documentListData.getCreatedFrom());\n    }\n\n    @Test\n    public void testCreatedBy() {\n        documentListData.setCreatedBy(\"test_created_by\");\n        assertEquals(\"test_created_by\", documentListData.getCreatedBy());\n    }\n\n    @Test\n    public void testCreatedAt() {\n        documentListData.setCreatedAt(123456789L);\n        assertEquals(123456789L, documentListData.getCreatedAt());\n    }\n\n    @Test\n    public void testIndexingStatus() {\n        documentListData.setIndexingStatus(\"indexing\");\n        assertEquals(\"indexing\", documentListData.getIndexingStatus());\n    }\n\n    @Test\n    public void testError() {\n        Object error = new Object();\n        documentListData.setError(error);\n        assertEquals(error, documentListData.getError());\n    }\n\n    @Test\n    public void testEnabled() {\n        documentListData.setEnabled(true);\n        assertTrue(documentListData.isEnabled());\n\n        documentListData.setEnabled(false);\n        assertFalse(documentListData.isEnabled());\n    }\n\n    @Test\n    public void testDisplayStatus() {\n        documentListData.setDisplayStatus(\"displaying\");\n        assertEquals(\"displaying\", documentListData.getDisplayStatus());\n    }\n\n    @Test\n    public void testWordCount() {\n        documentListData.setWordCount(1000);\n        assertEquals(1000, documentListData.getWordCount());\n    }\n\n    @Test\n    public void testEstimatedWaitingMinutes() {\n        documentListData.setEstimatedWaitingMinutes(30);\n        assertEquals(30, documentListData.getEstimatedWaitingMinutes());\n    }\n\n    @Test\n    public void testDisabledAt() {\n        Object disabledAt = new Object();\n        documentListData.setDisabledAt(disabledAt);\n        assertEquals(disabledAt, documentListData.getDisabledAt());\n    }\n\n    @Test\n    public void testDisabledBy() {\n        Object disabledBy = new Object();\n        documentListData.setDisabledBy(disabledBy);\n        assertEquals(disabledBy, documentListData.getDisabledBy());\n    }\n\n    @Test\n    public void testToString() {\n        documentListData.setId(\"test_id\");\n        documentListData.setName(\"test_name\");\n        documentListData.setDatasetProcessRuleId(\"test_rule_id\");\n        documentListData.setDataSourceType(\"test_source_type\");\n        documentListData.setPosition(5);\n        Map<String, String> dataSourceInfo = new HashMap<>();\n        dataSourceInfo.put(\"key1\", \"value1\");\n        documentListData.setDataSourceInfo(dataSourceInfo);\n        documentListData.setCreatedFrom(\"test_created_from\");\n        documentListData.setCreatedBy(\"test_created_by\");\n        documentListData.setCreatedAt(123456789L);\n        documentListData.setIndexingStatus(\"indexing\");\n        documentListData.setError(null);\n        documentListData.setEnabled(true);\n        documentListData.setDisplayStatus(\"displaying\");\n        documentListData.setWordCount(1000);\n        documentListData.setEstimatedWaitingMinutes(30);\n        documentListData.setDisabledAt(null);\n        documentListData.setDisabledBy(null);\n\n        String expectedString = \"DocumentListData{\" +\n                \"id='test_id', name='test_name', datasetProcessRuleId='test_rule_id', dataSourceType='test_source_type', \" +\n                \"position=5, dataSourceInfo={key1=value1}, createdFrom='test_created_from', createdBy='test_created_by', \" +\n                \"createdAt=123456789, indexingStatus='indexing', error=null, enabled=true, displayStatus='displaying', \" +\n                \"wordCount=1000, estimatedWaitingMinutes=30, disabledAt=null, disabledBy=null}\";\n        assertEquals(expectedString, documentListData.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/dataset/DocumentListResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class DocumentListResponseTest {\n    private DocumentListResponse documentListResponse;\n    private DocumentListResult documentListResult;\n\n    @Before\n    public void setUp() {\n        documentListResponse = new DocumentListResponse();\n\n        // Initialize DocumentListResult (assuming it has a default constructor and setters)\n        documentListResult = new DocumentListResult();\n        documentListResult.setTotal(100);\n        documentListResult.setPage(1);\n    }\n\n    @Test\n    public void testCode() {\n        documentListResponse.setCode(200);\n        assertEquals(200, documentListResponse.getCode());\n    }\n\n    @Test\n    public void testMessage() {\n        documentListResponse.setMessage(\"Request successful\");\n        assertEquals(\"Request successful\", documentListResponse.getMessage());\n    }\n\n    @Test\n    public void testResult() {\n        documentListResponse.setResult(documentListResult);\n        assertNotNull(documentListResponse.getResult());\n        assertEquals(100, documentListResponse.getResult().getTotal());\n        assertEquals(1, documentListResponse.getResult().getPage());\n    }\n\n    @Test\n    public void testToString() {\n        documentListResponse.setCode(200);\n        documentListResponse.setMessage(\"Request successful\");\n        documentListResponse.setResult(documentListResult);\n\n        String expectedString = \"DocumentListResponse{\" +\n                \"code=200, message='Request successful', result=\" + documentListResult + \"}\";\n        assertEquals(expectedString, documentListResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/dataset/DocumentListResultTest.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class DocumentListResultTest {\n    private DocumentListResult documentListResult;\n\n    @Before\n    public void setUp() {\n        documentListResult = new DocumentListResult();\n    }\n\n    @Test\n    public void testHasMore() {\n        documentListResult.setHasMore(true);\n        assertTrue(documentListResult.isHasMore());\n\n        documentListResult.setHasMore(false);\n        assertFalse(documentListResult.isHasMore());\n    }\n\n    @Test\n    public void testLimit() {\n        documentListResult.setLimit(10);\n        assertEquals(10, documentListResult.getLimit());\n    }\n\n    @Test\n    public void testPage() {\n        documentListResult.setPage(2);\n        assertEquals(2, documentListResult.getPage());\n    }\n\n    @Test\n    public void testTotal() {\n        documentListResult.setTotal(100);\n        assertEquals(100, documentListResult.getTotal());\n    }\n\n    @Test\n    public void testData() {\n        DocumentListData data1 = new DocumentListData();\n        data1.setId(\"doc1\");\n        data1.setName(\"Document 1\");\n\n        DocumentListData data2 = new DocumentListData();\n        data2.setId(\"doc2\");\n        data2.setName(\"Document 2\");\n\n        DocumentListData[] dataArray = {data1, data2};\n        documentListResult.setData(dataArray);\n\n        assertEquals(2, documentListResult.getData().length);\n        assertEquals(\"doc1\", documentListResult.getData()[0].getId());\n        assertEquals(\"Document 1\", documentListResult.getData()[0].getName());\n        assertEquals(\"doc2\", documentListResult.getData()[1].getId());\n        assertEquals(\"Document 2\", documentListResult.getData()[1].getName());\n    }\n\n    @Test\n    public void testToString() {\n        DocumentListData data1 = new DocumentListData();\n        data1.setId(\"doc1\");\n        data1.setName(\"Document 1\");\n\n        DocumentListData[] dataArray = {data1};\n        documentListResult.setHasMore(true);\n        documentListResult.setLimit(5);\n        documentListResult.setPage(1);\n        documentListResult.setTotal(50);\n        documentListResult.setData(dataArray);\n\n        String expectedString = \"DocumentListResult{\" +\n                \"hasMore=true, limit=5, page=1, total=50, data=[DocumentListData{id='doc1', name='Document 1', datasetProcessRuleId='null', dataSourceType='null', position=0, dataSourceInfo=null, createdFrom='null', createdBy='null', createdAt=0, indexingStatus='null', error=null, enabled=false, displayStatus='null', wordCount=0, estimatedWaitingMinutes=0, disabledAt=null, disabledBy=null}]}\";\n\n        assertEquals(expectedString, documentListResult.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/dataset/FileUploadResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class FileUploadResponseTest {\n    private FileUploadResponse fileUploadResponse;\n    private FileUploadResult fileUploadResult;\n\n    @Before\n    public void setUp() {\n        fileUploadResponse = new FileUploadResponse();\n        fileUploadResult = new FileUploadResult();\n        fileUploadResult.setId(\"file123\");\n        fileUploadResult.setName(\"testFile.txt\");\n        fileUploadResult.setSize(1024);\n        fileUploadResult.setExtension(\".txt\");\n        fileUploadResult.setMimeType(\"text/plain\");\n        fileUploadResult.setCreatedBy(\"user123\");\n        fileUploadResult.setCreatedAt(123456789L);\n    }\n\n    @Test\n    public void testCode() {\n        fileUploadResponse.setCode(200);\n        assertEquals(200, fileUploadResponse.getCode());\n    }\n\n    @Test\n    public void testMessage() {\n        fileUploadResponse.setMessage(\"Upload successful\");\n        assertEquals(\"Upload successful\", fileUploadResponse.getMessage());\n    }\n\n    @Test\n    public void testResult() {\n        fileUploadResponse.setResult(fileUploadResult);\n        assertNotNull(fileUploadResponse.getResult());\n        assertEquals(\"file123\", fileUploadResponse.getResult().getId());\n        assertEquals(\"testFile.txt\", fileUploadResponse.getResult().getName());\n        assertEquals(1024, fileUploadResponse.getResult().getSize());\n        assertEquals(\".txt\", fileUploadResponse.getResult().getExtension());\n        assertEquals(\"text/plain\", fileUploadResponse.getResult().getMimeType());\n        assertEquals(\"user123\", fileUploadResponse.getResult().getCreatedBy());\n        assertEquals(123456789L, fileUploadResponse.getResult().getCreatedAt());\n    }\n\n    @Test\n    public void testToString() {\n        fileUploadResponse.setCode(200);\n        fileUploadResponse.setMessage(\"Upload successful\");\n        fileUploadResponse.setResult(fileUploadResult);\n\n        String expectedString = \"FileUploadResponse{\" +\n                \"code=200, message='Upload successful', result=FileUploadResult{id='file123', name='testFile.txt', size=1024, extension='.txt', mimeType='text/plain', createdBy='user123', createdAt=123456789}}\";\n        \n        assertEquals(expectedString, fileUploadResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/dataset/FileUploadResultTest.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class FileUploadResultTest {\n    private FileUploadResult fileUploadResult;\n\n    @Before\n    public void setUp() {\n        fileUploadResult = new FileUploadResult();\n    }\n\n    @Test\n    public void testId() {\n        fileUploadResult.setId(\"test_id\");\n        assertEquals(\"test_id\", fileUploadResult.getId());\n    }\n\n    @Test\n    public void testName() {\n        fileUploadResult.setName(\"test_name\");\n        assertEquals(\"test_name\", fileUploadResult.getName());\n    }\n\n    @Test\n    public void testSize() {\n        fileUploadResult.setSize(1024);\n        assertEquals(1024, fileUploadResult.getSize());\n    }\n\n    @Test\n    public void testExtension() {\n        fileUploadResult.setExtension(\".txt\");\n        assertEquals(\".txt\", fileUploadResult.getExtension());\n    }\n\n    @Test\n    public void testMimeType() {\n        fileUploadResult.setMimeType(\"text/plain\");\n        assertEquals(\"text/plain\", fileUploadResult.getMimeType());\n    }\n\n    @Test\n    public void testCreatedBy() {\n        fileUploadResult.setCreatedBy(\"test_user\");\n        assertEquals(\"test_user\", fileUploadResult.getCreatedBy());\n    }\n\n    @Test\n    public void testCreatedAt() {\n        fileUploadResult.setCreatedAt(123456789L);\n        assertEquals(123456789L, fileUploadResult.getCreatedAt());\n    }\n\n    @Test\n    public void testToString() {\n        fileUploadResult.setId(\"test_id\");\n        fileUploadResult.setName(\"test_name\");\n        fileUploadResult.setSize(1024);\n        fileUploadResult.setExtension(\".txt\");\n        fileUploadResult.setMimeType(\"text/plain\");\n        fileUploadResult.setCreatedBy(\"test_user\");\n        fileUploadResult.setCreatedAt(123456789L);\n\n        String expectedString = \"FileUploadResult{\" +\n                \"id='test_id', name='test_name', size=1024, extension='.txt', mimeType='text/plain', \" +\n                \"createdBy='test_user', createdAt=123456789}\";\n\n        assertEquals(expectedString, fileUploadResult.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/dataset/ResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.dataset;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ResponseTest {\n    private DatasetCreateResponse datasetCreateResponse;\n    private DocumentAddResponse documentAddResponse;\n    private DocumentDeleteResponse documentDeleteResponse;\n\n    @Before\n    public void setUp() {\n        // Initialize DatasetCreateResponse\n        datasetCreateResponse = new DatasetCreateResponse();\n        DatasetCreateResult datasetCreateResult = new DatasetCreateResult(); // Assume default constructor\n        datasetCreateResponse.setCode(200);\n        datasetCreateResponse.setMessage(\"Dataset created successfully\");\n        datasetCreateResponse.setResult(datasetCreateResult);\n\n        // Initialize DocumentAddResponse\n        documentAddResponse = new DocumentAddResponse();\n        DocumentAddResult documentAddResult = new DocumentAddResult(); // Assume default constructor\n        documentAddResponse.setCode(201);\n        documentAddResponse.setMessage(\"Document added successfully\");\n        documentAddResponse.setResult(documentAddResult);\n\n        // Initialize DocumentDeleteResponse\n        documentDeleteResponse = new DocumentDeleteResponse();\n        documentDeleteResponse.setCode(204);\n        documentDeleteResponse.setMessage(\"Document deleted successfully\");\n        documentDeleteResponse.setResult(null); // Assume result can be null\n    }\n\n    @Test\n    public void testDatasetCreateResponse() {\n        assertEquals(200, datasetCreateResponse.getCode());\n        assertEquals(\"Dataset created successfully\", datasetCreateResponse.getMessage());\n        assertNotNull(datasetCreateResponse.getResult());\n\n        String expectedString = \"DatasetCreateResponse{\" +\n                \"code=200\" +\n                \", message='Dataset created successfully'\" +\n                \", result=\" + datasetCreateResponse.getResult() +\n                '}';\n        assertEquals(expectedString, datasetCreateResponse.toString());\n    }\n\n    @Test\n    public void testDocumentAddResponse() {\n        assertEquals(201, documentAddResponse.getCode());\n        assertEquals(\"Document added successfully\", documentAddResponse.getMessage());\n        assertNotNull(documentAddResponse.getResult());\n\n        String expectedString = \"DocumentAddResponse{\" +\n                \"code=201\" +\n                \", message='Document added successfully'\" +\n                \", result=\" + documentAddResponse.getResult() +\n                '}';\n        assertEquals(expectedString, documentAddResponse.toString());\n    }\n\n    @Test\n    public void testDocumentDeleteResponse() {\n        assertEquals(204, documentDeleteResponse.getCode());\n        assertEquals(\"Document deleted successfully\", documentDeleteResponse.getMessage());\n        assertNull(documentDeleteResponse.getResult());\n\n        String expectedString = \"DocumentDeleteResponse{\" +\n                \"code=204\" +\n                \", message='Document deleted successfully'\" +\n                \", result=null\" +\n                '}';\n        assertEquals(expectedString, documentDeleteResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/ChunkCreateRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.assertEquals;\n\npublic class ChunkCreateRequestTest {\n\n    private ChunkCreateRequest chunkCreateRequest;\n\n    @Before\n    public void setUp() {\n        chunkCreateRequest = new ChunkCreateRequest(\"doc123\", \"This is the content of the chunk.\");\n    }\n\n    @Test\n    public void testGetDocumentId() {\n        assertEquals(\"doc123\", chunkCreateRequest.getDocumentId());\n    }\n\n    @Test\n    public void testGetContent() {\n        assertEquals(\"This is the content of the chunk.\", chunkCreateRequest.getContent());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/ChunkCreateResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ChunkCreateResponseTest {\n\n    private ChunkCreateResponse chunkCreateResponse;\n\n    @Before\n    public void setUp() {\n        // 初始化 ChunkCreateResponse 对象\n        chunkCreateResponse = new ChunkCreateResponse();\n    }\n\n    @Test\n    public void testSetAndGetChunkId() {\n        // 设置 chunkId\n        chunkCreateResponse.setChunkId(\"chunk123\");\n\n        // 验证是否正确返回设置的 chunkId\n        assertEquals(\"chunk123\", chunkCreateResponse.getChunkId());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/ChunkDeleteRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.assertEquals;\n\npublic class ChunkDeleteRequestTest {\n\n    private ChunkDeleteRequest chunkDeleteRequest;\n\n    @Before\n    public void setUp() {\n        chunkDeleteRequest = new ChunkDeleteRequest();\n    }\n\n    @Test\n    public void testSetAndGetChunkId() {\n        String expectedChunkId = \"chunk123\";\n        chunkDeleteRequest.setChunkId(expectedChunkId);\n        assertEquals(expectedChunkId, chunkDeleteRequest.getChunkId());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/ChunkDescribeRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ChunkDescribeRequestTest {\n\n    private ChunkDescribeRequest chunkDescribeRequest;\n\n    @Before\n    public void setUp() {\n        // 初始化 ChunkDescribeRequest 对象\n        chunkDescribeRequest = new ChunkDescribeRequest();\n    }\n\n    @Test\n    public void testSetAndGetChunkId() {\n        // 设置 chunkId\n        chunkDescribeRequest.setChunkId(\"chunk123\");\n\n        // 验证是否正确返回设置的 chunkId\n        assertEquals(\"chunk123\", chunkDescribeRequest.getChunkId());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/ChunkDescribeResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ChunkDescribeResponseTest {\n    private ChunkDescribeResponse chunkDescribeResponse;\n\n    @Before\n    public void setUp() {\n        chunkDescribeResponse = new ChunkDescribeResponse();\n    }\n\n    @Test\n    public void testChunkId() {\n        chunkDescribeResponse.setChunkId(\"test_chunk_id\");\n        assertEquals(\"test_chunk_id\", chunkDescribeResponse.getChunkId());\n    }\n\n    @Test\n    public void testType() {\n        chunkDescribeResponse.setType(\"test_type\");\n        assertEquals(\"test_type\", chunkDescribeResponse.getType());\n    }\n\n    @Test\n    public void testKnowledgeBaseId() {\n        chunkDescribeResponse.setKnowledgeBaseId(\"test_knowledge_base_id\");\n        assertEquals(\"test_knowledge_base_id\", chunkDescribeResponse.getKnowledgeBaseId());\n    }\n\n    @Test\n    public void testDocumentId() {\n        chunkDescribeResponse.setDocumentId(\"test_document_id\");\n        assertEquals(\"test_document_id\", chunkDescribeResponse.getDocumentId());\n    }\n\n    @Test\n    public void testContent() {\n        chunkDescribeResponse.setContent(\"test_content\");\n        assertEquals(\"test_content\", chunkDescribeResponse.getContent());\n    }\n\n    @Test\n    public void testWordCount() {\n        chunkDescribeResponse.setWordCount(123);\n        assertEquals(Integer.valueOf(123), chunkDescribeResponse.getWordCount());\n    }\n\n    @Test\n    public void testTokenCount() {\n        chunkDescribeResponse.setTokenCount(456);\n        assertEquals(Integer.valueOf(456), chunkDescribeResponse.getTokenCount());\n    }\n\n    @Test\n    public void testEnabled() {\n        chunkDescribeResponse.setEnabled(true);\n        assertTrue(chunkDescribeResponse.getEnabled());\n\n        chunkDescribeResponse.setEnabled(false);\n        assertFalse(chunkDescribeResponse.getEnabled());\n    }\n\n    @Test\n    public void testStatus() {\n        chunkDescribeResponse.setStatus(\"test_status\");\n        assertEquals(\"test_status\", chunkDescribeResponse.getStatus());\n    }\n\n    @Test\n    public void testStatusMessage() {\n        chunkDescribeResponse.setStatusMessage(\"test_status_message\");\n        assertEquals(\"test_status_message\", chunkDescribeResponse.getStatusMessage());\n    }\n\n    @Test\n    public void testCreateTime() {\n        chunkDescribeResponse.setCreateTime(789);\n        assertEquals(Integer.valueOf(789), chunkDescribeResponse.getCreateTime());\n    }\n\n    @Test\n    public void testUpdateTime() {\n        chunkDescribeResponse.setUpdateTime(101112);\n        assertEquals(Integer.valueOf(101112), chunkDescribeResponse.getUpdateTime());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/ChunkModifyRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ChunkModifyRequestTest {\n\n    private ChunkModifyRequest chunkModifyRequest;\n\n    @Before\n    public void setUp() {\n        // 初始化 ChunkModifyRequest 对象\n        chunkModifyRequest = new ChunkModifyRequest(\"chunk123\", \"new content\", true);\n    }\n\n    @Test\n    public void testGetChunkId() {\n        assertEquals(\"chunk123\", chunkModifyRequest.getChunkId());\n    }\n\n    @Test\n    public void testGetContent() {\n        assertEquals(\"new content\", chunkModifyRequest.getContent());\n    }\n\n    @Test\n    public void testGetEnable() {\n        assertTrue(chunkModifyRequest.getEnable());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/ChunksDescribeRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ChunksDescribeRequestTest {\n\n    private ChunksDescribeRequest chunksDescribeRequest;\n\n    @Before\n    public void setUp() {\n        // 初始化 ChunksDescribeRequest 对象\n        chunksDescribeRequest = new ChunksDescribeRequest(\"doc123\", \"marker123\", 10, \"chunkType\");\n    }\n\n    @Test\n    public void testGetDocumentId() {\n        assertEquals(\"doc123\", chunksDescribeRequest.getDocumentId());\n    }\n\n    @Test\n    public void testGetMarker() {\n        assertEquals(\"marker123\", chunksDescribeRequest.getMarker());\n    }\n\n    @Test\n    public void testGetMaxKeys() {\n        assertEquals(Integer.valueOf(10), chunksDescribeRequest.getMaxKeys());\n    }\n\n    @Test\n    public void testGetType() {\n        assertEquals(\"chunkType\", chunksDescribeRequest.getType());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/ChunksDescribeResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ChunksDescribeResponseTest {\n    private ChunksDescribeResponse chunksDescribeResponse;\n    private ChunkDescribeResponse chunk1;\n    private ChunkDescribeResponse chunk2;\n\n    @Before\n    public void setUp() {\n        chunksDescribeResponse = new ChunksDescribeResponse();\n\n        // Initialize ChunkDescribeResponse objects (assuming ChunkDescribeResponse has default constructor and setters)\n        chunk1 = new ChunkDescribeResponse();\n        chunk1.setChunkId(\"chunk1\");\n        chunk1.setContent(\"Content of chunk 1\");\n\n        chunk2 = new ChunkDescribeResponse();\n        chunk2.setChunkId(\"chunk2\");\n        chunk2.setContent(\"Content of chunk 2\");\n\n        chunksDescribeResponse.setData(new ChunkDescribeResponse[]{chunk1, chunk2});\n        chunksDescribeResponse.setMarker(\"testMarker\");\n        chunksDescribeResponse.setTruncated(true);\n        chunksDescribeResponse.setNextMarker(\"testNextMarker\");\n        chunksDescribeResponse.setMaxKeys(100);\n    }\n\n    @Test\n    public void testData() {\n        ChunkDescribeResponse[] data = chunksDescribeResponse.getData();\n        assertNotNull(data);\n        assertEquals(2, data.length);\n        assertEquals(\"chunk1\", data[0].getChunkId());\n        assertEquals(\"Content of chunk 1\", data[0].getContent());\n        assertEquals(\"chunk2\", data[1].getChunkId());\n        assertEquals(\"Content of chunk 2\", data[1].getContent());\n    }\n\n    @Test\n    public void testMarker() {\n        assertEquals(\"testMarker\", chunksDescribeResponse.getMarker());\n    }\n\n    @Test\n    public void testIsTruncated() {\n        assertTrue(chunksDescribeResponse.isTruncated());\n    }\n\n    @Test\n    public void testNextMarker() {\n        assertEquals(\"testNextMarker\", chunksDescribeResponse.getNextMarker());\n    }\n\n    @Test\n    public void testMaxKeys() {\n        assertEquals(Integer.valueOf(100), chunksDescribeResponse.getMaxKeys());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/DocumentAddRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertArrayEquals;\nimport static org.junit.Assert.assertEquals;\n\npublic class DocumentAddRequestTest {\n\n    private DocumentAddRequest documentAddRequest;\n    private DocumentAddRequest.CustomProcessRule customProcessRule;\n\n    @Before\n    public void setUp() {\n        documentAddRequest = new DocumentAddRequest();\n        customProcessRule = new DocumentAddRequest.CustomProcessRule();\n    }\n\n    @Test\n    public void testSetAndGetKnowledgeBaseId() {\n        String knowledgeBaseId = \"kb123\";\n        documentAddRequest.setKnowledgeBaseId(knowledgeBaseId);\n        assertEquals(knowledgeBaseId, documentAddRequest.getKnowledgeBaseId());\n    }\n\n    @Test\n    public void testSetAndGetContentType() {\n        String contentType = \"text\";\n        documentAddRequest.setContentType(contentType);\n        assertEquals(contentType, documentAddRequest.getContentType());\n    }\n\n    @Test\n    public void testSetAndGetIsEnhanced() {\n        boolean isEnhanced = true;\n        documentAddRequest.setEnhanced(isEnhanced);\n        assertEquals(isEnhanced, documentAddRequest.isEnhanced());\n    }\n\n    @Test\n    public void testSetAndGetFileIds() {\n        String[] fileIds = {\"file1\", \"file2\"};\n        documentAddRequest.setFileIds(fileIds);\n        assertArrayEquals(fileIds, documentAddRequest.getFileIds());\n    }\n\n    @Test\n    public void testSetAndGetCustomProcessRule() {\n        String[] separators = {\",\", \";\"};\n        int targetLength = 100;\n        double overlapRate = 0.5;\n\n        customProcessRule.setSeparators(separators);\n        customProcessRule.setTargetLength(targetLength);\n        customProcessRule.setOverlapRate(overlapRate);\n\n        documentAddRequest.setCustomProcessRule(customProcessRule);\n\n        assertArrayEquals(separators, documentAddRequest.getCustomProcessRule().getSeparators());\n        assertEquals(targetLength, documentAddRequest.getCustomProcessRule().getTargetLength());\n        assertEquals(overlapRate, documentAddRequest.getCustomProcessRule().getOverlapRate(), 0);\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/DocumentDeleteRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.util.Map;\n\nimport static org.junit.Assert.*;\n\npublic class DocumentDeleteRequestTest {\n\n    private DocumentDeleteRequest documentDeleteRequest;\n\n    @Before\n    public void setUp() {\n        // 初始化 DocumentDeleteRequest 对象\n        documentDeleteRequest = new DocumentDeleteRequest();\n    }\n\n    @Test\n    public void testSetAndGetKonwledgeBaseId() {\n        // 设置 knowledgeBaseId\n        documentDeleteRequest.setKonwledgeBaseId(\"kb123\");\n\n        // 验证是否正确返回设置的 knowledgeBaseId\n        assertEquals(\"kb123\", documentDeleteRequest.getKonwledgeBaseId());\n    }\n\n    @Test\n    public void testSetAndGetDocumentId() {\n        // 设置 documentId\n        documentDeleteRequest.setDocumentId(\"doc456\");\n\n        // 验证是否正确返回设置的 documentId\n        assertEquals(\"doc456\", documentDeleteRequest.getDocumentId());\n    }\n\n    @Test\n    public void testToMap() {\n        // 设置字段\n        documentDeleteRequest.setKonwledgeBaseId(\"kb123\");\n        documentDeleteRequest.setDocumentId(\"doc456\");\n\n        // 验证 toMap() 方法是否正确返回 map\n        Map<String, Object> resultMap = documentDeleteRequest.toMap();\n        assertEquals(\"kb123\", resultMap.get(\"knowledge_base_id\"));\n        assertEquals(\"doc456\", resultMap.get(\"document_id\"));\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/DocumentDeleteResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class DocumentDeleteResponseTest {\n\n    private DocumentDeleteResponse documentDeleteResponse;\n\n    @Before\n    public void setUp() {\n        documentDeleteResponse = new DocumentDeleteResponse();\n    }\n\n    @Test\n    public void testGetSetRequestId() {\n        documentDeleteResponse.setRequestId(\"req123\");\n        assertEquals(\"req123\", documentDeleteResponse.getRequestId());\n    }\n\n    @Test\n    public void testGetSetCode() {\n        documentDeleteResponse.setCode(\"200\");\n        assertEquals(\"200\", documentDeleteResponse.getCode());\n    }\n\n    @Test\n    public void testGetSetMessage() {\n        documentDeleteResponse.setMessage(\"Success\");\n        assertEquals(\"Success\", documentDeleteResponse.getMessage());\n    }\n\n    @Test\n    public void testToString() {\n        documentDeleteResponse.setRequestId(\"req123\");\n        documentDeleteResponse.setCode(\"200\");\n        documentDeleteResponse.setMessage(\"Success\");\n\n        String expectedString = \"DocumentDeleteResponse{\" +\n                \"request_id=req123\" +\n                \", code='200'\" +\n                \", message='Success\" +\n                '}';\n\n        assertEquals(expectedString, documentDeleteResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/DocumentListRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.util.Map;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\n\npublic class DocumentListRequestTest {\n\n    private DocumentListRequest documentListRequest;\n\n    @Before\n    public void setUp() {\n        documentListRequest = new DocumentListRequest();\n    }\n\n    @Test\n    public void testGetSetKonwledgeBaseId() {\n        documentListRequest.setKonwledgeBaseId(\"kb123\");\n        assertEquals(\"kb123\", documentListRequest.getKonwledgeBaseId());\n    }\n\n    @Test\n    public void testGetSetLimit() {\n        documentListRequest.setLimit(10);\n        assertEquals(10, documentListRequest.getLimit());\n    }\n\n    @Test\n    public void testGetSetAfter() {\n        documentListRequest.setAfter(\"afterToken\");\n        assertEquals(\"afterToken\", documentListRequest.getAfter());\n    }\n\n    @Test\n    public void testGetSetBefore() {\n        documentListRequest.setBefore(\"beforeToken\");\n        assertEquals(\"beforeToken\", documentListRequest.getBefore());\n    }\n\n    @Test\n    public void testToMapWithAllValues() {\n        documentListRequest.setKonwledgeBaseId(\"kb123\");\n        documentListRequest.setLimit(10);\n        documentListRequest.setAfter(\"afterToken\");\n        documentListRequest.setBefore(\"beforeToken\");\n\n        Map<String, Object> resultMap = documentListRequest.toMap();\n\n        assertEquals(4, resultMap.size());\n        assertEquals(\"kb123\", resultMap.get(\"knowledge_base_id\"));\n        assertEquals(10, resultMap.get(\"limit\"));\n        assertEquals(\"afterToken\", resultMap.get(\"after\"));\n        assertEquals(\"beforeToken\", resultMap.get(\"before\"));\n    }\n\n    @Test\n    public void testToMapWithLimitZero() {\n        documentListRequest.setKonwledgeBaseId(\"kb123\");\n        documentListRequest.setLimit(0); // limit set to 0\n        documentListRequest.setAfter(\"afterToken\");\n        documentListRequest.setBefore(\"beforeToken\");\n\n        Map<String, Object> resultMap = documentListRequest.toMap();\n\n        assertEquals(3, resultMap.size()); // limit should not be included\n        assertEquals(\"kb123\", resultMap.get(\"knowledge_base_id\"));\n        assertEquals(\"afterToken\", resultMap.get(\"after\"));\n        assertEquals(\"beforeToken\", resultMap.get(\"before\"));\n        assertTrue(!resultMap.containsKey(\"limit\")); // Ensure limit is not included when it's 0\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/DocumentListResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class DocumentListResponseTest {\n    private DocumentListResponse documentListResponse;\n    private Document document1;\n    private Document document2;\n\n    @Before\n    public void setUp() {\n        documentListResponse = new DocumentListResponse();\n\n        // Initialize Document objects (assuming Document has default constructor and setters)\n        document1 = new Document();\n        document1.setId(\"doc1\");\n        document1.setName(\"Document 1\");\n\n        document2 = new Document();\n        document2.setId(\"doc2\");\n        document2.setName(\"Document 2\");\n\n        documentListResponse.setRequestId(\"testRequestId\");\n        documentListResponse.setData(new Document[]{document1, document2});\n        documentListResponse.setCode(\"200\");\n        documentListResponse.setMessage(\"Request successful\");\n    }\n\n    @Test\n    public void testRequestId() {\n        assertEquals(\"testRequestId\", documentListResponse.getRequestId());\n    }\n\n    @Test\n    public void testData() {\n        Document[] data = documentListResponse.getData();\n        assertNotNull(data);\n        assertEquals(2, data.length);\n        assertEquals(\"doc1\", data[0].getId());\n        assertEquals(\"Document 1\", data[0].getName());\n        assertEquals(\"doc2\", data[1].getId());\n        assertEquals(\"Document 2\", data[1].getName());\n    }\n\n    @Test\n    public void testCode() {\n        assertEquals(\"200\", documentListResponse.getCode());\n    }\n\n    @Test\n    public void testMessage() {\n        assertEquals(\"Request successful\", documentListResponse.getMessage());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/DocumentTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class DocumentTest {\n    private Document document;\n    private Document.Meta meta;\n\n    @Before\n    public void setUp() {\n        document = new Document();\n        meta = new Document.Meta();\n    }\n\n    @Test\n    public void testId() {\n        document.setId(\"doc123\");\n        assertEquals(\"doc123\", document.getId());\n    }\n\n    @Test\n    public void testName() {\n        document.setName(\"Test Document\");\n        assertEquals(\"Test Document\", document.getName());\n    }\n\n    @Test\n    public void testCreatedAt() {\n        document.setCreatedAt(\"2024-01-01T00:00:00Z\");\n        assertEquals(\"2024-01-01T00:00:00Z\", document.getCreatedAt());\n    }\n\n    @Test\n    public void testWordCount() {\n        document.setWordCount(500);\n        assertEquals(500, document.getWordCount());\n    }\n\n    @Test\n    public void testEnabled() {\n        document.setEnabled(true);\n        assertTrue(document.isEnabled());\n\n        document.setEnabled(false);\n        assertFalse(document.isEnabled());\n    }\n\n    @Test\n    public void testMeta() {\n        meta.setSource(\"http://example.com\");\n        meta.setFileId(\"file123\");\n\n        document.setMeta(meta);\n\n        assertEquals(\"http://example.com\", document.getMeta().getSource());\n        assertEquals(\"file123\", document.getMeta().getFileId());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/DocumentsCreateRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class DocumentsCreateRequestTest {\n    private DocumentsCreateRequest documentsCreateRequest;\n    private DocumentsCreateRequest.Source source;\n    private DocumentsCreateRequest.ProcessOption processOption;\n    private DocumentsCreateRequest.ProcessOption.Parser parser;\n    private DocumentsCreateRequest.ProcessOption.Chunker chunker;\n    private DocumentsCreateRequest.ProcessOption.Chunker.Separator separator;\n    private DocumentsCreateRequest.ProcessOption.Chunker.Pattern pattern;\n    private DocumentsCreateRequest.ProcessOption.KnowledgeAugmentation knowledgeAugmentation;\n\n    @Before\n    public void setUp() {\n        // Initialize inner classes\n        parser = new DocumentsCreateRequest.ProcessOption.Parser(new String[]{\"choice1\", \"choice2\"});\n        separator = new DocumentsCreateRequest.ProcessOption.Chunker.Separator(\n                new String[]{\",\"}, 100, 0.5);\n        pattern = new DocumentsCreateRequest.ProcessOption.Chunker.Pattern(\n                \"start\", \"\\\\w+\", 200, 0.3);\n        chunker = new DocumentsCreateRequest.ProcessOption.Chunker(\n                new String[]{\"chunkChoice1\"}, separator, pattern, new String[]{\"info1\"});\n        knowledgeAugmentation = new DocumentsCreateRequest.ProcessOption.KnowledgeAugmentation(\n                new String[]{\"augment1\", \"augment2\"});\n\n        processOption = new DocumentsCreateRequest.ProcessOption(\n                \"template1\", parser, chunker, knowledgeAugmentation);\n        source = new DocumentsCreateRequest.Source(\"url\", new String[]{\"http://example.com\"}, 2);\n\n        // Initialize main class\n        documentsCreateRequest = new DocumentsCreateRequest(\n                \"knowledge_base_1\", \"text/plain\", source, processOption);\n    }\n\n    @Test\n    public void testKnowledgeBaseId() {\n        assertEquals(\"knowledge_base_1\", documentsCreateRequest.getKnowledgeBaseId());\n    }\n\n    @Test\n    public void testContentFormat() {\n        assertEquals(\"text/plain\", documentsCreateRequest.getContentFormat());\n    }\n\n    @Test\n    public void testSource() {\n        assertEquals(\"url\", documentsCreateRequest.getSource().getType());\n        assertArrayEquals(new String[]{\"http://example.com\"}, documentsCreateRequest.getSource().getUrls());\n        assertEquals(Integer.valueOf(2), documentsCreateRequest.getSource().getUrlDepth());\n    }\n\n    @Test\n    public void testProcessOption() {\n        assertEquals(\"template1\", documentsCreateRequest.getProcessOption().getTemplate());\n\n        // Test Parser\n        assertArrayEquals(new String[]{\"choice1\", \"choice2\"}, documentsCreateRequest.getProcessOption().getParser().getChoices());\n\n        // Test Chunker\n        assertArrayEquals(new String[]{\"chunkChoice1\"}, documentsCreateRequest.getProcessOption().getChunker().getChoices());\n        assertArrayEquals(new String[]{\"info1\"}, documentsCreateRequest.getProcessOption().getChunker().getPrependInfo());\n\n        // Test Separator\n        assertArrayEquals(new String[]{\",\"}, documentsCreateRequest.getProcessOption().getChunker().getSeparator().getSeparators());\n        assertEquals(Integer.valueOf(100), documentsCreateRequest.getProcessOption().getChunker().getSeparator().getTargetLength());\n        assertEquals(Double.valueOf(0.5), documentsCreateRequest.getProcessOption().getChunker().getSeparator().getOverlapRate());\n\n        // Test Pattern\n        assertEquals(\"start\", documentsCreateRequest.getProcessOption().getChunker().getPattern().getMarkPosition());\n        assertEquals(\"\\\\w+\", documentsCreateRequest.getProcessOption().getChunker().getPattern().getRegex());\n        assertEquals(Integer.valueOf(200), documentsCreateRequest.getProcessOption().getChunker().getPattern().getTargetLength());\n        assertEquals(Double.valueOf(0.3), documentsCreateRequest.getProcessOption().getChunker().getPattern().getOverlapRate());\n\n        // Test Knowledge Augmentation\n        assertArrayEquals(new String[]{\"augment1\", \"augment2\"}, documentsCreateRequest.getProcessOption().getKnowledgeAugmentation().getChoices());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/FileUploadResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.assertEquals;\n\npublic class FileUploadResponseTest {\n\n    private FileUploadResponse fileUploadResponse;\n\n    @Before\n    public void setUp() {\n        fileUploadResponse = new FileUploadResponse();\n    }\n\n    @Test\n    public void testSetGetRequestId() {\n        fileUploadResponse.setRequestId(\"request123\");\n        assertEquals(\"request123\", fileUploadResponse.getRequestId());\n    }\n\n    @Test\n    public void testSetGetId() {\n        fileUploadResponse.setId(\"file123\");\n        assertEquals(\"file123\", fileUploadResponse.getId());\n    }\n\n    @Test\n    public void testSetGetCode() {\n        fileUploadResponse.setCode(\"200\");\n        assertEquals(\"200\", fileUploadResponse.getCode());\n    }\n\n    @Test\n    public void testSetGetMessage() {\n        fileUploadResponse.setMessage(\"Upload successful\");\n        assertEquals(\"Upload successful\", fileUploadResponse.getMessage());\n    }\n\n    @Test\n    public void testToString() {\n        fileUploadResponse.setRequestId(\"request123\");\n        fileUploadResponse.setId(\"file123\");\n        fileUploadResponse.setCode(\"200\");\n        fileUploadResponse.setMessage(\"Upload successful\");\n\n        String expected = \"FileUploadResponse{\" +\n                \"request_id=request123\" +\n                \", code='200'\" +\n                \", message='Upload successful\" +\n                '}';\n\n        assertEquals(expected, fileUploadResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseConfigTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.beans.Transient;\n\npublic class KnowledgeBaseConfigTest {\n\n    private KnowledgeBaseConfig knowledgeBaseConfig;\n    private KnowledgeBaseConfig.Index index;\n\n    @Before\n    public void setUp() {\n        index = new KnowledgeBaseConfig.Index(\"es\", \"clusterId\", \"user\", \"password\", \"bj\");\n        knowledgeBaseConfig = new KnowledgeBaseConfig(index);\n    }\n\n    @Test\n    public void testGetIndex() {\n        assertEquals(index, knowledgeBaseConfig.getIndex());\n    }\n\n    @Test\n    public void testIndexType() {\n        assertEquals(\"es\", index.getType());\n    }\n\n    @Test\n    public void testIndexClusterId() {\n        assertEquals(\"clusterId\", index.getClusterId());\n    }\n\n    @Test\n    public void testIndexUsername() {\n        assertEquals(\"user\", index.getUsername());\n    }\n\n    @Test\n    public void testIndexPassword() {\n        assertEquals(\"password\", index.getPassword());\n    }\n\n    @Test\n    public void testIndexLocation() {\n        assertEquals(\"bj\", index.getLocation());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseDetailRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\npublic class KnowledgeBaseDetailRequestTest {\n\n    private KnowledgeBaseDetailRequest knowledgeBaseDetailRequest;\n\n    @Before\n    public void setUp() {\n        knowledgeBaseDetailRequest = new KnowledgeBaseDetailRequest();\n    }\n\n    @Test\n    public void testGetKnowledgeBaseId() {\n        knowledgeBaseDetailRequest.setKnowledgeBaseId(\"testKnowledgeBaseId\");\n        assertEquals(\"testKnowledgeBaseId\", knowledgeBaseDetailRequest.getKnowledgeBaseId());\n    }\n\n    @Test\n    public void testSetKnowledgeBaseId() {\n        knowledgeBaseDetailRequest.setKnowledgeBaseId(\"newKnowledgeBaseId\");\n        assertEquals(\"newKnowledgeBaseId\", knowledgeBaseDetailRequest.getKnowledgeBaseId());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseDetailTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class KnowledgeBaseDetailTest {\n\n    private KnowledgeBaseDetail knowledgeBaseDetail;\n    private KnowledgeBaseConfig knowledgeBaseConfig;\n\n    @Before\n    public void setUp() {\n        knowledgeBaseDetail = new KnowledgeBaseDetail();\n        knowledgeBaseConfig = new KnowledgeBaseConfig(new KnowledgeBaseConfig.Index(\"type1\", \"clusterId\", \"user\", \"pass\", \"location\"));\n    }\n\n    @Test\n    public void testSetGetId() {\n        knowledgeBaseDetail.setId(\"kb123\");\n        assertEquals(\"kb123\", knowledgeBaseDetail.getId());\n    }\n\n    @Test\n    public void testSetGetName() {\n        knowledgeBaseDetail.setName(\"Knowledge Base Name\");\n        assertEquals(\"Knowledge Base Name\", knowledgeBaseDetail.getName());\n    }\n\n    @Test\n    public void testSetGetDescription() {\n        knowledgeBaseDetail.setDescription(\"This is a knowledge base description.\");\n        assertEquals(\"This is a knowledge base description.\", knowledgeBaseDetail.getDescription());\n    }\n\n    @Test\n    public void testSetGetConfig() {\n        knowledgeBaseDetail.setConfig(knowledgeBaseConfig);\n        assertEquals(knowledgeBaseConfig, knowledgeBaseDetail.getConfig());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseListRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class KnowledgeBaseListRequestTest {\n\n    private KnowledgeBaseListRequest knowledgeBaseListRequest;\n\n    @Before\n    public void setUp() {\n        // 初始化 KnowledgeBaseListRequest 对象\n        knowledgeBaseListRequest = new KnowledgeBaseListRequest(\"marker123\", 20, \"searchKeyword\");\n    }\n\n    @Test\n    public void testGetMarker() {\n        assertEquals(\"marker123\", knowledgeBaseListRequest.getMarker());\n    }\n\n    @Test\n    public void testGetMaxKeys() {\n        assertEquals(20, knowledgeBaseListRequest.getMaxKeys());\n    }\n\n    @Test\n    public void testGetKeyword() {\n        assertEquals(\"searchKeyword\", knowledgeBaseListRequest.getKeyword());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseListResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class KnowledgeBaseListResponseTest {\n    private KnowledgeBaseListResponse knowledgeBaseListResponse;\n    private KnowledgeBaseDetail knowledgeBaseDetail1;\n    private KnowledgeBaseDetail knowledgeBaseDetail2;\n\n    @Before\n    public void setUp() {\n        knowledgeBaseListResponse = new KnowledgeBaseListResponse();\n        \n        // Initialize KnowledgeBaseDetail objects (assuming KnowledgeBaseDetail has default constructor and setters)\n        knowledgeBaseDetail1 = new KnowledgeBaseDetail();\n        knowledgeBaseDetail1.setId(\"kb1\");\n        knowledgeBaseDetail1.setName(\"KnowledgeBase 1\");\n\n        knowledgeBaseDetail2 = new KnowledgeBaseDetail();\n        knowledgeBaseDetail2.setId(\"kb2\");\n        knowledgeBaseDetail2.setName(\"KnowledgeBase 2\");\n\n        knowledgeBaseListResponse.setRequestId(\"testRequestId\");\n        knowledgeBaseListResponse.setData(new KnowledgeBaseDetail[]{knowledgeBaseDetail1, knowledgeBaseDetail2});\n        knowledgeBaseListResponse.setMarker(\"testMarker\");\n        knowledgeBaseListResponse.setTruncated(true);\n        knowledgeBaseListResponse.setNextMarker(\"testNextMarker\");\n        knowledgeBaseListResponse.setMaxKeys(100);\n    }\n\n    @Test\n    public void testRequestId() {\n        assertEquals(\"testRequestId\", knowledgeBaseListResponse.getRequestId());\n    }\n\n    @Test\n    public void testData() {\n        KnowledgeBaseDetail[] data = knowledgeBaseListResponse.getData();\n        assertNotNull(data);\n        assertEquals(2, data.length);\n        assertEquals(\"kb1\", data[0].getId());\n        assertEquals(\"KnowledgeBase 1\", data[0].getName());\n        assertEquals(\"kb2\", data[1].getId());\n        assertEquals(\"KnowledgeBase 2\", data[1].getName());\n    }\n\n    @Test\n    public void testMarker() {\n        assertEquals(\"testMarker\", knowledgeBaseListResponse.getMarker());\n    }\n\n    @Test\n    public void testIsTruncated() {\n        assertTrue(knowledgeBaseListResponse.isTruncated());\n    }\n\n    @Test\n    public void testNextMarker() {\n        assertEquals(\"testNextMarker\", knowledgeBaseListResponse.getNextMarker());\n    }\n\n    @Test\n    public void testMaxKeys() {\n        assertEquals(100, knowledgeBaseListResponse.getMaxKeys());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/knowledgebase/KnowledgeBaseModifyRequestTest.java",
    "content": "package com.baidubce.appbuilder.model.knowledgebase;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class KnowledgeBaseModifyRequestTest {\n\n    private KnowledgeBaseModifyRequest knowledgeBaseModifyRequest;\n\n    @Before\n    public void setUp() {\n        knowledgeBaseModifyRequest = new KnowledgeBaseModifyRequest();\n    }\n\n    @Test\n    public void testSetGetKnowledgeBaseId() {\n        knowledgeBaseModifyRequest.setKnowledgeBaseId(\"kb123\");\n        assertEquals(\"kb123\", knowledgeBaseModifyRequest.getKnowledgeBaseId());\n    }\n\n    @Test\n    public void testSetGetName() {\n        knowledgeBaseModifyRequest.setName(\"New Knowledge Base\");\n        assertEquals(\"New Knowledge Base\", knowledgeBaseModifyRequest.getName());\n    }\n\n    @Test\n    public void testSetGetDescription() {\n        knowledgeBaseModifyRequest.setDescription(\"This is a description for the knowledge base.\");\n        assertEquals(\"This is a description for the knowledge base.\", knowledgeBaseModifyRequest.getDescription());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/rag/EventContentTest.java",
    "content": "package com.baidubce.appbuilder.model.rag;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport static org.junit.Assert.*;\n\npublic class EventContentTest {\n\n    private EventContent eventContent;\n\n    @Before\n    public void setUp() {\n        eventContent = new EventContent();\n    }\n\n    @Test\n    public void testGetSetEventCode() {\n        eventContent.setEventCode(\"eventCode123\");\n        assertEquals(\"eventCode123\", eventContent.getEventCode());\n    }\n\n    @Test\n    public void testGetSetEnentMessage() {\n        eventContent.setEnentMessage(\"message123\");\n        assertEquals(\"message123\", eventContent.getEnentMessage());\n    }\n\n    @Test\n    public void testGetSetNodeName() {\n        eventContent.setNodeName(\"nodeName123\");\n        assertEquals(\"nodeName123\", eventContent.getNodeName());\n    }\n\n    @Test\n    public void testGetSetDependencyNodes() {\n        String[] dependencyNodes = new String[]{\"node1\", \"node2\"};\n        eventContent.setDependencyNodes(dependencyNodes);\n        assertArrayEquals(dependencyNodes, eventContent.getDependencyNodes());\n    }\n\n    @Test\n    public void testGetSetEventType() {\n        eventContent.setEventType(\"eventType123\");\n        assertEquals(\"eventType123\", eventContent.getEventType());\n    }\n\n    @Test\n    public void testGetSetEventId() {\n        eventContent.setEventId(\"eventId123\");\n        assertEquals(\"eventId123\", eventContent.getEventId());\n    }\n\n    @Test\n    public void testGetSetEventStatus() {\n        eventContent.setEventStatus(\"eventStatus123\");\n        assertEquals(\"eventStatus123\", eventContent.getEventStatus());\n    }\n\n    @Test\n    public void testGetSetContentType() {\n        eventContent.setContentType(\"contentType123\");\n        assertEquals(\"contentType123\", eventContent.getContentType());\n    }\n\n    @Test\n    public void testGetSetOutputs() {\n        Map<String, Object> outputs = new HashMap<>();\n        outputs.put(\"outputKey\", \"outputValue\");\n        eventContent.setOutputs(outputs);\n        assertEquals(outputs, eventContent.getOutputs());\n    }\n\n    @Test\n    public void testGetSetDetail() {\n        HashMap<String, String> detail = new HashMap<>();\n        detail.put(\"key1\", \"value1\");\n        eventContent.setDetail(detail);\n        assertEquals(detail, eventContent.getDetail());\n    }\n\n    @Test\n    public void testToString() {\n        eventContent.setEventCode(\"eventCode123\");\n        eventContent.setEnentMessage(\"message123\");\n        eventContent.setNodeName(\"nodeName123\");\n        eventContent.setDependencyNodes(new String[]{\"node1\", \"node2\"});\n        eventContent.setEventType(\"eventType123\");\n        eventContent.setEventId(\"eventId123\");\n        eventContent.setEventStatus(\"eventStatus123\");\n        eventContent.setContentType(\"contentType123\");\n\n        String expected = \"EventContent{eventCode='eventCode123', enentMessage='message123', nodeName='nodeName123', dependencyNodes=[node1, node2], eventType='eventType123', eventId='eventId123', eventStatus='eventStatus123', contentType='contentType123', outputs=null, detail=null}\";\n        assertEquals(expected, eventContent.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/rag/RAGResponseTest.java",
    "content": "package com.baidubce.appbuilder.model.rag;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class RAGResponseTest {\n\n    private RAGResponse ragResponse;\n\n    @Before\n    public void setUp() {\n        ragResponse = new RAGResponse();\n    }\n\n    @Test\n    public void testSetGetCode() {\n        ragResponse.setCode(200);\n        assertEquals(200, ragResponse.getCode());\n    }\n\n    @Test\n    public void testSetGetMessage() {\n        ragResponse.setMessage(\"Success\");\n        assertEquals(\"Success\", ragResponse.getMessage());\n    }\n\n    @Test\n    public void testSetGetTraceId() {\n        ragResponse.setTraceId(\"trace12345\");\n        assertEquals(\"trace12345\", ragResponse.getTraceId());\n    }\n\n    @Test\n    public void testSetGetTime() {\n        ragResponse.setTime(123456789);\n        assertEquals(123456789L, ragResponse.getTime());\n    }\n\n    @Test\n    public void testSetGetResult() {\n        RAGResult mockResult = new RAGResult(); // 假设有 RAGResult 类\n        ragResponse.setResult(mockResult);\n        assertEquals(mockResult, ragResponse.getResult());\n    }\n\n    @Test\n    public void testToString() {\n        ragResponse.setCode(200);\n        ragResponse.setMessage(\"Success\");\n        ragResponse.setTraceId(\"trace12345\");\n        ragResponse.setTime(123456789);\n        RAGResult mockResult = new RAGResult(); // 假设有 RAGResult 类\n        ragResponse.setResult(mockResult);\n\n        String expected = \"RAGResponse{\" +\n                \"code=200\" +\n                \", message='Success'\" +\n                \", traceId='trace12345'\" +\n                \", time=123456789\" +\n                \", result=\" + mockResult +\n                '}';\n\n        assertEquals(expected, ragResponse.toString());\n    }\n}"
  },
  {
    "path": "java/src/test/java/com/baidubce/appbuilder/model/rag/RAGResultTest.java",
    "content": "package com.baidubce.appbuilder.model.rag;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.util.Arrays;  // 导入 java.util.Arrays\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertArrayEquals;\n\npublic class RAGResultTest {\n\n    private RAGResult ragResult;\n\n    @Before\n    public void setUp() {\n        ragResult = new RAGResult();\n    }\n\n    @Test\n    public void testSetGetAnswer() {\n        ragResult.setAnswer(\"This is an answer.\");\n        assertEquals(\"This is an answer.\", ragResult.getAnswer());\n    }\n\n    @Test\n    public void testSetGetConversationId() {\n        ragResult.setConversationId(\"conv123\");\n        assertEquals(\"conv123\", ragResult.getConversationId());\n    }\n\n    @Test\n    public void testSetGetMessageId() {\n        ragResult.setMessageId(\"msg456\");\n        assertEquals(\"msg456\", ragResult.getMessageId());\n    }\n\n    @Test\n    public void testSetGetIsCompletion() {\n        ragResult.setIsCompletion(true);  // 可以是任意对象，通常是Boolean\n        assertEquals(true, ragResult.getIsCompletion());\n    }\n\n    @Test\n    public void testSetGetPrototype() {\n        ragResult.setPrototype(\"prototype data\");\n        assertEquals(\"prototype data\", ragResult.getPrototype());\n    }\n\n    @Test\n    public void testSetGetContent() {\n        EventContent[] mockContent = new EventContent[2];\n        mockContent[0] = new EventContent();\n        mockContent[0].setEventCode(\"event1\");\n        mockContent[1] = new EventContent();\n        mockContent[1].setEventCode(\"event2\");\n\n        ragResult.setContent(mockContent);\n        assertArrayEquals(mockContent, ragResult.getContent());\n    }\n\n    @Test\n    public void testToString() {\n        ragResult.setAnswer(\"This is an answer.\");\n        ragResult.setConversationId(\"conv123\");\n        ragResult.setMessageId(\"msg456\");\n        ragResult.setIsCompletion(true);\n        ragResult.setPrototype(\"prototype data\");\n\n        EventContent[] mockContent = new EventContent[2];\n        mockContent[0] = new EventContent();\n        mockContent[0].setEventCode(\"event1\");\n        mockContent[1] = new EventContent();\n        mockContent[1].setEventCode(\"event2\");\n        ragResult.setContent(mockContent);\n\n        String expected = \"RAGResult{\" +\n                \"answer='This is an answer.'\" +\n                \", conversationId='conv123'\" +\n                \", messageId='msg456'\" +\n                \", isCompletion=true\" +\n                \", prototype='prototype data'\" +\n                \", content=\" + Arrays.toString(mockContent) +\n                '}';\n\n        assertEquals(expected, ragResult.toString());\n    }\n}"
  },
  {
    "path": "mkdocs.yml",
    "content": "site_name: Appbuilder-SDK\n\n# 网站页面结构和导航配置\nnav:\n  - 首页: README.md\n  - 快速上手: \n    - 开始你的第一个AI原生应用: \n      - 安装: QuickStart/StartFirstAINativeApplication/install.md\n      - 快速开始: QuickStart/StartFirstAINativeApplication/README.md\n    - 产业实践应用范例: \n      - SDK使用示例: QuickStart/ExamplesOfIndustrialPracticeApplications/README.md\n    - SDK当前支持的编程语言: QuickStart/CurrentlySupportedProgrammingLanguages/README.md\n  - 基础:\n    - 模型:\n      - 获取模型列表: BasisModule/Model/get_model_list.md\n    - 组件:\n      - 语义匹配（Matching）: BasisModule/Components/matching/README.md\n      - 表格文字识别 (TableOCR): BasisModule/Components/table_ocr/README.md\n      - 文件生成PPT（PPTGenerationFromFile）: BasisModule/Components/ppt_generation_from_file/README.md\n      - GBI 选表: BasisModule/Components/gbi/select_table/README.md\n      - GBI 问表: BasisModule/Components/gbi/nl2sql/README.md\n      - 向量计算（Embedding）: BasisModule/Components/embeddings/README.md\n      - 论文生成PPT（PPTGenerationFromPaper）: BasisModule/Components/ppt_generation_from_paper/README.md\n      - 地标识别（LandmarkRecognition）: BasisModule/Components/landmark_recognize/README.md\n      - 手写文字识别 （HandwriteOCR）: BasisModule/Components/handwrite_ocr/README.md\n      - 通用文字识别-高精度版（GeneralOCR）: BasisModule/Components/general_ocr/README.md\n      - 文本翻译-通用版（Translation）: BasisModule/Components/translate/README.md\n      - 百度搜索RAG（deprecate）: BasisModule/Components/rag_with_baidu_search/README.md\n      - 文档切分（DocSplitter）: BasisModule/Components/doc_splitter/README.md\n      - 表格抽取组件（ExtractTableFromDoc）: BasisModule/Components/extract_table/README.md\n      - 向量检索: BasisModule/Components/retriever/README.md\n      - 文本精排（Reranker）: BasisModule/Components/retriever/reranker/README.md\n      - 向量检索-VectorDB（BaiduVectorDBRetriever）: BasisModule/Components/retriever/baidu_vdb/README.md\n      - 向量检索-BES（BaiduElasticSearchRetriever）: BasisModule/Components/retriever/bes/README.md\n      - 通用物体和场景识别-高级版（ObjectRecognition）: BasisModule/Components/object_recognize/README.md\n      - 文档解析（DocParser）: BasisModule/Components/doc_parser/README.md\n      - 文档格式转换 (DocFormatConverter): BasisModule/Components/doc_format_converter/README.md\n      - 身份证混贴识别（MixCardOCR）: BasisModule/Components/mix_card_ocr/README.md\n      - 短语音识别-极速版 (Automatic Speech Recognition): BasisModule/Components/asr/README.md\n      - 文生图 (Text2Image): BasisModule/Components/text_to_image/README.md\n      - 长文档内容理解（DocumentUnderstanding）: BasisModule/Components/document_understanding/README.md\n      - 短文本在线合成（TTS）: BasisModule/Components/tts/README.md\n      - 植物识别（PlantRecognition）: BasisModule/Components/plant_recognize/README.md\n      - 树图 (TreeMind): BasisModule/Components/tree_mind/README.md\n      - 菜品识别（DishRecognition）: BasisModule/Components/dish_recognize/README.md\n      - 指令生成PPT（PPTGenerationFromInstruction）: BasisModule/Components/ppt_generation_from_instruction/README.md\n      - 动物识别 (AnimalRecognition): BasisModule/Components/animal_recognize/README.md\n      - 百度搜索RAG_PRO: BasisModule/Components/rag_with_baidu_search_pro/README.md\n      - 二维码识别 (QRcodeOCR): BasisModule/Components/qrcode_ocr/README.md\n      - 复杂Query判定（IsComplexQuery）: BasisModule/Components/llms/is_complex_query/README.md\n      - 空应用（Playground）: BasisModule/Components/llms/playground/README.md\n      - 口语化Query生成（Oral Query Generation）: BasisModule/Components/llms/oral_query_generation/README.md\n      - 阅读理解问答（MRC）: BasisModule/Components/llms/mrc/README.md\n      - 多轮改写 (QueryRewrite): BasisModule/Components/llms/query_rewrite/README.md\n      - 风格写作（StyleWriting）: BasisModule/Components/llms/style_writing/README.md\n      - 复杂Query分解（QueryDecomposition）: BasisModule/Components/llms/query_decomposition/README.md\n      - 会话小结（DialogSummary）: BasisModule/Components/llms/dialog_summary/README.md\n      - 幻觉检测（Hallucination Detection）: BasisModule/Components/llms/hallucination_detection/README.md\n      - 相似问生成（SimilarQuestion）: BasisModule/Components/llms/similar_question/README.md\n      - 标签抽取（TagExtraction）: BasisModule/Components/llms/tag_extraction/README.md\n      - 问答对挖掘（QAPairMining）: BasisModule/Components/llms/qa_pair_mining/README.md\n      - 风格转写 (StyleRewrite): BasisModule/Components/llms/style_rewrite/README.md\n      - 自然语言转pandas (nl2pandas): BasisModule/Components/llms/nl2pandas/README.md\n      - 文档矫正增强 (DocCropEnhance): BasisModule/Components/doc_crop_enhance/README.md\n      - 图像内容理解 （ImageUnderstand）: BasisModule/Components/image_understand/README.md\n    - 监控:\n      - TRACE基础功能: BasisModule/Trace/basic.md\n      - TRACE拓展功能: BasisModule/Trace/phoenix_method.md\n      - Debug功能: BasisModule/Trace/Debug.md\n    - 部署:\n      - 交互式前端部署: BasisModule/Deployment/AgentChainlit.md\n      - 公有云部署: BasisModule/Deployment/cloud.md\n      - API 访问: BasisModule/Deployment/flask.md\n      - AgentRuntime: BasisModule/Deployment/agentruntime.md\n      - UserSession: BasisModule/Deployment/usersession.md\n    - 平台:\n      - 应用:\n        - AppBuilderClient组件: BasisModule/Platform/Application/appbuilder_client.md\n        - 获取AppBuilder已发布的应用列表: BasisModule/Platform/Application/get_app_list.md\n      - 知识库:\n        - 知识库组件: BasisModule/Platform/KnowledgeBase/knowledgebase.md\n      - 自定义组件:\n        - 基础能力组件: BasisModule/Platform/CustomComponents/components.md\n  - 应用:\n    - Agent:\n      - 基础知识: Application/Agent/BasicKnowledge/agent.md\n      - 使用官方组件: Application/Agent/UseOfficialComponents/use_official_components.md\n      - ToolCall: Application/Agent/ToolCall/tool_call.md\n      - ToolChoice: Application/Agent/ToolChoice/tool_choice.md\n    #   - 使用异步和流式加速客户端调用: \n    - RAG:\n      - 基础知识: Application/RAG/BasicKnowledge/rag.md\n      - 知识库管理: Application/RAG/DatasetManage/dataset_manage.md\n      # - Reference信息处理: \n    # - Workflow:\n    #   - 基础知识: \n    #   - 从零使用Workflow组装一个RAG应用: \n    #   - 从零使用Workflow组装一个Agent应用: \n  - 开发者指南:\n    - 如何贡献代码: DevelopGuide/HowToContributeCode/README.md\n    - 二次开发: DevelopGuide/AdvancedDevelopment/README.md\n    - 版本升级日志: DevelopGuide/ChangeLog/changelog.md\n    - 错误信息: DevelopGuide/ErrorMessage/error_message.md\n    - 环境参数: DevelopGuide/EnvironmentalParameters/env.md\n  - API Reference:\n    - Python API Reference: API-Reference/Python/PythonAPI.md\n    - Java API Reference: API-Reference/Java/JavaAPI.md\n    # - Go API Reference: \n\n# 主题设置\ntheme:\n  name: material\n\n# 插件列表\nplugins:\n  - search\n\n# 其他配置\nmarkdown_extensions:\n  - codehilite\n  - toc:\n      permalink: true"
  },
  {
    "path": "python/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n__version__ = '1.1.5'\n\nimport os\nimport sys\nimport copy\nimport pydantic\n\n\nclass PythonVersionChecker:\n    def __init__(self):\n        self.min_version = (3, 9)\n        self.current_version = sys.version_info\n        self.check_version()\n\n    def check_version(self):\n        if self.current_version < self.min_version:\n            raise EnvironmentError(\n                f\"Mismatched Python version. Expected Python version >= {self.min_version[0]}.{self.min_version[1]}, \"\n                f\"Got Python version {self.current_version[0]}.{self.current_version[1]}.\")\n\n\n# Creating an instance to test the function\nchecker = PythonVersionChecker()\nchecker.current_version\n\n\nclass SDKReportConfig(pydantic.BaseModel):\n    appbuilder_sdk_version: str = __version__\n    appbuilder_sdk_language: str = \"python\"\n    appbuilder_sdk_platform: str = os.environ.get(\"APPBUILDER_SDK_PLATFORM\", \"unknown\")\n    appbuilder_sdk_mcp_context: str = None\n\n\ndef get_default_header(mcp_context: str = None):\n    if not mcp_context:\n        mcp_context = os.environ.get(\n                \"APPBUILDER_SDK_MCP_CONTEXT\", None\n            )\n    if mcp_context:\n        sdk_report_config = SDKReportConfig(appbuilder_sdk_mcp_context=mcp_context)\n    else:\n        sdk_report_config = SDKReportConfig()\n    default_header = {\n        \"X-Appbuilder-Sdk-Config\": sdk_report_config.model_dump_json(exclude_none=True),\n        \"X-Appbuilder-Origin\": \"appbuilder_sdk\",\n    }\n    return copy.deepcopy(default_header)\n\n\nfrom .core import *\nfrom .core.components.rag_with_baidu_search_pro import RagWithBaiduSearchPro\nfrom .core.components.rag_with_baidu_search import RAGWithBaiduSearch\nfrom .core import console\nfrom .core.components.llms.mrc import MRC\nfrom .core.components.llms.oral_query_generation import OralQueryGeneration\nfrom .core.components.llms.qa_pair_mining import QAPairMining\nfrom .core.components.llms.similar_question import SimilarQuestion\nfrom .core.components.llms.style_writing import StyleWriting\nfrom .core.components.llms.style_rewrite import StyleRewrite\nfrom .core.components.llms.tag_extraction import TagExtraction\nfrom .core.components.llms.nl2pandas import Nl2pandasComponent\nfrom .core.components.llms.query_rewrite import QueryRewrite\nfrom .core.components.llms.dialog_summary import DialogSummary\nfrom .core.components.llms.is_complex_query import IsComplexQuery\nfrom .core.components.llms.query_decomposition import QueryDecomposition\nfrom .core.components.llms.hallucination_detection import HallucinationDetection\nfrom .core.components.llms.playground import Playground\n\nfrom .core.components.asr.component import ASR\nfrom .core.components.general_ocr.component import GeneralOCR\nfrom .core.components.object_recognize.component import ObjectRecognition\nfrom .core.components.text_to_image.component import Text2Image\nfrom .core.components.landmark_recognize.component import LandmarkRecognition\nfrom .core.components.tts.component import TTS\nfrom .core.components.extract_table.component import ExtractTableFromDoc\nfrom .core.components.doc_parser.component import DocParser, ParserConfig\nfrom .core.components.doc_splitter.component import DocSplitter\nfrom .core.components.retriever.bes.component import BESRetriever\nfrom .core.components.retriever.bes.component import BESVectorStoreIndex\nfrom .core.components.retriever.baidu_vdb.component import BaiduVDBVectorStoreIndex\nfrom .core.components.retriever.baidu_vdb.component import BaiduVDBRetriever\nfrom .core.components.retriever.baidu_vdb.component import TableParams\nfrom .core.components.retriever.reranker.component import Reranker\nfrom .core.components.ppt_generation_from_instruction.component import PPTGenerationFromInstruction\nfrom .core.components.ppt_generation_from_paper.component import PPTGenerationFromPaper\nfrom .core.components.ppt_generation_from_file.component import PPTGenerationFromFile\n\nfrom .core.components.dish_recognize.component import DishRecognition\nfrom .core.components.translate.component import Translation\nfrom .core.components.animal_recognize.component import AnimalRecognition\nfrom .core.components.doc_crop_enhance.component import DocCropEnhance\nfrom .core.components.qrcode_ocr.component import QRcodeOCR\nfrom .core.components.table_ocr.component import TableOCR\nfrom .core.components.doc_format_converter.component import DocFormatConverter\n\nfrom .core.components.embeddings import Embedding\nfrom .core.components.matching import Matching\n\nfrom .core.components.gbi.nl2sql.component import NL2Sql\nfrom .core.components.gbi.select_table.component import SelectTable\n\nfrom .core.components.plant_recognize.component import PlantRecognition\nfrom .core.components.handwrite_ocr.component import HandwriteOCR\nfrom .core.components.image_understand.component import ImageUnderstand\nfrom .core.components.mix_card_ocr.component import MixCardOCR\nfrom .core.components.document_understanding.component import DocumentUnderstanding\nfrom .core.components.tree_mind.component import TreeMind\n__COMPONENTS__ = [\n    \"RagWithBaiduSearchPro\",\n    \"RAGWithBaiduSearch\",\n    \"MRC\",\n    \"OralQueryGeneration\",\n    \"QAPairMining\",\n    \"SimilarQuestion\",\n    \"StyleWriting\",\n    \"StyleRewrite\",\n    \"TagExtraction\",\n    \"Nl2pandasComponent\",\n    \"QueryRewrite\",\n    \"DialogSummary\",\n    \"HallucinationDetection\",\n    \"Playground\",\n    \"ASR\",\n    \"GeneralOCR\",\n    \"ObjectRecognition\",\n    \"Text2Image\",\n    \"LandmarkRecognition\",\n    \"TTS\",\n    \"ExtractTableFromDoc\",\n    \"DocParser\",\n    \"DocSplitter\",\n    \"BESRetriever\",\n    \"BESVectorStoreIndex\",\n    \"BaiduVDBVectorStoreIndex\",\n    \"BaiduVDBRetriever\",\n    \"TableParams\",\n    \"Reranker\",\n    \"PPTGenerationFromInstruction\",\n    \"PPTGenerationFromPaper\",\n    \"PPTGenerationFromFile\",\n    \"DishRecognition\",\n    \"Translation\",\n    \"AnimalRecognition\",\n    \"DocCropEnhance\",\n    \"QRcodeOCR\",\n    \"TableOCR\",\n    \"DocFormatConverter\",\n    \"Embedding\",\n    \"Matching\",\n    \"NL2Sql\",\n    \"SelectTable\",\n    \"PlantRecognition\",\n    \"HandwriteOCR\",\n    \"ImageUnderstand\",\n    \"MixCardOCR\",\n    \"DocumentUnderstanding\",\n    \"TreeMind\"\n] # NOQA\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.agent import AgentRuntime\nfrom appbuilder.core.user_session import UserSession\n\nfrom appbuilder.utils.logger_util import logger\n\nfrom appbuilder.core.manifest.manifest_decorator import manifest, manifest_parameter\nfrom appbuilder.core.manifest.models import Manifest\n\nfrom appbuilder.core.utils import get_model_list\n\nfrom appbuilder.core.console.appbuilder_client.appbuilder_client import AppBuilderClient\nfrom appbuilder.core.console.appbuilder_client.async_appbuilder_client import AsyncAppBuilderClient\nfrom appbuilder.core.console.ai_search import AISearch\nfrom appbuilder.core.console.appbuilder_client.appbuilder_client import AgentBuilder\nfrom appbuilder.core.console.appbuilder_client.appbuilder_client import get_app_list, get_all_apps, describe_apps, describe_app\nfrom appbuilder.core.console.component_client.component_client import ComponentClient\nfrom appbuilder.core.console.knowledge_base.knowledge_base import KnowledgeBase\nfrom appbuilder.core.console.knowledge_base.data_class import CustomProcessRule, DocumentSource, DocumentChoices, DocumentChunker, DocumentSeparator, DocumentPattern, DocumentProcessOption, DocumentSourceUrlConfig\n\nfrom .core._exception import (\n    BadRequestException,\n    ForbiddenException,\n    NotFoundException,\n    PreconditionFailedException,\n    InternalServerErrorException,\n    HTTPConnectionException,\n    AppBuilderServerException,\n    AppbuilderTraceException,\n)\n\nfrom appbuilder.core.assistant.base import assistant\nfrom appbuilder.core.assistant.threads.runs import StreamRunContext\nfrom appbuilder.core.assistant.threads.runs import AssistantEventHandler\nfrom appbuilder.core.assistant.threads.runs import AssistantStreamManager\n\nfrom appbuilder.utils.trace.tracer import AppBuilderTracer, AppbuilderInstrumentor\n\nfrom .utils.logger_file_headler import SizeAndTimeRotatingFileHandler\n\n__all__ = [\n    \"logger\",\n    \"SizeAndTimeRotatingFileHandler\",\n    \"BadRequestException\",\n    \"ForbiddenException\",\n    \"NotFoundException\",\n    \"PreconditionFailedException\",\n    \"InternalServerErrorException\",\n    \"HTTPConnectionException\",\n    \"AppBuilderServerException\",\n    \"AppbuilderTraceException\",\n    \"AppbuilderTestToolEval\",\n    \"AutomaticTestToolEval\",\n    \"get_model_list\",\n    \"AppBuilderClient\",\n    \"AsyncAppBuilderClient\",\n    \"AISearch\", \n    \"AgentBuilder\",\n    \"ComponentClient\",\n    \"get_app_list\",\n    \"get_all_apps\",\n    \"describe_apps\",\n    \"describe_app\",\n    \"KnowledgeBase\",\n    \"CustomProcessRule\",\n    \"DocumentSource\",\n    \"DocumentChoices\",\n    \"DocumentChunker\",\n    \"DocumentSeparator\",\n    \"DocumentPattern\",\n    \"DocumentProcessOption\",\n    \"DocumentSourceUrlConfig\" \"assistant\",\n    \"StreamRunContext\",\n    \"AssistantEventHandler\",\n    \"AssistantStreamManager\",\n    \"AppBuilderTracer\",\n    \"AppbuilderInstrumentor\",\n] + __COMPONENTS__\n"
  },
  {
    "path": "python/core/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/_client.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Base client for interact with backend server\"\"\"\n\nimport os\nimport uuid\nfrom typing import Optional\n\nimport requests\nfrom requests.adapters import HTTPAdapter, Retry\nfrom aiohttp import ClientResponse\n\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder import get_default_header\n\nfrom appbuilder.core._exception import *\nfrom appbuilder.core._session import InnerSession, AsyncInnerSession\nfrom appbuilder.core.constants import (\n    GATEWAY_URL,\n    GATEWAY_URL_V2,\n    CONSOLE_OPENAPI_VERSION,\n    CONSOLE_OPENAPI_PREFIX,\n    SECRET_KEY_PREFIX,\n)\nfrom appbuilder.utils.logger_util import logger\n\n\nclass HTTPClient:\n    r\"\"\"HTTPClient类,实现与后端服务交互的公共方法\"\"\"\n\n    def __init__(\n        self, secret_key: Optional[str] = None, gateway: str = \"\", gateway_v2: str = \"\"\n    ):\n        r\"\"\"HTTPClient初始化方法.\n\n        参数:\n            secret_key(str,可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway(str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            gateway_v2(str, 可选): 后端OpenAPI网关服务地址，当前仅AgentBuilder使用。默认从环境变量中获取: os.getenv(\"GATEWAY_URL_V2\", \"\")\n        返回：\n            无\n        \"\"\"\n        self._init_secret_key(secret_key)\n\n        # Component\n        self._init_gateway_url(gateway)\n\n        # Console OpenAPI\n        self._init_gateway_url_v2(gateway_v2)\n\n        self.session = InnerSession()\n        self.retry = Retry(total=0, backoff_factor=0.1)\n        self.session.mount(self.gateway, HTTPAdapter(max_retries=self.retry))\n\n    def _init_gateway_url(self, gateway: str):\n        if not gateway and not os.getenv(\"GATEWAY_URL\"):\n            self.gateway = GATEWAY_URL\n        else:\n            self.gateway = gateway if gateway else os.getenv(\"GATEWAY_URL\", \"\")\n        if not self.gateway.startswith(\"http\"):\n            self.gateway = \"https://\" + self.gateway\n\n    def _init_gateway_url_v2(self, gateway_v2: str):\n        if not gateway_v2 and not os.getenv(\"GATEWAY_URL_V2\"):\n            self.gateway_v2 = GATEWAY_URL_V2\n        else:\n            self.gateway_v2 = (\n                gateway_v2 if gateway_v2 else os.getenv(\"GATEWAY_URL_V2\", \"\")\n            )\n        if not self.gateway_v2.startswith(\"http\"):\n            self.gateway_v2 = \"https://\" + self.gateway_v2\n\n        self.console_openapi_verion = os.getenv(\n            \"CONSOLE_OPENAPI_VERSION\", CONSOLE_OPENAPI_VERSION\n        )\n        self.console_openapi_prefix = os.getenv(\n            \"CONSOLE_OPENAPI_PREFIX\", CONSOLE_OPENAPI_PREFIX\n        )\n\n    def _init_secret_key(self, secret_key: str):\n        self.secret_key = (\n            secret_key if secret_key else os.getenv(\"APPBUILDER_TOKEN\", \"\")\n        )\n        if not self.secret_key:\n            raise ValueError(\n                \"secret_key is empty, please pass a nonempty secret_key \"\n                'or set a secret_key in environment variable \"APPBUILDER_TOKEN\"'\n            )\n        secret_key_prefix = os.getenv(\"SECRET_KEY_PREFIX\", SECRET_KEY_PREFIX)\n\n        if not self.secret_key.startswith(secret_key_prefix):\n            self.secret_key = \"{} {}\".format(\n                secret_key_prefix, self.secret_key)\n\n        logger.debug(\"AppBuilder Secret key: {}\\n\".format(self.secret_key))\n\n    @staticmethod\n    def check_response_header(response: requests.Response):\n        r\"\"\"check_response_header is a helper method for check head status .\n        :param response: requests.Response.\n        :rtype:\n        \"\"\"\n        status_code = response.status_code\n        if status_code == requests.codes.ok:\n            response_headers = \"\\n\\t\".join([f\"{key} : {value}\" for key, value in response.headers.items()])\n            message = \"\\nrequest_id : {} \\nhttp status : {}\\nresponse headers : \\n\\t{}\".format(\n                __class__.response_request_id(response), status_code, response_headers\n            )\n            logger.debug(message)\n            return\n        message = \"request_id={} , http status code is {}, body is {}\".format(\n            __class__.response_request_id(response), status_code, response.text\n        )\n        if status_code == requests.codes.bad_request:\n            logger.error(message)\n            raise BadRequestException(message)\n        elif status_code == requests.codes.unauthorized:\n            logger.error(message)\n            raise UnAuthorizedException(message)\n        elif status_code == requests.codes.forbidden:\n            logger.error(message)\n            raise ForbiddenException(message)\n        elif status_code == requests.codes.not_found:\n            logger.error(message)\n            raise NotFoundException(message)\n        elif status_code == requests.codes.method_not_allowed:\n            logger.error(message)\n            raise MethodNotAllowedException(message)\n        elif status_code == requests.codes.conflict:\n            logger.error(message)\n            raise ConflictException(message)\n        elif status_code == requests.codes.length_required:\n            logger.error(message)\n            raise MissingContentLengthException(message)\n        elif status_code == requests.codes.precondition_required:\n            logger.error(message)\n            raise PreconditionFailedException(message)\n        elif status_code == requests.codes.unprocessable_entity:\n            logger.error(message)\n            raise UnprocessableEntityException(message)\n        elif status_code == requests.codes.failed_dependency:\n            logger.error(message)\n            raise DependencyFailedException(message)\n        elif status_code == requests.codes.too_many_requests:\n            logger.error(message)\n            raise TooManyRequestsException(message)\n        elif status_code == requests.codes.internal_server_error:\n            logger.error(message)\n            raise InternalServerErrorException(message)\n        elif status_code == requests.codes.insufficient_storage:\n            logger.error(message)\n            raise InsufficientStorageException(message)\n        else:\n            logger.error(message)\n            raise BaseRPCException(message)\n\n    def service_url(self, sub_path: str, prefix: str = None):\n        r\"\"\"service_url is a helper method for concatenate service url.\n        :param sub_path: service unique sub path.\n        :param prefix: service prefix.\n        :rtype: str.\n        \"\"\"\n        # host + fix prefix + sub service path\n        prefix = prefix if prefix else \"/rpc/2.0/cloud_hub\"\n        final_url = self.gateway + prefix + sub_path\n        logger.debug(\"Service url: {}\\n\".format(final_url))\n        return final_url\n\n    def service_url_v2(self, sub_path: str, client_token: str = None):\n        r\"\"\"service_url is a helper method for concatenate service url for OpenAPI, only used by AppBuilderClient.\n        :param sub_path: service unique sub path.\n        :rtype: str.\n        \"\"\"\n        # console_prefix =\n        final_url = (\n            self.gateway_v2\n            + self.console_openapi_prefix\n            + self.console_openapi_verion\n            + sub_path\n        )\n        if client_token:\n            if \"?\" in final_url:\n                final_url += \"&clientToken=\" + client_token\n            else:\n                final_url += \"?clientToken=\" + client_token\n        logger.debug(\"Service url: {}\\n\".format(final_url))\n        return final_url\n\n    @staticmethod\n    def check_response_json(data: dict):\n        r\"\"\"check_response_json is a helper method for check backend server response.\n        :param: dict, body response data.\n        :rtype: str.\n        \"\"\"\n        if \"code\" in data and \"message\" in data and \"requestId\" in data:\n            raise AppBuilderServerException(\n                data[\"requestId\"], data[\"code\"], data[\"message\"]\n            )\n\n    @staticmethod\n    def check_console_response(response: requests.Response):\n        r\"\"\"check_console_response is a helper method for console check backend server response.\n        :param: dict, body response data.\n        :rtype: str.\n        \"\"\"\n        data = response.json()\n        if \"code\" in data and data.get(\"code\") != 0:\n            requestId = __class__.response_request_id(response)\n            raise AppBuilderServerException(\n                requestId, data[\"code\"], data[\"message\"])\n\n    def auth_header(self, request_id: Optional[str] = None):\n        r\"\"\"auth_header is a helper method return auth info\"\"\"\n        auth_header = get_default_header()\n        new_request_id = str(uuid.uuid4())\n        auth_header[\"X-Appbuilder-Request-Id\"] = (\n            request_id if request_id else new_request_id\n        )\n        auth_header[\"X-Bce-Request-Id\"] = request_id if request_id else new_request_id\n        auth_header[\"X-Appbuilder-Authorization\"] = self.secret_key\n        logger.debug(\"Request header: {}\\n\".format(auth_header))\n        return auth_header\n\n    def auth_header_v2(self, request_id: Optional[str] = None, mcp_context = None):\n        r\"\"\"auth_header_v2 is a helper method return auth info for OpenAPI, only used by AppBuilderClient\"\"\"\n        auth_header = get_default_header(mcp_context)\n        new_request_id = str(uuid.uuid4())\n        auth_header[\"X-Appbuilder-Request-Id\"] = (\n            request_id if request_id else new_request_id\n        )\n        auth_header[\"X-Bce-Request-Id\"] = request_id if request_id else new_request_id\n        auth_header[\"Authorization\"] = self.secret_key\n        logger.debug(\"Request header: {}\\n\".format(auth_header))\n        return auth_header\n\n    @staticmethod\n    def response_request_id(response: requests.Response):\n        r\"\"\"response_request_id is a helper method get unique request id\"\"\"\n        return response.headers.get(\"X-Appbuilder-Request-Id\", \"\")\n\n    @staticmethod\n    def check_param(func):\n        def inner(*args, **kwargs):\n            retry = kwargs.get(\"retry\", 0)\n            if retry < 0 or not isinstance(retry, int):\n                raise InvalidRequestArgumentError(\n                    'Rqeuest argument \"retry\" format error. Expected retry >=0. Got {}'.format(\n                        retry\n                    )\n                )\n            timeout = kwargs.get(\"timeout\", None)\n            if timeout and not (\n                isinstance(timeout, float) or isinstance(timeout, tuple)\n            ):\n                raise InvalidRequestArgumentError(\n                    'Request argument \"timeout\" format error, Expected timeout be float or tuple of float'\n                )\n            return func(*args, **kwargs)\n\n        return inner\n\n    @staticmethod\n    def classify_exception(e):\n        \"\"\"classify exception type and raise\"\"\"\n        from requests.exceptions import HTTPError\n        \n        # 定义需要直接抛出的异常类型列表\n        custom_exceptions = (\n            AppBuilderServerException,\n            NoFileUploadedExecption,\n            InvalidRequestArgumentError,\n            RetryableExecption,\n            RiskInputException,\n            InternalServerException,\n            AssistantServerException\n        )\n        \n        if isinstance(e, HTTPError):\n            __class__.check_response_header(e.response)\n        elif isinstance(e, custom_exceptions):  # 检查异常是否属于自定义的类型\n            raise e\n        else: #未定义的错误使用InternalServerException兜底\n            raise InternalServerException(str(e))\n\n\nclass AsyncHTTPClient(HTTPClient):\n    def __init__(self, secret_key=None, gateway=\"\", gateway_v2=\"\"):\n        super().__init__(secret_key, gateway, gateway_v2)\n        self.session = AsyncInnerSession()\n\n    @staticmethod\n    async def check_response_header(response: ClientResponse):\n        r\"\"\"check_response_header is a helper method for check head status .\n        :param response: requests.Response.\n        :rtype:\n        \"\"\"\n        status_code = response.status\n        if status_code == requests.codes.ok:\n            return\n        message = \"request_id={} , http status code is {}, body is {}\".format(\n            await __class__.response_request_id(response), status_code, await response.text()\n        )\n        if status_code == requests.codes.bad_request:\n            logger.error(message)\n            raise BadRequestException(message)\n        elif status_code == requests.codes.unauthorized:\n            logger.error(message)\n            raise UnAuthorizedException(message)\n        elif status_code == requests.codes.forbidden:\n            logger.error(message)\n            raise ForbiddenException(message)\n        elif status_code == requests.codes.not_found:\n            logger.error(message)\n            raise NotFoundException(message)\n        elif status_code == requests.codes.method_not_allowed:\n            logger.error(message)\n            raise MethodNotAllowedException(message)\n        elif status_code == requests.codes.conflict:\n            logger.error(message)\n            raise ConflictException(message)\n        elif status_code == requests.codes.length_required:\n            logger.error(message)\n            raise MissingContentLengthException(message)\n        elif status_code == requests.codes.precondition_required:\n            logger.error(message)\n            raise PreconditionFailedException(message)\n        elif status_code == requests.codes.unprocessable_entity:\n            logger.error(message)\n            raise UnprocessableEntityException(message)\n        elif status_code == requests.codes.failed_dependency:\n            logger.error(message)\n            raise DependencyFailedException(message)\n        elif status_code == requests.codes.too_many_requests:\n            logger.error(message)\n            raise TooManyRequestsException(message)\n        elif status_code == requests.codes.internal_server_error:\n            logger.error(message)\n            raise InternalServerErrorException(message)\n        elif status_code == requests.codes.insufficient_storage:\n            logger.error(message)\n            raise InsufficientStorageException(message)\n        else:\n            logger.error(message)\n            raise BaseRPCException(message)\n\n    @staticmethod\n    async def response_request_id(response: ClientResponse):\n        r\"\"\"response_request_id is a helper method to get the unique request id\"\"\"\n        return response.headers.get(\"X-Appbuilder-Request-Id\", \"\")\n\n    @staticmethod\n    async def classify_exception(e):\n        \"\"\"classify exception type and raise\"\"\"\n        from requests.exceptions import HTTPError\n        # 定义需要直接抛出的异常类型列表\n        custom_exceptions = (\n            AppBuilderServerException,\n            NoFileUploadedExecption,\n            InvalidRequestArgumentError,\n            RetryableExecption,\n            RiskInputException,\n            InternalServerException,\n            AssistantServerException\n        )\n        \n        if isinstance(e, HTTPError):\n            await __class__.check_response_header(e.response)\n        elif isinstance(e, custom_exceptions):  # 检查异常是否属于自定义的类型\n            raise e\n        else: #未定义的错误使用InternalServerException兜底\n            raise InternalServerException(str(e))\n\nclass AssistantHTTPClient(HTTPClient):\n    def service_url(self, sub_path: str, prefix: str = None):\n        \"\"\"\n        根据给定的子路径和前缀，返回完整的服务URL。\n\n        Args:\n            sub_path (str): 子路径，例如 \"/api/v1/user\"。\n            prefix (str, optional): URL前缀，例如 \"http://example.com\"。默认为None。\n\n        Returns:\n            str: 完整的服务URL，例如 \"http://example.com/api/v1/user\"。\n        \"\"\"\n        prefix = prefix if prefix else \"\"\n        return self.gateway + prefix + sub_path\n\n    def auth_header(self, request_id: Optional[str] = None):\n        \"\"\"\n        返回一个包含认证信息的字典\n\n        Args:\n            无参数。\n        \"\"\"\n        r\"\"\"auth_header is a helper method return auth info\"\"\"\n        auth_header = get_default_header()\n        auth_header[\"Authorization\"] = self.secret_key\n        new_request_id = str(uuid.uuid4())\n        auth_header[\"X-Appbuilder-Request-Id\"] = (\n            request_id if request_id else new_request_id\n        )\n        auth_header[\"X-Bce-Request-Id\"] = request_id if request_id else new_request_id\n        auth_header[\"X-Appbuilder-Authorization\"] = self.secret_key\n        auth_header[\"Content-Type\"] = \"application/json\"\n        logger.debug(\"Request header: {}\\n\".format(auth_header))\n        return auth_header\n\n    @staticmethod\n    def check_assistant_response(request_id, data):\n        \"\"\"\n        检查助手的响应结果，如果返回了错误信息，则抛出 AssistantServerException 异常。\n\n        Args:\n            request_id (str): 请求 ID。\n            data (dict): 助手返回的响应数据。\n\n        Returns:\n            None\n\n        Raises:\n            AssistantServerException: 如果助手返回了错误信息，则抛出该异常。\n\n        \"\"\"\n        if \"error\" in data:\n            raise AssistantServerException(\n                request_id=request_id,\n                code=data[\"error\"][\"code\"],\n                message=data[\"error\"][\"message\"],\n                type=data[\"error\"][\"type\"],\n                params=(\n                    data[\"error\"][\"param\"]\n                    if \"param\" in data[\"error\"]\n                    else data[\"error\"][\"params\"]\n                ),\n            )"
  },
  {
    "path": "python/core/_exception.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"include HTTP and backend server exception.\n\"\"\"\n\n\nclass BaseRPCException(Exception):\n    r\"\"\"Base RPC exception.\n    \"\"\"\n    pass\n\n\nclass BadRequestException(BaseRPCException):\n    r\"\"\" BadRequestException represent HTTP Code 400.\n    \"\"\"\n    pass\n\n\nclass UnAuthorizedException(BaseRPCException):\n    r\"\"\"UnAuthorizedException represent HTTP Code 401.\n    \"\"\"\n    pass\n\n\nclass ForbiddenException(BaseRPCException):\n    r\"\"\"BadRequestException represent HTTP Code 403.\n    \"\"\"\n    pass\n\n\nclass NotFoundException(BaseRPCException):\n    r\"\"\"NotFoundException represent HTTP Code 404.\n    \"\"\"\n    pass\n\nclass MethodNotAllowedException(BaseRPCException):\n    r\"\"\"MethodNotAllowedException represent HTTP Code 405.\n    \"\"\"\n    pass\n\n\nclass ConflictException(BaseRPCException):\n    r\"\"\"ConflictException represent HTTP Code 409.\n    \"\"\"\n    pass\n\n\nclass MissingContentLengthException(BaseRPCException):\n    r\"\"\"MissingContentLengthException represent HTTP Code 411.\n    \"\"\"\n    pass\n\n\nclass PreconditionFailedException(BaseRPCException):\n    r\"\"\"PreconditionFailedException represent HTTP Code 412.\n    \"\"\"\n    pass\n\n\nclass UnprocessableEntityException(BaseRPCException):\n    r\"\"\"UnprocessableEntityException represent HTTP Code 422.\n    \"\"\"\n    pass\n\n\nclass DependencyFailedException(BaseRPCException):\n    r\"\"\"DependencyFailedException represent HTTP Code 424.\n    \"\"\"\n    pass\n\n\nclass TooManyRequestsException(BaseRPCException):\n    r\"\"\"TooManyRequestsException represent HTTP Code 429.\n    \"\"\"\n    pass\n\nclass InternalServerErrorException(BaseRPCException):\n    r\"\"\"InternalServerErrorException represent HTTP Code 500.\n    \"\"\"\n    pass\n\n\nclass InsufficientStorageException(BaseRPCException):\n    r\"\"\"TooManyRequestsException represent HTTP Code 507.\n    \"\"\"\n    pass\n\nclass HTTPConnectionException(BaseRPCException):\n    r\"\"\"HTTPConnectionException represent HTTP Connection error.\n    \"\"\"\n    pass\n\n\nclass ModelNotSupportedException(BaseRPCException):\n    r\"\"\"ModelNotSupportedException represent model is not supported\n    \"\"\"\n    pass\n\n\nclass TypeNotSupportedException(BaseRPCException):\n    r\"\"\"TypeNotSupportedException represent type is not supported\n    \"\"\"\n    pass\n\n\nclass AppBuilderServerException(BaseRPCException):\n    r\"\"\"AppBuilderServerException represent backend server failed response.\n    \"\"\"\n    description: str = \"Interal Server Error\"\n    code: int = 500\n\n    def __init__(self, request_id=\"\", code=\"\", message=\"\", service_err_code=\"\", service_err_message=\"\"):\n        self.description = \"request_id={}, code={}, message={}, service_err_code={}, service_err_message={} \".format(\n            request_id, code, message, service_err_code, service_err_message)\n        self.code = code if code else self.code\n\n    def __str__(self):\n        return self.description\n\nclass AssistantServerException(BaseRPCException):\n    r\"\"\"AssistantSercerException represent assistant server failed response.\n    \"\"\"\n    description: str = \"Interal Server Error\"\n    code: int = 500\n\n    def __init__(self, request_id= \"\", code=\"\", message=\"\", type=\"\", params=\"\"):\n        self.description = \"request_id={}, code={}, message={}, type={}, params={} \".format(\n            request_id, code, message, type, params)\n        self.code = code if code else self.code\n\n    def __str__(self):\n        return self.description\n\n\nclass InvalidRequestArgumentError(BaseRPCException):\n    r\"\"\"InvalidRequestArgumentError invalid request param\n    \"\"\"\n    description: str = \"Invalid Request Params Error\"\n    code: int = 400\n\n    def __init__(self, message=\"\", request_id= \"\", code=\"\"):\n        self.description = \"request_id={}, code={}, message={}\".format(\n            request_id, code, message)\n        self.code = code if code else self.code\n\n    def __str__(self):\n        return self.description\n\n\nclass RiskInputException(BaseRPCException):\n    r\"\"\"RiskInputException\n    \"\"\"\n    pass\n\n\nclass AppbuilderBuildexException(BaseRPCException):\n    r\"\"\"AppbuilderBuildxException\n    \"\"\"\n    pass\n\n\nclass AppbuilderTraceException(BaseRPCException):\n    r\"\"\"AppbuilderTraceException\n    \"\"\"\n    pass\n\nclass RetryableExecption(Exception):\n    r\"\"\"RetryableExecption\n    \"\"\"\n    pass\n\nclass InternalServerException(BaseRPCException):\n    r\"\"\"InternalServerException\n    \"\"\"\n    pass\n\nclass NoFileUploadedExecption(Exception):\n    r\"\"\"NoFileUploadedExecption\"\"\"\n    pass\n\n\nclass CustomError(Exception):\n    \"\"\"自定义错误类，包含错误码\"\"\"\n    \n    def __init__(self, code, message=\"\"):\n        \"\"\"\n        初始化自定义错误\n        \n        Args:\n            message (str): 错误消息\n            code (int/str): 错误码\n        \"\"\"\n        super().__init__(message)\n        self.code = code\n        self.message = message\n    \n    def __str__(self):\n        if self.code:\n            return f\"[{self.code}] {self.message}\"\n        return self.message"
  },
  {
    "path": "python/core/_session.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport requests\nimport json\nimport aiohttp\nfrom aiohttp import ClientSession, hdrs\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder.utils.trace.tracer_wrapper import session_post\n\n\nclass InnerSession(requests.sessions.Session):\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"\n        Initialize inner session.\n        \"\"\"\n        super(InnerSession, self).__init__(*args, **kwargs)\n\n    def build_curl(self, request: requests.PreparedRequest) -> str:\n        \"\"\"\n        Generate cURL command from prepared request object.\n        \"\"\"\n        curl = \"curl -X {0} -L '{1}' \\\\\\n\".format(request.method, request.url)\n\n        headers = [\n            \"-H '{0}: {1}' \\\\\".format(k, v)\n            for k, v in request.headers.items()\n            if k != \"Content-Length\"\n        ]\n\n        if headers:\n            headers[-1] = headers[-1].rstrip(\" \\\\\")\n        curl += \"\\n\".join(headers)\n        if request.body:\n            try:\n                body = json.loads(request.body)\n                body = \"'{0}'\".format(json.dumps(body, ensure_ascii=False))\n                curl += \" \\\\\\n-d {0}\".format(body)\n            except:\n                curl += \" \\\\\\n-d '{0}'\".format(request.body)\n        return curl\n\n    def send(self, request, **kwargs):\n        \"\"\"\n        Send request using inner session.\n        \"\"\"\n        logger.debug(\"Curl Command:\\n\" + self.build_curl(request) + \"\\n\")\n        return super(InnerSession, self).send(request, **kwargs)\n\n    @session_post\n    def post(self, url, data=None, json=None, **kwargs):\n        return super().post(url=url, data=data, json=json, **kwargs)\n\n    @session_post\n    def delete(self, url, **kwargs):\n        return super().delete(url=url, **kwargs)\n\n    @session_post\n    def get(self, url, **kwargs):\n        return super().get(url=url, **kwargs)\n\n    @session_post\n    def put(self, url, data=None, **kwargs):\n        return super().put(url=url, data=data, **kwargs)\n\n\nclass AsyncInnerSession(ClientSession):\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"\n        Initialize inner session.\n        \"\"\"\n        super(AsyncInnerSession, self).__init__(*args, **kwargs)\n\n    async def build_curl(self, method, url, data=None, json_data=None, **kwargs) -> str:\n        \"\"\"\n        Generate cURL command from prepared request object.\n        \"\"\"\n        curl = \"curl -X {0} -L '{1}' \\\\\\n\".format(method, url)\n\n        headers = kwargs.get(\"headers\", {})\n        headers_strs = [\n            \"-H '{0}: {1}' \\\\\".format(k, v) for k, v in headers.items()]\n        if headers_strs:\n            headers_strs[-1] = headers_strs[-1].rstrip(\" \\\\\")\n        curl += \"\\n\".join(headers_strs)\n\n        if data:\n            try:\n                body = \"'{0}'\".format(json.dumps(data, ensure_ascii=False))\n                curl += \" \\\\\\n-d {0}\".format(body)\n            except:\n                pass\n        elif json_data:\n            body = \"'{0}'\".format(json.dumps(json_data, ensure_ascii=False))\n            curl += \" \\\\\\n-d {0}\".format(body)\n\n        return curl\n\n    async def post(self, url, data=None, json=None, **kwargs):\n        logger.debug(\"Curl Command:\\n\" + await self.build_curl(hdrs.METH_POST, url, data=data, json_data=json, **kwargs) + \"\\n\")\n        return await super().post(url=url, data=data, json=json, **kwargs)\n\n    async def delete(self, url, **kwargs):\n        logger.debug(\"Curl Command:\\n\" + await self.build_curl(hdrs.METH_DELETE, url, **kwargs) + \"\\n\")\n        return await super().delete(url=url, **kwargs)\n\n    async def get(self, url, **kwargs):\n        logger.debug(\"Curl Command:\\n\" + await self.build_curl(hdrs.METH_GET, url, **kwargs) + \"\\n\")\n        return await super().get(url=url, **kwargs)\n\n    async def put(self, url, data=None, **kwargs):\n        logger.debug(\"Curl Command:\\n\" + await self.build_curl(hdrs.METH_PUT, url, data=data, **kwargs) + \"\\n\")\n        return await super().put(url=url, data=data, **kwargs)\n"
  },
  {
    "path": "python/core/agent.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport sys\nimport copy\nimport os\nimport logging\nimport uuid\nimport json\nimport shutil\nimport inspect\nfrom pydantic import BaseModel, model_validator, Extra\nfrom typing import Optional, Dict, Any, Union\nimport appbuilder\nfrom appbuilder.core.context import init_context\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder.core.console.appbuilder_client.data_class import ToolChoiceFunction, ToolChoice, Action\n\n# 流式场景首包超时时，最大重试次数\nMAX_RETRY_COUNT = 3\n\n\nclass AgentRuntime(BaseModel):\n    r\"\"\"\n    AgentRuntime 是对组件调用的服务化封装，开发者不是必须要用 AgentRuntime 才能运行自己的组件服务。\n    但 AgentRuntime 可以快速帮助开发者服务化组件服务，并且提供API、对话框等部署方式。\n    此外，结合 Component 和 Message 自带的运行和调试接口，可以方便开发者快速获得一个调试 Agent 的服务。\n\n    Args:\n        component (Component): 可运行的 Component, 需要实现 run(message, stream, args) 方法  \n        user_session_config (sqlalchemy.engine.URL|str|None): Session 输出存储配置字符串。默认使用 sqlite:///user_session.db\n            遵循 sqlalchemy 后端定义，参考文档：https://docs.sqlalchemy.org/en/20/core/engines.html#backend-specific-urls\n        tool_choice (ToolChoice): 可用于Agent强制执行的组件工具\n\n\n    Examples:\n\n        .. code-block:: python\n\n            import os\n            import sys\n            import appbuilder\n            os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n            component = appbuilder.Playground(\n                prompt_template=\"{query}\",\n                model=\"eb-4\"\n            )\n            agent = appbuilder.AgentRuntime(component=component)\n            message = appbuilder.Message({\"query\": \"你好\"})\n            print(agent.chat(message, stream=False))\n\n        .. code-block:: python\n\n            import os\n            import sys\n            import appbuilder\n            os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n            component = appbuilder.Playground(\n                prompt_template=\"{query}\",\n                model=\"eb-4\"\n            )\n            user_session_config = \"sqlite:///foo.db\"\n            agent = appbuilder.AgentRuntime(\n                component=component, user_session_config=user_session_config)\n            agent.serve(debug=False, port=8091)\n\n        .. code-block:: python\n\n            import os\n            import sys\n            import appbuilder\n            os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n            component = appbuilder.Playground(\n                prompt_template=\"{query}\",\n                model=\"eb-4\"\n            )\n            agent = appbuilder.AgentRuntime(component=component)\n            agent.chainlit_demo(port=8091)\n\n        Session 数据管理 : 除去上述简单应用外，还支持 Session 数据管理，下面是一个例子\n\n        .. code-block:: python\n\n            import os\n            import sys\n            from appbuilder.core.component import Component\n            from appbuilder import (\n                AgentRuntime, UserSession, Message, QueryRewrite, Playground,\n            )\n\n            os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n            class PlaygroundWithHistory(Component):\n                def __init__(self):\n                    super().__init__()\n                    self.query_rewrite = QueryRewrite(model=\"DeepSeek-V3.1\")\n                    self.play = Playground(\n                        prompt_template=\"{query}\",\n                        model=\"eb-4\"\n                    )\n\n                def run(self, message: Message, stream: bool=False):\n                    user_session = UserSession()\n                    # 获取 Session 历史数据\n                    history_queries = user_session.get_history(\"query\", limit=1)\n                    history_answers = user_session.get_history(\"answer\", limit=1)\n\n                    if history_queries and history_answers:\n                        history = []\n                        for query, answer in zip(history_queries, history_answers):\n                            history.extend([query.content, answer.content])\n                        logging.info(f\"history: {history}\")\n                        message = self.query_rewrite(\n                            Message(history + [message.content]), rewrite_type=\"带机器人回复\")\n                    logging.info(f\"message: {message}\") \n                    answer = self.play.run(message, stream)\n                    # 保存本轮数据\n                    user_session.append({\n                        \"query\": message,\n                        \"answer\": answer,\n                    }) \n                    return answer\n\n            agent = AgentRuntime(component=PlaygroundWithHistory())\n            agent.chainlit_demo(port=8091)\n\n        请求时认证 : component在创建时可以不进行认证，由AgentRuntime服务化后带入AppbuilderToken\n\n        .. code-block:: python\n\n            import appbuilder\n\n            component = appbuilder.Playground(\n                prompt_template=\"{query}\",\n                model=\"eb-4\",\n                lazy_certification=True, # 在创建时不进行认证\n            )\n            agent = appbuilder.AgentRuntime(component=component)\n            agent.serve(debug=False, port=8091)\n\n        .. code-block:: shell\n        \n            curl --location 'http://0.0.0.0:8091/chat' \\\n                --header 'Content-Type: application/json' \\\n                --header 'X-Appbuilder-Token: ...' \\\n                --data '{\n                    \"message\": \"你是谁\",\n                    \"stream\": false\n                }'\n\n        Session 信息查看 : 查看本地user_session.db数据库内部信息，下面是一个例子\n\n        .. code-block:: python\n\n            import sqlite3  \n            import json  \n            \n            # 连接到 SQLite 数据库  \n            # 如果文件不存在，会自动在当前目录创建:  \n            user_session_path = 'your_user_session.db地址'  \n            conn = sqlite3.connect(user_session_path)  \n            cursor = conn.cursor()  \n            \n            # 执行一条 SQL 语句，列出所有表  \n            cursor.execute(\"SELECT name FROM sqlite_master WHERE type='table';\")  \n            print(cursor.fetchall())  \n\n            # 查询appbuilder_session_messages表的列信息  \n            cursor.execute(\"PRAGMA table_info(appbuilder_session_messages);\")  \n            columns_info = cursor.fetchall()  \n\n            column_names = [info[1] for info in columns_info]  # info[1]是列名的位置  \n            for column_name in column_names:  \n                print(column_name)   \n\n            # 查询特定表中的数据  \n            cursor.execute(\"SELECT message_value FROM appbuilder_session_messages;\")  \n            for row in cursor.fetchall():  \n                print(json.loads(row[0]))\n            \n            # 关闭 Connection:  \n            conn.close()\n\n    \"\"\"\n\n    component: Component\n    user_session_config: Optional[Union[Any, str]] = None\n    user_session: Optional[Any] = None\n    tool_choice: ToolChoice = None\n\n    class Config:\n        \"\"\"\n        检查配置\n\n        Attributes:\n            extra (Extra): 额外属性，默认为 Extra.forbid，即禁止添加任何额外的属性\n            arbitrary_types_allowed (bool): 任意类型是否允许，默认为 True\n        \"\"\"\n        extra = Extra.forbid  # 不能传入类定义中未声明的字段\n        arbitrary_types_allowed = True  # 此设置允许在模型中使用自定义类型的字段\n\n    @model_validator(mode='before')\n    @classmethod\n    def init(cls, values: Dict) -> Dict:\n        \"\"\"\n        初始化 AgentRuntime，UserSession 会在这里被初始化\n\n        Args:\n            values (Dict): 初始化参数\n\n        Returns:\n            None\n        \"\"\"\n        # 初始化 UserSession\n        from appbuilder.core.user_session import UserSession\n        values.update({\n            \"user_session\": UserSession(values.get(\"user_session_config\"))\n        })\n        return values\n\n    def chat(self, message: Message, stream: bool = False, **args) -> Message:\n        \"\"\"\n        执行一次对话\n\n        Args:\n            message (Message): 该次对话用户输入的 Message\n            stream (bool): 是否流式请求\n            **args: 其他参数，会被透传到 component\n\n        Returns:\n            Message(Message): 返回的 Message\n        \"\"\"\n        return self.component.run(message=message, stream=stream, **args)\n\n    def create_flask_app(self, url_rule=\"/chat\"):\n        \"\"\" \n        创建 Flask 应用，主要用于 Gunicorn 这样的 WSGI 服务器来运行服务。\n\n        Args:\n            None\n\n        Returns:\n            Flask\n        \"\"\"\n        # lazy import flask\n        try:\n            from flask import Flask, current_app, request, Response\n            from flask_restful import reqparse, Resource\n            from werkzeug.exceptions import BadRequest\n            from flask import stream_with_context\n\n        except ImportError:\n            raise ImportError(\"Flask module is not installed. Please install it using 'pip install \"\n                              \"flask~=2.3.2 flask-restful==0.3.9'.\")\n        app = Flask(__name__)\n        app.json.ensure_ascii = False\n\n        @app.errorhandler(BadRequest)\n        def handle_bad_request(e):\n            return {\"code\": 400, \"message\": f'{e}', \"result\": None}, 400\n\n        @app.errorhandler(Exception)\n        def handle_bad_request(e):\n            if hasattr(e, \"code\"):\n                return {\"code\": e.code, \"message\": str(e), \"result\": None}, 200\n            else:\n                return {\"code\": 500, \"message\": \"Internal Server Error\", \"result\": None}, 200\n\n        def warp():\n            \"\"\"\n            根据component的lazy_certification属性处理请求。\n            \n            Args:\n                无参数。\n            \n            Returns:\n                如果stream为True，则返回流式响应（Content-Type为text/event-stream）。\n                如果stream为False，则返回包含处理结果的字典。\n            \n            Raises:\n                BadRequest: 当请求头中缺少必要的X-Appbuilder-Authorization时抛出。\n                BadRequest: 当请求体中缺少必要的message字段时抛出。\n                BadRequest: 当请求体中session_id字段不是字符串类型时抛出。\n                BadRequest: 当请求体中stream字段不是布尔类型时抛出。\n            \n            \"\"\"\n            # 根据component是否lazy_certification，分成两种情况：\n            # 1. lazy_certification为True，初始化时未被认证，每次请求都需要带入AppbuilderToken\n            # 2. lazy_certification为False，初始化时已经认证，请求时不需要带入AppbuilderToken，并且带入也无效\n            if self.component.lazy_certification:\n                app_builder_token = None\n                for key in [\"X-Appbuilder-Token\", \"X-Appbuilder-Authorization\"]:\n                    if key in request.headers:\n                        app_builder_token = request.headers[key]\n                        break\n                if not app_builder_token:\n                    raise BadRequest(\n                        \"X-Appbuilder-Authorization is required in Headers\")\n                try:\n                    self.component.set_secret_key_and_gateway(\n                        secret_key=app_builder_token)\n                except appbuilder.core._exception.BaseRPCException as e:\n                    logging.error(f\"failed to verify. err={e}\", exc_info=True)\n                    raise BadRequest(\"X-Appbuilder-Authorization invalid\")\n                except Exception as e:\n                    logging.error(f\"failed to verify. err={e}\", exc_info=True)\n                    raise e\n            else:\n                pass\n\n            data = request.get_json()\n            if \"message\" not in data:\n                raise BadRequest(\"message is required\")\n            message = Message(data.pop('message'))\n            if \"session_id\" not in data:\n                session_id = str(uuid.uuid4())\n            else:\n                session_id = data.pop(\"session_id\")\n                if not isinstance(session_id, str):\n                    raise BadRequest(\"session_id must be str type\")\n            if \"stream\" not in data:\n                stream = False\n            else:\n                stream = data.pop(\"stream\")\n                if not isinstance(stream, bool):\n                    raise BadRequest(\"stream must be bool type\")\n            request_id = request.headers.get(\"X-Appbuilder-Request-Id\", str(uuid.uuid4()))\n            user_id = request.headers.get(\"X-Appbuilder-User-Id\", None)\n\n            init_context(session_id=session_id, request_id=request_id, user_id=user_id)\n            logging.info(\n                f\"request_id={request_id}, session_id={session_id}] message={message},\"\n                f\" stream={stream}, data={data}, start run...\")\n\n            def gen_sse_resp():\n                with app.app_context():\n                    received_first_packet = False\n                    retry_count = 0\n                    while retry_count < MAX_RETRY_COUNT:\n                        try:\n                            answer = self.chat(message, stream, **data)\n                        except Exception as e:  # 调用chat方法报错，直接返回\n                            code = 500 if not hasattr(e, \"code\") else e.code\n                            err_resp = {\"code\": code, \"message\": \"InternalServerError\", \"result\": None}\n                            logging.error(\n                                f\"request_id={request_id}, session_id={session_id}, err={e}, execute self.chat failed\", exc_info=True)\n                            yield \"data: \" + json.dumps(err_resp, ensure_ascii=False) +  \"\\n\\n\"\n                            return\n                        else:  # 调用chat方法成功，开始生成流式事件\n                            content_iterator = iter(answer.content)\n                            answer.content = None\n                            result = None\n                            try:\n                                for sub_content in content_iterator:\n                                    result = copy.deepcopy(answer)\n                                    result.content = sub_content\n                                    yield \"data: \" + json.dumps({\n                                        \"code\": 0, \"message\": \"\",\n                                        \"result\": {\n                                            \"session_id\": session_id,\n                                            \"is_completion\": False,\n                                            \"answer_message\": json.loads(result.json(exclude_none=True))\n                                        }\n                                    }, ensure_ascii=False) + \"\\n\\n\"\n                                    received_first_packet = True\n                            except Exception as e:\n                                retry_count += 1\n                                logging.error(\n                                    f\"[request_id={request_id}, session_id={session_id}] err={e}, \"\n                                    f\"retry_count={retry_count}\", exc_info=True)\n                                # 如果未收到首包且重试次数小于最大重试次数，则尝试重新执行一次chat方法\n                                if not received_first_packet and retry_count < MAX_RETRY_COUNT:\n                                    continue\n                                else:  # 其它情况返回\n                                    logging.error(\n                                        f\"[request_id={request_id}, session_id={session_id}] err={e}, \"\n                                        f\"retry_count={retry_count}, received_first_packet={received_first_packet}\"\n                                        , exc_info=True)\n                                    code = 500 if not hasattr(e, \"code\") else e.code\n                                    err_resp = {\"code\": code, \"message\": \"InternalServerError\", \"result\": None}\n                                    yield \"data: \" + json.dumps(err_resp, ensure_ascii=False) + \"\\n\\n\"\n                                    return\n                            result.content = \"\"\n                            yield \"data: \" + json.dumps({\n                                \"code\": 0, \"message\": \"\",\n                                \"result\": {\n                                    \"session_id\": session_id,\n                                    \"is_completion\": True,\n                                    \"answer_message\": json.loads(result.json(exclude_none=True))\n                                }\n                            }, ensure_ascii=False) + \"\\n\\n\"\n                            logging.info(\n                                f\"request_id={request_id}, session_id={session_id}]\"\n                                f\"retry_count={retry_count}, success response\", exc_info=True)\n                            self.user_session._post_append()\n                            return  # 正常返回\n\n            if stream:  # 流式\n                return Response(stream_with_context(gen_sse_resp()), 200,\n                        {'Content-Type': 'text/event-stream; charset=utf-8'})\n            if not stream:  # 非流式\n                try:\n                    answer = self.chat(message, stream, **data)\n                    blocking_result = json.loads(copy.deepcopy(answer).json(exclude_none=True))\n                    logging.debug(f\"[request_id={request_id}, session_id={session_id}] blocking_result={blocking_result}\")\n                    self.user_session._post_append()\n                    return {\n                        \"code\": 0, \"message\": \"\",\n                        \"result\": {\"session_id\": session_id, \"answer_message\": blocking_result}\n                    }\n                except Exception as e:\n                    logging.error(\n                        f\"[request_id={request_id}, session_id={session_id}] err={e}\", exc_info=True)\n                    code = 500 if not hasattr(e, \"code\") else e.code\n                    return {\"code\": code, \"message\": \"InternalServerError\", \"result\": None}\n\n        app.add_url_rule(url_rule, 'chat', warp, methods=['POST'])\n        return app\n\n    def serve(self, host='0.0.0.0', debug=True, port=8092, url_rule=\"/chat\"):\n        \"\"\"\n        将 component 服务化，提供 Flask http API 接口\n        \n        Args:\n            host (str): 服务运行的host地址，默认为'0.0.0.0'\n            debug (bool): 是否开启debug模式，默认为True\n            port (int): 服务运行的端口号，默认为8092\n            url_rule (str): 服务的URL规则，默认为\"/chat\"\n        \n        Returns:\n            None\n        \"\"\"\n        app = self.create_flask_app(url_rule=url_rule)\n        app.run(host=host, debug=debug, port=port)\n\n    def prepare_chainlit_readme(self):\n        \"\"\"\n        准备 Chainlit 的 README 文件\n        \n        Args:\n            无\n        \n        Returns:\n            无\n        \n        Raises:\n            无\n        \n        说明:\n            从 utils 文件夹中拷贝 chainlit.md 文件到当前工作目录下，如果当前工作目录下已存在 chainlit.md 文件，则不拷贝。\n        \n        \"\"\"\n        try:\n            # 获取当前python命令执行的路径，而不是文件的位置\n            cwd_path = os.getcwd()\n            # 获取当前文件的路径所在文件夹\n            current_file_path = os.path.dirname(\n                os.path.dirname(os.path.abspath(__file__)))\n            chainlit_readme_path = os.path.join(\n                current_file_path, \"utils\", \"chainlit.md\")\n\n            # 拷贝chainlit_readme到cwd_path\n            # 如果cwd_path下已经存在chainlit_readme，则不拷贝\n            if not os.path.exists(os.path.join(cwd_path, \"chainlit.md\")):\n                shutil.copy(chainlit_readme_path, cwd_path)\n        except:\n            logger.error(\"Failed to copy chainlit.md to current directory\")\n\n    def chainlit_demo(self, host='0.0.0.0', port=8091):\n        \"\"\"\n        将 component 服务化，提供 chainlit demo 页面\n\n        Args:\n            host (str): 服务 host\n            port (int): 服务 port\n\n        Returns:\n            None\n        \"\"\"\n        # lazy import chainlit\n        try:\n            import chainlit as cl\n            import chainlit.cli\n        except ImportError:\n            raise ImportError(\"chainlit module is not installed. Please install it using 'pip install \"\n                              \"chainlit~=1.0.200'.\")\n        import click\n        from click.testing import CliRunner\n\n        self.prepare_chainlit_readme()\n\n        @cl.on_message  # this function will be called every time a user inputs a message in the UI\n        async def main(message: cl.Message):\n            session_id = cl.user_session.get(\"id\")\n            request_id = str(uuid.uuid4())\n            init_context(session_id=session_id, request_id=request_id)\n            msg = cl.Message(content=\"\")\n            await msg.send()\n            stream_message = self.chat(Message(message.content), stream=True)\n\n            for part in stream_message.content:\n                if token := part or \"\":\n                    await msg.stream_token(token)\n            await msg.update()\n            self.user_session._post_append()\n\n        # start chainlit service\n        if os.getenv('APPBUILDER_RUN_CHAINLIT') == '1':\n            pass\n        else:\n            os.environ['APPBUILDER_RUN_CHAINLIT'] = '1'\n            target = sys.argv[0]\n            runner = CliRunner()\n            runner.invoke(\n                chainlit.cli.chainlit_run, [target, '--watch', \"--port\", port, \"--host\", host])\n\n    def chainlit_agent(self, host='0.0.0.0', port=8091):\n        \"\"\"\n        将 appbuilder client 服务化，提供 chainlit demo 页面\n\n        Args:\n            host (str): 服务 host\n            port (int): 服务 port\n\n        Returns:\n            None\n        \"\"\"\n        # lazy import chainlit\n        try:\n            import chainlit as cl\n            import chainlit.cli\n        except ImportError:\n            raise ImportError(\"chainlit module is not installed. Please install it using 'pip install \"\n                              \"chainlit~=1.0.200'.\")\n        import click\n        from click.testing import CliRunner\n\n        if not isinstance(self.component, appbuilder.AppBuilderClient):\n            raise ValueError(\n                \"chainlit_agent require component must be an instance of AppBuilderClient\")\n        self.prepare_chainlit_readme()\n\n        conversation_ids = []\n        interrupt_dict = {}\n\n        def _chat(message: cl.Message):\n            if len(conversation_ids) == 0:\n                raise ValueError(\"create new conversation failed!\")\n            conversation_id = conversation_ids[-1]\n            file_ids = []\n            if len(message.elements) > 0:\n                file_id = self.component.upload_local_file(\n                    conversation_id, message.elements[0].path)\n                file_ids.append(file_id)\n\n            interrupt_ids = interrupt_dict.get(conversation_id, [])\n            interrupt_event_id = interrupt_ids.pop() if len(interrupt_ids) > 0 else None\n            action = None\n            if interrupt_event_id is not None:\n                action = Action.create_resume_action(interrupt_event_id)\n            \n            tmp_message = self.component.run(conversation_id=conversation_id, query=message.content, file_ids=file_ids,\n                                      stream=True, tool_choice=self.tool_choice, action=action)\n            res_message=list(tmp_message.content)\n            \n            interrupt_event_id = None\n            for ans in res_message:\n                for event in ans.events:\n                    if event.content_type == \"chatflow_interrupt\":\n                        interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n                    if event.content_type == \"publish_message\" and event.event_type == \"chatflow\":\n                        answer = event.detail.get(\"message\")\n                        ans.answer += answer\n                        \n            if interrupt_event_id is not None:\n                interrupt_ids.append(interrupt_event_id)\n                interrupt_dict[conversation_id] = interrupt_ids\n            tmp_message.content = res_message\n            return tmp_message\n\n        @cl.on_chat_start\n        async def start():\n            session_id = cl.user_session.get(\"id\")\n            request_id = str(uuid.uuid4())\n            init_context(session_id=session_id, request_id=request_id)\n            conversation_ids.append(self.component.create_conversation())\n            interrupt_dict[conversation_ids[-1]] = []\n\n        @cl.on_message  # this function will be called every time a user inputs a message in the UI\n        async def main(message: cl.Message):\n            msg = cl.Message(content=\"\")\n            await msg.send()\n            await msg.update()\n\n            stream_message = _chat(message)\n            detail_json_list = []\n            for part in stream_message.content:\n                if token := part.answer or \"\":\n                    await msg.stream_token(token)\n                for event in part.events:\n                    detail = event.detail\n                    detail_json = json.dumps(\n                        detail, indent=4, ensure_ascii=False)\n                    detail_json_list.append(detail_json)\n            await msg.update()\n\n            @cl.step(name=\"详细信息\")\n            def show_json(detail_json):\n                return \"```json\\n\" + detail_json + \"\\n```\"\n            for detail_json in detail_json_list:\n                if len(detail_json) > 2:\n                    show_json(detail_json)\n            await msg.update()\n            self.user_session._post_append()\n\n        # start chainlit service\n        if os.getenv('APPBUILDER_RUN_CHAINLIT') == '1':\n            pass\n        else:\n            os.environ['APPBUILDER_RUN_CHAINLIT'] = '1'\n            target = sys.argv[0]\n            runner = CliRunner()\n            runner.invoke(\n                chainlit.cli.chainlit_run, [target, '--watch', \"--port\", port, \"--host\", host])\n"
  },
  {
    "path": "python/core/assistant/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/assistant/assistants/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .assistants import (\n    Assistants\n)\n\nfrom .files import (\n    Files\n)\n\n__all__ = [\n    'Assistants',\n    'Files',\n]"
  },
  {
    "path": "python/core/assistant/assistants/assistants.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nfrom typing import Optional\nfrom appbuilder.core.assistant.type import assistant_type\nfrom appbuilder.utils.collector import Collector\nfrom appbuilder.utils.collector import AssistantKeys\nfrom appbuilder.core._client import AssistantHTTPClient\nfrom appbuilder.core.assistant.assistants.files import Files\nfrom appbuilder.utils.trace.tracer_wrapper import assistent_tool_trace\n\n\nclass Assistants(object):\n    def __init__(self):\n        self._http_client = AssistantHTTPClient()\n\n    @property\n    def files(self):\n        \"\"\"\n        获取当前工作目录下的文件对象。\n        \n        Args:\n            无\n        \n        Returns:\n            Files: 返回当前工作目录下的文件对象。\n        \n        \"\"\"\n        return Files()\n\n    @assistent_tool_trace\n    def create(self,\n               name: str,\n               description: str,\n               model: Optional[str] = \"ERNIE-4.0T-8K\",\n               response_format: Optional[str] = 'text',\n               instructions: Optional[str] = \"你是百度制作的AI助手\",\n               thought_instructions: Optional[str] = \"\",\n               chat_instructions: Optional[str] = \"\",\n               tools: Optional[list[assistant_type.AssistantTool]] = [],\n               file_ids: Optional[list[str]] = [],\n               metadata: Optional[dict] = {},\n               ) -> assistant_type.AssistantCreateResponse:\n        \"\"\"\n        创建助手实例\n        \n        Args:\n            name (str): 助手名称\n            description (str): 助手描述\n            model (Optional[str], optional): 模型名称. Defaults to \"ERNIE-4.0T-8K\".\n            response_format (Optional[str], optional): 响应格式. Defaults to 'text'.\n            instructions (Optional[str], optional): 指令. Defaults to \"\".\n            thought_instructions (Optional[str], optional): 思考指令. Defaults to \"\".\n            chat_instructions (Optional[str], optional): 聊天指令. Defaults to \"\".\n            tools (Optional[list[assistant_type.AssistantTool]], optional): 工具列表. Defaults to [].\n            file_ids (Optional[list[str]], optional): 文件ID列表. Defaults to [].\n            metadata (Optional[dict], optional): 元数据. Defaults to {}.\n        \n        Returns:\n            assistant_type.AssistantCreateResponse: 助手创建响应\n        \n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/assistants\")\n\n        req = assistant_type.AssistantCreateRequest(\n            name=name,\n            description=description,\n            model=model,\n            response_format=response_format,\n            instructions=instructions,\n            thought_instructions=thought_instructions,\n            chat_instructions=chat_instructions,\n            tools=tools,\n            file_ids=file_ids,\n            metadata=metadata,\n        )\n\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        resp = assistant_type.AssistantCreateResponse(**data)\n        Collector().add_to_collection(AssistantKeys.ASSISTANT, resp, resp.id)\n        return resp\n    \n    @assistent_tool_trace\n    def update(self,\n               assistant_id: str,\n               model: Optional[str],\n               name: Optional[str],\n               description: Optional[str],\n               instructions: Optional[str] = \"\",\n               tools: Optional[list[assistant_type.AssistantTool]] = [],\n               thought_instructions: Optional[str] = \"\",\n               chat_instructions: Optional[str] = \"\",\n               response_format: Optional[str] = \"text\",\n               file_ids: Optional[list[str]] = [],\n               metadata: Optional[dict] = {}\n               ) -> assistant_type.AssistantUpdateResponse:\n        \"\"\"\n        根据assistant_id修改一个已创建的Assistant\n        \n        Args:\n            assistant_id (str): 助手ID。\n            model (Optional[str]): 助手模型。\n            name (Optional[str]): 助手名称。\n            description (Optional[str]): 助手描述。\n            response_format (Optional[str], optional): 响应格式。默认为None。\n            instructions (Optional[str], optional): 助手指令。默认为None。\n            thought_instructions (Optional[str], optional): 思考指令。默认为None。\n            chat_instructions (Optional[str], optional): 聊天指令。默认为None。\n            tools (Optional[list[assistant_type.AssistantTool]], optional): 助手工具列表。默认为空列表。\n            file_ids (Optional[list[str]], optional): 文件ID列表。默认为空列表。\n            metadata (Optional[dict], optional): 助手元数据。默认为空字典。\n        \n        Returns:\n            assistant_type.AssistantUpdateResponse: 助手更新响应。\n        \n        \"\"\"\n        \n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/assistants/update\")\n        \n        req = assistant_type.AssistantUpdateRequest(\n            assistant_id=assistant_id,\n            model=model,\n            name=name,\n            description=description,\n            response_format=response_format,\n            instructions=instructions,\n            thought_instructions=thought_instructions,\n            chat_instructions=chat_instructions,\n            tools=tools,\n            file_ids=file_ids,\n            metadata=metadata,\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        resp = assistant_type.AssistantUpdateResponse(**data)\n        return resp\n    \n    @assistent_tool_trace\n    def list(self,\n             limit: Optional[int] = 20,\n             order: Optional[str] = \"desc\",\n             after: Optional[str] = \"\",\n             before: Optional[str] = \"\",\n             ) -> assistant_type.AssistantListResponse:\n        \"\"\"\n        查询当前用户已创建的assistant列表\n        \n        Args:\n            limit (Optional[int], optional): 返回助手列表的最大数量，默认为20。\n            order (Optional[str], optional): 返回助手列表的排序方式，可选值为\"asc\"或\"desc\"，默认为\"desc\"。\n            after (Optional[str], optional): 返回助手列表中id在指定id之后的助手，默认为空字符串。\n            before (Optional[str], optional): 返回助手列表中id在指定id之前的助手，默认为空字符串。\n        \n        Returns:\n            assistant_type.AssistantListResponse: 助手列表响应体。\n        \n        \"\"\"\n        \n        \n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/assistants/list\")\n        \n        req = assistant_type.AssistantListRequest(\n            limit=limit,\n            order=order,\n            after=after,\n            before=before\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        resp = assistant_type.AssistantListResponse(**data)\n        return resp\n    \n    @assistent_tool_trace\n    def query(self,\n              assistant_id: Optional[str]) -> assistant_type.AssistantQueryResponse:\n        \"\"\"\n        根据assistant_id查询Assistant信息\n        \n        Args:\n            assistant_id (Optional[str]): 助手ID\n        \n        Returns:\n            assistant_type.AssistantQueryResponse: 助手查询响应结果\n        \n        Raises:\n            HTTPError: 请求失败，抛出HTTPError异常\n        \"\"\"\n        \n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/assistants/query\")\n        \n        req = assistant_type.AssistantQueryRequest(\n            assistant_id=assistant_id\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        resp = assistant_type.AssistantQueryResponse(**data)\n        return resp\n    \n    @assistent_tool_trace\n    def delete(self,\n               assistant_id: Optional[str]) -> assistant_type.AssistantDeleteResponse:\n        \"\"\"\n        根据assistant_id删除指定Assitant\n        \n        Args:\n            assistant_id (Optional[str]): 待删除的助手实例ID。\n        \n        Returns:\n            assistant_type.AssistantDeleteResponse: 删除助手实例后的响应结果。\n        \n        Raises:\n            HttpRequestError: 发送HTTP请求时发生错误。\n        \n        \"\"\"\n        \n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/assistants/delete\")\n        \n        req = assistant_type.AssistantDeleteRequest(\n            assistant_id=assistant_id\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)    \n        \n        resp = assistant_type.AssistantDeleteResponse(**data)\n        return resp\n    \n    @assistent_tool_trace\n    def mount_files(self,\n            assistant_id: Optional[str],\n            file_id: Optional[str]\n            ) -> assistant_type.AssistantFilesResponse:\n        \"\"\"\n        指定file_id和assistant_id，挂载File到对应的Assistant\n        \n        Args:\n            assistant_id (Optional[str]): 助理ID。\n            file_id (Optional[str]): 文件ID。\n        \n        Returns:\n            assistant_type.AssistantFilesResponse: 助理文件列表响应对象。\n        \n        \"\"\"\n        if not isinstance(assistant_id, str):\n            raise TypeError(\"assistant_id must be a string\")\n        if not assistant_id:\n            raise ValueError(\"assistant_id can't be empty\")\n        if not isinstance(file_id, str):\n            raise TypeError(\"file_id must be a string\")\n        if not file_id:\n            raise ValueError(\"file_id can't be empty\")\n        try:\n            self.files.query(file_id)\n        except:\n            raise FileNotFoundError(\"can't find file with id {}\".format(file_id))\n        \n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/assistants/files\")\n        \n        req = assistant_type.AssistantFilesRequest(\n            assistant_id=assistant_id,\n            file_id=file_id\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)    \n        \n        resp = assistant_type.AssistantFilesResponse(**data)\n        return resp\n    \n    @assistent_tool_trace\n    def mounted_files_list(self,\n                   assistant_id: Optional[str],  \n                   limit: Optional[int] = 20,\n                   order: Optional[str] =  'desc' , \n                   after: Optional[str] =  \"\", \n                   before: Optional[str] =  \"\") -> assistant_type.AssistantMountedFilesListResponse:\n        \"\"\"\n        查询Assistant挂载的File列表\n        \n        Args:\n            assistant_id (Optional[str]): 助手ID，为空时获取当前登录用户的助手文件列表。\n            limit (Optional[int], optional): 每页最多显示多少个文件。默认为20。\n            order (Optional[AssistantListRole], optional): 文件列表排序方式。可选值为 'asc' 或 'desc'。默认为 'desc'。\n            after (Optional[str], optional): 返回文件ID大于该值的文件列表。默认为空字符串。\n            before (Optional[str], optional): 返回文件ID小于该值的文件列表。默认为空字符串。\n        \n        Returns:\n            assistant_type.AssistantFilesListResponse: 包含文件列表信息的响应对象。\n        \n        \"\"\"\n        \n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/assistants/files/list\")\n        \n        req = assistant_type.AssistantMountedFilesListRequest(\n            assistant_id=assistant_id,\n            limit=limit,\n            order=order,\n            after=after,\n            before=before\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)    \n        \n        resp = assistant_type.AssistantMountedFilesListResponse(**data)\n        return resp\n    \n    @assistent_tool_trace\n    def unmount_files(self,\n                     assistant_id: Optional[str],\n                     file_id: Optional[str]\n                     ) -> assistant_type.AssistantFilesDeleteResponse:\n        \"\"\"\n        指定assistant_id和file_id，解绑Assistant中对应File的关联\n        \n        Args:\n            assistant_id (Optional[str]): 助理ID。\n            file_id (Optional[str]): 文件ID。\n        Returns:\n            assistant_type.AssistantFilesDeleteResponse: 响应对象。\n        \"\"\"\n        if not isinstance(assistant_id, str):\n            raise TypeError(\"assistant_id must be a string\")\n        if not assistant_id:\n            raise ValueError(\"assistant_id can't be empty\")\n        if not isinstance(file_id, str):\n            raise TypeError(\"file_id must be a string\")\n        if not file_id:\n            raise ValueError(\"file_id can't be empty\")\n        try:\n            list_response=self.mounted_files_list(assistant_id, limit=2147483647)\n            exist_files = False\n            for data in list_response.data:\n                if data.id == file_id:\n                    exist_files = True\n                    break\n            if exist_files == False:\n                raise FileNotFoundError\n        except:\n            raise FileNotFoundError(\"can't find file with id {}\".format(file_id))\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/assistants/files/delete\")\n        \n        req = assistant_type.AssistantFilesDeleteRequest(\n            assistant_id=assistant_id,\n            file_id=file_id\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)    \n        \n        resp = assistant_type.AssistantFilesDeleteResponse(**data)\n        return resp\n            \n\n             \n    \n    \n        \n"
  },
  {
    "path": "python/core/assistant/assistants/files.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# -*- coding: utf-8 -*-\n\n\nimport os\nimport json\nfrom typing import Optional\nfrom appbuilder.core.assistant.type import assistant_type\nfrom appbuilder.core._client import AssistantHTTPClient\n\nfrom appbuilder.core._exception import AppBuilderServerException,HTTPConnectionException\nfrom appbuilder.utils.trace.tracer_wrapper import assistent_tool_trace\n\nclass Files(object):\n    def __init__(self):\n        self._http_client = AssistantHTTPClient()\n\n    @assistent_tool_trace\n    def create(self, file_path: str, purpose: str = \"assistant\") -> assistant_type.AssistantFilesCreateResponse:\n        \"\"\"\n        上传文件到助理存储中。\n        \n        Args:\n            file_path (str): 要上传的文件路径。\n            purpose (str, optional): 上传文件的用途。默认为 \"assistant\"。\n        \n        Returns:\n            assistant_type.AssistantFilesCreateResponse: 上传文件后返回的响应对象。\n        \n        Raises:\n            ValueError: 如果指定的文件路径不存在，则会引发此异常。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        headers.pop(\"Content-Type\")\n        url = self._http_client.service_url(\"/v2/storage/files\")\n\n        if not os.path.exists(file_path):\n            raise ValueError(\"File {} not exists\".format(file_path))\n\n        with open(file_path, 'rb') as f:\n            files = [\n                ('file',(os.path.basename(file_path), f))\n            ]\n\n            response = self._http_client.session.post(\n                url,\n                headers=headers,\n                files=files,\n                params={\n                    'purpose': purpose\n                }\n            )\n\n        self._http_client.check_response_header(response)\n\n        request_id = self._http_client.response_request_id(response)\n        data = response.json()\n\n        self._http_client.check_assistant_response(request_id, data)\n        resp = assistant_type.AssistantFilesCreateResponse(**data)\n        return resp\n\n    @assistent_tool_trace\n    def list(self) -> assistant_type.AssistantFilesListResponse:\n        \"\"\"\n        列出存储中的文件列表。\n        \n        此方法向存储服务发送请求，获取已上传的文件列表。返回的文件列表包含每个文件的详细信息，\n        包括文件ID、大小、用途、审核状态、创建时间、文件名、文件分类ID等。\n\n        Args:\n            无\n\n        Returns:\n            assistant_type.AssistantFilesListResponse: 文件列表的响应对象，包含以下属性：\n            \n            - object (str): 表示对象类型，默认值为 \"list\"\n            \n            - data (list[AssistantFilesListData]): 包含文件信息的列表，列表中的每个元素为 AssistantFilesListData 对象。该对象包含以下属性：\n            \n                - id (str): 文件ID\n                - bytes (int): 文件大小（字节）\n                - object (str): 文件对象标识\n                - purpose (str): 文件用途\n                - censored (AuditStatus): 文件的审核状态\n                - create_at (int): 文件创建时间戳\n                - filename (str): 文件名\n                - classification_id (str): 文件分类ID\n                - file_type (str): 文件类型\n\n        Raises:\n            assistant_type.AssistantError: 请求发生错误时抛出，具体错误信息可通过 `error_msg` 属性获取。\n        \"\"\"\n        headers = self._http_client.auth_header()  # 获取身份认证头\n        headers['Content-Type'] = 'application/json'  # 设置请求头为JSON格式\n        url = self._http_client.service_url(\"/v2/storage/files/list\")  # 拼接存储服务的URL\n        \n        response = self._http_client.session.post(  # 向存储服务发送POST请求，获取文件列表\n            url=url,\n            headers=headers,\n            json={},  # 发送空的JSON请求体\n            timeout=None  # 设置为无超时限制\n        ) \n        self._http_client.check_response_header(response)  # 检查响应头是否合法\n\n        request_id = self._http_client.response_request_id(response)  # 从响应中获取请求ID\n        data = response.json()  # 将响应内容转换为JSON格式\n\n        self._http_client.check_assistant_response(request_id, data)  # 检查Assistant响应是否有错误\n        resp = assistant_type.AssistantFilesListResponse(**data)  # 将响应数据映射为AssistantFilesListResponse对象\n        return resp  # 返回文件列表响应对象\n\n    \n    @assistent_tool_trace\n    def query(self,\n              file_id: str,\n            ) -> assistant_type.AssistantFilesQueryResponse:\n        \"\"\"\n        根据文件ID查询文件信息\n        \n        Args:\n            file_id (str): 文件ID\n        \n        Returns:\n            assistant_type.AssistantFilesQueryResponse: 文件查询响应对象\n        \n        Raises:\n            TypeError: 如果file_id不是str类型\n            ValueError: 如果file_id不存在\n        \"\"\"\n\n        if not isinstance(file_id, str):\n            raise TypeError(\"file_id must be str\")\n        headers = self._http_client.auth_header()\n        headers['Content-Type'] = 'application/json'\n        url = self._http_client.service_url(\"/v2/storage/files/query\")\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json={\n                'file_id': file_id\n            },\n            timeout=None\n        )\n        try:\n            self._http_client.check_response_header(response)\n\n            request_id = self._http_client.response_request_id(response)\n            data = response.json()\n\n            self._http_client.check_assistant_response(request_id, data)\n            resp = assistant_type.AssistantFilesQueryResponse(**data)\n        except AssertionError:\n            raise ValueError('file_id {} is not exist'.format(file_id))\n        except TypeError:\n            raise ValueError('file_id {} is not exist'.format(file_id))\n        return resp \n    \n    @assistent_tool_trace\n    def delete(self,\n               file_id: str,\n            ) -> assistant_type.AssistantFilesDeleteResponse:\n        \"\"\"\n        删除文件\n        \n        Args:\n            file_id (str): 文件ID\n        Returns:\n            assistant_type.AssistantFilesDeleteResponse: 删除文件后的响应对象。\n        Raises:\n            无\n        \"\"\"\n        headers = self._http_client.auth_header()\n        headers['Content-Type'] = 'application/json'\n        url = self._http_client.service_url(\"/v2/storage/files/delete\")\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json={\n                'file_id': file_id\n            },\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        request_id = self._http_client.response_request_id(response)\n        data = response.json()\n        self._http_client.check_assistant_response(request_id, data)\n        resp = assistant_type.AssistantFilesDeleteResponse(**data)\n        return resp\n    \n    @assistent_tool_trace\n    def download(self,\n                 file_id:str,\n                 file_path:str=\"\", # 要求若文件路径不为空，需要以/结尾，默认下载到当前文件夹\n                 timeout:Optional[int]=None,\n                 ):\n        \"\"\"\n        下载文件\n        \n        Args:\n            file_id (str): 文件ID\n            file_path (str, optional): 文件保存路径，默认为空字符串。如果未指定，则使用文件名的默认值。要求若文件路径不为空，需要以/结尾。\n            timeout (Optional[int], optional): 请求超时时间，单位秒。如果未指定，则使用默认超时时间。\n        \n        Returns:\n            None\n        \n        Raises:\n            TypeError: 当file_path或file_id类型不为str时引发此异常。\n            ValueError: 当file_id为空或None时，或file_path不是文件目录时引发此异常。\n            FileNotFoundError: 当指定的文件路径或文件不存在时引发此异常。\n            OSError: 当磁盘空间不足时引发此异常。\n            HTTPConnectionException: 当请求失败时引发此异常。\n            Exception: 当发生其他异常时引发此异常。\n        \"\"\"\n        if not isinstance(file_path, str):\n            raise TypeError(\"file_path must be str\")\n        if not isinstance(file_id, str):\n            raise TypeError(\"file_id must be str\")\n        if file_id == \"\" or file_id is None:\n            raise ValueError(\"file_id cannot be empty or None\")\n        try:\n            self.query(file_id)\n        except:\n            raise FileNotFoundError(\"file_id {} not found\".format(file_id))\n        if file_path != \"\" and not os.path.exists(file_path):\n            raise FileNotFoundError(\"file_path {} not found\".format(file_path))\n        if file_path != \"\" and not os.path.isdir(file_path):\n            raise ValueError(\"file_path must be a file directory\")\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/storage/files/download\")\n        try:\n            response = self._http_client.session.post(\n                url=url,\n                headers=headers,\n                json={\n                    'file_id': file_id\n                },\n                timeout=timeout\n            )\n        except:\n            raise HTTPConnectionException(\"request failed\")\n        self._http_client.check_response_header(response)\n        \n        filename=response.headers['Content-Disposition'].split(\"filename=\")[-1]\n        file_path+=filename\n        try:    \n            with open(file_path,'wb') as file:\n                for chunk in response.iter_content():\n                    if chunk:\n                        file.write(chunk)\n        except FileNotFoundError as e:\n            raise FileNotFoundError(\"请检查文件路径是否正确,错误信息{}\".format(e))\n        except OSError as e:\n            raise OSError(\"磁盘空间不足,错误信息{}\".format(e))\n        except Exception as e:\n            raise Exception(\"出现错误,错误信息{}\".format(e))\n        \n    @assistent_tool_trace\n    def content(self,\n                file_id:str,\n                timeout:Optional[int]=None):\n        \"\"\"\n        获取指定文件的内容\n        \n        Args:\n            file_id (str): 文件ID\n            timeout (Optional[int], optional): 请求超时时间，单位秒. Defaults to None.\n        \n        Returns:\n            assistant_type.AssistantFilesContentResponse: 包含文件内容的响应对象\n        \n        Raises:\n            TypeError: 当file_id不是字符串类型时引发此异常\n            FileNotFoundError: 当指定的文件路径不存在时引发此异常\n            HTTPConnectionException: 当请求失败时引发此异常\n        \n        \"\"\"\n        if not isinstance(file_id, str):\n            raise TypeError(\"file_id must be str\")\n        try:\n            self.query(file_id)\n        except:\n            raise FileNotFoundError(\"can't find file with id {}\".format(file_id))\n        headers = self._http_client.auth_header()\n        headers['Content-Type'] = 'application/json'\n        url = self._http_client.service_url(\"/v2/storage/files/content\")\n        try:\n            response = self._http_client.session.post(\n                url=url,\n                headers=headers,\n                json={\n                    'file_id': file_id\n                },\n                timeout=timeout\n            )\n        except:\n            raise HTTPConnectionException(\"request failed\")\n        self._http_client.check_response_header(response)\n        \n        content=b''\n        for chunk in response.iter_content():\n            if chunk:\n                content+=chunk\n        \n        res=assistant_type.AssistantFilesContentResponse(\n            content_type =response.headers['Content-Type'],\n            content = content\n        )\n        \n        return res\n\n "
  },
  {
    "path": "python/core/assistant/base.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nclass BetaAssistant(object):\n    @property\n    def assistants(self):\n        from appbuilder.core.assistant.assistants import Assistants\n        return Assistants()\n    \n    @property\n    def threads(self):\n        from appbuilder.core.assistant.threads import Threads\n        return Threads()\n    \n    @property\n    def type(self):\n        from appbuilder.core.assistant import type\n        return type\n    \n    @property\n    def assistant_type(self):\n        from appbuilder.core.assistant.type import assistant_type\n        return assistant_type\n    \n    @property\n    def thread_type(self):\n        from appbuilder.core.assistant.type import thread_type\n        return thread_type\n    \n    @property\n    def public_type(self):\n        from appbuilder.core.assistant.type import public_type\n        return public_type\n\nassistant = BetaAssistant()\n"
  },
  {
    "path": "python/core/assistant/threads/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .threads import (\n    Threads\n)\n\nfrom .messages import (\n    Messages,\n)\n\nfrom .runs import (\n    Runs,\n    Steps\n)\n\n___all__ = [\n    'Threads',\n    'Messages',\n    'Runs',\n    'Steps'\n]"
  },
  {
    "path": "python/core/assistant/threads/messages/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .messages import (\n    Messages\n)\n\n__all__ = [\n    'Messages',\n]"
  },
  {
    "path": "python/core/assistant/threads/messages/messages.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nfrom appbuilder.core.assistant.type import thread_type\nfrom appbuilder.core._client import AssistantHTTPClient\nfrom typing import Optional\nfrom appbuilder.utils.trace.tracer_wrapper import assistent_tool_trace\n\n\nclass Messages(object):\n    def __init__(self):\n        self._http_client = AssistantHTTPClient()\n\n    @assistent_tool_trace\n    def create(self, \n               thread_id: str,\n               content: str,\n               role: Optional[str] = \"user\",\n               file_ids: Optional[list[str]] = []) -> thread_type.AssistantMessageCreateResponse:\n        \"\"\"\n        创建一条消息。\n        \n        Args:\n            thread_id (str): 线程ID。\n            content (str): 消息内容。\n            role (Optional[str], optional): 角色，可选值为\"user\"或\"assistant\"。默认为\"user\"。\n            file_ids (Optional[list[str]], optional): 消息中包含的文件ID列表。默认为空列表。\n        \n        Returns:\n            thread_type.AssistantMessageCreateResponse: 消息创建响应对象。\n        \n        Raises:\n            HttpError: 如果请求失败，则抛出HttpError异常。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/messages\")\n\n        req = thread_type.AssistantMessageCreateRequest(\n            thread_id=thread_id,\n            content=content,\n            role=role,\n            file_ids=file_ids\n        )\n\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        response = thread_type.AssistantMessageCreateResponse(**data)\n        return response\n    \n    @assistent_tool_trace\n    def update(self,\n               thread_id: str,\n               message_id: str,\n               content: Optional[str],\n               file_ids: Optional[list[str]] = []) -> thread_type.AssistantMessageUpdateResponse:\n        \"\"\"\n        修改Message对象，允许content和file_ids字段\n        \n        Args:\n            thread_id (str): 线程ID。\n            message_id (str): 消息ID。\n            content (Optional[str], optional): 消息内容。默认为空字符串。\n            file_ids (Optional[list[str]], optional): 消息中包含的文件ID列表。默认为空列表。\n        \n        Returns:\n            thread_type.AssistantMessageUpdateResponse: 消息更新响应对象。\n        \n        Raises:\n            HttpError: 如果请求失败，则抛出HttpError异常。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/messages/update\")\n        \n        req = thread_type.AssistantMessageUpdateRequest(\n            thread_id = thread_id, \n            message_id = message_id,\n            content = content,\n            file_ids = file_ids\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        response = thread_type.AssistantMessageUpdateResponse(**data)\n        return response  \n\n    @assistent_tool_trace\n    def list(self,\n            thread_id: str,\n            limit: int = 20,\n            order: str = \"desc\",\n            after: str = \"\",\n            before: str = \"\") -> thread_type.AssistantMessageListResponse:\n        \"\"\"\n        查询指定Thread下的Message列表\n        \n        Args:\n            thread_id (str): 线程ID。\n            limit (int, optional): 返回消息的最大数量，取值范围为[1,20]。默认为-20。\n            order (Optional[str], optional): 排序方式，可选值为\"asc\"或\"desc\"。默认为\"desc\"。\n            after (Optional[str], optional): 查询指定message_id之后创建的Message。\n            before (Optional[str], optional): 查询指定message_id之前创建的Message\n            \n        Returns:\n            thread_type.AssistantMessageListResponse: 查询thread下的message列表响应对象。\n            \n        Raises:\n            HttpError: 如果请求失败，则抛出HttpError异常。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/messages/list\")\n        \n        req = thread_type.AssistantMessageListRequest(\n            thread_id = thread_id,\n            limit = limit,\n            order = order,\n            after = after,\n            before = before\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        response = thread_type.AssistantMessageListResponse(**data)\n        return response \n    \n    @assistent_tool_trace\n    def query(self,\n            thread_id:str,\n            message_id:str) -> thread_type.AssistantMessageQueryResponse:\n        \"\"\"\n        根据message_id查询指定Message的信息\n        \n        Args:\n            thread_id (str): 线程ID\n            message_id (str): 消息ID\n        \n        Returns:\n            thread_type.AssistantMessageQueryResponse: 消息信息响应\n            \n        Raises:\n            HttpError: 如果请求失败，则抛出HttpError异常。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/messages/query\")\n        req = thread_type.AssistantMessageQueryRequest(\n            thread_id = thread_id,\n            message_id = message_id\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        response = thread_type.AssistantMessageQueryResponse(**data)\n        return response  \n    \n    @assistent_tool_trace\n    def files(self,\n              thread_id:str,\n              message_id:str,\n              limit:Optional[int] =  20,\n              order:Optional[str] = \"desc\",\n              after:Optional[str] = \"\",\n              before:Optional[str] = \"\") -> thread_type.AssistantMessageFilesResponse:\n        \"\"\"\n        获取指定消息 ID 的附件信息。\n        \n        Args:\n            thread_id (str): 线程 ID。\n            messsages_id (str): 消息 ID。\n            limit (Optional[int], optional): 返回结果的最大数量，默认为 20。\n            order (Optional[str], optional): 排序方式，可选值为 \"asc\" 或 \"desc\"，默认为 \"desc\"。\n            after (Optional[str], optional): 返回结果的时间范围，只返回时间晚于该时间戳的消息附件，默认为空。\n            before (Optional[str], optional): 返回结果的时间范围，只返回时间早于该时间戳的消息附件，默认为空。\n        \n        Returns:\n            thread_type.AssistantMessageFilesResponse: 附件信息响应对象。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/messages/files/list\")\n        \n        req = thread_type.AssistantMessageFilesRequest(\n            thread_id = thread_id, \n            message_id = message_id,\n            limit = limit,\n            order = order,\n            after = after,\n            before = before\n        )\n        \n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        response = thread_type.AssistantMessageFilesResponse(**data)\n        return response \n"
  },
  {
    "path": "python/core/assistant/threads/runs/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .runs import (\n    Runs\n)\n\nfrom .steps import (\n    Steps,\n)\n\nfrom .stream_helper import (\n    StreamRunContext,\n    AssistantEventHandler,\n    AssistantStreamManager,\n)\n\n__all__ = [\n    'Runs',\n    'Steps',\n    'StreamRunContext',\n    'AssistantEventHandler',\n    'AssistantStreamManager'\n]"
  },
  {
    "path": "python/core/assistant/threads/runs/runs.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport json\nfrom typing import Optional, Union\nfrom appbuilder.core.assistant.threads.runs.steps import Steps\nfrom appbuilder.core.assistant.threads.runs.stream_helper import AssistantStreamManager\nfrom appbuilder.core.assistant.threads.runs.stream_helper import AssistantEventHandler\nfrom appbuilder.core.assistant.type import thread_type\nfrom appbuilder.core.assistant.type import assistant_type\nfrom appbuilder.core.assistant.type import public_type\nfrom appbuilder.core._client import AssistantHTTPClient\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.utils.trace.tracer_wrapper import assistent_tool_trace, assistant_run_trace, assistent_stream_run_trace, assistent_stream_run_with_handler_trace\n\n\n\nclass Runs():\n    def __init__(self) -> None:\n        self._http_client = AssistantHTTPClient()\n\n    @property\n    def steps(self) -> Steps:\n        \"\"\"\n        返回步骤对象\n        \n        Args:\n            无\n        \n        Returns:\n            Steps: 返回一个新的Steps对象\n        \n        \"\"\"\n        return Steps()\n    \n    @assistant_run_trace\n    def run(self,\n            assistant_id: str,\n            thread_id: Optional[str] = \"\",\n            thread: Optional[thread_type.AssistantThread] = None,\n            model: Optional[str] = None,\n            response_format: Optional[str] = \"text\",\n            instructions: Optional[str] = None,\n            thought_instructions: Optional[str] = None,\n            chat_instructions: Optional[str] = None,\n            tools: Optional[list[assistant_type.AssistantTool]] = [],\n            metadata: Optional[dict] = {},\n            tool_output: Optional[thread_type.ToolOutput] = None,\n            model_parameters: Optional[public_type.AssistantModelParameters] = None,\n            user_info: Optional[public_type.AssistantUserInfo] = None,\n            user_loc: Optional[public_type.AssistantUserLoc] = None,\n            ) -> thread_type.RunResult:\n        \"\"\"\n        Args:\n            assistant_id (str): 助手id\n            thread_id (Optional[str], optional): 对话id. Defaults to \"\".\n            thread (Optional[thread_type.AssistantThread], optional): 对话信息. Defaults to None.\n            model (Optional[str], optional): 模型名称. Defaults to None.\n            response_format (Optional[str], optional): 返回格式. Defaults to \"text\".\n            instructions (Optional[str], optional): 指令信息. Defaults to None.\n            thought_instructions (Optional[str], optional): 思考指令信息. Defaults to None.\n            chat_instructions (Optional[str], optional): 闲聊指令信息. Defaults to None.\n            tools (Optional[list[assistant_type.AssistantTool]], optional): 工具列表. Defaults to [].\n            metadata (Optional[dict], optional): 元数据. Defaults to {}.\n            tool_output (Optional[thread_type.ToolOutput], optional): 工具输出. Defaults to None.\n            model_parameters (Optional[public_type.AssistantModelParameters], optional): 模型运行参数. Defaults to None.\n            user_info (Optional[public_type.AssistantUserInfo], optional): 用户身份信息. Defaults to None.\n            user_loc (Optional[public_type.AssistantUserLoc], optional): 用户定位信息. Defaults to None.\n        Returns:\n            thread_type.RunResult: 运行结果\n\n        Raises:\n            ValueError: thread_id和thread不能同时为空,model_parameters的各个参数不在规定范围内\n\n        Note:\n            1. 如果thread_id没有传，则thread必须要传值\n            2. 如果这里不传值，thread_id查出来的历史对话，最后一条消息的role必须为user\n            3. 如果这里传值，则需要保证thread_id查出来的历史对话 + 本轮追加的thread对话，最后一条消息的role必须为user\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/runs\")\n\n        if thread_id == \"\" and thread is None:\n            raise ValueError(\"Runs().run() argument thread_id && thread can't be empty at the same time\")\n        \n        if model_parameters:\n            chat_temperature = model_parameters.chat_parameters.temperature\n            chat_top_p = model_parameters.chat_parameters.top_p\n            chat_penalty_score = model_parameters.chat_parameters.penalty_score\n            thought_temperature = model_parameters.thought_parameters.temperature\n            thought_top_p = model_parameters.thought_parameters.top_p\n            thought_penalty_score = model_parameters.thought_parameters.penalty_score\n\n            if chat_temperature < 0 or chat_temperature > 1 or thought_temperature < 0 or thought_temperature > 1:\n                raise ValueError(\"chat_temperature and thought_temperature must be in range [0, 1]\")\n            if chat_top_p < 0 or chat_top_p > 1 or thought_top_p < 0 or thought_top_p > 1:\n                raise ValueError(\"chat_top_p and thought_top_p must be in range [0, 1]\")\n            if chat_penalty_score < 1 or chat_penalty_score > 2 or thought_penalty_score < 1 or thought_penalty_score > 2:\n                raise ValueError(\"chat_penalty_score and thought_penalty_score must be in range [1, 2]\")\n            \n        req = thread_type.AssistantRunRequest(\n            thread_id=thread_id,\n            thread=thread,\n            model=model,\n            assistant_id=assistant_id,\n            response_format=response_format,\n            instructions=instructions,\n            thought_instructions=thought_instructions,\n            chat_instructions=chat_instructions,\n            model_parameters = model_parameters,\n            stream=False,\n            tools=tools,\n            metadata=metadata,\n            tool_output=tool_output,\n            user_info=user_info,\n            user_loc=user_loc\n        )\n\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        resp = thread_type.RunResult(**data)\n        return resp\n    \n\n    def _stream(self,\n                   assistant_id: str,\n                   thread_id: Optional[str] = \"\",\n                   thread: Optional[thread_type.AssistantThread] = None,\n                   model: Optional[str] = None,\n                   response_format: Optional[str] = \"text\",\n                   instructions: Optional[str] = None,\n                   thought_instructions: Optional[str] = None,\n                   chat_instructions: Optional[str] = None,\n                   tools: Optional[list[assistant_type.AssistantTool]] = [],\n                   metadata: Optional[dict] = {},\n                   tool_output: Optional[thread_type.ToolOutput] = None,\n                   model_parameters: Optional[public_type.AssistantModelParameters] = None,\n                   user_info: Optional[public_type.AssistantUserInfo] = None,\n                   user_loc: Optional[public_type.AssistantUserLoc] = None,\n                   ):\n        \"\"\"\n        启动一个流式运行的对话，用于处理对话流中的消息。\n        \n        Args:\n            assistant_id (str): 助理ID。\n            thread_id (Optional[str], optional): 线程ID，用于恢复历史对话。默认为空字符串。\n            thread (Optional[thread_type.AssistantThread], optional): 线程对象，用于恢复历史对话。默认为None。\n            model (Optional[str], optional): 使用的模型名称。默认为None。\n            response_format (Optional[str], optional): 响应格式，支持\"text\"和\"json\"两种格式。默认为\"text\"。\n            instructions (Optional[str], optional): 指令文本。默认为 None。\n            thought_instructions (Optional[str], optional): 思考指令文本。默认为 None。\n            chat_instructions (Optional[str], optional): 聊天指令文本。默认为 None。\n            tools (Optional[list[assistant_type.AssistantTool]], optional): 使用的工具列表。默认为空列表。\n            metadata (Optional[dict], optional): 元数据字典。默认为空字典。\n            tool_output (Optional[thread_type.ToolOutput], optional): 工具输出对象。默认为None。\n            model_parameters (Optional[public_type.AssistantModelParameters], optional): 模型运行参数. Defaults to None.\n        \n        Returns:\n            Iterator[thread_type.AssistantRunEvent]: 返回一个迭代器，用于遍历流式运行中的事件。\n        \n        Raises:\n            ValueError: 如果thread_id和thread参数同时为空，则会引发ValueError异常。model_parameters的各个参数不在规定范围内。\n        \n        Note:\n            1. 如果thread_id没有传，则thread必须要传值。\n            2. 如果这里不传值，thread_id查出来的历史对话，最后一条消息的role必须为user。\n            3. 如果这里传值，则需要保证thread_id查出来的历史对话 + 本轮追加的thread对话，最后一条消息的role必须为user。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/runs\")\n\n        \"\"\"\n        注意：\n            1. 若thread_id没有传，则thread必须要传值\n            2. 若这里不传值，thread_id查出来的历史对话，最后一条消息的role必须为user\n            3. 若这里传值，则需要保证thread_id查出来的历史对话 + 本轮追加的thread对话，最后一条消息的role必须为user\n        \"\"\"\n        if thread_id == \"\" and thread is None:\n            raise ValueError(\"Runs().run() argument thread_id and thread can't be empty at the same time\")\n        \n        if model_parameters:\n    \n            chat_temperature = model_parameters.chat_parameters.temperature\n            chat_top_p = model_parameters.chat_parameters.top_p\n            chat_penalty_score = model_parameters.chat_parameters.penalty_score\n            thought_temperature = model_parameters.thought_parameters.temperature\n            thought_top_p = model_parameters.thought_parameters.top_p\n            thought_penalty_score = model_parameters.thought_parameters.penalty_score\n\n            if chat_temperature < 0 or chat_temperature > 1 or thought_temperature < 0 or thought_temperature > 1:\n                raise ValueError(\"chat_temperature and thought_temperature must be in range [0, 1]\")\n            if chat_top_p < 0 or chat_top_p > 1 or thought_top_p < 0 or thought_top_p > 1:\n                raise ValueError(\"chat_top_p and thought_top_p must be in range [0, 1]\")\n            if chat_penalty_score < 1 or chat_penalty_score > 2 or thought_penalty_score < 1 or thought_penalty_score > 2:\n                raise ValueError(\"chat_penalty_score and thought_penalty_score must be in range [1, 2]\")\n\n        req = thread_type.AssistantRunRequest(\n            thread_id=thread_id,\n            thread=thread,\n            model=model,\n            assistant_id=assistant_id,\n            response_format=response_format,\n            instructions=instructions,\n            thought_instructions=thought_instructions,\n            chat_instructions=chat_instructions,\n            stream=True,\n            model_parameters=model_parameters,\n            tools=tools,\n            metadata=metadata,\n            tool_output=tool_output,\n            user_info=user_info,\n            user_loc=user_loc\n        )\n\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            stream=True,\n            timeout=None\n        )\n        return response\n\n    @assistent_stream_run_trace\n    def stream_run(self,\n                   assistant_id: str,\n                   thread_id: Optional[str] = \"\",\n                   thread: Optional[thread_type.AssistantThread] = None,\n                   model: Optional[str] = None,\n                   response_format: Optional[str] = \"text\",\n                   instructions: Optional[str] = None,\n                   thought_instructions: Optional[str] = None,\n                   chat_instructions: Optional[str] = None,\n                   tools: Optional[list[assistant_type.AssistantTool]] = [],\n                   metadata: Optional[dict] = {},\n                   tool_output: Optional[thread_type.ToolOutput] = None,\n                   model_parameters: Optional[public_type.AssistantModelParameters] = None,\n                   user_info: Optional[public_type.AssistantUserInfo] = None,\n                   user_loc: Optional[public_type.AssistantUserLoc] = None,\n                   ) -> Union[thread_type.StreamRunStatus, thread_type.StreamRunMessage, None]:\n        \"\"\"\n        启动一个流式运行的对话，用于处理对话流中的消息。\n\n        Args:\n            assistant_id (str): 助理ID。\n            thread_id (Optional[str], optional): 线程ID，用于恢复历史对话。默认为空字符串。\n            thread (Optional[thread_type.AssistantThread], optional): 线程对象，用于恢复历史对话。默认为None。\n            model (Optional[str], optional): 使用的模型名称。默认为None。\n            response_format (Optional[str], optional): 响应格式，支持\"text\"和\"json\"两种格式。默认为\"text\"。\n            instructions (Optional[str], optional): 指令文本。默认为 None。\n            thought_instructions (Optional[str], optional): 思考指令文本。默认为 None。\n            chat_instructions (Optional[str], optional): 聊天指令文本。默认为 None。\n            tools (Optional[list[assistant_type.AssistantTool]], optional): 使用的工具列表。默认为空列表。\n            metadata (Optional[dict], optional): 元数据字典。默认为空字典。\n            tool_output (Optional[thread_type.ToolOutput], optional): 工具输出对象。默认为None。\n            model_parameters (Optional[public_type.AssistantModelParameters], optional): 模型参数对象。默认为None。\n\n        Returns:\n            Union[thread_type.StreamRunStatus, thread_type.StreamRunMessage, None]: 返回一个迭代器，每次迭代返回一个处理结果对象，可能是 StreamRunStatus 或 StreamRunMessage。\n\n        Raises:\n            ValueError: 如果thread_id和thread参数同时为空，则会引发ValueError异常。\n\n        Note:\n            1. 如果thread_id没有传，则thread必须要传值。\n            2. 如果这里不传值，thread_id查出来的历史对话，最后一条消息的role必须为user。\n            3. 如果这里传值，则需要保证thread_id查出来的历史对话 + 本轮追加的thread对话，最后一条消息的role必须为user。\n        \"\"\"\n\n        response = self._stream(\n            assistant_id=assistant_id,\n            thread_id=thread_id,\n            thread=thread,\n            model=model,\n            response_format=response_format,\n            instructions=instructions,\n            thought_instructions=thought_instructions,\n            chat_instructions=chat_instructions,\n            model_parameters=model_parameters,\n            tools=tools,\n            metadata=metadata,\n            tool_output=tool_output,\n            user_info=user_info,\n            user_loc=user_loc\n        )\n        self._http_client.check_response_header(response)\n        sse_client = SSEClient(response)\n        return self._iterate_events(sse_client.events())\n\n    @assistent_stream_run_with_handler_trace\n    def stream_run_with_handler(self,\n                   assistant_id: str,\n                   thread_id: Optional[str] = \"\",\n                   thread: Optional[thread_type.AssistantThread] = None,\n                   model: Optional[str] = None,\n                   response_format: Optional[str] = \"text\",\n                   instructions: Optional[str] = None,\n                   thought_instructions: Optional[str] = None,\n                   chat_instructions: Optional[str] = None,\n                   tools: Optional[list[assistant_type.AssistantTool]] = [],\n                   metadata: Optional[dict] = {},\n                   tool_output: Optional[thread_type.ToolOutput] = None,\n                   event_handler: Optional[AssistantEventHandler] = None,\n                   model_parameters: Optional[public_type.AssistantModelParameters] = None,\n                   user_info: Optional[public_type.AssistantUserInfo] = None,\n                   user_loc: Optional[public_type.AssistantUserLoc] = None,\n                   ) -> AssistantStreamManager:\n        \"\"\"\n        使用带有事件处理器的流运行助手\n        \n        Args:\n            assistant_id (str): 助手的唯一标识符\n            thread_id (Optional[str], optional): 会话线程的标识符，默认为空字符串. 默认为 \"\".\n            thread (Optional[thread_type.AssistantThread], optional): 会话线程对象，默认为None. 默认为 None.\n            model (Optional[str], optional): 模型标识符，默认为None. 默认为 None.\n            response_format (Optional[str], optional): 响应格式，可选值为\"text\"或\"json\"，默认为\"text\". 默认为 \"text\".\n            instructions (Optional[str], optional): 主要指令，默认为空字符串. 默认为 None.\n            thought_instructions (Optional[str], optional): 思维指令，默认为空字符串. 默认为 None.\n            chat_instructions (Optional[str], optional): 聊天指令，默认为空字符串. 默认为 None.\n            tools (Optional[list[assistant_type.AssistantTool]], optional): 助手工具列表，默认为空列表. 默认为 [].\n            metadata (Optional[dict], optional): 元数据字典，默认为空字典. 默认为 {}.\n            tool_output (Optional[thread_type.ToolOutput], optional): 工具输出对象，默认为None. 默认为 None.\n            event_handler (Optional[AssistantEventHandler], optional): 事件处理器对象，默认为None. 默认为 None.\n            model_parameters (Optional[public_type.AssistantModelParameters], optional): 模型参数对象，默认为None. 默认为 None.\n            user_info (Optional[public_type.AssistantUserInfo], optional): 用户信息对象，默认为None. 默认为 None.\n            user_loc (Optional[public_type.AssistantUserLoc], optional): 用户位置信息对象，默认为None. 默认为 None.\n        \n        Returns:\n            AssistantStreamManager: 返回的流管理器对象\n        \n        Raises:\n            HTTPError: 如果HTTP响应状态码不为200，则抛出HTTPError异常\n        \n        \"\"\"\n        response = self._stream(\n            assistant_id=assistant_id,\n            thread_id=thread_id,\n            thread=thread,\n            model=model,\n            response_format=response_format,\n            instructions=instructions,\n            thought_instructions=thought_instructions,\n            chat_instructions=chat_instructions,\n            model_parameters=model_parameters,\n            tools=tools,\n            metadata=metadata,\n            tool_output=tool_output,\n            user_info=user_info,\n            user_loc=user_loc\n        )\n        self._http_client.check_response_header(response)\n\n        return AssistantStreamManager(\n            response=response,\n            event_handler=event_handler or AssistantEventHandler()\n        )\n\n    def _iterate_events(self, events):\n        \"\"\"\n        根据给定的事件列表，生成对应的事件处理结果\n\n        Args:\n            events (list): 事件列表，每个元素为一个包含 'event' 和 'data' 属性的字典对象\n\n        Returns:\n            generator: 返回一个生成器，每次迭代返回一个处理结果对象，可能是 StreamRunStatus 或 StreamRunMessage\n\n        \"\"\"\n        for event in events:\n            try:\n                event_class = event.event\n                if event_class == \"ping\":\n                    # TODO(chengmo): record ping event, add timeout func\n                    continue\n\n                data = event.data\n                if len(data) == 0:\n                    data = event.raw\n                data = json.loads(data)\n\n                if event_class == \"status\":\n                    result = thread_type.StreamRunStatus(**data)\n                elif event_class == \"message\":\n                    result = thread_type.StreamRunMessage(**data)\n\n            except Exception as e:\n                print(e)\n\n            yield result\n\n\n    @assistent_tool_trace\n    def submit_tool_outputs(self,\n                            run_id: str,\n                            thread_id: str,\n                            tool_outputs: Optional[list[thread_type.ToolOutput]]) -> thread_type.RunResult:\n        \"\"\"\n        向服务端提交工具输出\n\n        Args:\n            run_id (str): 运行ID\n            thread_id (str): 线程ID\n            tool_outputs (Optional[list[thread_type.ToolOutput]]): 工具输出列表，可选\n\n        Returns:\n            thread_type.RunResult: 运行结果\n\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\n            \"/v2/threads/runs/submit_tool_outputs\")\n\n        req = thread_type.AssistantSubmitToolOutputsRequest(\n            thread_id=thread_id,\n            run_id=run_id,\n            tool_outputs=tool_outputs\n        )\n\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        resp = thread_type.RunResult(**data)\n        return resp\n\n    @assistent_tool_trace\n    def cancel(self, run_id: str, thread_id: str, sync: bool = False) -> thread_type.RunResult:\n        \"\"\"\n        取消指定线程的运行\n        \n        Args:\n            run_id (str): 运行的ID\n            thread_id (str): 线程的ID\n            sync (bool, optional): 是否同步执行. 默认为False.\n        \n        Returns:\n            thread_type.RunResult: 取消运行的结果\n        \n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/runs/cancel\")\n\n        req = thread_type.AssistantRunCancelRequest(\n            run_id=run_id,\n            thread_id=thread_id,\n            sync = sync\n        )\n\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        resp = thread_type.RunResult(**data)\n        return resp\n\n    @assistent_tool_trace\n    def list(self, thread_id: str, limit: int = 20,\n             order: str = 'desc', after: str = \"\", before: str = \"\") -> thread_type.RunListResponse:\n        \"\"\"\n        列出对应thread的历史run记录\n        \n        Args:\n            thread_id (str): 线程ID\n            limit (int, optional): 列表数量限制，默认为20\n            order (str, optional): 排序方式，'asc'为升序，'desc'为降序，默认为'desc'\n            after (str, optional): 返回在指定时间之后的运行列表，默认为空字符串\n            before (str, optional): 返回在指定时间之前的运行列表，默认为空字符串\n        \n        Returns:\n            thread_type.RunListResponse: 列出对应thread的历史run记录\n        \n        Raises:\n            无\n        \n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/runs/list\")\n\n        req = thread_type.AssistantRunListRequest(\n            thread_id=thread_id,\n            limit=limit,\n            order=order,\n            after=after,\n            before=before\n        )\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        resp = thread_type.RunListResponse(**data)\n        return resp\n\n    @assistent_tool_trace\n    def query(self, thread_id: str, run_id: str) -> thread_type.RunResult:\n        \"\"\"\n        根据thread_id和run_id，查询run的详情\n        \n        Args:\n            thread_id (str): 线程ID。\n            run_id (str): 运行ID。\n        \n        Returns:\n            thread_type.RunResult: 查询到的运行结果。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/runs/query\")\n\n        req = thread_type.AssistantRunQueryRequest(\n            thread_id=thread_id,\n            run_id=run_id\n        )\n\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        resp = thread_type.RunResult(**data)\n        return resp\n    "
  },
  {
    "path": "python/core/assistant/threads/runs/steps.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport json\nfrom typing import Optional\nfrom appbuilder.core.assistant.type import thread_type\nfrom appbuilder.core.assistant.type import assistant_type\nfrom appbuilder.core._client import AssistantHTTPClient\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.utils.trace.tracer_wrapper import assistent_tool_trace\n\nclass Steps():\n    def __init__(self) -> None:\n        self._http_client = AssistantHTTPClient()\n\n    @assistent_tool_trace\n    def list(self, thread_id: str, run_id: str, limit: int = 20,\n                   order: str = 'desc', after: str = \"\", before: str = \"\") -> thread_type.RunStepListResponse:\n        \"\"\"\n        根据thread_id和run_id，列出对应run的历史step记录\n        \n        Args:\n            thread_id (str): 线程ID\n            run_id (str): 运行ID\n            limit (int, optional): 步骤数量限制，默认为20\n            order (str, optional): 排序方式，'asc'表示升序，'desc'表示降序，默认为'desc'\n            after (str, optional): 过滤出时间戳晚于此值的步骤，默认为空\n            before (str, optional): 过滤出时间戳早于此值的步骤，默认为空\n        \n        Returns:\n            thread_type.RunStepListResponse: 线程运行步骤列表的响应对象\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/runs/steps/list\")\n        req = thread_type.AssistantRunStepListRequest(\n            thread_id=thread_id,\n            run_id=run_id,\n            limit=limit,\n            order=order,\n            after=after,\n            before=before\n        )\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        resp = thread_type.RunStepListResponse(**data)\n        return resp\n\n    @assistent_tool_trace\n    def query(self, thread_id: str, run_id: str, step_id: str) -> thread_type.RunStepResult:\n        \"\"\"\n        根据thread_id，run_id和step_id，查询对应step的信息\n        \n        Args:\n            thread_id (str): 线程ID\n            run_id (str): 运行ID\n            step_id (str): 步骤ID\n        \n        Returns:\n            thread_type.RunStepResult: 步骤运行结果\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/runs/steps/query\")\n        req = thread_type.AssistantRunStepQueryRequest(\n            thread_id=thread_id,\n            run_id=run_id,\n            step_id=step_id\n        )\n        response = self._http_client.session.post(\n            url=url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        resp = thread_type.RunStepResult(**data)\n        return resp"
  },
  {
    "path": "python/core/assistant/threads/runs/stream_helper.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport json\nfrom typing import Optional, Iterator, Union\nfrom appbuilder.core.assistant.type import thread_type\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.utils.logger_util import logger\n\n\nclass StreamRunContext(object):\n    \"\"\"\n    StreamRunContext类用于管理和维护流式运行时的上下文信息。\n\n    这个类提供了存储和获取当前流事件、工具调用、运行ID、运行步骤ID、线程ID和助手ID等属性的功能。\n    通过创建StreamRunContext的实例，可以方便地跟踪和处理流式运行时的各种状态和数据。\n\n    Attributes:\n        current_event: 当前流事件的对象。\n        current_tool_calls: 当前工具调用的相关信息。\n        current_run_id: 当前运行的唯一标识符。\n        current_run_step_id: 当前运行步骤的唯一标识符。\n        current_thread_id: 当前线程的唯一标识符。\n        current_assistant_id: 当前助手的唯一标识符。\n\n    Note:\n        这个类通常作为其他流式处理类（如StreamProcessor、StreamHandler等）的组成部分，\n        用于在流式处理过程中传递和共享上下文信息。\n    \"\"\"\n\n    def __init__(self) -> None:\n        # 当前事件\n        self._current_event = None\n        # 当前工具调用\n        self._current_tool_calls = None\n        # 当前运行ID\n        self._current_run_id = None\n        # 当前运行步骤ID\n        self._current_run_step_id = None\n        # 当前线程ID\n        self._current_thread_id = None\n        # 当前助手ID\n        self._current_assistant_id = None\n\n    @property\n    def current_event(self) -> Union[thread_type.StreamRunStatus,\n                                     thread_type.StreamRunMessage,\n                                     None]:\n        \"\"\"\n        获取当前事件。\n        \n        Args:\n            无\n        \n        Returns:\n            Union[thread_type.StreamRunStatus, thread_type.StreamRunMessage, None]:\n                当前事件，可能为StreamRunStatus类型（表示流运行状态）、StreamRunMessage类型（表示流运行消息）或None。\n        \n        \"\"\"\n        return self._current_event\n\n    def set_current_event(self, event):\n        \"\"\"\n        设置当前事件\n        \n        Args:\n            event (thread_type.StreamRunStatus or thread_type.StreamRunMessage): 需要设置的事件对象\n        \n        Returns:\n            None\n        \n        Raises:\n            无\n        \n        \"\"\"\n        if isinstance(event, thread_type.StreamRunStatus) or \\\n                isinstance(event, thread_type.StreamRunMessage):\n            self._current_event = event\n        else:\n            self._current_event = None\n\n    @property\n    def current_tool_calls(self) -> Union[list[thread_type.ToolCall], None]:\n        \"\"\"\n        获取当前工具调用列表。\n        \n        Args:\n            无\n        \n        Returns:\n            Union[list[thread_type.ToolCall], None]: 如果存在当前工具调用列表，则返回该列表；否则返回None。\n        \n        \"\"\"\n        return self._current_tool_calls\n\n    def set_current_tool_calls(self, tool_calls):\n        \"\"\"\n        设置当前工具调用列表。\n        \n        Args:\n            tool_calls (list of thread_type.ToolCall): 工具调用列表。\n        \n        Returns:\n            None\n        \n        Raises:\n            AssertionError: 如果 tool_calls 不是 ToolCall 对象的列表。\n        \n        \"\"\"\n        if isinstance(tool_calls, list) and len(tool_calls) > 0:\n            for call in tool_calls:\n                assert isinstance(call, thread_type.ToolCall), \\\n                    \"current_tool_calls should be a list of ToolCall object.\"\n            self._current_tool_calls = tool_calls\n        else:\n            self._current_tool_calls = None\n\n    @property\n    def current_run_id(self) -> Union[str, None]:\n        \"\"\"\n        获取当前运行的ID。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            str 或 None: 返回当前运行的ID，如果没有当前运行的ID，则返回None。\n        \n        \"\"\"\n        return self._current_run_id\n\n    def set_current_run_id(self, run_id):\n        \"\"\"\n        设置当前运行ID。\n        \n        Args:\n            run_id (str): 运行ID字符串。\n        \n        Returns:\n            None\n        \n        Raises:\n            无\n        \n        注意事项:\n            如果传入的run_id不是字符串类型或长度为0，则不设置当前运行ID，将其设置为None。\n        \"\"\"\n        if isinstance(run_id, str) and len(run_id) > 0:\n            self._current_run_id = run_id\n        else:\n            self._current_run_id = None\n\n    @property\n    def current_run_step_id(self) -> Union[str, None]:\n        \"\"\"\n        获取当前运行的步骤ID。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            Union[str, None]: 当前运行的步骤ID，如果没有运行任何步骤则返回None。\n        \n        \"\"\"\n        return self._current_run_step_id\n\n    def set_current_run_step_id(self, run_step_id):\n        \"\"\"\n        设置当前运行步骤的ID。\n        \n        Args:\n            run_step_id (str): 需要设置的运行步骤ID。\n        \n        Returns:\n            None\n        \n        Raises:\n            无\n        \n        Note:\n            如果传入的run_step_id是一个非空字符串，则将其设置为当前运行步骤的ID；\n            否则，将当前运行步骤的ID设置为None。\n        \"\"\"\n        if isinstance(run_step_id, str) and len(run_step_id) > 0:\n            self._current_run_step_id = run_step_id\n        else:\n            self._current_run_step_id = None\n\n    @property\n    def current_thread_id(self) -> Union[str, None]:\n        \"\"\"\n        获取当前线程的ID。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            Union[str, None]: 当前线程的ID，如果当前没有线程ID则返回None。\n        \n        \"\"\"\n        return self._current_thread_id\n\n    def set_current_thread_id(self, thread_id):\n        \"\"\"\n        设置当前线程的ID。\n        \n        Args:\n            thread_id (str): 要设置的线程ID。\n        \n        Returns:\n            None\n        \n        Raises:\n            无\n        \n        Note:\n            如果thread_id不是字符串类型或者长度为0，则不会设置当前线程的ID，并将其设置为None。\n        \"\"\"\n        if isinstance(thread_id, str) and len(thread_id) > 0:\n            self._current_thread_id = thread_id\n        else:\n            self._current_thread_id = None\n\n    @property\n    def current_assistant_id(self) -> Union[str, None]:\n        \"\"\"\n        获取当前助手ID。\n        \n        Args:\n            无\n        \n        Returns:\n            Union[str, None]: 返回当前助手ID的字符串，如果未设置则返回None。\n        \n        \"\"\"\n        return self._current_assistant_id\n\n    def set_current_assistant_id(self, assistant_id):\n        \"\"\"\n        设置当前助手ID。\n        \n        Args:\n            assistant_id (str): 需要设置的助手ID。\n        \n        Returns:\n            None\n        \n        Raises:\n            无\n        \n        Note:\n            如果输入的assistant_id是有效的字符串且长度大于0，则将其设置为当前助手ID；否则，将当前助手ID设置为None。\n        \"\"\"\n        if isinstance(assistant_id, str) and len(assistant_id) > 0:\n            self._current_assistant_id = assistant_id\n        else:\n            self._current_assistant_id = None\n\n    def reset_step_context(self):\n        \"\"\"\n        重置步骤上下文。\n        \n        Args:\n            无\n        \n        Returns:\n            无\n        \n        \"\"\"\n        self._current_tool_calls = None\n        self._current_run_step_id = None\n        self._current_event = None\n\n\nclass AssistantEventHandler():\n    \"\"\"\n    AssistantEventHandler类用于处理Assistant流式返回的相关事件。\n\n    这个类作为Assistant流式事件的处理中心，负责接收和处理来自Assistant的各种事件，\n    如用户交互、数据更新、状态变化等。通过实现不同的事件处理方法，\n    可以定义Assistant在不同事件下的行为逻辑。\n\n    Assistant事件处理程序通常与具体的Assistant实例相关联，用于管理和控制Assistant的运行流程，\n    以及与其他系统组件的交互。\n\n    该类包含多个方法，每个方法对应一种特定事件的处理逻辑。\n    当相应的事件发生时，Assistant或相关系统会调用这些方法，以执行预定义的操作。\n\n    通过继承AssistantEventHandler类并重写其方法，可以实现自定义的Assistant流式事件处理逻辑，\n    从而满足特定的业务需求。\n    \"\"\"\n\n    def _init(self, response):\n        self._response = response\n        self._sse_client = SSEClient(response)\n        self._event_stream = self._sse_client.events()\n        self._iterator = self.__stream__()\n        self.stream_run_context = StreamRunContext()\n\n    def __stream__(self) -> Iterator[Union[\n            thread_type.StreamRunStatus, thread_type.StreamRunMessage, str]]:\n        \"\"\"\n        获取流数据的迭代器，用于从事件流中读取并处理事件数据。\n\n        Args:\n            无参数。\n\n        Returns:\n            返回一个迭代器，每次迭代返回一个Union[StreamRunStatus, StreamRunMessage, str]类型的值。\n            StreamRunStatus类型表示流运行状态，StreamRunMessage类型表示流运行消息，str类型表示异常信息。\n\n        Raises:\n            流式运行过程中的任何异常都会在此抛出\n        \"\"\"\n        try:\n            for event in self._event_stream:\n                self.stream_run_context.reset_step_context()\n                process_res = self.__stream_event_process__(event)\n                yield process_res\n        except Exception as e:\n            logger.info(e)\n\n    def __stream_event_process__(self, event) -> Union[\n            thread_type.StreamRunStatus, thread_type.StreamRunMessage, dict]:\n        \"\"\"\n        处理从stream收到的event\n\n        Args:\n            event (thread_type.StreamEvent): 从stream收到的event对象\n\n        Returns:\n            Union[thread_type.StreamRunStatus, thread_type.StreamRunMessage, dict]:\n                根据event的类型，返回相应的StreamRunStatus、StreamRunMessage对象或原始数据字典\n\n        \"\"\"\n        event_type = event.event\n        raw_data = event.data\n        if len(raw_data) == 0:\n            raw_data = event.raw\n\n        if event_type == 'ping':\n            self.__timeout_process__(event)\n        elif event_type == 'message':\n            data = json.loads(raw_data)\n            stream_run_message = thread_type.StreamRunMessage(**data)\n            self.stream_run_context.set_current_event(stream_run_message)\n            self.messages(stream_run_message)\n            return stream_run_message\n        elif event_type == 'status':\n            data = json.loads(raw_data)\n            stream_run_status = thread_type.StreamRunStatus(**data)\n            self.stream_run_context.set_current_event(stream_run_status)\n\n            # stream内置的handler，用于设置stream_context，不建议用户重载\n            context_func_map = {\n                \"tool_calls\": self._before_tool_calls,\n                \"run_begin\": self._before_run_begin,\n                \"tool_step_begin\": self._before_tool_step,\n                \"tool_step_end\": self._before_tool_step,\n            }\n            if stream_run_status.event_type in context_func_map:\n                context_func = context_func_map[stream_run_status.event_type]\n                context_func(stream_run_status)\n\n            # 用户可以自定义的handler\n            type_handler_func_map = {\n                \"run_begin\": self.run_begin,\n                \"run_end\": self.run_end,\n                \"tool_step_begin\": self.tool_step_begin,\n                \"tool_step_end\": self.tool_step_end,\n                \"run_cancelling\": self.run_cancelling,\n                \"tool_calls\": self.tool_calls,\n                \"message_creation\": self.message_creation,\n                \"tool_submitted_output\": self.tool_submitted_output\n            }\n\n            if stream_run_status.event_type in type_handler_func_map:\n                status_handler_func = type_handler_func_map[stream_run_status.event_type]\n                status_handler_func(stream_run_status)\n            else:\n                logger.warning(\n                    f\"Unknown status: {stream_run_status.event_type}, \"\n                    f\"data: {stream_run_status}\"\n                )\n            return stream_run_status\n\n        return raw_data\n\n    def __timeout_process__(self, event):\n        # TODO(chengmo): record ping event, add timeout func\n        pass\n\n    def __next__(self) -> Optional[str]:\n        return self._iterator.__next__()\n\n    def __iter__(self):\n        for item in self._iterator:\n            yield item\n\n    def until_done(self):\n        \"\"\"\n        直到迭代器结束为止，持续迭代。\n        \n        Args:\n            无\n        \n        Returns:\n            无\n        \n        Raises:\n            无\n        \n        \"\"\"\n        for _ in self._iterator:\n            ...\n\n    def _before_run_begin(self, stream_run_status):\n        self.stream_run_context.set_current_run_id(\n            stream_run_status.details.run_object.id)\n        self.stream_run_context.set_current_assistant_id(\n            stream_run_status.details.run_object.assistant_id)\n        self.stream_run_context.set_current_thread_id(\n            stream_run_status.details.run_object.thread_id)\n\n    def _before_tool_calls(self, stream_run_status):\n        self.stream_run_context.set_current_tool_calls(\n            stream_run_status.details.tool_calls)\n\n    def _before_tool_step(self, stream_run_status):\n        self.stream_run_context.set_current_run_step_id(\n            stream_run_status.details.run_step_object.id)\n\n    def messages(self, messages_event: thread_type.StreamRunMessage):\n        \"\"\"\n        当触发 messages 打印事件时回调此函数。\n        \n        Args:\n            messages_event (thread_type.StreamRunMessage): 包含消息内容的事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的消息处理逻辑。\n        \"\"\"\n        pass\n\n    def tool_calls(self, status_event: thread_type.StreamRunStatus):\n        \"\"\"\n        当触发 tool_calls 事件时回调此函数。\n        \n        Args:\n            status_event (thread_type.StreamRunStatus): 工具调用状态事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的工具调用处理逻辑。\n        \"\"\"\n        pass\n\n    def tool_submitted_output(self, status_event: thread_type.StreamRunStatus):\n        \"\"\"\n        当触发 tool_submitted_output 事件时回调此函数。\n        \n        Args:\n            status_event (thread_type.StreamRunStatus): 工具提交输出状态事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的工具输出处理逻辑。\n        \"\"\"\n        pass\n\n    def message_creation(self, status_event: thread_type.StreamRunStatus):\n        \"\"\"\n        当触发 message_creation 事件时回调此函数。\n        \n        Args:\n            status_event (thread_type.StreamRunStatus): 消息创建状态事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的消息创建处理逻辑。\n        \"\"\"\n        pass\n\n    def run_begin(self, status_event: thread_type.StreamRunStatus):\n        \"\"\"\n        当触发 run_begin 事件时回调此函数。\n        \n        Args:\n            status_event (thread_type.StreamRunStatus): 运行开始状态事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的运行开始处理逻辑。\n        \"\"\"\n        pass\n\n    def run_end(self, status_event: thread_type.StreamRunStatus):\n        \"\"\"\n        当触发 run_end 事件时回调此函数。\n        \n        Args:\n            status_event (thread_type.StreamRunStatus): 运行结束状态事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的运行结束处理逻辑。\n        \"\"\"\n        pass\n\n    def tool_step_begin(self, status_event: thread_type.StreamRunStatus):\n        \"\"\"\n        当触发 tool_step_begin 事件时回调此函数。\n        \n        Args:\n            status_event (thread_type.StreamRunStatus): 工具步骤开始状态事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的工具步骤开始处理逻辑。\n        \"\"\"\n        pass\n\n    def tool_step_end(self, status_event: thread_type.StreamRunStatus):\n        \"\"\"\n        当触发 tool_step_end 事件时回调此函数。\n        \n        Args:\n            status_event (thread_type.StreamRunStatus): 工具步骤结束状态事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的工具步骤结束处理逻辑。\n        \"\"\"\n        pass\n\n    def run_cancelling(self, status_event: thread_type.StreamRunStatus):\n        \"\"\"\n        当触发 run_cancelling 事件时回调此函数。\n        \n        Args:\n            status_event (thread_type.StreamRunStatus): 运行取消状态事件对象\n        \n        Returns:\n            None\n        \n        Note:\n            用户可以重载此函数，实现自定义的运行取消处理逻辑。\n        \"\"\"\n        pass\n\n\nclass AssistantStreamManager(AssistantEventHandler):\n    def __init__(\n        self,\n        response,\n        event_handler: AssistantEventHandler,\n    ) -> None:\n        self._response = response\n        self._event_handler = event_handler\n        self._event_handler._init(self._response)\n\n    def __enter__(self) -> AssistantEventHandler:\n        return self._event_handler\n\n    def __exit__(self, exc_type, exc_value, traceback) -> None:\n        pass\n"
  },
  {
    "path": "python/core/assistant/threads/threads.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nfrom typing import Optional\nfrom appbuilder.core.assistant.type import thread_type\nfrom appbuilder.core.assistant.threads.messages import Messages\nfrom appbuilder.core.assistant.threads.runs import Runs\nfrom appbuilder.core._client import AssistantHTTPClient\nfrom appbuilder.utils.trace.tracer_wrapper import assistent_tool_trace\nclass Threads():\n    def __init__(self) -> None:\n        self._http_client = AssistantHTTPClient()\n\n    @property\n    def messages(self) -> Messages:\n        \"\"\"\n        获取消息实例\n        \n        Args:\n            无\n        \n        Returns:\n            Messages: 返回Messages实例\n        \n        \"\"\"\n        return Messages()\n    \n    @property\n    def runs(self) -> Runs:\n        \"\"\"\n        返回Runs对象。\n        \n        Args:\n            无\n        \n        Returns:\n            Runs: 一个Runs对象实例。\n        \"\"\"\n        return Runs()\n\n    @assistent_tool_trace\n    def create(self, messages: Optional[list[thread_type.AssistantMessage]] = []) -> thread_type.ThreadCreateResponse:\n        \"\"\"\n        创建一个新的对话线程。\n        \n        Args:\n            messages: 要发送给助手的消息列表。如果不传入此参数，则会创建一个空对话线程。\n        \n        Returns:\n            一个ThreadCreateResponse对象，包含新创建的线程的相关信息。\n        \n        Raises:\n            ValueError: 如果传入的messages参数不是列表类型。\n        \n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads\")\n        \n        if  not isinstance(messages, list):\n            raise ValueError(\"Threads().create() messages must be a list, but got: {}\".format(messages))\n\n        req = thread_type.ThreadCreateRequest(\n            messages=messages)\n\n        response =self._http_client.session.post(\n            url = url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n\n        response = thread_type.ThreadCreateResponse(**data)\n        return response\n    \n    @assistent_tool_trace\n    def query(self,\n              thread_id:str)->thread_type.ThreadQueryResponse:\n        \"\"\"\n        查询对话线程信息。\n\n        Args:\n            thread_id: 要查询的对话线程ID。\n\n        Returns:\n            一个ThreadQueryResponse对象，包含对话线程的相关信息。\n            \n        Raises:\n            ValueError: 如果传入的thread_id参数不是字符串类型。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/query\")\n        \n        req = thread_type.ThreadQueryRequest(\n            thread_id=thread_id)\n\n        response =self._http_client.session.post(\n            url = url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        response = thread_type.ThreadQueryResponse(**data)\n        return response\n    \n    @assistent_tool_trace\n    def delete(self,\n               thread_id:str)->thread_type.ThreadDeleteResponse:\n        \"\"\"\n        删除对话线程。\n        Args:\n            thread_id: 要删除的对话线程ID。\n        Returns:\n            一个ThreadDeleteResponse对象，包含对话线程的相关信息。\n        Raises:\n            ValueError: 如果传入的thread_id参数不是字符串类型。\n        \"\"\"\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/delete\")\n        \n        req = thread_type.ThreadDeleteRequest(\n            thread_id=thread_id)\n\n        response =self._http_client.session.post(\n            url = url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        response = thread_type.ThreadDeleteResponse(**data)\n        return response\n    \n    @assistent_tool_trace\n    def update(self,\n               thread_id:str ,\n               metadata:Optional[dict] ={} )->thread_type.ThreadUpdateResponse:\n        \"\"\"\n        更新线程信息\n        \n        Args:\n            thread_id (str): 线程ID\n            metadata (Optional[dict], optional): 线程元数据. 默认为空字典.\n        \n        Returns:\n            thread_type.ThreadUpdateResponse: 线程更新响应\n        \n        Raises:\n            TypeError: 如果metadata不是字典类型\n            ValueError: 如果metadata的键超过64个字符或值超过512个字符\n        \"\"\"\n        if not isinstance(metadata, dict):\n            raise TypeError(\"Threads().update() metadata must be a dict, but got: {}\".format(type(metadata)))\n        for key,value in metadata.items():\n            if len(key)>64:\n                raise ValueError(\"Threads().update() metadata key must be less than 64, but got: {}\".format(len(key)))\n            if len(value)>512:\n                raise ValueError(\"Threads().update() metadata value must be less than 512, but got: {}\".format(len(value)))\n        headers = self._http_client.auth_header()\n        url = self._http_client.service_url(\"/v2/threads/update\")\n        \n        req = thread_type.ThreadUpdateRequest(\n            thread_id=thread_id)\n\n        response =self._http_client.session.post(\n            url = url,\n            headers=headers,\n            json=req.model_dump(),\n            timeout=None\n        )\n        self._http_client.check_response_header(response)\n\n        data = response.json()\n        request_id = self._http_client.response_request_id(response)\n        self._http_client.check_assistant_response(request_id, data)\n        response = thread_type.ThreadUpdateResponse(**data)\n        return response"
  },
  {
    "path": "python/core/assistant/type/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .public_type import (\n    AssistantFunctionCall,\n    AssistantExample,\n    AssistantFunctionJsonSchema,\n    AssistantFunction,\n    AssistantTool,\n    ResponseFormat,\n    AssistantText,\n    AssistantContent,\n    AssistantChatParameters,\n    AssistantThoughtParameters,\n    AssistantModelParameters,\n    AssistantUserInfo,\n    AssistantUserLoc,\n)\n\n\nfrom .assistant_type import (\n    # AssitantFileInfo,\n    # AssistantAnnotation,\n    AssistantFilesCreateResponse,\n    AssistantCreateRequest,\n    AssistantCreateResponse,\n    AuditStatus,\n    AssistantFilesListData,\n    AssistantFilesListResponse,\n    AssistantFilesQueryResponse,\n    AssistantFilesDeleteResponse,\n    AssistantUpdateRequest,\n    AssistantUpdateResponse,\n    AssistantListRole,\n    AssistantListRequest,\n    AssistantListResponse,\n    AssistantQueryRequest,\n    AssistantQueryResponse,\n    AssistantDeleteRequest,\n    AssistantDeleteResponse,\n    AssistantFilesRequest,\n    AssistantFilesResponse,\n    AssistantMountedFilesListRequest,\n    AssistantMountedFilesListResponse,\n    AssistantFilesDeleteRequest,\n    AssistantFilesContentResponse\n)\n\n\nfrom .thread_type import (\n    AssistantMessageRole,\n    AssistantMessage,\n    AssistantMessageCreateRequest,\n    AssistantMessageCreateResponse,\n    AssistantThread,\n    ThreadCreateResponse,\n    ThreadCreateRequest,\n    AssistantThread,\n    RunActionInfo,\n    FunctionCall,\n    ToolCall,\n    SubmitToolOutput,\n    RequiredAction,\n    LastError,\n    FinalAnswerMessage,\n    FinalAnswer,\n    RunResult,\n    RunMessageCreation,\n    ToolInfo,\n    RunStepDetail,\n    RunStepResult,\n    StreamRunDetail,\n    StreamRunStatus,\n    StreamRunMessage,\n    ToolOutput,\n    AssistantRunRequest,\n    AssistantSubmitToolOutputsRequest,\n    AssistantRunCancelRequest,\n    AssistantMessageListRole,\n    AssistantMessageListRequest,\n    AssistantMessageListResponse,\n    AssistantMessageListResponseData,\n    AssistantMessageQueryRequest,\n    AssistantMessageQueryResponse,\n    AssistantMessageUpdateRequest,\n    AssistantMessageUpdateResponse,\n    AssistantMessageFilesRequest,\n    AssistantMessageFilesResponse,\n    AssistantContentFilesData,\n    ThreadQueryRequest,\n    ThreadQueryResponse,\n    ThreadDeleteRequest,\n    ThreadDeleteResponse,\n    ThreadUpdateResponse,\n    AssistantThread\n)\n"
  },
  {
    "path": "python/core/assistant/type/assistant_type.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom pydantic import BaseModel\nfrom pydantic import Field\nfrom typing import Optional\nfrom enum import Enum\nfrom appbuilder.core.assistant.type import (\n    AssistantTool,\n    ResponseFormat\n)\n\n# AssistantFilesCreateResponse类，用于描述创建助理文件后的响应信息\nclass AssistantFilesCreateResponse(BaseModel):\n    id: str = \"\"  # 文件ID\n    bytes: int = 0  # 文件大小（字节）\n    object: str = \"\"  # 文件对象标识\n    purpose: str = \"\"  # 文件用途\n    create_at: int = 0  # 文件创建时间戳\n    filename: str = \"\"  # 文件名\n    classification_id: str = \"\"  # 文件分类ID\n    \nclass AuditStatus(int,Enum):\n    AUDITING = -1, # 审核中 \n    NOT_AUDITED = 0, # 未审核\n    APPROVED = 1, # 审核通过\n    REJECTED = 2, # 审核不通过\n    NEEDS_FURTHER_AUDIT = 3, # 需要进一步审核\n    AUDIT_FAILED_SERVICE_EXCEPTION = 4, # 审核失败（服务异常）\n    AUDIT_FAILED_TIMEOUT = 5, # 审核失败（审核超时）\n\n\nclass AssistantFilesListData(BaseModel):\n    id: str = \"\"  # 文件ID\n    bytes: int = 0  # 文件大小（字节）\n    object: str = \"\"  # 文件对象标识\n    purpose: str = \"\"  # 文件用途\n    censored :AuditStatus = Field()  # 审核状态\n    create_at: int = 0  # 文件创建时间戳\n    filename: str = \"\"  # 文件名\n    classification_id: str = \"\"  # 文件分类ID\n    file_type: str = \"\" # 文件类型\n    \n\nclass AssistantFilesListResponse(BaseModel):\n    object :str = \"list\"\n    data: list[AssistantFilesListData] = []\n    \n\nclass AssistantFilesQueryResponse(BaseModel):\n    id: str = \"\"  # 文件ID\n    bytes: int = 0  # 文件大小（字节）\n    object: str = \"\"  # 文件对象标识\n    purpose: str = \"\"  # 文件用途\n    censored :AuditStatus = Field()  # 审核状态\n    create_at: int = 0  # 文件创建时间戳\n    filename: str = \"\"  # 文件名\n    classification_id: str = \"\"  # 文件分类ID\n    file_type: str = \"\" # 文件类型\n    \nclass AssistantFilesDeleteResponse(BaseModel):\n    id: str = \"\"  # 文件ID\n    object: str = \"\"  # 文件对象标识\n    deleted: bool = False  # 是否删除成功\t\n\n# AssistantCreateRequest类，用于描述创建助理的请求参数\nclass AssistantCreateRequest(BaseModel):\n    model: str = Field(default=\"ERNIE-4.0T-8K\")  # 使用的模型\n    name: str = Field(default=\"\", min_length=1, max_length=128, pattern=\"^[\\u4e00-\\u9fa50-9a-zA-Z_-]+$\")  # 助理名称\n    description: str = Field(default=\"\", max_length=512)  # 助理描述\n    response_format: ResponseFormat = Field(default=ResponseFormat.TEXT)  # 响应格式\n    instructions: str = Field(default=\"你是百度制作的AI助手\", max_length=4096)  # 助理的通用指令\n    thought_instructions: str = Field(default=\"\", max_length=4096)  # 助理的思维指令\n    chat_instructions: str = Field(default=\"\", max_length=4096)  # 助理的聊天指令\n    tools: list[AssistantTool] = Field(default=[], max_length=10)  # 助理使用的工具列表\n    file_ids: list[str] = Field(default=[], max_length=10)  # 关联文件的ID列表\n    metadata: dict = Field(default={}, max_length=16)  # 元数据\n\n\n# AssistantCreateResponse类，用于描述创建助理后的响应信息\nclass AssistantCreateResponse(BaseModel):\n    id: Optional[str] = \"\"  # 助理ID\n    object: Optional[str] = \"\"  # 助理对象标识\n    name: Optional[str] = \"\"  # 助理名称\n    description: Optional[str] = \"\"  # 助理描述\n    instructions: Optional[str]  # 助理的通用指令\n    tools: Optional[list[AssistantTool]] = Field(default=[])  # 助理使用的工具列表\n    created_at: Optional[int] = 0  # 助理创建时间戳\n    thought_instructions: Optional[str] = \"\"  # 助理的思维指令\n    chat_instructions: Optional[str] = \"\"  # 助理的聊天指令\n    response_format: Optional[ResponseFormat] = Field(default=ResponseFormat.TEXT)  # 响应格式\n    file_ids: Optional[list[str]] = Field(default=[])  # 关联文件的ID列表\n    metadata: Optional[dict] = Field(default={}, max_length=16)  # 元数据\n\nclass AssistantUpdateRequest(BaseModel):\n    assistant_id: Optional[str] = \"\"  # 助理ID\n    model: str = Field(default=\"ERNIE-4.0T-8K\")  # 使用的模型\n    name: str = Field(default=\"\", min_length=1, max_length=128, pattern=\"^[\\u4e00-\\u9fa50-9a-zA-Z_-]+$\")   # 助理名称\n    description: str = Field(default=\"\", max_length=512)  # 助理描述\n    response_format: ResponseFormat = Field(default=ResponseFormat.TEXT)  # 响应格式\n    instructions: str = Field(default=\"你是百度制作的AI助手\", max_length=4096)  # 助理的通用指令\n    thought_instructions: str = Field(default=\"\", max_length=4096)  # 助理的思维指令\n    chat_instructions: str = Field(default=\"\", max_length=4096)  # 助理的聊天指令\n    tools: list[AssistantTool] = Field(default=[], max_length=10)  # 助理使用的工具列表\n    file_ids: list[str] = Field(default=[], max_length=10)  # 关联文件的ID列表\n    metadata: dict = Field(default={}, max_length=16)  # 元数据\n    \nclass AssistantUpdateResponse(BaseModel):\n    id: Optional[str] = \"\"  # 助理ID\n    model: Optional[str] = \"\"  # 助理对象标识\n    name: Optional[str] = \"\"  # 助理名称\n    description: Optional[str] = \"\"  # 助理描述\n    response_format: Optional[ResponseFormat] = Field(default=ResponseFormat.TEXT)  # 响应格式\n    instructions: Optional[str]  # 助理的通用指令\n    created_at: Optional[int] = 0  # 助理创建时间戳\n    thought_instructions: Optional[str] = \"\"  # 助理的思维指令\n    chat_instructions: Optional[str] = \"\"  # 助理的聊天指令\n    tools: Optional[list[AssistantTool]] = Field(default=[])  # 助理使用的工具列表\n    file_ids: Optional[list[str]] = Field(default=[])  # 关联文件的ID列表\n    metadata: Optional[dict] = Field(default={}, max_length=16)  # 元数据\n    \n    \nclass AssistantListRole(str, Enum):\n    DESC = 'desc'\n    ASC = 'asc'\n\nclass AssistantListRequest(BaseModel):\n    limit: Optional[int] =   Field(default=20) # 列举结果数量上限\n    order: Optional[AssistantListRole] =   Field(default= AssistantListRole.DESC) # 排序字段\n    after: Optional[str] =   Field(default=\"\") # 查询指定assistant_id之后创建的Assistant\n    before: Optional[str] =   Field(default=\"\") # 查询指定assistant_id之前创建的Assistant\n    \nclass AssistantListResponse(BaseModel):\n    object: str = \"list\" # 结构类型，返回值固定为 list\n    data: Optional[list[AssistantCreateResponse]] = Field(default=[]) # Assistant对象列表\n    first_id: Optional[str] = \"\" # 返回的列表中第一条assistant的id\n    last_id: Optional[str] = \"\" # 返回的列表中最后一条assistant的id\n    has_more: bool = False # 是否还有更多的数据\n    \nclass AssistantQueryRequest(BaseModel):\n    assistant_id: Optional[str] = \"\"  # 助理ID\n    \nclass AssistantQueryResponse(BaseModel):\n    id: Optional[str] = \"\"  # 助理ID\n    object: Optional[str] = \"\"  # 助理对象标识\n    name: Optional[str] = \"\"  # 助理名称\n    description: Optional[str] = \"\"  # 助理描述\n    instructions: Optional[str]  # 助理的通用指令\n    tools: Optional[list[AssistantTool]] = Field(default=[])  # 助理使用的工具列表\n    created_at: Optional[int] = 0  # 助理创建时间戳\n    thought_instructions: Optional[str] = \"\"  # 助理的思维指令\n    chat_instructions: Optional[str] = \"\"  # 助理的聊天指令\n    response_format: Optional[ResponseFormat] = Field(default=ResponseFormat.TEXT)  # 响应格式\n    file_ids: Optional[list[str]] = Field(default=[])  # 关联文件的ID列表\n    metadata: Optional[dict] = Field(default={}, max_length=16)  # 元数据 \n    \n    \nclass AssistantDeleteRequest(BaseModel):\n    assistant_id: Optional[str] = \"\"  # 助理ID\n    \n    \nclass AssistantDeleteResponse(BaseModel):\n    id: Optional[str] = \"\"  # 助理ID\n    object: Optional[str] = \"\"  # 助理对象标识\n    deleted: bool = False  # 删除状态\n    \nclass AssistantFilesRequest(BaseModel):\n    assistant_id: Optional[str] = \"\"  # 助理ID\n    file_id: Optional[str] = \"\"  # File对象的id\n    \nclass AssistantFilesResponse(BaseModel):\n    id: Optional[str] = \"\"  # File对象的id，值等于入参\n    object: Optional[str] = \"\"  # 助理对象标识\n    created_at: Optional[int] = 0  # 助理创建时间戳\n    assistant_id: Optional[str] = \"\"  # Assistant对象的id，值等于入参\n    \nclass AssistantMountedFilesListRequest(BaseModel):\n    assistant_id: Optional[str] = \"\"  # Assistant对象的id\n    limit: Optional[int] =   Field(default=20) # 列举结果数量上限\n    order: AssistantListRole = Field(default= AssistantListRole.DESC) # 排序字段\n    after: Optional[str] =   Field(default=\"\") # 查询指定file_id之后创建的File\n    before: Optional[str] =   Field(default=\"\") # 查询指定file_id之前创建的File\n\nclass AssistantMountedFilesListResponse(BaseModel):\n    object: str = \"list\" # 结构类型，返回值固定为 list\n    data: Optional[list[AssistantFilesResponse]] = Field(default=[]) # file对象列表\n    first_id: Optional[str] = \"\" # 返回的列表中第一条assistant的id\n    last_id: Optional[str] = \"\" # 返回的列表中最后一条assistant的id\n    has_more: bool = False # 是否还有更多的数据\n    \nclass AssistantFilesDeleteRequest(BaseModel):\n    assistant_id: Optional[str] = \"\"  # 助理ID\n    file_id: Optional[str] = \"\"  # File对象的id\n    \n    \nclass AssistantFilesContentResponse(BaseModel):\n    content_type:Optional[str] = \"\"  # 文件类型\n    content :Optional[bytes] =b\"\" # 二进制流数据\n    "
  },
  {
    "path": "python/core/assistant/type/public_type.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom pydantic import BaseModel\nfrom enum import Enum\nfrom typing import Union\nfrom typing import Optional\n\n\nclass AssistantFunctionCall(BaseModel):\n    \"\"\"\n    表示助理功能调用的模型。\n\n    Attributes:\n        name (str): 函数调用的名称。\n        arguments (str): 函数调用的参数列表。\n    \"\"\"\n\n    name: str\n    arguments: str\n\n\nclass AssistantExample(BaseModel):\n    \"\"\"\n    表示助理功能示例的模型。\n\n    Attributes:\n        role (str): 示例的角色，默认为 \"user\"。\n        content (str): 示例的内容。\n        function_call (AssistantFunctionCall): 函数调用的实例。\n    \"\"\"\n\n    role: str = \"user\"\n    content: str\n    function_call: AssistantFunctionCall\n\n\nclass AssistantFunctionJsonSchema(BaseModel):\n    \"\"\"\n    表示助理功能的JSON Schema的模型。\n\n    Attributes:\n        type (str): Schema的类型，默认为 'object'。\n        properties (Union[dict, None]): JSON对象的属性，默认为None。\n        required (Union[list[str], None]): 必需的属性列表，默认为None。\n    \"\"\"\n\n    type: str = \"object\"\n    properties: Union[dict, None] = None\n    required: Union[list[str], None] = None\n\n\nclass AssistantFunction(BaseModel):\n    \"\"\"\n    表示助理功能的模型。\n\n    Attributes:\n        name (str): 功能的名称。\n        description (str): 功能的描述。\n        parameters (Union[AssistantFunctionJsonSchema, None]): 功能的参数Schema，默认为None。\n        responses (Union[AssistantFunctionJsonSchema, None]): 功能的响应Schema，默认为None。\n        examples (Union[list[list[AssistantExample]], None]): 功能的示例列表，默认为None。\n    \"\"\"\n\n    name: str\n    description: str\n    parameters: Union[AssistantFunctionJsonSchema, None] = None\n    responses: Union[AssistantFunctionJsonSchema, None] = None\n    examples: Union[list[list[AssistantExample]], None] = None\n\n\nclass AssistantTool(BaseModel):\n    \"\"\"\n    表示助理工具的模型。\n\n    Attributes:\n        type (str): 工具的类型，默认为 'function'。\n        function (AssistantFunction): 功能的实例。\n    \"\"\"\n\n    type: str = \"function\"\n    function: AssistantFunction = None\n\n\nclass ResponseFormat(str, Enum):\n    \"\"\"\n    表示响应格式的枚举类型。\n\n    Values:\n        TEXT: 文本格式。\n        JSON_OBJECT: JSON对象格式。\n    \"\"\"\n\n    TEXT = \"text\"\n    JSON_OBJECT = \"json_object\"\n\n\nclass AssistantText(BaseModel):\n    \"\"\"\n    表示助理文本内容的模型。\n\n    Attributes:\n        value (str): 文本的值。\n        annotations (Optional[list[str]]): 文本的注解列表，默认为None。\n    \"\"\"\n\n    value: str = \"\"\n    annotations: Optional[list[str]] = None\n\n\nclass AssistantContent(BaseModel):\n    \"\"\"\n    表示助理内容的模型。\n\n    Attributes:\n        type (str): 内容类型，默认为 \"text\"。\n        text (Optional[AssistantText]): 文本内容的实例，默认为None。\n    \"\"\"\n\n    type: str = \"text\"\n    text: Optional[AssistantText] = None\n\n\nclass AssistantChatParameters(BaseModel):\n    \"\"\"\n    表示助理聊天参数的模型。\n    Attributes:\n        temperature (Optional[float]): \t采样温度，较高的数值会使输出更随机。取值范围严格大于0，小于等于1，默认为0.8。\n        top_p (Optional[float]): top_p，核采样方法的概率阈值，影响输出文本的多样性，较高的数值会使输出的文本更加多样性。取值范围大于等于0，小于等于1，默认为0.8。\n        penalty_score (Optional[float]): 惩罚分数，减少重复生成的现象，值越大表示惩罚越大。取值范围大于等于1，小于等于2，默认为1.0。\n    \"\"\"\n\n    temperature: Optional[float] = 0.8\n    top_p: Optional[float] = 0.8\n    penalty_score: Optional[float] = 1.0\n\n\nclass AssistantThoughtParameters(BaseModel):\n    \"\"\"\n    表示助理思考参数的模型。\n    Attributes:\n        temperature (Optional[float]): \t采样温度，较高的数值会使输出更随机。取值范围严格大于0，小于等于1，默认为0.01。\n        top_p (Optional[float]): top_p，核采样方法的概率阈值，影响输出文本的多样性，较高的数值会使输出的文本更加多样性。取值范围大于等于0，小于等于1，默认为0。\n        penalty_score (Optional[float]): 惩罚分数，减少重复生成的现象，值越大表示惩罚越大取值范围大于等于1，小于等于2，默认为1.0。\n    \"\"\"\n\n    temperature: Optional[float] = 0.01\n    top_p: Optional[float] = 0\n    penalty_score: Optional[float] = 1.0\n\n\nclass AssistantModelParameters(BaseModel):\n    \"\"\"\n    表示助理模型的参数的模型。\n    Attributes:\n        chat_parameters (Optional[AssistantChatParameters]): 聊天参数的实例，默认为None。\n        thought_parameters (Optional[AssistantThoughtParameters]): 思考参数的实例，默认为None。\n    \"\"\"\n\n    chat_parameters: Optional[AssistantChatParameters] = AssistantChatParameters()\n    thought_parameters: Optional[AssistantThoughtParameters] = (\n        AssistantThoughtParameters()\n    )\n\n\nclass AssistantUserInfo(BaseModel):\n    \"\"\"\n    表示用户信息。\n    Attributes:\n        id (Optional[str]): 用户ID，默认为None。\n        name (Optional[str]): 用户名称，默认为None。\n        nickname (Optional[str]): 用户昵称，默认为None。\n        watermark (Optional[str]): 用户水印，默认为None。\n        intro (Optional[str]): 用户简介，默认为None。\n        baidu_id (Optional[str]): 用户百度ID，默认为None。\n    \"\"\"\n\n    id: Optional[str] = None\n    name: Optional[str] = None\n    nickname: Optional[str] = None\n    watermark: Optional[str] = None\n    intro: Optional[str] = None\n    baidu_id: Optional[str] = None\n\n\nclass AssistantUserLoc(BaseModel):\n    \"\"\"\n    表示用户位置信息。\n    Attributes:\n        loc (Optional[str]): 用户当前的地理位置信息，使用json格式描述\n        uip (Optional[str]): 用户的ipv4地址\n        uipv6 (Optional[str]): 用户的ipv6地址\n    \"\"\"\n\n    loc: Optional[str] = None\n    uip: Optional[str] = None\n    uipv6: Optional[str] = None\n"
  },
  {
    "path": "python/core/assistant/type/thread_type.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import BaseModel\nfrom pydantic import Field\nfrom enum import Enum\nfrom typing import Union\nfrom typing import Optional\n\nfrom appbuilder.core.assistant.type import (\n    AssistantTool,\n    AssistantContent,\n    ResponseFormat,\n    AssistantModelParameters,\n    AssistantUserInfo,\n    AssistantUserLoc\n)\n\n\nclass AssistantMessageRole(str, Enum):\n    USER = 'user'\n    ASSISTANT = 'assistant'\n\nclass AssistantMessage(BaseModel):\n    content: str\n    role: AssistantMessageRole = Field(\n        default=AssistantMessageRole.USER)\n    file_ids: Optional[list[str]] = Field(default=[], max_length=10)\n\n\nclass AssistantMessageCreateRequest(BaseModel):\n    thread_id: str\n    role: AssistantMessageRole = Field(\n        default=AssistantMessageRole.USER)\n    content: str\n    file_ids: Optional[list[str]] =  Field(default=[], max_length=10)\n\n\nclass AssistantMessageCreateResponse(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    role: AssistantMessageRole = Field(\n        default=AssistantMessageRole.USER)\n    content: Optional[list[AssistantContent]] = []\n    created_at: int = 0\n    thread_id: str = \"\"\n    assistant_id: Optional[str] = \"\"\n    run_id: Optional[str] = \"\"\n    file_ids: Optional[list[str]] = []\n    \n    \nclass AssistantMessageListRole(str, Enum):\n    DESC = 'desc'\n    ASC = 'asc'\n    \n    \nclass AssistantMessageListRequest(BaseModel):\n    thread_id: str\n    limit: int = -20\n    order: AssistantMessageListRole = Field(\n        default=AssistantMessageListRole.DESC)\n    after: str = \"\"\n    before: str = \"\"\n    \n    \nclass AssistantMessageListResponseData(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    role: AssistantMessageRole = Field()\n    content: Optional[list[AssistantContent]] = []\n    created_at: int = 0\n    thread_id: str = \"\"\n    assistant_id: Optional[str] = \"\"\n    run_id: Optional[str] = \"\"\n    file_ids: Optional[list[str]] = []\n    \n    \nclass AssistantMessageListResponse(BaseModel):\n    object: str = \"\"\n    data: list[AssistantMessageListResponseData] = []\n    first_id: Optional[str] = \"\"\n    last_id: Optional[str] = \"\"\n    has_more: bool = False\n    \nclass AssistantMessageQueryRequest(BaseModel):\n    thread_id: str\n    message_id: str\n\nclass AssistantMessageQueryResponse(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    role: AssistantMessageRole = Field()\n    content: Optional[list[AssistantContent]] = []\n    created_at: int = 0\n    thread_id: str = \"\"\n    assistant_id: Optional[str] = \"\"\n    run_id: Optional[str] = \"\"\n    file_ids: Optional[list[str]] = []\n    \n    \nclass AssistantMessageUpdateRequest(BaseModel):\n    thread_id: str\n    message_id: str\n    content: Optional[str] \n    file_ids: Optional[list[str]] = []\n    \n    \nclass AssistantMessageUpdateResponse(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    role: AssistantMessageRole = Field(default=AssistantMessageRole.USER)\n    content: Optional[list[AssistantContent]] = []\n    created_at: int = 0\n    thread_id: str = \"\"\n    assistant_id: Optional[str] = \"\"\n    run_id: Optional[str] = \"\"\n    file_ids: Optional[list[str]] = []\n    \nclass AssistantMessageFilesRequest(BaseModel):\n    thread_id: str\n    message_id: str\n    limit: int = -20\n    order : AssistantMessageListRole = Field(\n        default=AssistantMessageListRole.DESC)\n    after: str = \"\"\n    before: str = \"\"\n    \nclass AssistantContentFilesData(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    created_at: int = 0\n    message_id: str = \"\"\n    \nclass AssistantMessageFilesResponse(BaseModel):\n    object: str = \"\"\n    data: list[AssistantContentFilesData] = []\n    first_id: Optional[str] = \"\"\n    last_id: Optional[str] = \"\"\n    has_more: bool = False\n    \n\nclass AssistantThread(BaseModel):\n    messages: Optional[list[AssistantMessage]] = []\n    metadata: Optional[dict] = Field(default={}, max_length=16)\n\nclass ThreadCreateResponse(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    created_at: int = 0\n    metadata: dict = {}\n\nclass ThreadCreateRequest(BaseModel):\n    messages: list[AssistantMessage]\n\nclass ThreadQueryRequest(BaseModel):\n    thread_id: str\n\nclass ThreadQueryResponse(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    created_at: int = 0\n    metadata: dict = {}\n    \nclass ThreadDeleteRequest(BaseModel):\n    thread_id: str\n\nclass ThreadDeleteResponse(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    deleted: bool = False\n    \nclass ThreadUpdateRequest(BaseModel):\n    thread_id: str\n    metadata: Optional[dict] = Field(default={}, max_length=16)\n    \nclass ThreadUpdateResponse(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    created_at: Optional[int] = 0\n    metadata: Optional[dict] = {}\n\nclass AssistantThread(BaseModel):\n    messages: list[AssistantMessage] = []\n\n\nclass RunActionInfo(BaseModel):\n    toolName: str = \"\"\n    actionName: str = \"\"\n    actionContent: str = \"\"\n\n\nclass FunctionCall(BaseModel):\n    name: str = \"\"\n    arguments: str = \"\"\n    output: str = \"\"\n\n\nclass ToolCall(BaseModel):\n    id: str = \"\"\n    type: str = 'function'\n    function: Union[FunctionCall, None] = None\n\n\nclass SubmitToolOutput(BaseModel):\n    tool_calls: Union[list[ToolCall], None] = None\n\n\nclass RequiredAction(BaseModel):\n    type: str = \"\"\n    submit_tool_outputs: Union[SubmitToolOutput, None] = None\n\n\nclass LastError(BaseModel):\n    type: Optional[str] = \"\"\n    message: Optional[str] = \"\"\n\nclass FinalAnswerMessage(BaseModel):\n    message_id: Optional[str] = \"\"\n    content: Optional[list[AssistantContent]] = []\n\nclass FinalAnswer(BaseModel):\n    type: Optional[str] = \"message\"\n    message: Optional[FinalAnswerMessage] = None\n\nclass RunResult(BaseModel):\n    id: str = \"\"\n    object: str = \"\"\n    assistant_id: str = \"\"\n    thread_id: str = \"\"\n\n    model: str = \"\"\n    instructions: str = \"\"\n    thought_instructions: str = \"\"\n    chat_instructions: str = \"\"\n    tools: Optional[list[AssistantTool]] = None\n    file_ids: Optional[list[str]] = None\n\n    status: str = \"\"\n    required_action: Optional[RequiredAction] = None\n    last_error: Optional[LastError] = None\n    final_answer: Optional[FinalAnswer] = None\n    created_at: int = 0\n    started_at: int = 0\n    expired_at: int = 0\n    cancelled_at: int = 0\n    failed_at: int = 0\n    completed_at: int = 0\n\n\nclass RunMessageCreation(BaseModel):\n    message_id: str = \"\"\n\n\n\nclass ToolInfo(BaseModel):\n    type: str = \"\"\n    name: str = \"\"\n    arguments: str = \"\"\n    output: str = \"\"\n\n\nclass RunStepDetail(BaseModel):\n    type: str = \"\"\n    message_creation: Union[RunMessageCreation, None] = None\n    action_info: Union[RunActionInfo, None] = None\n    tool_calls: Union[list[ToolCall], None] = None\n    tool_info: Union[list[ToolInfo], None] = None\n\n\nclass RunStepResult(BaseModel):\n    id: Optional[str] = \"\"\n    object: Optional[str] = \"\"\n    assistant_id: Optional[str] = \"\"\n    thread_id: Optional[str] = \"\"\n    run_id: Optional[str] = \"\"\n    status: Optional[str] = \"\"\n    created_at: Optional[int] = 0\n    started_at: Optional[int] = 0\n    expired_at: Optional[int] = 0\n    cancelled_at: Optional[int] = 0\n    failed_at: Optional[int] = 0\n    completed_at: Optional[int] = 0\n    last_error: Union[LastError, str, None] = None\n    type: Optional[str] = 'null'\n    step_datail: Union[RunStepDetail, None] = None\n\n\nclass StreamRunDetail(BaseModel):\n    type: str = \"\"\n    message_creation: Union[RunMessageCreation, None] = None\n    run_object: Union[RunResult, None] = None\n    run_step_object: Union[RunStepResult, None] = None\n    tool_calls: Union[list[ToolCall], None] = None\n    error_info: Union[LastError, None] = None\n\n\nclass StreamRunStatus(BaseModel):\n    event: str = \"status\"\n    status: str = \"\"\n    send_id: int = 0\n    message: str = \"\"\n    event_type: str = \"\"\n    details: Optional[StreamRunDetail] = None\n\n\nclass StreamRunMessage(BaseModel):\n    event: str = \"message\"\n    status: str = \"\"\n    send_id: int = 0\n    is_end: int = 0\n    message_id: str = \"\"\n    message_index: str = \"\"\n    content: Optional[list[AssistantContent]] = None\n\n\nclass ToolOutput(BaseModel):\n    tool_call_id: str = \"\"\n    output: str = \"\"\n    run_id: str = \"\"\n\nclass AssistantRunModel(str,Enum):\n    ERNIE_4_0_8K = \"ERNIE-4.0T-8K\"\n    ERNIE_3_5_8K = \"DeepSeek-V3.1\"\n\nclass AssistantRunRequest(BaseModel):\n    thread_id: Optional[str] = Field(default=\"\")\n    model: Optional[AssistantRunModel] = Field(default=None)\n    assistant_id: Optional[str] = Field(default=\"\")\n    metadata: Optional[dict] =  Field(default={}, max_length=16)\n    response_format: ResponseFormat = Field(default=ResponseFormat.TEXT)\n    instructions: Optional[str] = Field(default= None, max_length=4096)\n    thought_instructions: Optional[str] = Field(default=None, max_length=4096)\n    chat_instructions: Optional[str] = Field(default=None, max_length=4096)\n    stream: Optional[bool] = False\n    model_parameters: Optional[AssistantModelParameters] = AssistantModelParameters()\n    class Config:\n        extra = \"forbid\"\n        protected_namespaces = ()\n    thread: Optional[AssistantThread] = None\n    tools: Optional[list[AssistantTool]] = []\n    tool_output: Optional[ToolOutput] = None\n    user_info: Optional[AssistantUserInfo] = None\n    user_loc: Optional[AssistantUserLoc] = None\n\n\nclass AssistantSubmitToolOutputsRequest(BaseModel):\n    thread_id: str = Field(default=\"\", min_length=1)\n    run_id: str = Field(default=\"\", min_length=1)\n    tool_outputs: Optional[list[ToolOutput]] = Field(default=[], min_length=1)\n\n\nclass AssistantRunCancelRequest(BaseModel):\n    thread_id: str = Field(default=\"\", min_length=1)\n    run_id: str = Field(default=\"\", min_length=1)\n    sync:bool = False\n\n\nclass RunListOrderEnum(str, Enum):\n    DESC = \"desc\"\n    ASC = \"asc\"\n\nclass AssistantRunListRequest(BaseModel):\n    thread_id: str = Field(default=\"\", min_length=1)\n    limit: int = Field(default=20)\n    order: RunListOrderEnum = Field(default=RunListOrderEnum.DESC)\n    after: str = Field(default=\"\")\n    before: str = Field(default=\"\")\n\nclass RunListResponse(BaseModel):\n    object: Optional[str] = Field(default=\"list\")\n    first_id: Optional[str] = Field(default=\"\")\n    last_id: Optional[str] = Field(default=\"\")\n    has_more: Optional[bool] = Field(default=False)\n    data: Optional[list[RunResult]] = Field(default=[])\n\nclass AssistantRunQueryRequest(BaseModel):\n    thread_id: str = Field(default=\"\", min_length=1)\n    run_id: str = Field(default=\"\", min_length=1)\n\nclass AssistantRunStepListRequest(BaseModel):\n    thread_id: str = Field(default=\"\", min_length=1)\n    run_id: str = Field(default=\"\", min_length=1)\n    limit: int = Field(default=20)\n    order: RunListOrderEnum = Field(default=RunListOrderEnum.DESC)\n    after: str = Field(default=\"\")\n    before: str = Field(default=\"\")\n\nclass RunStepListResponse(BaseModel):\n    object: Optional[str] = Field(default=\"list\")\n    first_id: Optional[str] = Field(default=\"\")\n    last_id: Optional[str] = Field(default=\"\")\n    has_more: Optional[bool] = Field(default=False)\n    data: Optional[list[RunStepResult]] = Field(default=[])\n\nclass AssistantRunStepQueryRequest(BaseModel):\n    thread_id: str = Field(default=\"\", min_length=1)\n    run_id: str = Field(default=\"\", min_length=1)\n    step_id: str = Field(default=\"\", min_length=1)"
  },
  {
    "path": "python/core/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Component模块包括组件基类，用户自定义组件需要继承Component类，并至少实现run方法\"\"\"\nimport json\n\nfrom enum import Enum\n\nfrom pydantic import BaseModel\nfrom pydantic import Field, field_validator\nfrom typing import (\n    Dict, List, Optional, Any, Generator, Union, AsyncGenerator)\nfrom appbuilder.core.utils import ttl_lru_cache\nfrom appbuilder.core._client import HTTPClient, AsyncHTTPClient\nfrom appbuilder.core.message import Message\n\n\nclass ComponentArguments(BaseModel):\n    \"\"\"\n    ComponentArguments define Component meta fields\n\n    Attributes:\n        name (str): component name.\n        tool_desc (dict): component description.\n    \"\"\"\n    name: str = \"\"\n    tool_desc: Dict[str, Any] = {}\n\n    def extract_values_to_dict(self):\n        r\"\"\"extract ComponentArguments fields to dict\"\"\"\n\n        inputs = {}\n        for name, info in self.model_fields.items():\n            value = getattr(self, name)\n            # 获取 display_name 元数据\n            if not info.json_schema_extra:\n                continue\n            variable_name = info.json_schema_extra.get('variable_name')\n            if not variable_name:\n                inputs[name] = value\n                continue\n            # 使用 Enum 成员的实际值\n            if isinstance(value, Message):\n                inputs[variable_name] = str(value.content)\n            elif isinstance(value, Enum):\n                inputs[variable_name] = str(value.value)\n            else:\n                inputs[variable_name] = str(value)\n        return inputs\n\n\nclass Text(BaseModel, extra='allow'):\n    info: str = Field(default=\"\", description=\"具体文本内容\")\n\n\nclass Code(BaseModel, extra='allow'):\n    code: str = Field(default=\"\", description=\"代码片段\")\n\n\nclass Files(BaseModel, extra='allow'):\n    filename: str = Field(default=\"\", description=\"文件名\")\n    url: str = Field(default=\"\", description=\"文件url\")\n    file_id: str = Field(default=\"\", description=\"文件ID\")\n\n\nclass Urls(BaseModel, extra='allow'):\n    url: str = Field(default=\"\", description=\"链接地址\")\n\n\nclass OralText(BaseModel, extra='allow'):\n    info: str = Field(default=\"\", description=\"口语化文本内容\")\n\n\nclass ReasoningContent(BaseModel, extra=\"allow\"):\n    info: str = Field(default=\"\", description=\"思考过程\")\n\n\nclass VideoDetail(BaseModel):\n    url: Optional[str] = Field(None, description=\"视频链接\")\n    height: Optional[str] = Field(None, description=\"视频高度\")\n    width: Optional[str] = Field(None, description=\"视频宽度\")\n    size: Optional[str] = Field(None, description=\"视频大小，单位Bytes\")\n    duration: Optional[str] = Field(None, description=\"视频长度，单位秒\")\n    hover_pic: Optional[str] = Field(None, description=\"视频封面图\")\n\n\nclass ImageDetail(BaseModel):\n    url: Optional[str] = Field(None, description=\"图片链接\")\n    height: Optional[str] = Field(None, description=\"图片高度\")\n    width: Optional[str] = Field(None, description=\"图片宽度\")\n\n\nclass References(BaseModel, extra='allow'):\n    type: Optional[str] = Field(default=\"\", description=\"类型\")\n    source: Optional[str] = Field(default=\"\", description=\"来源\")\n    doc_id: Optional[str] = Field(default=None, description=\"文档id\")\n    content: Optional[str] = Field(default=\"\", description=\"内容\")\n    extra: Optional[dict] = Field(default={}, description=\"其他信息\")\n\n    title: Optional[str] = Field(\"\", description=\"网页标题\")\n    url: Optional[str] = Field(\"\", description=\"网页地址\")\n    web_anchor: Optional[str] = Field(\"\", description=\"网站锚文本或网站标题\")\n    icon: Optional[str] = Field(None, description=\"站点图标\")\n    date: Optional[str] = Field(None, description=\"网页日期\")\n    type: Optional[str] = Field(\n        None, description=\"检索资源类型\"\n    )\n    id: Optional[Union[int, str]] = Field(\n        None, description=\"引用编号1、2、3\"\n    )\n    image: Optional[ImageDetail] = Field(None, description=\"图片详情\")\n    video: Optional[VideoDetail] = Field(None, description=\"视频详情\")\n\nclass Image(BaseModel, extra='allow'):\n    filename: str = Field(default=\"\", description=\"图片名称\")\n    url: str = Field(default=\"\", description=\"图片url\")\n    base64: Optional[str] = Field(default=\"\", description=\"图片base64数据\")\n    mime_type: Optional[str] = Field(\n        default=\"jpeg\", description=\"图片类型，如image/jpeg, 可选，默认jpeg\")\n\n\nclass Chart(BaseModel, extra='allow'):\n    type: str = Field(default=\"\", description=\"图表类型\")\n    data: str = Field(default=\"\", description=\"图表数据, json_str格式\")\n\n\nclass Audio(BaseModel, extra='allow'):\n    filename: str = Field(default=\"\", description=\"音频名称\")\n    url: str = Field(default=\"\", description=\"音频url\")\n    base64: Optional[str] = Field(default=\"\", description=\"音频base64数据\")\n    mime_type: Optional[str] = Field(\n        default=\"\", description=\"音频类型，如mp3/wav, 可选，暂无默认值\")\n\n\nclass PlanStep(BaseModel, extra='allow'):\n    name: str = Field(default=\"\", description=\"step名\")\n    arguments: dict = Field(default={}, description=\"step参数\")\n    thought: str = Field(default=\"\", description=\"step思考结果\")\n\n\nclass Task(BaseModel, extra='allow'):\n    id: str = Field(default=\"\", description=\"task id\")\n    name: str = Field(default=\"\", description=\"task名\")\n    description: str = Field(default=\"\", description=\"task描述\")\n    requires: list[str] = Field(default=[], description=\"依赖的task列表\")\n    tool: str = Field(default=\"\", description=\"工具名\")\n    parameters: dict = Field(default={}, description=\"参数列表\")\n    status: str = Field(default=\"\", description=\"task状态\")\n\n\nclass Plan(BaseModel, extra='allow'):\n    goal: str = Field(default=\"\", description=\"计划目标\")\n    thought: str = Field(default=\"\", description=\"计划思考结果\")\n    tasks: list[Task] = Field(default=[], description=\"任务列表\")\n    # deprecated parameters, delete when dte agent update\n    detail: str = Field(default=\"\", description=\"计划详情\")\n    steps: list[PlanStep] = Field(default=[], description=\"步骤列表\")\n\n\nclass FunctionCall(BaseModel, extra='allow'):\n    thought: str = Field(default=\"\", description=\"思考结果\")\n    name: str = Field(default=\"\", description=\"工具名\")\n    arguments: dict = Field(default={}, description=\"参数列表\")\n\n\nclass Json(BaseModel, extra='allow'):\n    data: str = Field(default=\"\", description=\"json数据\")\n\n\nclass Browser(BaseModel, extra='allow'):\n    class Computer(BaseModel, extra='allow'):\n        vnc_url: str = Field(default=\"\", description=\"vnc url\")\n        computer_id: str = Field(default=\"\", description=\"该vnc容器的computer_id\")\n\n    class Result(BaseModel, extra='allow'):\n        is_error: bool = Field(default=False, description=\"是否错误\")\n        answer: str = Field(\n            default=\"\", description=\"is_error=False为最终的总结结果, is_error=True为错误信息\")\n\n    class Screenshot(BaseModel, extra='allow'):\n        browser_url: str = Field(default=\"\", description=\"截图时的浏览器当前URL\")\n        url: str = Field(\n            default=\"\", description=\"图片URL (url, filename与data, mime_type二选一)\")\n        filename: str = Field(default=\"\", description=\"图像文件名\")\n        mime_type: str = Field(\n            default=\"image/jpeg\", description=\"图片类型，如image/jpeg, image/png，可选，默认为image/jpeg\")\n        data: str = Field(\n            default=\"\", description=\"图片base64串 (url, filename与data, mime_type二选一)\")\n        file_id: str = Field(default=\"\", description=\"图片文件ID\")\n\n    class Thought(BaseModel, extra='allow'):\n        next_goal: str = Field(default=\"\", description=\"下一个目标\")\n\n    query: str = Field(default=\"\", description=\"浏览器查询内容\")\n    computer: Computer = Field(default=Computer(), description=\"浏览器计算资源\")\n    result: Result = Field(default=Result(), description=\"浏览器执行结果\")\n    screenshot: Screenshot = Field(default=Screenshot(), description=\"浏览器截图结果\")\n    thought: Thought = Field(default=Thought(), description=\"浏览器思考结果\")\n    action: Union[list, list[dict], None] = Field(\n        default=None, description=\"浏览器执行动作\")\n\n\nclass Progress(BaseModel, extra='allow'):\n    progress: float = Field(default=0.0, description=\"进度, 数值在0-1之间\")\n    step: str = Field(default=\"\", description=\"状态枚举值\")\n    next_step_name: str = Field(default=\"\", description=\"下一个step名\")\n    message: str = Field(default=\"\", description=\"附加说明信息\")\n\n\nclass Content(BaseModel):\n    name: str = Field(default=\"\",\n                      description=\"介绍当前yield内容的阶段名， 使用name的必要条件，是同一组件会输出不同type的content，并且需要加以区分，方便前端渲染与用户展示\")\n    visible_scope: str = Field(default=\"all\",\n                               description=\"为了界面展示明确的说明字段，三种取值：llm、user、all。llm为思考模型可见，类似function calling结果中submit的执行结果，user为终端用户可见，all包含上述两者\")\n    raw_data: dict = Field(default={},\n                           description=\"raw_data是原始数据，可以是任何格式，比如json、html等，具体由开发者决定，用户上游请求结果透传，内部系统返回的信息，例如API节点收到的resp，大模型节点的MB resp\")\n    usage: dict = Field(default={},\n                        description=\"大模型的token用量, \")\n    metrics: dict = Field(default={},\n                          description=\"耗时、性能、内存等trace及debug所需信息\")\n    type: str = Field(default=\"text\",\n                      description=\"代表event 类型，包括 text、code、files、urls、oral_text、references、image、chart、audio、browser、plan、function_call、json、progress该字段的取值决定了下面text字段的内容结构\")\n    text: Union[Text, Code, Files, Urls, OralText, References, Image, Chart, Audio, Plan, Json, FunctionCall, Browser, Progress, ReasoningContent] = Field(default=Text,\n                                                                                                                                         description=\"代表当前 event 元素的内容，每一种 event 对应的 text 结构固定\")\n\n    @field_validator('text', mode='before')\n    def set_text(cls, v, values, **kwargs):\n        if values.data['type'] == 'text':\n            return Text(**v)\n        elif values.data['type'] == 'code':\n            return Code(**v)\n        elif values.data['type'] == 'files':\n            return Files(**v)\n        elif values.data['type'] == 'urls':\n            return Urls(**v)\n        elif values.data['type'] == 'oral_text':\n            return OralText(**v)\n        elif values.data['type'] == 'references':\n            return References(**v)\n        elif values.data['type'] == 'image':\n            return Image(**v)\n        elif values.data['type'] == 'chart':\n            return Chart(**v)\n        elif values.data['type'] == 'audio':\n            return Audio(**v)\n        elif values.data['type'] == 'plan':\n            return Plan(**v)\n        elif values.data['type'] == 'function_call':\n            return FunctionCall(**v)\n        elif values.data['type'] == 'json':\n            return Json(**v)\n        elif values.data['type'] == 'browser':\n            return Browser(**v)\n        elif values.data['type'] == 'progress':\n            return Progress(**v)\n        elif values.data['type'] == \"reasoning_content\":\n            return ReasoningContent(**v)\n        else:\n            raise ValueError(f\"Invalid value for 'type': {values['type']}\")\n\n\nclass ComponentOutput(BaseModel):\n    role: str = Field(default=\"tool\",\n                      description=\"role是区分当前消息来源的重要字段，对于绝大多数组件而言，都是填写tool，标明role所在的消息来源为组件。部分思考及问答组件，role需要填写为assistant\")\n    content: list[Content] = Field(default=[],\n                                   description=\"content是当前组件返回内容的主要payload，List[Content]，每个Content Dict 包括了当前输出的一个元素\")\n\n\nclass Component:\n    \"\"\"\n    Component基类, 其它实现的Component子类需要继承该基类，并至少实现run方法.\n\n    Args:\n        meta (ComponentArguments): component meta information.\n        secret_key (str): user authentication token.\n        gateway (str): backend gateway server address.\n        lazy_certification (bool): lazy certification flag.\n    \"\"\"\n\n    manifests = []\n\n    def __init__(\n        self,\n        meta: Optional[ComponentArguments] = ComponentArguments(),\n        secret_key: Optional[str] = None,\n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        is_aysnc: bool = False,\n        **kwargs\n    ):\n        r\"\"\"Component初始化方法.\n\n            参数:\n                meta (obj: `ComponentArguments`, 可选) : component元信息.\n                secret_key(str,可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n                gateway(str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n                lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n            返回：\n                无\n        \"\"\"\n        self.meta = meta\n        self.secret_key = secret_key\n        self.gateway = gateway\n        self._http_client = None\n        self.lazy_certification = lazy_certification\n        self.is_async = is_aysnc\n        if not self.lazy_certification:\n            self.set_secret_key_and_gateway(self.secret_key, self.gateway)\n\n    def set_secret_key_and_gateway(self, secret_key: Optional[str] = None, gateway: str = \"\"):\n        \"\"\"\n        设置密钥和网关地址。\n\n        Args:\n            secret_key (Optional[str], optional): 密钥，默认为None。如果未指定，则使用实例当前的密钥。\n            gateway (str, optional): 网关地址，默认为空字符串。如果未指定，则使用实例当前的网关地址。\n\n        Returns:\n            None\n\n        \"\"\"\n        self.secret_key = secret_key\n        self.gateway = gateway\n        # 因为子类可能重载init方法，导致没有is_async属性，所以此处需要判断一下\n        try:\n            self.is_async\n        except AttributeError:\n            # 目前async仅在AppBuilderClient中使用，所以没有async属性的组件都可以设置为False\n            self.is_async = False\n\n        if self.is_async:\n            self._http_client = AsyncHTTPClient(self.secret_key, self.gateway)\n        else:\n            self._http_client = HTTPClient(self.secret_key, self.gateway)\n\n    def set_model_info(self, model_name: str, model_url: str):\n        \"\"\"为llm component设置模型，其它component不生效\"\"\"\n        pass\n\n    @property\n    def http_client(self):\n        \"\"\"\n        获取 HTTP 客户端实例。\n\n        Args:\n            无\n\n        Returns:\n            HTTPClient: HTTP 客户端实例。\n\n        \"\"\"\n        if self._http_client is None:\n            if self.is_async:\n                self._http_client = AsyncHTTPClient(\n                    self.secret_key, self.gateway)\n            else:\n                self._http_client = HTTPClient(self.secret_key, self.gateway)\n        return self._http_client\n\n    def __call__(self, *inputs, **kwargs):\n        r\"\"\"implement __call__ method\"\"\"\n        return self.run(*inputs, **kwargs)\n\n    def tool_eval(self, *input, **kwargs) -> Generator:\n        \"\"\"\n        对给定的输入执行工具的FunctionCall。\n\n        Args:\n            *input: 一个可变数量的参数，代表输入数据。\n            **kwargs: 关键字参数，可以包含任意数量的键值对，用于传递额外的参数。\n\n        Returns:\n            Generator[dict, ComponentOutput]: 生成器，生成字典和ComponentOutput类型的对象。\n\n        Raises:\n            NotImplementedError: 如果子类没有实现此方法，则抛出此异常。\n\n        \"\"\"\n        raise NotImplementedError\n\n    def run(self, *inputs, **kwargs) -> Message:\n        \"\"\"\n        run method,待子类重写实现\n\n        Args:\n            inputs: list of arguments\n            kwargs: keyword arguments\n        \"\"\"\n        raise NotImplementedError\n\n    def batch(self, *args, **kwargs) -> List[Message]:\n        \"\"\"\n        批量处理输入并返回结果列表。\n\n        Args:\n            *args: 可变数量的输入参数，每个参数将依次被处理。\n            **kwargs: 关键字参数，这些参数将被传递给每个输入的处理函数。\n\n        Returns:\n            List[Message]: 包含处理结果的列表，每个元素对应一个输入参数的处理结果。\n\n        \"\"\"\n\n        results = [self.run(inp, **kwargs) for inp in args]\n        return results\n\n    def non_stream_tool_eval(self, *args, **kwargs) -> Union[ComponentOutput, dict]:\n        \"\"\"\n        对工具评估结果进行非流式处理。\n\n        Args:\n            *args: 可变参数，具体参数依赖于调用的工具评估函数。\n            **kwargs: 关键字参数，具体参数依赖于调用的工具评估函数。\n\n        Returns:\n            Union[ComponentOutput, dict]: 返回包含评估结果的 ComponentOutput 对象或字典。\n                如果评估结果为空，则返回包含评估结果的字典。\n\n        \"\"\"\n        result = ComponentOutput()\n        result_content = []\n        for iter_result in self.tool_eval(*args, **kwargs):\n            result.role = iter_result.role\n            result_content += iter_result.content\n        result.content = result_content\n        return result\n\n    async def atool_eval(self, *args, **kwargs) -> AsyncGenerator:\n        r\"\"\"\n        atool_eval method,待子类重写实现\n\n        Args:\n            args: list of arguments\n            kwargs: keyword arguments\n        \"\"\"\n        return None\n\n    async def arun(self, *args, **kwargs) -> Optional[Message]:\n        r\"\"\"\n        arun method,待子类重写实现\n\n        Args:\n            args: list of arguments\n            kwargs: keyword arguments\n        \"\"\"\n        return None\n\n    async def abatch(self, *args, **kwargs) -> List[Message]:\n        r\"\"\"\n        abatch method,待子类重写实现\n\n        Args:\n            args: list of arguments\n            kwargs: keyword arguments\n        \"\"\"\n        return None\n\n    def _trace(self, **data) -> None:\n        r\"\"\"pass\"\"\"\n        pass\n\n    def _debug(self, **data) -> None:\n        r\"\"\"pass\"\"\"\n        pass\n\n    def tool_desc(self) -> List[str]:\n        r\"\"\"\n        tool_desc method,待子类重写实现\n\n        Args:\n            None\n\n        Returns:\n            list of strings\n        \"\"\"\n        return [json.dumps(manifest, ensure_ascii=False) for manifest in self.manifests]\n\n    def tool_name(self) -> List[str]:\n        r\"\"\"\n        tool_name method,待子类重写实现\n\n        Args:\n            None\n\n        Returns:\n            list of strings\n        \"\"\"\n        return [manifest[\"name\"] for manifest in self.manifests]\n\n    def create_langchain_tool(self, tool_name=\"\", **kwargs):\n        r\"\"\"\n        create_langchain_tool method,将AB-SDK的Tool转换为LangChain的StructuredTool\n\n        Args:\n            tool_name: string, optional, default is empty string\n            kwargs: keyword arguments\n\n        Returns:\n            StructuredTool\n        \"\"\"\n        try:\n            from langchain_core.tools import StructuredTool\n        except ImportError:\n            raise ImportError(\n                \"Please install langchain to use create_langchain_tool.\")\n\n        # NOTE(chengmo): 可以支持LangChain的组件，必须要求具备mainfest\n        if self.manifests == []:\n            raise ValueError(\n                \"Compnent {} No manifests found. Cannot convert it into LangChain Tool\".format(type(self)))\n\n        langchain_tool_json_schema = {}\n        # NOTE(chengmo): 虽然现阶段，组件的mainfest列表中最多只有一个元素，但是需要兼容后期可能的多Tool的情况\n        if len(self.manifests) > 1:\n            if tool_name == \"\":\n                raise ValueError(\n                    \"Multiple tools found, please use 'tool_name' specify which one to use.\")\n\n            for manifest in self.manifests:\n                if manifest[\"name\"] == tool_name:\n                    langchain_tool_json_schema = manifest\n                    break\n\n            if langchain_tool_json_schema == {}:\n                raise ValueError(\n                    \"Tool {} not found in mainfest.\".format(tool_name))\n        else:\n            langchain_tool_json_schema = self.manifests[0]\n\n        # NOTE(chengmo): 当前AB-SDK的Tool有两种情况\n        # 1、存在tool_eval方法，则直接调用tool_eval方法，并设置stream=True, 汇总结果，封装成Message返回\n        # 2、不存在tool_eval方法，则调用run方法，并设置 stream=False, 封装成Message返回\n        has_tool_eval = self._has_implemented_tool_eval()\n        langchain_tool_func = None\n        if has_tool_eval:\n            langchain_tool_func = self._langchain_tool_eval_implement\n        else:\n            langchain_tool_func = self._langchain_run_implement\n\n        # NOTE(chengmo): name 及 description 都从mainfest中获取\n        langchain_tool_name = langchain_tool_json_schema[\"name\"]\n        langchain_tool_description = langchain_tool_json_schema[\"description\"]\n\n        # NOTE(chengmo): 从mainfest中获取参数的json_schema，并转换成Pydantic的BaseModel\n        from appbuilder.utils.json_schema_to_model import json_schema_to_pydantic_model\n        try:\n            import copy\n            schema = copy.deepcopy(langchain_tool_json_schema[\"parameters\"])\n            schema[\"title\"] = langchain_tool_name\n            langchain_tool_model = json_schema_to_pydantic_model(\n                schema,\n                name_override=langchain_tool_name)\n        except Exception as e:\n            raise RuntimeError(\n                \"Failed to generate Pydantic model for tool schema: {}\".format(e))\n\n        return StructuredTool.from_function(\n            func=langchain_tool_func,\n            name=langchain_tool_name,\n            description=langchain_tool_description,\n            args_schema=langchain_tool_model,\n            return_direct=False\n        )\n\n    def _has_implemented_tool_eval(self):\n        has_tool_eval = False\n        try:\n            # 调用self.tool_eval方法，如果抛出NotImplementedError异常，则说明没有实现tool_eval方法\n            self.tool_eval(**{'name': \"\", \"streaming\": False})\n        except NotImplementedError:\n            has_tool_eval = False\n        else:\n            has_tool_eval = True\n\n        return has_tool_eval\n\n    def _langchain_run_implement(self, **kwargs):\n        # NOTE(chengmo): 调用run方法，并设置 stream=False, 封装成Message返回\n        kwargs[\"stream\"] = False\n        return self.run(**kwargs)\n\n    def _langchain_tool_eval_implement(self, **kwargs):\n        # NOTE(chengmo): 调用tool_eval方法，并设置 stream=True, 封装成Message返回\n        kwargs[\"stream\"] = True\n        kwargs[\"streaming\"] = True\n        res = self.tool_eval(**kwargs)\n\n        final_result = \"\"\n\n        # TODO(chengmo): 在组件标准化管理前，复用DTE对流式组件的处理逻辑\n        for step in res:\n            if isinstance(step, str):\n                final_result += step\n            else:\n                final_result += step.get(\"text\", \"\")\n        return final_result\n\n    @classmethod\n    def create_output(cls, type, text, role=\"tool\", name=\"\", visible_scope=\"all\", raw_data={}, usage={}, metrics={}):\n        \"\"\"create_text_output\n\n        Args:\n            type (str): 类型，包括\"text\", \"code\", \"files\", \"urls\", \"oral_text\", \"references\", \"image\", \"chart\", \"audio\", \"plan\", \"function_call\"\n            text (str|dict): text字段，可输入str或dict\n            role (str, optional): 当前消息来源. Defaults to \"tool\".\n            name (str, optional): 当前yield内容的step name. Defaults to \"\".\n            visible_scope (str, optional): 界面展示明确的说明字段. Defaults to \"all\".\n            raw_data (dict, optional): 内部信息，由开发者请求透传. Defaults to {}.\n            usage (dict, optional): 大模型的token用量. Defaults to {}.\n            metrics (dict, optional): 耗时、性能、内存等trace及debug所需信息. Defaults to {}.\n\n        Returns:\n            ComponentOutput: 组件输出\n        \"\"\"\n        if isinstance(text, str):\n            if type == \"text\":\n                text = {\"info\": text}\n            elif type == \"code\":\n                text = {\"code\": text}\n            elif type == \"urls\":\n                text = {\"url\": text}\n            elif type == \"oral_text\":\n                text = {\"info\": text}\n            elif type == \"json\":\n                text = {\"data\": text}\n            elif type == \"reasoning_content\":\n                text = {\"info\": text}\n            else:\n                raise ValueError(\n                    \"Only when type=text/code/urls/oral_text/reasoning_content, string text is allowed! Please give dict text\")\n        elif isinstance(text, dict):\n            if type == \"text\":\n                key_list = [\"info\"]\n            elif type == \"code\":\n                key_list = [\"code\"]\n            elif type == \"oral_text\":\n                key_list = [\"info\"]\n            elif type == \"urls\":\n                key_list = [\"url\"]\n            elif type == \"files\":\n                key_list = [\"filename\", \"url\"]\n            elif type == \"references\":\n                key_list = []\n            elif type == \"image\":\n                key_list = [\"filename\", \"url\"]\n            elif type == \"chart\":\n                key_list = [\"type\", \"data\"]\n            elif type == \"audio\":\n                key_list = [\"filename\", \"url\"]\n            elif type == \"plan\":\n                # add follow key_list when dte_agent update\n                key_list = []  # [\"goal\", \"thought\", \"tasks\", \"detail\", \"steps\"]\n            elif type == \"function_call\":\n                key_list = [\"thought\", \"name\", \"arguments\"]\n            elif type == \"json\":\n                key_list = [\"data\"]\n            elif type == \"browser\":\n                key_list = [\"query\"]\n            elif type == \"progress\":\n                key_list = []\n            elif type == \"reasoning_content\":\n                key_list = [\"info\"]\n            else:\n                raise ValueError(\"Unknown type: {}\".format(type))\n            assert all(\n                key in text for key in key_list), \"all keys:{} must be included in the text field\".format(key_list)\n        else:\n            raise ValueError(\"text must be str or dict\")\n\n        assert role in [\n            \"tool\", \"assistant\"], \"role must be 'tool' or 'assistant'\"\n        result = {\n            \"role\": role,\n            \"content\": [{\n                \"type\": type,\n                \"name\": name,\n                \"text\": text,\n                \"visible_scope\": visible_scope,\n                \"raw_data\": raw_data,\n                \"usage\": usage,\n                \"metrics\": metrics\n            }]\n        }\n        return ComponentOutput(**result)\n"
  },
  {
    "path": "python/core/components/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/animal_recognize/README.md",
    "content": "# 动物识别 (AnimalRecognition) \n\n## 简介\n动物识别 (AnimalRecognition) 支持对于输入的一张图片（可正常解码），输出动物识别结果。\n\n### 功能介绍\n* 识别动物名称\n\n  识别近八千种动物，接口返回动物名称、置信度信息，支持自定义返回结果数， 并可获取识别结果对应的百科信息；\n\n### 应用场景\n* 拍照识图\n\n    根据拍摄照片，识别图片中动物的名称，可配合其它识图能力对识别的结果进一步细化，提升用户体验，广泛应用于拍照识图类APP中。\n\n\n## 基本用法\n\n我们选取一张可爱的大熊猫照片，使用动物识别组件进行识别。\n\n\n![大熊猫](https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad6862cf937c03f8c5260d51c6ae\n)\n\n\n下面是动物识别的代码示例：\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n            \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n            \"62cf937c03f8c5260d51c6ae\"\nraw_image = requests.get(image_url).content\n# 创建动物识别组件实例\nanimal_recognition = appbuilder.AnimalRecognition()\n# 执行识别操作并获取结果\nout = animal_recognition.run(appbuilder.Message(content={\"raw_image\": raw_image}))\nprint(out.content)\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message    | obj:`Message` | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数       |     |\n| +content   | Dict   | 是    | 消息内容                              |  {\"raw_image\": ...., \"url\": \"http://xxx.png\"}  |\n| ++raw_image  | Bytes | 是    | 输入的图片数据，图片数据需要base64编码 | - |\n| ++url     | String | 否    | 图像下载链接                     | -  |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\n\n### 响应参数\n| 参数名称   | 参数类型    | 描述   | 示例值                                   |\n|--------|---------|------|---------------------------------------|\n|  message | obj:`Message`  | 动物识别输出内容 | - |\n| +content | Dict | 返回结果 | \"result\": [{\"name\":\"国宝大熊猫\",\"score\":\"0.975161\"}] |\n| ++name  | String  | 动物名称 | \"国宝大熊猫\"                               |\n| ++score | String  | \t置信度 | \"0.975161\"                            |\n### 响应示例\n```json\n{\n    \"result\":[\n        {\n            \"name\":\"国宝大熊猫\",\n            \"score\":\"0.975161\"\n        },\n        {\n            \"name\":\"秦岭四宝\",\n            \"score\":\"0.0161979\"\n        },\n        {\n            \"name\":\"团团圆圆\",\n            \"score\":\"0.00239265\"\n        },\n        {\n            \"name\":\"圆仔\",\n            \"score\":\"0.00192277\"\n        },\n        {\n            \"name\":\"棕色大熊猫\",\n            \"score\":\"0.00130296\"\n        },\n        {\n            \"name\":\"小熊猫\",\n            \"score\":\"0.000275865\"\n        }\n    ]\n}\n```\n\n## 高级用法\n\n目前该模块仅提供基础的动物识别功能。\n\n\n## 更新记录和贡献\n* 动物识别能力 (2024-01)"
  },
  {
    "path": "python/core/components/animal_recognize/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/animal_recognize/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"animal recognize component.\"\"\"\n\nimport base64\nimport json\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.animal_recognize.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom typing import Generator, Union\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nTOP_NUM = 1\nBAIKE_NUM = 0\n\n\nclass AnimalRecognition(Component):\n    r\"\"\"\n       用于识别一张图片，即对于输入的一张图片（可正常解码，且长宽比较合适），输出动物识别结果。\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           animal_recognition = appbuilder.AnimalRecognition()\n           with open(\"./animal_recognition_test.png\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n           print(out.content)\n\n        \"\"\"\n    name = \"animal_rec\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"animal_rec\",\n            \"description\": \"用于识别图片中动物类别，可识别近八千种动物\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名\"\n                    },\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        根据输入消息运行动物识别功能\n        \n        Args:\n            message (Message): 输入的消息对象，其中应包含需要识别的图像数据或URL\n            timeout (float, optional): 超时时间，单位为秒。默认为None，表示无超时限制。Defaults to None.\n            retry (int, optional): 重试次数。默认为0，表示不重试。Defaults to 0.\n        \n        Returns:\n            Message: 识别结果的消息对象\n        \n        \"\"\"\n        inp = AnimalRecognitionInMsg(**message.content)\n        req = AnimalRecognitionRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        req.top_num = 6\n        req.baike_num = 0\n        result = self._recognize(req, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = AnimalRecognitionOutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(\n        self,\n        request: AnimalRecognitionRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> AnimalRecognitionResponse:\n        r\"\"\"调用底层接口进行动物识别\n\n                   参数:\n                       request (obj: `AnimalRecognitionRequest`) : 动物识别输入参数\n                   返回：\n                       response (obj: `AnimalRecognitionResponse`): 动物识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n\n        data = AnimalRecognitionRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/animal\")\n        response = self.http_client.session.post(url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        animalRes = AnimalRecognitionResponse.from_json(json.dumps(data))\n        animalRes.request_id = request_id\n        return animalRes\n\n    @components_run_stream_trace\n    def tool_eval(\n        self,\n        name: str,\n        streaming: bool,\n        origin_query: str,\n        **kwargs,\n    ) -> Union[Generator[str, None, None], str]:\n        \"\"\"\n        用于工具的执行，通过调用底层接口进行动物识别。\n        \n        Args:\n            name (str): 工具名。\n            streaming (bool): 是否流式返回。\n            origin_query (str): 用户原始query。\n            **kwargs: 工具调用的额外关键字参数。\n        \n        Returns:\n            Union[Generator[str, None, None], str]: 动物识别结果，包括识别出的动物类别和相应的置信度信息。\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        img_name = kwargs.get(\"img_name\", \"\")\n        img_url = kwargs.get(\"img_url\", \"\")\n        file_urls = kwargs.get(\"file_urls\", {})\n        rec_res = self._recognize_w_post_process(img_name, img_url, file_urls, request_id=traceid)\n        if streaming:\n            yield rec_res\n        else:\n            return rec_res\n\n    def _recognize_w_post_process(self, img_name, img_url, file_urls, request_id=None) -> str:\n        r\"\"\"调底层接口对图片或图片url进行动物识别，并返回类别及其置信度\n                   参数:\n                       img_name (str): 图片文件名\n                       img_url (str): 图片url\n                       file_urls (dict): 文件名与对应文件url的映射\n                   返回：\n                       str: 动物识别结果，包括识别出的动物类别和相应的置信度信息\n        \"\"\"\n        req = AnimalRecognitionRequest()\n        if img_name in file_urls:\n            req.url = file_urls[img_name]\n        if img_url:\n            if img_url in file_urls:\n                img_url = file_urls[img_url]\n            req.url = img_url\n        req.top_num = TOP_NUM\n        req.baike_num = BAIKE_NUM\n        result = self._recognize(req, request_id=request_id)\n        result_dict = proto.Message.to_dict(result)\n        rec_res = \"模型识别结果为：\\n\"\n        for rec_info in result_dict['result']:\n            rec_res += \"类别: {} 置信度: {}\\n\".format(rec_info['name'], rec_info['score'])\n        return rec_res\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request_id (str) : 请求ID\n                data (dict) : 动物识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n"
  },
  {
    "path": "python/core/components/animal_recognize/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"animal recognize client.\"\"\"\nimport proto\n\nfrom typing import List\nfrom pydantic import BaseModel\n\n\nclass AnimalRecognitionRequest(proto.Message):\n    r\"\"\"动物识别请求体参数.\n            属性:\n                image (str):\n                    可选。图像内容的base64编码。\n                url (str):\n                    可选。图像的URL地址，经过base64编码。\n                    图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n                top_num (int):\n                    返回预测得分top结果数，默认为6\n                baike_num (int):\n                    控制返回结果是否带有百科信息，默认为0，不返回\n            必须设置image或url属性之一，如果两者都设置了，将使用image属性。\n        \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    top_num: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    baike_num: int = proto.Field(\n        proto.INT64,\n        number=4,\n    )\n\n\nclass AnimalRecognitionResponse(proto.Message):\n    \"\"\"动物识别响应消息。\n\n        属性:\n            request_id (str): 请求ID。\n            log_id (int): 用于问题识别的唯一日志ID。\n            result (List[AnimalRecognitionRes]): 动物识别结果列表。\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=2,\n    )\n    result: 'AnimalRecognitionRes' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=3,\n        message='AnimalRecognitionRes',\n    )\n\n\nclass AnimalRecognitionRes(proto.Message):\n    \"\"\"动物识别结果详情。\n\n        属性:\n            name (str): 请求ID。\n            score (int): 用于问题识别的唯一日志ID。\n            baike_info (AnimalBaikeInfo): 动物识别百科信息。\n    \"\"\"\n    name: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    score: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    baike_info: 'AnimalBaikeInfo' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=3,\n        message=\"AnimalBaikeInfo\",\n    )\n\n\nclass AnimalBaikeInfo(proto.Message):\n    \"\"\"物体识别百科信息。\n\n           属性:\n               baike_url (str): 与识别结果对应的百度百科页面的URL。\n               image_url (str): 与识别结果相关联的图像的URL。\n               description (str): 百度百科提供的识别结果的描述。\n       \"\"\"\n    baike_url: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    image_url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    description: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass AnimalRecognitionInMsg(BaseModel):\n    \"\"\" 动物识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''\n    url: str = \"\"\n\n\nclass AnimalRes(BaseModel):\n    \"\"\"动物识别对象信息\n\n        属性:\n            name (str): 动物名称，示例：蒙古马\n            score (str): 置信度，示例：0.5321\n    \"\"\"\n    name: str\n    score: str\n\n\nclass AnimalRecognitionOutMsg(BaseModel):\n    r\"\"\"识别结果列表\"\"\"\n    result: List[AnimalRes]  # 结果列表\n"
  },
  {
    "path": "python/core/components/asr/README.md",
    "content": "# 短语音识别-极速版 (Automatic Speech Recognition) \n\n## 简介\n短语音识别 (Automatic Speech Recognition) 可以将音频流实时识别为文字，并返回每句话的开始和结束时间，适用于手机语音输入、语音搜索、人机对话等语音交互场景。\n\n### 功能介绍\n通过极速API接口，将语音识别为文字，毫秒级响应，快速返回识别结果。\n\n### 特色优势\n采用领先国际的流式端到端建模方法SMLTA，近场普通话语音识别准确率可达98%；采用最新识别解码技术，识别速度提升5倍以上，极速返回识别结果；专有GPU服务集群、提供企业级的稳定服务，弹性灵活的高并发承载及高可靠性保障。\n\n### 应用场景\n语音输入、语音搜索、人机对话等。\n\n## 基本用法\n\n下面是短语音识别的代码示例：\n\n```python\nimport os\nimport requests\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nasr = appbuilder.ASR()\n\naudio_file_url = \"https://bj.bcebos.com/v1/appbuilder/asr_test.pcm?authorization=bce-auth-v1\" \\\n                   \"%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A56%3A41Z%2F-1%2Fhost\" \\\n                   \"%2Fa6c4d2ca8a3f0259f4cae8ae3fa98a9f75afde1a063eaec04847c99ab7d1e411\"\naudio_data = requests.get(audio_file_url).content\ncontent_data = {\"audio_format\": \"pcm\", \"raw_audio\": audio_data, \"rate\": 16000}\nmsg = appbuilder.Message(content_data)\nout = asr.run(msg)\nprint(out.content)\n\n# {'result': ['北京科技馆。']}\n```\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|message |String  |是 |输入的消息，用于模型的主要输入内容。这是一个必需的参数，语音时长最长为60S| Message(content={\"raw_audio\": b\"...\"}) |\n|audio_format|String|是 |定义语言文件的格式，包括\"pcm\"、\"wav\"、\"amr\"，默认值为\"pcm\"| pcm    |\n|rate|Integer|是 |定义录音采样率，固定值16000| 16000  |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer|是 |HTTP重试次数| 3      |\n\n### 响应参数\n|参数名称 | 参数类型         |描述 |示例值|\n|--------|--------------|----|------|\n|result  | List[String] |返回结果|[\"北京科技馆。\"]|\n### 响应示例\n```json\n{\"result\": [\"北京科技馆。\"]}\n```\n### 错误码\n| 错误码 |描述|\n|---|---|\n| 0 |success|\n| 2000  |data empty|\n\n## 高级用法\n\n目前该模块仅提供基础的语音识别功能。\n\n\n## 更新记录和贡献\n* 短语音识别能力 (2023-12)\n"
  },
  {
    "path": "python/core/components/asr/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/asr/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"ASR component.\n\"\"\"\nimport os\nimport uuid\nimport json\n\nimport requests\nimport tempfile\nfrom urllib.parse import urlparse\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.components.asr.model import ShortSpeechRecognitionRequest, ShortSpeechRecognitionResponse, \\\n    ASRInMsg, ASROutMsg\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nDEFAULT_AUDIO_MAX_DURATION = 55 * 1000  # 55s\n# 参考短语音极速版API(https://ai.baidu.com/ai-doc/SPEECH/Jlbxdezuf)\nDEFAULT_FRAME_RATE = 16000\n\n\nclass ASR(Component):\n    r\"\"\"\n    ASR组件，即对于输入的语音文件，输出语音识别结果\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        asr = appbuilder.ASR()\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        with open(\"xxxx.pcm\", \"rb\") as f:\n            audio_data = f.read()\n        content_data = {\"audio_format\": \"pcm\", \"raw_audio\": audio_data, \"rate\": 16000}\n        msg = appbuilder.Message(content_data)\n        out = asr.run(msg)\n        print(out.content) # eg: {\"result\": [\"北京科技馆。\"]}\n     \"\"\"\n    name = \"asr\"\n    version = \"v1\"\n\n    manifests = [\n        {\n            \"name\": \"asr\",\n            \"description\": \"对于输入的语音文件进行识别，输出语音识别结果。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入语音文件的url,根据url获取到语音文件\"\n                    },\n                    \"file_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别语音文件名,用于生成获取语音的url\"\n                    },\n                    \"file_type\": {\n                        \"type\": \"string\",\n                        \"description\": \"语音文件类型,支持pcm/wav/amr/m4a\",\n                        \"enum\": [\"pcm\", \"wav\", \"amr\", \"m4a\"]\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"file_url\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"file_name\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, audio_format: str = \"pcm\", rate: int = 16000,\n            timeout: float = None, retry: int = 0, **kwargs) -> Message:\n        r\"\"\"\n        执行语音识别操作，并返回识别结果。\n        \n        Args:\n            message (Message): 输入消息对象，包含待识别的音频数据。该参数为必需项，格式如：Message(content={\"raw_audio\": b\"...\"})。\n            audio_format (str, optional): 音频文件格式，支持pcm/wav/amr/m4a，不区分大小写，推荐使用pcm格式。默认为\"pcm\"。\n            rate (int, optional): 音频采样率，固定为16000。默认为16000。\n            timeout (float, optional): HTTP请求超时时间。默认为None。\n            retry (int, optional): HTTP请求重试次数。默认为0。\n        \n        Returns:\n            Message: 语音识别结果，格式如：Message(content={\"result\": [\"识别结果\"]})。\n        \"\"\"\n        inp = ASRInMsg(**message.content)\n        request = ShortSpeechRecognitionRequest()\n        request.format = audio_format\n        request.rate = rate\n        request.cuid = str(uuid.uuid4())\n        request.dev_pid = \"80001\"\n        request.speech = inp.raw_audio\n        traceid = kwargs.get(\"traceid\", \"\")\n        response = self._recognize(request, timeout, retry, request_id=traceid)\n        out = ASROutMsg(result=list(response.result))\n        return Message(content=out.model_dump())\n\n    def _recognize(\n            self,\n            request: ShortSpeechRecognitionRequest,\n            timeout: float = None,\n            retry: int = 0,\n            request_id: str = None,\n    ) -> ShortSpeechRecognitionResponse:\n        \"\"\"\n        使用给定的输入并返回语音识别的结果。\n\n        参数:\n            request (obj:`ShortSpeechRecognitionRequest`): 输入请求，这是一个必需的参数。\n            timeout (float, 可选): 请求的超时时间。\n            retry (int, 可选): 请求的重试次数。\n\n        返回:\n            obj:`ShortSpeechRecognitionResponse`: 接口返回的输出消息。\n        \"\"\"\n        ContentType = \"audio/\" + request.format + \";rate=\" + str(request.rate)\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = ContentType\n        params = {\n            'dev_pid': request.dev_pid,\n            'cuid': request.cuid\n        }\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        response = self.http_client.session.post(self.http_client.service_url(\"/v1/bce/aip_speech/asrpro\"),\n                                                 params=params, headers=headers, data=request.speech, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        response = ShortSpeechRecognitionResponse.from_json(payload=json.dumps(data))\n        response.request_id = request_id\n        return response\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n\n            参数:\n                request (dict) : 短语音识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"err_no\" in data and \"err_msg\" in data:\n            if data[\"err_no\"] != 0:\n                raise AppBuilderServerException(\n                    request_id=request_id,\n                    service_err_code=data[\"err_no\"],\n                    service_err_message=data[\"err_msg\"]\n                )\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool, **kwargs):\n        \"\"\"\n        评估给定文件名或文件URL的语音识别结果。\n        \n        Args:\n            name (str): 函数调用名称。\n            streaming (bool): 是否以流的方式返回结果。\n            **kwargs: 关键字参数，用于指定文件名、文件URL等参数。\n        \n        Returns:\n            如果streaming为True，则通过生成器逐个返回包含识别结果的消息对象；\n            如果streaming为False，则返回包含识别结果的JSON字符串。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果未设置文件名或文件URL不存在，则抛出此异常。\n        \n        \"\"\"\n        file_url = kwargs.get(\"file_url\", None)\n        if not file_url:\n            file_urls = kwargs.get(\"file_urls\", {})\n            file_path = kwargs.get(\"file_name\", None)\n            if not file_path:\n                raise InvalidRequestArgumentError(\"request format error, file name is not set\")\n            file_name = os.path.basename(file_path)\n            file_url = file_urls.get(file_name, None)\n            if not file_url:\n                raise InvalidRequestArgumentError(\n                    f\"request format error, file {file_url} url does not exist\"\n                )\n\n        _, file_type = os.path.splitext(os.path.basename(urlparse(file_url).path))\n        file_type = file_type.strip('.')\n\n        audio_file = tempfile.NamedTemporaryFile(\"wb\", suffix=file_type)\n        audio_file.write(requests.get(file_url).content)\n\n        raw_audios = _convert(audio_file.name, file_type)\n        text = \"\"\n        for raw_audio in raw_audios:\n            content_data = {\"audio_format\": file_type, \"raw_audio\": raw_audio, \"rate\": DEFAULT_FRAME_RATE}\n            msg = Message(content_data)\n            out = self.run(msg)\n            text += \"\".join(out.content[\"result\"])\n        results = {\"识别结果\": text}\n        audio_file.close()\n        res = json.dumps(results, ensure_ascii=False, indent=4)\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": res,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": 'user',\n            }\n        else:\n            return res\n\n\ndef _convert(path, file_type):\n    from pydub import AudioSegment\n    if file_type.lower() == \"mp3\":\n        audio = AudioSegment.from_mp3(path)\n    elif file_type.lower() == \"wav\":\n        audio = AudioSegment.from_wav(path)\n    # 如果是pcm格式，则直接读取并返回\n    elif file_type.lower() == \"pcm\":\n        with open(path, \"rb\") as f:\n            return [f.read()]\n    else:\n        # pydub自动检测音频类型\n        audio = AudioSegment.from_wav(path)\n    # 如果取样率为16000且时长小于60s，则直接读取音频并返回\n    if (audio.frame_rate == DEFAULT_FRAME_RATE and audio.frame_count() * 1000\n            / audio.frame_rate < DEFAULT_AUDIO_MAX_DURATION):\n        with open(path, \"rb\") as f:\n            return [f.read()]\n    audio = audio.set_frame_rate(DEFAULT_FRAME_RATE)\n    total_milliseconds = int(audio.frame_count() * 1000 / audio.frame_rate)\n    start = 0\n    raw_audios = []\n    while start < total_milliseconds:\n        end = start + DEFAULT_AUDIO_MAX_DURATION\n        if start + DEFAULT_AUDIO_MAX_DURATION > total_milliseconds:\n            end = total_milliseconds\n        audio_seg = audio[start:end]\n        audio_seg_file = tempfile.NamedTemporaryFile(\"wb\", suffix=\"wav\")\n        try:\n            audio_seg.export(audio_seg_file.name, format=\"wav\")\n            with open(audio_seg_file.name, \"rb\") as f:\n                raw_audios.append(f.read())\n        finally:\n            audio_seg_file.close()\n        start = end\n    return raw_audios\n\n\n\n"
  },
  {
    "path": "python/core/components/asr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"ASR model.py.\n\"\"\"\nfrom typing import MutableSequence, List\n\nimport proto\nfrom pydantic import BaseModel\n\n\nclass ShortSpeechRecognitionRequest(proto.Message):\n    r\"\"\"短语音识别的请求体\n         参数:\n            format(str):\n                语音文件的格式，pcm/wav/amr/m4a。不区分大小写。推荐pcm文件。\n            rate(int):\n                采样率，16000，固定值。\n            cuid(str):\n                用户唯一标识，用来区分用户，计算UV值。建议填写能区分用户的机器 MAC 地址或 IMEI 码，长度为60字符以内。\n            dev_pid(int):\n                80001（极速版输入法模型）\n            speech(int):\n                本地语音文件的的二进制语音数据。\n         \"\"\"\n    format: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    rate: int = proto.Field(\n        proto.INT64,\n        number=2,\n    )\n    cuid: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    dev_pid: str = proto.Field(\n        proto.STRING,\n        number=4,\n    )\n    speech: bytes = proto.Field(\n        proto.BYTES,\n        number=5,\n    )\n\n\nclass ShortSpeechRecognitionResponse(proto.Message):\n    r\"\"\"短语音识别结果返回体.\n\n         参数:\n            request_id(str):\n                网关层的请求ID.\n            err_no(int):\n                算子层的错误码.\n            err_msg(str):\n                算子层的错误信息.\n            corpus_no(str):\n            sn(str):\n                语音数据唯一标识，系统内部产生。如果反馈及debug请提供sn。\n            result(MutableSequence[str]):\n                识别结果数组，返回1个最优候选结果。utf-8 编码。\n         \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n\n    err_no: int = proto.Field(\n        proto.INT32,\n        number=2,\n    )\n\n    err_msg: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    corpus_no: str = proto.Field(\n        proto.STRING,\n        number=4,\n    )\n\n    sn: str = proto.Field(\n        proto.STRING,\n        number=5,\n    )\n    result: MutableSequence[str] = proto.RepeatedField(\n        proto.STRING,\n        number=6\n    )\n\n\nclass ASRInMsg(BaseModel):\n    \"\"\" ASR输入message.\n        参数:\n            raw_audio(bytes):\n                原始的语音文件字节数组.\n\n    \"\"\"\n    raw_audio: bytes\n\n\nclass ASROutMsg(BaseModel):\n    \"\"\" ASR输出message.\n\n        参数:\n            result(List[str]):\n                输出识别后的文本结果.\n    \"\"\"\n    result: List[str]\n\n"
  },
  {
    "path": "python/core/components/dish_recognize/README.md",
    "content": "# 菜品识别（DishRecognition）\n\n## 简介\n菜品识别组件（DishRecognition）可以识别超过9千种菜品，可准确识别图片中的菜品名称、卡路里，适用于多种客户识别菜品的业务场景中。\n\n### 功能介绍\n识别超过9千种菜品，适用于识别只含有单个菜品的图片，接口返回菜品的名称、卡路里等综合信息\n\n### 特色优势\n识别精度高，响应速度快\n\n### 应用场景\n1. 餐饮健康：根据拍摄照片，识别图片中菜品名称，获取菜品参考卡路里含量和百科信息，可结合识别结果进一步提供饮食推荐、健康管理方案等相关功能，增强用户体验，广泛应用于餐饮娱乐类和健康管理类APP中\n2. 智能结算：根据拍摄照片，识别图片中菜品名称和位置，提高结算效率，减少人工录入成本，广泛应用于餐饮行业中\n\n## 基本用法\n通过如下示例代码可以快速开始使用菜品识别组件：\n\n示例图片为：\n\n![菜品识别示例图片](https://bj.bcebos.com/v1/appbuilder/dish_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A58%3A25Z%2F-1%2Fhost%2F7b8fc08b2be5adfaeaa4e3a0bb0d1a1281b10da3d6b798e116cce3e37feb3438)\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\ndish_recognition = appbuilder.DishRecognition()\n\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/dish_recognize_test.jpg?\" \\\n          \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T\" \\\n          \"10%3A58%3A25Z%2F-1%2Fhost%2F7b8fc08b2be5adfaeaa4e3a0bb0d1a1281b10da\" \\\n          \"3d6b798e116cce3e37feb3438\"\nraw_image = requests.get(image_url).content\n\nresp = dish_recognition(appbuilder.Message({\"raw_image\": raw_image}))\n# 输出{'result': [{'name': '剁椒鱼头', 'calorie': '127'}]}\nprint(resp.content)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|message |obj:`Message`  |是 |待识别的图片字节流数据或url| Message(content={\"raw_image\": b\"...\"}) 或Message(content={\"url\": \"...\"}) |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer|否 |HTTP重试次数| 3      |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |List[Object]  |返回结果|[{\"name\": \"剁椒鱼头\", \"calorie\": \"127\"}]|\n|result[0].name    |String  |菜品名称|剁椒鱼头|\n|result[0].calorie |String  |菜品卡路里含量|127|\n\n\n### 响应示例\n```json\n{\"result\": [{\"name\": \"剁椒鱼头\", \"calorie\": \"127\"}]}\n```\n\n\n## 更新记录和贡献\n* 菜品识别 (2024-01)"
  },
  {
    "path": "python/core/components/dish_recognize/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/dish_recognize/component.py",
    "content": "\n# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n菜品识别组件.\n\"\"\"\nimport base64\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.dish_recognize.model import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass DishRecognition(Component):\n    \"\"\"\n    菜品识别组件，适用于识别只含有单个菜品的图片，返回识别的菜品名称和卡路里信息\n    \n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        dish_recognition = appbuilder.DishRecognition()\n\n        with open(\"xxxx.jpg\", \"rb\") as f:\n            resp = dish_recognition(appbuilder.Message({\"raw_image\": f.read()}))\n            # 输出示例 {'result': [{'name': '剁椒鱼头', 'calorie': '127'}]}\n            print(resp.content)\n    \"\"\"\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        根据输入图片进行菜品识别。\n\n        Args:\n            message (Message): 输入待识别图片，支持传图片二进制流和图片URL。\n            timeout (float, optional): 请求超时时间，默认为 None。\n            retry (int, optional): 重试次数，默认为 0。\n\n        Returns:\n            Message: 包含菜品识别结果的输出消息。例如，Message(content={'result': [{'name': '剁椒鱼头', 'calorie': '127'}]})\n\n        \"\"\"\n        inp = DishRecognitionInMsg(**message.content)\n        req = DishRecognitionRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        result = self._recognize(req, timeout=timeout, retry=retry)\n        result_dict = proto.Message.to_dict(result)\n        out = DishRecognitionOutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: DishRecognitionRequest, timeout: float = None,\n                   retry: int = 0) -> DishRecognitionResponse:\n        \"\"\"\n        发起食物识别请求并返回识别结果。\n\n        :param request: 包含执行识别所需信息的 DishRecognitionRequest 对象。\n        :param timeout: 请求超时时间（秒），默认为 None。\n        :param retry: 请求失败时的重试次数，默认为 0。\n        :return: 包含食物识别结果的响应对象。\n        \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        if not request.top_num:\n            request.top_num = 1\n        if not request.filter_threshold:\n            request.filter_threshold = 0.95\n        request_data = DishRecognitionRequest.to_dict(request)\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header()\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v2/dish\")\n        response = self.http_client.session.post(url, headers=headers, data=request_data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        if \"error_code\" in data and \"error_msg\" in data:\n            raise AppBuilderServerException(request_id=request_id, service_err_code=data[\"error_code\"], service_err_message=data[\"error_msg\"])\n        return DishRecognitionResponse(data)\n"
  },
  {
    "path": "python/core/components/dish_recognize/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n菜品识别model\n\"\"\"\nimport proto\nimport pydantic\nfrom typing import Optional, List\n\n\nclass DishRecognitionRequest(proto.Message):\n    \"\"\"\n    菜品识别请求的请求体。\n\n    Attributes:\n\t    image (str): 表示图像数据的 Base64 编码字符串。\n        url (str): 图像的 URL，用于识别。\n        top_num (int): 要返回的顶部结果的数量。\n        filter_threshold (float): 过滤识别结果的置信度阈值。\n        baike_num (int): 要返回的百科结果的数量。\n\n    Note:\n        'image' 或 'url' 字段至少传一个，两个都传默认使用 'image'。\n    \"\"\"\n\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    top_num: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    filter_threshold: float = proto.Field(\n        proto.FLOAT,\n        number=4,\n    )\n    baike_num: int = proto.Field(\n        proto.INT32,\n        number=5,\n    )\n\n\nclass DishRecognitionResponse(proto.Message):\n    \"\"\"\n    表示菜品识别返回的响应结果。\n\n    Attributes:\n        log_id (str): 识别请求的唯一标识符。\n        request_id (str): 识别请求的唯一标识符。\n        result_num (int): 返回的识别结果数量。\n        result (List[DishRecognitionRes]): 识别结果列表。\n    \"\"\"\n    log_id: str = proto.Field(\n        proto.INT64,\n        number=1,\n    )\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    result_num: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    result: \"DishRecognitionRes\" = proto.RepeatedField(\n        proto.MESSAGE,\n        number=4,\n        message='DishRecognitionRes',\n    )\n\n\nclass DishRecognitionRes(proto.Message):\n    \"\"\"\n    表示菜品识别结果。\n\n    Attributes:\n        name (str): 识别的菜品名称。\n        calorie (str): 识别的菜品热量信息。\n        has_calorie (bool): 指示识别菜品是否返回了热量信息。\n        probability (str): 识别置信度分数。\n        baike_info (DishBaikeInfo): 与被识别菜品相关的百度百科信息。\n    \"\"\"\n    name: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    calorie: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    has_calorie: bool = proto.Field(\n        proto.BOOL,\n        number=3,\n    )\n    probability: str = proto.Field(\n        proto.STRING,\n        number=4,\n    )\n    baike_info: \"DishBaikeInfo\" = proto.Field(\n        proto.MESSAGE,\n        number=5,\n        message='DishBaikeInfo',\n    )\n\n\nclass DishBaikeInfo(proto.Message):\n    \"\"\"\n    与被识别菜品相关的百度百科信息。\n\n    Attributes:\n        baike_url (str): 识别菜品的百度百科页面URL。\n        image_url (str): 百度百科中与被识别菜品相关的图像URL。\n        description (str): 百度百科中关于被识别菜品的描述或信息。\n    \"\"\"\n    baike_url: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    image_url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    description: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass DishRecognitionInMsg(pydantic.BaseModel):\n    \"\"\"\n    菜品识别的输入消息模型。\n\n    :param raw_image: 图像的字节数组，包含要识别的菜品图像的原始数据。\n                      此字段是可选的，可以为 None。\n    :param url: 图像的可下载URL。如果提供，则将从此URL下载图像进行识别。\n                      此字段也是可选的，可以为 None。\n    注意：raw_image 和 url 至少传一个，不能同时为 None，两个都传默认使用 raw_image。\n    \"\"\"\n    raw_image: bytes = None\n    url: str = None\n\n\nclass DishRecognitionResult(pydantic.BaseModel):\n    \"\"\"\n    表示菜品识别结果。\n\n    Attributes:\n        name (str): 识别到的菜品名称。\n        calorie (Optional[str]): 菜品的卡路里信息。如果未返回卡路里信息，默认为 None。\n    \"\"\"\n    name: str\n    calorie: Optional[str] = None\n\n\nclass DishRecognitionOutMsg(pydantic.BaseModel):\n    \"\"\"\n    表示菜品识别组件返回的结构。\n\n    Attributes:\n        result (List[DishRecognitionResult]): 包含菜品识别结果的列表。\n    \"\"\"\n    result: List[DishRecognitionResult]\n"
  },
  {
    "path": "python/core/components/doc_crop_enhance/README.md",
    "content": "# 文档矫正增强 (DocCropEnhance) \n\n## 简介\n文档矫正增强 (DocCropEnhance) 可对图片中的文件、卡证、票据等内容进行四角点检测定位，提取主体内容并对其进行矫正，同时可选图片增强效果进一步提升图片清晰度，达到主体检测矫正并增强的目的，提升图片整体质量\n### 功能介绍\n* 文档矫正增强\n\n  支持对文档中的文件、卡证等内容进行主体检测与矫正，同时可开启增强功能\n### 特色优势\n* 技术领先\n\n  模型针对图片倾斜、弯曲等情况进行专项优化，鲁棒性强，在处理图像的同时，可完整保留原有文档内容\n* 能力丰富\n  \n  提供文档图片矫正、增强、去手写等多项能力，全方位提升图像质量，适用于采集质量把控、文字识别效果提升等多应用场景\n### 应用场景\n   旨在改善文档图像质量，提升可读性和可处理性，广泛应用于图像处理和分析、归档和数字化等领域\n## 基本用法\n\n下面是文档矫正增强代码示例：\n\n示例图片为\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder/doc_enhance_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A51%3A09Z%2F-1%2Fhost%2F2020d2433da471b40dafa933d557a1ebe8abf28df78010f865e45dfcd6dc3951)\n\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/doc_enhance_test.png?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01\" \\\n            \"-24T12%3A51%3A09Z%2F-1%2Fhost%2F2020d2433da471b40dafa933d557a1e\" \\\n            \"be8abf28df78010f865e45dfcd6dc3951\"\nraw_image = requests.get(image_url).content\n# 创建文档矫正增强组件实例\ndoc_crop_enhance = appbuilder.DocCropEnhance()\n# 执行操作并获取结果\nout = doc_crop_enhance.run(appbuilder.Message(content={\"raw_image\": raw_image}),enhance_type=3)\nprint(out.content)\n# {\"image_processed\": \"...\", 'points': [{'y': 1371, 'x': 0}, {'x': 0, 'y': 0}, {'x': 997, 'y': 0}, {'x': 994, 'y': 1371}]}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称         | 参数类型    | 是否必须 | 描述                                                                                                                          | 示例值                                            |\n|--------------|---------|------|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------|\n| message      | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数                                                                                                 | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n| enhance_type | Integer | 否    | 选择是否开启图像增强功能，如开启可选择增强效果，可选值如下：enhance_type =0：默认值，不开启增强功能，enhance_type = 1：去阴影，enhance_type = 2：增强并锐化，enhance_type = 3：黑白滤镜 | 0                                              |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry        | Integer | 否    | HTTP重试次数                                                                                                                    | 3                                              |\n\n### 响应参数\n| 参数名称            | 参数类型    | 描述                                        | 示例值                                                                                     |\n|-----------------|---------|-------------------------------------------|-----------------------------------------------------------------------------------------|\n| image_processed | String  | 返回处理后的图片，base64编码                         | \"...\"                                                                                   |\n| points          | Array[] | 检测到的图片内主体在原图中的四角点坐标 | [{ \"x\": 0, \"y\": 1371 },{ \"x\": 0, \"y\": 0 },{ \"x\": 997, \"y\": 0 },{ \"x\": 994, \"y\": 1371 }] |\n\n### 响应示例\n```json\n{\n  \"image_processed\": \"...\",\n  \"points\": [\n    { \"x\": 0, \"y\": 1371 },\n    { \"x\": 0, \"y\": 0 },\n    { \"x\": 997, \"y\": 0 },\n    { \"x\": 994, \"y\": 1371 }\n  ]\n}\n```\n\n## 高级用法\n\n目前该模块仅提供基础的文档矫正增强功能。\n\n\n## 更新记录和贡献\n* 文档矫正增强能力 (2024-01)"
  },
  {
    "path": "python/core/components/doc_crop_enhance/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/doc_crop_enhance/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"doc_crop_enhance component.\"\"\"\n\nimport base64\nimport json\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.components.doc_crop_enhance.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nenhance_type_set = [0, 1, 2, 3]\n\n\nclass DocCropEnhance(Component):\n    r\"\"\"\n       对图片中的文件、卡证、票据等内容进行四角点检测定位，提取主体内容并对其进行矫正，同时可选图片增强效果进一步提升图片清晰度，\n       达到主体检测矫正并增强的目的，提升图片整体质量\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           doc_crop_enhance = appbuilder.DocCropEnhance()\n           with open(\"./doc_enhance_test.png\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n           print(out.content)\n\n    \"\"\"\n    \n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, enhance_type: int = 0, timeout: float = None, retry: int = 0) -> Message:\n        r\"\"\"\n        文档矫正增强\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行操作。举例: Message(content={\"raw_image\": b\"...\",\n            \"enhance_type\": 3})或 Message(content={\"url\": \"https://image/download/url\"})。\n            enhance_type (int, 可选): 选择是否开启图像增强功能，如开启可选择增强效果，可选值如下：\n                - 0：默认值，不开启增强功能\n                - 1：去阴影\n                - 2：增强并锐化\n                - 3：黑白滤镜。\n            timeout (float, 可选): HTTP超时时间\n            retry (int, 可选): HTTP重试次数\n        \n        Returns:\n            Message: 识别结果。举例: Message(name=msg, content={'image_processed': '...',\n            'points': [{'x': 220, 'y': 705}, {'x': 240, 'y': 0}, {'x': 885, 'y': 2}, {'x': 980, 'y': 759}]},\n            mtype=dict)\n        \"\"\"\n        inp = DocCropEnhanceInMsg(**message.content)\n        req = DocCropEnhanceRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        req.scan_type = 3\n        if enhance_type not in enhance_type_set:\n            raise InvalidRequestArgumentError(f\"mismatched argument enhance_type, expected enhance_type in {enhance_type_set}\")\n        req.enhance_type = enhance_type\n        result = self._recognize(req, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = DocCropEnhanceOutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: DocCropEnhanceRequest, timeout: float = None,\n                   retry: int = 0) -> DocCropEnhanceResponse:\n        r\"\"\"文档矫正增强调用\n                   参数:\n                       request (obj: `DocCropEnhanceRequest`) : 文档矫正增强输入参数\n                   返回：\n                       response (obj: `DocCropEnhanceResponse`): 文档矫正增强返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request argument error, one of image or url must be set\")\n\n        req = json.dumps(DocCropEnhanceRequest.to_dict(request))\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header()\n        headers['content-type'] = 'application/json'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/doc_crop_enhance\")\n        response = self.http_client.session.post(url, headers=headers, data=req, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        res = DocCropEnhanceResponse.from_json(json.dumps(data))\n        res.request_id = request_id\n        return res\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 文档矫正增强body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n"
  },
  {
    "path": "python/core/components/doc_crop_enhance/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"doc_crop_enhance model.\"\"\"\nimport proto\n\nfrom typing import List, Dict\nfrom pydantic import BaseModel\n\n\nclass DocCropEnhanceRequest(proto.Message):\n    r\"\"\"文档矫正增强请求体参数.\n            属性:\n                image (str):\n                    可选。图像内容的base64编码。\n                url (str):\n                    可选。图像的URL地址，经过base64编码。\n                    图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n                scan_type (int):\n                    可选。选择是否对图片内主体内容进行四角点增强或矫正。\n                    - scan_type = 1：只做检测，不对主体进行矫正，返回主体四角点坐标，可用作前端页面展示\n                    - scan_type = 2：只做矫正，需传入主体四角点坐标，使用传入的坐标值对主体进行扣取及矫正\n                    - scan_type = 3：默认值，检测并矫正，返回主体在原图中的四角点坐标以及矫正后的图像\n                enhance_type (int):\n                    可选。选择是否开启图像增强功能，如开启可选择增强效果，可选值如下：\n                    - enhance_type = 0：默认值，不开启增强功能\n                    - enhance_type = 1：去阴影\n                    - enhance_type = 2：增强并锐化\n                    - enhance_type = 3：黑白滤镜。\n            必须设置image或url属性之一，如果两者都设置了，将使用image属性。\n        \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    scan_type: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    enhance_type: int = proto.Field(\n        proto.INT32,\n        number=4,\n    )\n\n\nclass DocCropEnhanceResponse(proto.Message):\n    \"\"\"文档矫正增强识别响应消息。\n\n        属性:\n            request_id (str): 请求ID。\n            log_id (int): 用于问题识别的唯一日志ID。\n            image_processed (str):\n                返回处理后的图片，base64编码，如请求参数 scan_type = 1 & enhance_type =0，则返回原图。\n            points (List[DocLocation]):\n                检测到的图片内主体在原图中的四角点坐标，scan_type = 2 时不返回此参数。\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=2,\n    )\n    image_processed: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    points: 'DocLocation' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=4,\n        message='DocLocation',\n    )\n\n\nclass DocLocation(proto.Message):\n    \"\"\"图片四角点坐标。\n\n        属性:\n            x (int): x坐标。\n            y (int): y坐标。\n    \"\"\"\n    x: int = proto.Field(\n        proto.INT64,\n        number=1,\n    )\n    y: int = proto.Field(\n        proto.INT64,\n        number=2,\n    )\n\n\nclass DocCropEnhanceInMsg(BaseModel):\n    \"\"\" 文档矫正增强识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n            enhance_type(int): 可选参数\n                选择是否开启图像增强功能，如开启可选择增强效果，可选值如下：\n                - enhance_type = 0：默认值，不开启增强功能\n                - enhance_type = 1：去阴影\n                - enhance_type = 2：增强并锐化\n                - enhance_type = 3：黑白滤镜\n    \"\"\"\n    raw_image: bytes = b''\n    url: str = \"\"\n\n\nclass DocCropEnhanceOutMsg(BaseModel):\n    \"\"\" 文档矫正增强识别响应体\n\n        属性:\n            image_processed(str): 处理后的图片，base64编码\n            points(List[Dict[str, int]]): 检测主体在原图中的四角点坐标\n    \"\"\"\n    image_processed: str\n    points: List[Dict[str, int]]\n"
  },
  {
    "path": "python/core/components/doc_format_converter/README.md",
    "content": "# 文档格式转换 (DocFormatConverter)\n\n## 简介\n文档格式转换：识别文档内文字及版面布局，可将多种类型的版式文档转换为流式文档。\n\n### 功能介绍\n支持识别图片中文档版面布局，提取文字内容，并转换为保留原文档版式的Word/Excel，方便二次编辑和复制。\n\n### 特色优势\n1、多种格式互转：支持多种格式相互转换，覆盖全面；\n\n2、图像预处理：支持对文件朝向检测、印章/水印去除后等预处理，提升格式转换效果。\n\n### 应用场景\n文档电子化：标题/正文/表格/配图等版式信息精准识别与还原，快速录入文档内容，实现纸质档案电子化。\n\n## 基本用法\n\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\ndoc_format_converter = appbuilder.DocFormatConverter()\n\nimage_url = \"https://ai-cape-strategy-data.bj.bcebos.com/document-restructure/1EF33F9307451C9413D5D1160.jpg\"\n\nresp = doc_format_converter(appbuilder.Message({\"file_path\": image_url}))\n# 输出{\"word_url\":\"\", \"excel_url\":\"\"}\nprint(resp.content)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称       |参数类型 |是否必须 | 描述          | 示例值  |\n|------------|--------|--------|-------------|------|\n| file_path    |String  |是 | 需要转换的文件的本地存储路径或远程URL,支持图片, URL长度不超过1024字节，图片base64编码后大小不超过4M，最短边至少15px，最长边最大4096px,支持jpg/jpeg/png/bmp格式 | \"./test.png\" |\n\n\n### 响应参数\n| 参数名称        |参数类型 | 描述   | 示例值                     |\n|-------------|--------|------|-------------------------|\n| word_url |Message  | 还原后的word文件的下载地址,文件识别失败时返回空 | \"http://bos.bce.cn/dsfkjc.docx\"|\n| excel_url |Message  | 还原后的Excel文件的下载地址(源文件中含表格时才会输出),若文档中没有表格则返回\"\" | \"http://bos.bce.cn/dsfkjc.xlsx\"|\n\n### 常见错误信息\n| 错误信息                  | 描述          |\n|-------------------------|-------------|\n|IAM Certification failed  |IAM鉴权失败|\n|Check file failed!|文件检查错误,请检查文件大小以及URL是否符合要求  |\n\n## 更新记录和贡献\n* 文档格式转换 (2024-04)"
  },
  {
    "path": "python/core/components/doc_format_converter/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License."
  },
  {
    "path": "python/core/components/doc_format_converter/component.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n文档格式转换\n\"\"\"\nimport os\nimport json\nimport base64\nfrom typing import Dict, Any\nimport time\n\nimport requests\n\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.component import Component, Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.components.doc_format_converter.model import DocFormatConverterInMessage, \\\n                        DocFormatConverterOutMessage, \\\n                        DocFormatConverterSubmitRequest, DocFormatConverterSubmitResponse, \\\n                        DocFormatConverterQueryRequest, DocFormatConverterQueryResponse\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass DocFormatConverter(Component):\n    r\"\"\"\n    可识别图片/PDF文档版面布局，提取文字内容，并转换为保留原文档版式的Word、Excel文档，方便二次编辑和复制，\n    可支持含表格、印章、水印、手写等内容的文档。满足文档格式转换、企业档案电子化等信息管理需求。\n\n    Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           table_ocr = appbuilder.DocFormatConverter()\n           out = self.component.run(appbuilder.Message(content={\"file_path\": \"\"}))\n           print(out.content)\n    \"\"\"\n\n    name = \"doc_converter\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"doc_format_converter\",\n            \"description\": \"提供文档格式转换功能，包含图片转word、图片转excel、PDF转word、PDF转excel\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                     \"file_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待转换文件的文件名称\",\n                    },\n                    \"file_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待转换文件的URL地址\",\n                    },\n                    \"page_num\": {\n                        \"anyOf\": [\n                            {\"type\": \"string\"},\n                            {\"type\": \"integer\"}\n                        ],\n                        \"description\": \"待转换PDF文档的页码, 从1开始, 如果不传则默认转换全部页码\",\n                    }\n                },\n            \"anyOf\": [\n                    {\"required\": [\"file_name\"]},\n                    {\"required\": [\"file_url\"]}\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0, request_id: str = None) -> Message:\n        \"\"\"\n        将PDF、JPG、PNG、BMP等格式文件转换为Word、Excel格式，并返回转换后的文件URL。\n\n        Args:\n            message (Message): 包含待转换文件路径和页码信息的消息对象。\n            timeout (float, optional): 请求超时时间，单位为秒。默认为None，表示不设置超时时间。\n            retry (int, optional): 请求重试次数。默认为0，表示不重试。\n\n        Returns:\n            Message: 包含转换后文件URL的消息对象。\n            \n        Raises:\n            AppBuilderServerException: 文档格式转换服务发生错误时抛出。\n        \"\"\"\n        doc_message = DocFormatConverterInMessage(**message.content)\n        submit_request = DocFormatConverterSubmitRequest()\n\n        if doc_message.file_path.startswith(('http://', 'https://')):\n            # TODO 根据URL判断文件类型Refactor\n            if(\".pdf\" in doc_message.file_path):\n                submit_request.pdf_file = base64.b64encode(requests.get(doc_message.file_path).content)\n                if doc_message.page_num:\n                    submit_request.pdf_file_num = doc_message.page_num\n            else:\n                submit_request.url = doc_message.file_path\n        else:\n            if doc_message.file_path.endswith('.pdf'):\n                with open(doc_message.file_path, 'rb') as f:\n                    submit_request.pdf_file = base64.b64encode(f.read())\n                if doc_message.page_num:\n                    submit_request.pdf_file_num = doc_message.page_num\n            else:\n                with open(doc_message.file_path, 'rb') as f:\n                    submit_request.image =  base64.b64encode(f.read())\n        docConverterSubmitResponse = self.submitDocFormatConverterTask(submit_request, request_id=request_id)\n        taskId = docConverterSubmitResponse.result.task_id\n        TASK_PROGRESS_COMPLETED = 3\n        TASK_PROGRESS_FAILED = 4\n        if taskId:\n            task_request_time = 1\n            while True:\n                request = DocFormatConverterQueryRequest()\n                request.task_id = taskId\n                docConverterQueryResponse = self.queryDocFormatConverterTask(request, request_id=request_id)\n                if docConverterQueryResponse.result.ret_code is not None:\n                    task_progress = docConverterQueryResponse.result.ret_code\n                    if task_progress == TASK_PROGRESS_COMPLETED:\n                        break\n                    elif task_progress == TASK_PROGRESS_FAILED:\n                        raise AppBuilderServerException(f'doc convert task progress failed: {docConverterQueryResponse.error_msg}')\n                    # TODO 文档格式转换查询间隔Refactor\n                    if task_request_time <= 3:\n                        time.sleep(3)\n                    else:\n                        time.sleep(task_request_time)\n                    task_request_time += 1\n            word_url = docConverterQueryResponse.result.result_data.word\n            excel_url = docConverterQueryResponse.result.result_data.excel\n            out = DocFormatConverterOutMessage(word_url=word_url, excel_url=excel_url)\n            return Message(content=out.model_dump())\n        else:\n            raise AppBuilderServerException(f'service error when doc convert：{docConverterSubmitResponse.error_msg}')\n\n\n    @HTTPClient.check_param\n    def submitDocFormatConverterTask(\n        self,\n        request: DocFormatConverterSubmitRequest,\n        timeout: float = None, \n        retry: int = 0,\n        request_id: str = None,\n    ) -> DocFormatConverterSubmitResponse:\n        \"\"\"\n        提交任务\n        :param request: 请求参数\n        :type request: DocFormatConverterSubmitRequest\n        :return: 返回结果\n        :rtype: DocFormatConverterSubmitResponse\n        \"\"\"\n        url = self.http_client.service_url(\"/v1/bce/aip/text_mind/v1/doc_convert/request\",'/api')\n        data = json.loads(DocFormatConverterSubmitRequest.to_json(request, preserving_proto_field_name=True))\n        headers = self.http_client.auth_header(request_id)\n        headers['Content-Type'] = 'application/x-www-form-urlencoded'\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n\n        response = self.http_client.session.post(url, data=data, headers=headers, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        response = DocFormatConverterSubmitResponse.from_json(payload=json.dumps(data))\n        return response\n\n    @HTTPClient.check_param\n    def queryDocFormatConverterTask(\n        self,\n        request: DocFormatConverterQueryRequest,\n        timeout: float = None, \n        retry: int = 0,\n        request_id: str = None\n    ) -> DocFormatConverterQueryResponse:\n        \"\"\"\n        查询任务\n        :param request: 请求参数\n        :type request: DoFormatcConverterQueryRequest\n        :return: 返回结果\n        :rtype: DocFormatConverterSubmitResponse\n        \"\"\"\n        url = self.http_client.service_url(\"/v1/bce/aip/text_mind/v1/doc_convert/get_request_result\",'/api')\n        data = {\n            \"task_id\": request.task_id\n        }\n        data = json.loads(DocFormatConverterQueryRequest.to_json(request, preserving_proto_field_name=True))\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = \"application/x-www-form-urlencoded\"\n\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        response = self.http_client.session.post(url, data=data, headers=headers, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        response = DocFormatConverterQueryResponse.from_json(payload=json.dumps(data))\n        return response\n\n    @components_run_stream_trace\n    def tool_eval(self, streaming: bool, origin_query: str, **kwargs,):\n        \"\"\"\n        评估工具函数。\n        \n        Args:\n            streaming (bool): 是否流式输出。如果为True，则逐个生成文件URL；如果为False，则直接返回结果内容。\n            origin_query (str): 原始查询字符串。\n            **kwargs: 其他关键字参数，包括但不限于：\n                traceid (str): 请求的跟踪ID，用于日志追踪。\n                file_url (str): 文件的URL地址。如果为空，则从file_urls和file_name中获取。\n                file_urls (dict): 包含多个文件路径与URL的映射关系的字典。\n                file_name (str): 文件名。如果file_url为空，则从file_urls和file_name中获取file_url。\n                page_num (Union[int, str]): 需要处理的页面编号，如果为字符串，必须为纯数字。\n        \n        Returns:\n            如果streaming为True，则逐个生成包含文件URL的字典；如果streaming为False，则直接返回结果内容。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误，如page_num不是整数、file_url为空且无法从file_urls和file_name中获取file_url等。\n            AppBuilderServerException: 如果服务执行过程中出现异常。\n        \n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        file_url = kwargs.get(\"file_url\", None)\n        page_num = kwargs.get(\"page_num\", '')\n        if page_num:\n            if isinstance(page_num, int) or (isinstance(page_num, str) and page_num.isdigit()):\n                page_num = str(page_num)\n            else:\n                raise InvalidRequestArgumentError(\"request format error, page_num must be a integer\")\n        if not file_url or not (file_url.startswith(\"http\") or file_url.startswith(\"https\")):\n            file_urls = kwargs.get(\"file_urls\", {})\n            file_path = kwargs.get(\"file_name\", file_url)\n            if not file_path:\n                raise InvalidRequestArgumentError(\"request format error, file name is not set\")\n            file_name = os.path.basename(file_path)\n            file_url = file_urls.get(file_name, None)\n            if not file_url:\n                raise InvalidRequestArgumentError(\"request format error, file url is not set\")\n        try:\n            result = self.run(Message({\"file_path\": file_url, \"page_num\": page_num}), request_id=traceid)\n        except AppBuilderServerException:\n            raise\n        except Exception as e:\n            raise AppBuilderServerException(f'service error when doc convert：{e}')\n        if streaming:\n            yield {\n                \"type\": \"files\",\n                \"text\": [result.content['word_url'], result.content['excel_url']]\n            }\n        else:\n            return result.content"
  },
  {
    "path": "python/core/components/doc_format_converter/model.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"doc converter model.\"\"\"\nimport proto\nfrom datetime import date, datetime\n\nfrom typing import List, Dict\nfrom pydantic import BaseModel\n\n\nclass DocFormatConverterInMessage(BaseModel):\n    \"\"\" 文档格式转换输入message\n        属性:\n            file_path: 文件路径\n            pdf_file_num(str): 需要转换的PDF文件的对应页码, 从1开始\n    \"\"\"\n    file_path: str = None\n    page_num: str = None\n\n\nclass DocFormatConverterOutMessage(BaseModel):\n    \"\"\" 文档格式转换输出message\n        属性:\n            word_url(str): 转换后的word路径\n            excel_url(str): 转换后的excel路径\n    \"\"\"\n    word_url: str\n    excel_url: str\n\n\nclass DocFormatConverterSubmitRequest(proto.Message):\n    \"\"\"\n    文档格式转换提交请求类。\n    用于构建和提交文档格式转换任务所需的参数。\n    \"\"\"\n    image: bytes = proto.Field(\n        proto.STRING,\n        number=1,\n        optional=True,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n        optional=True,\n    )\n    pdf_file: str = proto.Field(\n        proto.STRING,\n        number=3,\n        optional=True,\n    )\n    pdf_file_num: str = proto.Field(\n        proto.STRING,\n        number=4,\n        optional=True,\n    )\n\n\nclass DocFormatConverterSubmitResponse(proto.Message):\n    \"\"\"文档格式转换提交响应类\"\"\"\n    class Result(proto.Message):\n        \"\"\"Result\"\"\"\n        task_id: str = proto.Field(proto.STRING, number=1)\n\n    success: bool = proto.Field(proto.BOOL, number=1)\n    log_id: int = proto.Field(proto.UINT64, number=2)\n    error_code: int = proto.Field(proto.INT32, number=3)\n    code: int = proto.Field(proto.INT32, number=4)\n    error_msg: str = proto.Field(proto.STRING, number=5)\n    message: str = proto.Field(proto.STRING, number=6)\n    result: Result = proto.Field(proto.MESSAGE, number=7, message=Result)\n\n\n\n\nclass DocFormatConverterQueryRequest(proto.Message):\n    \"\"\"\n    文档格式转换查询请求类。\n    用于查询文档格式转换任务所需的参数\n    \"\"\"\n    task_id = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n\n\nclass DocFormatConverterQueryResponse(proto.Message):\n    \"\"\"文档格式转换查询响应类\"\"\"\n    class Result(proto.Message):\n        \"\"\"Result\"\"\"\n        class ResultData(proto.Message):\n            \"\"\"ResultData\"\"\"\n            word: str = proto.Field(proto.STRING, number=1)\n            excel: str = proto.Field(proto.STRING, number=2)\n\n        task_id: str = proto.Field(proto.STRING, number=1)\n        ret_code: int = proto.Field(proto.INT32, number=2)\n        ret_msg: str = proto.Field(proto.STRING, number=3)\n        percent: int = proto.Field(proto.INT32, number=4)\n        result_data: ResultData = proto.Field(proto.MESSAGE, number=5, message=ResultData)\n        create_time: datetime = proto.Field(proto.STRING, number=6)\n        start_time: datetime = proto.Field(proto.STRING, number=7)\n        end_time: datetime = proto.Field(proto.STRING, number=8)\n\n    success: bool = proto.Field(proto.BOOL, number=1)\n    log_id: int = proto.Field(proto.INT64, number=2)\n    result: Result = proto.Field(proto.MESSAGE, number=3, message=Result)\n    code: int = proto.Field(proto.INT64, number=4)\n    message: str = proto.Field(proto.STRING, number=5)\n\n\n"
  },
  {
    "path": "python/core/components/doc_parser/README.md",
    "content": "# 文档解析（DocParser）\n\n## 简介\n文档解析组件（DocParser）可以用于文档内容解析，支持PDF、JPG、DOC、TXT、XLS、PPT等16种文档格式的内容解析。\n\n### 功能介绍\n文档解析组件（DocParser）支持从文档中解析出文档字符内容、版式信息、位置坐标、表格结构、阅读顺序、标题段落层级树等内容\n\n### 特色优势\nDocParser支持解析以下几种类型的文档：\n* 版式文档：「pdf」、「jpg」、「jpeg」、「png」、「bmp」、「tif」、「tiff」、「ofd」\n* 流式文档：「doc」、「docx」、「txt」、「xls」、「xlsx」、「wps」、「ppt」、「pptx」\n\n支持解析的文档内容包括：\n* 文档的版式分析，识别文档中的标题、正文、页眉页脚、表格等\n* 文档内的文字内容、位置坐标\n* 表格结构和内容\n* 构建文档标题段落层级树\n* 构建文档阅读顺序\n* 支持以上类型文档转成pdf格式\n\n### 应用场景\n* 文档内容解析\n* 文档版式解析\n* 文档格式转化\n\n## 基本用法\n\n以下是使用DocParser快速开始的一个示例：\n\n```python\nfrom appbuilder import DocParser\nfrom appbuilder.core.message import Message\nimport os\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 进行文档内容解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"  # 待解析的文件路径\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\nmsg = Message(file_path)\nparser = DocParser()\nparse_result = parser(msg)\nprint(parse_result.content)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称       |参数类型 |是否必须 | 描述          | 示例值  |\n|------------|--------|--------|-------------|------|\n| message    |String  |是 | 需要解析的文档的存储路径 | \"./test.pdf\" |\n| return_raw |bool|否 | 指定是否返回原始的解析结果结构，默认为 False。 | True |\n\n### 响应参数\n| 参数名称        |参数类型 | 描述   | 示例值                     |\n|-------------|--------|------|-------------------------|\n| parseResult |Message  | 解析结果 | ParseResult对象，包含文档解析的内容 |\n### 响应示例\n```python\nclass ParseResult(BaseModel):\n    \"\"\"\n    解析结果整体结构\n    \"\"\"\n    para_node_tree: Optional[List[ParaNode]] = []  # 标题段落层级树，当ParserConfig.return_para_node_tree为True时有内容\n    page_contents: Optional[List[PageContent]] = []  # 页面的解析内容，详细内容参考base.py中的PageContent类\n    pdf_data: Optional[str] = \"\" # pdf格式数据, 当ParserConfig.convert_file_to_pdf为True时有内容\n    raw: Optional[Dict] = {} # 云端服务的原始解析结果\n```\n\n## 高级用法\nDocParser支持自定义文档解析的配置和对解析结果进行二次处理，以下是一个示例：\n\n```python\nfrom appbuilder import DocParser\nfrom appbuilder.core.message import Message\nimport os\nimport requests\n\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 先进行文档内容解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"  # 待解析的文件路径\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\nmsg = Message(file_path)\n\nparser = DocParser()\nconfig = parser.config\nconfig.convert_file_to_pdf = True  # 指定将当前文件转换成pdf格式\nconfig.page_filter = [0, 2]  # 只解析第1页和第3页，注意：页码从0开始\n\nparse_result = parser(msg)\nfile_content = parse_result.content\npdf_data = file_content.pdf_data  # 获取原始文件转化成pdf之后的数据\npage_content = file_content.page_content[1]  # 获取第3页的解析结果\npage_table = page_content.tables[0]  # 第3页中第一个表格的解析结果（如有），表格的解析内容的结构详见上一章详细说明部分关于表格结果的说明\ncells = page_table.cells  # 表格的单元格信息\ncell_text = cells[0]  # 表格第一个单元格的文本内容\nmatrix = page_table.cell_matrix  # 表格的单元格矩阵，用来描述单元格的空间位置信息\n...\n自定义处理表格内容\n...\n```\n### 高级用法参数详细说明\n\n在base.py中定义了DocParser配置和结果结构，下面做一些详细的说明和解释：\n### DocParser配置\n```python\nclass ParserConfig(BaseModel):\n    \"\"\"\n    DocParser解析配置\n    \"\"\"\n    convert_file_to_pdf: bool = Field(alias=\"need_pdffile_data\", default=False) #  是否需要将当前文件转换成pdf格式\n    page_filter: List[int] = Field(alias=\"page_filter\", default=None) #  指定解析的页码，默认传None，代表全部解析\n    return_para_node_tree: bool = Field(alias=\"return_para_nodes\", default=True) #  是否需要返回标题段落层级树\n    erase_watermark: bool = Field(alias=\"erase_watermark\", default=False) #  解析的过程中是否需要去除水印的干扰\n```\n### DocParser解析结果\n```python\nclass ParseResult(BaseModel):\n    \"\"\"\n    解析结果整体结构\n    \"\"\"\n    para_node_tree: Optional[List[ParaNode]] = []  # 标题段落层级树，当ParserConfig.return_para_node_tree为True时有内容\n    page_contents: Optional[List[PageContent]] = []  # 页面的解析内容，详细内容参考base.py中的PageContent类\n    pdf_data: Optional[str] = \"\" # pdf格式数据, 当ParserConfig.convert_file_to_pdf为True时有内容\n    raw: Optional[Dict] = {} # 云端服务的原始解析结果\n\nclass ParaNode(BaseModel):\n    \"\"\"\n    文档内容层级树结构\n    \"\"\"\n    node_id: int # 标题段落层级树的节点id\n    text: str # 节点文本\n    para_type: str # 节点类型，包括：title、text、table\n    parent: Optional[int] # 父节点id，文本的父节点是标题，标题的父节点是更高一级的标题\n    children: List[int] # 子节点id列表，标题节点才会有子节点\n    position: List[Position] # 节点位置信息，包括：页码和在对应页面的位置坐标\n    table: Optional[Table] = None # 节点类型为table时，包含表格解析结果\n\nclass PageContent(BaseModel):\n    \"\"\"\n    单页文档内容结构\n    \"\"\"\n    page_num: int # 页码\n    page_width: int # 页面宽度\n    page_height: int # 页面高度\n    page_angle: int # 页面旋转角度\n    page_type: str # 页面类型\n    page_layouts: List[Layout] # 页面版式信息\n    titles: Optional[List[Layout]] = [] # 页面标题信息\n    tables: Optional[List[Table]] = [] # 页面表格信息\n\nclass Layout(BaseModel):\n    \"\"\"\n    layout结构\n    \"\"\"\n    type: str # 布局类型\n    text: str # 布局文本\n    box: List[int] # 布局位置信息，包括：左上角x、y坐标和宽高\n    node_id: int # 布局在标题层级树中的节点id\n\nclass Table(BaseModel):\n    \"\"\"\n    表格结构\n    \"\"\"\n    box: List[int] # 表格位置信息，包括：左上角x、y坐标和宽高\n    cells: List[Layout] = Field(alias=\"children\") # 表格单元格信息，列表形式\n    matrix: List[List[int]] # 表格单元格矩阵，用来描述单元格的空间位置信息\n    node_id: int # 表格在标题层级树中的节点id\n```\n表格解析结构说明, 以下图为例：\n\n![表格](https://bj.bcebos.com/v1/appbuilder-sdk-components/table.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-05-30T03%3A09%3A32Z%2F-1%2Fhost%2Fb36695708e047713b5fe17b49733228aecdaf46322a5cec8d4e7bd0989032197)\n\n```python\n# cells中一共有26个元素，matrix中的每一个元素代表单元格在cells中的索引\ncells = [{\"box\": [90, 376, 21, 10], \"type\": \"cell\", \"text\": \"序号\", \"node_id\": 1}, ...]\nmatrix = [\n        [0, 1, 2, 3],\n        [4, 5, 6, 7],\n        [8, 9, 10, 11],\n        [12, 13, 14, 15],\n        [16, 17, 18, 19],\n        [20, 21, 22, 23],\n        [24, 24, 25, 26]\n    ]\n```\n\n\n## 更新记录和贡献\n* 文档解析能力 (2023-12)"
  },
  {
    "path": "python/core/components/doc_parser/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/doc_parser/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n文档解析\n\"\"\"\nfrom typing import List, Optional, Dict\nfrom pydantic import BaseModel, Field\n\n\n#  定义Parser解析结果的结构\nclass Position(BaseModel):\n    \"\"\"\n    position结构\n    \"\"\"\n    page_num: int = Field(alias=\"pageno\")\n    box: List[int]\n\n\nclass Layout(BaseModel):\n    \"\"\"\n    layout结构\n    \"\"\"\n    type: str\n    text: str\n    box: List[int]\n    node_id: int\n\n\nclass Table(BaseModel):\n    \"\"\"\n    表格结构\n    \"\"\"\n    box: List[int]\n    cells: List[Layout] = Field(alias=\"children\")\n    matrix: List[List[int]]\n    node_id: int\n\n\nclass ParaNode(BaseModel):\n    \"\"\"\n    文档内容层级树结构\n    \"\"\"\n    node_id: int\n    text: str\n    para_type: str\n    parent: Optional[int]\n    children: List[int]\n    position: List[Position]\n    table: Optional[Table] = None\n\n\nclass PageContent(BaseModel):\n    \"\"\"\n    单页文档内容结构\n    \"\"\"\n    page_num: int\n    page_width: int\n    page_height: int\n    page_angle: int\n    page_type: str\n    page_layouts: List[Layout]\n    titles: Optional[List[Layout]] = []\n    tables: Optional[List[Table]] = []\n\n\nclass ParseResult(BaseModel):\n    \"\"\"\n    解析结果整体结构\n    \"\"\"\n    para_node_tree: Optional[List[ParaNode]] = []\n    page_contents: Optional[List[PageContent]] = []\n    pdf_data: Optional[str] = \"\"\n    raw: Optional[Dict] = {}\n\n\nclass ParserConfig(BaseModel):\n    \"\"\"\n    DocParser解析配置\n    \"\"\"\n    convert_file_to_pdf: bool = Field(alias=\"need_pdffile_data\", default=False)\n    page_filter: List[int] = Field(alias=\"page_filter\", default=None)\n    return_para_node_tree: bool = Field(alias=\"return_para_nodes\", default=True)\n    erase_watermark: bool = Field(alias=\"erase_watermark\", default=False)\n\n\n#  文档内容切分结构\nclass DocSegment(BaseModel):\n    \"\"\"\n    自定义文档内容切分的结构\n    \"\"\"\n    content: Optional[str] = \"\"\n    title: Optional[List[str]] = []\n"
  },
  {
    "path": "python/core/components/doc_parser/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n文档解析\n\"\"\"\nimport os\nimport json\nimport base64\nfrom typing import Dict, Any\nimport tempfile\nfrom urllib.parse import urlparse\nimport requests\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.component import Component, Message\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.components.doc_parser.base import ParserConfig, ParseResult\nfrom appbuilder.utils.trace.tracer_wrapper import (\n    components_run_trace, components_run_stream_trace\n)\n\n\nclass DocParser(Component):\n    \"\"\"\n    文档解析组件，用于对文档的内容进行解析。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        file_path = \"./test.pdf\" # 待解析的文件路径\n        msg = Message(file_path)\n        parser = appbuilder.DocParser()\n        parse_result = parser(msg)\n\n    \"\"\"\n\n    name: str = \"doc_parser\"\n    tool_desc: Dict[str, Any] = {\"description\": \"parse document content\"}\n    base_url: str = \"/v1/bce/xmind/parser\"\n    config: ParserConfig = ParserConfig()\n\n    manifests = [\n        {\n            \"name\": \"doc_parser\",\n            \"description\": \"提供文档解析功能，支持PDF、Word、Excel、PPT等文档的解析\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"description\": \"用户上传的文档的文件名，包含文件后缀，用于判断文件类型\"\n                    }\n                },\n                \"required\": [\"file_names\"]\n            }\n        }\n    ]\n\n    def set_config(self, config: ParserConfig):\n        \"\"\"\n        设置解析配置\n        \n        Args:\n            config (ParserConfig): 解析配置对象\n        \n        Returns:\n            None\n        \"\"\"\n        self.config = config\n\n    def make_parse_result(self, response: Dict):\n        \"\"\"\n        将解析结果的内容转化成ParseResult的结构\n        \n        Args:\n            response (Dict): 解析后的响应字典，包含文件内容、目录等信息\n        \n        Returns:\n            Dict: 转换后的ParseResult结构，包含段落节点树、页面内容和PDF数据\n        \n        \"\"\"\n        para_nodes = (\n            response[\"para_nodes\"] if response[\"para_nodes\"] is not None else []\n        )\n        catalog = response[\"catalog\"] if response[\"catalog\"] is not None else []\n        pdf_data = response[\"pdf_data\"]\n        title_node_ids = [title[\"node_id\"] for title in catalog] if catalog else []\n        page_contents = []\n        for content in response[\"file_content\"]:\n            page_content = {\n                \"page_num\": content[\"page_num\"],\n                \"page_width\": int(content[\"page_size\"][\"width\"]),\n                \"page_height\": int(content[\"page_size\"][\"height\"]),\n                \"page_angle\": int(content[\"page_angle\"]),\n                \"page_type\": content[\"page_content\"][\"type\"],\n                \"page_layouts\": [],\n                \"page_titles\": [],\n                \"page_tables\": [],\n            }\n            for layout_item in content[\"page_content\"][\"layout\"]:\n                if layout_item[\"node_id\"] in title_node_ids:\n                    continue\n                if layout_item[\"type\"] == \"table\":\n                    page_content[\"page_tables\"].append(layout_item)\n                    if para_nodes:\n                        para_nodes[layout_item[\"node_id\"]][\"table\"] = layout_item\n                        table_row = []\n                        for i in range(len(layout_item[\"matrix\"])):\n                            cell_index = layout_item[\"matrix\"][i]\n                            row_markdown = (\n                                \"|\"\n                                + \"|\".join(\n                                    [\n                                        layout_item[\"children\"][index][\"text\"]\n                                        for index in set(cell_index)\n                                    ]\n                                )\n                                + \"|\"\n                            )\n                            if i != len(layout_item[\"matrix\"]) - 1:\n                                row_markdown += \"\\n\"\n                            table_row.append(row_markdown)\n                        para_nodes[layout_item[\"node_id\"]][\"text\"] = \"\".join(table_row)\n                else:\n                    page_content[\"page_layouts\"].append(layout_item)\n            page_contents.append(page_content)\n\n        for title in catalog:\n            page_num = title[\"position\"][0][\"pageno\"]\n            page_contents[page_num][\"page_titles\"].append(\n                {\n                    \"text\": title[\"text\"],\n                    \"type\": title[\"level\"],\n                    \"box\": title[\"position\"][0][\"box\"],\n                    \"node_id\": title[\"node_id\"],\n                }\n            )\n        parse_result = {\n            \"para_node_tree\": para_nodes,\n            \"page_contents\": page_contents,\n            \"pdf_data\": pdf_data,\n        }\n        # parse_result = ParseResult.parse_obj(parse_result)\n        return parse_result\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, input_message: Message, return_raw=False) -> Message:\n        \"\"\"\n        对传入的文件进行解析\n        \n        Args:\n            input_message (Message[str]): 输入为文件的路径\n            return_raw (bool, optional): 是否返回云端服务的原始结果。默认为False。\n        \n        Returns:\n            Message[ParseResult]: 文件的解析结果。\n        \n        Raises:\n            ValueError: 如果传入的文件路径不是字符串类型。\n            AppBuilderServerException: 如果文件解析过程中出现异常，将抛出该异常。\n        \n        \"\"\"\n        file_path = input_message.content\n\n        if not isinstance(file_path, str):\n            raise ValueError(\"file_path should be str type\")\n\n        with open(file_path, \"rb\") as f:\n            param = self.config.dict(by_alias=True)\n            param[\"data\"] = base64.b64encode(f.read()).decode()\n            param[\"name\"] = os.path.basename(file_path)\n            payload = json.dumps({\"file_list\": [param]})\n            headers = self.http_client.auth_header()\n            headers[\"Content-Type\"] = \"application/json\"\n            response = self.http_client.session.post(\n                url=self.http_client.service_url(self.base_url),\n                headers=headers,\n                data=payload,\n            )\n            self.http_client.check_response_header(response)\n            self.http_client.check_response_json(response.json())\n            request_id = self.http_client.response_request_id(response)\n            response = response.json()\n            if response[\"error_code\"] != 0:\n                logger.error(\n                    \"doc parser service log_id {} err {}\".format(\n                        response[\"log_id\"], response[\"error_msg\"]\n                    )\n                )\n                raise AppBuilderServerException(\n                    request_id=request_id,\n                    service_err_code=response[\"error_code\"],\n                    service_err_message=response[\"error_msg\"],\n                )\n            parse_result = self.make_parse_result(response[\"result\"][\"result_list\"][0])\n            if return_raw:\n                parse_result[\"raw\"] = response\n\n        parse_result = ParseResult.parse_obj(parse_result)\n        return Message(parse_result)\n\n    @components_run_stream_trace\n    def tool_eval(self, streaming: bool = False, **kwargs):\n        \"\"\" tool eval\n        \"\"\"\n        return_raw = kwargs.get(\"return_raw\", False)\n        file_names = kwargs.get(\"file_names\", [])\n        if not file_names:\n            raise ValueError(\"缺少file_names参数\")\n        file_name = file_names[0]\n        file_urls = kwargs.get(\"file_urls\", {})\n        if len(file_urls) == 0:\n            raise ValueError(\"file_urls is empty\")\n        file_url = file_name if file_name.startswith(\"http\") else file_urls.get(file_name, \"\")\n\n        with tempfile.TemporaryDirectory() as tmp_dir:\n            local_filename = os.path.join(tmp_dir, os.path.basename(urlparse(file_url).path))\n            # 下载文件\n            with requests.get(file_url, stream=True) as r:\n                r.raise_for_status()\n                with open(local_filename, 'wb') as f:\n                    for chunk in r.iter_content(chunk_size=8192):\n                        if chunk:\n                            f.write(chunk)\n\n            input_message = Message(content=local_filename)\n            parse_result = self.run(input_message, return_raw)\n\n        result = json.dumps(parse_result.content.model_dump(), ensure_ascii=False)\n        if streaming:\n            yield result\n        else:\n            return result\n"
  },
  {
    "path": "python/core/components/doc_splitter/README.md",
    "content": "# 文档切分（DocSplitter）\n\n## 简介\n文档切分组件（DocSplitter）可以用于对文档进行段落切分。\n\n### 功能介绍\n对解析后的文档，支持将文档划分为多个段落，便于后续处理和分析。\n目前支持的文档切分类型splitter_type如下：\n*  split_by_chunk：按照最大段落大小，对文档进行切分\n*  split_by_title：按照文档的title标识层级进行段落切分\n\n### 特色优势\n组件对文档分隔段落，准确高效，且有多种可选策略，代码简单可快速上手，是后续大模型使用文档信息的基础。\n\n\n### 应用场景\n对解析后的各类型文档进行分段，用于后续任务的输入。\n\n\n## 基本用法\n---\n参考tests目录下的[test_doc_splitter.py](https://github.com/baidubce/app-builder/blob/master/appbuilder/tests/test_doc_splitter.py)，可快速搭建自己的文档切分用例。\n\n以下是DocSplitter快速开始的一个示例。\n\n#### DocSplitter示例:\n\n```python\nimport os\nimport requests\nfrom appbuilder import DocParser\nfrom appbuilder import DocSplitter\nfrom appbuilder.core.message import Message\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 先解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\n\nmsg = Message(file_path)\n\nparser = DocParser()\nparse_result = parser(msg, return_raw=True)\n\n# 基于parser的结果切分段落\nsplitter = DocSplitter(splitter_type=\"split_by_chunk\")\nres_paras = splitter(parse_result)\n\n# 打印结果\nprint(res_paras.content)\n```\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n`splitter_type`(str): 切分器的类型，支持`split_by_chunk`和`split_by_title`两种方式，必选参数\n\n### 调用参数\n* `message`(Message): 上游`docparser`的文档解析结果\n* 备注: 文档解析时，`parser(msg, return_raw=True)`函数的参数`return_raw`必须为`True`\n\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|splitter_type |String  |是 |文本提取器类型, 目前支持`split_by_chunk`, `split_by_title`| DocSplitter(splitter_type=\"split_by_chunk\") |\n\n\n### 响应参数\n|参数名称 | 参数类型 |描述 | 示例值            |\n|--------|------|----|----------------|\n|res_paras  |Message    |返回结果| [{段落1}， {段落2}] |\n\n### 响应示例\n```\nMessage(name=msg, content={'paragraphs': [{'text': '第十节其他重要事项'}]})\n```\n\n### 错误码\n无\n\n\n## DocSplitter高级用法\n\n#### 示例:\n\n```python\nimport os\nimport requests\nfrom appbuilder import DocParser\nfrom appbuilder import DocSplitter\nfrom appbuilder.core.message import Message\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 先解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\n\nmsg = Message(file_path)\n\nparser = DocParser()\nparse_result = parser(msg, return_raw=True)\n\n# 基于parser的结果切分段落\ndoc_splitter = DocSplitter(splitter_type=\"split_by_chunk\",\n                           separators=[\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\", \"|\\n\"],\n                           max_segment_length=800,\n                           overlap=0)\nres_paras = doc_splitter(parse_result)\n\n# 打印结果\nprint(res_paras.content)\n```\n## 参数说明:\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 调用参数\n* `message`(Message): 上游`docparser`的文档解析结果\n* 备注: 文档解析时，`parser(msg, return_raw=True)`函数的参数`return_raw`必须为`True`\n*  备注: `splitter_type`为`split_by_title`时，`max_segment_length`, `separators`, `overlap`, `join_symbol`参数不起作用\n\n|参数名称 | 参数类型    | 是否必须 |描述 | 示例值   |\n|--------|---------|------|----|-------|\n|splitter_type | String  | 是    |文本提取器类型, 目前支持`split_by_chunk`, `split_by_title`| DocSplitter(splitter_type=\"split_by_chunk\") |\n|max_segment_length| Integer    | 否    |切分时段落的最大长度|  800   |\n|separators| List  | 否    |固定字数时，段落最后截断的分隔符| [\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\", \"|\\n\"] |\n|overlap| Integer | 否    |分隔的段落间重叠的内容字数| 200     |\n|join_symbol| String | 否    |组成固定字数段落时，文本块段落间的链接符| 空字符     |\n\n### 响应参数\n|参数名称 | 参数类型 |描述 | 示例值            |\n|--------|------|----|----------------|\n|res_paras  |Message    |返回结果| [{段落1}， {段落2}] |\n\n### 响应示例\n```\nMessage(name=msg, content={'paragraphs': [{'text': '第十节其他重要事项'}]})\n```\n\n## 更新记录和贡献\n* 文档分隔 (2023-12)\n\n\n"
  },
  {
    "path": "python/core/components/doc_splitter/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/doc_splitter/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n对文档进行段落切分\n\"\"\"\nimport os\nfrom typing import Dict, Any\n\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.doc_parser.base import ParseResult\nfrom appbuilder.core.component import Component, Message, ComponentArguments\nfrom appbuilder.core.components.doc_parser.base import DocSegment\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass DocSplitter(Component):\n    \"\"\"\n    文档段落切分组件\n\n    Attributes:\n        name (str): 组件名称。\n        meta (ComponentArguments): 组件元数据。\n    \"\"\"\n    name: str = \"doc_to_parapraphs\"\n    meta: ComponentArguments = ComponentArguments(tool_desc={\n        \"description\": \"split data to segments in doc\",\n    })\n\n    def __init__(self, splitter_type, max_segment_length=800, overlap=200,\n                 separators=[\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\", \"|\\n\"],\n                 join_symbol=\"\", **kwargs):\n        \"\"\"\n        文档段落切分实例化\n        \n        Args:\n            splitter_type (str): 切分器的类型，目前支持split_by_chunk和split_by_title，为split_by_title时，后续参数无效\n            max_segment_length (int, optional): 切分后每个段落的最大长度，默认为800。\n            overlap (int, optional): 每个段落和其前后相邻块，首尾重叠两部分的长度，默认为200。\n            separators (list, optional): 段落按照最大字符数切分时，字符数超限时，边界用分隔符截断，默认为[\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\"]。\n            join_symbol (str, optional): 文本块拼接时，作为连接符的字符，默认为\"\"。\n            **kwargs (Any, optional): 关键字参数。\n        \n        Returns:\n            无\n        \"\"\"\n        self.splitter_type = splitter_type\n\n        self.max_segment_length = max_segment_length\n        self.overlap = overlap\n        self.separators = separators\n        self.join_symbol = join_symbol\n\n        super(DocSplitter, self). __init__(meta=self.meta, **kwargs)\n\n    @components_run_trace\n    def run(self, message: Message):\n        \"\"\"\n        运行函数，根据splitter_type将文档分割成多个部分\n        \n        Args:\n            message (Message): 包含文档内容的消息对象\n        \n        Returns:\n            list: 分割后的文档列表\n        \n        Raises:\n            ValueError: 如果message.content不是ParseResult类型，抛出异常\n            ValueError: 如果splitter_type为空，抛出异常\n            ValueError: 如果ParseResult不包含原始值，抛出异常\n            ValueError: 如果splitter_type不是split_by_chunk或split_by_title，抛出异常\n        \n        \"\"\"\n        parse_result = message.content\n        if not isinstance(parse_result, ParseResult):\n            raise ValueError(\"message.content type must be a ParseResult\")\n\n        if not self.splitter_type:\n            raise ValueError(\"splitter_type must be a value\")\n\n        if not parse_result.raw:\n            raise ValueError(\"The exceptional purpose:Z to determine whether the ParseResult contains a raw value.\\n\"\n                             \"The current value: maybe the value of return_raw is False.\\n\"\n                             \"The expected value: the value of return_raw is True.\")\n\n        if self.splitter_type == \"split_by_chunk\":\n            xmind_output = parse_result.raw\n            # 文档原始的解析结果，作为输入，按照块最大长度，分隔文档\n            chunk_splitter = ChunkSplitter(self.max_segment_length, self.overlap, self.separators, self.join_symbol)\n            result = chunk_splitter(message)\n\n            return result\n        elif self.splitter_type == \"split_by_title\":\n            # 文档原始的解析结果，作为输入，按照标题叶子层级，分隔文档\n            title_splitter = TitleSplitter()\n            result = title_splitter(message)\n\n            return result\n        else:\n            raise ValueError(\"splitter_type must be split_by_chunk or split_by_title\")\n\n\nclass ChunkSplitter(Component):\n    \"\"\"\n    文档按照块大小切分段落\n    \n    Examples:\n\n    原始文档：\n        贷款资金不得用于从事股本权益性投资，不得用于购买股票、有价证券、期货、理财产品等金融产品。\n        不得用于从事房地产经营，不得用于借贷牟取非法收入。不得用于个人或其控制的企业生产经营。\n        不得套取现金。不得用于其他违反国家法律、政策规定的领域，不得用于监管机构禁止银行贷款进入的领域。\n\n    切分结果：\n        [\"贷款资金不得用于从事股本权益性投资，不得用于购买股票、有价证券、期货、理财产品等金融产品。不得用于从事房地产经营，\n        不得用于借贷牟取非法收入。不得用于个\",\n        \"不得用于个人或其控制的企业生产经营。不得套取现金。不得用于其他违反国家法律、政策规定的领域，\n        不得用于监管机构禁止银行贷款进入的领域。\"]\n    \"\"\"\n\n    name: str = \"doc_to_chunk\"\n    meta: ComponentArguments = ComponentArguments(tool_desc={\n        \"description\": \"split data to chunks with max size in doc\",\n    })\n\n    def __init__(self, max_segment_length=800, overlap=200,\n                 separators=[\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\", \"|\\n\"],\n                 join_symbol=\"\", **kwargs):\n        \"\"\"\n        文档段落切分实例化\n        \n        Args:\n            max_segment_length (int, optional): 切分后每个段落的最大长度，默认为800。\n            overlap (int, optional): 每个段落和其前后相邻块，首尾重叠两部分的长度，默认为200。\n            separators (list of str, optional): 按照段落最大字符数切分超限时，边界用分隔符截断，默认为[\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\", \"|\\n\"]。\n            join_symbol (str, optional): 文本块拼接时，作为连接符的字符，默认为\"\"。\n            **kwargs (Any, optional): 关键字参数。\n        \n        Returns:\n            None\n        \n        \"\"\"\n        self.base_url = kwargs.get(\n            \"base_url\",\n            \"/rpc/2.0/cloud_hub/v1/ai_engine/copilot_engine/v1/api/doc_search_tools/xmind_paragraph_splitter\")\n        kwargs.pop(\"base_url\", \"\")\n\n        self.max_segment_length = max_segment_length\n        self.overlap = overlap\n        self.separators = separators\n        self.join_symbol = join_symbol\n\n        super(ChunkSplitter, self). __init__(meta=self.meta, **kwargs)\n\n    @components_run_trace\n    def run(self, message: Message):\n        \"\"\"\n        对输入的解析文档结果，按照最大段落块大小、结尾分隔符等，处理为多个段落结果\n\n        Args:\n            message (obj:Message): 上游docparser的文档解析结果\n\n        Returns:\n            obj:Message: 文档分隔后的段落结果\n\n        Raises:\n            ValueError: 如果 message.content 的类型不是 ParseResult，则抛出 ValueError 异常\n\n        Examples:\n\n        .. code-block:: python\n\n            import os\n            from appbuilder import DocParser\n            from appbuilder.core.components.doc_splitter.component import DocSplitter, ChunkSplitter\n            from appbuilder.core.message import Message\n\n            # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n            os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n            # 先解析\n            msg = Message(\"./test.pdf\")\n            parser = DocParser()\n            parse_result = parser(msg, return_raw=True)\n\n            # 基于parser的结果切分段落\n            splitter = ChunkSplitter()\n            res_paras = splitter(parse_result)\n\n            # 打印结果\n            print(res_paras.content)\n        \"\"\"\n        paser_res = message.content\n        if not isinstance(paser_res, ParseResult):\n            raise ValueError(\"message.content type must be a ParseResult\")\n\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n\n        chunk_splitter_remote_params = {\"xmind_res\": paser_res.raw, \"max_segment_length\": self.max_segment_length,\n                                        \"overlap\": self.overlap, \"separators\": self.separators,\n                                        \"join_symbol\": self.join_symbol}\n\n        response = self.http_client.session.post(url=self.http_client.service_url(prefix=self.base_url, sub_path=\"\"),\n                                                 headers=headers, json=chunk_splitter_remote_params, stream=False)\n        self.http_client.check_response_header(response)\n        self.http_client.check_response_json(response.json())\n        doc_chunk_splitter_res = response.json()\n\n        return Message(doc_chunk_splitter_res[\"result\"])\n\n\nclass TitleSplitter(Component):\n    \"\"\" \n    文档按照标题层级切分段落\n        \n    Examples:\n\n        原始文档：\n            一、简介\n            叠贷业务是指借款人家庭为满足购房、购车、装修、教育、医疗、旅游、日常消费等符合国家法律法规规定的消费用途。\n            二、申请条件\n            （一）基本条件\n            1、年满18周岁的自然人，具有完全民事行为能力，能提供有效身份证明或居留证明；\n            2、有稳定职业和收入，有偿还贷款本息的能力；\n            （二）抵押房产所有人的要求\n            1、抵押房产的所有人应为借款人本人\n            2、抵押房产如有共同所有人，借款人必须为之一，且其他共同所有人必须同意以该房产办理最高额抵押登记，并提供同意抵押的合法有效的书面文件。\n\n        切分结果：\n            [\"一、简介  叠贷业务是指借款人家庭为满足购房、购车、装修、教育、医疗、旅游、日常消费等符合国家法律法规规定的消费用途。\",\n            \"二、申请条件 （一）基本条件  1、年满18周岁的自然人，具有完全民事行为能力，能提供有效身份证明或居留证明； 2、有稳定职业和收入，\n            有偿还贷款本息的能力；\"，\n            \"二、申请条件 （二）抵押房产所有人的要求  1、抵押房产的所有人应为借款人本人。 2、抵押房产如有共同所有人，借款人必须为之一，\n            且其他共同所有人必须同意以该房产办理最高额抵押登记，并提供同意抵押的合法有效的书面文件。\"】\n    \"\"\"\n\n    name: str = \"doc_to_title_level\"\n    tool_desc: Dict[str, Any] = {\"description\": \"split document content by titles\"}\n\n    def _get_title(self, nodes, parent_id, titles):\n        \"\"\"\n        获取段落各层级的标题\n\n        参数:\n            nodes: 文档的节点树\n            parent_id: 当前节点的父节点\n            titles: 当前节点的标题, 递归过程中，记录各层级的标题\n\n        返回:\n            titles: 当前节点的标题\n        \"\"\"\n        def inner_get_titles(nodes, parent_id, titles):\n            if parent_id:\n                titles.append(nodes[parent_id].text)\n                inner_get_titles(nodes, nodes[parent_id].parent, titles)\n        inner_get_titles(nodes, parent_id, titles)\n        return titles[::-1]\n\n    #  按照标题层级进行切分\n    @components_run_trace\n    def run(self, input_message: Message) -> Message:\n        \"\"\"\n        对输入的解析文档结果，按照各标题层级，处理为多个段落结果\n        \n        Args:\n            input_message (obj:Message): 上游docparser的文档解析结果\n        \n        Returns:\n            obj:Message: 文档分隔后的段落结果\n        \n        Raises:\n            ValueError: 如果message.content的类型不是ParseResult，则抛出异常\n        \n        Examples:\n\n        .. code-block:: python\n        \n            import os\n            from appbuilder.core.components.doc_parser.doc_parser import DocParser\n            from appbuilder.core.components.doc_splitter.doc_splitter import DocSplitter, TitleSplitter\n            from appbuilder.core.message import Message\n\n            # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n            os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n            # 先解析\n            msg = Message(\"./title_splitter.docx\")\n            parser = DocParser()\n            parse_result = parser(msg, return_raw=True)\n\n            # 基于parser的结果切分段落\n            splitter = TitleSplitter()\n            res_paras = splitter(parse_result)\n\n            # 打印结果\n            print(res_paras.content)\n        \n        \"\"\"\n        parse_result = input_message.content\n        if not isinstance(parse_result, ParseResult):\n            raise ValueError(\"message.content type must be a ParseResult\")\n\n        para_node_tree = parse_result.para_node_tree\n        doc_segments = []\n        paragraphs = []\n        segment = DocSegment()\n        for i in range(1, len(para_node_tree)):\n            node = para_node_tree[i]\n            #  去掉页眉页脚\n            if node.para_type == \"head_tail\":\n                continue\n\n            if node.para_type[:5] != \"title\":\n                segment.content += \" \" + node.text\n                # 下一个node是title或当前node是最后一个node，代表当前的标题层级segment结束\n                if i < len(para_node_tree) - 1 and para_node_tree[i + 1].para_type[:5] == \"title\" or i == len(\n                        para_node_tree) - 1:\n                    segment.title = self._get_title(para_node_tree, node.parent, [])\n                    doc_segments.append(segment)\n                    paragraphs_text = \" \".join(segment.title) + \" \" + segment.content\n                    paragraphs.append({\"text\": paragraphs_text, \"node_id\": i})\n                    segment = DocSegment()\n\n        if segment.content:\n            segment.title = self._get_title(para_node_tree, node.parent, [])\n            doc_segments.append(segment)\n            paragraphs_text = \" \".join(segment.title) + \" \" + segment.content\n            paragraphs.append({\"text\": paragraphs_text, \"node_id\": i})\n\n        return Message({\"doc_segments\": doc_segments, \"paragraphs\": paragraphs})\n"
  },
  {
    "path": "python/core/components/document_understanding/README.md",
    "content": "# 长文档内容理解（DocumentUnderstanding）\n\n## 简介\n长文档内容理解组件（DocumentUnderstanding）支持对图片以及文档内容进行理解，并基于图片以及文档内容对用户的提问进行回答，\n包括但不限于文档内容问答、总结摘要、内容分析。\n### 功能介绍\n根据用户上传的文档（支持txt、docx、pdf、xlsx、png、jpg、jpeg等多种格式）、query、指令生成大模型答案\n### 特色优势\n处理长上下文的大模型内容理解任务\n### 应用场景\n长上下文的文档问答\n\n## 基本用法\n### 快速开始\n\n```python\n\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nAPPBUILDER_TOKEN = \"YOUR-TOKEN\"\nos.environ[\"APPBUILDER_TOKEN\"] = APPBUILDER_TOKEN\ndu = appbuilder.DocumentUnderstanding()\nquery = appbuilder.Message(\"这篇文档讲了什么\")\ninstruction = \"请根据文档内容回答问题，用一句话简短概括\"\naddition_instruction = \"用一句话简短概括\" ##用户增强指令，可选填，该内容会进一步增强大模型的指令跟随能力，将你最需要增强效果的指令填于此，内容可以与上述的\"instruction\"基础指令有重复，注意：该字段内容过多会一定程度影响大模型内容严谨度，请注意控制该字段的指令字数\napp_id = \"YOUR-APP-ID\" ##你需要在系统上自己的账号下（https://qianfan.cloud.baidu.com/appbuilder）创建任意空Agent，并获取该Agent的app_id（即界面上的应用ID，在首页->个人空间->应用 里面即会显示应用ID），这里任意空Agent就可以，无需任何配置信息，这个agent的作用只是为了获取app_id信息\nfile_path = \"YOUR-FILE-PATH\" ##填写你的本地待分析文件路径\nstream = False ##是否开启流式输出功能\nresponse_ = du.run(query, \n                   file_path, \n                   instruction=instruction, \n                   addition_instruction=addition_instruction, \n                   app_id=app_id,\n                   stream=stream)\n\nfor result in response_:\n    print(result) ##打印输出的大模型答案\n```\n\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nimport os\nos.environ['APPBUILDER_TOKEN'] = 'bce-YOURTOKEN'\n```\n\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n\n### 调用参数\n\n| 参数名称                   | 参数类型 | 是否必须 | 描述                                                                       | 示例值                         |\n|------------------------|------|------|--------------------------------------------------------------------------|-----------------------------|\n| `message`              | obj  | 是    | 输入消息，用户输入query。                                                          | Message(content=input_data) |\n| `file_path`            | str  | 是    | 用户需要分析的文档                                                                | \"test.pdf\"                  |\n| `app_id`               | str  | 是    | 你需要在系统上自己的账号下（https://qianfan.cloud.baidu.com/appbuilder）创建任意空Agent，并获取该Agent的app_id（即界面上的应用ID，在首页->个人空间->应用 里面即会显示应用ID），这里任意空Agent就可以，无需任何配置信息，这个agent的作用只是为了获取app_id信息 | \"YOUR-APP-ID\"               |\n| `instruction`          | str  | 否    | 用户指令                                                                     | \"你的回答要严谨客观，且答案一定要分点阐述\"      |\n| `addition_instruction` | str  | 否    | 用户增强指令，可选填，该内容会进一步增强大模型的指令跟随能力，将你最需要增强效果的指令填于此，注意：该字段内容过多会一定程度影响大模型内容严谨度 | \"你的答案需要分点阐述\"                |\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- |------| -------- | -------- |\n| `result` | str  | 模型运行后的输出结果 | \"\" |\n\n### 响应示例-流式输出\n```\ndata: {\"type\": \"text\", \"text\": \"文件解析完成, 耗时13485.63ms\\n\\n\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\ndata: {\"type\": \"text\", \"text\": \"**Human\", \"event_status\": \"running\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\ndata: {\"type\": \"text\", \"text\": \"-Timescale Adaptation in an Open-Ended Task Space** 文档详细介绍了DeepMind团队开发的自适应代理（Adaptive Agent，简称\", \"event_status\": \"running\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\ndata: {\"type\": \"text\", \"text\": \"AdA）在开放任务空间中的快速适应能力。\", \"event_status\": \"running\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\ndata: {\"type\": \"text\", \"text\": \"\", \"event_status\": \"done\"} request_id: f99a7230-649f-4170-ade7-62d8368a18e6\n```\n\n### 响应示例-非流式输出\n```\n{'code': 0, 'message': '', 'result': {'text': '文件解析完成, 耗时14572.57ms\\n\\n**Human-Timescale Adaptation in an Open-Ended Task Space** 文档详细介绍了DeepMind团队开发的自适应代理（Adaptive Agent，简称AdA）在开放任务空间中的快速适应能力。以下是文档的主要内容和贡献点：\\n\\n1. **引言**：\\n   - 强调了快速适应能力对于人工智能的重要性，特别是在现实世界中的应用和与人类互动的场景中。\\n   - 提出了通过元强化学习（meta-RL）和自动课程学习（auto-curriculum learning）等方法，训练能够在未见过的环境中快速适应的代理。\\n\\n2. **自适应代理（AdA）**：\\n   - 介绍了AdA的设计和训练方法，包括其在开放任务空间中的适应行为、记忆架构、以及如何通过自动课程学习来优化训练过程。\\n   - 展示了AdA能够在几分钟内解决复杂的3D任务，且不需要进一步的代理训练，显示了其快速适应的能力。\\n\\n3. **实验与结果**：\\n   - 在多个方面评估了AdA的性能，包括其在单代理和多代理设置下的适应能力、不同架构和课程学习方法的影响、以及模型大小和记忆长度对性能的影响。\\n   - 通过与人类玩家的比较，证明了AdA在适应速度上与人类相当。\\n\\n4. **相关工作**：\\n   - 回顾了与本工作相关的领域，包括程序化环境生成、开放任务学习、适应性和强化学习中的Transformer应用等。\\n\\n5. **结论**：\\n   - 总结了AdA的贡献，强调了其在开放任务空间中快速适应的能力，以及通过元强化学习和自动课程学习等方法训练大型模型的可能性。\\n\\n6. **作者和贡献**：\\n   - 列出了主要贡献者和部分贡献者，以及项目的赞助商和认可。\\n\\n**主要贡献点**：\\n- 提出了AdA，一个能够在开放任务空间中快速适应的代理，其适应速度与人类相当。\\n- 通过元强化学习和自动课程学习等方法，训练了大型Transformer模型，展示了其在开放任务空间中的快速适应能力。\\n- 分析了不同架构、课程学习方法、模型大小和记忆长度对AdA性能的影响，提供了详细的实验结果和比较。\\n- 通过与人类玩家的比较，证明了AdA在适应速度上的优势。'}, 'request_id': '687642b0-b877-49ed-9ad9-65d76de0ea58'}\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.10. 15\n#### [Added]\n- 第一版"
  },
  {
    "path": "python/core/components/document_understanding/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/document_understanding/base.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\nfrom pydantic import Field\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\n\n\n\nclass DocumentUnderstandingArgs(ComponentArguments):\n    '''长文档问答配置'''\n    message: Message = Field(...,\n                         variable_name=\"query\",\n                         description=\"用户输入query\")\n    file_path: str = Field(...,\n                           variable_name=\"file_path\",\n                             description=\"用户上传的文件路径\")\n    instruction: str = Field(default=\"\",\n                           variable_name='instruction',\n                           description='用户指令')\n    addition_instruction: str = Field(default=\"\",\n                                      variable_name='addition_instruction',\n                                      description='用户增强指令')"
  },
  {
    "path": "python/core/components/document_understanding/component.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nimport os\n\nimport requests\n\nimport json\nfrom typing import Optional\nfrom appbuilder.core.components.document_understanding.base import DocumentUnderstandingArgs\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nimport base64\nimport uuid\n\nclass DocumentUnderstanding(Component):\n    \"\"\"\n    DocumentUnderstanding\n    \"\"\"\n    name = \"document_understanding\"\n    version = \"v1\"\n    meta = DocumentUnderstandingArgs\n    manifests = [{\n        \"name\": \"document_understanding\",\n        \"description\": \"该工具支持对图片以及文档内容进行理解，并基于图片以及文档内容对用户的提问进行回答，包括但不限于文档内容问答、\"\n                       \"总结摘要、内容分析。\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"query\": {\n                    \"type\": \"string\",\n                    \"description\": \"用户输入的query\"\n                },\n                \"file_path\": {\n                    \"type\": \"string\",\n                    \"description\": \"用户上传的文档的文件路径\"\n                },\n                \"instruction\": {\n                    \"type\": \"string\",\n                    \"description\": \"用户指令\"\n                },\n                \"addition_instruction\": {\n                    \"type\": \"string\",\n                    \"description\": \"用户增强指令\"\n                },\n                \"app_id\": {\n                    \"type\": \"string\",\n                    \"description\": \"系统应用ID\"\n                },\n            },\n            \"required\": [\"query\", \"file_path\", \"instruction\", \"addition_instruction\", \"app_id\"]\n        }\n    }]\n    def __init__(\n            self,\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = False,\n            instruction: Optional[Message] = None,\n            addition_instruction: Optional[Message] = None,\n            file_path: Optional[str] = None,\n            app_id: Optional[str] = None,\n            **kwargs\n    ):\n        \"\"\"初始化DocumentUnderstanding组件。\n\n        Args:\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n\n        Returns:\n            None\n        \"\"\"\n        super().__init__(DocumentUnderstandingArgs,\n                         secret_key=secret_key,\n                         gateway=gateway,\n                         lazy_certification=lazy_certification)\n        self.instruction = instruction,\n        self.addition_instruction = addition_instruction\n        self.file_path = file_path\n        self.app_id = app_id\n\n\n    def get_addition_instruction(self, addition_instruction: str):\n        \"\"\"拼接addition_instruction\"\"\"\n        return \"，指令：\" + addition_instruction\n\n\n    def get_conversation_id(self, app_id: str):\n        url = \"https://qianfan.baidubce.com/v2/app/conversation\"\n        payload = json.dumps({\n            \"app_id\": app_id\n        })\n        headers = {\n            'Content-Type': 'application/json',\n            'X-Appbuilder-Authorization': f\"Bearer {os.getenv('APPBUILDER_TOKEN', '')}\"\n        }\n        response = self.http_client.session.post(url, headers=headers, data=payload)\n        self.http_client.check_response_header(response)\n        response = requests.request(\"POST\", url, headers=headers, data=payload)\n        return json.loads(response.text).get(\"conversation_id\", None)\n\n    def get_file_id(self, conversation_id: str, app_id: str, file_path: str):\n        url = \"https://qianfan.baidubce.com/v2/app/conversation/file/upload\"\n        payload = {\n            'app_id': app_id,\n            'conversation_id': conversation_id\n        }\n        files = [\n            ('file', (os.path.basename(file_path),\n                      open(file_path, 'rb'), 'application/{}'.format(file_path.split(\".\")[-1])))\n        ]\n        headers = {\n            'X-Appbuilder-Authorization': f\"Bearer {os.getenv('APPBUILDER_TOKEN', '')}\"\n        }\n        response = requests.request(\"POST\", url, headers=headers, data=payload, files=files)\n        return json.loads(response.text).get(\"id\", None)\n\n    def run(self,\n            message: Message,\n            file_path,\n            instruction=\"\",\n            addition_instruction=\"\",\n            app_id=\"\",\n            stream=False,\n            timeout=None):\n        '''\n        run方法，用于执行长文档理解任务\n        Args:\n            message: 用户输入query\n            file_path: 用户输入的文件路径\n            instruction: 用户输入的人设指令\n            addition_instruction: 用户输入的增强版指令(如有)\n            app_id: 用户输入的app_id\n\n        Returns:\n            result (Message): 模型运行后的输出消息。\n\n        '''\n        file_name = file_path.split(\"/\")[-1]\n        file_type = file_name.split(\".\")[-1].lower()\n        request_id = str(uuid.uuid4())\n        support_file_type = [\"pdf\", \"docx\", \"xlsx\", \"png\", \"jpg\", \"jpeg\", \"txt\"]\n        if file_type not in support_file_type:\n            raise Exception(f\"不支持解析{file_type}类型的文件，当前仅支持解析以下几种文件类型：{support_file_type}\")\n        payload = json.dumps({\n            \"stream\": stream,\n            \"batch\": False,\n            \"arguments\": {\n            \"query\": message.content,\n            \"file_ids\":[self.get_file_id(self.get_conversation_id(app_id=app_id), app_id, file_path)],\n            \"files\": [],\n            \"file_urls\": {},\n            \"instruction\": instruction,\n            \"addition_instruction\": self.get_addition_instruction(addition_instruction),\n            }\n        })\n        headers = self.http_client.auth_header()\n        headers['Content-Type'] = 'application/json'\n        headers['Authorization'] = f\"Bearer {os.getenv('APPBUILDER_TOKEN', '')}\"\n        headers['X-Appbuilder-Request-Id'] = request_id\n        url = self.http_client.service_url_v2(\"/components/document_understanding/version/preview\")\n        response = self.http_client.session.post(url, headers=headers, data=payload, timeout=timeout, stream=stream)\n        self.http_client.check_response_header(response)\n        if response.status_code == 200:\n            if stream:\n                # 处理流式响应，逐行生成数据\n                for line in response.iter_lines():\n                    if line:\n                        decoded_line = line.decode('utf-8')\n                        decoded_line = f\"{decoded_line} request_id: {request_id}\"\n                        yield decoded_line  # 使用yield逐行输出结果\n            else:\n                result = response.json()\n                result[\"request_id\"] = request_id\n                if result[\"code\"] == 0:\n                    yield result\n\n                else:\n                    raise Exception(f\"服务请求失败: {result['message']}\")\n        else:\n            response.raise_for_status()\n\n    def tool_eval(self,\n                  message: Message,\n                  file_path: str,\n                  stream: bool = False,\n                  **kwargs):\n        \"\"\"用于function call\n        \"\"\"\n        instruction = kwargs.get(\"instruction\", \"\")\n        addition_instruction = kwargs.get(\"addition_instruction\", \"\")\n        app_id = kwargs.get(\"app_id\", \"\")\n\n        result = self.run(message,\n                          file_path,\n                          instruction=instruction,\n                          addition_instruction=addition_instruction,\n                          app_id=app_id,\n                          stream=stream)\n        return result"
  },
  {
    "path": "python/core/components/embeddings/README.md",
    "content": "# 向量计算（Embedding）\n\n## 简介\n\n向量计算组件（Embedding）支持将文本转化为用数值表示的向量形式，用于文本检索、信息推荐、知识挖掘等场景。嵌入（Embedding）是一种在机器学习和自然语言处理中常用的技术，主要用于将大量高维数据（如单词、图像等）转换为更低维的向量表示。这些向量表示捕获了原始数据的关键特征和关系。\n\n### 功能介绍\n\n1. 维度降低：将高维数据（如词汇表中的单词）映射到低维空间，使得数据处理更高效。\n2. 特征学习：学习数据的内在特征，使得具有相似含义的元素在嵌入空间中彼此接近。\n3. 关系映射：在嵌入空间中，数据点的距离和方向可以表示元素之间的关系。\n\n### 特色优势\n\nEmbedding-V1，是基于百度文心大模型技术的文本表示模型，在Embedding模块中，我们使用Embedding-V1作为默认模型。\n\n### 应用场景\n\n1. 文本检索\n2. 信息推荐\n3. 知识挖掘\n\n## 基本用法\n\n当前支持的embedding底座模型暂时只包括：\n- embedding-v1\n\n### 下面是使用单条字符串测试的代码示例\n\n请注意，您必须确保字符串的token长度小于384\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nembedding = appbuilder.Embedding()\n\nout = embedding(\"hello world!\")\n# 得到一个长度为384的float数组\nprint(out.content)\n```\n\n### 下面是使用多条字符串测试的代码示例\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nembedding = appbuilder.Embedding()\n\nouts = embedding.batch([\"hello\", \"world\"])\n# 得到一个长度为 2 x 384的float 二维数组\nprint(out.content)\n```\n\n### 下面是使用上游的Message作为输入的代码示例\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nfrom appbuilder import Message\n\nembedding = appbuilder.Embedding()\n\nquery = Message(\"你好，世界！\")\nout = embedding(query)\n# 得到一个长度为384的float数组\nprint(out.content)\n```\n\n### 下面是批量运行的代码示例\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nfrom appbuilder import Message\n\nembedding = appbuilder.Embedding()\n\nquery = Message([\n    \"你好\",\n    \"世界\"\n])\nouts = embedding.batch(query)\n# 得到一个长度为 2 x 384的float 二维数组\nprint(outs.content)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述                                                         | 示例值           |\n| -------- | -------- | -------- | ------------------------------------------------------------ | ---------------- |\n| model    | 字符串   | 可选     | 指定底座模型的类型。当前仅支持 embedding-v1 作为可选值。若不指定，默认值为 embedding-v1。 | embedding-v1   |\n\n### 调用参数\n\n#### 单条\n\n| 参数名称 | 参数类型 | 是否必须 | 描述                                                         | 示例值           |\n| -------- | -------- | -------- | ------------------------------------------------------------ | ---------------- |\n| text     | 字符串   | 必须     | 一个类型为 string 的句子，用于输入。该句子的长度不能超过384个字符，通常为用户的输入。 | \"您好，我需要帮助。\" |\n\n#### 批量\n\n| 参数名称 | 参数类型        | 是否必须 | 描述                                                             | 示例值                               |\n| -------- | --------------- | -------- | ---------------------------------------------------------------- | ------------------------------------ |\n| texts    | 字符串列表      | 必须     | 一个类型为 List[string] 的句子数组。数组中的每个元素都是一个句子，且每个句子的长度不能超过384个字符。通常这些句子为和用户输入相关的文本候选集。 | [\"您好，我需要帮助。\", \"请问有什么可以帮您？\"] |\n\n### 响应示例\n\n#### 单条\n\n```\n[0.1, 0.2, 0.3, ....]\n```\n\n#### 批量\n\n```\n[\n    [0.1, 0.2, ...],\n    ...,\n    [0.1, 0.2, ...],\n]\n```\n\n### 错误码\n\n无\n\n## 更新记录和贡献\n\n* embedding-v1 (2023-12)\n"
  },
  {
    "path": "python/core/components/embeddings/__init__.py",
    "content": "\"\"\"\ninit\n\"\"\"\n\nfrom .component import Embedding\nfrom .base import EmbeddingBaseComponent\n"
  },
  {
    "path": "python/core/components/embeddings/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom abc import abstractmethod\nfrom typing import List, Union\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\n\n\nclass EmbeddingBaseComponent(Component):\n    \"\"\"\n    EmbeddingBaseComponent\n    \"\"\"\n    \n    name: str\n    version: str\n    meta: ComponentArguments\n    base_url: str = \"\"\n    model_type: str = \"embeddings\"\n\n\n    @abstractmethod\n    def run(self, text: Union[Message[str], str]) -> Message[List[float]]:\n        \"\"\"\n        Args:\n            message: str\n        Returns:\n            embeddings: List[float]\n        \"\"\"\n\n    async def arun(self, text: Union[Message[str], str]) -> Message[List[float]]:\n        \"\"\"\n        Args:\n            message: str\n        Returns:\n            embeddings: List[float]\n        \"\"\"\n\n        # embedding don't need be async, just return it\n        return self.run(text)\n\n    @abstractmethod\n    def batch(self, texts: Union[Message[List[str]], List[str]]) -> Message[List[List[float]]]:\n        \"\"\"\n        Args:\n            message: List[str]\n        Returns:\n            embeddings: List[List[float]]\n        \"\"\"\n\n    def abatch(self, texts: Union[Message[List[str]], List[str]]) -> Message[List[List[float]]]:\n        \"\"\"\n        Args:\n            message: List[str]\n        Returns:\n            embeddings: List[List[float]]\n        \"\"\"\n\n        # embedding don't need be async, just return it\n        return self.batch(texts)\n    \n\nclass EmbeddingArgs(ComponentArguments):\n    \"\"\"\n    ernie bot embedding配置\n\n    Attributes:\n        text (Union[Message[str], str]): 输入文本\n    \"\"\"\n    text: Union[Message[str], str]\n"
  },
  {
    "path": "python/core/components/embeddings/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"\nernie bot embedding\n\"\"\"\n\nfrom typing import Union, List\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.embeddings.base import EmbeddingBaseComponent\nfrom appbuilder.core._exception import AppBuilderServerException, ModelNotSupportedException\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import EmbeddingArgs\n\nclass Embedding(EmbeddingBaseComponent):\n    \"\"\"\n    Embedding\n\n    Embedding-V1是基于百度文心大模型技术的文本表示模型，将文本转化为用数值表示的向量形式，用于文本检索、信息推荐、知识挖掘等场景。\n\n    Attributes:\n        model: str = \"Embedding-V1\"\n\n    Examples:\n\n        .. code-block:: python\n\n            import appbuilder\n            from appbuilder import Message\n\n            os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n            embedding = appbuilder.Embedding()\n\n            embedding_single = embedding(Message(\"hello world!\"))\n\n            embedding_batch = embedding.batch(Message([\"hello\", \"world\"]))\n    \"\"\"\n\n    name: str = \"embedding\"\n    version: str = \"v1\"\n\n    meta = EmbeddingArgs\n    accepted_models = [\"Embedding-V1\"]\n\n    base_urls = {\n        'Embedding-V1' : \"/v1/bce/wenxinworkshop/ai_custom/v1/embeddings/embedding-v1\"\n    }\n\n    def __init__(self, \n                 model=\"Embedding-V1\",\n                 **kwargs\n                 ):\n        \"\"\"Embedding\"\"\"\n\n        if model not in self.accepted_models:\n            raise ModelNotSupportedException(f\"Model {model} not supported, only support {self.accepted_models}\")\n\n        if model in self.base_urls:\n            self.base_url = self.base_urls[model]\n        else:\n            raise ModelNotSupportedException(f\"Model {model} is not yet supported, only support {self.base_urls.keys()}\")\n\n        super().__init__(self.meta)\n\n    def _check_response_json(self, data: dict):\n        \"\"\"\n        check_response_json for embedding\n        \"\"\"\n\n        self.http_client.check_response_json(data)\n        if \"error_code\" in data and \"error_msg\" in data:\n            raise AppBuilderServerException(\n                service_err_code=data['error_code'],\n                service_err_message=data['error_msg'],\n            )\n\n    def _request(self, payload: dict) -> dict:\n        \"\"\"\n        request to gateway\n        \"\"\"\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        resp = self.http_client.session.post(\n            url=self.http_client.service_url(self.base_url),\n            headers=headers,\n            json=payload,\n        )\n        self.http_client.check_response_header(resp)\n        self._check_response_json(resp.json())\n\n        return resp.json()\n\n    def _batchify(self, texts: List[str], batch_size: int = 16) -> List[List[str]]:\n        \"\"\"\n        batchify input text list\n        \"\"\"\n        if batch_size > 16:\n            raise ValueError(f\"The max Embedding batch_size is 16, but got {batch_size}\")\n\n        return [\n            texts[i : i + batch_size] for i in range(0, len(texts), batch_size)\n        ]\n\n    def _batch(self, texts: List[str]) -> Message[List[List[float]]]:\n        \"\"\"\n        batch run implement\n        \"\"\"\n        batches = self._batchify(texts)\n        results = []\n        for batch in batches:\n            result = self._request({\"input\": batch})\n            results.extend(result['data'])\n        results = Message([result['embedding'] for result in results])\n\n        return results\n\n    @components_run_trace\n    def run(self, text: Union[Message[str], str]) -> Message[List[float]]:\n        \"\"\"\n        处理给定的文本或消息对象，并返回包含处理结果的消息对象。\n        \n        Args:\n            text (Union[Message[str], str]): 待处理的文本或消息对象。\n        \n        Returns:\n            Message[List[float]]: 处理后的结果，封装在消息对象中。结果是一个浮点数列表。\n        \"\"\"\n        _text = text if isinstance(text, str) else text.content\n\n        return Message(self._batch([_text]).content[0])\n\n    def batch(self, texts: Union[Message[List[str]], List[str]]) -> Message[List[List[float]]]:\n        \"\"\"\n        批量处理文本数据。\n        \n        Args:\n            texts (Union[Message[List[str]], List[str]]):\n                待处理的文本数据，可以是 Message 类型，包含多个文本列表，也可以是普通列表类型，包含多个文本。\n        \n        Returns:\n            Message[List[List[float]]]:\n                处理后的结果，为 Message 类型，包含一个二维浮点数列表，每个子列表对应输入文本列表中一个文本的处理结果。\n        \n        \"\"\"\n        _texts = texts if isinstance(texts, list) else texts.content\n\n        return self._batch(_texts)\n"
  },
  {
    "path": "python/core/components/extract_table/README.md",
    "content": "# 表格抽取组件（ExtractTableFromDoc）\n\n## 简介\n表格抽取组件（ExtractTableFromDoc）是用于文档表格处理的组件，从文档中抽取表格。支持对文档表格大小进行限制，限制后自动进行拆分、跨页合并等处理；支持合并表格上文，提取的表格为Markdown格式。\n\n### 功能介绍\n从文档中抽取表格。支持对文档表格大小进行限制，限制后自动进行拆分、跨页合并等处理；支持合并表格上文，设置表格上文数量，提取的表格为Markdown格式。\n\n### 特色优势\n组件抽取表格，准确高效，代码简单可快速上手；且不依赖本地计算资源。\n\n### 适用场景\n文档表格解析与处理，用于后续任务的输入。\n\n## 基本用法\n下面是一个基本用法的样例\n\n```python\nimport os\nimport json\nimport requests\n\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder import Message, ExtractTableFromDoc, DocParser\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n\n# 进行文档内容解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"  # 待解析的文件路径\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\n\nmsg = Message(file_path)\n\nparser = DocParser()\n# ExtractTableFromDoc输入为文档原始解析结果，此处需要带上原始结果，return_raw=True.\ndoc = parser(msg, return_raw=True).content.raw\n\n# 抽取文档中的表格\nparser = ExtractTableFromDoc()\nresult = parser.run(Message(doc))\n\nlogger.info(\"Tables: {}\".format(\n    json.dumps(result.content, ensure_ascii=False))\n)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message | Dict  |是 | 输入的消息，用于模型的主要输入内容，必须为Docparser解析后的结果raw，需要设置return_raw=True。这是一个必需的参数。| `Message(parser(msg, return_raw=True).content.raw)` |\n|table_max_size |int  |否 |单个表格的长度的最大值(包含上文)，按字符数即len(table_str)统计，默认为800。如果表格超长，则会被拆分成多个子表格，拆分的最小粒度为表格的行。若单行就超长，则会强制按table_max_size截断。截断时会优先截断上文，尽量保留表格内容。 | 800 |\n|doc_node_num_before_table |int  |否 |表格前附加的上文DocParser Node的数量，默认为1。范围：1~10。 | 1 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n| - | List  | 解析出来的文档表格，如果元素长度为1，则对应原文档中格式化后的长度不超过`table_max_size`的表格；如果元素长度>1，则是对应原文档中一个大表格，该表格被拆分成的多个子表格，以满足设置大小。 | 见响应示例 |\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n\n### 响应示例\n```json\n[[{\"para\": \"table1\"}], [{\"para\": \"table2-part1\"}, {\"para\": \"table2-part2\"}]]\n```\n\n## 更新记录和贡献\n* 表格抽取能力 (2023-12)"
  },
  {
    "path": "python/core/components/extract_table/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"__init__\"\"\"\n\n"
  },
  {
    "path": "python/core/components/extract_table/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n文档表格转换\n\"\"\"\nimport os\nimport json\n\nfrom appbuilder.core.component import Component, Message, ComponentArguments\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass ExtractTableFromDoc(Component):\n    \"\"\" 文档表格抽取\n    \n    Examples:\n\n        .. code-block:: python\n        \n            import os\n            import json\n\n            from appbuilder.utils.logger_util import logger\n            from appbuilder import Message, ExtractTableFromDoc, DocParser\n\n            # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n            os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n            # 测试文档解析器使用默认配置，xxx为待解析的文档路径。\n            msg = Message(\"xxx\")\n            parser = DocParser()\n            # ExtractTableFromDoc输入为文档原始解析结果，此处需要带上原始结果，return_raw=True.\n            doc = parser(msg, return_raw=True).content.raw\n\n            # 抽取文档中的表格\n            parser = ExtractTableFromDoc()\n            result = parser.run(Message(doc))\n\n            logger.info(\"Tables: {}\".format(\n                json.dumps(result.content, ensure_ascii=False)))\n    \"\"\"\n    name: str = \"extract_table_from_doc\"\n    #TODO: 隐藏base_url，@tangwei12统一修改\n    base_url = \"/rpc/2.0/cloud_hub/v1/ai_engine/copilot_engine/v1/api/doc_search_tools/doc_table_to_markdown_parser\"\n    meta: ComponentArguments = ComponentArguments(tool_desc={\n        \"description\": \"Extract table from doc, table format is markdown\",\n    })\n\n    def _input_check(self, message: Message, table_max_size, doc_node_num_before_table):\n        \"\"\" para_check\n        \"\"\"\n        if table_max_size < 30:\n            raise ValueError(\"table_max_size mismached, expected table_max_size >= 30, got {}\".format(table_max_size))\n        if doc_node_num_before_table < 1 or doc_node_num_before_table > 10:\n            raise ValueError(\"doc_node_num_before_table mismatched, expected [1, 10], got {}\".format(doc_node_num_before_table))\n        obj = message.content.get(\"result\", {}).get(\"result_list\", [])\n        if len(obj) < 1:\n            raise ValueError(\"Input check failed, expected raw_doc_parser output.\")\n\n    def _post_process(self, resp):\n        \"\"\" pass\n        \"\"\"\n        resp = resp[\"result\"] \n        data = []\n        for table in resp.get(\"mdtables\", []):\n            tmp = []\n            for sub_table in table:\n                # print(sub_table[\"para\"])\n                sub_table = sub_table.get(\"para\", \"\").split(\"表：\\n|\")\n                if len(sub_table) < 2:\n                    context = sub_table[0]\n                    tmp.append({\"para\": context[:self.table_max_size]})\n                else:\n                    context, table_str = sub_table\n                    table_str = \"|\" + table_str\n                    remain_len = self.table_max_size - len(table_str)\n                    if remain_len < 1:\n                        table_str = table_str[:self.table_max_size]\n                    else:\n                        table_str = context[-remain_len:] + table_str\n                    tmp.append({\"para\": table_str})\n            data.append(tmp)\n        return data\n\n    @components_run_trace\n    def run(self, message: Message, table_max_size: int = 800, doc_node_num_before_table: int = 1):\n        \"\"\"\n        将文档原始解析结果，请求云端进行表格抽取，返回表格列表。\n        \n        Args:\n            message (Message): 文档原始解析结果。\n            table_max_size (int): 单个表格的长度的最大值(包含上文)，按字符数即len(table_str)统计，默认为800。如果表格超长，则会被拆\\\n            分成多个子表格，拆分的最小粒度为表格的行。若单行就超长，则会强制按table_max_size截断。截断时会优先截断上文，尽量保留表格内容。\n            doc_node_num_before_table (int): 表格前附加的上文DocParser Node的数量，默认为1。范围：1~10。\n        \n        Returns:\n            Message: 返回解析后的消息实体对象\n                Message.content (list): 解析出来的文档表格，list(二维)。解析出来的文档表格，如果元素长度为1，则对应原文档中格式化后的\\\n                长度不超过`table_max_size`的表格；如果元素长度>1，则是对应原文档中一个大表格，该表格被拆分成的多个子表格，以满足设置\\\n                大小。输出结果数据结构样例：`[[{table1}], [{table2-part1}, {table2-part2}]]`\n        \n        Raises:\n            ValueError: 当输入参数不为文档原始解析结果时，或值不合法时，抛出异常。\n        \"\"\"\n        self._input_check(message, table_max_size, doc_node_num_before_table)\n        self.table_max_size = table_max_size\n        params = {\n            \"xmind_res\": message.content,\n            \"single_table_size\": self.table_max_size,\n            \"field_before_table_cnt\": doc_node_num_before_table\n        }\n        url = self.http_client.service_url(sub_path=\"\", prefix=self.base_url)\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        resp = self.http_client.session.post(url=url, data=json.dumps(params), headers=headers)\n\n        self.http_client.check_response_header(resp)\n        resp = resp.json()\n        self.http_client.check_response_json(resp)\n        resp = self._post_process(resp)\n        return Message(resp)\n"
  },
  {
    "path": "python/core/components/gbi/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/gbi/basic.py",
    "content": "#!/usr/bin/env python 3\n# -*- coding: utf-8 -*-\n# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"GBI nl2sql component.\n\"\"\"\n\nfrom pydantic import BaseModel, Field\nfrom typing import Dict, List\n\n\nclass NL2SqlResult(BaseModel):\n    \"\"\"\n    gbi_nl2sql 返回的结果\n    \"\"\"\n\n    llm_result: str = Field(..., description=\"大模型返回的结果\")\n    sql: str = Field(..., description=\"从大模型中抽取的 sql 语句\")\n\nclass SessionRecord(BaseModel):\n    \"\"\"\n    gbi session record\n    \"\"\"\n    query: str = Field(..., description=\"用户的问题\")\n    answer: NL2SqlResult = Field(..., description=\"nl2sql 返回的结果\")\n\nclass ColumnItem(BaseModel):\n    \"\"\"\n    列信息\n    \"\"\"\n    ori_value: str = Field(..., description=\"query 中的 词语, 比如: 北京去年收入,  \"\n                                            \"分词后: 北京, 去年, 收入, ori_value 是分词中某一个，比如: ori_value = 北京\")\n    column_name: str = Field(..., description=\"对应数据库中的列名称, 比如: city\")\n    column_value: str = Field(..., description=\"对应数据库中的列值, 比如: 北京市\")\n\n    table_name: str = Field(..., description=\"该列所在表的名字\")\n    is_like: bool = Field(default=False, description=\"与 ori_value 的匹配是包含 还是 等于，包含: True; 等于: False\")\n\n\nSUPPORTED_MODEL_NAME = {\n    \"ERNIE-Bot 4.0\", \"ERNIE-Bot\", \"ERNIE-Bot-turbo\"\n}\n"
  },
  {
    "path": "python/core/components/gbi/nl2sql/README.md",
    "content": "# GBI 问表\n\n## 简介\nGBI 问表，根据提供的 mysql 表的 schema 信息，生成对应问题的 sql 语句。\n\n### 功能介绍\nGBI 问表，根据提供的 mysql 表的 schema 信息，生成对应问题的 sql 语句。\n\n### 特色优势\n直接生成 sql 语句，无需人工编写。\n\n### 应用场景\n1. 业务人员需要根据问题生成 sql 语句，但是不熟悉 sql 语法。\n2. 业务人员需要根据问题生成 sql 语句，但是不熟悉表的名称。\n\n\n## 基本用法\n这里是一个示例，展示如何基于 mysql 表的 schema, 根据问题生成 sql 语句。\n\n\n```python\nimport logging\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.gbi.basic import SessionRecord\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nSUPER_MARKET_SCHEMA = \"\"\"\nCREATE TABLE `supper_market_info` (\n  `订单编号` varchar(32) DEFAULT NULL,\n  `订单日期` date DEFAULT NULL,\n  `邮寄方式` varchar(32) DEFAULT NULL,\n  `地区` varchar(32) DEFAULT NULL,\n  `省份` varchar(32) DEFAULT NULL,\n  `客户类型` varchar(32) DEFAULT NULL,\n  `客户名称` varchar(32) DEFAULT NULL,\n  `商品类别` varchar(32) DEFAULT NULL,\n  `制造商` varchar(32) DEFAULT NULL,\n  `商品名称` varchar(32) DEFAULT NULL,\n  `数量` int(11) DEFAULT NULL,\n  `销售额` int(11) DEFAULT NULL,\n  `利润` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\n\"\"\"\n\ntable_schemas = [SUPER_MARKET_SCHEMA]\ngbi_nl2sql = appbuilder.NL2Sql(model_name=\"ERNIE-Bot 4.0\", table_schemas=table_schemas)\nquery = \"列出超市中的所有数据\"\nnl2sql_result_message = gbi_nl2sql(Message({\"query\": query}))\n\nprint(f\"sql: {nl2sql_result_message.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message.content.llm_result}\")\n```\n\n\n## 参数说明\n\n### 初始化参数\n- model_name:  支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, DeepSeek-V3.1\n- table_schemas: 表的 schema，例如:\n  \n```\nCREATE TABLE `supper_market_info` (\n  `订单编号` varchar(32) DEFAULT NULL,\n  `订单日期` date DEFAULT NULL,\n  `邮寄方式` varchar(32) DEFAULT NULL,\n  `地区` varchar(32) DEFAULT NULL,\n  `省份` varchar(32) DEFAULT NULL,\n  `客户类型` varchar(32) DEFAULT NULL,\n  `客户名称` varchar(32) DEFAULT NULL,\n  `商品类别` varchar(32) DEFAULT NULL,\n  `制造商` varchar(32) DEFAULT NULL,\n  `商品名称` varchar(32) DEFAULT NULL,\n  `数量` int(11) DEFAULT NULL,\n  `销售额` int(11) DEFAULT NULL,\n  `利润` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\n```\n\n- knowledge: 用于提供一些知识, 比如 {\"毛利率\": \"(销售收入 - 销售成本) / 销售收入\"}\n- prompt_template: prompt 模版, 必须包含的格式如下:\n                  ***你的描述\n                  {schema}\n                  ***你的描述\n                  {column_instrument}\n                  ***你的描述\n                  {kg}\n                  ***你的描述\n                  当前时间：{date}\n                  ***你的描述\n                  {history_instrument}\n                  ***你的描述\n                  当前问题：{query}\n                  回答：\n\n### 调用参数\n- message: message.content 是 字典，包含: query, session, column_constraint 三个key\n  * query: 用户的问题\n  * session: gbi session 的历史 列表, 参考 SessionRecord\n  * column_constraint: 列选约束 参考 ColumnItem 具体定义\n\n#### SessionRecord 初始化参数\n- query: 用户的问题\n- answer: gbi_nl2sql 返回的结果 NL2SqlResult\n\n#### ColumnItem 初始化参数如下\n- ori_value: query 中的 词语, 比如: \"北京去年收入\",  分词后: \"北京, 去年, 收入\", ori_value 是分词中某一个，比如: ori_value = \"北京\"\n- column_name: 对应数据库中的列名称, city\n- column_value: 对应数据库中的列值, 北京市\n- table_name: 该列所属的表名称\n- is_like: 与 ori_value 的匹配是包含 还是 等于，包含: True; 等于: False\n\n### 返回值\n- NL2SqlResult 的 message\n\n#### NL2SqlResult 初始化参数如下\n- llm_result: 大模型返回的结果\n- sql: 从 llm_result 中抽取的 sql 语句\n\n## 高级用法\n### 设置 session\n\n\n```python\nsession = list()\nsession.append(SessionRecord(query=query, answer=nl2sql_result_message.content))\n```\n\n再次问表\n\n\n```python\nnl2sql_result_message2 = gbi_nl2sql(Message({\"query\": \"查看商品类别是水果的所有数据\",\n                                             \"session\": session}))\nprint(f\"sql: {nl2sql_result_message2.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message2.content.llm_result}\")\n```\n\n    sql: \n    SELECT * FROM supper_market_info WHERE 商品类别 = '水果';\n    -----------------\n    llm result: ```sql\n    SELECT * FROM supper_market_info WHERE 商品类别 = '水果';\n    ```\n\n\n### 增加列选优化\n实际上数据中 \"商品类别\" 存储的是 \"新鲜水果\", 那么就可以通过列选的限制来优化 sql.\n\n\n```python\nfrom appbuilder.core.components.gbi.basic import ColumnItem\n\ncolumn_constraint = [ColumnItem(ori_value=\"水果\", \n                               column_name=\"商品类别\", \n                               column_value=\"新鲜水果\", \n                               table_name=\"超市营收明细表\", \n                               is_like=False)]\nnl2sql_result_message2 = gbi_nl2sql(Message({\"query\": \"查看商品类别是水果的所有数据\",\n                                             \"column_constraint\": column_constraint}))\n\nprint(f\"sql: {nl2sql_result_message2.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message2.content.llm_result}\")\n```\n\n    sql: \n    SELECT * FROM supper_market_info WHERE 商品类别='新鲜水果'\n    -----------------\n    llm result: ```sql\n    SELECT * FROM supper_market_info WHERE 商品类别='新鲜水果'\n    ```\n\n\n从上面我们看到，商品类别不在是 \"水果\" 而是 修订为 \"新鲜水果\"\n\n### 增加知识优化\n当计算某些特殊知识的时候，大模型是不知道的，所以需要告诉大模型具体的知识，比如:\n利润率的计算方式: 利润/销售额\n可以将该知识注入。具体示例如下:\n\n\n```python\n# 注入知识\ngbi_nl2sql.knowledge[\"利润率\"] = \"计算方式: 利润/销售额\"\n```\n\n\n```python\nquery3 = \"列出商品类别是日用品的利润率\"\nmsg3 = Message(query3)\n\nnl2sql_result_message3 = gbi_nl2sql(Message({\"query\": \"列出商品类别是日用品的利润率\"}))\nprint(f\"sql: {nl2sql_result_message3.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message3.content.llm_result}\")\n```\n\n    sql: \n    SELECT 商品类别, SUM(利润)/SUM(销售额) AS 利润率\n    FROM supper_market_info\n    WHERE 商品类别 = '日用品'\n    GROUP BY 商品类别\n    -----------------\n    llm result: ```sql\n    SELECT 商品类别, SUM(利润)/SUM(销售额) AS 利润率\n    FROM supper_market_info\n    WHERE 商品类别 = '日用品'\n    GROUP BY 商品类别\n    ```\n\n\n## 调整 prompt 模版\n有时候，我们希望定义自己的prompt, 但是必须遵循对应的 prompt 模版的格式。\n\n\n问表的 prompt template 必须包含:\n1. {schema} - 表的 schema 信息\n2. {instrument} - 列选限制的信息\n3. {kg} - 知识\n4. {date} - 时间\n5. {history_prompt} - 历史\n6. {query} - 当前问题\n\n参考下面的示例\n\n\n```python\nNL2SQL_PROMPT_TEMPLATE = \"\"\"\n  MySql 表 Schema 如下:\n  {schema}\n  请根据用户当前问题，联系历史信息，仅编写1个sql，其中 sql 语句需要使用```sql ```这种 markdown 形式给出。\n  请参考列选信息：\n  {instrument}\n  请参考知识:\n  {kg}\n  当前时间：{date}\n  历史信息如下:\n  {history_prompt}\n  当前问题：\"{query}\"\n  回答：\n\"\"\"\n```\n\n\n```python\ngbi_nl2sql5 = appbuilder.NL2Sql(model_name=\"ERNIE-Bot 4.0\", table_schemas=table_schemas, prompt_template=NL2SQL_PROMPT_TEMPLATE)\nnl2sql_result_message5 = gbi_nl2sql5(Message({\"query\": \"查看商品类别是水果的所有数据\"}))\n\nprint(f\"sql: {nl2sql_result_message5.content.sql}\")\nprint(f\"llm result: {nl2sql_result_message5.content.llm_result}\")\n```\n\n    sql: \n    SELECT * FROM supper_market_info WHERE 商品类别 = '水果'\n    -----------------\n    llm result: ```sql\n    SELECT * FROM supper_market_info WHERE 商品类别 = '水果'\n    ```\n\n"
  },
  {
    "path": "python/core/components/gbi/nl2sql/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/gbi/nl2sql/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom typing import List\nfrom pydantic import Field\n\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.components.gbi.basic import SessionRecord\nfrom appbuilder.core.components.gbi.basic import ColumnItem\n\n\nclass NL2SqlArgs(ComponentArguments):\n    \"\"\"\n    nl2sql 的参数\n\n    Attributes:\n        query: 用户的 query 输入\n        session: gbi session 的历史 列表\n        column_constraint: 列选的限制条件\n    \"\"\"\n    query: str = Field(..., description=\"用户的 query 输入\")\n    session: List[SessionRecord] = Field(default=list(), description=\"gbi session 的历史 列表\")\n    column_constraint: List[ColumnItem] = Field(default=list(), description=\"列选的限制条件\")"
  },
  {
    "path": "python/core/components/gbi/nl2sql/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"GBI nl2sql component.\n\"\"\"\nfrom typing import Dict, List\nfrom pydantic import ValidationError\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.gbi.basic import SessionRecord\nfrom appbuilder.core.components.gbi.basic import ColumnItem\nfrom appbuilder.core.components.gbi.basic import NL2SqlResult\nfrom appbuilder.core.components.gbi.basic import SUPPORTED_MODEL_NAME\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import NL2SqlArgs\n\nclass NL2Sql(Component):\n    \"\"\"\n    gib nl2sql\n    \"\"\"\n    meta = NL2SqlArgs\n\n    def __init__(self, \n                 model_name: str, \n                 table_schemas: List[str], \n                 knowledge: Dict = None,\n                 prompt_template: str = \"\",\n                 **kwargs\n                 ):\n        \"\"\"\n        创建 gbi nl2sql 对象\n        \n        Args:\n            model_name:  支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, DeepSeek-V3.1\n            table_schemas: 表的 schema 列表，例如: ```\n                            CREATE TABLE `mytable` (\n                            `d_year` COMMENT '年度,2019,2020..2022..',\n                            `industry` COMMENT '行业',\n                            `project_name` COMMENT '项目名称',\n                            `customer_name` COMMENT '客户名称')\n                            ```\"\n            knowledge: 用于提供一些知识, 比如 {\"毛利率\": \"毛收入-毛成本/毛成本\"}\n            prompt_template: prompt 模版, 必须包含的格式如下:\n                  ***你的描述\n                  {schema}\n                  ***你的描述\n                  {column_instrument}\n                  ***你的描述\n                  {kg}\n                  ***你的描述\n                  当前时间：{date}\n                  ***你的描述\n                  {history_instrument}\n                  ***你的描述\n                  当前问题：{query}\n                  回答：\n        \"\"\"\n        super().__init__(meta=NL2SqlArgs)\n\n        if model_name not in SUPPORTED_MODEL_NAME:\n            raise ValueError(f\"model_name mismatchhed, expected in {SUPPORTED_MODEL_NAME}, got {model_name}\")\n        self.model_name = model_name\n        self.server_sub_path = \"/v1/ai_engine/gbi/v1/gbi_nl2sql\"\n        self.table_schemas = table_schemas\n        self.knowledge = knowledge or dict()\n        self.prompt_template = prompt_template\n\n    @components_run_trace\n    def run(self,\n            message: Message, timeout: float = 60, retry: int = 0) -> Message[NL2SqlResult]:\n        \"\"\"\n        执行自然语言转SQL操作。\n        \n        Args:\n            message (Message): 包含用户问题和会话历史的消息对象。\n                - message.content 是一个字典，包含以下关键字：\n                    1. query: 用户问题\n                    2. session: 会话历史列表，参考 SessionRecord\n                    3. column_constraint: 列选约束，参考 ColumnItem 具体定义\n            timeout (float): 超时时间，默认为60秒。\n            retry (int): 重试次数，默认为0次。\n        \n        Returns:\n            Message[NL2SqlResult]: 转换结果以Message对象形式返回，其中content属性包含NL2SqlResult对象。\n        \n        \"\"\"\n        try:\n            inputs = self.meta(**message.content)\n        except ValidationError as e:\n            raise ValueError(e)\n\n        response = self._run_nl2sql(query=inputs.query, session=inputs.session, table_schemas=self.table_schemas,\n                                    column_constraint=inputs.column_constraint, knowledge=self.knowledge,\n                                    prompt_template=self.prompt_template,\n                                    model_name=self.model_name,\n                                    timeout=timeout,\n                                    retry=retry)\n\n        rsp_data = response.json()\n        nl2sql_result = NL2SqlResult(llm_result=rsp_data[\"llm_result\"],\n                                     sql=rsp_data[\"sql\"])\n        return Message(content=nl2sql_result)\n\n    def _run_nl2sql(self, query: str, session: List[SessionRecord], table_schemas: List[str], knowledge: Dict[str, str],\n                    prompt_template: str,\n                    column_constraint: List[ColumnItem],\n                    model_name: str,\n                    timeout: float = None, retry: int = 0):\n        \"\"\"\n        运行\n        Args:\n            query: query\n            session: gbi session 的历史 列表\n            table_schemas: 表的 schema 列表\n            knowledge: 知识\n            prompt_template: prompt 模版\n            column_constraint: 列的限制\n            model_name: 模型名字\n            timeout: 超时时间\n            retry:\n\n        Returns:\n\n        \"\"\"\n\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n\n        payload = {\"query\": query,\n                   \"table_schemas\": table_schemas,\n                   \"session\": [session_record.dict() for session_record in session],\n                   \"column_constraint\": [column_item.dict() for column_item in column_constraint],\n                   \"model_name\": model_name,\n                   \"knowledge\": knowledge,\n                   \"prompt_template\": prompt_template}\n\n        server_url = self.http_client.service_url(prefix=\"\", sub_path=self.server_sub_path)\n        response = self.http_client.session.post(url=server_url, headers=headers,\n                                                 json=payload, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n\n        request_id = self.http_client.response_request_id(response)\n        response.request_id = request_id\n        return response\n"
  },
  {
    "path": "python/core/components/gbi/select_table/README.md",
    "content": "# GBI 选表\n\n## 简介\nGBI 选表：根据提供的多个 MySql 表名 以及 表名对应的描述信息，通过 query 选择一个或多个最合适的表来回答该 query。\n一般的适用场景是，当有数据库有多个表的时候，但是实际只有1个表能回答该 query，那么，通过该能力将该表选择出来，用于后面的 问表 环节。\n\n\n### 功能介绍\nGBI 选表，根据提供的多个 MySql 表名 以及 表名对应的描述信息，通过 query 选择一个或多个最合适的表来回答该 query。\n一般的适用场景是，当有数据库有多个表的时候，但是实际只有1个表能回答该 query，那么，通过该能力将该表选择出来，用于后面的 问表 环节。\n\n### 特色优势\n可直接通过上传Excel进行数据问答\n\n### 应用场景\n1. 营销数据分析\n2. 表格问答\n\n\n## 基本用法\n下面是根据提供的表的描述信息以及 query 选择对应的表的示例。\n\n\n```python\nimport logging\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.gbi.basic import SessionRecord\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 表的描述信息, key: 表名; value: 是表的描述\ntable_descriptions = {\n    \"supper_market_info\": \"超市营收明细表，包含超市各种信息等\",\n    \"product_sales_info\": \"产品销售表\"\n}\n\n\n# 生成问表对象\nselect_table = appbuilder.SelectTable(model_name=\"ERNIE-Bot 4.0\", table_descriptions=table_descriptions)\nselect_table_result_message = select_table(Message({\"query\": \"列出超市中的所有数据\"}))\n\nprint(f\"选的表是: {select_table_result_message.content}\")\n```\n\n    选的表是: ['supper_market_info']\n\n\n## 参数说明\n### 初始化参数\n- model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, DeepSeek-V3.1\n- table_descriptions: 表的描述是个字典，key: 是表的名字, value: 是表的描述，例如:\n\n```\n{\n    \"supper_market_info\": \"超市营收明细表，包含超市各种信息等\",\n    \"product_sales_info\": \"产品销售表\"\n}\n```\n- prompt_template: prompt 模版, 必须包含如下:\n  1. {num} - 表的数量， 注意 {num} 有两个地方出现\n  2. {table_desc} - 表的描述\n  3. {query} - query\n  参考下面的示例:\n\n```\n你是一个专业的业务人员，下面有{num}张表，具体表名如下:\n{table_desc}\n请根据问题帮我选择上述1-{num}种的其中相关表并返回，可以为多表，也可以为单表,\n返回多张表请用“,”隔开\n返回格式请参考如下示例：\n问题:有多少个审核通过的投运单？\n回答: ```DWD_MAT_OPERATION```\n请严格参考示例只不要返回无关内容，直接给出最终答案后面的内容，分析步骤不要输出\n问题:{query}\n回答:\n```\n     \n### 调用参数\n- message: message.content 是用户的问题，包含的key: query, session\n  * query: 用户提出的问题\n  * session: SessionRecord 列表\n\n#### SessionRecord 初始化参数\n- query: 用户的问题\n- answer: gbi_nl2sql 返回的结果 NL2SqlResult\n  \n### 返回值\n识别的表名的列表例如:\n`[\"table_name\"]`\n\n## 调整 prompt 模版\n有时候，我们希望定义自己的prompt, 选表支持 prompt 模版的定制化，但是必须遵循对应的 prompt 模版的格式。\n\n### 选表 prompt 调整\n选表的 prompt template, 必须包含 \n1. {num} - 表的数量， 注意 {num} 有两个地方出现\n2. {table_desc} - 表的描述\n3. {query} - query, 参考下面的示例:\n\n\n```python\nSELECT_TABLE_PROMPT_TEMPLATE = \"\"\"\n你是一个专业的业务人员，下面有{num}张表，具体表名如下:\n{table_desc}\n请根据问题帮我选择上述1-{num}种的其中相关表并返回，可以为多表，也可以为单表,\n返回多张表请用“,”隔开\n返回格式请参考如下示例：\n问题:有多少个审核通过的投运单？\n回答: ```DWD_MAT_OPERATION```\n请严格参考示例只不要返回无关内容，直接给出最终答案后面的内容，分析步骤不要输出\n问题:{query}\n回答:\n\"\"\"\n```\n\n\n```python\nselect_table4 = appbuilder.SelectTable(model_name=\"ERNIE-Bot 4.0\", \n                                          table_descriptions=table_descriptions,\n                                          prompt_template=SELECT_TABLE_PROMPT_TEMPLATE)\n\nselect_table_result_message4 = select_table4(Message({\"query\": \"列出超市中的所有数据\"}))\n\nprint(f\"选的表是: {select_table_result_message4.content}\")\n```\n\n    选的表是: ['supper_market_info']\n\n"
  },
  {
    "path": "python/core/components/gbi/select_table/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/gbi/select_table/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom typing import List\nfrom pydantic import Field\n\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.components.gbi.basic import SessionRecord\n\n\nclass SelectTableArgs(ComponentArguments):\n    \"\"\"\n    选表的参数\n    \"\"\"\n    query: str = Field(..., description=\"用户的 query 输入\")\n    session: List[SessionRecord] = Field(default=list(), description=\"gbi session 的历史 列表\")"
  },
  {
    "path": "python/core/components/gbi/select_table/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"GBI nl2sql component.\n\"\"\"\nfrom typing import Dict, List\nfrom pydantic import ValidationError\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.gbi.basic import SessionRecord\nfrom appbuilder.core.components.gbi.basic import SUPPORTED_MODEL_NAME\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import SelectTableArgs\n\n\nclass SelectTable(Component):\n    \"\"\"\n    gbi 选表\n    \"\"\"\n\n    def __init__(self, \n                 model_name: str, \n                 table_descriptions: Dict[str, str],\n                 prompt_template: str = \"\",\n                 **kwargs\n                 ):\n        \"\"\"\n        创建 GBI 选表对象\n        \n        Args:\n            model_name: 支持的模型名字 ERNIE-Bot 4.0, ERNIE-Bot, ERNIE-Bot-turbo, DeepSeek-V3.1\n            table_descriptions: 表的描述是个字典，key: 是表的名字, value: 是表的描述，例如:\n                                {\n                                    \"超市营收明细表\": \"超市营收明细表，包含超市各种信息等\",\n                                    \"product_sales_info\": \"产品销售表\"\n                                }\n            prompt_template: rompt 模版, 必须包含如下:\n                              1. {num} - 表的数量， 注意 {num} 有两个地方出现\n                              2. {table_desc} - 表的描述\n                              3. {query} - query\n                              参考下面的示例:\n\n                            ```\n                            你是一个专业的业务人员，下面有{num}张表，具体表名如下:\n                            {table_desc}\n                            请根据问题帮我选择上述1-{num}种的其中相关表并返回，可以为多表，也可以为单表,\n                            返回多张表请用“,”隔开\n                            返回格式请参考如下示例：\n                            问题:有多少个审核通过的投运单？\n                            回答: ```DWD_MAT_OPERATION```\n                            请严格参考示例只不要返回无关内容，直接给出最终答案后面的内容，分析步骤不要输出\n                            问题:{query}\n                            回答:\n                            ```\n        \"\"\"\n        super().__init__(meta=SelectTableArgs)\n        if model_name not in SUPPORTED_MODEL_NAME:\n            raise ValueError(\n                f\"model_name mismatchhed, expected in {SUPPORTED_MODEL_NAME}, got {model_name}\"\n            )\n        self.model_name = model_name\n        self.server_sub_path = \"/v1/ai_engine/gbi/v1/gbi_select_table\"\n        self.table_descriptions = table_descriptions\n        self.prompt_template = prompt_template\n\n    @components_run_trace\n    def run(self,\n            message: Message, timeout: int = 60, retry: int = 0) -> Message[List[str]]:\n        \"\"\"\n        执行查询操作，返回识别的表名列表。\n        \n        Args:\n            message (Message): 包含查询信息的消息对象。\n                - message.content 字典包含以下 key:\n                    1. query (str): 用户的问题输入。\n                    2. session (list, optional): 对话历史，默认为空列表。\n            timeout (int, optional): 超时时间，默认为 60 秒。\n            retry (int, optional): 重试次数，默认为 0。\n        \n        Returns:\n            Message[List[str]]: 包含识别出的表名列表的 Message 对象。\n        \n        Raises:\n            ValueError: 如果输入的 message.content 不符合期望的格式，将抛出 ValueError 异常。\n        \n        \"\"\"\n        try:\n            inputs = self.meta(**message.content)\n        except ValidationError as e:\n            raise ValueError(e)\n\n        response = self._run_select_table(query=inputs.query, session=inputs.session,\n                                          prompt_template=self.prompt_template,\n                                          table_descriptions=self.table_descriptions,\n                                          model_name=self.model_name,\n                                          timeout=timeout,\n                                          retry=retry)\n\n        rsp_data = response.json()\n\n        return Message(content=rsp_data)\n\n    def _run_select_table(self, query: str, session: List[SessionRecord],\n                          prompt_template,\n                          table_descriptions: Dict[str, str],\n                          model_name: str,\n                          timeout: float = None, retry: int = 0):\n        \"\"\"\n        使用给定的输入并返回语音识别的结果。\n\n        参数:\n            request (obj:`ShortSpeechRecognitionRequest`): 输入请求，这是一个必需的参数。\n            timeout (float, 可选): 请求的超时时间。\n            retry (int, 可选): 请求的重试次数。\n\n        返回:\n            obj:`ShortSpeechRecognitionResponse`: 接口返回的输出消息。\n        \"\"\"\n\n        headers = self.http_client.auth_header()\n        headers[\"Content_Type\"] = \"application/json\"\n\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n\n        payload = {\"query\": query,\n                   \"table_descriptions\": table_descriptions,\n                   \"session\": [session_record.dict() for session_record in session],\n                   \"model_name\": model_name,\n                   \"prompt_template\": prompt_template}\n\n        server_url = self.http_client.service_url(sub_path=self.server_sub_path)\n        response = self.http_client.session.post(url=server_url, headers=headers,\n                                                 json=payload, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n\n        request_id = self.http_client.response_request_id(response)\n        response.request_id = request_id\n        return response\n"
  },
  {
    "path": "python/core/components/general_ocr/README.md",
    "content": "# 通用文字识别-高精度版（GeneralOCR）\n\n## 简介\n\n通用文字识别组件（GeneralOCR）支持多场景、多语种、高精度的文字识别服务，对图片全部文字内容进行检测识别。\n\n### 功能介绍\n覆盖多种通用场景、20+种语言的高精度整图文字检测和识别服务，包括各类印刷和手写文档、网络图片、表格、印章、数字、二维码等；\n\n### 特色优势\n* 准确率高\n\n    多项ICDAR指标居世界第一，识别准确率高\n### 应用场景\n支持多场景、多语种、高精度的文字识别服务，可用于纸质文档电子化、办公文档/报表识别、图像内容审核等场景\n## 基本用法\n\n以下是一个简单的例子来演示如何开始使用GeneralOCR组件：\n\n示例图片为![示例图片](https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae857a27513734d765495f89ffa5f73)\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\"\\\n    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\"\\\n    \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\"\\\n    \"857a27513734d765495f89ffa5f73\"\nraw_image = requests.get(image_url).content\nimage_base64 = base64.b64encode(raw_image)\ngeneral_ocr = appbuilder.GeneralOCR()\nout = general_ocr.run(appbuilder.Message(content={\"image_base64\": image_base64}))\nprint(out.content)\n```\n\n##  参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | Message  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\"image_base64\": \"待识别的图片base64数据\", \"image_url\": ...}), 优先级image_base64 > image_url > pdf_base64 > pdf_url |\n| +image_base64 | String | 否 | 待识别的图片base64数据, 要求base64编码和urlencode后大小不超过10M，最短边至少15px，最长边最大8192px，支持jpg/jpeg/png/bmp格式 | 略 |\n| +image_url | String | 否 | 待识别的图片url, 要求base64编码和urlencode后大小不超过10M，最短边至少15px，最长边最大8192px，支持jpg/jpeg/png/bmp格式 | \"https://bj.bcebos.com/agi-dev-platform-sdk-test/1.png\" |\n| +pdf_base64 | String | 否 | 待识别的pdf文件base64数据，base64编码后进行urlencode，要求base64编码和urlencode后大小不超过10M，最短边至少15px，最长边最大8192px，支持jpg/jpeg/png/bmp格式 | 略 |\n| +pdf_url | String | 否 | 待识别的pdf文件url，base64编码后进行urlencode，要求base64编码和urlencode后大小不超过10M，最短边至少15px，最长边最大8192px，支持jpg/jpeg/png/bmp格式 | \"https://bj.bcebos.com/agi-dev-platform-sdk-test/8、质量流量计.pdf\" |\n| +pdf_file_num | String | 否 | 需要识别的PDF文件的对应页码，当 pdf_file 参数有效时，识别传入页码的对应页面内容，若不传入，则默认识别第 1 页 | \"1\" |\n| +detect_direction | String | 否 | 是否检测图像朝向，默认不检测，即：false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括: true-检测朝向, false：不检测朝向 | \"false\" |\n| +multidirectional_recognize | String | 否 | 是否开启行级别的多方向文字识别，可选值包括: true-识别, false-不识别.若图内有不同方向的文字时，建议将此参数设置为“true” | \"true\" |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\n\n### 响应参数\n| 参数名称         | 参数类型    | 描述      | 示例值                                               |\n|--------------|---------|---------|---------------------------------------------------|\n| words_result | Array[] | 返回结果    | [{\"words\":\"一站式企业级大模型平台，提供先进的生成式AI生产及应用全流程开发工具链\"}] |\n| + words      | String  | 识别结果字符串 | \"百度智能云千帆大模型平台\"                                    |\n\n### 响应示例\n```json\n{\n    \"words_result\":[\n        {\n            \"words\":\"一站式企业级大模型平台，提供先进的生成式AI生产及应用全流程开发工具链\"\n        },\n        {\n            \"words\":\"百度智能云千帆大模型平台\"\n        },\n        {\n            \"words\":\"文心大模型4.0已正式发布，个人和企业客户可通过百度智能云千帆大模型平台接入使用\"\n        },\n        {\n            \"words\":\"立即使用\"\n        },\n        {\n            \"words\":\"在线体验\"\n        },\n        {\n            \"words\":\"使用文档\"\n        },\n        {\n            \"words\":\"定价说明\"\n        },\n        {\n            \"words\":\"千帆社区\"\n        },\n        {\n            \"words\":\"常见概念、使用指导\"\n        },\n        {\n            \"words\":\"定价、计费方式、计量说明\"\n        },\n        {\n            \"words\":\"大模型开发学习、交流社区\"\n        }\n    ]\n}\n```\n\n## 高级用法\n\n目前该模块仅提供基础通用文字识别功能。\n\n\n## 更新记录和贡献\n* 通用文字识别能力 (2023-12)\n* 增加Pdf格式输入，增加detect_direction和multidirectional_recognize入参\n"
  },
  {
    "path": "python/core/components/general_ocr/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/general_ocr/component.py",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"general ocr component.\"\"\"\nimport base64\nimport json\nimport os.path\nimport requests\n\nfrom appbuilder.core import utils\nfrom appbuilder.core._client import HTTPClient\n\n\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.general_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass GeneralOCR(Component):\n    r\"\"\"\n    提供通用文字识别能力，在通用文字识别的基础上，提供更高精度的识别服务，支持更多语种识别（丹麦语、荷兰语、马来语、\n    瑞典语、印尼语、波兰语、罗马尼亚语、土耳其语、希腊语、匈牙利语、泰语、越语、阿拉伯语、印地语及部分中国少数民族语言），\n    并将字库从1w+扩展到2w+，能识别所有常用字和大部分生僻字。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        general_ocr = appbuilder.GeneralOCR()\n        with open(\"./general_ocr_test.png\", \"rb\") as f:\n            out = general_ocr.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n        print(out.content)\n\n     \"\"\"\n    name = \"general_ocr\"\n    version = \"v1\"\n\n    manifests = [\n        {\n            \"name\": \"general_ocr\",\n            \"description\": \"提供更高精度的通用文字识别能力，能够识别图片中的文字，不支持html后缀文件的输入\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url,根据该url能够获取图片\"\n                    },\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名,用于生成图片url\"\n                    },\n                    \"language_type\": {\n                        \"type\": \"string\",\n                        \"description\": \"识别语言类型，'CHN_ENG'为中英文混合，'ENG'为英文， 'JAP'为日语，'KOR'为韩语，'FRE'为法语，'SPA'为西班牙语，'POR'为葡萄牙语，\"\n                        \"'GER'为德语，'ITA'为意大利语，'RUS'为俄语，'DAN'为丹麦语，'DUT'为荷兰语，'MAL'为马来语，'SWE'为瑞典语，'IND'为印尼语，'POL'为波兰语，'ROM'为罗马尼亚语，\"\n                        \"'TUR'为土耳其语，'GRE'为希腊语，'HUN'为匈牙利语，'THA'为泰语，'VIE'为越南语，'ARA'为阿拉伯语，'HIN'为印地语，默认为'CHN_ENG'\",\n                        \"enum\": ['CHN_ENG', 'ENG', 'JAP', 'KOR', 'FRE', 'SPA', 'POR', 'GER', 'ITA',\n                                 'RUS', 'DAN', 'DUT', 'MAL', 'SWE', 'IND', 'POL', 'ROM', 'TUR', \n                                 'GRE', 'HUN', 'THA', 'VIE', 'ARA', 'HIN'],\n                    },\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0, language_type: str = 'CHN_ENG') -> Message:\n        \"\"\"\n        在通用文字识别的基础上，提供更高精度的识别服务，支持更多语种识别\n        \n        Args:\n            message (Message): 包含识别任务的输入信息的消息对象。\n            timeout (float, optional): 超时时间，单位秒。默认为None，表示不设置超时。\n            retry (int, optional): 重试次数。默认为0，表示不重试。\n            language_type (str, optional): 识别语言类型，可选值为'CHN_ENG'（中英文）和'CHN'（中文）。默认为'CHN_ENG'。\n        \n        Returns:\n            Message: 包含识别结果的消息对象。\n        \n        \"\"\"\n        inp = GeneralOCRInMsg(**message.content)\n        request = GeneralOCRRequest()\n        if inp.image_base64:\n            request.image = (inp.image_base64)\n        elif inp.image_url:\n            request.url = inp.image_url\n        elif inp.pdf_base64:\n            request.pdf_file = inp.pdf_base64\n        elif inp.pdf_url:\n            raw_pdf = requests.get(inp.pdf_url).content\n            pdf_base64 = base64.b64encode(raw_pdf)\n            request.pdf_file = pdf_base64\n        request.pdf_file_num = inp.pdf_file_num\n        request.detect_direction = inp.detect_direction\n        request.multidirectional_recognize = inp.multidirectional_recognize\n        request.language_type = language_type\n        result = self._recognize(request, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = GeneralOCROutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(\n        self,\n        request: GeneralOCRRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> GeneralOCRResponse:\n        r\"\"\"调用底层接口进行通用文字识别\n                   参数:\n                       request (obj: `GeneralOCRRequest`) : 通用文字识别输入参数\n\n                   返回：\n                       response (obj: `GeneralOCRResponse`): 通用文字识别返回结果\n               \"\"\"\n        if not request.image and not request.url and not request.pdf_file and not request.ofd_file:\n            raise ValueError(\n                \"request format error, one of image or url or must pdf_file or ofd_file be set\")\n        data = GeneralOCRRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/accurate_basic\")\n        response = self.http_client.session.post(\n            url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        ocr_response = GeneralOCRResponse.from_json(payload=json.dumps(data))\n        ocr_response.request_id = request_id\n        return ocr_response\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 通用文字识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool, **kwargs):\n        r\"\"\"\n        根据给定的参数执行OCR识别功能。\n        \n        Args:\n            name (str): 函数名称，此处未使用，但为保持一致性保留。\n            streaming (bool): 是否以流式方式返回结果。如果为True，则逐个返回结果，否则返回全部结果。\n            kwargs: 关键字参数，支持以下参数：\n                traceid (str): 请求的唯一标识符，用于追踪请求和响应。\n                img_url (str): 待识别图片的URL。\n                file_urls (dict): 包含文件名和对应URL的字典。如果提供了img_url，则忽略此参数。\n                img_name (str): 待识别图片的文件名，与file_urls配合使用。\n        \n        Returns:\n            如果streaming为False，则返回包含识别结果的JSON字符串。\n            如果streaming为True，则逐个返回包含识别结果的字典。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误（例如未设置文件名或指定文件名对应的URL不存在），则抛出此异常。\n        \n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        img_url = kwargs.get(\"img_url\", None)\n        language_type = kwargs.get(\"language_type\", 'CHN_ENG')\n        if not img_url:\n            file_urls = kwargs.get(\"file_urls\", {})\n            img_path = kwargs.get(\"img_name\", None)\n            if not img_path:\n                raise InvalidRequestArgumentError(\n                    \"request format error, file name is not set\")\n            img_name = os.path.basename(img_path)\n            img_url = file_urls.get(img_name, None)\n            if not img_url:\n                raise InvalidRequestArgumentError(\n                    f\"request format error, file {img_name} url does not exist\")\n        req = GeneralOCRRequest(url=img_url)\n        req.detect_direction = \"true\"\n        req.language_type = language_type\n        result = proto.Message.to_dict(self._recognize(req, request_id=traceid))\n        results = {\n            \"识别结果\": \" \\n\".join(item[\"words\"] for item in result[\"words_result\"])\n        }\n        res = json.dumps(results, ensure_ascii=False, indent=4)\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": res,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": 'user',\n            }\n        else:\n            return res\n"
  },
  {
    "path": "python/core/components/general_ocr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"general ocr model.\"\"\"\nimport proto\n\nfrom typing import List\nfrom pydantic import BaseModel\n\n\n# PB definition\nclass GeneralOCRRequest(proto.Message):\n    \"\"\"通用ocr识别请求体\n\n    属性:\n        image (str):\n            可选。图像内容的base64编码。\n        url (str):\n            可选。图像的URL地址，经过base64编码。\n            图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n        pdf_file (str):\n            可选。PDF文件内容的base64编码。\n        pdf_file_num (str):\n            可选。PDF文件的页数。\n        ofd_file (str):\n            可选。OFD（Open Format Document）文件内容的base64编码。\n        ofd_file_num (str):\n            可选。OFD文件的页数。\n        language_type (str):\n            可选。文本使用的语言类型。默认为\"CHN_ENG\"。\n            可能的取值包括：\n            - \"auto_detect\": 自动检测语言并识别。\n            - \"CHN_ENG\": 中英文混合。\n            - \"ENG\": 英文。\n            - \"JAP\": 日文。\n            - \"KOR\": 韩文。\n            - \"FRE\": 法文。\n            - \"SPA\": 西班牙文。\n            - \"POR\": 葡萄牙文。\n            - \"GER\": 德文。\n            - \"ITA\": 意大利文。\n            - \"RUS\": 俄文。\n            - \"DAN\": 丹麦文。\n            - \"DUT\": 荷兰文。\n            - \"MAL\": 马来文。\n            - \"SWE\": 瑞典文。\n            - \"IND\": 印度尼西亚文。\n            - \"POL\": 波兰文。\n            - \"ROM\": 罗马尼亚文。\n            - \"TUR\": 土耳其文。\n            - \"GRE\": 希腊文。\n            - \"HUN\": 匈牙利文。\n            - \"THA\": 泰文。\n            - \"VIE\": 越南文。\n            - \"ARA\": 阿拉伯文。\n            - \"HIN\": 印地文。\n        detect_direction (str):\n            可选。是否检测文本方向。默认为\"false\"。\n            可能的取值包括：\n            - \"true\": 检测文本方向。\n            - \"false\": 不检测文本方向。\n        paragraph (str):\n            可选。是否输出段落信息。默认为\"false\"。\n            可能的取值包括：\n            - \"true\": 输出段落信息。\n            - \"false\": 不输出段落信息。\n        probability (str):\n            可选。是否输出置信度。默认为\"false\"。\n            可能的取值包括：\n            - \"true\": 返回识别结果中每行的置信度。\n            - \"false\": 不返回置信度。\n    \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    pdf_file: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    pdf_file_num: str = proto.Field(\n        proto.STRING,\n        number=4,\n        optional=True,\n    )\n    ofd_file: str = proto.Field(\n        proto.STRING,\n        number=5,\n    )\n    ofd_file_num: str = proto.Field(\n        proto.STRING,\n        number=6,\n    )\n    language_type: str = proto.Field(\n        proto.STRING,\n        number=7,\n    )\n    detect_direction: str = proto.Field(\n        proto.STRING,\n        number=8,\n    )\n    paragraph: str = proto.Field(\n        proto.STRING,\n        number=9,\n    )\n    probability: str = proto.Field(\n        proto.STRING,\n        number=10,\n    )\n    multidirectional_recognize: str = proto.Field(\n        proto.STRING,\n        number=11,\n    )\n\nclass GeneralOCRResponse(proto.Message):\n    \"\"\"通用ocr识别结果\n\n        属性:\n        log_id (int):\n            必填。用于问题跟踪的唯一日志ID。\n        direction (int):\n            可选。当detect_direction=true时的图像方向。\n            - -1: 未定义。\n            - 0: 正常。\n            - 1: 逆时针旋转90度。\n            - 2: 逆时针旋转180度。\n            - 3: 逆时针旋转270度。\n        words_result_num (int):\n            必填。识别结果的数量。\n        words_result (List[Dict[str, Any]]):\n            必填。识别结果的数组。\n            - words (str): 识别出的文本。\n            - probability (Dict[str, float]): 识别结果中每行的置信度值。\n            包括平均值、方差和最小置信度值。\n            当probability=true时返回。\n        paragraphs_result (List[Dict[str, Any]]):\n            可选。段落检测结果。当paragraph=true时返回。\n            - words_result_idx (List[int]): 包含在段落中的行索引。\n        paragraphs_result_num (int):\n            可选。段落检测结果的数量。当paragraph=true时返回。\n        pdf_file_size (int):\n            可选。输入PDF文件的总页数。当pdf_file参数有效时返回。\n        ofd_file_size (str):\n            可选。输入OFD文件的总页数。当ofd_file参数有效时返回。\n\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    log_id: int = proto.Field(\n        proto.UINT64,\n        number=2,\n    )\n    direction: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    words_result_num: int = proto.Field(\n        proto.UINT32,\n        number=4,\n    )\n    words_result: 'WordResult' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=5,\n        message='WordResult'\n    )\n    paragraphs_result: 'ParagraphResult' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=6,\n        message='ParagraphResult'\n    )\n    paragraphs_result_num: int = proto.Field(\n        proto.UINT32,\n        number=7,\n    )\n    pdf_file_size: int = proto.Field(\n        proto.UINT32,\n        number=8,\n    )\n    ofd_file_size: str = proto.Field(\n        proto.STRING,\n        number=9,\n    )\n\n\nclass WordResult(proto.Message):\n    \"\"\" 识别结果列表.\n\n        属性:\n            - words (str): 识别出的文本。\n            - probability (Dict[str, float]): 识别结果中每行的置信度值。\n                包括平均值、方差和最小置信度值。\n                当probability=true时返回。\n     \"\"\"\n    words: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    probability: 'Probability' = proto.Field(\n        proto.MESSAGE,\n        number=2,\n        message='Probability'\n    )\n\n\nclass Probability(proto.Message):\n    \"\"\"置信度\n\n           属性:\n              - average (float): 每行的平均置信度\n              - variance (float): 每行置信度的方差\n              - minimum (float)：每行的最小置信度\n    \"\"\"\n\n    average: float = proto.Field(\n        proto.FLOAT,\n        number=1,\n    )\n    variance: float = proto.Field(\n        proto.FLOAT,\n        number=2,\n    )\n    min: float = proto.Field(\n        proto.FLOAT,\n        number=3,\n    )\n\n\nclass ParagraphResult(proto.Message):\n    \"\"\"\n        段落检测结果，当paragraph=true时将返回该字段。\n    \"\"\"\n    words_result_idx: int = proto.Field(\n        proto.INT32,\n        number=1,\n    )\n\n\nclass GeneralOCRInMsg(BaseModel):\n    \"\"\" 通用文字识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    image_base64: str = \"\"  # 原始图片base64数据\n    image_url: str = \"\"  # 图片可下载链接\n    pdf_base64: str = \"\" #pdf base64数据\n    pdf_url: str = \"\" #pdf 可下载链接\n    pdf_file_num: str = \"1\" #需要识别的PDF文件的对应页码\n    detect_direction: str = \"false\" #是否检测图像朝向\n    multidirectional_recognize: str = \"true\" #是否开启行级别的多方向文字识别\n\n\nclass Words(BaseModel):\n    \"\"\" 识别文字\n\n        属性：\n            words(str):识别文字结果\n    \"\"\"\n    words: str\n\n\nclass GeneralOCROutMsg(BaseModel):\n    \"\"\" 识别文字结果列表\n\n        属性：\n            words_result([]array):识别文字结果列表\n    \"\"\"\n    words_result: List['Words']\n"
  },
  {
    "path": "python/core/components/handwrite_ocr/README.md",
    "content": "# 手写文字识别 （HandwriteOCR）\n\n## 简介\n手写文字识别 （HandwriteOCR），图片中的手写中文、手写数字进行检测和识别，针对不规则的手写字体进行专项优化，识别准确率可达90%以上。\n\n\n### 功能介绍\n检测识别图片中的手写中文、手写数字，针对不规则的手写字体进行专项优化\n\n\n### 特色优势\n识别准确率可达90%以上\n\n### 应用场景\n手写文字识别\n\n\n## 基本用法\n\n下面是手写文字识别的代码示例：\n\n示例图片为 ![示例图片](https://bj.bcebos.com/v1/appbuilder/test_handwrite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b)\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\nimage_url=\"https://bj.bcebos.com/v1/appbuilder/test_handwrite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b\"\n\n# 从BOS存储读取样例文件\nraw_image = requests.get(image_url).content\ninp = appbuilder.Message(content={\"raw_image\": raw_image})\n# inp = Message(content={\"url\": image_url})\n\n# 运行手写文字识别\nhandwrite_ocr = appbuilder.HandwriteOCR()\nout = handwrite_ocr.run(inp)\n# 打印识别结果\nprint(out.content) \n\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数 \n| 参数名称       | 参数类型   | 是否必须 | 描述                          |示例值|\n|------------|--------|------|-----------------------------|---|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 ||\n| +content   | Dict   | 是    | 消息内容                        ||\n| +raw_image | String | 否    | 原始图片字节流                     ||\n| +url       | String   | 否    | 图片下载链接地址                    ||\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer| 否    | HTTP重试次数                    |3||\n\n   \n### 响应参数\n| 参数名称      | 参数类型     | 描述 | 示例值                                                             |\n|-----------|----------|--|-----------------------------------------------------------------|\n| contents  | List     | 文本内容块 | |\n| +text     | String   | 文本字符串 | |\n| +Position | Dict     | 文本位置信息 | |\n| ++left    | Interger | 表示定位位置的长方形左上顶点的水平坐标 | |\n| ++top      | Interger |  表示定位位置的长方形左上顶点的垂直坐标| |\n| ++width   | Interger | 表示定位位置的长方形的宽度 | |\n| ++height  | Interger | 表示定位位置的长方形的高度 | |\n| direction | Interger | 图像旋转角度 | 图像旋转角度，0（正向），- 1（逆时针90度），- 2（逆时针180度），- 3（逆时针270度）|\n\n### 响应示例\n```json\n{\n\t\"contents\": [{\n\t\t\t\"text\": \"我们家住的小区里有很多银杏树。\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 390,\n\t\t\t\t\"top\": 46,\n\t\t\t\t\"width\": 1801,\n\t\t\t\t\"height\": 161\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"它们笔直笔直的,就像一位正在站岗的\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 131,\n\t\t\t\t\"top\": 263,\n\t\t\t\t\"width\": 2083,\n\t\t\t\t\"height\": 170\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"卫兵。它枝繁叶茂,长的非常好,它的叶子\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 154,\n\t\t\t\t\"top\": 483,\n\t\t\t\t\"width\": 2023,\n\t\t\t\t\"height\": 161\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"有些小的像一把把小扇子,大的也像扇子。\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 151,\n\t\t\t\t\"top\": 699,\n\t\t\t\t\"width\": 2167,\n\t\t\t\t\"height\": 168\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"但是中间有一个缺口,就像被淘汽的小\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 148,\n\t\t\t\t\"top\": 929,\n\t\t\t\t\"width\": 2123,\n\t\t\t\t\"height\": 177\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"text\": \"朋友用剪刀剪掉了一样。\",\n\t\t\t\"position\": {\n\t\t\t\t\"left\": 161,\n\t\t\t\t\"top\": 1165,\n\t\t\t\t\"width\": 1340,\n\t\t\t\t\"height\": 217\n\t\t\t}\n\t\t}\n\t],\n\t\"direction\": 0\n}\n```\n\n\n## 高级用法\n目前该模块仅提供基础的手写体识别。\n\n\n## 更新记录和贡献\n* 手写文字识别 (2024-01)\n* 手写文字识别 (2024-02)\n"
  },
  {
    "path": "python/core/components/handwrite_ocr/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/handwrite_ocr/component.py",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"手写文字识别组件\"\"\"\nimport base64\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.handwrite_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core import utils\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nclass HandwriteOCR(Component):\n    r\"\"\" 手写文字识别组件\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n        os.environ[\"GATEWAY_URL\"] = \"...\"\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n        # 从BOS存储读取样例文件\n        image_url=\"https://bj.bcebos.com/v1/appbuilder/test_handwrite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b\"\n        # 输入参数为一张图片\n        inp = appbuilder.Message(content={\"url\": image_url})\n        # 进行植物识别\n        handwrite_ocr = HandwriteOCR()\n        out = handwrite_ocr.run(inp)\n        # 打印识别结果\n        print(out.content)\n        \n     \"\"\"\n\n    name = \"handwriting_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"handwriting_ocr\",\n            \"description\": \"需要对图片中手写体文字进行识别时，使用该工具，不支持PDF文件，如果用户没有提供图片文件，应引导用户提供图片，而不是尝试使用该工具\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别文件的文件名\"\n                    }\n                },\n                \"required\": [\"file_names\"]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        r\"\"\"\n        输入图片并识别其中的文字\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作.例如: Message(content={\"raw_image\": b\"...\"}) 或 Message(content={\"url\": \"https://image/download/url\"}).\n            timeout (float, optional): HTTP超时时间. 默认为None.\n            retry (int, optional): HTTP重试次数. 默认为0.\n        \n        Returns:\n            Message: 手写体模型识别结果.\n        \"\"\"\n        inp = HandwriteOCRInMsg(**message.content)\n        request = HandwriteOCRRequest()\n        if inp.url:\n            request.url = inp.url\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        request.recognize_granularity = \"big\"\n        request.probability = \"false\"\n        request.detect_direction = \"true\"\n        request.detect_alteration = \"true\"\n        response = self._recognize(request, timeout, retry)\n        out = HandwriteOCROutMsg()\n        out.direction = response.direction\n        [out.contents.append(\n            Content(text=w.words,\n                    position=Position(\n                        left=w.location.left,\n                        top=w.location.top,\n                        width=w.location.width,\n                        height=w.location.height\n                    )))\n            for w in response.words_result]\n        return Message(content=out.model_dump())\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool, **kwargs):\n        r\"\"\"\n        对指定文件或URL进行手写识别。\n        \n        Args:\n            name (str): 任务名称。\n            streaming (bool): 是否以流式形式返回结果。\n            kwargs: 其他参数，包括：\n                traceid (str, optional): 请求的traceid，用于标识请求的唯一性。默认为None。\n                file_names (List[str], optional): 待识别的文件名列表。默认为None，此时会从kwargs中获取'files'参数。\n                file_urls (Dict[str, str], optional): 文件名与URL的映射字典。默认为空字典。\n        \n        Returns:\n            如果streaming为True，则以生成器形式返回识别结果，否则直接返回结果字符串。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误，例如指定的文件名对应的URL不存在。\n        \n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        result = \"\"\n        file_names = kwargs.get(\"file_names\", None)\n        if not file_names:\n            file_names = kwargs.get(\"files\")\n        file_urls = kwargs.get(\"file_urls\", {})\n        for file_name in file_names:\n\n            if utils.is_url(file_name):\n                file_url = file_name\n            else:\n                file_url = file_urls.get(file_name, None)\n            if file_url is None:\n                raise InvalidRequestArgumentError(f\"request format error, file {file_name} url does not exist\")\n            req = HandwriteOCRRequest()\n            req.url = file_url\n            req.recognize_granularity = \"big\"\n            req.probability = \"false\"\n            req.detect_direction = \"true\"\n            req.detect_alteration = \"true\"\n            response = self._recognize(req, request_id=traceid)\n            text = \"\".join([w.words for w in response.words_result])\n            result += f\"{file_name}的手写识别结果是：{text} \"\n\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": result,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": \"user\",\n            }\n        else:\n            return result\n\n    def _recognize(\n        self, \n        request: HandwriteOCRRequest, \n        timeout: float = None, \n        retry: int = 0,\n        request_id: str = None,\n    ) -> HandwriteOCRResponse:\n        r\"\"\"调用底层接口进行通用文字识别\n                    参数:\n                       request (obj: `HandwriteOCRRequest`) : 通用文字识别输入参数\n\n                   返回：\n                       response (obj: `HandwriteOCRResponse`): 通用文字识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        data = HandwriteOCRRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/handwriting\")\n        response = self.http_client.session.post(url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        ocr_response = HandwriteOCRResponse(data)\n        ocr_response.request_id = request_id\n        return ocr_response\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 通用文字识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n"
  },
  {
    "path": "python/core/components/handwrite_ocr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"手写文字识别数据类\"\"\"\nimport proto\nfrom typing import List, Optional\nfrom pydantic import BaseModel\n\n\nclass HandwriteOCRRequest(proto.Message):\n    \"\"\" 手写文字识别组件请求参数\n    属性:\n        image (str):\n            可选。图像内容的base64编码。\n        url (str):\n            可选。图像的URL地址，经过base64编码。\n            图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n        pdf_file (str):\n            可选。PDF文件内容的base64编码。\n        pdf_file_num (str):\n            可选。PDF文件的页数。\n        ofd_file (str):\n            可选。OFD（Open Format Document）文件内容的base64编码。\n        ofd_file_num (str):\n            可选。OFD文件的页数。\n        recognize_granularity(str):\n            可选，识别粒度：\n            可能的取值包括：\n            - \"big\": 不定位单字符位置\n            - \"small\": 定位单字符位置。\n        probability (str):\n            可选。是否输出置信度。默认为\"false\"。\n            可能的取值包括：\n            - \"true\": 返回识别结果中每行的置信度。\n            - \"false\": 不返回置信度。\n        detect_direction (str):\n            可选。是否检测文本方向。默认为\"false\"。\n            可能的取值包括：\n            - \"true\": 检测文本方向。\n            - \"false\": 不检测文本方向。\n        detect_alteration（str）：\n             可选，是否检测涂改痕迹，适用于手写作文场景，默认不检测\n             可选值包括：\n             - \"true\"：检测，涂改痕迹部分用“☰”返回；\n             - \"false\"：不检测\n    \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    pdf_file: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    pdf_file_num: str = proto.Field(\n        proto.STRING,\n        number=4,\n    )\n    ofd_file: str = proto.Field(\n        proto.STRING,\n        number=5,\n    )\n    ofd_file_num: str = proto.Field(\n        proto.STRING,\n        number=6,\n    )\n    recognize_granularity: str = proto.Field(\n        proto.STRING,\n        number=7,\n    )\n    probability: str = proto.Field(\n        proto.STRING,\n        number=8,\n    )\n    detect_direction: str = proto.Field(\n        proto.STRING,\n        number=9,\n    )\n    detect_alteration: str = proto.Field(\n        proto.STRING,\n        number=10,\n    )\n\n\nclass HandwriteLocation(proto.Message):\n    \"\"\" 手写体位置信息.\n\n        属性:\n            left (int): 表示定位位置的长方形左上顶点的水平坐标\n            top (int): 表示定位位置的长方形左上顶点的垂直坐标\n            width (int): 表示定位位置的长方形的宽度\n            height (int): 表示定位位置的长方形的高度\n         \"\"\"\n    left: int = proto.Field(\n        proto.INT32,\n        number=1,\n    )\n    top: int = proto.Field(\n        proto.INT32,\n        number=2,\n    )\n    width: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    height: int = proto.Field(\n        proto.INT32,\n        number=4,\n    )\n\n\nclass HandwriteWordResult(proto.Message):\n    \"\"\" 手写文字识别结果列表\n\n        属性:\n            words (str): 识别出的文本\n            location (Location): 文本位置信息\n     \"\"\"\n    words: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    location = proto.Field(\n        HandwriteLocation,\n        number=2,\n    )\n\n\nclass HandwriteProbability(proto.Message):\n    \"\"\"手写体置信度\n\n       属性:\n            average (float): 每行的平均置信度\n            variance (float): 每行置信度的方差\n            min (float)：每行的最小置信度\n    \"\"\"\n\n    average: float = proto.Field(\n        proto.FLOAT,\n        number=1,\n    )\n    variance: float = proto.Field(\n        proto.FLOAT,\n        number=2,\n    )\n    min: float = proto.Field(\n        proto.FLOAT,\n        number=3,\n    )\n\n\nclass HandwriteOCRResponse(proto.Message):\n    \"\"\"手写文字识别结果\n\n        属性:\n            request_id(str): 请求ID\n            log_id (int): 用于问题跟踪的唯一日志ID\n            words_result_num (int): 必填。识别结果的数量\n            words_result (List[WordResult]): 识别结果的数组\n            probability（Probability）：当probability=true 时返回该字段，表示识别结果中每一行的置信度值\n            direction (int): 当detect_direction=true返回改字段，1（未定义）、\n            0（正向）、1（逆时针90度）、2（逆时针180度）、3（逆时针270度）\n            pdf_file_size (str): 输入PDF文件的总页数。当pdf_file参数有效时返回\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    log_id: int = proto.Field(\n        proto.UINT64,\n        number=2,\n    )\n    words_result_num: int = proto.Field(\n        proto.UINT32,\n        number=3,\n    )\n    words_result = proto.RepeatedField(\n        HandwriteWordResult,\n        number=4,\n    )\n    probability = proto.Field(\n        HandwriteProbability,\n        number=5\n    )\n    direction: int = proto.Field(\n        proto.INT32,\n        number=6,\n    )\n    pdf_file_size: str = proto.Field(\n        proto.STRING,\n        number=7,\n    )\n\n\nclass HandwriteOCRInMsg(BaseModel):\n    \"\"\" 手写体文字识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''  # 原始图片byte数组\n    url: str = \"\"  # 图片可下载链接\n\n\nclass Position(BaseModel):\n    \"\"\"位置信息\n\n       属性：\n            left (int): 表示定位位置的长方形左上顶点的水平坐标\n            top (int): 表示定位位置的长方形左上顶点的垂直坐标\n            width (int): 表示定位位置的长方形的宽度\n            height (int): 表示定位位置的长方形的高度\n    \"\"\"\n\n    left: int\n    top: int\n    width: int\n    height: int\n\n\nclass Content(BaseModel):\n    \"\"\" 识别文字\n\n        属性：\n            content(str):文字内容\n            position(Position): 文字内容的位置信息\n    \"\"\"\n    text: str\n    position: Optional[Position] = None\n\n\nclass HandwriteOCROutMsg(BaseModel):\n    \"\"\" 识别文字结果列表\n\n        属性：\n            contents(list[Content]): 手写体文字识别结果列表\n            direction(int): 图像旋转角度，0（正向），- 1（逆时针90度），- 2（逆时针180度），- 3（逆时针270度）\n    \"\"\"\n    contents: List[Content] = list()\n    direction: int = 0\n"
  },
  {
    "path": "python/core/components/image_understand/README.md",
    "content": "# 图像内容理解 （ImageUnderstand）\n\n## 简介\n图像内容理解 （ImageUnderstand），输出理解图片后的文本信息\n### 功能介绍\n支持输入图片和提问信息，可对输入图片进行理解，输出对图片的一句话描述\n### 特色优势\n同时，支持客户自主选择，是否调用大模型对输出文本进行润色，目前支持百度文心大模型调用。\n\n### 应用场景\n图像内容理解\n\n## 基本用法\n\n下面是图像内容理解的代码示例：\n\n示例图片为：![示例图片](https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6)\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 从BOS存储读取样例文件\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6\"\nraw_image = requests.get(image_url).content\n# 输入参数为一张图片\ninp = appbuilder.Message(content={\"raw_image\": raw_image, \"question\": \"图片里内容是什么?\"})\n# 进行图像内容理解\nimage_understand = appbuilder.ImageUnderstand()\nout = image_understand.run(inp)\n# 打印识别结果\nprint(out.content)\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n\n| 参数名称       | 参数类型   | 是否必须 | 描述                                | 示例值 |\n|------------|--------|------|-----------------------------------|-----|\n| message    | obj:`Message` | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数       |     |\n| +content   | Dict   | 是    | 消息内容                              |     |\n| ++raw_image | String | 否    | 原始图片字节流                           |     |\n| ++url       | String | 否    | 图片下载链接地址                          |     |\n| ++question  | String | 是    | 问题字符串，长度小于100                     |     |\n| ++language  | String | 否    | 描述内容的所使用的语言，默认是zh-CN（中文），可选en(英文) |     |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒 |1||\n|retry| Integer | 否    | HTTP重试次数 |3||\n\n### 响应参数\n| 参数名称      | 参数类型 | 描述     | 示例值                                             |\n|-----------|------|--------|-------------------------------------------------|\n|  message | obj:`Message`  | 图像理解输出内容 | - |\n| +content | Dict  | 输出内容 | \"description\": \"用户上传的图像，经过前期模型分析存在以下信息..., 整个图像内容可以表述为...，回答如下...\" |\n| ++description | String | 图像内容理解结果 | \"用户上传的图像，经过前期模型分析存在以下信息...，回答如下问题：图片里内容是什么?\" |\n\n### 响应示例\n```json\noutput.content = \n{\n\t\"description\": \"用户上传的图像，经过前期模型分析存在以下信息：;;整个图像内容可以表述为：...，回答如下问题：图片里内容是什么?, 注意不要复述提供的资料内容\"\n}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n目前该模块仅提供基础的图像内容理解。\n\n## 更新记录和贡献\n* 图像内容理解 (2024-01)"
  },
  {
    "path": "python/core/components/image_understand/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/image_understand/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"图像内容理解\"\"\"\nimport base64\nimport time\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.image_understand.model import *\nfrom typing import Generator, Union\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass ImageUnderstand(Component):\n    r\"\"\"\n    图像内容理解组件，即对于输入的一张图片（可正常解码，且长宽比适宜）与问题，输出对图片的描述\n\n    Examples:\n\n    .. code-block:: python\n    \n       import os\n       import appbuilder\n       os.environ[\"GATEWAY_URL\"] = \"...\"\n       os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n       # 从BOS存储读取样例文件\n       image_url = \"https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6\"\n       # 输入参数为一张图片\n       inp = Message(content={\"url\": image_url, \"question\": \"图片里内容是什么?\"})\n       # 进行图像内容理解\n       image_understand = ImageUnderstand()\n       out = image_understand.run(inp)\n       # 打印识别结果\n       print(out.content)\n     \"\"\"\n    name = \"image_understanding\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"image_understanding\",\n            \"description\": \"可对输入图片进行理解，可输出图片描述、OCR 及图像识别结果\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名\"\n                    },\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        执行图像内容理解\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作. 举例: Message(content={\"raw_image\": b\"...\", \"question\": \"图片主要内容是什么？\"})\n                              或 Message(content={\"url\": \"https://image/download/url\", \"question\": \"图片主要内容是什么？\"}).\n            timeout (float, optional): HTTP超时时间. 默认为 None.\n            retry (int, optional): HTTP重试次数. 默认为 0.\n        \n        Returns:\n            Message: 模型识别结果.\n        \n        \"\"\"\n        inp = ImageUnderstandInMsg(**message.content)\n        request = ImageUnderstandRequest()\n        # 兼容新参数，确保输出结果一致\n        request.subject_detect = False\n        request.llm_switch = False\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            request.url = inp.url\n        if inp.question == \"\":\n            raise ValueError(\"request format error, question is empty\")\n        if len(inp.question) > 100:\n            raise ValueError(f\"request format error, expected len(question)>100, got {len(inp.question)}\")\n        if inp.language != \"zh-CN\" and inp.language != \"en\":\n            raise ValueError(f\"request format error, expected language in ['zh-CN', 'en'], got {inp.language}\")\n        request.question = inp.question\n        request.output_CHN = True\n        if inp.language == \"en\":\n            request.output_CHN = False\n        response = self.__recognize(request, timeout, retry)\n        out = ImageUnderstandOutMsg(description=response.result.description_to_llm)\n        return Message(content=out.model_dump())\n\n    def __recognize(\n        self, \n        request: ImageUnderstandRequest, \n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> ImageUnderstandResponse:\n        r\"\"\"调用底层接口进行图像内容理解\n\n            参数:\n                request (obj: `ImageUnderstandRequest`) : 图像内容理解输入\n\n            返回：\n                response (obj: `ImageUnderstandResponse`): 图像内容理解输出\n        \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        data = ImageUnderstandRequest.to_dict(request)\n        headers = self.http_client.auth_header(request_id)\n        headers['Content-Type'] = 'application/json'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/image-understanding/request\")\n        response = self.http_client.session.post(url, json=data, timeout=timeout, headers=headers)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__.__check_create_task_service_error(request_id, data)\n        task = ImageUnderstandTask(data, request_id=request_id)\n        task_id = task.result.get(\"task_id\", \"\")\n        if task_id == \"\":\n            raise AppBuilderServerException(request_id=request_id, service_err_message=\"empty task_id\")\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/image-understanding/get-result\")\n        while True:\n            response = self.http_client.session.post(url, json={\"task_id\": task_id}, timeout=timeout, headers=headers)\n            self.http_client.check_response_header(response)\n            data = response.json()\n            self.http_client.check_response_json(data)\n            request_id = self.http_client.response_request_id(response)\n            self.__class__.__check_service_error(request_id, data.get(\"result\", {}))\n            # 处理成功\n            response = ImageUnderstandResponse(data)\n            if response.result.ret_code == 0:\n                return ImageUnderstandResponse(data)\n            # 还在处理中\n            if response.result.ret_code == 1:\n                # 避免触发限流（>1QPS），等待1.1秒\n                time.sleep(1.1)\n\n    @components_run_stream_trace\n    def tool_eval(\n        self,\n        name: str,\n        streaming: bool,\n        origin_query: str = '图片内容有哪些',\n        **kwargs,\n    ) -> Union[Generator[str, None, None], str]:\n        \"\"\"\n        用于工具的执行，调用底层接口进行图像内容理解\n        \n        Args:\n            name (str): 工具名\n            streaming (bool): 是否流式返回\n            origin_query (str): 用户原始query\n            **kwargs: 工具调用的额外关键字参数\n        \n        Returns:\n            Union[Generator[str, None, None], str]: 图片内容理解结果\n        \"\"\"\n        if origin_query is None or not origin_query.strip():\n            origin_query = '图片内容有哪些'\n        traceid = kwargs.get(\"traceid\")\n        img_name = kwargs.get(\"img_name\", \"\")\n        img_url = kwargs.get(\"img_url\", \"\")\n        file_urls = kwargs.get(\"file_urls\", {})\n        rec_res = self._recognize_w_post_process(\n            img_name,\n            img_url,\n            file_urls,\n            question=origin_query,\n            request_id=traceid\n        )\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": rec_res,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": 'user',\n            }\n        else:\n            return rec_res\n\n    def _recognize_w_post_process(\n        self,\n        img_name,\n        img_url,\n        file_urls,\n        question=\"图片内容有哪些\",\n        request_id=None,\n    ) -> str:\n        r\"\"\"\n            参数:\n                img_name (str): 图片文件名\n                img_url (bool): 图片url\n                question (str): 询问有关图片内容的问题\n                file_urls (dict): 文件名与对应文件url的映射\n\n            返回：\n                str: 图片内容理解结果\n        \"\"\"\n        req = ImageUnderstandRequest()\n        # 兼容新参数，确保输出结果一致\n        req.subject_detect = False\n        req.llm_switch = False\n        req.question = question\n        if img_name in file_urls:\n            req.url = file_urls[img_name]\n        if img_url:\n            if img_url in file_urls:\n                img_url = file_urls[img_url]\n            req.url = img_url\n        response = self.__recognize(req, request_id=request_id)\n        description_to_llm = response.result.description_to_llm\n        description_processed = description_to_llm.rsplit(\"。\", 2)[0]\n        return description_processed\n\n    @staticmethod\n    def __check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n\n            参数:\n                request (dict) : 图像内容理解body返回\n            返回：\n                无\n        \"\"\"\n        ret_code = data.get(\"ret_code\", 0)\n        if ret_code != 0 and ret_code != 1:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"ret_code\", \"\"),\n                service_err_message=data.get(\"ret_msg\", \"\")\n            )\n\n    @staticmethod\n    def __check_create_task_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request_id (str) : 任务请求ID\n                data (dict): 响应数据\n            返回：\n                无\n        \"\"\"\n\n        if \"error_code\" in data and \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\", \"\"),\n                service_err_message=data.get(\"error_msg\", \"\")\n            )\n\n\n\n\n\n"
  },
  {
    "path": "python/core/components/image_understand/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"Landmark recognition model.\"\"\"\n\nfrom typing import MutableMapping, List\n\nimport proto\nfrom pydantic import BaseModel\n\n\nclass ImageUnderstandRequest(proto.Message):\n    r\"\"\"地标识别请求参数\n\n         属性:\n             image (str, 可选): 图像base64编码结果.\n             url (str, 可选): 图像下载链接，base64编码后结果小于4MB, 短边大于15px，长边小于4096px.\n             question(str): 针对图片的问题信息，限制在100个字符之内\n         \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    question: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    output_CHN: bool = proto.Field(\n        proto.BOOL,\n        number=4\n    )\n    subject_detect: bool = proto.Field(\n        proto.BOOL,\n        number=5\n    )\n    llm_switch: bool = proto.Field(\n        proto.BOOL,\n        number=6\n    )\n\n\nclass ImageUnderstandTask(proto.Message):\n    r\"\"\"地标识别返回结果\n\n        属性:\n             log_id (int): 随机日志ID\n             request_id(str): 服务链路追踪ID.\n             result (MutableMapping[str, str]): {\"task_id\":\"task-123\"}\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=2\n    )\n    result: MutableMapping[str, str] = proto.MapField(\n        proto.STRING,\n        proto.STRING,\n        number=3,\n    )\n\n\nclass ImageUnderstandLocation(proto.Message):\n    \"\"\"位置信息\n\n          属性：\n               left (int): 表示定位位置的长方形左上顶点的水平坐标\n               top (int): 表示定位位置的长方形左上顶点的垂直坐标\n               width (int): 表示定位位置的长方形的宽度\n               height (int): 表示定位位置的长方形的高度\n    \"\"\"\n    top: int = proto.Field(\n        proto.INT32,\n        number=1\n    )\n    left: int = proto.Field(\n        proto.INT32,\n        number=2\n    )\n    width: int = proto.Field(\n        proto.INT32,\n        number=3\n    )\n    height: int = proto.Field(\n        proto.INT32,\n        number=4\n    )\n\n\nclass ImageUnderstandSubject(proto.Message):\n    \"\"\"主题信息\n\n            属性：\n                name (str): 主题名字\n                location (ImageUnderstandLocation): 主题位置\n    \"\"\"\n    name: str = proto.Field(\n        proto.STRING,\n        number=1\n    )\n    location = proto.Field(\n        ImageUnderstandLocation,\n        number=2\n    )\n\n\nclass ImageUnderstandOCR(proto.Message):\n    \"\"\"主题信息\n            属性：\n                word (str): 文本识别结果\n                rect (ImageUnderstandLocation): 位置信息\n    \"\"\"\n    word: str = proto.Field(\n        proto.STRING,\n        number=1\n    )\n    rect = proto.Field(\n        ImageUnderstandLocation,\n        number=2\n    )\n    prob = proto.Field(\n        proto.FLOAT,\n        number=3\n    )\n\n\nclass ImageUnderstandResult(proto.Message):\n    \"\"\"主题信息\n            属性：\n                task_id (str): 任务id\n                ret_code (int): 返回错误码\n                ret_msg（str）：错误信息\n                description（str）：描述信息\n                description_to_llm（str）：描述信息\n                subject_result（ImageUnderstandSubject）：主题结果\n                ocr_result（ImageUnderstandOCR）：ocr识别结果\n                classify_result（str）：分类结果\n    \"\"\"\n    task_id: str = proto.Field(\n        proto.STRING,\n        number=1\n    )\n    ret_code: int = proto.Field(\n        proto.INT32,\n        number=2\n    )\n    ret_msg: str = proto.Field(\n        proto.STRING,\n        number=3\n    )\n    description: str = proto.Field(\n        proto.STRING,\n        number=4\n    )\n    description_to_llm: str = proto.Field(\n        proto.STRING,\n        number=5,\n    )\n    subject_result = proto.RepeatedField(\n        ImageUnderstandSubject,\n        number=6\n    )\n    ocr_result = proto.RepeatedField(\n        ImageUnderstandOCR,\n        number=7,\n    )\n    classify_result = proto.RepeatedField(\n        proto.STRING,\n        number=8\n    )\n\n\nclass ImageUnderstandResponse(proto.Message):\n    \"\"\"主题信息\n            属性：\n                request_id (str): 请求id\n                log_id (int): 日志ID\n                result（ImageUnderstandResult）：图像理解结果\n        \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=2\n    )\n    result = proto.Field(\n        ImageUnderstandResult,\n        number=3\n    )\n\n\nclass ImageUnderstandInMsg(BaseModel):\n    \"\"\" 图像理解输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''\n    url: str = \"\"\n    question: str = \"\"\n    language: str = \"zh-CN\"\n\n\nclass ImageUnderstandOutMsg(BaseModel):\n    \"\"\" 图像理解输出结果\n\n        属性:\n            description(str): 输出描述信息\n    \"\"\"\n    description: str = \"\"\n"
  },
  {
    "path": "python/core/components/landmark_recognize/README.md",
    "content": "# 地标识别（LandmarkRecognition）\n\n## 简介\n地标识别组件（LandmarkRecognition）可以识别12万中外著名地标、热门景点，可返回地标名称。\n\n### 功能介绍\n识别中外著名地标、热门景点，可返回地标名称\n\n### 特色优势\n可以识别12万中外著名地标、热门景点\n\n### 应用场景\n地点识别\n\n\n## 基本用法\n\n下面是地标识别的代码示例：\n\n示例图片为：![示例图片](https://bj.bcebos.com/v1/appbuilder/landmark_test.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A59%3A56Z%2F-1%2Fhost%2Fc249a068c6f321b91da0d0fd629b26ded58dcac2b6a3674f32378f5eb8df1ed0)\n\n```python\nimport os\n\nimport requests\n\nimport appbuilder\n\n#  请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n# 从BOS存储读取样例文件\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/landmark_test.jpeg?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n            \"11T10%3A59%3A56Z%2F-1%2Fhost%2Fc249a068c6f321b91\" \\\n            \"da0d0fd629b26ded58dcac2b6a3674f32378f5eb8df1ed0\"\nraw_image = requests.get(image_url).content\n# 输入参数为一张图片\ninp = appbuilder.Message(content={\"raw_image\": raw_image})\n# 进行地标识别\nlandmark_recognize = appbuilder.LandmarkRecognition()\nout = landmark_recognize.run(inp)\n# 打印识别结果\nprint(out.content) # eg: {\"landmark\": \"尼罗河\"}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数 \n| 参数名称       | 参数类型   | 是否必须 | 描述                          |示例值|\n|------------|--------|------|-----------------------------|---|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 ||\n| +content   | Dict   | 是    | 消息内容                        ||\n| +raw_image | String | 否    | 原始图片字节流                     ||\n| +url       | String   | 否    | 图片下载链接地址                    ||\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer| 否    | HTTP重试次数                    |3||\n\n### 响应参数\n| 参数名称     | 参数类型 | 描述   | 示例值    |\n|----------|------|------|--------|\n| landmark | str  | 地标名字 | 比如：尼罗河 |\n### 响应示例\n```json\n{\"landmark\": \"尼罗河\"}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n目前该模块仅提供基础的地标识别。\n\n## 更新记录和贡献\n* 地标识别 (2024-01)\n"
  },
  {
    "path": "python/core/components/landmark_recognize/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/landmark_recognize/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"landmark recognize component.\"\"\"\nimport base64\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.landmark_recognize.model import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass LandmarkRecognition(Component):\n    r\"\"\"\n    识别地标组件，即对于输入的一张图片（可正常解码，且长宽比适宜），输出图片中的地标识别结果\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        landmark_recognize = appbuilder.LandmarkRecognition()\n        with open(\"xxxx.jpg\", \"rb\") as f:\n            inp = appbuilder.Message(content={\"raw_image\": f.read()})\n            out = landmark_recognize.run(inp)\n            # 打印识别结果\n            print(out.content) # eg: {\"landmark\": \"狮身人面相\"}\n     \"\"\"\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        执行地标识别任务\n        \n        Args:\n            message (Message): 输入消息对象，包含待识别的图片或图片URL。\n                例如：Message(content={\"raw_image\": b\"...\"}) 或 Message(content={\"url\": \"https://image/download/url\"})。\n            timeout (float, optional): HTTP请求的超时时间。默认为None。\n            retry (int, optional): HTTP请求的重试次数。默认为0。\n        \n        Returns:\n            Message: 地标识别结果的消息对象。\n                例如：Message(content={\"landmark\": b\"狮身人面像\"})\n        \"\"\"\n        inp = LandmarkRecognitionInMsg(**message.content)\n        request = LandmarkRecognitionRequest()\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            request.url = inp.url\n        response = self.__recognize(request, timeout, retry)\n        out = LandmarkRecognitionOutMsg(landmark=response.result.get(\"landmark\", \"\"))\n        return Message(content=out.model_dump())\n\n    def __recognize(self, request: LandmarkRecognitionRequest, timeout: float = None,\n                    retry: int = 0) -> LandmarkRecognitionResponse:\n        r\"\"\"调用底层接口进行地标识别\n\n            参数:\n                request (obj: `LandmarkRecognitionRequest`) : 地标识别输入参数\n\n            返回：\n                response (obj: `LandmarkRecognitionResponse`): 地标识别返回结果\n        \"\"\"\n\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        data = LandmarkRecognitionRequest.to_dict(request)\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header()\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/landmark\")\n        response = self.http_client.session.post(url, data=data, timeout=timeout, headers=headers)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__.__check_service_error(request_id, data)\n        return LandmarkRecognitionResponse(data, request_id=request_id)\n\n    @staticmethod\n    def __check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n\n            参数:\n                request (dict) : 地标识别body返回\n            返回：\n                无\n        \"\"\"\n\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n\n"
  },
  {
    "path": "python/core/components/landmark_recognize/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"Landmark recognition model.\"\"\"\n\nfrom typing import MutableMapping\n\nimport proto\nfrom pydantic import BaseModel\n\n\nclass LandmarkRecognitionRequest(proto.Message):\n    r\"\"\"地标识别请求参数\n\n         属性:\n             image (str, 可选): 图像base64编码结果.\n             url (str, 可选): 图像下载链接，base64编码后结果小于4MB, 短边大于15px，长边小于4096px.\n         \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n        optional=True,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n        optional=True,\n    )\n\n\nclass LandmarkRecognitionResponse(proto.Message):\n    r\"\"\"地标识别返回结果\n\n        属性:\n             log_id (int): 随机日志ID\n             result (MutableMapping[str, str]): 地标识别结果, eg: {\"landmark\": \"狮身人面像\"}.\n             request_id(str): 服务链路追踪ID.\n    \"\"\"\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=1\n    )\n    result: MutableMapping[str, str] = proto.MapField(\n        proto.STRING,\n        proto.STRING,\n        number=2,\n    )\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass LandmarkRecognitionInMsg(BaseModel):\n    \"\"\" 地标识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''\n    url: str = \"\"\n\n\nclass LandmarkRecognitionOutMsg(BaseModel):\n    \"\"\" 地标识别输出消息\n\n        属性:\n            landmark(str): 地标识别结果\n    \"\"\"\n    landmark: str\n"
  },
  {
    "path": "python/core/components/llms/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/llms/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport itertools\nimport json\nimport os\nimport uuid\nfrom enum import Enum\nimport logging\nimport requests\nimport copy\nimport collections.abc\nfrom appbuilder.core.constants import GATEWAY_URL, GATEWAY_INNER_URL\nfrom pydantic import BaseModel, Field, ValidationError, HttpUrl, validator\nfrom pydantic.types import confloat\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message, _T\nfrom appbuilder.utils.logger_util import logger\nfrom typing import Dict, List, Optional, Any\n\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.utils import ModelInfo, ttl_lru_cache\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.core._exception import AppBuilderServerException, ModelNotSupportedException\n\n\nclass LLMMessage(Message):\n    content: Optional[_T] = {}\n    extra: Optional[Dict] = {}\n    token_usage: Optional[Dict] = {}\n\n    def __str__(self):\n        return f\"Message(name={self.name}, content={self.content}, \" \\\n               f\"mtype={self.mtype}, extra={self.extra}, token_usage={self.token_usage})\"\n    \n    def __deepcopy__(self, memo):\n        new_instance = self.__class__()\n        memo[id(self)] = new_instance\n        for k, v in self.__dict__.items():\n            if k == \"content\" and isinstance(v, collections.abc.Iterator):\n                pass\n            else:\n                setattr(new_instance, k, copy.deepcopy(v, memo))\n        return new_instance\n\n\nclass CompletionRequest(object):\n    r\"\"\"ShortSpeechRecognitionRequest.\"\"\"\n    params = None\n    response_mode = \"blocking\"\n\n    def __init__(self, params: Dict[str, Any] = None, response_mode: str = None, **kwargs):\n        r\"\"\" __init__ the client state.\n        \"\"\"\n        self.params = params\n        self.response_mode = response_mode\n\n\nclass ModelArgsConfig(BaseModel):\n    stream: bool = Field(default=False, description=\"是否流式响应。默认为 False。\")\n    temperature: float = Field(default=1e-10,gt=0.0, le=1.0 ,description=\"模型的温度参数，范围从 0.0 到 1.0。\")\n    top_p: float= Field(default=1e-10, ge=0.0, le=1.0, description=\"模型的top_p参数，范围从 0.0 到 1.0。\")\n    max_output_tokens: int = Field(default=1024, ge=2, description=\"最大输出token数。\")\n    disable_search: bool = Field(default=True, description=\"是否禁用搜索。默认为 True\")\n    response_format: str = Field(default=\"text\", description=\"响应格式，可选项有text、json_object\")\n    stop: list[str] = Field(default=[], description=\"停止词列表。\", max_length=4)\n\n\nclass CompletionResponse(object):\n    r\"\"\"ShortSpeechRecognitionResponse.\"\"\"\n    error_no = 0\n    error_msg = \"\"\n    result = None\n    log_id = \"\"\n    extra = None\n    token_usage = {}\n\n    def __init__(self, response, stream: bool = False):\n        \"\"\"初始化客户端状态。\"\"\"\n        self.error_no = 0\n        self.error_msg = \"\"\n        self.log_id = response.headers.get(\"X-Appbuilder-Request-Id\", None)\n        self.extra = {}\n        self.token_usage = {}\n\n        if stream:\n            # 流式数据处理\n            def stream_data():\n                sse_client = SSEClient(response)\n                for event in sse_client.events():\n                    if not event:\n                        continue\n                    answer = self.parse_stream_data(event)\n                    if answer is not None:\n                        yield answer\n\n            self.result = stream_data()\n        else:\n            # 非流式数据的处理\n            if response.status_code != 200:\n                self.error_no = response.status_code\n                self.error_msg = \"error\"\n                self.result = response.text\n\n                raise AppBuilderServerException(self.log_id, self.error_no, self.result)\n\n            else:\n                data = response.json()\n\n                if data.get(\"code\") and \"message\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n\n                if \"code\" in data and \"message\" in data and \"requestId\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n\n                if \"code\" in data and \"message\" in data and \"status\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n\n                self.result = data.get(\"answer\", None)\n                trace_log_list = data.get(\"trace_log\", None)\n                if trace_log_list is not None:\n                    for trace_log in trace_log_list:\n                        key = trace_log[\"tool\"]\n                        result_list = trace_log[\"result\"]\n                        result_list = ResultProcessor.process(key, result_list)\n                        self.extra[key] = result_list\n                self.token_usage = data.get(\"usage\", {})\n\n    def parse_stream_data(self, event):\n        \"\"\"解析流式数据块并提取answer字段\"\"\"\n        parsed_str = event.data\n        raw_str = event.raw\n        if parsed_str:\n            try:\n                data = json.loads(parsed_str)\n                if data.get(\"code\") and \"message\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n                if \"code\" in data and \"message\" in data and \"requestId\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n                if \"code\" in data and \"message\" in data and \"status\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n                return data\n            except json.JSONDecodeError:\n                # 处理可能的解析错误\n                logging.error(\"failed to parse: \" + parsed_str)\n                raise AppBuilderServerException(\"unknown\", \"unknown\", parsed_str)\n        else:\n            try:\n                data = json.loads(raw_str)\n                if \"code\" in data and \"message\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n                return data\n            except json.JSONDecodeError:\n                # 处理解析错误\n                logging.error(\"failed to parse: \" + raw_str)\n                raise AppBuilderServerException(\"unknown\", \"unknown\", raw_str)\n\n    def get_stream_data(self):\n        \"\"\"获取处理过的流式数据的迭代器\"\"\"\n        return self.result\n\n    def to_message(self):\n        \"\"\"将响应结果转换为Message对象。\n\n        Returns:\n            Message: Message对象。\n\n        \"\"\"\n        message = LLMMessage()\n        message.id = self.log_id\n        message.content = self.result\n        message.extra = self.extra\n        message.token_usage = self.token_usage\n        return self.message_iterable_wrapper(message)\n\n    def message_iterable_wrapper(self, message):\n        \"\"\"\n        对模型输出的 Message 对象进行包装。\n        当 Message 是流式数据时，数据被迭代完后，将重新更新 content 为 blocking 的字符串。\n        \"\"\"\n\n        class IterableWrapper:\n            def __init__(self, stream_content):\n                self._content = stream_content\n                self._concat = \"\"\n                self._token_usage = {}\n\n            def __iter__(self):\n                return self\n\n            def __next__(self):\n                try:\n                    result_json = next(self._content)\n                    char = result_json.get(\"answer\", \"\")\n                    result_list = result_json.get(\"result\")\n                    key = result_json.get(\"tool\")\n                    if result_list is not None:\n                        result_list = ResultProcessor.process(key, result_list)\n                        message.extra = {key: result_list}  # Update the original extra\n                    else:\n                        message.extra = {}\n                    if \"usage\" in result_json:\n                        self._token_usage = result_json.get(\"usage\")\n                        message.token_usage = self._token_usage\n                    self._concat += char\n                    return char\n                except StopIteration:\n                    message.content = self._concat  # Update the original content\n                    raise\n\n        from collections.abc import Generator\n        if isinstance(message.content, Generator):\n            # Replace the original content with the custom iterable\n            message.content = IterableWrapper(message.content)\n        return message\n\nclass ResultProcessor:\n    @staticmethod\n    def process(key, result_list):\n        if key == 'search_baidu':\n            rename_fields = {\n                'id': 'url',\n                'mock_id': 'ref_id',\n                'content': 'content',\n                'title': 'title',\n                'icon': 'icon',\n                'site_name': 'site_name',\n            }\n            renamed_list = []\n            for result in result_list:\n                renamed_list.append({rename_fields[k]: v for k, v in result.items() if k in rename_fields})\n            return renamed_list\n        elif key == 'search_db':\n            return result_list\n        else:\n            raise TypeError(f\"illegal argument key, expected key in {'search_baidu','search_db'}, got {key}\")\n\n\nclass CompletionBaseComponent(Component):\n    name: str\n    version: str\n    base_url: str = \"/rpc/2.0/cloud_hub/v1/ai_engine/copilot_engine\"\n    model_name: str = \"\"\n    model_url: str = \"\"\n    model_type: str = \"chat\"\n    excluded_models: List[str] = [\"DeepSeek-V3.1\", \"ChatLaw\"]\n    model_info: ModelInfo = None\n    model_config: Dict[str, Any] = {\n        \"model\": {\n            \"provider\": \"baidu\",\n            \"name\": \"ERNIE-Bot\",\n            \"completion_params\": {\n                \"temperature\": 1e-10,\n                \"top_p\": 0,\n            }\n        }\n    }\n\n    def __init__(\n        self, \n        meta: ComponentArguments, \n        model: str = None, \n        secret_key: Optional[str] = None,\n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"\n        Args:\n            meta (ComponentArguments): 组件参数信息\n            model (str, optional): 模型名称. Defaults to None.\n            secret_key (Optional[str], optional): 可选的密钥. Defaults to None.\n            gateway (str, optional): 网关地址. Defaults to \"\".\n            lazy_certification (bool, optional): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n            **kwargs: 其他关键字参数\n        \n        \"\"\"\n        super(CompletionBaseComponent, self).__init__(\n                meta=meta, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n        self.model_name = model\n        self.version = self.version\n        if not lazy_certification:\n            self._check_model_and_get_model_url(self.model_name, self.model_type)\n\n    @ttl_lru_cache(seconds_to_live=1 * 60 * 60) # 1h \n    def set_secret_key_and_gateway(self, secret_key: Optional[str] = None, gateway: str = \"\"):\n        super(CompletionBaseComponent, self).set_secret_key_and_gateway(\n                secret_key=secret_key, gateway=gateway)\n        # 不用重新获取列表\n        if os.environ.get(\"PRIVATE_AB\", \"OFF\") == \"OFF\":\n            self.__class__.model_info = ModelInfo(client=self.http_client)\n\n    def set_model_info(self, model_name: str, model_url: str):\n        \"\"\"为llm component设置模型信息\"\"\"\n        self.model_name = model_name\n        self.model_url = model_url\n\n    @ttl_lru_cache(seconds_to_live=1 * 60 * 60) # 1h \n    def _check_model_and_get_model_url(self, model, model_type):\n        if model and model in self.excluded_models:\n            raise ModelNotSupportedException(f\"unsupport model, epected model in {self.excluded_models}, got {model}\")\n        if not model:\n            raise ValueError(\"illegal argument, model_name can't be empty\")\n        if self.__class__.model_info is None:\n            self.set_secret_key_and_gateway()\n        m_type = self.model_info.get_model_type(model)\n        if m_type != model_type:\n            raise ModelNotSupportedException(\n                f\"unsupport model_type for model {model}, expected model_type in {model_type}, got {m_type}\")\n\n        model_url = self.model_info.get_model_url(model)\n        return model_url\n\n    def gene_request(self, query, inputs, response_mode, message_id, model_config):\n        \"\"\"\"send request\"\"\"\n\n        data = {\n            \"query\": query,\n            \"inputs\": inputs,\n            \"response_mode\": response_mode,\n            \"user\": message_id,\n            \"model_config\": model_config\n        }\n\n        request = CompletionRequest(data, response_mode)\n        return request\n\n    def gene_response(self, response, stream: bool = False):\n        \"\"\"generate response\"\"\"\n        response = CompletionResponse(response, stream)\n        return response\n\n    def run(self, *args, **kwargs):\n        \"\"\"\n        Run the model with given input and return the result.\n\n        Args:\n            **kwargs: Keyword arguments for both StyleWritingComponent and common component inputs.\n\n        Returns:\n            obj:`Message`: Output message after running model.\n        \"\"\"\n\n        timeout = kwargs.get('timeout')\n        retry = kwargs.get('retry', 0)\n        request_id = kwargs.get('request_id')\n        specific_params = {k: v for k, v in kwargs.items() if k in self.meta.model_fields}\n        model_config_params = {k: v for k, v in kwargs.items() if k in ModelArgsConfig.model_fields}\n        \n        # 不在timeout、retry、request_id、specific_params、model_config_params中的参数\n        other_params = {k: v for k, v in kwargs.items() if k not in [\n            'timeout', 'retry', 'request_id' ] + list(specific_params.keys()) + list(model_config_params.keys()) }\n\n        try:\n            specific_inputs = self.meta(**specific_params)\n            model_config_inputs = ModelArgsConfig(**model_config_params)\n        except ValidationError as e:\n            raise ValueError(e)\n\n        query, inputs, response_mode, user_id = self.get_compeliton_params(specific_inputs, model_config_inputs)\n        model_config = self.get_model_config(model_config_inputs, other_params)\n        request = self.gene_request(query, inputs, response_mode, user_id, model_config)\n        response = self.completion(\n            version=self.version,\n            base_url=self.base_url,\n            request=request,\n            timeout=timeout,\n            retry=retry,\n            request_id=request_id\n        )\n\n        if response.error_no != 0:\n            raise AppBuilderServerException(service_err_code=response.error_no, service_err_message=response.error_msg)\n\n        return response.to_message()\n\n    def get_compeliton_params(self, specific_inputs, model_config_inputs):\n        \"\"\"获取模型请求参数\"\"\"\n        inputs = specific_inputs.extract_values_to_dict()\n\n        query = inputs[\"query\"]\n        user_id = str(uuid.uuid4())\n\n        if model_config_inputs.stream:\n            response_mode = \"streaming\"\n        else:\n            response_mode = \"blocking\"\n\n        return query, inputs, response_mode, user_id\n\n    def get_model_config(self, model_config_inputs: ModelArgsConfig, other_params: dict = {}):\n        \"\"\"获取模型配置信息\"\"\"\n        self.model_config[\"model\"][\"name\"] = self.model_name\n        # 不需要进行地址替换\n        if os.environ.get(\"PRIVATE_AB\", \"false\") == \"false\":\n            model_url = self._check_model_and_get_model_url(self.model_name, self.model_type)\n            if model_url:\n                self.model_config[\"model\"][\"url\"] = model_url\n        elif os.environ.get(\"PRIVATE_AB\", \"false\") == \"true\":\n            if self.model_url:\n                self.model_config[\"model\"][\"url\"] = self.model_url\n\n        self.model_config[\"model\"][\"completion_params\"][\"temperature\"] = model_config_inputs.temperature\n        self.model_config[\"model\"][\"completion_params\"][\"top_p\"] = model_config_inputs.top_p\n        self.model_config[\"model\"][\"completion_params\"][\"max_output_tokens\"] = model_config_inputs.max_output_tokens\n        self.model_config[\"model\"][\"completion_params\"][\"disable_search\"] = model_config_inputs.disable_search\n        self.model_config[\"model\"][\"completion_params\"][\"response_format\"] = model_config_inputs.response_format\n        self.model_config[\"model\"][\"completion_params\"][\"stop\"] = model_config_inputs.stop\n\n        if len(other_params) > 0:\n            logger.info(\"Some paramters are not expected by the model configuration, we assume they will be used in llm completion api\")\n\n            for k, v in other_params.items():\n                self.model_config[\"model\"][\"completion_params\"][k] = v\n                logger.info(\"Add parameter: {}, value: {} in completion_params.\".format(k, v))\n            \n        return self.model_config\n\n    def completion(\n        self,\n        version,\n        base_url,\n        request: CompletionRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> CompletionResponse:\n        r\"\"\"Send a byte array of an audio file to obtain the result of speech recognition.\"\"\"\n\n        headers = self.http_client.auth_header(request_id)\n        headers[\"Content-Type\"] = \"application/json\"\n\n        completion_url = \"/\" + self.version + \"/api/llm/\" + self.name\n\n        stream = True if request.response_mode == \"streaming\" else False\n        url = self.http_client.service_url(completion_url, self.base_url)\n        response = self.http_client.session.post(url, json=request.params, headers=headers, timeout=timeout,\n                                                 stream=stream)\n        \n        return self.gene_response(response, stream)\n\n\n    @staticmethod\n    def check_service_error(data: dict):\n        r\"\"\"check service internal error.\n            :param: data: dict, service return body data.\n            :rtype: .\n        \"\"\"\n        if \"err_no\" in data and \"err_msg\" in data:\n            if data[\"err_no\"] != 0:\n                raise AppBuilderServerException(service_err_code=data[\"err_no\"], service_err_message=data[\"err_msg\"])\n\n"
  },
  {
    "path": "python/core/components/llms/dialog_summary/README.md",
    "content": "# 会话小结（DialogSummary）\n\n## 简介\n会话小结（DialogSummary）基于生成式大模型对一段用户与坐席的对话生成总结，结果按{\"诉求\": \"\", \"回应\": \"\", \"解决情况\": \"\"}格式输出。适用于运营商、金融、汽车等多种场景的对话总结。\n\n### 功能介绍\n基于生成式大模型对一段用户与坐席的对话生成总结。\n\n### 特色优势\n基于生成式大模型对一段用户与坐席的对话生成总结，结果按{\"诉求\": \"\", \"回应\": \"\", \"解决情况\": \"\"}格式输出。\n\n### 应用场景\n适用于运营商、金融、汽车等多种场景的对话总结。\n\n## 基本用法\n\n为了快速开始使用会话小结组件，您可以参考以下步骤：\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n\ndialog_summary = appbuilder.DialogSummary(\"DeepSeek-V3.1\")\ntext = \"用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见\"\nanswer = dialog_summary(appbuilder.Message(text))\nprint(answer)\n```\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model` (str|None): 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n### 调用参数\n|参数名称 |参数类型 | 是否必须 | 描述                                                                          | 示例值           |\n|--------|--------|---|-----------------------------------------------------------------------------|---------------|\n|message |Message  | 是 | 输入消息，包含用户提出的问题。                                                             | Message(\"你好\") |\n|stream|bool| 否 | 是否以流式形式返回响应                                                                 | False         |\n|temperature|float| 否 | 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 0.0001        |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|对象，包含模型运行后的输出消息。|\n### 响应示例\n```json\n{\"result\": [\"您话费余的话还有87.49元钱\"]}\n```\n### 错误码\n无\n\n## 高级用法\n\n暂无\n\n## 示例和案例研究\n\n目前暂无具体的实际应用案例。\n\n## API文档\n\n暂无\n\n## 更新记录和贡献\n* 会话小结更新Readme (2023-12)\n"
  },
  {
    "path": "python/core/components/llms/dialog_summary/__init__.py",
    "content": "\"\"\"DialogSummary\"\"\"\nfrom .component import DialogSummary"
  },
  {
    "path": "python/core/components/llms/dialog_summary/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom pydantic import Field\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\n\nclass DialogSummaryArgs(ComponentArguments):\n    \"\"\"\n    会话小结生成配置\n\n    Attributes:\n        message (Message): 输入对话文本，用于生成小结\n    \"\"\"\n    message: Message = Field(...,\n                             variable_name='query',\n                             description='输入对话文本，用于生成小结')\n\n"
  },
  {
    "path": "python/core/components/llms/dialog_summary/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import Optional\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import DialogSummaryArgs\n\nclass DialogSummary(CompletionBaseComponent):\n    r\"\"\"\n    会话小结大模型组件， 基于生成式大模型对一段用户与坐席的对话生成总结，结果按{\"诉求\": \"\", \"回应\": \"\", \"解决情况\": \"\"}格式输出。\n\n    Examples:\n\n    .. code-block:: python\n\n        import app\n        import os\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        dialog_summary = appbuilder.DialogSummary(\"DeepSeek-V3.1\")\n        text = \"用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见\"\n        answer = dialog_summary(appbuilder.Message(text))\n        print(answer)\n\n    \"\"\"\n    name = \"dialog_summary\"\n    version = \"v1\"\n    meta = DialogSummaryArgs\n\n    manifests = [\n        {\n            \"name\": \"dialog_summary\",\n            \"description\": \"基于输入的对话，用大模型对该段对话生成总结, 结果按{\\\"诉求\\\": \\\"\\\", \\\"回应\\\": \\\"\\\", \\\"解决情况\\\": \\\"\\\"}格式输出。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入的对话，用于大模型根据该对话生成总结。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化DialogSummary模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                DialogSummaryArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/hallucination_detection/README.md",
    "content": "# 幻觉检测（Hallucination Detection）\n\n## 简介\n幻觉检测（Hallucination Detection）针对问答场景，检测答案中是否存在幻觉。\n\n### 功能介绍\n幻觉检测（Hallucination Detection）针对问答场景，检测答案中是否存在幻觉。\n\n### 特色优势\n无。\n\n### 应用场景\n问答场景，比如RAG问答。\n\n## 基本用法\n\n下面是幻觉检测的代码示例：\n\n```python\nimport os\nimport appbuilder\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ['APPBUILDER_TOKEN'] = '...'\n\n\nquery = '澳门新麻蒲烤肉店每天开门吗？'\ncontext = \\\n'''澳门美食： 澳门新麻蒲韩国烤肉店\n在澳门一年四季之中除了火锅，烤肉也相当受欢迎。提到韩烧，有一间令我印象最深刻，就是号称韩国第一的烤肉店－新麻蒲韩国烤肉店，光是韩国的分店便多达四百多间，海外分店更是遍布世界各地，2016年便落户澳门筷子基区，在原本已经食肆林立的地方一起百花齐放！店内的装修跟韩国分店还完度几乎没差，让食客彷如置身于韩国的感觉，还要大赞其抽风系统不俗，离开时身上都不会沾上烤肉味耶！\n时间：周一至周日 下午5:00 - 上午3:00\n电话：＋853 2823 4012\n地址：澳门筷子基船澳街海擎天第三座地下O号铺96号\n必食推介:\n护心肉二人套餐\n来新麻蒲必试的有两样东西，现在差不多每间烤肉店都有炉边烤蛋，但大家知道吗？原来新麻蒲就是炉边烤蛋的开创者，既然是始祖，这已经是个非吃不可的理由！还有一款必试的就是护心肉，即是猪的横隔膜与肝中间的部分，每头猪也只有200克这种肉，非常珍贵，其味道吃起来有种独特的肉香味，跟牛护心肉一样精彩！\n秘制猪皮\n很多怕胖的女生看到猪皮就怕怕，但其实猪皮含有大量胶原蛋白，营养价值很高呢！这里红通通的猪皮还经过韩国秘制酱汁处理过，会有一点点辣味。烤猪皮的时候也需特别注意火侯，这样吃起来才会有外脆内Q的口感！'''\nanswer = '澳门新麻蒲烤肉店并不是每天开门。'\n\n#! 该组件推荐使用DeepSeek-V3.1模型。\nhallucination_detection = appbuilder.HallucinationDetection('DeepSeek-V3.1')\ninputs = {'query': query, 'context': context, 'answer': answer}\nmsg = appbuilder.Message(inputs)\nresult = hallucination_detection.run(msg)\n\nprint(result)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `model` | str | 是 | 模型名称，用于指定要使用的千帆模型。推荐使用DeepSeek-V3.1模型。 | DeepSeek-V3.1 |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入信息，用于传入用户查询query、根据query得到的检索结果context和基于context生成的query的答案answer。 | Message(content={'query': '...', 'context': '...', 'answer': '...'}) |\n| `stream` | bool | 否 | 指定是否以流式形式返回响应。默认为 False。 | False |\n| `temperature` | float | 否 | 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 0.1 |\n| `top_p` | float | 否 | 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0.0。 | 0.0 |\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果（可通过result.content获取结果核心内容） | Message(content='...') |\n\n### 响应示例\n```\nMessage(name=msg, content=存在幻觉, mtype=dict, extra={}, token_usage={'prompt_tokens': 748, 'completion_tokens': 2, 'total_tokens': 750})\n```\n\n### 错误码\n|错误码|描述|\n| ------ | ------ |\n\n## 高级用法\n可用于RAG问答的答案检测。\n\n## 更新记录和贡献\n### 2024.5.22\n#### [Added]\n- 增加幻觉检测组件。\n- 增加幻觉检测组件单元测试。"
  },
  {
    "path": "python/core/components/llms/hallucination_detection/__init__.py",
    "content": "from .component import HallucinationDetection"
  },
  {
    "path": "python/core/components/llms/hallucination_detection/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom pydantic import Field\nfrom appbuilder.core.component import ComponentArguments\n\n\n\nclass HallucinationDetectionArgs(ComponentArguments):\n    \"\"\"\n    幻觉检测配置\n\n    Attributes:\n        query: str\n            用户查询。\n        context: str\n            根据query得到的检索结果。\n        answer: str\n            基于context生成的query的答案。\n    \"\"\"\n    query: str = Field(...,\n                       valiable_name='query',\n                       description='用户查询。')\n    context: str = Field(...,\n                         valiable_name='context',\n                         description='根据query得到的检索结果。')\n    answer: str = Field(...,\n                        valiable_name='answer',\n                        description='基于context生成的query的答案。')"
  },
  {
    "path": "python/core/components/llms/hallucination_detection/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom pydantic import BaseModel, Field\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent, ModelArgsConfig\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import HallucinationDetectionArgs\n        \n\nclass HallucinationDetection(CompletionBaseComponent):\n    \"\"\"\n    幻觉检测。输入<query, context, answer>，判断answer中是否存在幻觉。\n    *注：该组件推荐使用DeepSeek-V3.1模型。*\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ['APPBUILDER_TOKEN'] = '...'\n\n        hallucination_detection = appbuilder.HallucinationDetection()\n\n        query = ''\n        context = \\\n        '''澳门美食： 澳门新麻蒲韩国烤肉店\n        在澳门一年四季之中除了火锅，烤肉也相当受欢迎。提到韩烧，有一间令我印象最深刻，就是号称韩国第一的烤肉店－新麻蒲韩国烤肉店，光是韩国的分店便多达四百多间，海外分店更是遍布世界各地，2016年便落户澳门筷子基区，在原本已经食肆林立的地方一起百花齐放！店内的装修跟韩国分店还完度几乎没差，让食客彷如置身于韩国的感觉，还要大赞其抽风系统不俗，离开时身上都不会沾上烤肉味耶！\n        时间：周一至周日 下午5:00 - 上午3:00\n        电话：＋853 2823 4012\n        地址：澳门筷子基船澳街海擎天第三座地下O号铺96号\n        必食推介:\n        护心肉二人套餐\n        来新麻蒲必试的有两样东西，现在差不多每间烤肉店都有炉边烤蛋，但大家知道吗？原来新麻蒲就是炉边烤蛋的开创者，既然是始祖，这已经是个非吃不可的理由！还有一款必试的就是护心肉，即是猪的横隔膜与肝中间的部分，每头猪也只有200克这种肉，非常珍贵，其味道吃起来有种独特的肉香味，跟牛护心肉一样精彩！\n        秘制猪皮\n        很多怕胖的女生看到猪皮就怕怕，但其实猪皮含有大量胶原蛋白，营养价值很高呢！这里红通通的猪皮还经过韩国秘制酱汁处理过，会有一点点辣味。烤猪皮的时候也需特别注意火侯，这样吃起来才会有外脆内Q的口感！'''\n        answer = '澳门新麻蒲烤肉店并不是每天开门。'\n\n        inputs = {'query': query, 'context': context, 'answer': answer}\n        msg = appbuilder.Message(inputs)\n        result = hallucination_detection.run(msg)\n\n        print(result)\n    \"\"\"\n    name = 'hallucination_detection'\n    version = 'v1'\n    meta = HallucinationDetectionArgs\n\n    manifests = [\n        {\n            \"name\": \"hallucination_detection\",\n            \"description\": \"输入用户查询query、检索结果context以及根据检索结果context生成的用户查询query的回答answer，判断answer\" \\\n                           \"中是否存在幻觉。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"用户查询。\"\n                    },\n                    \"context\": {\n                        \"type\": \"string\",\n                        \"description\": \"检索结果。\"\n                    },\n                    \"answer\": {\n                        \"type\": \"string\",\n                        \"description\": \"根据检索结果context生成的用户查询query的回答answer。\"\n                    }\n                },\n                \"required\": [\n                    \"query\",\n                    \"context\",\n                    \"answer\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化幻觉检测组件。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。推荐使用DeepSeek-V3.1模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(HallucinationDetectionArgs,\n                         model=model,\n                         secret_key=secret_key,\n                         gateway=gateway,\n                         lazy_certification=lazy_certification)\n\n    def completion(self, version, base_url, request, timeout: float = None,\n                   retry: int = 0):\n        \"\"\"\n        Send a byte array of an audio file to obtain the result of speech recognition.\n        \n        Args:\n            version (str): API version.\n            base_url (str): Base URL of the API.\n            request (Request): Request object containing audio file and other parameters.\n            timeout (float, optional): Timeout for the request. Defaults to None.\n            retry (int, optional): Number of retries for the request. Defaults to 0.\n        \n        Returns:\n            Response: Processed response object.\n        \n        \"\"\"\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n\n        stream = True if request.response_mode == \"streaming\" else False\n        \n        url = self.http_client.service_url(\"/app/hallucination_detection\", self.base_url)\n        response = self.http_client.session.post(url, json=request.params, headers=headers, timeout=timeout,\n                                                 stream=stream)\n        return self.gene_response(response, stream)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (Message): 输入消息，包含 query、context 和 answer。是必需的参数。\n            stream (bool, 可选): 是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            result (Message): 模型运行后的输出消息。\n        \n        Raises:\n            AssertionError: 如果输入的 message 中缺少 query、context 或 answer。\n            AppBuilderServerException: 如果请求执行失败，将抛出异常，包含服务错误码和错误信息。\n        \"\"\"\n        inputs = message.content\n        query = inputs.pop('query', None)\n        assert query, 'You must input query and query should not be empty'\n        assert 'context' in inputs and inputs['context'], 'You must input context and context should not be empty'\n        assert 'answer' in inputs and inputs['answer'], 'You must input answer and answer should not be empty'\n        response_mode = \"streaming\" if stream else \"blocking\"\n        user_id = message.id\n        model_config_inputs = ModelArgsConfig(**{\"stream\": stream, \"temperature\": temperature, \"top_p\": top_p})\n        model_config = self.get_model_config(model_config_inputs)\n\n        request = self.gene_request(query, inputs, response_mode, user_id, model_config)\n        response = self.completion(self.version, self.base_url, request)\n\n        if response.error_no != 0:\n            raise AppBuilderServerException(service_err_code=response.error_no, service_err_message=response.error_msg)\n\n        result = response.to_message()\n\n        return result\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, stream: bool = False, **kwargs):\n        \"\"\"\n        调用函数进行工具评估。\n        \n        Args:\n            name (str): 函数名，当前方法未使用此参数，预留接口。\n            stream (bool, optional): 是否以流的方式返回结果，默认为False。如果为True，则逐个返回结果；如果为False，则一次性返回所有结果。\n            **kwargs: 关键字参数，包含评估所需的输入参数。\n        \n                - query (str): 查询语句。\n                - context (str): 上下文信息。\n                - answer (str): 参考答案。\n                - model_configs (dict, optional): 模型配置信息，默认为空字典。包含以下字段：\n                    - temperature (float, optional): 温度参数，用于控制生成文本的随机性，默认为1e-10。\n                    - top_p (float, optional): 截断概率，用于控制生成文本的质量，默认为0.0。\n        \n        Returns:\n            如果stream为False，返回包含所有评估结果的列表；如果stream为True，逐个返回评估结果。\n        \n        Raises:\n            ValueError: 如果缺少query、context或answer参数，将引发此异常。\n        \"\"\"\n        query = kwargs.get('query', None)\n        context = kwargs.get('context', None)\n        answer = kwargs.get('answer', None)\n        if not query or not context or not answer:\n            raise ValueError('param `query` and `context` and `answer` are required')\n        msg = Message({'query': query, 'context': context, 'answer': answer})\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get('temperature', 1e-10)\n        top_p = model_configs.get('top_p', 0.0)\n        message = self.run(message=msg,\n                           stream=stream,\n                           temperature=temperature,\n                           top_p=top_p)\n        if stream:\n            for data in message.content:\n                yield data\n        else:\n            return message.content"
  },
  {
    "path": "python/core/components/llms/is_complex_query/README.md",
    "content": "# 复杂Query判定（IsComplexQuery）\n\n## 简介\n复杂Query判定组件（IsComplexQuery）可以根据输入的提问进行初步的分类，区分简单问题和复杂问题，以便后续运用不同的处理流程处理。可应用于知识问答场景。\n\n### 功能介绍\n在知识问答领域中存在很多复杂问题需要处理，这些复杂问题通常需要进行问题分解并采用分治的方法处理。复杂Query判定组件尝试定义复杂问题和简单问题的概念，对用户的问题进行初步的分类，方便下游使用不同类型的流程来处理当前的简单问题/复杂问题。\n\n### 特色优势\n复杂Query判定组件通过对问题进行有效分类，系统可以更快速地将简单问题导向快速回答流程，而将复杂问题导向更深入的分析流程。这种判定能力可以提高整个问答系统的效率和准确性。\n\n### 应用场景\n广泛应用于知识问答场景\n\n## 基本用法\n下面是复杂Query判定的代码示例：\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nis_complex_query = appbuilder.IsComplexQuery(model=\"DeepSeek-V3.1\")\n\nmsg = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\nmsg = appbuilder.Message(msg)\nanswer = is_complex_query(msg)\n\nprint(\"Answer: \\n{}\".format(answer.content))\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|model |str  |是 |模型名称，用于指定要使用的千帆模型|DeepSeek-V3.1|\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |obj:`Message`|是 |输入消息，用于模型的主要输入内容。这是一个必需的参数| |\n|stream|bool|否 |指定是否以流式形式返回响应。默认为 False|False|\n|temperature|float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10|1e-10|\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|Message |obj:`Message` |输出消息，包含模型运行后的输出| |\n\n### 响应示例\n```text\n分析：这个问题涉及到吸塑包装盒在工业化生产和物流运输中的重要性。回答这个问题需要从多个角度来考虑，比如生产方面、运输方面、环保方面等。这需要对吸塑包装盒有深入的了解，并且需要考虑到生产、运输等各个环节。因此，这是一个复杂问题。\n类型：复杂问题\n```\n\n### 错误码\n无\n\n## 高级用法\n你可以通过自定义调整参数来获得想要的结果，例如：\n```python\n# 流式返回, 调整模型temperature参数\nanswer = is_complex_query(msg, stream=True, temperature=0.5)\n```\n\n## 更新记录和贡献\n* 复杂Query判定 (2024-01)\n"
  },
  {
    "path": "python/core/components/llms/is_complex_query/__init__.py",
    "content": "\nfrom .component import IsComplexQuery\n"
  },
  {
    "path": "python/core/components/llms/is_complex_query/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import Field\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\n\n\nclass IsComplexQueryMeta(ComponentArguments):\n    \"\"\" \n    IsComplexQueryMeta\n\n    Attributes:\n        message (Message): 输入消息，用于模型的输入，一般为问题。\n    \"\"\"\n    message: Message = Field(..., \n                             variable_name=\"query\", \n                             description=\"输入消息，用于模型的输入，一般为问题。\")"
  },
  {
    "path": "python/core/components/llms/is_complex_query/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\" is complex query\n\"\"\"\nfrom pydantic import Field\nfrom typing import Optional\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import IsComplexQueryMeta\n\n\nclass IsComplexQuery(CompletionBaseComponent):\n    r\"\"\" \n    基于输入的问题, 对问题进行初步的分类，方便下游使用不同类型的流程来处理当前的简单问题/复杂问题。广泛用于知识问答场景。\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        is_complex_query = appbuilder.IsComplexQuery(model=\"DeepSeek-V3.1\")\n\n        msg = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(msg)\n        answer = is_complex_query(msg)\n\n        print(\"Answer: \\n{}\".format(answer.content))\n    \"\"\"\n    name = \"is_complex_query\"\n    version = \"v1\"\n    meta = IsComplexQueryMeta\n\n    manifests = [\n        {\n            \"name\": \"is_complex_query\",\n            \"description\": \"基于输入的问题, 对问题进行初步的分类，方便下游使用不同类型的流程来处理当前的简单问题/复杂问题。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入的问题，用于大模型根据该问题进行初步的分类。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化IsComplexQueryMeta任务。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                IsComplexQueryMeta, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/mrc/README.md",
    "content": "# 阅读理解问答（MRC）\n\n## 简介\n阅读理解问答（MRC）组件是基于生成式大模型的阅读理解问答系统。该组件支持拒答、澄清、重点强调、友好性提升、溯源等多种功能，可用于回答用户提出的问题。\n\n### 功能介绍\nMRC（阅读理解问答模块）是一项先进的自然语言处理功能，旨在使机器能够理解、分析文本内容，并基于这些内容回答相关问题。 本模块基于大语言模型，提供对文本内容的深入理解和精确回答能力。\n\n### 特色优势\n我们的MRC模块，基于百度自研的先进语言模型文新一言，提供了一系列强大的阅读理解问答功能。在保持文本理解和问题回答的高精度的同时，\n我们特别强调了答案的质量和交互体验。以下是我们MRC模块的几个主要功能特色：\n - 1.多版本模型支持：我们的MRC模块包括不同版本的文新一言大模型，Erniebot 4.0、DeepSeek-V3.1等，每个版本都针对特定的应用场景进行了优化。 用户可以根据自己的需求选择最适合的模型版本，以获得最佳的性能。\n - 2.答案格式的多样性：\n   - 拒答功能：当问题超出模型知识范围或不具体时，模型可以选择不回答，避免提供误导性信息。\n   - 澄清功能：对于模棱两可或含糊的问题，模型可以请求更多信息或对问题进行澄清，以确保答案的准确性。\n   - 重点内容强调：模型可以识别并强调答案中的关键信息，使答案更清晰、更易于理解。\n   - 友好度提升：模型可以以更自然、更亲切礼貌的方式呈现答案，且必要时对答案进行分点论述，改善用户体验。\n   - 答案溯源：模型能提供答案的来源信息，增强答案的可信度和透明度。\n\n - 3.灵活的功能开关：每项功能都配备了开关，用户可以根据不同的应用场景和需求，灵活地启用或关闭某些功能。这种可定制性确保了MRC模块能够在各种环境下提供最优化的表现。\n\n### 应用场景\n我们的MRC模块，凭借文心大模型强大的文本理解能力，以及多功能性，已在多个领域展现出显著的价值。\n - 政务服务：在政务领域，MRC模块可以帮助构建智能问答系统，为公民提供关于政策、法规和服务程序的即时信息。它可以通过理解复杂的政府文件和公文，准确回答与政策相关的查询，极大地提高政府服务的效率和透明度。\n - 法律咨询：法律领域充满了专业术语和复杂的概念。我们的MRC模块能够深入理解法律文献和案例，为法律专业人士和普通民众提供准确的法律咨询。无论是寻找相关法条还是理解特定法律案例，MRC模块都能提供快速、可靠的帮助。\n - 医疗健康：在医疗健康领域，准确的信息至关重要。MRC模块能够解析医学文献、病例报告和临床试验数据，为医生和研究人员提供支持，帮助他们在诊断、治疗和研究中做出更明智的决策。此外，它也能在患者咨询中发挥作用，为患者提供关于疾病、治疗方案和药物的详细信息。\n - 教育和研究：MRC模块可以作为学习和研究的强大工具，帮助学生和研究人员快速找到他们需要的信息。无论是解答学术问题，还是提供详细的背景资料，MRC模块都能提供卓越的支持。\n - 企业客户服务：企业可以利用MRC模块构建高效的客服系统，提供24/7的咨询服务。从产品详情到服务流程的解释，MRC模块都能提供准确、及时的答案，提升客户满意度并减轻人工客服的压力。\n - 金融咨询：在金融领域，MRC模块可以帮助用户理解复杂的金融产品、市场趋势和投资策略。通过提供准确的数据解读和市场分析，MRC模块能够辅助投资者和金融专业人士做出更明智的决策。\n除上述场景以外，还可应用于其他更多生产生活的场景中。\n\n## 基本用法\n\n### 快速开启\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 创建MRC对象\nmrc_component = appbuilder.MRC(model=\"DeepSeek-V3.1\")\n\n# 初始化参数\nmsg = \"残疾人怎么办相关证件\"\nmsg = appbuilder.Message(msg)\ncontext_list = appbuilder.Message([\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）\"\"\",\n                    \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\nC5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n北京市无障碍环境建设促进中心\"\"\"])\n\n# 模拟运行MRC基本组件\nresult = mrc_component.run(msg, context_list)\n\n# 输出运行结果\nprint(result)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nimport os\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n|参数名称 |参数类型 | 是否必须 |描述 | 示例值                                      |\n|--------|--------|---|----|------------------------------------------|\n|msg |Message  | 是 |输入消息，包含用户提出的问题。| Message(\"你好\")                            |\n|context_list|Message| 是 |用户输入的问题对应的段落文本列表。| Message([\"\"\"context1\"\"\",\"\"\"context2\"\"\"]) |\n|reject|bool| 否 |拒绝开关，如果为 True，则启用该能力。默认为 False。当输入的问题在context_list中没有找到答案时，开关开启时，模型会用特定话术(\"当前文档库找不到对应的答案，我可以尝试用我的常识来回答你。\")做回复的开头，并后接自有知识做回复内容。| eg.示例值                                   |\n|clarify|bool| 否 |澄清开关，如果为 True，则启用该能力。默认为 False。 当输入的问题比较模糊、或者主体指代不清晰，且context_list中包含有可以回答该模糊问题的多种潜在备选答案时，开启该开关，大模型会以特定的话术做澄清反问，引导用户继续补充问题发问。举例子，query:发电机的续航时间？ Answer: 根据搜索结果得到了xx和xx两种型号的发电机，您的问题具体涉及到哪一个？请补充关键信息，作为完整的问题重新发问。| eg.示例值                                   |\n|highlight|bool| 否 |重点强调开关，如果为 True，则启用该能力。默认为 False。开启该功能时，回复结果中会高亮显示关键部分的内容。| 加粗的部分是**重点内容**                           |\n|friendly|bool| 否 |友好性提升开关，如果为 True，则启用该能力。默认为 False。开关开启时，部分回复的开头会加礼貌用语。且如果回答涉及到大段的信息，会倾向于以<总-分>或者<总-分-总>的形式做分点论述，使得答案的格式更规整，可读性更强。| eg.示例值                                   |\n|cite|bool| 否 |溯源开关，如果为 True，则启用该能力。默认为 False。开关开启时，回复内容后会接形如(^[1]^)的标记来表示回答内容在原文(context_list)中的来源索引。例如：按照当地公安机关出入境管理部门规定的其他材料办理^[2]^。| eg.示例值                                   |\n|temperature|float| 否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。| 0.0001                                   |\n\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|对象，包含模型运行后的输出消息。|\n### 响应示例\n```json\n{\"result\": \"极氪007的售价区间为20.99~29.99万元。\"}\n```\n\n### 错误码\n无\n\n\n\n## 高级用法\n该组件的高级用法包括定制化的输入处理、输出处理，以及更复杂的调用场景。用户可以根据具体需求扩展组件功能，实现个性化的问答系统。\n包括如下功能：\n1、拒答\n2、澄清反问\n3、重点强调\n4、友好度提升\n5、溯源\n\n\n### 代码样例\n```python\nimport appbuilder\nimport os\n\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建MRC对象\nmrc_component = appbuilder.MRC(model=\"DeepSeek-V3.1\")\n\n# 初始化参数\nmsg = \"残疾人怎么办相关证件\"\nmsg = appbuilder.Message(msg)\ncontext_list = appbuilder.Message([\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）\"\"\",\n                    \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\nC5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n北京市无障碍环境建设促进中心\"\"\"])\n\n# 模拟运行MRC组件，开启拒答、澄清追问、重点强调、友好性提升和溯源能力五个功能\nresult = mrc_component.run(msg, context_list, reject=True,\n                           clarify=True, highlight=True, friendly=True, cite=True)\n\n# 输出运行结果\nprint(result)\n```\n\n## 更新记录和贡献\n* 阅读理解问答 (2023-12)\n\n\n"
  },
  {
    "path": "python/core/components/llms/mrc/__init__.py",
    "content": "\nfrom .component import MRC\n"
  },
  {
    "path": "python/core/components/llms/mrc/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom pydantic import Field\n\n\nclass MrcArgs(ComponentArguments):\n    \"\"\"\n    阅读理解问答配置\n\n    Attributes:\n        message: Message\n            用户输入的查询内容，例如'千帆平台都有哪些大模型？'\n        context_list: list\n            用户输入的检索片段列表，例如['content1', 'content2', 'content3',...]，也可以为空，即[]\n        reject: bool\n            控制大模型拒答能力的开关，为true即为开启拒答功能，为false即为关闭拒答功能\n        clarify: bool\n            控制大模型澄清能力的开关，为true即为开启澄清反问功能，为false即为关闭澄清反问功能\n        highlight: bool\n            控制大模型重点强调能力的开关，为true即为开启重点强调功能，为false即为关闭重点强调功能\n        friendly: bool\n            控制大模型友好对提升难过能力的开关，为true即为开启友好度提升功能，为false即为关闭重点强调功能\n        cite: bool\n            控制大模型溯源能力的开关，为true即为开启溯源功能，为false即为关闭溯源功能\n    \"\"\"\n    message: Message = Field(...,\n                         variable_name=\"query\",\n                         description=\"输入用户query，例如'千帆平台都有哪些大模型？'\")\n    context_list: list = Field(...,\n                                   variable_name=\"context_list\",\n                                   description=\"用户输入检索片段list，\"\n                                               \"例如[content1, content2, content3,...]，也可以为空, 即[]\")\n    reject: bool = Field(...,\n                         variable_name=\"reject\",\n                         description=\"控制大模型拒答能力的开关，为true即为开启拒答功能，为false即为关闭拒答功能\")\n    clarify: bool = Field(...,\n                          variable_name=\"clarify\",\n                          description=\"控制大模型澄清能力的开关，为true即为开启澄清反问功能，为false即为关闭澄清反问功能\")\n    highlight: bool = Field(...,\n                            variable_name=\"highlight\",\n                            description=\"控制大模型重点强调能力的开关，为true即为开启重点强调功能，为false即为关闭重点强调功能\")\n    friendly: bool = Field(...,\n                           variable_name=\"friendly\",\n                           description=\"控制大模型友好对提升难过能力的开关，\"\n                                       \"为true即为开启友好度提升功能，为false即为关闭友好度提升功能\")\n    cite: bool = Field(...,\n                       variable_name=\"cite\",\n                       description=\"控制大模型溯源能力的开关，为true即为开启溯源功能，为false即为关闭溯源功能\")"
  },
  {
    "path": "python/core/components/llms/mrc/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent, ModelArgsConfig\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom pydantic import Field\nfrom typing import Optional\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import MrcArgs\n\n\nclass MRC(CompletionBaseComponent):\n    \"\"\"\n    阅读理解问答组件，基于大模型进行阅读理解问答，支持拒答、澄清、重点强调、友好性提升、溯源等多种功能，可用于回答用户提出的问题。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        import os\n\n        # 设置环境变量\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        # 创建MRC对象\n        mrc_component = appbuilder.MRC()\n\n        #初始化参数\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        context_list = appbuilder.Message([\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；2、持有准驾车型为C1（听力残疾）、\n        C2（左下肢残疾、听力残疾\", \"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，\n        并有有效交强险凭证，C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n        北京市无障碍环境建设促进中心\"])\n\n        # 模拟运行MRC组件，开启拒答、澄清追问、重点强调、友好性提升和溯源能力五个功能\n        result = mrc_component.run(msg, context_list, reject=True,\n                                    clarify=True, highlight=True, friendly=True, cite=True)\n\n        # 输出运行结果\n        print(result)\n\n    \"\"\"\n    name = \"mrc\"\n    version = \"v1\"\n    meta: MrcArgs\n\n    manifests = [\n        {\n            \"name\": \"mrc\",\n            \"description\": \"对于输入的问题，基于大模型进行阅读理解问答，支持拒答、澄清、重点强调、友好性提升、溯源等多种功能，可用于回答用户提出的问题\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入用户query，例如'千帆平台都有哪些大模型？'\"\n                    },\n                    \"context_list\": {\n                        \"type\": \"list\",\n                        \"description\": \"用户输入检索片段list，例如[content1, content2, content3,...]，也可以为空, 即[]\"\n                    },\n                    \"reject\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型拒答能力的开关，为true即为开启拒答功能，为false即为关闭拒答功能\"\n                    },\n                    \"clarify\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型澄清能力的开关，为true即为开启澄清反问功能，为false即为关闭澄清反问功能\"\n                    },\n                    \"highlight\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型重点强调能力的开关，为true即为开启重点强调功能，为false即为关闭重点强调功能\"\n                    },\n                    \"friendly\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型友好对提升难过能力的开关，为true即为开启友好度提升功能，为false即为关闭友好度提升功能\"\n                    },\n                    \"cite\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型溯源能力的开关，为true即为开启溯源功能，为false即为关闭溯源功能。\"\n                    }\n                },\n                \"required\": [\n                    \"query\",\n                    \"context_list\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化MRC(阅读理解问答)模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                MrcArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    def __get_instruction_set(self):\n        \"\"\"\n        return: json格式的instruction_set\n        \"\"\"\n        return {\"reject\": \"如果答案不在搜索结果中得到，则在答案开头说明：\"\n                          \"“当前文档库找不到对应的答案，我可以尝试用我的常识来回答你”，\"\n                          \"并基于你的常识给出答案。\",\n                \"clarify\": \"当问题比较模糊，而检索结果包含多种可能的答案时，反向提问用户想问的具体内容，\"\n                           \"让用户补充关键信息后以完整的query重新发问。\",\n                \"highlight\": \"可以对答案中的核心部分进行markdown加粗（**加粗内容**）。\",\n                \"friendly\": \"答案尽量用礼貌用语开头，涉及到条目列举的内容需要在前面加序号并做分点描述，\"\n                            \"必要时可在每一点前面做小标题的汇总，并可以用总-分-总的形式展示分点式答案内容，使得答案内容可读性更强。\",\n                \"cite\": \"使用引用标记来标注回答内容参考的搜索结果序号，例如^[1]^ (引用单个搜索结果）,^[1][2]^（引用多个搜索结果），\"\n                        \"其中方括号中的数字是搜索结果序号。引用标记只能出现在句尾标点符号前。\"}\n\n    @components_run_trace\n    def run(self, message, context_list, reject=False, clarify=False,\n            highlight=False, friendly=False, cite=False, stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        运行阅读理解问答模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，包含用户提出的问题。这是一个必需的参数。\n            context_list (obj:`Message`): 用户输入的问题对应的段落文本列表。这是一个必需的参数。\n            reject (bool, 可选): 拒答开关，如果为 True，则启用拒答能力。默认为 False。\n            clarify (bool, 可选): 澄清开关，如果为 True，则启用澄清能力。默认为 False。\n            highlight (bool, 可选): 重点强调开关，如果为 True，则启用重点强调能力。默认为 False。\n            friendly (bool, 可选): 友好性提升开关，如果为 True，则启用友好性提升能力。默认为 False。\n            cite (bool, 可选): 溯源开关，如果为 True，则启用溯源能力。默认为 False。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        instruction_set = self.__get_instruction_set()\n        context_list = context_list.content\n        inputs = {\n            \"query\": message.content,\n            \"context_out\": \"\\n\\n\".join(f\"[{i + 1}] {s}\" for i, s in enumerate(context_list)),\n            \"reject\": instruction_set[\"reject\"] if reject else None,\n            \"clarify\": instruction_set[\"clarify\"] if clarify else None,\n            \"highlight\": instruction_set[\"highlight\"] if highlight else None,\n            \"friendly\": instruction_set[\"friendly\"] if friendly else None,\n            \"cite\": instruction_set[\"cite\"] if cite else None,\n        }\n        model_config_inputs = ModelArgsConfig(**{\"stream\": stream, \"temperature\": temperature, \"top_p\": top_p})\n        model_config = self.get_model_config(model_config_inputs)\n        query = inputs[\"query\"]\n        response_mode = \"streaming\" if stream else \"blocking\"\n        user_id = message.id\n\n        request = self.gene_request(query, inputs, response_mode, user_id, model_config)\n        response = self.completion(self.version, self.base_url, request)\n\n        if response.error_no != 0:\n            raise AppBuilderServerException(service_err_code=response.error_no, service_err_message=response.error_msg)\n\n        return response.to_message()\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        context_list = kwargs.get(\"context_list\", None)\n        reject = kwargs.get(\"reject\", False)\n        clarify = kwargs.get(\"clarify\", False)\n        highlight = kwargs.get(\"highlight\", False)\n        friendly = kwargs.get(\"friendly\", False)\n        cite = kwargs.get(\"cite\", False)\n        if not query or not context_list:\n            raise ValueError(\"param `query` and `context_list` are required\")\n        msg = Message(query)\n        context_list_msg = Message(context_list)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, context_list=context_list_msg, reject=reject, clarify=clarify,\n            highlight=highlight, friendly=friendly, cite=cite, stream=False, temperature=temperature,\n            top_p=top_p, request_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/nl2pandas/README.md",
    "content": "# 自然语言转pandas (nl2pandas)\n\n## 简介\n自然语言转pandas (nl2pandas)这个组件通过理解对表格信息的提问，生成对应语义的可执行Python代码，主要使用Pandas库。它可以用于基于表格的查询，问答等多种场景。\n\n### 功能介绍\n自然语言转pandas (nl2pandas)根据用户的输入的表格信息和查询query，利用大语言模型的理解和生成能力，自动生成符合查询语义的一行或多行pandas代码。\n\n### 特色优势\n自然语言转pandas (nl2pandas)，基于百度自研的大语言模型文心一言，提供内置的自然语言转pandas代码的能力，无需更多的prompt描述，即可生成对应的查询代码。\n\n### 应用场景\n自然语言转pandas (nl2pandas)可用对结构化表格数据的自然语言查询场景，问答场景等。\n\n## 基本用法\n这里是一个简单示例，展示如何使用自然语言转Pandas组件：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n#定义表格信息 假设有一个小学学校表格，包含学校名、所属地区、创办时间、类别、学生人数、教职工人数、教学班数量等列。列名后给出示例（例如清华附小是学校名的示例），以及列值类型（字符串类型、数字值类型），最后给出列名的解释。列之间使用换行符分隔。\ntable_info = '''表格列信息如下：\\n学校名 : 清华附小 , 字符串类型，代表小学学校的名称\\n所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\\n创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\\n类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\\n学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\\n教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\\n教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量'''\n\n#定义查询问题\nquery = \"海淀区有哪些学校\"\nquery = appbuilder.Message(query)\n\n#定义并运行Nl2pandas实例，得到结果\nnl2pandas = appbuilder.Nl2pandasComponent(model=\"DeepSeek-V3.1\")\nanswer = nl2pandas(query, table_info = table_info)\n```\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|query |Message | 是 | 查询语句，一般是针对表格信息的提问 |例如'海淀区的小学有哪些'。建议长度是50字以内。 |\n|table_info |str | 是 | 表格信息，是表格列名以及对应列名的举例和释义 |例如：’表格列信息如下：\\n学校名 : 清华附小 , 字符串类型，代表小学学校的名称\\n所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\\n创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\\n类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\\n学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\\n教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\\n教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量‘ |\n|stream |bool | 否 |指定是否以流式形式返回响应。默认为 False。 |False |\n|temperature |float | 否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 |0.7 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|Message(content=\"df.loc[df['所属地区'] == \"海淀区\",\"学校名\"]\")|\n\n## 高级用法\n\n多个表格查询或跨表查询场景。\n\n## 更新记录和贡献\n\n- 初始版本发布(2023-10)"
  },
  {
    "path": "python/core/components/llms/nl2pandas/__init__.py",
    "content": "\"\"\"text to pandas\"\"\"\nfrom .component import Nl2pandasComponent"
  },
  {
    "path": "python/core/components/llms/nl2pandas/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.message import Message\nfrom pydantic import Field\nfrom appbuilder.core.component import ComponentArguments\n\n\nclass Nl2pandasArgs(ComponentArguments):\n    \"\"\"\n    自然语言转pandas代码 参数配置\n\n    Attributes:\n        message: Message = Field(...)\n        table_info: str = Field(...)\n    \"\"\"\n    message: Message = Field(..., \n                             variable_name=\"query\", \n                             description=\"输入问题，一般是针对表格信息的提问，例如'海淀区的小学有哪些'\")\n    table_info: str = Field(...,  \n                                variable_name=\"table_info\", \n                                description=\"表格信息，一般是表格列名以及对应列名的举例和释义，例如'表格列信息如下：\\n学校名 : 清华附小 , 字符串类型，代表小学学校的名称\")"
  },
  {
    "path": "python/core/components/llms/nl2pandas/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\nfrom pydantic import BaseModel, Field\nfrom typing import Optional\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import Nl2pandasArgs\n \nclass Nl2pandasComponent(CompletionBaseComponent):\n    \"\"\"\n    自然语言转pandas大模型组件， 基于生成式大模型对query进行理解并生成对应语义的可执行python代码（主要使用pandas），可用于基于表格的查询、问答等多种场景。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        table_info = '''表格列信息如下：\n        学校名 : 清华附小 , 字符串类型，代表小学学校的名称\n        所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\n        创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\n        类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\n        学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\n        教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\n        教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量\n        '''\n        query = \"海淀区有哪些学校\"\n        query = appbuilder.Message(query)\n        \n        nl2pandas = appbuilder.Nl2pandasComponent(model=\"DeepSeek-V3.1\")\n        answer = nl2pandas(query, table_info = table_info)\n    \"\"\"\n    name = \"nl2pandas\"\n    version = \"v1\"\n    meta = Nl2pandasArgs\n\n    manifests = [\n        {\n            \"name\": \"nl2pandas\",\n            \"description\": \"输入用户查询query，基于生成式大模型对query进行理解并生成对应语义的可执行python代码（主要使用pandas），可用于基于表格的查询、问答等多种场景\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"text\": \"string\",\n                        \"description\": \"输入问题，一般是针对表格信息的提问，例如'海淀区的小学有哪些'\"\n                    },\n                    \"table_info\": {\n                        \"text\": \"string\",\n                        \"description\": \"表格信息，一般是表格列名以及对应列名的举例和释义，例如'表格列信息如下：\\n学校名 : 清华附小 , 字符串类型，代表小学学校的名称\"\n                    }\n                },\n                \"required\": [\n                    \"query\",\n                    \"table_info\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化Nl2pandasComponent模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                Nl2pandasArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, table_info=None, stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入问题，通常是针对表格信息的提问，如'海淀区的小学有哪些'。这是一个必需的参数。\n            table_info (obj:`Message`, optional): 表格信息，包括表格列名、对应列名的示例和释义。默认值为 None，但这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, table_info=table_info, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        table_info = kwargs.get(\"table_info\", None)\n        if not query or not table_info:\n            raise ValueError(\"param `query` and 'table_info' are required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, table_info=table_info, stream=False, temperature=temperature,\n                              top_p=top_p, request_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/oral_query_generation/README.md",
    "content": "# 口语化Query生成（Oral Query Generation）\n\n## 简介\n口语化Query生成组件（Oral Query Generation）可以基于输入文本生成与文档内容相关的Query。\n\n### 功能介绍\n基于输入文本生成与文档内容相关的Query。\n\n### 特色优势\n生成的query划分为问题和短语两种类型，可分别用于不同场景。\n\n### 应用场景\n可用于推荐问题生成、标签生成、文档索引增强等。\n\n## 基本用法\n### 快速开始\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n\ntext = ('文档标题：在OPPO Reno5上使用视频超级防抖\\n'\n        '文档摘要：OPPO Reno5上的视频超级防抖，视频超级防抖3.0，多代视频防抖算法积累，这一代依旧超级防抖超级稳。 开启视频超级'\n        '防抖 开启路径：打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能，开启超级'\n        '防抖后手机屏幕将出现超级防抖Pro开关，点击即可开启或关闭。 除此之外，前置视频同样加持防抖算法，边走边拍也能稳定聚焦脸部'\n        '，实时视频分享您的生活。')\n\n#! 该组件推荐使用DeepSeek-V3.1模型。\noral_query_generation = appbuilder.OralQueryGeneration(model='DeepSeek-V3.1')\nresult = oral_query_generation(appbuilder.Message(text), query_type='全部', output_format='str')\n\nprint(result)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `model` | str | 是 | 模型名称，用于指定要使用的千帆模型。推荐使用DeepSeek-V3.1模型。 | DeepSeek-V3.1 |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入消息，用于模型的主要输入内容。 | Message(content='...') |\n| `query_type` | str | 否 | 待生成的query类型，包括问题、短语和全部（问题+短语）。默认为全部。 | 全部 |\n| `output_format` | str | 否 | 输出格式，包括json和str。默认为str。 | str |\n| `stream` | bool | 否 | 指定是否以流式形式返回响应。默认为 False。 | False |\n| `temperature` | float | 否 | 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 0.1 |\n| `top_p` | float | 否 | 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0.0。 | 0.0 |\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果 | Message(content='...') |\n\n### 响应示例\n```\nMessage(name=msg, content=1. OPPO Reno5上有什么特殊的功能？\n2. 视频超级防抖是什么？\n3. 视频超级防抖有什么作用？\n4. 如何在OPPO Reno5上开启视频超级防抖？\n5. 视频超级防抖Pro是什么？\n6. 开启视频超级防抖后，屏幕上会出现什么？\n7. 前置视频有防抖算法吗？\n8. OPPO Reno5上的视频超级防抖\n9. 视频超级防抖3.0\n10. 多代视频防抖算法积累的作用\n11. 开启视频超级防抖的方法\n12. 视频超级防抖Pro的功能\n13. 开启视频超级防抖后，屏幕上会出现的东西\n14. 前置视频防抖算法的作用, mtype=dict, extra={})\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.5.22\n#### [Updated]\n- 升级能力，主要升级内容如下：\n  - 生成的query要求能够使用输入文本进行回答。\n  - 生成的query划分为问题和短语类型。\n  - 生成的query数量不再限制为10个。\n- 在调用组件时，支持输出问题、短语或全部（问题 + 短语）；支持输出格式为json或者str（兼容之前版本的输出格式）。\n\n### 2024.1.24\n#### [Updated]\n- 更新README。\n\n### 2023.12.07\n#### [Added]\n- 增加口语化Query生成组件。\n- 增加口语化Query生成组件单元测试。"
  },
  {
    "path": "python/core/components/llms/oral_query_generation/__init__.py",
    "content": "from .component import OralQueryGeneration"
  },
  {
    "path": "python/core/components/llms/oral_query_generation/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import Field\nfrom enum import Enum\nfrom appbuilder.core.component import ComponentArguments\n\n\nclass QueryTypeChoices(Enum):\n    questions = '问题'\n    phrases = '短语'\n    questions_and_phrases = '全部'\n\n    def to_chinese(self):\n        \"\"\"\n        将QueryTypeChoices枚举类中的值转换为中文描述。\n        \n        Args:\n            无参数\n        \n        Returns:\n            返回一个字典，键是QueryTypeChoices枚举类的成员，值为对应的中文描述字符串。\n        \n        \"\"\"\n        descriptions = {\n            QueryTypeChoices.questions: '问题',\n            QueryTypeChoices.phrases: '短语',\n            QueryTypeChoices.questions_and_phrases: '全部'\n        }\n        return descriptions[self]\n\n\nclass OutputFormatChoices(Enum):\n    json_format = 'json'\n    str_format = 'str'\n\n    def to_chinese(self):\n        \"\"\"\n        将OutputFormatChoices枚举类中的值转换为中文描述。\n        \n        Args:\n            无参数\n        \n        Returns:\n            返回一个字典，键是OutputFormatChoices枚举类的成员，值为对应的中文描述字符串。\n        \n        \"\"\"\n        descriptions = {\n            OutputFormatChoices.json_format: 'json',\n            OutputFormatChoices.str_format: 'str'\n        }\n        return descriptions[self]\n\n\nclass OralQueryGenerationArgs(ComponentArguments):\n    \"\"\"口语化Query生成配置\n    \"\"\"\n    text: str = Field(...,\n                      valiable_name='text',\n                      description='输入文本，用于生成Query')\n    query_type: QueryTypeChoices = Field(...,\n                                         variable_name='query_type',\n                                         description='待生成的query类型，可选值为问题、短语和全部（问题+短语）。')\n    output_format: QueryTypeChoices = Field(...,\n                                            variable_name='output_format',\n                                            description='输出格式，可选值为json、str。')"
  },
  {
    "path": "python/core/components/llms/oral_query_generation/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport json\nimport re\n\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent, ModelArgsConfig\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import OralQueryGenerationArgs\n\n\nclass OralQueryGeneration(CompletionBaseComponent):\n    r\"\"\"\n    口语化Query生成，可用于问答场景下对文档增强索引。\n    *注：该组件推荐使用DeepSeek-V3.1模型。*\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        text = ('文档标题：在OPPO Reno5上使用视频超级防抖\\n'\n                '文档摘要：OPPO Reno5上的视频超级防抖，视频超级防抖3.0，多代视频防抖算法积累，这一代依旧超级防抖超级稳。 开启视频超级'\n                '防抖 开启路径：打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能，开启超级'\n                '防抖后手机屏幕将出现超级防抖Pro开关，点击即可开启或关闭。 除此之外，前置视频同样加持防抖算法，边走边拍也能稳定聚焦脸部'\n                '，实时视频分享您的生活。')\n        oral_query_generation = appbuilder.OralQueryGeneration(model='DeepSeek-V3.1')\n        answer = oral_query_generation(appbuilder.Message(text), query_type='全部', output_format='str')\n        print(answer.content)\n    \"\"\"\n    name = 'query_generation'\n    version = 'v1'\n    meta = OralQueryGenerationArgs\n\n    manifests = [\n        {\n            \"name\": \"query_generation\",\n            \"description\": \"输入文本、待生成的query类型和输出格式，生成query，并按照要求的格式进行输出。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"text\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入文本，组件会根据该输入文本生成query。\"\n                    },\n                    \"query_type\": {\n                        \"type\": \"string\",\n                        \"description\": \"待生成的query类型，可选问题、短语以及全部（问题 + 短语）。\"\n                    },\n                    \"output_format\": {\n                        \"type\": \"string\",\n                        \"description\": \"输出格式，可选json或str，str格式与老版本输出格式相同。\"\n                    }\n                },\n                \"required\": [\n                    \"text\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化口语化Query生成模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。推荐使用DeepSeek-V3.1模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                OralQueryGenerationArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n    \n    def regenerate_output(self, model_output, output_format):\n        \"\"\"\n        兼容老版本的输出格式\n        \"\"\"\n        if not isinstance(model_output, str):\n            return model_output\n        \n        match_obj = re.search(r'```json\\n(.+)\\n```', model_output, flags=re.DOTALL)\n\n        regenerated_output = None\n        if match_obj:\n            regenerated_output = json.loads(match_obj.group(1))\n        else:\n            dict_json_match_obj = re.search(r'\\{(.|\\n)+\\}', model_output)\n            dict_json_text = dict_json_match_obj.group(0) if dict_json_match_obj else None\n            regenerated_output = json.loads(dict_json_text) if dict_json_text is not None else model_output\n\n        if output_format == 'json' or not isinstance(regenerated_output, dict):\n            return json.dumps(regenerated_output, ensure_ascii=False, indent=4)\n\n        queries = []\n        for key in ['问题', '短语']:\n            queries += regenerated_output.pop(key, [])\n        for value in regenerated_output.values():\n            queries += value\n        \n        regenerated_output = '\\n'.join([f'{index}. {query}' for index, query in enumerate(queries, 1)])\n        return regenerated_output\n\n    def completion(self, version, base_url, request, timeout: float = None,\n                   retry: int = 0):\n        r\"\"\"Send a byte array of an audio file to obtain the result of speech recognition.\"\"\"\n\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n\n        stream = True if request.response_mode == \"streaming\" else False\n        \n        url = self.http_client.service_url(\"/app/query_generation\", self.base_url)\n        response = self.http_client.session.post(url, json=request.params, headers=headers, timeout=timeout,\n                                                 stream=stream)\n        return self.gene_response(response, stream)\n\n    @components_run_trace\n    def run(self, message, query_type='全部', output_format='str', stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (Message): 输入消息，包含query、context和answer等信息。这是一个必需的参数。\n            query_type (str, 可选): 待生成的query类型，包括问题、短语和全部（问题+短语）。默认为全部。\n            output_format (str, 可选): 输出格式，包括json和str，当stream为True时，只能以json形式输出。默认为str。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            result (Message): 模型运行后的输出消息。\n        \n        \"\"\"\n        text = message.content\n        assert text, 'Input text should be a valid string'\n        inputs = {\n            'text': text,\n            'query_type': query_type\n        }\n        response_mode = \"streaming\" if stream else \"blocking\"\n        user_id = message.id\n        model_config_inputs = ModelArgsConfig(**{\"stream\": stream, \"temperature\": temperature, \"top_p\": top_p})\n        model_config = self.get_model_config(model_config_inputs)\n\n        request = self.gene_request('', inputs, response_mode, user_id, model_config)\n        response = self.completion(self.version, self.base_url, request)\n\n        if response.error_no != 0:\n            raise AppBuilderServerException(service_err_code=response.error_no, service_err_message=response.error_msg)\n\n        result = response.to_message()\n        result.content = self.regenerate_output(result.content, output_format)\n\n        return result\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        调用函数进行工具评估。\n        \n        Args:\n            name (str): 评估工具的名称。\n            stream (bool, optional): 是否以流的形式返回结果。默认为False。\n            **kwargs: 关键字参数，可以包含以下参数：\n                text (str): 需要评估的文本。\n                query_type (str, optional): 查询类型，默认为'全部'。\n                output_format (str, optional): 输出格式，默认为'str'。\n                model_configs (dict, optional): 模型配置，默认为空字典。\n        \n        Returns:\n            如果stream为False，则返回评估结果列表；\n            如果stream为True，则逐个返回评估结果。\n        \n        Raises:\n            ValueError: 如果未提供text参数，则抛出ValueError异常。\n        \n        \"\"\"\n        text = kwargs.get('text', None)\n        query_type = kwargs.get('query_type', '全部')\n        output_format = kwargs.get('output_format', 'str')\n        if not text:\n            raise ValueError('param `text` is required')\n        msg = Message(text)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get('temperature', 1e-10)\n        top_p = model_configs.get('top_p', 0.0)\n        message = self.run(message=msg,\n                           query_type=query_type,\n                           output_format=output_format,\n                           stream=streaming,\n                           temperature=temperature,\n                           top_p=top_p)\n        if streaming:\n            for data in message.content:\n                yield data\n        else:\n            return message.content\n"
  },
  {
    "path": "python/core/components/llms/playground/README.md",
    "content": "# 空应用（Playground）\n\n## 简介\nPlayground空应用（Playground）是一款灵活的组件，允许用户自定义prompt模板并执行。\n\n\n### 功能介绍\nPlayground空应用（Playground）是一款灵活的组件，允许用户自定义prompt模板并执行。它适用于各种场景，特别是在需要自定义输入模板和使用预训练模型进行交互的情况下。\n\n### 特色优势\n灵活可自定义，用户可自由定义提示词，来跟大模型进行交互。\n\n### 应用场景\n在需要灵活定义提示词的场景，并且其他提供的开箱即用的组件无法满足的情况下使用。\n\n## 基本用法\n\n要开始使用 Playground，你需要设置prompt模板和模型名称。以下是一个基本示例：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nplay = appbuilder.Playground(\n    prompt_template=\"你好，{name}，我是{bot_name}，{bot_name}是一个{bot_type}，我可以{bot_function}，你可以问我{bot_question}。\",\n    model=\"DeepSeek-V3.1\"\n)\nplay(appbuilder.Message({\"name\": \"小明\", \"bot_name\": \"小红\", \"bot_type\": \"聊天机器人\", \"bot_function\": \"聊天\", \"bot_question\": \"你好吗？\"}), stream=False)\n```\n\n## 参数说明\n### 初始化参数\n\n| 参数名称           | 类型         | 说明                               |\n|----------------|------------|----------------------------------|\n| prompt_template | str        | 输入模板，用于指定prompt格式。                 |\n| model           | str \\| None | 模型名称，用于指定要使用的千帆模型。 |\n\n### 调用参数\n\n| 参数名称      | 类型            | 说明                         | 默认值  |\n|-----------|---------------|----------------------------|------|\n| message   | obj:`Message` | 输入消息，必需参数。              | 无    |\n| stream    | bool          | 是否以流式形式返回响应。           | False |\n| temperature | float        | 模型配置的温度参数。              | 1e-10 |\n| max_output_tokens | int        |  指定生成的文本的最大长度，默认最大输出token数为1024, 最小为2， 最大输出token与选择的模型有关           | 1024  |\n|disable_search| bool         | 是否关闭搜索功能，默认关闭          | True  |\n|response_format| str         | 指定返回的响应格式，可选值有：`text`, `json_object`| text  |\n|stop| str                   | 生成停止标识，当模型生成结果以stop中某个元素结尾时，停止文本生成。每个元素长度不超过20字符,最多4个元素.         | []  |\n\n\n### 响应参数\n\n| 类型             | 说明                 |\n|----------------|--------------------|\n| obj:`Message` | 模型运行后的输出消息。 |\n\n### 响应示例\n```json\n{\"result\": \"北京科技馆。\"}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n\n## 高级用法\n此部分可根据实际应用场景提供更复杂的示例和用法说明。\n\n## 示例和案例研究\n目前暂无具体案例，将在未来更新。\n\n## API文档\n无\n\n## 更新记录和贡献\n- 2024年01月24日 更新Readme格式，调整请求参数样式，新增特色优势\n- 2024年08月01日 更新playground组件的入参，并且前向兼容，支持未来的大模型对话参数\n"
  },
  {
    "path": "python/core/components/llms/playground/__init__.py",
    "content": "\"\"\"text to pandas\"\"\"\nfrom .component import Playground"
  },
  {
    "path": "python/core/components/llms/playground/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import Field\n\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.message import Message\n\n\nclass PlaygroundArgs(ComponentArguments):\n    \"\"\"\n    空模板参数配置\n\n    Attributes:\n        message (Message): 输入消息，用于模型的主要输入内容\n    \"\"\"\n    message: Message = Field(...,\n                             json_schema_extra={\n                                 \"variable_name\": \"query\",\n                                 \"description\": \"输入消息，用于模型的主要输入内容\"}\n                            )"
  },
  {
    "path": "python/core/components/llms/playground/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom typing import Optional\nimport re\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace\nfrom .base import PlaygroundArgs\n\nclass Playground(CompletionBaseComponent):\n    \"\"\"\n    空模板， 支持用户自定义prompt模板，并进行执行\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        play = appbuilder.Playground(prompt_template=\"你好，{name}，我是{bot_name}，{bot_name}是一个{bot_type}，我可以{bot_function}，你可以问我{bot_question}。\", model=\"DeepSeek-V3.1\")\n        play(appbuilder.Message({\"name\": \"小明\", \"bot_name\": \"小红\", \"bot_type\": \"聊天机器人\", \"bot_function\": \"聊天\", \"bot_question\": \"你好吗？\"}), stream=False)\n\n    \"\"\"\n\n    name = \"playground\"\n    version = \"v1\"\n    meta = PlaygroundArgs\n    prompt_template = \"\"\n    variable_names = {}\n\n    def __init__(\n        self,\n        prompt_template=None,\n        model=None,\n        secret_key: Optional[str] = None,\n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化空模板配置模型。\n\n        Args:\n            prompt_template (str): 输入模板，用于指定prompt格式\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n\n        Returns:\n            None\n\n        \"\"\"\n        super().__init__(\n            PlaygroundArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n        if prompt_template is None:\n            prompt_template = \"{query}\"\n        self.prompt_template = prompt_template\n\n        self.variable_names = self.__parse__(prompt_template)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0, max_output_tokens=1024, disable_search=True, response_format='text', stop=[], **kwargs):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n            max_output_tokens (int, 可选): 指定生成的文本的最大长度，默认最大输出token数为1024, 最小为2，\n                最大输出token与选择的模型有关。\n            disable_search (bool, 可选): 是否强制关闭实时搜索功能，默认为 True，表示关闭。\n            response_format (str, 可选): 指定返回的消息格式，默认为 'text'，以文本模式返回。\n                可选 'json_object'，以 json 格式返回，但可能存在不满足效果的情况。\n            stop (list[str], 可选): 生成停止标识，当模型生成结果以 stop 中某个元素结尾时，停止文本生成。\n                每个元素长度不超过 20 字符，最多 4 个元素。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        inputs = {}\n\n        if isinstance(message.content, str):\n            if len(self.variable_names) == 1:\n                inputs[self.variable_names[0]] = message.content\n\n        if isinstance(message.content, dict):\n            inputs.update(message.content)\n\n        for key in self.variable_names:\n            if key not in inputs:\n                raise ValueError(\n                    f\"Missing input variable {key} in message {message.content}\")\n\n        prompt = self.prompt_template.format(**inputs)\n        query_message = Message(prompt)\n        return super().run(message=query_message, stream=stream, temperature=temperature, top_p=top_p,\n                           max_output_tokens=max_output_tokens, disable_search=disable_search, response_format=response_format, stop=stop, **kwargs)\n\n    def __parse__(self, prompt_template):\n        last_end = 0\n        results = []\n        for match in re.finditer(r\"{([a-zA-Z_]\\w*)}\", prompt_template):\n            field_name = match.group(1)\n            start, end = match.span()\n\n            literal_text = prompt_template[last_end:start]\n            last_end = end\n\n            results.append((literal_text, field_name, '', None))\n\n        remaining_literal_text = prompt_template[last_end:]\n        if remaining_literal_text:\n            results.append((remaining_literal_text, None, None, None))\n\n        input_variables = [v for _, v, _, _ in results if v is not None]\n\n        return input_variables\n"
  },
  {
    "path": "python/core/components/llms/qa_pair_mining/README.md",
    "content": "# 问答对挖掘（QAPairMining）\n\n## 简介\n问答对挖掘（QAPairMining）可以基于输入文本内容，快速生成多个问题及对应答案，极大提高信息提炼的效率和准确性。广泛用于在线客服、智能问答等领域。\n\n### 功能介绍\n基于输入文本内容，快速生成多个问题及对应答案；可与文档解析、分段联用，快速生成文档的问答对。\n\n### 特色优势\n问答对挖掘组件快速基于输入文本生成的问题和答案，准确率高；可快速依据文档生成FAQ，减少人工成本。\n\n### 适用场景\n适用于在线客服、智能问答等场景\n\n## 基本用法\n\n### 快速开始\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nqa_mining = appbuilder.QAPairMining(model=\"DeepSeek-V3.1\")\n# 输入文本（对此文本挖掘问答对）\nmsg = '2017年，工商银行根据外部宏观环境变化，及时调整业务策略，优化资产负债结构，' + \\\n    '保持存贷款业务协调发展，提升资产负债配置效率。' + \\\n    '2018年3月末，工商银行总资产264,937.81亿元，比上年末增加4,067.38亿元.'\nmsg = appbuilder.Message(msg)\nanswer = qa_mining(msg)\n\nprint(\">>> Output: {}\".format(answer.content))\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n| message | String |是 |输入消息，用于模型的主要输入内容。这是一个必需的参数。| `Message(\"2017年，工商银行根据...\")` |\n| stream |bool|否 |指定是否以流式形式返回响应。默认为 False。| False |\n| temperature |float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 1e-10 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n| result | String | 输出消息，包含模型运行后的输出内容。| 见响应示例 |\n\n### 响应示例\n```text\n问题：2017年，工商银行是如何应对外部宏观环境变化的？\n答案：工商银行根据外部宏观环境变化，及时调整业务策略，优化资产负债结构，保持存贷款业务协调发展，提升资产负债配置效率。\n\n问题：2018年3月末，工商银行总资产是多少？\n答案：264,937.81亿元。\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n\n基于一篇文档，快速生成多个问题及对应答案，极大提高信息提炼的效率和准确性。\n主要流程如下：\n\n1. 读取本地文档，文档解析分段，获取段落；\n2. 段落作为问答对挖掘的输入，挖掘问答对。 \n\n### 代码样例\n```python\nimport os\nimport requests\n\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder import Message, DocParser, DocSplitter, QAPairMining\n\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 进行文档内容解析\nfile_url = \"https://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d\"\nfile_data = requests.get(file_url).content\nfile_path = \"./test.pdf\"  # 待解析的文件路径\nwith open(file_path, \"wb\") as f:\n    f.write(file_data)\n\n# 解析文档\nmsg = Message(file_path)\nparser = DocParser()\nparse_result = parser.run(msg, return_raw=True)\n\n# 对文档进行分段落，split_by_chunk需要return_raw=True\nsplitter = DocSplitter(\n    splitter_type=\"split_by_chunk\", overlap=0)\nsplit_result = splitter(parse_result)\n\n# 每个段落抽取问答对，并返回结果\nfor doc_segment in split_result.content[\"paragraphs\"]:\n    qa_mining = QAPairMining(model=\"DeepSeek-V3.1\")\n    text = doc_segment.get(\"text\", \"\")\n    if text == \"\":\n        logger.error(\"Text is null. break\")\n        break\n    logger.info(\"Input: \\n{}\".format(text))\n    answer = qa_mining(Message(text))\n    logger.info(\"Output: \\n{}\".format(answer.content))\n    break # 样例代码只跑1个段落\n```\n\n## 更新记录和贡献\n* 问答对挖掘能力 (2023-12)\n"
  },
  {
    "path": "python/core/components/llms/qa_pair_mining/__init__.py",
    "content": "\nfrom .component import QAPairMining\n"
  },
  {
    "path": "python/core/components/llms/qa_pair_mining/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import Field\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\n\n\nclass QAPairMiningMeta(ComponentArguments):\n    \"\"\"\n    QAPairMiningMeta\n\n    Attributes:\n        message (Message): 输入消息，用于模型的输入，一般为文档段落。\n    \"\"\"\n    message: Message = Field(..., \n                             variable_name=\"query\", \n                             description=\"输入消息，用于模型的输入，一般为文档段落。\")"
  },
  {
    "path": "python/core/components/llms/qa_pair_mining/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import Field\nfrom typing import Optional\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import QAPairMiningMeta\n\n\nclass QAPairMining(CompletionBaseComponent):\n    \"\"\" \n    基于输入文本内容，快速生成多个问题及对应答案,极大提高信息提炼的效率和准确性.广泛用于在线客服、智能问答等领域。\n\n    Examples:\n\n    .. code-block:: python\n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        qa_mining = appbuilder.QAPairMining(model=\"DeepSeek-V3.1\")\n        # 输入文本（对此文本挖掘问答对）\n        msg =  '2017年，工商银行根据外部宏观环境变化，及时调整业务策略，优化资产负债结构，' + \\\n            '保持存贷款业务协调发展，提升资产负债配置效率。' + \\\n            '2018年3月末，工商银行总资产264,937.81亿元，比上年末增加4,067.38亿元。'\n        msg = appbuilder.Message(msg)\n        answer = qa_mining(msg)\n\n        print(\">>> Output: {}\".format(answer.content))\n    \n    \"\"\"\n    name = \"qa_pair_mining\"\n    version = \"v1\"\n    meta = QAPairMiningMeta\n\n    manifests = [\n        {\n            \"name\": \"qa_pair_mining\",\n            \"description\": \"基于输入文本内容，快速生成多个问题及对应答案，极大提高信息提炼的效率和准确性。广泛用于在线客服、智能问答等领域。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入消息，用于模型的输入，一般为文档段落。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化QAPairMining(问答对挖掘)模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                QAPairMiningMeta, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/query_decomposition/README.md",
    "content": "# 复杂Query分解（QueryDecomposition）\n\n## 简介\n复杂Query分解（QueryDecomposition）可以将已经确定为复杂问题的原始问题拆解为一个个简单问题。广泛应用在知识问答场景。\n\n### 功能介绍\n在知识问答领域中存在很多复杂问题需要处理，这些复杂问题通常需要进行问题分解并采用分治的方法处理。复杂Query分解组件尝试对已经判定为复杂问题的原始问题进行拆解，把复杂问题拆解为一个个简单问题。\n\n### 特色优势\n复杂Query分解组件可以将复杂问题分解为不同层级的简单问题。这有助于更系统地分析和解决问题，提高答案的全面性。\n\n### 应用场景\n广泛应用于知识问答场景\n\n## 基本用法\n下面是复杂Query分解的代码示例：\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nquery_decomposition = appbuilder.QueryDecomposition(model=\"DeepSeek-V3.1\")\n\nmsg = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\nmsg = appbuilder.Message(msg)\nanswer = query_decomposition(msg)\n\nprint(\"Answer: \\n{}\".format(answer.content))\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|model |str  |是 |模型名称，用于指定要使用的千帆模型|DeepSeek-V3.1|\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |obj:`Message`|是 |输入消息，用于模型的主要输入内容。这是一个必需的参数| |\n|stream|bool|否 |指定是否以流式形式返回响应。默认为 False|False|\n|temperature|float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10|1e-10|\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|Message |obj:`Message` |输出消息，包含模型运行后的输出| |\n\n### 响应示例\n```text\n1. 吸塑包装盒在工业化生产中有什么重要性？\n2. 吸塑包装盒在物流运输中有什么重要性？\n```\n### 错误码\n无\n\n## 高级用法\n你可以通过自定义调整参数来获得想要的结果，例如：\n```python\n# 流式返回, 调整模型temperature参数\nanswer = query_decomposition(msg, stream=True, temperature=0.5)\n```\n\n## 更新记录和贡献\n* 复杂Query分解 (2024-01)\n"
  },
  {
    "path": "python/core/components/llms/query_decomposition/__init__.py",
    "content": "\nfrom .component import QueryDecomposition\n"
  },
  {
    "path": "python/core/components/llms/query_decomposition/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import Field\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\n\n\nclass QueryDecompositionMeta(ComponentArguments):\n    \"\"\" \n    QueryDecomposition\n\n    Attributes:\n        message (Message): 输入消息，用于模型的主要输入内容。\n    \"\"\"\n    message: Message = Field(..., \n                             variable_name=\"query\", \n                             description=\"输入消息，用于模型的输入，一般为问题。\")"
  },
  {
    "path": "python/core/components/llms/query_decomposition/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\" query decomposition\n\"\"\"\nfrom pydantic import Field\nfrom typing import Optional\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import QueryDecompositionMeta\n\n\nclass QueryDecomposition(CompletionBaseComponent):\n    r\"\"\" 尝试对已经判定为复杂问题的原始问题进行拆解，把复杂问题拆解为一个个简单问题。广泛用于知识问答场景。\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        query_decomposition = appbuilder.QueryDecomposition(model=\"DeepSeek-V3.1\")\n\n        msg = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(msg)\n        answer = query_decomposition(msg)\n\n        print(\"Answer: \\n{}\".format(answer.content))\n    \"\"\"\n    name = \"query_decomposition\"\n    version = \"v1\"\n    meta = QueryDecompositionMeta\n\n    manifests = [\n        {\n            \"name\": \"query_decomposition\",\n            \"description\": \"尝试对已经判定为复杂问题的原始问题进行拆解，把复杂问题拆解为一个个简单问题。广泛用于知识问答场景。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入消息，用于模型的输入，一般为问题。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化QueryDecompositionMeta任务。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                QueryDecompositionMeta, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/query_rewrite/README.md",
    "content": "# 多轮改写 (QueryRewrite)\n\n## 简介\n多轮改写组件 (QueryRewrite) 是一个用于处理多轮对话和查询改写的组件。它主要用于理解和优化用户与机器人的交互过程，进行指代消解及省略补全。该组件支持不同的改写类型，可根据对话历史生成更准确的用户查询。\n\n### 功能介绍\n多轮改写组件 (QueryRewrite) 据用户和机器人的聊天记录，改写用户当前query，利用大语言模型的理解及生成能力，进行指代消解及省略补全。\n\n### 特色优势\n多轮改写组件 (QueryRewrite) ，基于百度自研的大语言模型文心一言，无需更多的prompt描述，即可根据对话历史生成更准确的用户查询。\n\n### 应用场景\n多轮改写组件 (QueryRewrite) 可用于智能问答、对话式搜索等场景。\n\n## 基本用法\n\n以下是一个简单的例子，展示如何快速开始使用 QueryRewrite 组件：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 初始化并使用 QueryRewrite 组件\nquery_rewrite = appbuilder.QueryRewrite(model=\"DeepSeek-V3.1\")\nanswer = query_rewrite(appbuilder.Message(['我应该怎么办理护照？', '您可以查询官网或人工咨询', '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']), rewrite_type=\"带机器人回复\")\nprint(answer)\n```\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |Message  |是 |需要改写的文本，用于模型的主要输入内容，这是一个必需的参数。 |Message(content=['我应该怎么办理护照？', '您可以查询官网或人工咨询','我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']) |\n|rewrite_type |str |否 |改写类型选项，可选值为 '带机器人回复'(改写时参考user查询历史和assistant回复历史)，'仅用户查询'(改写时参考user查询历史)。 默认是\"带机器人回复\" |\"带机器人回复\" |\n|stream |bool | 否 |指定是否以流式形式返回响应。默认为 False。 |False |\n|temperature |float | 否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 |1e-10 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|Message(content=\"身份证在哪办\")|\n\n### 响应示例\n```\nMessage(name=msg, content=\"身份证在哪办\", mtype=dict, extra={})\n```\n\n## 示例和案例研究\n实际应用中，QueryRewrite 可用于多种场景，如信息检索、智能对话等。\n\n## 更新记录和贡献\n当前版本：v2 (2023-12)\n"
  },
  {
    "path": "python/core/components/llms/query_rewrite/__init__.py",
    "content": "\"\"\"query_rewrite\"\"\"\nfrom .component import QueryRewrite\n"
  },
  {
    "path": "python/core/components/llms/query_rewrite/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom pydantic import Field\nfrom enum import Enum\n\nclass RewriteTypeChoices(Enum):\n    \"\"\"\n    多轮改写类型选择\n    \"\"\"\n    user_assistant_user = \"带机器人回复\"\n    user_user = \"仅用户查询\"\n\n    def to_chinese(self):\n        \"\"\"\n        将RewriteTypeChoices枚举类中的值转换为中文描述。\n        \n        Args:\n            无参数\n        \n        Returns:\n            返回一个字典，键是RewriteTypeChoices枚举类的成员，值为对应的中文描述字符串。\n        \n        \"\"\"\n        descriptions = {\n            RewriteTypeChoices.user_assistant_user: \"带机器人回复\",\n            RewriteTypeChoices.user_user: \"仅用户查询\",\n        }\n        return descriptions[self]\n\n\nclass QueryRewriteArgs(ComponentArguments):\n    \"\"\"\n    多轮改写配置\n    \n    Attributes:\n        message: Message = Field(...)\n        rewrite_type: RewriteTypeChoices = Field(...)\n    \"\"\"\n    message: Message = Field(..., \n                             variable_name=\"query\",\n                             description=\"输入消息，用于模型的主要输入内容，例如'['我应该怎么办理护照？', '您可以查询官网或人工咨询', \\\n                                         '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']'\")\n    rewrite_type: RewriteTypeChoices = Field(...,  \n                                             variable_name=\"rewrite_type\",\n                                             description=\"改写类型选项，可选值为 '带机器人回复'(改写时参考user查询历史和assistant回复历史)，\\\n                                                         '仅用户查询'(改写时参考user查询历史)。 默认是'带机器人回复'. \")"
  },
  {
    "path": "python/core/components/llms/query_rewrite/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"\n多轮改写\n\"\"\"\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom pydantic import BaseModel, Field\nfrom typing import Optional\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import QueryRewriteArgs\n\n\nclass QueryRewrite(CompletionBaseComponent):\n    \"\"\"\n    多轮改写大模型组件， 基于生成式大模型进行多轮对话query改写的组件。它主要用于理解和优化用户与机器人的交互过程，进行指代消解及省略补全。该组件支持不同的改写类型，可根据对话历史生成更准确的用户查询。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        query_rewrite = appbuilder.QueryRewrite(model=\"DeepSeek-V3.1\")\n        answer = query_rewrite(appbuilder.Message(['我应该怎么办理护照？', \n                                                    '您可以查询官网或人工咨询', \n                                                    '我需要准备哪些材料？', \n                                                    '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', \n                                                    '在哪里办']), \n                                                    rewrite_type=\"带机器人回复\")\n                        \n    \"\"\"\n\n    name = \"query_rewrite\"\n    version = \"v1\"\n    meta = QueryRewriteArgs\n\n    manifests = [\n        {\n            \"name\": \"query_rewrite\",\n            \"description\": \"多轮改写大模型组件， 基于生成式大模型进行多轮对话query改写的组件。它主要用于理解和优化用户与机器人\"\n                           \"的交互过程，进行指代消解及省略补全。该组件支持不同的改写类型，可根据对话历史生成更准确的用户查询。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入消息，用于模型的主要输入内容\"\n                    },\n                    \"rewrite_type\": {\n                        \"type\": \"string\",\n                        \"enum\": [\n                            \"带机器人回复\",\n                            \"仅用户查询\"\n                        ]\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"QueryRewrite模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                QueryRewriteArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, rewrite_type=\"带机器人回复\", stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            rewrite_type (str, 可选): 改写类型选项，可选值为 '带机器人回复'(改写时参考user查询历史和assistant回复历史)，\n                                      '仅用户查询'(改写时参考user查询历史)。默认为\"带机器人回复\"。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                                       取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                                       默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                                 取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                                 默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \n        Raises:\n            ValueError: 如果输入消息为空或不符合要求，将抛出 ValueError 异常。\n        \n        \"\"\"\n        if message is None:\n            raise ValueError(\"input message is required\")\n\n        sum_len = sum(len(item) for item in message.content)\n        if len(message.content) > 10 or len(message.content) % 2 == 0:\n            raise ValueError(f\"illegal input，expected len(message.content) in {1,3,5,9}, got {len(message.content)}\")\n        if sum_len > 4000:\n            raise ValueError(f\"illegal input, expected length <= 4000, got {sum_len}\")\n        if rewrite_type == \"带机器人回复\":\n            converted_input = ''.join([f\"{'User:' if i % 2 == 0 else 'Assistant:'}\\\n                                       {message.content[i]}\\n\" for i in range(len(message.content))])\n        else:\n            converted_input = ''.join([f\"User1: {message.content[i]}\\n\" for i in range(0, len(message.content), 2)])\n        message.content = converted_input\n\n        return super().run(message=message, rewrite_type=rewrite_type, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        rewrite_type = kwargs.get(\"rewrite_type\", \"带机器人回复\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, rewrite_type=rewrite_type, stream=False, temperature=temperature,\n                              top_p=top_p, trace_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n\n"
  },
  {
    "path": "python/core/components/llms/similar_question/README.md",
    "content": "# 相似问生成（SimilarQuestion）\n\n## 简介\n相似问生成组件（SimilarQuestion）可以用于基于输入的问题，挖掘出与该问题相关的类似问题。广泛用于客服、问答等场景。\n\n### 功能介绍\n基于输入的问题，挖掘出与该问题相关的类似问题。\n\n### 特色优势\n相似问生成组件，可一次生成多个相似问题，准确率可达90%以上。\n\n### 应用场景\n应用于客服、问答等场景\n\n## 基本用法\n\n### 快速开始\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nsimilar_question = appbuilder.SimilarQuestion(model=\"DeepSeek-V3.1\")\n\nmsg = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\nmsg = appbuilder.Message(msg)\nanswer = similar_question(msg)\n\nprint(\"Answer: \\n{}\".format(answer.content))\n```\n\n## 参数说明\n\n### 初始化参数\n无\n\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n| message | String |是 |输入消息，用于模型的主要输入内容。这是一个必需的参数。| `Message(\"我想吃冰淇淋，哪里的冰淇淋比较好吃？\")` |\n| stream |bool|否 |指定是否以流式形式返回响应。默认为 False。| False |\n| temperature |float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 | 1e-10 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n| result | String | 返回结果 | \"1. 哪里能品尝到美味的冰淇淋？\\n2. 哪...\" |\n\n### 响应示例\n\n```text\n1. 哪里能品尝到美味的冰淇淋？\n2. 哪里能买到好吃的冰淇淋？\n3. 哪里能品尝到正宗的冰淇淋？\n4. 哪里能品尝到最新鲜的冰淇淋？\n5. 哪里能买到口感最好的冰淇淋？\n6. 哪里能品尝到最经典的冰淇淋？\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n\n## 高级用法\n\n### 特殊场景示例\n\n你可以根据特定的场景调整参数来获得更精确的结果，例如：\n\n```python\n# 流式返回, 调整模型temperature参数\nanswer = similar_question(msg, stream=True, temperature=0.5)\n```\n\n## 示例和案例研究\n\n### 示例\n\n- **场景:** 用户提出问题\n- **输入:** \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n- **输出:** 1. 请问哪里的冰淇淋最美味？ 2. 在哪些地方可以品尝到最好的冰淇淋？ .....\n\n\n## 更新记录和贡献\n* 相似问生成能力 (2023-12)"
  },
  {
    "path": "python/core/components/llms/similar_question/__init__.py",
    "content": "\nfrom .component import SimilarQuestion\n"
  },
  {
    "path": "python/core/components/llms/similar_question/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import Field\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\n\n\nclass SimilarQuestionMeta(ComponentArguments):\n    \"\"\" \n    SimilarQuestionMeta\n\n    Attributes:\n        message (Message): 输入消息，用于模型的输入，一般为问题。\n    \"\"\"\n    message: Message = Field(..., \n                             variable_name=\"query\", \n                             description=\"输入消息，用于模型的输入，一般为问题。\")"
  },
  {
    "path": "python/core/components/llms/similar_question/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\" similar question\n\"\"\"\nfrom typing import Optional\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import SimilarQuestionMeta\n\n\nclass SimilarQuestion(CompletionBaseComponent):\n    r\"\"\" \n    基于输入的问题, 挖掘出与该问题相关的类似问题。广泛用于客服、问答等场景。\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        qa_mining = appbuilder.SimilarQuestion(model=\"DeepSeek-V3.1\")\n\n        msg = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n        msg = appbuilder.Message(msg)\n        answer = qa_mining(msg)\n\n        print(\"Answer: \\n{}\".format(answer.content))\n    \"\"\"\n    name = \"similar_question\"\n    version = \"v1\"\n    meta = SimilarQuestionMeta\n\n    manifests = [\n        {\n            \"name\": \"similar_question\",\n            \"description\": \"基于输入的问题，挖掘出与该问题相关的类似问题。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入的问题，用于大模型根据该问题输出相关的类似问题。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化SimilarQuestionMeta任务。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                SimilarQuestionMeta, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0, request_id=None):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p(float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p, request_id=request_id)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        执行函数调用的评估工具。\n        \n        Args:\n            name (str): 函数名。\n            streaming (bool, optional): 是否以流式方式输出结果。默认为False。\n            **kwargs: 其他关键字参数，包括：\n                traceid (str, optional): 请求的追踪ID。\n                query (str): 输入的查询字符串。\n                model_configs (dict, optional): 模型配置字典，包括：\n                    temperature (float, optional): 温度参数，用于控制输出结果的多样性。默认为1e-10。\n                    top_p (float, optional): 截断概率，用于控制生成文本的质量。默认为0.0。\n        \n        Returns:\n            如果streaming为False，则返回评估结果的字符串表示。\n            如果streaming为True，则生成评估结果的字符串表示的迭代器。\n        \n        Raises:\n            ValueError: 如果未提供query参数，则抛出此异常。\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/style_rewrite/README.md",
    "content": "# 风格转写 (StyleRewrite)\n\n## 简介\n风格转写组件（StyleRewrite） 可以基于生成式大模型对文本的风格进行改写。支持多种文本风格，包括营销、客服、直播、激励及教学话术。\n\n\n### 功能介绍\n文本风格转写能够将一段文本转换成不同的风格（营销、客服、直播、激励及教学话术），同时保持原文的基本意义不变。基于大模型的文本理解与生成能力，根据用户指定的风格重新组织语言和表达方式。它不仅能识别和模仿不同的写作风格，还能在转换过程中保持文本的连贯性和逻辑性。\n\n### 特色优势\n- 准确性与流畅性： 在转写时保持原文意义的准确传达，同时确保文本流畅自然。\n- 风格多样性： 能够覆盖广泛的文本风格，满足不同场合的需求。\n- 提高效率： 节省人工重新编写文本的时间。\n\n### 应用场景\n不同的文本风格可以应用到以下不同的场景中：\n- 营销风格：该风格的转写能力可以根据商品的描述生成一段营销文案，生动地为用户介绍商品特点。\n- 客服风格：针对客户关心的产品问题，用礼貌易懂的口语化文本进行回复，提升客户服务体验。\n- 直播风格：在线直播平台的主播或内容创作者可以使用文本风格转写技术来优化其直播脚本，使其更吸引特定的观众群体。\n- 激励风格：在激励演讲、团队管理或个人发展领域，文本风格转写可以帮助创建更有动力和启发性的内容。起到鼓舞人心的作用。\n- 教学风格：可以帮助教师或教材作者生成互动感强、并且引人入胜的教学材料。\n\n\n## 基本用法\n\n以下是一个简单的例子，展示如何快速开始使用 StyleRewrite 组件：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n# 初始化并使用 StyleRewrite 组件\nstyle_rewrite = appbuilder.StyleRewrite(model=\"DeepSeek-V3.1\")\nanswer = style_rewrite(appbuilder.Message(\"文心大模型发布新版\"), style=\"激励话术\")\n```\n\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |String  |是 |需要改写的文本|文心大模型发布新版|\n|style|String|否 |想要转换的文本风格，默认为\"营销话术\"，目前支持营销、客服、直播、激励及教学五种话术。|激励话术|\n|stream|bool|否 |指定是否以流式形式返回响应，默认为 False。|True|\n|temperature|float|否 |模型配置的温度参数，默认为 1e-10|1e-10|\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |String  |返回结果|\"文心NLP大模型平台再添新功绩！近日，文心NLP大模型平台成功发布新版，这标志着我们在这个领域又取得了新的里程碑。新版的文心NLP大模型平台在技术、功能和易用性等方面都有了显著的提升，为用户提供了更好的使用体验。\"|\n\n### 响应示例\n```json\n{\"result\": \"文心NLP大模型平台再添新功绩！近日，文心NLP大模型平台成功发布新版，这标志着我们在这个领域又取得了新的里程碑。新版的文心NLP大模型平台在技术、功能和易用性等方面都有了显著的提升，为用户提供了更好的使用体验。\"}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n\n目前该模块仅提供基础的文本风格转写功能。\n\n\n## 更新记录和贡献\n* 当前版本：v1\n"
  },
  {
    "path": "python/core/components/llms/style_rewrite/__init__.py",
    "content": "\"\"\"StyleRewrite\"\"\"\nfrom .component import StyleRewrite\n"
  },
  {
    "path": "python/core/components/llms/style_rewrite/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.message import Message\n\nfrom appbuilder.core.component import ComponentArguments\n\nfrom pydantic import Field\nfrom enum import Enum\n\n\nclass StyleChoices(Enum):\n    \"\"\"\n    StyleChoices枚举类，包含了五种风格：\n\n    Attributes:\n        YINGXIAO : 营销话术\n        JIAOXUE : 教学话术\n        JILI : 激励话术\n        KEFU : 客服话术\n        ZHIBO : 直播话术\n    \"\"\"\n    YINGXIAO = \"营销话术\"\n    JIAOXUE = \"教学话术\"\n    JILI = \"激励话术\"\n    KEFU = \"客服话术\"\n    ZHIBO = \"直播话术\"\n\n    def to_chinese(self):\n        \"\"\"\n        将StyleChoices枚举类中的值转换为中文描述。\n        \n        Args:\n            无参数\n        \n        Returns:\n            返回一个字典，键是StyleChoices枚举类的成员，值为对应的中文描述字符串。\n        \n        \"\"\"\n        descriptions = {\n            StyleChoices.YINGXIAO: \"营销话术\",\n            StyleChoices.JIAOXUE: \"教学话术\",\n            StyleChoices.JILI: \"激励话术\",\n            StyleChoices.KEFU: \"客服话术\",\n            StyleChoices.ZHIBO: \"直播话术\"\n        }\n        return descriptions[self]\n\n\nclass StyleRewriteArgs(ComponentArguments):\n    \"\"\"\n    文本风格转写配置\n\n    Attributes:\n        message: Message\n        style: StyleChoices\n    \"\"\"\n    message: Message = Field(...,\n                             variable_name=\"query\",\n                             description=\"需要改写的文本，该字段为必须字段。\")\n    style: StyleChoices = Field(...,\n                                variable_name=\"style\",\n                                description=\"想要转换的文本风格，目前有营销、客服、直播、激励及教学五种话术可选\")"
  },
  {
    "path": "python/core/components/llms/style_rewrite/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\n\nfrom typing import Optional\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .base import StyleRewriteArgs\n\n\nclass StyleRewrite(CompletionBaseComponent):\n    \"\"\"\n    文本风格转写大模型组件， 基于生成式大模型对文本的风格进行改写，支持有营销、客服、直播、激励及教学五种话术。\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        style_rewrite = appbuilder.StyleRewrite(model=\"DeepSeek-V3.1\")\n        answer = style_rewrite(appbuilder.Message(\"文心大模型发布新版本\"), style=\"激励话术\")\n\n    \"\"\"\n    name = \"style_rewrite\"\n    version = \"v1\"\n    meta = StyleRewriteArgs\n\n    manifests = [\n        {\n            \"name\": \"style_rewrite\",\n            \"description\": \"能够将一段文本转换成不同的风格（营销、客服、直播、激励及教学话术），同时保持原文的基本意义不变。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"需要改写的文本。\"\n                    },\n                    \"style\": {\n                        \"type\": \"string\",\n                        \"description\": \"想要转换的文本风格，目前有营销、客服、直播、激励及教学五种话术可选. 默认是营销话术。\",\n                        \"enum\": [\"营销话术\", \"客服话术\", \"直播话术\", \"激励话术\", \"教学话术\"]\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model=None,\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = False,\n            **kwargs\n    ):\n        \"\"\"初始化StyleRewrite模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            StyleRewriteArgs, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, style=\"营销话术\", stream=False, temperature=1e-10, top_p=0.0, request_id=None):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            style (str, optional): 想要转换的文本风格，目前有营销、客服、直播、激励及教学五种话术可选。默认为\"营销话术\"。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \n        \"\"\"\n        return super().run(message=message, style=style, stream=stream, temperature=temperature, top_p=top_p, request_id=request_id)\n\n    @components_run_stream_trace \n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        执行工具评估函数\n        \n        Args:\n            name (str): 函数名称，本函数不使用该参数，但保留以符合某些框架的要求。\n            streaming (bool, optional): 是否以流的形式返回结果。默认为 False，即一次性返回结果。如果设置为 True，则以生成器形式逐个返回结果。\n            **kwargs: 其他参数，包含但不限于：\n                traceid (str): 请求的跟踪ID，用于日志记录和跟踪。\n                query (str): 待评估的文本。\n                style (str, optional): 评估风格，可选值为 ['营销话术', '客服话术', '直播话术', '激励话术', '教学话术']。默认为 '营销话术'。\n                model_configs (dict, optional): 模型配置参数，可选的键包括：\n                    temperature (float, optional): 温度参数，用于控制生成文本的随机性。默认为 1e-10。\n                    top_p (float, optional): top_p 采样参数，用于控制生成文本的多样性。默认为 0.0。\n        \n        Returns:\n            如果 streaming 为 False，则直接返回评估结果字符串。\n            如果 streaming 为 True，则以生成器形式逐个返回评估结果字符串。\n        \n        Raises:\n            ValueError: 如果缺少参数 'query'。\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        style = kwargs.get(\"style\", \"营销话术\")\n        if style not in [\"营销话术\", \"客服话术\", \"直播话术\", \"激励话术\", \"教学话术\"]:\n            style = \"营销话术\"\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, style=style, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n        \n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/style_writing/README.md",
    "content": "# 风格写作（StyleWriting）\n\n## 简介\n风格写作组件（StyleWriting）是一款基于生成式大模型进行文本创作的工具，支持多种风格，包括B站、小红书等，适用于编写文案、广告等多种场景。\n\n### 功能介绍\n风格写作组件（StyleWriting）根据用户的输入内容和风格要求，利用大语言模型的生成能力，自动生成符合特定风格的文案。\n\n\n### 特色优势\n风格写作组件（StyleWriting），基于百度自研的大语言模型文新一言，提供内置的风格生成能力，无需更多的prompt描述，即可生成对应风格的文案。\n\n\n### 应用场景\n风格写作组件（StyleWriting）可用于特定平台的文案生成分发营销场景。\n\n\n## 基本用法\n\n为了快速开始使用风格写作组件，您可以参考以下步骤：\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nmodel = \"DeepSeek-V3.1\"\nstyle_writing = appbuilder.StyleWriting(model)\n\nquery = \"帮我写一篇关于人体工学椅的文案\"\nstyle = \"小红书\"\nlength = 100\n\nmsg = appbuilder.Message(query)\nanswer = style_writing(message=msg, style_query=style, length=length)\nprint(answer)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |Message  |是 |输入的消息，用于模型的主要输入内容，这是一个必需的参数。 |Message(content=\"帮我生成一个介绍保温杯的话术\") |\n|style_query |str |否 |定义生成文案的格式，包括\"通用\"、\"B站\"、\"小红书\"，默认为\"通用\" |\"通用\" |\n|length |int |否 |定义生成文案的长度，可选 '短' (100), '中' (300), '长' (600), 默认100 |100 |\n|stream |bool | 否 |指定是否以流式形式返回响应。默认为 False。 |False |\n|temperature |float | 否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。 |0.7 |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|Message(content=\"大家好，我给你们介绍一款家里和办公室都要备上的保温杯。...\")|\n\n### 响应示例\n```\nMessage(name=msg, content=大家好，我给你们介绍一款家里和办公室都要备上的保温杯。我平常上班的时候都会装上一杯热开水，但用普通保温杯装上一会就凉了，所以我赶紧在网上淘了一个好货。它是双层设计，内层是不锈钢材质，外层是玻璃材质，非常贴心，冷热都能装。装上热水，保温效果非常出色，到晚上还是热的。这个保温杯的外观也非常漂亮，采用优质不锈钢材质，耐磨、易清洗。同时，它还非常轻便，可以轻松放入口袋、背包中。有了这个保温杯后，我再也不用担心喝水问题了。无论是在家里、办公室还是户外活动，它都能随时随地为你提供热水。而且，它还非常安全、健康，采用了优质的保温材料和先进的生产工艺。无论男女老少都可以使用这款保温杯哦。快来购买吧。\", mtype=dict, extra={})\n```\n\n## 高级用法\n\n使用风格写作组件进行更复杂的文本创作，例如调整不同的风格和长度参数来适应特定的写作场景。\n\n## 更新记录和贡献\n\n- 初始版本发布(2023-10)\n"
  },
  {
    "path": "python/core/components/llms/style_writing/__init__.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\nfrom .component import StyleWriting\n"
  },
  {
    "path": "python/core/components/llms/style_writing/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.message import Message\n\nfrom appbuilder.core.component import ComponentArguments\n\nfrom pydantic import Field\nfrom enum import Enum\n\n\nclass StyleQueryChoices(Enum):\n    \"\"\"\n    StyleQueryChoices是一个枚举类型，包含三个选项：\n    \n    Attributes:\n        BILIBILI (\"B站\")\n        XIAOHONGSHU (\"小红书\")\n        GENERAL (\"通用\")\n    \"\"\"\n    BILIBILI = \"B站\"\n    XIAOHONGSHU = \"小红书\"\n    GENERAL = \"通用\"\n\n    def to_chinese(self):\n        \"\"\"\n        将StyleQueryChoices枚举类中的值转换为中文描述。\n        \n        Args:\n            无参数\n        \n        Returns:\n            返回一个字典，键是StyleQueryChoices枚举类的成员，值为对应的中文描述字符串。\n        \n        \"\"\"\n        descriptions = {\n            StyleQueryChoices.BILIBILI: \"B站\",\n            StyleQueryChoices.XIAOHONGSHU: \"小红书\",\n            StyleQueryChoices.GENERAL: \"通用\",\n        }\n        return descriptions[self]\n\n\nclass LengthChoices(Enum):\n    SHORT = 100  # 短\n    MEDIUM = 300  # 中\n    LONG = 600  # 长\n\n    def to_chinese(self):\n        \"\"\"\n        将LengthChoices枚举对象转换为中文描述。\n        \n        Args:\n            无参数\n        \n        Returns:\n            str: 转换后的中文描述，包括\"短\"、\"中\"和\"长\"。\n        \n        \"\"\"\n        descriptions = {\n            LengthChoices.SHORT: \"短\",\n            LengthChoices.MEDIUM: \"中\",\n            LengthChoices.LONG: \"长\",\n        }\n        return descriptions[self]\n\n\nclass StyleWritingArgs(ComponentArguments):\n    \"\"\"\n    风格写作配置\n\n    Attributes:\n        message: Message = Field(...)\n        style_query: StyleQueryChoices = Field(...)\n        length: LengthChoices = Field(...)\n    \"\"\"\n    message: Message = Field(...,\n                             variable_name=\"query\",\n                             description=\"输入消息，用于模型的主要输入内容，例如'帮我生成一个介绍保温杯的话术'\")\n    style_query: StyleQueryChoices = Field(...,\n                                           variable_name=\"style_query\",\n                                           description=\"风格查询选项，可选值为 'B站', '小红书', '通用'。\")\n    length: LengthChoices = Field(...,\n                                  variable_name=\"length\",\n                                  description=\"输出长度，可选值为 '短' (100), '中' (300), '长' (600)。\")"
  },
  {
    "path": "python/core/components/llms/style_writing/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\n\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nfrom pydantic import Field\nfrom typing import Optional\n\nfrom .base import StyleQueryChoices, LengthChoices\n\nclass StyleWritingArgs(ComponentArguments):\n    \"\"\"\n    风格写作配置\n\n    Attributes:\n        message: Message = Field(...)\n        style_query: StyleQueryChoices = Field(...)\n        length: LengthChoices = Field(...)\n    \"\"\"\n    message: Message = Field(...,\n                             variable_name=\"query\",\n                             description=\"输入消息，用于模型的主要输入内容，例如'帮我生成一个介绍保温杯的话术'\")\n    style_query: StyleQueryChoices = Field(...,\n                                           variable_name=\"style_query\",\n                                           description=\"风格查询选项，可选值为 'B站', '小红书', '通用'。\")\n    length: LengthChoices = Field(...,\n                                  variable_name=\"length\",\n                                  description=\"输出长度，可选值为 '短' (100), '中' (300), '长' (600)。\")\n\n\nclass StyleWriting(CompletionBaseComponent):\n    \"\"\"\n    风格写作大模型组件， 基于生成式大模型进行风格写作，支持B站、小红书等多种风格，可用于文案、广告等多种场景。\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        style_writing = appbuilder.StyleWriting(model=\"DeepSeek-V3.1\")\n        answer = style_writing(appbuilder.Message(\"帮我写一篇关于人体工学椅的文案\"), style_query=\"小红书\", length=100)\n\n    \"\"\"\n\n    name = \"style_writing\"\n    version = \"v1\"\n    meta = StyleWritingArgs\n\n    manifests = [\n        {\n            \"name\": \"style_writing\",\n            \"description\": \"根据用户输入的文案要求和文案风格，生成符合特定风格的产品介绍或宣传文案。目前支持生成小红书风格、B站风格或通用风格的文案。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"用于描述生成文案的主题和要求。\"\n                    },\n                    \"style\": {\n                        \"type\": \"string\",\n                        \"description\": \"用于定义文案生成的风格，包括通用、B站、小红书，默认为通用。\",\n                        \"enum\": [\"通用\", \"B站\", \"小红书\"]\n                    },\n                    \"length\": {\n                        \"type\": \"integer\",\n                        \"description\": \"用于定义输出内容的长度。有效的选项包括 100（短）、300（中）、600（长），默认值为 100。\",\n                        \"enum\": [100, 300, 600]\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model=None,\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = False,\n            **kwargs\n    ):\n        \"\"\"初始化StyleWriting模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            StyleWritingArgs, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, style_query=\"通用\", length=100, stream=False, temperature=1e-10, top_p=0, request_id=None):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            style_query (str): 风格查询选项，用于指定写作风格。有效的选项包括 'B站', '小红书', '通用'。默认值为 '通用'。\n            length (int): 输出内容的长度。有效的选项包括 100（短），300（中），600（长）。默认值为 100。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n            request_id (str, optional): 请求ID，用于跟踪和识别请求。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, style_query=style_query, length=length, stream=stream,\n                           temperature=temperature, top_p=top_p, request_id=request_id)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        对指定的工具进行函数调用评估。\n        \n        Args:\n            name (str): 工具名称。\n            streaming (bool, optional): 是否以流的方式返回结果。默认为False。\n            **kwargs: 其他参数。\n        \n        Returns:\n            str 或 generator: 如果 streaming 为 False，则返回评估结果字符串；如果 streaming 为 True，则返回一个生成器，每次迭代返回评估结果字符串的一部分。\n        \n        Raises:\n            ValueError: 如果未提供必要的参数 'query'。\n        \n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        style = kwargs.get(\"style\", \"通用\")\n        if style not in [\"通用\", \"B站\", \"小红书\"]:\n            style = \"通用\"\n        length = kwargs.get(\"length\", 100)\n        try:\n            length = int(length)\n            if length not in [100, 300, 600]:\n                length = 100\n        except:\n            length = 100\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, style_query=style, length=length, stream=False,\n                              temperature=temperature, top_p=top_p, request_id=traceid)\n        \n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/llms/tag_extraction/README.md",
    "content": "# 标签抽取（TagExtraction）\n\n## 简介\n标签抽取组件（TagExtraction）是一款高效的标签抽取组件，基于生成式大模型，专门用于从文本中提取关键标签。它适用于各种文本分析场景，如内容分类、关键词提取等。\n\n### 功能介绍\n标签抽取组件（TagExtraction）专门设计用于从各类文本中高效地提取关键标签。此组件利用先进的生成式大模型，可以准确识别和提取文本中的重要信息，如关键词、短语或主题。它不仅能快速分析大量文本数据，还能精准识别文本的核心内容，支持用户快速了解文本的主要信息和结构\n\n### 特色优势\n- 高效准确：基于先进的生成式大模型，提供高效且准确的标签提取功能。\n- 适用广泛：能够处理不同类型和格式的文本数据，适用于多种文本分析场景。\n- 格式友好：输出格式采用规范化编号输出，后处理时方便快捷。\n\n### 应用场景\n标签抽取组件可以广泛应用于多种场景：\n\n- 内容分类：快速为文章或文档分类，提高信息管理和检索效率。\n- 关键词提取：从文本中提取关键词，帮助用户快速了解文本主题和内容。\n- 数据分析：在大数据分析中，可以用于预处理，提取有价值的信息。\n- 搜索引擎优化：帮助网站或博客提取有效标签，改善其在搜索引擎中的可见度。\n\n\n## 基本用法\n\n要开始使用 `TagExtraction`，首先需要设置环境变量 `APPBUILDER_TOKEN`，然后创建 `TagExtraction` 实例并传递文本消息。\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\ntag_extraction = appbuilder.TagExtraction(model=\"DeepSeek-V3.1\")\nresult = tag_extraction(appbuilder.Message(\"从这段文本中抽取关键标签\"))\n```\n\n这个例子展示了如何实例化 `TagExtraction` 组件并使用一个文本消息进行标签抽取。\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n\n|参数名称 |参数类型 |是否必须 |描述 |示例值|\n|--------|--------|--------|----|------|\n|message |String  |是 |需要抽取标签的文本|从这段文本中抽取关键标签|\n|stream|bool|否 |指定是否以流式形式返回响应，默认为 False。|True|\n|temperature|float|否 |模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。|1e-10|\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |Message  |返回结果|对象，包含模型运行后的输出消息。|\n### 响应示例\n```json\n{\"result\": \"1.5G 2.云计算 3.人工智能 4.数字经济 5.数据中心 6.新型基础设施 7.政策优化 8.产业发展 9.国家重视 10.快速增长\"}\n```\n\n## 高级用法\n\n高级用法可以包括自定义模型参数或使用不同的模型源。例如，可以通过指定不同的 `model` 来使用特定于域的模型进行标签抽取。\n\n```python\ntag_extraction = appbuilder.TagExtraction(model=\"custom-model\")\nresult = tag_extraction(appbuilder.Message(\"自定义模型抽取的标签\"))\n```\n\n## 示例和案例研究\n\n在实际应用中，`TagExtraction` 可以用于新闻文章、社交媒体帖子或其他任何文本内容的关键标签提取，帮助内容创建者或营销分析师快速了解主要主题和趋势。\n\n\n"
  },
  {
    "path": "python/core/components/llms/tag_extraction/__init__.py",
    "content": "\nfrom .component import TagExtraction"
  },
  {
    "path": "python/core/components/llms/tag_extraction/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom pydantic import Field\n\n\nclass TagExtractionArgs(ComponentArguments):\n    \"\"\"\n    标签抽取配置\n\n    Attributes:\n        message (Message): 输入消息，用于模型的主要输入内容\n    \"\"\"\n    message: Message = Field(...,\n                             variable_name=\"query\",\n                             description=\"\"\"输入消息，用于模型的主要输入内容，例如'本实用新型公开了一种可利用热能的太阳能光伏光热一体化组件，\n                             包括太阳能电池，还包括有吸热板，太阳能电池粘附在吸热板顶面，吸热板内嵌入有热电材料制成的内芯，吸热板底面设置有蛇形管。\n                             本实用新型结构紧凑，安装方便，能充分利用太阳能电池散发的热能，具有较高的热能利用率。'\"\"\")"
  },
  {
    "path": "python/core/components/llms/tag_extraction/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments\nfrom pydantic import BaseModel, Field\nfrom typing import Optional\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nfrom .base import TagExtractionArgs\n\nclass TagExtraction(CompletionBaseComponent):\n    \"\"\"\n    标签抽取组件，基于生成式大模型进行关键标签的抽取。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        tag_extraction = appbuilder.TagExtraction(model=\"DeepSeek-V3.1\")\n        answer = tag_extraction(appbuilder.Message(\"从这段文本中抽取关键标签\"))\n\n    \"\"\"\n\n    name = \"tag_extraction\"\n    version = \"v1\"\n    meta = TagExtractionArgs\n\n    manifests = [\n        {\n            \"name\": \"tag_extraction\",\n            \"description\": \"标签抽取组件，基于生成式大模型进行关键标签的抽取。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入消息，用于模型的主要输入内容\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=None,\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化TagExtraction模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n                TagExtractionArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`, 必选): 输入消息，用于模型的主要输入内容。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool = False, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        query = kwargs.get(\"query\", None)\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n\n        if streaming:\n            yield str(message.content)\n        else:\n            return str(message.content)\n"
  },
  {
    "path": "python/core/components/matching/README.md",
    "content": "# 语义匹配（Matching）\n\n## 简介\n\n语义匹配组件（Matching）可以计算query与文本列表之间的相似度关系，并根据其进行排序。\n\n### 功能介绍\n\n根据query与文本列表之间的相似度关系，并根据其进行排序。\n\n### 特色优势\n\n基于百度文心大模型技术的文本表示模型，学习数据的内在特征，使得排序效果相较于bm25等排序算法，可以更好地处理相似问和同义、近义句子之间的偏序关系。\n\n### 应用场景\n\n1. 语义排序\n\n## 基本用法\n\n### 下面是基于query和文本之间的相似度进行匹配排序的代码示例\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 初始化所需要的组件\nembedding = appbuilder.Embedding()\nmatching = appbuilder.Matching(embedding)\n\n# 定义query和文本列表\nquery = appbuilder.Message(\"你好\")\ncontexts = appbuilder.Message([\"世界\", \"你好\"])\n\ncontexts_matched = matching(query, contexts)\nprint(contexts_matched.content)\n```\n\n```\n['你好', '世界']\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n| 参数名称   | 参数类型    | 是否必须 | 描述                                                          | 示例值          |\n| ---------- | ----------- | -------- | ------------------------------------------------------------- | --------------- |\n| embedding  | Embedding   | 可选     | 一个类型为Embedding的Component，用于初始化 Matching 的向量计算功能。底座模型当前仅支持 embedding-v1 作为可选值。若不指定，默认值为 embedding-v1 。 |  appbuilder.Embedding()   |\n\n### 调用参数\n\n| 参数名称  | 参数类型    | 是否必须 | 描述                                                         | 示例值                             |\n| --------- | ----------- | -------- | ------------------------------------------------------------ | ---------------------------------- |\n| query     | 字符串      | 必须     | 一个类型为 string 的句子，用于输入。该句子的长度不能超过384个字符，通常为用户输入的问题。 | \"如何提高工作效率？\"                |\n| contexts  | 字符串列表   | 必须     | 一个类型为 List[string] 的句子数组。数组中的每个元素都是一个句子，且每个句子的长度不能超过384个字符。这些句子通常为与问题相关的文本候选集。 | [\"时间管理技巧\", \"提高专注力的方法\"]  |\n| return_score | 布尔 | 可选 | 默认为False, 仅返回排序后的字符串列表；当设置为True时，返回匹配分数和字符串的二元组列表 |\n\n### 响应示例\n\n默认为排完序后的字符串列表\n\n```\n[\"时间管理技巧\", \"提高专注力的方法\"]\n```\n\n当设置`return_score = True`时，二元组的第一个值为相似度分数，第二个值为字符串\n\n```\n[(0.9999999852985002, '你好'), (0.18920520439845268, '世界')]\n```\n\n### 错误码\n\n无\n\n## 更新记录和贡献\n\n* 语义匹配 (2023-12)\n"
  },
  {
    "path": "python/core/components/matching/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"\ninit\n\"\"\"\n\nfrom .component import Matching\n"
  },
  {
    "path": "python/core/components/matching/base.py",
    "content": "\"\"\"\nbase\n\"\"\"\n\n# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom abc import abstractmethod\nfrom typing import List, Union\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.component import ComponentArguments\n\n\nclass MatchingArgs(ComponentArguments):\n    \"\"\"Matching Args\"\"\"\n\n    query: Union[str, Message[str]]\n    contexts: Union[List[str], Message[List[str]]]\n\n\nclass MatchingBaseComponent(Component):\n    \"\"\"\n    MatchingBaseComponent\n    \"\"\"\n\n    name: str\n    version: str\n    meta: MatchingArgs\n\n    @abstractmethod\n    def run(\n        self,\n        query: Union[Message[str], str],\n        contexts: Union[Message[List[str]], List[str]],\n    ) -> Message[List[str]]:\n        \"\"\"\n        Args:\n            query: Union[Message[str], str]\n            contexts: Union[Message[List[str]], List[str]]\n        Returns:\n            Message[List[str]]: contexts which has been Matched\n        \"\"\"\n"
  },
  {
    "path": "python/core/components/matching/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom typing import List, Union\n\nimport numpy as np\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.embeddings import EmbeddingBaseComponent\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nfrom .base import MatchingBaseComponent, MatchingArgs\n\n\nclass Matching(MatchingBaseComponent):\n    \"\"\"\n    Matching\n\n    基于Embedding类型的文本表示模型，输入query和文本列表，对其进行排序或者相似度计算\n\n    Examples:\n\n        .. code-block:: python\n\n            import appbuilder\n            os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n            # 初始化所需要的组件\n            embedding = appbuilder.Embedding()\n            matching = appbuilder.Matching(embedding)\n\n            # 定义输入query和文本列表\n            query = appbuilder.Message(\"你好\")\n            contexts = appbuilder.Message([\"世界\", \"你好\"])\n\n            # 根据query，对文本列表做相似度排序\n            contexts_matched = matching(query, contexts)\n            print(contexts_matched.content)\n            # ['你好', '世界']\n    \"\"\"\n\n    name: str = \"Matching\"\n    version: str = \"v1\"\n    meta: MatchingArgs = MatchingArgs\n\n    def __init__(\n        self,\n        embedding_component: EmbeddingBaseComponent,\n        **kwargs\n    ):\n        \"\"\"\n        EmbeddingBaseComponent: 用于计算文本的embedding\n        \"\"\"\n        \n        self.embedding_component = embedding_component\n        super().__init__(self.meta)\n\n    @components_run_trace\n    def run(\n        self,\n        query: Union[Message[str], str],\n        contexts: Union[Message[List[str]], List[str]],\n        return_score: bool=False,\n    ) -> Message[List[str]]:\n        \"\"\"\n        根据给定的查询和上下文，返回匹配的上下文列表。\n        \n        Args:\n            query (Union[Message[str], str]): 查询字符串或Message对象，包含查询字符串。\n            contexts (Union[Message[List[str]], List[str]]): 上下文字符串列表或Message对象，包含上下文字符串列表。\n            return_score (bool, optional): 是否返回匹配得分。默认为False。\n        \n        Returns:\n            Message[List[str]]: 匹配的上下文列表。如果return_score为True，则返回包含得分和上下文的元组列表；否则仅返回上下文列表。\n        \"\"\"\n        query_embedding = self.embedding_component(query)\n        contexts_embedding = self.embedding_component.batch(contexts)\n\n        sematic = self.semantics(query_embedding, contexts_embedding)\n\n        combined = list(zip(sematic.content, contexts.content))\n        sorted_combined = sorted(combined, reverse=True)\n\n        if return_score:\n            return Message([(item[0], item[1]) for item in sorted_combined])\n        else:\n            return Message([item[1] for item in sorted_combined])\n\n    def _cosine_similarity(self, X, Y):\n        \"\"\"\n        Args:\n            X: 长度为 1 x n 的矩阵\n            Y: 长度为 m x n 的矩阵\n        Returns:\n            长度为 m x 1 的矩阵，每个元素表示 X 与 Y的对应行m 的余弦相似度\n        \"\"\"\n\n        X_norm = X / np.linalg.norm(X)\n        Y_norm = Y / np.linalg.norm(Y, axis=1, keepdims=True)\n\n        similarity = np.dot(Y_norm, X_norm.T)\n        return similarity\n\n    def semantics(\n        self,\n        query_embedding: Union[Message[List[float]], List[float]],\n        context_embeddings: Union[Message[List[List[float]]], List[List[float]]],\n    ) -> Message[List[float]]:\n        \"\"\"\n        计算query和context的相似度\n        \n        Args:\n            query_embedding (Union[Message[List[float]], List[float]]): query的embedding，长度为n的数组\n            context_embeddings (Union[Message[List[List[float]]], List[List[float]]]): context的embedding，长度为m x n的矩阵，其中m表示候选context的数量\n        \n        Returns:\n            Message[List[float]]: query和所有候选context的相似度列表\n        \n        \"\"\"\n        _query_embedding = query_embedding.content if isinstance(query_embedding, Message) else query_embedding\n        _context_embeddings = context_embeddings.content if isinstance(context_embeddings, Message) else context_embeddings\n\n        similarity_matrix = self._cosine_similarity([_query_embedding], _context_embeddings)\n        similarity_matrix = similarity_matrix.flatten().tolist()\n\n        return Message(similarity_matrix)\n"
  },
  {
    "path": "python/core/components/mix_card_ocr/README.md",
    "content": "# 身份证混贴识别（MixCardOCR）\n\n## 简介\n身份证混贴识别（MixCardOCR），身份证混贴识别支持自动检测与识别身份证正反面在同一张图片上的场景，一次识别图片中身份证正反面所有字段。\n\n\n### 功能介绍\n支持对二代居民身份证正反面所有8个字段进行结构化识别，包括姓名、性别、民族、出生日期、住址、身份证号、签发机关、有效期限，识别准确率超过99%；同时支持身份证正面头像检测，并返回头像切片的base64编码及位置信息。\n\n### 特色优势\n同时，支持对用户上传的身份证图片进行图像风险和质量检测，可识别图片是否为复印件或临时身份证，是否被翻拍或编辑，是否存在正反颠倒、模糊、欠曝、过曝等质量问题。\n\n\n\n### 应用场景\n身份证混贴识别支持自动检测与识别身份证正反面在同一张图片上的场景，一次识别图片中身份证正反面所有字段。\n\n\n## 基本用法\n\n下面是身份证混贴识别的代码示例：\n\n示例图片为：![示例图片](https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe1865e4393da5a3515e90d72d81ef18296bd29598)\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\nimage_url= \"https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe1865e4393da5a3515e90d72d81ef18296bd29598\"\n\n\n# 从BOS存储读取样例文件\nraw_image = requests.get(image_url).content\ninp = appbuilder.Message(content={\"raw_image\": raw_image})\n# inp = Message(content={\"url\": image_url})\n\n# 运行身份证混贴识别OCR\nmix_card_ocr = appbuilder.MixCardOCR()\nout = mix_card_ocr.run(inp)\n# 打印识别结果\nprint(out.content) \n\n# {'front': {'fields': [{'key': '出生', 'value': '19920225', 'position': {'left': 620, 'top': 218, 'width': 239, 'height': 30}}, {'key': '性别', 'value': '女', 'position': {'left': 616, 'top': 164, 'width': 25, 'height': 30}}, {'key': '民族', 'value': '汉', 'position': {'left': 766, 'top': 164, 'width': 29, 'height': 30}}, {'key': '姓名', 'value': '姚佳', 'position': {'left': 621, 'top': 102, 'width': 84, 'height': 35}}, {'key': '公民身份号码', 'value': '110103199202250229', 'position': {'left': 733, 'top': 417, 'width': 399, 'height': 36}}, {'key': '住址', 'value': '北京市海淀区仙秀园555号', 'position': {'left': 618, 'top': 277, 'width': 253, 'height': 67}}], 'position': {'left': 483, 'top': 42, 'width': 737, 'height': 464}}, 'back': {'fields': [{'key': '签发日期', 'value': '20150413', 'position': {'left': 789, 'top': 946, 'width': 139, 'height': 34}}, {'key': '签发机关', 'value': '北京市公安局海淀分局', 'position': {'left': 787, 'top': 883, 'width': 275, 'height': 35}}, {'key': '失效日期', 'value': '20350413', 'position': {'left': 946, 'top': 945, 'width': 144, 'height': 34}}], 'position': {'left': 473, 'top': 537, 'width': 749, 'height': 480}}, 'direction': 0}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n| 参数名称       | 参数类型   | 是否必须 | 描述                          |示例值|\n|------------|--------|------|-----------------------------|---|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 ||\n| +content   | Dict   | 是    | 消息内容                        ||\n| +raw_image | String | 否    | 原始图片字节流                     ||\n| +url       | String   | 否    | 图片下载链接地址                    ||\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer| 否    | HTTP重试次数                    |3||\n\n### 响应参数\n\n| 参数名称       | 参数类型   | 描述                  | 示例值                                                |\n|------------|--------|---------------------|----------------------------------------------------|\n| front      | object | 身份证正面信息             |                                                    |\n| +fields    | list   | 字段信息                |                                                    |\n| ++key      | str    | 字段名                 |                                                    |\n| ++value    | str    | 字段值                 |                                                    |\n| ++position | object | 字段坐标,结构同下position           |                                                    |\n| +position  | object | 身份证正面坐标             |                                                    |\n| ++left     | int | 表示定位位置的长方形左上顶点的水平坐标 |                                                    |\n| ++top        | int | 表示定位位置的长方形左上顶点的垂直坐标 |                                                    |\n| ++width    | int | 表示定位位置的长方形的宽度       |                                                    |\n| ++height   | int | 表示定位位置的长方形的高度       |                                                    |\n| back       | object | 身份证反面信息，结构同front    |                                            |\n| direction  | int    | 图像旋转角度              | 图像旋转角度，0（正向），- 1（逆时针90度），- 2（逆时针180度），- 3（逆时针270度） |\n\n### 响应示例\n```json\n{\n\t\"front\": {\n\t\t\"fields\": [{\n\t\t\t\t\"key\": \"出生\",\n\t\t\t\t\"value\": \"19920225\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 620,\n\t\t\t\t\t\"top\": 218,\n\t\t\t\t\t\"width\": 239,\n\t\t\t\t\t\"height\": 30\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"性别\",\n\t\t\t\t\"value\": \"女\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 616,\n\t\t\t\t\t\"top\": 164,\n\t\t\t\t\t\"width\": 25,\n\t\t\t\t\t\"height\": 30\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"民族\",\n\t\t\t\t\"value\": \"汉\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 766,\n\t\t\t\t\t\"top\": 164,\n\t\t\t\t\t\"width\": 29,\n\t\t\t\t\t\"height\": 30\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"姓名\",\n\t\t\t\t\"value\": \"姚佳\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 621,\n\t\t\t\t\t\"top\": 102,\n\t\t\t\t\t\"width\": 84,\n\t\t\t\t\t\"height\": 35\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"公民身份号码\",\n\t\t\t\t\"value\": \"110103199202250229\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 733,\n\t\t\t\t\t\"top\": 417,\n\t\t\t\t\t\"width\": 399,\n\t\t\t\t\t\"height\": 36\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"住址\",\n\t\t\t\t\"value\": \"北京市海淀区仙秀园555号\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 618,\n\t\t\t\t\t\"top\": 277,\n\t\t\t\t\t\"width\": 253,\n\t\t\t\t\t\"height\": 67\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"position\": {\n\t\t\t\"left\": 483,\n\t\t\t\"top\": 42,\n\t\t\t\"width\": 737,\n\t\t\t\"height\": 464\n\t\t}\n\t},\n\t\"back\": {\n\t\t\"fields\": [{\n\t\t\t\t\"key\": \"签发日期\",\n\t\t\t\t\"value\": \"20150413\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 789,\n\t\t\t\t\t\"top\": 946,\n\t\t\t\t\t\"width\": 139,\n\t\t\t\t\t\"height\": 34\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"签发机关\",\n\t\t\t\t\"value\": \"北京市公安局海淀分局\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 787,\n\t\t\t\t\t\"top\": 883,\n\t\t\t\t\t\"width\": 275,\n\t\t\t\t\t\"height\": 35\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"key\": \"失效日期\",\n\t\t\t\t\"value\": \"20350413\",\n\t\t\t\t\"position\": {\n\t\t\t\t\t\"left\": 946,\n\t\t\t\t\t\"top\": 945,\n\t\t\t\t\t\"width\": 144,\n\t\t\t\t\t\"height\": 34\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"position\": {\n\t\t\t\"left\": 473,\n\t\t\t\"top\": 537,\n\t\t\t\"width\": 749,\n\t\t\t\"height\": 480\n\t\t}\n\t},\n\t\"direction\": 0\n}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n目前该模块仅提供基础的身份证混贴识别。\n\n## 更新记录和贡献\n* 身份证混贴识别 (2024-01)"
  },
  {
    "path": "python/core/components/mix_card_ocr/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/mix_card_ocr/component.py",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"身份证混贴识别组件\"\"\"\nimport base64\nimport json\n\nfrom appbuilder.core import utils\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.mix_card_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass MixCardOCR(Component):\n    r\"\"\" 身份证混贴识别组件\n    \n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import requests\n        import appbuilder\n\n        os.environ[\"GATEWAY_URL\"] = \"...\"\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n        # 从BOS存储读取样例文件\n        image_url=\"https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe1865e4393da5a3515e90d72d81ef18296bd29598\"\n        raw_image = requests.get(image_url).content\n        # 输入参数为一张图片\n        inp = appbuilder.Message(content={\"raw_image\": raw_image})\n        # 进行识别\n        mix_card_ocr = MixCardOCR()\n        out = mix_card_ocr.run(inp)\n        # 打印识别结果\n        print(out.content)\n     \"\"\"\n\n    name = \"mixcard_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"mixcard_ocr\",\n            \"description\": \"当身份证正反面在同一张图片上，需要识别图片中身份证正反面所有字段时，使用该工具\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别文件的文件名\"\n                    }\n                },\n                \"required\": [\"file_names\"]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        执行身份证识别操作\n        \n        Args:\n            message (Message): 包含待识别图片或图片下载URL的Message对象.\n                示例: Message(content={\"raw_image\": b\"...\"}) 或 Message(content={\"url\": \"https://image/download/url\"}).\n            timeout (float, 可选): HTTP请求的超时时间，默认为None.\n            retry (int, 可选): HTTP请求的重试次数，默认为0.\n        \n        Returns:\n            Message: 包含身份证识别结果的Message对象.\n        \"\"\"\n        inp = MixCardOCRInMsg(**message.content)\n        request = MixCardOCRRequest()\n        if inp.url:\n            request.url = inp.url\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        request.detect_risk = \"false\"\n        request.detect_quality = \"false\"\n        request.detect_photo = \"false\"\n        request.detect_card = \"false\"\n        response = self._recognize(request, timeout, retry)\n        out = MixCardOCROutMsg()\n        for res in response.words_result:\n            card_type = res.card_info.card_type\n            if card_type != \"idcard_back\" and card_type != \"idcard_front\":\n                continue\n            ref = out.front\n            if card_type == \"idcard_back\":\n                ref = out.back\n            loc = res.card_info.card_location\n            ref.position = MixCardPosition(left=loc.left, top=loc.top, width=loc.width, height=loc.height)\n            for key, val in res.card_result.items():\n                position = MixCardPosition(left=val.location.left, top=val.location.top, width=val.location.width,\n                                           height=val.location.height)\n                ref.fields.append(MixCardField(key=key, value=val.words, position=position))\n        out.direction = response.direction\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: MixCardOCRRequest, timeout: float = None, retry: int = 0, request_id: str = None) -> MixCardOCRResponse:\n        r\"\"\"调用底层身份证混贴识别\n                参数:\n                    request (obj: `GeneralOCRRequest`) : 通用文字识别输入参数\n\n                返回：\n                    response (obj: `GeneralOCRResponse`): 通用文字识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        data = MixCardOCRRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/multi_idcard\")\n        response = self.http_client.session.post(url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        response = MixCardOCRResponse(data)\n        response.request_id = request_id\n        return response\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 通用文字识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool, **kwargs):\n        \"\"\"\n        对指定文件进行OCR识别。\n        \n        Args:\n            name (str): API名称。\n            streaming (bool): 是否流式输出。如果为True，则逐个返回识别结果；如果为False，则一次性返回所有识别结果。\n            **kwargs: 其他参数。\n        \n        Returns:\n            如果streaming为False，则返回包含所有识别结果的JSON字符串。\n            如果streaming为True，则逐个返回包含识别结果的字典，每个字典包含以下字段：\n                type (str): 消息类型，固定为\"text\"。\n                text (str): 识别结果的JSON字符串。\n                visible_scope (str): 消息可见范围，可以是\"llm\"或\"user\"。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误，即文件URL不存在时抛出。\n        \n        \"\"\"\n        result = {}\n        traceid = kwargs.get(\"traceid\")\n        file_names = kwargs.get(\"file_names\", None)\n        if not file_names:\n            file_names = kwargs.get(\"files\")\n        file_urls = kwargs.get(\"file_urls\", {})\n        for file_name in file_names:\n            if utils.is_url(file_name):\n                file_url = file_name\n            else:\n                file_url = file_urls.get(file_name, None)\n            if file_url is None:\n                raise InvalidRequestArgumentError(f\"request format error, file {file_name} url does not exist\")\n\n            request = MixCardOCRRequest()\n            request.url = file_url\n            request.detect_risk = \"false\"\n            request.detect_quality = \"false\"\n            request.detect_photo = \"false\"\n            request.detect_card = \"false\"\n            response = self._recognize(request, request_id=traceid)\n            out = MixCardOCROutMsg()\n            for res in response.words_result:\n                card_type = res.card_info.card_type\n                if card_type != \"idcard_back\" and card_type != \"idcard_front\":\n                    continue\n                ref = out.front\n                if card_type == \"idcard_back\":\n                    ref = out.back\n                for key, val in res.card_result.items():\n                    ref.fields.append(MixCardField(key=key, value=val.words, position=None))\n            out.direction = response.direction\n            result[file_name] = out.dict()\n\n        result = json.dumps(result, ensure_ascii=False)\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": result,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": \"user\",\n            }\n        else:\n            return result\n"
  },
  {
    "path": "python/core/components/mix_card_ocr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"身份证混贴数据类\"\"\"\nimport proto\nfrom typing import List, Optional\nfrom pydantic import BaseModel\n\n\nclass MixCardOCRRequest(proto.Message):\n    \"\"\" 身份证混贴识别\n    属性:\n        image (str):\n            可选。图像内容的base64编码\n        url (str):\n            可选，图像的URL地址，经过base64编码\n            图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素\n        detect_risk（str）:\n            是否检测风险（身份证复印件、临时身份证、身份证翻拍、修改过的身份证）类型，可选值是\"true\"或“false”\n        detect_quality（str）:\n            是否开启身份证质量类型(边框/四角不完整、头像或关键字段被遮挡/马赛克)检测功能,可选值是\"true\"或“false”\n        detect_photo（str）:\n            是否检测头像内容，默认不检测,可选值是\"true\"或“false”\n        detect_card（str）:\n            是否检测身份证并进行裁剪,\"true\"或“false”\n    \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    detect_risk: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    detect_quality: str = proto.Field(\n        proto.STRING,\n        number=4,\n    )\n    detect_photo: str = proto.Field(\n        proto.STRING,\n        number=5,\n    )\n    detect_card: str = proto.Field(\n        proto.STRING,\n        number=6,\n    )\n\n\nclass MixCardOCRLocation(proto.Message):\n    \"\"\" 位置信息.\n\n        属性:\n            left (int): 表示定位位置的长方形左上顶点的水平坐标\n            top (int): 表示定位位置的长方形左上顶点的垂直坐标\n            width (int): 表示定位位置的长方形的宽度\n            height (int): 表示定位位置的长方形的高度\n         \"\"\"\n    left: int = proto.Field(\n        proto.INT32,\n        number=1,\n    )\n    top: int = proto.Field(\n        proto.INT32,\n        number=2,\n    )\n    width: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    height: int = proto.Field(\n        proto.INT32,\n        number=4,\n    )\n\n\nclass MixCardOCRInfo(proto.Message):\n    \"\"\" 身份证混贴手识别结果\n\n        属性:\n            card_location (MixCardLocation): 身份证的位置信息（坐标0点为左上角）\n            card_type（str）: idcard_front(头像面)、idcard_back（国徽面）\n            image_status (str): normal-识别正常、 non_idcard-上传的图片中不包含身份证 、blurred-身份证模糊\n            other_type_card-其他类型证照 、over_exposure-身份证关键字段反光或过曝 、over_dark-身份证欠曝（亮度过低）\n            unknown-未知状态\n     \"\"\"\n    card_location = proto.Field(\n        MixCardOCRLocation,\n        number=1,\n    )\n    card_type: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    image_status: str = proto.Field(\n        proto.STRING,\n        number=3\n    )\n    direction: int = proto.Field(\n        proto.INT32,\n        number=4\n    )\n    idcard_number_type: int = proto.Field(\n        proto.INT32,\n        number=5\n    )\n\n\nclass MixCardOCRResult(proto.Message):\n    \"\"\"身份证混贴别结果\n\n        属性:\n            words (str): 文本信息\n            location（MixCardOCRLocation）: 位置信息\n       \"\"\"\n\n    words: str = proto.Field(\n        proto.STRING,\n        number=1\n    )\n    location = proto.Field(\n        MixCardOCRLocation,\n        number=2\n    )\n\n\nclass MixOCRCardInfoResult(proto.Message):\n    \"\"\"身份证混贴信息\n\n        属性:\n            card_result (Map[str,MixCardOCRResult]): 身份证字段信息\n            card_info（MixCardOCRInfo）: 身份证信息\n          \"\"\"\n    card_result = proto.MapField(\n        proto.STRING,\n        MixCardOCRResult,\n        number=1\n    )\n    card_info = proto.Field(\n        MixCardOCRInfo,\n        number=2\n    )\n\n\nclass MixCardOCRResponse(proto.Message):\n    \"\"\"身份证混贴识别结果\n\n        属性:\n            request_id(str): 请求ID\n            log_id (int): 用于问题跟踪的唯一日志ID\n            words_result (List[MixOCRCardInfoResult]): 识别结果列表\n            direction (int): 当detect_direction=true返回改字段，1（未定义）、\n            0（正向）、1（逆时针90度）、2（逆时针180度）、3（逆时针270度）\n            pdf_file_size (str): 输入PDF文件的总页数。当pdf_file参数有效时返回\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    log_id: int = proto.Field(\n        proto.UINT64,\n        number=2,\n    )\n    words_result = proto.RepeatedField(\n        MixOCRCardInfoResult,\n        number=3,\n    )\n    direction: int = proto.Field(\n        proto.INT32,\n        number=4,\n    )\n\n\nclass MixCardOCRInMsg(BaseModel):\n    \"\"\" 手写体文字识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''  # 原始图片byte数组\n    url: str = \"\"  # 图片可下载链接\n\n\nclass MixCardPosition(BaseModel):\n    \"\"\"位置信息\n\n       属性：\n            left (int): 表示定位位置的长方形左上顶点的水平坐标\n            top (int): 表示定位位置的长方形左上顶点的垂直坐标\n            width (int): 表示定位位置的长方形的宽度\n            height (int): 表示定位位置的长方形的高度\n    \"\"\"\n\n    left: int\n    top: int\n    width: int\n    height: int\n\n\nclass MixCardField(BaseModel):\n    \"\"\" 字段信息\n\n        属性：\n            key（str): 字段名\n            value (str): 字段值\n            position(MixCardPosition): 字段位置信息\n      \"\"\"\n\n    key: str\n    value: str\n    position: Optional[MixCardPosition] = None\n\n\nclass MixCardContent(BaseModel):\n    \"\"\"正/反识别结果\n\n        属性：\n            fields(List[MixCardField]):字段列表\n            position(MixCardPosition): 正/反面在图像中的位置信息\n    \"\"\"\n    fields: List[MixCardField] = list()\n    position: MixCardPosition = None\n\n\nclass MixCardOCROutMsg(BaseModel):\n    \"\"\"身份证混贴识别结果\n\n        属性：\n            front（MixCardField）: 人像面信息\n            back(MixCardField): 国徽面信息\n            direction(int): 图像旋转角度，0（正向），- 1（逆时针90度），- 2（逆时针180度），- 3（逆时针270度）\n    \"\"\"\n    front: MixCardContent = MixCardContent()\n    back: MixCardContent = MixCardContent()\n    direction: int = 0\n"
  },
  {
    "path": "python/core/components/object_recognize/README.md",
    "content": "# 通用物体和场景识别-高级版（ObjectRecognition）\n\n## 简介\n通用物体和场景识别组件（ObjectRecognition）可以识别超过10万类常见物体和场景，接口返回大类及细分类的名称。广泛适用于图像或视频内容分析、拍照识图等业务场景。\n### 功能介绍\n* 识别物体或场景名称\n\n  识别动物、植物、商品、建筑、风景、动漫、食材、公众人物等10万个常见物体及场景，接口返回大类及细分类的名称结果；\n\n### 特色优势\n* 可识别超过10万类常见物体和场景，接口返回大类及细分类的名称，并支持获取识别结果对应的百科信息；\n\n### 应用场景\n可以识别超过10万类常见物体和场景，广泛适用于图像或视频内容分析、拍照识图等业务场景\n\n\n## 基本用法\n\n示例图片为：\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc1ba1de0a8f072bc5a87102bd32f9e3)\n\n\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?\"\\\n    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\"\\\n    \"11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc\"\\\n    \"1ba1de0a8f072bc5a87102bd32f9e3\"\nraw_image = requests.get(image_url).content\n# 创建物体识别组件实例\nobject_recognition = appbuilder.ObjectRecognition()\n# 执行识别操作并获取结果\nout = object_recognition.run(appbuilder.Message(content={\"raw_image\": raw_image}))\nprint(out.content)\n# {'result': [{'keyword': '苹果', 'score': 0.961247, 'root': '植物-蔷薇科'}, {'keyword': '姬娜果', 'score': 0.740838, 'root': '植物-其它'}, {'keyword': '梨子', 'score': 0.392218, 'root': '商品-水果'}, {'keyword': '车厘子', 'score': 0.193986, 'root': '植物-其它'}, {'keyword': '石榴', 'score': 0.000239, 'root': '植物-千屈菜科'}]}\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数 （以表格形式展示）\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\n\n### 响应参数\n| 参数名称     | 参数类型    | 描述          | 示例值                                                 |\n|----------|---------|-------------|-----------------------------------------------------|\n| result   | Array[] | 返回结果        | [{\"keyword\":\"苹果\",\"score\":0.961247,\"root\":\"植物-蔷薇科\"}] |\n| +keyword | String  | 图片中的物体或场景名称 | \"苹果\"                                                |\n| +score\t  | Float   | 置信度         | 0.961247                                            |\n| +root\t   | String  | 识别结果的上层标签   | \"植物-蔷薇科\"                                            |\n\n\n### 响应示例\n```json\n{\n    \"result\":[\n        {\n            \"keyword\":\"苹果\",\n            \"score\":0.961247,\n            \"root\":\"植物-蔷薇科\"\n        },\n        {\n            \"keyword\":\"姬娜果\",\n            \"score\":0.740838,\n            \"root\":\"植物-其它\"\n        },\n        {\n            \"keyword\":\"梨子\",\n            \"score\":0.392218,\n            \"root\":\"商品-水果\"\n        },\n        {\n            \"keyword\":\"车厘子\",\n            \"score\":0.193986,\n            \"root\":\"植物-其它\"\n        },\n        {\n            \"keyword\":\"石榴\",\n            \"score\":0.000239,\n            \"root\":\"植物-千屈菜科\"\n        }\n    ]\n}\n```\n### 错误码\n| 错误码 | 描述 |\n|-----|----|\n\n## 高级用法\n目前该模块仅提供基础通用物体与场景识别功能。\n\n## 更新记录和贡献\n* 通用物体及场景识别 (2023-12-08)\n"
  },
  {
    "path": "python/core/components/object_recognize/__init__.py",
    "content": "# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/object_recognize/component.py",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"object recognize component.\"\"\"\n\nimport base64\nimport json\nimport os\n\nfrom appbuilder.core import utils\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.components.object_recognize.model import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nclass ObjectRecognition(Component):\n    r\"\"\"\n       提供通用物体及场景识别能力，即对于输入的一张图片（可正常解码，且长宽比适宜），输出图片中的多\n       个物体及场景标签。\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           object_recognition = appbuilder.ObjectRecognition()\n           with open(\"./object_recognition_test.jepg\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n           print(out.content)\n\n        \"\"\"\n    name = \"object_recognition\"\n    version = \"v1\"\n\n    manifests = [\n        {\n            \"name\": \"object_recognition\",\n            \"description\": \"提供通用物体及场景识别能力，即对于输入的一张图片，输出图片中的多个物体及场景标签。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url,根据该url能够获取图片\"\n                    },\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名,用于生成图片url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        通用物体识别\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作。\n                例如: Message(content={\"raw_image\": b\"...\"}) 或 Message(content={\"url\": \"https://image/download/url\"})。\n            timeout (float, optional): HTTP超时时间，默认为None。\n            retry (int, optional): HTTP重试次数，默认为0。\n        \n        Returns:\n            Message: 模型识别结果。\n                例如: Message(content={\"result\":[{\"keyword\":\"苹果\",\n                    \"score\":0.94553,\"root\":\"植物-蔷薇科\"},{\"keyword\":\"姬娜果\",\"score\":0.730442,\"root\":\"植物-其它\"},\n                    {\"keyword\":\"红富士\",\"score\":0.505194,\"root\":\"植物-其它\"}]})\n        \"\"\"\n        inp = ObjectRecognitionInMsg(**message.content)\n        req = ObjectRecognitionRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        result = self._recognize(req, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = ObjectRecognitionOutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: ObjectRecognitionRequest, timeout: float = None,\n                  retry: int = 0, request_id: str = None) -> ObjectRecognitionResponse:\n        r\"\"\"调用底层接口进行通用物体与场景识别\n                   参数:\n                       request (obj: `ObjectRecognitionRequest`) : 通用物体与场景识别输入参数\n                   返回：\n                       response (obj: `ObjectRecognitionResponse`): 通用物体与场景识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n\n        data = ObjectRecognitionRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v2/advanced_general\")\n        response = self.http_client.session.post(url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id,data)\n        object_response = ObjectRecognitionResponse.from_json(payload=json.dumps(data))\n        object_response.request_id = request_id\n        return object_response\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 通用物体与场景识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool, **kwargs):\n        \"\"\"\n        评估并识别传入图像中的物体或场景。\n        \n        Args:\n            name (str): 调用此方法的对象名称。\n            streaming (bool): 是否以流式方式返回结果。如果是True，则以生成器形式返回结果；如果是False，则直接返回字符串形式的识别结果。\n            **kwargs: 任意关键字参数，支持以下参数：\n                traceid (str, optional): 请求的追踪ID，用于追踪请求处理流程。默认为None。\n                img_url (str, optional): 待识别图像的URL地址。默认为None，如果未指定，则尝试从file_urls和img_name参数中获取图像路径。\n                file_urls (dict, optional): 包含文件名和对应URL的字典。默认为空字典。\n                img_name (str, optional): 待识别图像的文件名。如果img_url未指定，则根据img_name从file_urls中获取图像的URL。默认为None。\n                score_threshold (float, optional): 置信度阈值，低于此阈值的识别结果将被忽略。默认为0.5。\n        \n        Returns:\n            如果streaming为True，则返回一个生成器，生成器中的元素为包含识别结果的字典，字典包含以下键：\n                type (str): 结果类型，固定为\"text\"。\n                text (str): 识别结果的JSON字符串表示。\n                visible_scope (str): 结果的可见范围，'llm'表示仅对LLM可见，'user'表示对用户可见。\n        \n            如果streaming为False，则直接返回识别结果的JSON字符串表示。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误（如未设置文件名或文件URL不存在），则抛出此异常。\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        img_url = kwargs.get(\"img_url\", None)\n        if not img_url:\n            file_urls = kwargs.get(\"file_urls\", {})\n            img_path = kwargs.get(\"img_name\", None)\n            if not img_path:\n                raise InvalidRequestArgumentError(\"request format error, file name is not set\")\n            img_name = os.path.basename(img_path)\n            img_url = file_urls.get(img_name, None)\n            if not img_url:\n                raise InvalidRequestArgumentError(f\"request format error, file {img_name} url does not exist\")\n        score_threshold = kwargs.get(\"score_threshold\", 0.5)\n        req = ObjectRecognitionRequest(url=img_url)\n        result = proto.Message.to_dict(self._recognize(req, request_id=traceid))\n        results = []\n        for item in result[\"result\"]:\n            if item[\"score\"] < score_threshold and len(results) > 0:\n                continue\n            res = {\n                \"物体或场景名称\": item[\"keyword\"],\n                \"置信度\": item[\"score\"],\n                \"所属类别\": item[\"root\"],\n            }\n            results.append(res)\n        res = json.dumps(results, ensure_ascii=False, indent=4)\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": res,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": 'user',\n            }\n        else:\n            return res"
  },
  {
    "path": "python/core/components/object_recognize/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"object recognize client.\"\"\"\nimport proto\n\nfrom typing import List\nfrom pydantic import BaseModel\n\n\n# PB Definition\nclass ObjectRecognitionRequest(proto.Message):\n    r\"\"\"通用物体与场景识别请求体.\n\n        属性:\n            image (str):\n                可选。图像内容的base64编码。\n            url (str):\n                可选。图像的URL地址，经过base64编码。\n                图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n\n        必须设置image或url属性之一，如果两者都设置了，将使用image属性。\n    \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    baike_num: int = proto.Field(\n        proto.INT64,\n        number=3,\n    )\n\n\nclass ObjectRecognitionResponse(proto.Message):\n    \"\"\"通用物体与场景识别响应消息。\n\n        属性:\n            request_id (str): 请求ID。\n            log_id (int): 用于问题识别的唯一日志ID。\n            result_num (int): 结果数量，即结果数组中的元素数量。最多返回5个结果。\n            result (List[ObjectResult]): 物体识别结果列表。\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=2,\n    )\n    result_num: int = proto.Field(\n        proto.UINT32,\n        number=3,\n    )\n    result: 'ObjectResult' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=4,\n        message=\"ObjectResult\",\n    )\n\n\nclass ObjectResult(proto.Message):\n    \"\"\"物体识别信息.\n\n        属性:\n            keyword (str): 图像中物体或场景的名称。\n            score (float): 置信度得分，范围从0到1。\n            root (str): 识别结果中的顶级标签。一些标签，如硬币、动漫、烟草等，可能没有顶级标签。\n            baike_info (List[BaikeInfo]): 与识别结果对应的百科信息列表。\n    \"\"\"\n    keyword: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    score: float = proto.Field(\n        proto.FLOAT,\n        number=2,\n    )\n    root: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    baike_info: 'BaikeInfo' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=4,\n        message=\"BaikeInfo\",\n    )\n\n\nclass BaikeInfo(proto.Message):\n    \"\"\"物体识别百科信息。\n\n           属性:\n               baike_url (str): 与识别结果对应的百度百科页面的URL。\n               image_url (str): 与识别结果相关联的图像的URL。\n               description (str): 百度百科提供的识别结果的描述。\n       \"\"\"\n    baike_url: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    image_url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    description: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass ObjectRecognitionInMsg(BaseModel):\n    \"\"\" 通用物体与场景识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''\n    url: str = \"\"\n\n\nclass Object(BaseModel):\n    \"\"\"物体识别输入消息。\n        属性:\n            keyword(bytes):\n                原始二进制图像数据。\n            score(float):\n                置信度得分，范围从0到1。\n            root(str):\n                识别结果中的顶级标签。\n    \"\"\"\n    keyword: str\n    score: float\n    root: str\n\n\nclass ObjectRecognitionOutMsg(BaseModel):\n    r\"\"\"识别结果列表\"\"\"\n    result: List[Object]  # 结果列表\n"
  },
  {
    "path": "python/core/components/plant_recognize/README.md",
    "content": "# 植物识别（PlantRecognition）\n\n## 简介\n植物识别（PlantRecognition），即对于输入的一张图片（可正常解码，且长宽比较合适），输出植物识别结果。\n\n### 功能介绍\n可识别超过2万种常见植物和近8千种花卉，接口返回植物的名称，并支持获取识别结果对应的百科信息\n\n### 特色优势\n还可使用EasyDL定制训练平台，定制识别植物种类\n\n### 应用场景\n适用于拍照识图、幼教科普、图像内容分析等场景\n\n## 基本用法\n\n下面是植物识别的代码示例：\n\n示例图片为\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder/palnt_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2Faa2217067f78f0236c8262cdd89a4b4f4b2188d971ca547c53d01742af4a2cbe)\n\n```python\nimport os\nimport requests\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/palnt_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2Faa2217067f78f0236c8262cdd89a4b4f4b2188d971ca547c53d01742af4a2cbe\"\n\n# 从BOS存储读取样例文件\nraw_image = requests.get(image_url).content\ninp = appbuilder.Message(content={\"raw_image\": raw_image})\n# inp = Message(content={\"url\": image_url})\n\n# 运行植物识别\nplant_recognize = appbuilder.PlantRecognition()\nout = plant_recognize.run(inp)\n# 打印识别结果\nprint(out.content)  \n\n# {'plant_score_list': [{'name': '榕树', 'score': 0.4230029582977295}, {'name': '榆树', 'score': 0.1273619383573532}, {'name': '美国榆', 'score': 0.12065108865499496}, {'name': '白蜡树', 'score': 0.11650644987821579}, {'name': '雨树', 'score': 0.045340824872255325}]}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n| 参数名称       | 参数类型   | 是否必须 | 描述                          |示例值|\n|------------|--------|------|-----------------------------|---|\n| message    | String | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 ||\n| +content   | Dict   | 是    | 消息内容                        ||\n| +raw_image | String | 否    | 原始图片字节流                     ||\n| +url       | String   | 否    | 图片下载链接地址                    ||\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer| 否    | HTTP重试次数                    |3||\n\n### 响应参数\n| 参数名称             | 参数类型   | 描述     | 示例值                                              |\n|------------------|--------|--------|--------------------------------------------------|\n| plant_score_list | List   | 植物识别列表 |  |\n| name             | String | 植物名    |  |\n| score            | Float  | 植物识别打分 |  |\n\n\n### 响应示例\n```json\n{\n  \"plant_score_list\": [\n    {\n      \"name\": \"榕树\",\n      \"score\": 0.4230029582977295\n    },\n    {\n      \"name\": \"榆树\",\n      \"score\": 0.1273619383573532\n    },\n    {\n      \"name\": \"美国榆\",\n      \"score\": 0.1206519496\n    },\n    {\n      \"name\": \"白蜡树\",\n      \"score\": 0.11650644987821579\n    },\n    {\n      \"name\": \"雨树\",\n      \"score\": 0.045340824872255325\n    }\n  ]\n}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 高级用法\n目前该模块仅提供基础的植物识别。\n\n\n## 更新记录和贡献\n* 植物识别 (2024-01)"
  },
  {
    "path": "python/core/components/plant_recognize/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/plant_recognize/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"植物识别组件\"\"\"\nimport base64\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.plant_recognize.model import *\nfrom typing import Generator, Union\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .model import TOP_NUM, BAIKE_NUM\n\n\n\nclass PlantRecognition(Component):\n    r\"\"\"\n    植物识别组件，即对于输入的一张图片（可正常解码，且长宽比适宜），输出图片中的植物识别结果\n\n    Examples:\n\n    .. code-block:: python\n    \n        import os\n        import requests\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"GATEWAY_URL\"] = \"...\"\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/palnt_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2Faa2217067f78f0236c8262cdd89a4b4f4b2188d971ca547c53d01742af4a2cbe\"\n\n        # 从BOS存储读取样例文件\n        raw_image = requests.get(image_url).content\n        inp = appbuilder.Message(content={\"raw_image\": raw_image})\n        # inp = Message(content={\"url\": image_url})\n\n        # 运行植物识别\n        plant_recognize = appbuilder.PlantRecognition()\n        out = plant_recognize.run(inp)\n        # 打印识别结果\n        print(out.content)\n     \"\"\"\n    name = \"plant_rec\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"plant_rec\",\n            \"description\": \"用于识别图片中植物类别\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名\"\n                    },\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        输入图片并识别其中的植物\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作. 举例: Message(content={\"raw_image\": b\"...\"})\n            或 Message(content={\"url\": \"https://image/download/uel\"}).\n            timeout (float, optional): HTTP超时时间，默认为None\n            retry (int, optional): HTTP重试次数，默认为0\n        \n        Returns:\n            Message: 模型识别结果\n        \"\"\"\n        inp = PlantRecognitionInMsg(**message.content)\n        request = PlantRecognitionRequest()\n        if inp.url:\n            request.url = inp.url\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        request.top_num = 5\n        request.baike_num = 0\n        response = self.__recognize(request, timeout, retry)\n        plant_score_list = []\n        [plant_score_list.append(PlantScore(name=plant.name, score=plant.score)) for plant in response.result]\n        out = PlantRecognitionOutMsg(plant_score_list=plant_score_list)\n        return Message(content=out.model_dump())\n\n    def __recognize(\n        self,\n        request: PlantRecognitionRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> PlantRecognitionResponse:\n        r\"\"\"调用底层接口植物识别\n\n            参数:\n                request (obj: `PlantRecognitionRequest`) : 植物识别输入参数\n\n            返回：\n                response (obj: `PlantRecognitionResponse`): 植物识别返回结果\n        \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        data = PlantRecognitionRequest.to_dict(request)\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/plant\")\n        response = self.http_client.session.post(url, data=data, timeout=timeout, headers=headers)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__.__check_service_error(request_id, data)\n        return PlantRecognitionResponse(data, request_id=request_id)\n\n    @components_run_stream_trace\n    def tool_eval(\n        self, \n        name: str, \n        streaming: bool,\n        origin_query: str,\n        **kwargs,\n    ) -> Union[Generator[str, None, None], str]:\n        \"\"\"\n        用于工具的执行，通过调用底层接口进行植物识别\n        \n        Args:\n            name (str): 工具名\n            streaming (bool): 是否流式返回\n            origin_query (str): 用户原始query\n            **kwargs: 工具调用的额外关键字参数\n        \n        Returns:\n            Union[Generator[str, None, None], str]: 植物识别结果，包括识别出的植物类别和相应的置信度信息\n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        img_name = kwargs.get(\"img_name\", \"\")\n        img_url = kwargs.get(\"img_url\", \"\")\n        file_urls = kwargs.get(\"file_urls\", {})\n        rec_res = self._recognize_w_post_process(img_name, img_url, file_urls, request_id=traceid)\n        if streaming:\n            yield rec_res\n        else:\n            return rec_res\n\n    def _recognize_w_post_process(self, img_name, img_url, file_urls, request_id=None):\n        r\"\"\"调底层接口对图片或图片url进行植物识别，并返回类别及其置信度\n            参数:\n               img_name (str): 图片文件名\n               img_url (str): 图片url\n               file_urls (dict): 文件名与对应文件url的映射\n            返回：\n               str: 植物识别结果，包括识别出的动物类别和相应的置信度信息\n         \"\"\"\n        req = PlantRecognitionRequest()\n        if img_name in file_urls:\n            req.url = file_urls[img_name]\n        if img_url:\n            if img_url in file_urls:\n                img_url = file_urls[img_url]\n            req.url = img_url\n        req.top_num = TOP_NUM\n        req.baike_num = BAIKE_NUM\n        result = self.__recognize(req, request_id=request_id)\n        result_dict = proto.Message.to_dict(result)\n        rec_res = \"模型识别结果为：\\n\"\n        for rec_info in result_dict['result']:\n            rec_res += \"类别: {} 置信度: {}\\n\".format(rec_info['name'], rec_info['score'])\n        return rec_res\n\n    @staticmethod\n    def __check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n\n            参数:\n                request (dict) : 地标识别body返回\n            返回：\n                无\n        \"\"\"\n\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n\n"
  },
  {
    "path": "python/core/components/plant_recognize/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"植物识别数据类\"\"\"\n\nfrom typing import List\n\nimport proto\nfrom pydantic import BaseModel\n\n\nTOP_NUM = 1\nBAIKE_NUM = 0\n\nclass PlantBaikeInfo(proto.Message):\n    \"\"\"\n    植物百度百科信息\n\n    属性:\n        baike_url (str): 百度百科页面URL\n        image_url (str): 百度百科中的图像URL\n        description (str): 百度百科中的描述信息\n    \"\"\"\n    baike_url: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    image_url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    description: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass Plant(proto.Message):\n    \"\"\"\n    植物识别结果\n\n    属性:\n        name(str): 植物名称\n        score(float): 置信度\n        baike_info (List[PlantBaikeInfo]): 植物百科信息\n    \"\"\"\n    name: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    score: float = proto.Field(\n        proto.FLOAT,\n        number=2,\n    )\n    baike_info = proto.RepeatedField(\n        PlantBaikeInfo,\n        number=3,\n    )\n\n\nclass PlantRecognitionRequest(proto.Message):\n    r\"\"\"植物识别请求参数\n\n         属性:\n             image (str, 可选): 图像base64编码结果，支持jpg/png/bmp格式\n             url (str, 可选): 图像下载链接，base64编码后结果小于4MB, 短边大于15px，长边小于4096px\n             如果image存在，url字段则自动失效\n             top_num(int，可选): 返回得分较高的结果\n             baike_num(int，可选): 返回百科信息的个数\n\n         \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    top_num: int = proto.Field(\n        proto.INT64,\n        number=3,\n    )\n    baike_num: int = proto.Field(\n        proto.INT64,\n        number=4,\n    )\n\n\nclass PlantRecognitionResponse(proto.Message):\n    r\"\"\"植物识别返回结果\n\n        属性:\n             log_id (int): 随机日志ID\n             request_id(str): 请求链路ID\n             result (List[Plant]): 识别植物列表信息\n    \"\"\"\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=1,\n    )\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    result = proto.RepeatedField(\n        Plant,\n        number=3,\n    )\n\n\nclass PlantRecognitionInMsg(BaseModel):\n    \"\"\" 植物识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''\n    url: str = \"\"\n\n\nclass PlantScore(BaseModel):\n    \"\"\" 植物识别输出消息\n        属性:\n            name(str): 植物名\n            score(float): 识别分数\n      \"\"\"\n    name: str\n    score: float\n\n\nclass PlantRecognitionOutMsg(BaseModel):\n    \"\"\" 植物识别输出消息\n        属性:\n            PlantScores(List[PlantScore]): 植物识别结果列表\n    \"\"\"\n    plant_score_list: List[PlantScore]\n"
  },
  {
    "path": "python/core/components/ppt_generation_from_file/README.md",
    "content": "# 文件生成PPT（PPTGenerationFromFile）\n\n## 简介\n文件生成PPT组件（PPTGenerationFromFile）可以根据上传的文件（支持**中英文**）生成PPT。\n\n### 功能介绍\n根据上传的文件（支持**中英文**）生成PPT。\n\n### 特色优势\n可根据文件（支持**中英文**）生成高质量PPT。\n\n### 应用场景\nPPT生成。\n\n## 基本用法\n### 快速开始\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ['APPBUILDER_TOKEN'] = '...'\n\n\nppt_generator = appbuilder.PPTGenerationFromFile()\n\nuser_input = {\n    'file_url':'http://image.yoojober.com/users/chatppt/temp/2024-06/6672a92c87e6f.doc',\n    'user_name':'百度千帆AppBuilder'\n}\nresult = ppt_generator(appbuilder.Message(user_input))\nprint(result.content)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ['APPBUILDER_TOKEN'] = 'bce-YOURTOKEN'\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入消息，用于模型的主要输入内容。 | Message(content=input_data) |\n| `poll_request_times` | int | 否 | 轮询请求结果次数。默认为60。 | 60 |\n| `poll_request_interval` | int | 否 | 轮询请求的间隔时间（秒）。默认为5。 | 5 |\n\n其中message包含的input_data包括以下参数：\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `file_url` | str | 是 | 文件链接。 | http://image.yoojober.com/users/chatppt/temp/2024-06/6672a92c87e6f.doc |\n| `user_name` | str | 否 | 作者名。 | 百度千帆AppBuilder |\n\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果，包含PPT下载链接。 | Message(content='...') |\n\n### 响应示例\n```\nhttps://download.yoojober.com/chatppt_business/2024-07/d1a1ab518ebcfbba7908a6734fa11d13.pptx?e=1721964933&token=8_2qFlGEVQZPpFvHdGR6gg2t9A9QZfWT9wwTl92s:9bs8LWV1SQLJNJoJgtd-sLF-CTw=\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.8.1\n#### [Added]\n- 增加文件生成PPT组件。\n- 增加文件生成PPT组件单元测试。"
  },
  {
    "path": "python/core/components/ppt_generation_from_file/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/ppt_generation_from_file/base.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\nfrom pydantic import Field\nfrom enum import Enum\n\nfrom appbuilder.core.component import ComponentArguments\n\n\n\nDEFAULT_AUTHOR = '百度千帆AppBuilder'\n\nclass PPTGenerationFromFileArgs(ComponentArguments):\n    \"\"\"论文生成PPT组件配置\n    \"\"\"\n    file_url: str = Field(...,\n                          valiable_name='file_url',\n                          description='文件链接。')\n    user_name: str = Field(default=None,\n                           variable_name='user_name',\n                           description='作者。')\n    \n    def convert_params_to_dict(self):\n        \"\"\"输出参数字典\n        \"\"\"\n        output_dict = {}\n        for k, v in self.model_dump().items():\n            if k in self.model_fields and \\\n                    self.model_fields[k].json_schema_extra and \\\n                    v is not None:\n                if isinstance(v, Enum):\n                    output_dict[k] = v.value\n                else:\n                    output_dict[k] = v\n        return output_dict"
  },
  {
    "path": "python/core/components/ppt_generation_from_file/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\nimport traceback\nimport time\n\nfrom typing import Optional\n\nfrom .base import PPTGenerationFromFileArgs, DEFAULT_AUTHOR\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.utils.logger_util import logger\n\n\nclass PPTGenerationFromFile(Component):\n    \"\"\"\n    文件生成PPT。\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        ppt_generator = appbuilder.PPTGenerationFromFile()\n        user_input = {\n            'file_url': 'http://image.yoojober.com/users/chatppt/temp/2024-06/6672aa839a9da.docx'\n        }\n        answer = ppt_generator(appbuilder.Message(user_input))\n        print(answer.content)\n    \"\"\"\n    uniform_prefix = '/api/v1/component/component'\n    ppt_generation_url = '/ppt/text2ppt/apps/ppt-create-file'\n    get_ppt_generation_status_url = '/ppt/text2ppt/apps/ppt-result'\n    get_ppt_download_link_url = '/ppt/text2ppt/apps/ppt-download'\n\n    name = 'ppt_generation_from_file'\n    version: str\n    meta = PPTGenerationFromFileArgs\n\n    manifests = [\n        {\n            \"name\": \"ppt_generation_from_file\",\n            \"description\": \"根据上传的文件（非论文）生成PPT。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"用户上传的文件的链接。\"\n                    }\n                },\n                \"required\": [\n                    \"file_url\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        secret_key: Optional[str] = None,\n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化论文生成PPT组件。\n        \n        Args:\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \"\"\"\n        super().__init__(PPTGenerationFromFileArgs,\n                         secret_key=secret_key,\n                         gateway=gateway,\n                         lazy_certification=lazy_certification)\n        self.x_alternative_authorization = None\n\n    def ppt_generation(self,\n                       post_data: dict,\n                       timeout: float = None):\n        \"\"\"\n        创建PPT生成任务\n        \n        Args:\n            post_data (dict): 包含PPT生成任务所需数据的字典\n            timeout (float, optional): 请求超时时间，默认为None，表示不设置超时时间。\n        \n        Returns:\n            str: PPT生成任务的Job ID\n        \n        Raises:\n            Exception: 如果PPT生成任务请求失败，抛出异常\n        \n        \"\"\"\n        url = self.http_client.service_url(self.ppt_generation_url, self.uniform_prefix)\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n        response = self.http_client.session.post(url,\n                                                 json=post_data,\n                                                 headers=headers,\n                                                 timeout=timeout)\n        self.http_client.check_response_header(response)\n        resp_data = response.json()\n        if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n            error_msg = f'[ppt_generation] PPT generation request error! response: {resp_data}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        job_id = resp_data['data']['id']\n        return job_id\n\n    def get_ppt_generation_status(self,\n                                  job_id: str,\n                                  request_times: int = 60,\n                                  request_interval: int = 5,\n                                  timeout: float = None):\n        \"\"\"\n        轮询查看PPT生成状态\n        \n        Args:\n            job_id (str): PPT生成任务的唯一标识符\n            request_times (int, optional): 轮询请求次数，默认为60次。\n            request_interval (int, optional): 每次轮询请求的间隔时间（秒），默认为5秒。\n            timeout (float, optional): 请求的超时时间（秒），默认为None，即无超时限制。\n        \n        Returns:\n            int: PPT生成状态码，1表示正在生成，2表示生成完成，3表示生成失败。\n        \n        Raises:\n            Exception: 如果PPT生成状态码不为2（生成完成），则抛出异常。\n        \"\"\"\n        url = self.http_client.service_url(self.get_ppt_generation_status_url, self.uniform_prefix) + f'?id={job_id}'\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n\n        status = -1\n        for _ in range(request_times):\n            response = self.http_client.session.get(url,\n                                                    headers=headers,\n                                                    timeout=timeout)\n            try:\n                self.http_client.check_response_header(response)\n            except:\n                error_msg = f'[get_ppt_generation_status] ERROR!\\n{traceback.format_exc()}'\n                logger.error(error_msg)\n                time.sleep(request_interval)\n                continue\n            self.http_client.check_response_header(response)\n\n            resp_data = response.json()\n            if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n                error_msg = f'[get_ppt_generation_status] Get PPT generation status error! job_id: {job_id}, ' \\\n                            f'response: {resp_data}'\n                logger.error(error_msg)\n                raise Exception(error_msg)\n            status = resp_data['data']['status']\n            if status == 1:\n                # 正在生成\n                time.sleep(request_interval)\n            elif status == 2:\n                # 生成完成\n                break\n            elif status == 3:\n                # 生成失败\n                raise Exception(f'[get_ppt_generation_status] PPT generation Fail! job_id: {job_id}')\n        \n        if status == 1:\n            error_msg = f'[get_ppt_generation_status] PPT generation timeout! job_id: {job_id}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        elif status == -1:\n            error_msg = f'[get_ppt_generation_status] Request fail! job_id: {job_id}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n\n        return status\n\n    def get_ppt_download_link(self,\n                              job_id: str,\n                              timeout: float = None):\n        \"\"\"\n        获取PPT下载链接\n        \n        Args:\n            job_id (str): 任务ID\n            timeout (float, optional): 请求超时时间，默认为None。\n        \n        Returns:\n            str: PPT下载链接\n        \n        Raises:\n            Exception: PPT生成请求错误\n        \n        \"\"\"\n        url = self.http_client.service_url(self.get_ppt_download_link_url, self.uniform_prefix) + f'?id={job_id}'\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n        response = self.http_client.session.get(url,\n                                                headers=headers,\n                                                timeout=timeout)\n        self.http_client.check_response_header(response)\n        resp_data = response.json()\n        if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n            error_msg = f'[get_ppt_download_link] PPT generation request error! response: {resp_data}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        download_link = resp_data['data']['download_url']\n        return download_link\n    \n    def run(self, message: Message, poll_request_times=60, poll_request_interval=5) -> Message:\n        \"\"\"使用给定的输入运行模型并返回结果。\n\n        Args:\n            message (Message): 输入消息，用于传入请求参数。\n            poll_request_times (int): 轮询请求结果次数。\n            poll_request_interval (int): 轮询请求的间隔时间（秒）。\n\n        Returns:\n            result (Message): 模型运行后的输出消息。\n        \"\"\"\n        # 参数检查与设置\n        user_input = message.content\n        for key in ['file_url']:\n            if key not in user_input:\n                raise Exception(f'[PPTGenerationFromFile] Missing key: {key}')\n        if user_input.get('user_name', '') is None or not user_input.get('user_name', '').strip():\n            user_input['user_name'] = DEFAULT_AUTHOR\n        user_input = self.meta(**{k: v for k, v in user_input.items() if v is not None})\n        user_input = user_input.convert_params_to_dict()\n        \n        # 创建PPT生成任务\n        logger.info('Creating a PPT generation task...')\n        job_id = self.ppt_generation(user_input)\n        logger.info('Creating a PPT generation task succeeds.')\n        \n        # 查询PPT生成状态\n        logger.info('Generating PPT...')\n        status = self.get_ppt_generation_status(job_id,\n                                                request_times=poll_request_times,\n                                                request_interval=poll_request_interval)\n        logger.info('PPT generation task completed.')\n        \n        # 获取PPT下载链接\n        logger.info('Getting PPT download link...')\n        ppt_download_link = self.get_ppt_download_link(job_id)\n        logger.info('Getting PPT download link succeeds.')\n\n        return Message(ppt_download_link)\n\n    def tool_eval(self, stream: bool = False, **kwargs):\n        \"\"\"\n        用于执行function call的功能。\n        \n        Args:\n            stream (bool, optional): 是否以生成器的方式返回结果，默认为False。\n            **kwargs: 任意关键字参数，目前只支持'file_url'。\n        \n        Returns:\n            如果stream为False，则返回一个字符串，表示ppt下载链接。\n            如果stream为True，则返回一个生成器，生成器产生一个字符串，表示ppt下载链接。\n        \n        Raises:\n            ValueError: 如果'file_url'为空，则抛出异常。\n        \n        \"\"\"\n        file_url = kwargs.get('file_url', '')\n        if not file_url:\n            raise ValueError('param `file_url` should not be empty.')\n        user_input = {\n            'file_url': file_url\n        }\n\n        message = Message(user_input)\n        result = self.run(message,\n                          poll_request_times=60,\n                          poll_request_interval=5)\n\n        ppt_download_link = result.content\n\n        if stream:\n            yield ppt_download_link\n        else:\n            return ppt_download_link"
  },
  {
    "path": "python/core/components/ppt_generation_from_instruction/README.md",
    "content": "# 指令生成PPT（PPTGenerationFromInstruction）\n\n## 简介\n指令生成PPT组件（PPTGenerationFromInstruction）可以基于指令或者自定义信息生成PPT。\n\n### 功能介绍\n基于指令或者自定义信息生成PPT。\n\n### 特色优势\n- 可生成高质量PPT。\n- 支持传入自定义信息生成PPT。\n- 生成PPT复杂度可控。\n\n### 应用场景\nPPT生成。\n\n## 基本用法\n### 快速开始\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ['APPBUILDER_TOKEN'] = '...'\n\n\nppt_generator = appbuilder.PPTGenerationFromInstruction()\n\nuser_input = {\n    'text': '生成一个介绍北京的PPT。',\n    'custom_data': {},\n    'complex': 1,\n    'user_name': '百度千帆AppBuilder'\n}\nresult = ppt_generator(appbuilder.Message(user_input))\nprint(result.content)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ['APPBUILDER_TOKEN'] = 'bce-YOURTOKEN'\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入消息，用于模型的主要输入内容。 | Message(content=input_data) |\n| `poll_request_times` | int | 否 | 轮询请求结果次数。默认为60。 | 60 |\n| `poll_request_interval` | int | 否 | 轮询请求的间隔时间（秒）。默认为5。 | 5 |\n\n其中message包含的input_data包括以下参数：\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `text` | str | 是 | 请求生成PPT的query。可为空字符串\"\"，与custom_data有一个参数不为空即可。 | 请你生成一个介绍北京的PPT。 |\n| `custom_data` | obj | 是 | 自定义参数，可指定标题、副标题、作者、结构等信息。可为空字典{}，与text有一个参数不为空即可。 | `{\"title\": \"标题\", \"sub_title\": \"副标题\", \"author\": \"作者\", \"catalogs\": [{\"catalog\": \"一级大纲1\", \"sub_catalog\": [\"一级大纲1-二级大纲1\"]}, {\"catalog\": \"一级大纲2\", \"sub_catalog\": [\"一级大纲2-二级大纲1\"]}], \"contents\": [{\"catalog_index\": 0, \"sub_catalog_index\": 0, \"content\": [\"一级大纲1-二级大纲1-内容1\", \"一级大纲1-二级大纲1-内容2\"]}, {\"catalog_index\": 1, \"sub_catalog_index\": 0, \"content\": [{\"key\": \"一级大纲2-二级大纲1-小标题1\", \"value\": \"一级大纲2-二级大纲1-子内容1\"}, {\"key\": \"一级大纲2-二级大纲1-小标题2\", \"value\": \"一级大纲2-二级大纲1-子内容2\"}, {\"key\": \"一级大纲2-二级大纲1-小标题3\", \"value\": \"一级大纲2-二级大纲1-子内容3\"}], \"picture\": [\"https://image.yoojober.com/chatppt_business/2024-02/000114cd07b809cb8c6bb22674e814da.png\"]}]}` |\n| `complex` | integer | 否 | PPT复杂度，可选：1、2、3，其中1最简单、3最复杂。 | 1 |\n| `font_name` | str | 否 | PPT字体，可选：黑体、宋体、仿宋、幼圆、楷体、隶书。 | 黑体 |\n| `user_name` | str | 否 | 作者名。 | 百度千帆AppBuilder |\n\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果，包含PPT下载链接。 | Message(content='...') |\n\n### 响应示例\n```\nhttps://download.yoojober.com/chatppt_business/2024-07/bf2af50285e52261507abdd7385e02c4.pptx?e=1721964536&token=8_2qFlGEVQZPpFvHdGR6gg2t9A9QZfWT9wwTl92s:nikgRM9RbPxzClBvmKrweeKd9Ck=\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.8.1\n#### [Added]\n- 增加指令生成PPT组件。\n- 增加指令生成PPT组件单元测试。"
  },
  {
    "path": "python/core/components/ppt_generation_from_instruction/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/ppt_generation_from_instruction/base.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\nfrom pydantic import Field\nfrom enum import Enum\n\nfrom appbuilder.core.component import ComponentArguments\n\n\nDEFAULT_AUTHOR = '百度千帆AppBuilder'\n\nclass ComplexChoices(Enum):\n    easy = 1\n    medium = 2\n    complex = 3\n\n\nclass FontNameChoices(Enum):\n    HeiTi = '黑体'\n    SongTi = '宋体'\n    FangSong = '仿宋'\n    YouYuan = '幼圆'\n    KaiTi = '楷体'\n    LiShu = '隶书'\n\n\nclass PPTGenerationFromInstructionArgs(ComponentArguments):\n    \"\"\"PPT生成组件配置\n    \"\"\"\n    text: str = Field(...,\n                      valiable_name='text',\n                      description='请求生成PPT的query。')\n    custom_data: dict = Field(...,\n                              valiable_name='custom_data',\n                              description='自定义参数，可指定标题、副标题等信息。')\n    complex: ComplexChoices = Field(default=None,\n                                    variable_name='complex',\n                                    description='生成PPT的复杂度，可选：1、2、3，分别对应简单、中等、复杂。默认是1。')\n    font_name: FontNameChoices = Field(default=None,\n                                       variable_name='font_name',\n                                       description='字体，可选：黑体、宋体、仿宋、幼圆、楷体、隶书。')\n    user_name: str = Field(default=None,\n                           variable_name='user_name',\n                           description='PPT作者名。')\n\n    def convert_params_to_dict(self):\n        \"\"\"输出参数字典\n        \"\"\"\n        output_dict = {}\n        for k, v in self.model_dump().items():\n            if k in self.model_fields and \\\n                    self.model_fields[k].json_schema_extra and \\\n                    v is not None:\n                if isinstance(v, Enum):\n                    output_dict[k] = v.value\n                else:\n                    output_dict[k] = v\n        return output_dict"
  },
  {
    "path": "python/core/components/ppt_generation_from_instruction/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\nimport traceback\nimport time\n\nfrom typing import Optional\n\nfrom .base import PPTGenerationFromInstructionArgs, DEFAULT_AUTHOR\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.utils.logger_util import logger\n\n\nclass PPTGenerationFromInstruction(Component):\n    \"\"\"\n    指令生成PPT，可通过传入对PPT的描述或者自定义参数进行生成。\n\n    Examples:\n\n        .. code-block:: python\n\n            import os\n            import appbuilder\n\n            os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n            ppt_generator = appbuilder.PPTGenerationFromInstruction()\n            input_data = {\n                'text': '生成一个介绍北京的PPT。',\n                'custom_data': {},\n                'complex': 3,\n                'user_name': '百度千帆AppBuilder'\n            }\n            answer = ppt_generator(appbuilder.Message(input_data))\n            print(answer.content)\n    \"\"\"\n    uniform_prefix = '/api/v1/component/component'\n    ppt_generation_url = '/ppt/text2ppt/apps/ppt-create'\n    get_ppt_generation_status_url = '/ppt/text2ppt/apps/ppt-result'\n    get_ppt_download_link_url = '/ppt/text2ppt/apps/ppt-download'\n\n    name = 'ppt_generation_from_instruction'\n    version: str\n    meta = PPTGenerationFromInstructionArgs\n\n    manifests = [\n        {\n            \"name\": \"ppt_generation_from_instruction\",\n            \"description\": \"根据输入指令生成PPT。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"text\": {\n                        \"type\": \"string\",\n                        \"description\": \"用户请求生成PPT的指令。\",\n                        \"example\": \"生成一个介绍北京的PPT。\"\n                    }\n                },\n                \"required\": [\n                    \"text\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        secret_key: Optional[str] = None,\n        gateway: str = '',\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化PPT生成组件。\n        \n        Args:\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \"\"\"\n        super().__init__(PPTGenerationFromInstructionArgs,\n                         secret_key=secret_key,\n                         gateway=gateway,\n                         lazy_certification=lazy_certification)\n        self.x_alternative_authorization = None\n\n    def ppt_generation(self,\n                       post_data: dict,\n                       timeout: float = None):\n        \"\"\"\n        创建PPT生成任务\n        \n        Args:\n            post_data (dict): 请求数据\n            timeout (float, optional): 请求超时时间，默认为None.\n        \n        Returns:\n            str: 任务ID\n        \n        Raises:\n            Exception: PPT生成请求失败\n        \n        \"\"\"\n        url = self.http_client.service_url(self.ppt_generation_url, self.uniform_prefix)\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n        response = self.http_client.session.post(url,\n                                                 json=post_data,\n                                                 headers=headers,\n                                                 timeout=timeout)\n        self.http_client.check_response_header(response)\n        resp_data = response.json()\n        if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n            error_msg = f'[ppt_generation] PPT generation request error! response: {resp_data}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        job_id = resp_data['data']['id']\n        return job_id\n\n    def get_ppt_generation_status(self,\n                                  job_id: str,\n                                  request_times: int = 60,\n                                  request_interval: int = 5,\n                                  timeout: float = None):\n        \"\"\"\n        轮询查看PPT生成状态\n        \n        Args:\n            job_id (str): PPT生成任务的唯一标识符\n            request_times (int, optional): 轮询请求的次数，默认为60次。\n            request_interval (int, optional): 每次轮询请求之间的间隔时间（秒），默认为5秒。\n            timeout (float, optional): 请求的超时时间（秒）。如果未设置，则使用http_client的默认超时时间。\n        \n        Returns:\n            int: PPT生成状态码。\n                - 1：正在生成\n                - 2：生成完成\n                - 3：生成失败\n        \n        Raises:\n            Exception: PPT生成过程中出现异常时抛出。\n        \n        \"\"\"\n        url = self.http_client.service_url(self.get_ppt_generation_status_url, self.uniform_prefix) + f'?id={job_id}'\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n\n        status = -1\n        for _ in range(request_times):\n            response = self.http_client.session.get(url,\n                                                    headers=headers,\n                                                    timeout=timeout)\n            try:\n                self.http_client.check_response_header(response)\n            except:\n                error_msg = f'[get_ppt_generation_status] ERROR!\\n{traceback.format_exc()}'\n                logger.error(error_msg)\n                time.sleep(request_interval)\n                continue\n            self.http_client.check_response_header(response)\n\n            resp_data = response.json()\n            if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n                error_msg = f'[get_ppt_generation_status] Get PPT generation status error! job_id: {job_id}, ' \\\n                            f'response: {resp_data}'\n                logger.error(error_msg)\n                raise Exception(error_msg)\n            status = resp_data['data']['status']\n            if status == 1:\n                # 正在生成\n                time.sleep(request_interval)\n            elif status == 2:\n                # 生成完成\n                break\n            elif status == 3:\n                # 生成失败\n                raise Exception(f'[get_ppt_generation_status] PPT generation Fail! job_id: {job_id}')\n        \n        if status == 1:\n            error_msg = f'[get_ppt_generation_status] PPT generation timeout! job_id: {job_id}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        elif status == -1:\n            error_msg = f'[get_ppt_generation_status] Request fail! job_id: {job_id}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n\n        return status\n\n    def get_ppt_download_link(self,\n                              job_id: str,\n                              timeout: float = None):\n        \"\"\"\n        获取PPT下载链接\n        \n        Args:\n            job_id (str): 作业ID\n            timeout (float, optional): 请求超时时间，默认为None。\n        \n        Returns:\n            str: PPT下载链接\n        \n        Raises:\n            Exception: 当PPT生成请求失败时抛出异常\n        \"\"\"\n        url = self.http_client.service_url(self.get_ppt_download_link_url, self.uniform_prefix) + f'?id={job_id}'\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n        response = self.http_client.session.get(url,\n                                                headers=headers,\n                                                timeout=timeout)\n        self.http_client.check_response_header(response)\n        resp_data = response.json()\n        if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n            error_msg = f'[get_ppt_download_link] PPT generation request error! response: {resp_data}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        download_link = resp_data['data']['download_url']\n        return download_link\n    \n    def run(self, message: Message, poll_request_times=60, poll_request_interval=5) -> Message:\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (Message): 输入消息，用于传入请求参数。\n            poll_request_times (int, optional): 轮询请求结果次数，默认为60。\n            poll_request_interval (int, optional): 轮询请求的间隔时间（秒），默认为5。\n        \n        Returns:\n            Message: 模型运行后的输出消息，包含PPT下载链接。\n        \n        \"\"\"\n        # 参数检查与设置\n        user_input = message.content\n        for key in ['text', 'custom_data']:\n            if key not in user_input:\n                raise Exception(f'[PPTGeneration] Missing key: {key}')\n        if user_input['custom_data']:\n            author = user_input['custom_data'].get('author', '')\n            if author is None or not author.strip():\n                user_input['custom_data']['author'] = DEFAULT_AUTHOR\n        if user_input.get('user_name', '') is None or not user_input.get('user_name', '').strip():\n            user_input['user_name'] = DEFAULT_AUTHOR\n        user_input = self.meta(**{k: v for k, v in user_input.items() if v is not None})\n        user_input = user_input.convert_params_to_dict()\n        \n        # 创建PPT生成任务\n        logger.info('Creating a PPT generation task...')\n        job_id = self.ppt_generation(user_input)\n        logger.info('Creating a PPT generation task succeeds.')\n        \n        # 查询PPT生成状态\n        logger.info('Generating PPT...')\n        status = self.get_ppt_generation_status(job_id,\n                                                request_times=poll_request_times,\n                                                request_interval=poll_request_interval)\n        logger.info('PPT generation task completed.')\n        \n        # 获取PPT下载链接\n        logger.info('Getting PPT download link...')\n        ppt_download_link = self.get_ppt_download_link(job_id)\n        logger.info('Getting PPT download link succeeds.')\n\n        return Message(ppt_download_link)\n\n    def tool_eval(self, stream: bool = False, **kwargs):\n        \"\"\"\n        评估给定的文本内容。\n        \n        Args:\n            stream (bool, optional): 是否以生成器形式返回结果，默认为False。如果为True，则逐个生成下载链接；如果为False，则直接返回下载链接。\n            **kwargs: 关键字参数，可以传递其他参数，但当前只使用 'text' 参数。\n        \n        Returns:\n            如果 stream 为 False，则返回一个包含下载链接的字符串；如果 stream 为 True，则逐个生成下载链接。\n        \n        Raises:\n            ValueError: 如果 'text' 参数为空，则抛出此异常。\n        \n        \"\"\"\n        text = kwargs.get('text', '')\n        if not text:\n            raise ValueError('param `text` should not be empty.')\n        user_input = {\n            'text': text,\n            'custom_data': {}\n        }\n\n        message = Message(user_input)\n        result = self.run(message,\n                          poll_request_times=60,\n                          poll_request_interval=5)\n        ppt_download_link = result.content\n\n        if stream:\n            yield ppt_download_link\n        else:\n            return ppt_download_link"
  },
  {
    "path": "python/core/components/ppt_generation_from_paper/README.md",
    "content": "# 论文生成PPT（PPTGenerationFromPaper）\n\n## 简介\n论文生成PPT组件（PPTGenerationFromPaper）可以根据上传的论文（支持**中英文**）生成PPT。\n\n### 功能介绍\n根据上传的论文（支持**中英文**）生成PPT。\n\n### 特色优势\n可根据论文（支持**中英文**）生成高质量PPT。\n\n### 应用场景\nPPT生成。\n\n## 基本用法\n### 快速开始\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ['APPBUILDER_TOKEN'] = '...'\n\n\nppt_generator = appbuilder.PPTGenerationFromPaper()\n\nuser_input = {\n    'file_key': 'http://image.yoojober.com/users/chatppt/temp/2024-06/6672aa839a9da.docx',\n    'style': '科技',\n    'color': '蓝色',\n    'title': '',\n    'pleader': '百度千帆AppBuilder',\n    'advisor': '百度千帆AppBuilder',\n    'school': '北京大学',\n    'school_logo': '',\n    'school_picture': ''\n}\nresult = ppt_generator(appbuilder.Message(user_input))\nprint(result.content)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ['APPBUILDER_TOKEN'] = 'bce-YOURTOKEN'\n```\n\n### 初始化参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `secret_key` | str | 否 | 用户鉴权token，默认从环境变量中获取: `os.getenv(\"APPBUILDER_TOKEN\", \"\")` | bce-v3/XXX |\n| `gateway` | str | 否 | 后端网关服务地址，默认从环境变量中获取: `os.getenv(\"GATEWAY_URL\", \"\")` | https://appbuilder.baidu.com |\n| `lazy_certification` | bool | 否 | 延迟认证，为True时在第一次运行时认证。默认为False。 | False |\n\n### 调用参数\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `message` | obj | 是 | 输入消息，用于模型的主要输入内容。 | Message(content=input_data) |\n| `poll_request_times` | int | 否 | 轮询请求结果次数。默认为60。 | 60 |\n| `poll_request_interval` | int | 否 | 轮询请求的间隔时间（秒）。默认为5。 | 5 |\n\n其中message包含的input_data包括以下参数：\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- | -------- |\n| `file_key` | str | 是 | 论文链接。 | http://image.yoojober.com/users/chatppt/temp/2024-06/6672aa839a9da.docx |\n| `style` | str | 否 | PPT风格，可选：科技、商务、小清新、可爱卡通、中国风、极简、党政。 | 科技 |\n| `color` | str | 否 | PPT主色调。可选：紫色、红色、橙色、黄色、绿色、青色、蓝色、粉色。 | 紫色 |\n| `title` | str | 否 | 自定义标题。优先使用自定义标题，如果为空则使用解析结果中的标题。 | 论文分享 |\n| `pleader` | str | 否 | 汇报人。 | 百度千帆AppBuilder |\n| `advisor` | str | 否 | 指导教师。 | 百度千帆AppBuilder |\n| `school` | str | 否 | 学校名称。 | 北京大学 |\n| `school_logo` | str | 否 | 学校logo链接。 |  |\n| `school_picture` | str | 否 | 学校图片链接。 |  |\n\n\n### 响应参数\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n| ------- | ------- | -------- | -------- |\n| `result` | obj | 模型运行后的输出结果，包含PPT下载链接。 | Message(content='...') |\n\n### 响应示例\n```\nhttps://download.yoojober.com/chatppt_business/2024-07/6f472b65ee324d2da7849b6003a896e3.pptx?e=1721964794&token=8_2qFlGEVQZPpFvHdGR6gg2t9A9QZfWT9wwTl92s:nG-hbPN51uPP8FOeTY2jdQcT51w=\n```\n\n## 高级用法\n\n## 更新记录和贡献\n### 2024.8.1\n#### [Added]\n- 增加论文生成PPT组件。\n- 增加论文生成PPT组件单元测试。"
  },
  {
    "path": "python/core/components/ppt_generation_from_paper/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/ppt_generation_from_paper/base.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\nfrom pydantic import Field\nfrom enum import Enum\n\nfrom appbuilder.core.component import ComponentArguments\n\n\nDEFAULT_AUTHOR = '百度千帆AppBuilder'\n\nclass StyleChoices(Enum):\n    technology = '科技'\n    business = '商务'\n    fresh = '小清新'\n    cute_cartoon = '可爱卡通'\n    chinese_style = '中国风'\n    minimalist = '极简'\n    party_politics = '党政'\n\n\nclass ColorChoices(Enum):\n    purple = '紫色'\n    red = '红色'\n    orange = '橙色'\n    yellow = '黄色'\n    green = '绿色'\n    cyan = '青色'\n    blue = '蓝色'\n    pink = '粉色'\n\n\nclass FontNameChoices(Enum):\n    HeiTi = '黑体'\n    SongTi = '宋体'\n    FangSong = '仿宋'\n    YouYuan = '幼圆'\n    KaiTi = '楷体'\n    LiShu = '隶书'\n\n\nclass PPTGenerationFromPaperArgs(ComponentArguments):\n    \"\"\"论文生成PPT组件配置\n    \"\"\"\n    file_key: str = Field(...,\n                          valiable_name='file_key',\n                          description='论文链接。')\n    style: StyleChoices = Field(default=None,\n                                valiable_name='style',\n                                description='PPT风格，可选：科技、商务、小清新、可爱卡通、中国风、极简、党政。')\n    color: ColorChoices = Field(default=None,\n                                variable_name='color',\n                                description='PPT主色调。可选：紫色、红色、橙色、黄色、绿色、青色、蓝色、粉色。')\n    title: str = Field(default=None,\n                       variable_name='title',\n                       description='自定义标题。优先使用自定义标题，如果为空则使用解析结果中的标题。')\n    pleader: str = Field(default=None,\n                         variable_name='pleader',\n                         description='汇报人。')\n    advisor: str = Field(default=None,\n                         variable_name='advisor',\n                         description='指导教师。')\n    school: str = Field(default=None,\n                        variable_name='school',\n                        description='学校名称。')\n    school_logo: str = Field(default=None,\n                             variable_name='school_logo',\n                             description='学校logo图片链接。')\n    school_picture: str = Field(default=None,\n                                variable_name='school_picture',\n                                description='学校图片链接。')\n    \n    def convert_params_to_dict(self):\n        \"\"\"输出参数字典\n        \"\"\"\n        output_dict = {}\n        for k, v in self.model_dump().items():\n            if k in self.model_fields and \\\n                    self.model_fields[k].json_schema_extra and \\\n                    v is not None:\n                if isinstance(v, Enum):\n                    output_dict[k] = v.value\n                else:\n                    output_dict[k] = v\n        return output_dict"
  },
  {
    "path": "python/core/components/ppt_generation_from_paper/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\nimport traceback\nimport time\n\nfrom typing import Optional\n\nfrom .base import PPTGenerationFromPaperArgs, DEFAULT_AUTHOR\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.utils.logger_util import logger\n\n\nclass PPTGenerationFromPaper(Component):\n    \"\"\"\n    论文生成PPT。\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        ppt_generator = appbuilder.PPTGenerationFromPaper()\n        user_input = {\n            'file_key': 'http://image.yoojober.com/users/chatppt/temp/2024-06/6672aa839a9da.docx'\n        }\n        answer = ppt_generator(appbuilder.Message(user_input))\n        print(answer.content)\n    \"\"\"\n    uniform_prefix = '/api/v1/component/component'\n    ppt_generation_url = '/ppt/text2ppt/apps/ppt-create-thesis'\n    get_ppt_generation_status_url = '/ppt/text2ppt/apps/ppt-result'\n    get_ppt_download_link_url = '/ppt/text2ppt/apps/ppt-download'\n\n    name = 'ppt_generation_from_paper'\n    version: str\n    meta = PPTGenerationFromPaperArgs\n\n    manifests = [\n        {\n            \"name\": \"ppt_generation_from_paper\",\n            \"description\": \"根据上传的论文生成PPT。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_key\": {\n                        \"type\": \"string\",\n                        \"description\": \"用户上传的论文的链接。\"\n                    }\n                },\n                \"required\": [\n                    \"file_key\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        secret_key: Optional[str] = None,\n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        **kwargs\n    ):\n        \"\"\"初始化论文生成PPT组件。\n        \n        Args:\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \"\"\"\n        super().__init__(PPTGenerationFromPaperArgs,\n                         secret_key=secret_key,\n                         gateway=gateway,\n                         lazy_certification=lazy_certification)\n        self.x_alternative_authorization = None\n\n    def ppt_generation(self,\n                       post_data: dict,\n                       timeout: float = None):\n        \"\"\"\n        创建PPT生成任务\n        \n        Args:\n            post_data (dict): 发送的POST请求体数据\n            timeout (float, optional): 请求超时时间，默认为None。\n        \n        Returns:\n            str: 返回的任务ID\n        \n        Raises:\n            Exception: 如果PPT生成请求失败，抛出异常\n        \n        \"\"\"\n        url = self.http_client.service_url(self.ppt_generation_url, self.uniform_prefix)\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n        response = self.http_client.session.post(url,\n                                                 json=post_data,\n                                                 headers=headers,\n                                                 timeout=timeout)\n        self.http_client.check_response_header(response)\n        resp_data = response.json()\n        if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n            error_msg = f'[ppt_generation] PPT generation request error! response: {resp_data}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        job_id = resp_data['data']['id']\n        return job_id\n\n    def get_ppt_generation_status(self,\n                                  job_id: str,\n                                  request_times: int = 60,\n                                  request_interval: int = 5,\n                                  timeout: float = None):\n        \"\"\"\n        轮询查看PPT生成状态\n        \n        Args:\n            job_id (str): 任务ID\n            request_times (int, optional): 请求次数，默认为60次。\n            request_interval (int, optional): 请求间隔时间，默认为5秒。\n            timeout (float, optional): 请求超时时间，默认为None，即不设置超时时间。\n        \n        Returns:\n            int: PPT生成状态码。\n                - 1: PPT正在生成中\n                - 2: PPT生成完成\n                - 3: PPT生成失败\n        \n        Raises:\n            Exception: PPT生成失败或请求失败时抛出异常。\n        \"\"\"\n        url = self.http_client.service_url(self.get_ppt_generation_status_url, self.uniform_prefix) + f'?id={job_id}'\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n\n        status = -1\n        for _ in range(request_times):\n            response = self.http_client.session.get(url,\n                                                    headers=headers,\n                                                    timeout=timeout)\n            try:\n                self.http_client.check_response_header(response)\n            except:\n                error_msg = f'[get_ppt_generation_status] ERROR!\\n{traceback.format_exc()}'\n                logger.error(error_msg)\n                time.sleep(request_interval)\n                continue\n            self.http_client.check_response_header(response)\n\n            resp_data = response.json()\n            if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n                error_msg = f'[get_ppt_generation_status] Get PPT generation status error! job_id: {job_id}, ' \\\n                            f'response: {resp_data}'\n                logger.error(error_msg)\n                raise Exception(error_msg)\n            status = resp_data['data']['status']\n            if status == 1:\n                # 正在生成\n                time.sleep(request_interval)\n            elif status == 2:\n                # 生成完成\n                break\n            elif status == 3:\n                # 生成失败\n                raise Exception(f'[get_ppt_generation_status] PPT generation Fail! job_id: {job_id}')\n        \n        if status == 1:\n            error_msg = f'[get_ppt_generation_status] PPT generation timeout! job_id: {job_id}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        elif status == -1:\n            error_msg = f'[get_ppt_generation_status] Request fail! job_id: {job_id}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n\n        return status\n\n    def get_ppt_download_link(self,\n                              job_id: str,\n                              timeout: float = None):\n        \"\"\"\n        获取PPT下载链接\n        \n        Args:\n            job_id (str): 任务ID\n            timeout (float, optional): 请求超时时间，默认为None.\n        \n        Returns:\n            str: PPT下载链接\n        \n        Raises:\n            Exception: PPT生成请求失败\n        \n        \"\"\"\n        url = self.http_client.service_url(self.get_ppt_download_link_url, self.uniform_prefix) + f'?id={job_id}'\n        headers = self.http_client.auth_header()\n        if self.x_alternative_authorization:\n            headers[\"X-Alternative-Authorization\"] = self.x_alternative_authorization\n        headers['Content-Type'] = 'application/json'\n        response = self.http_client.session.get(url,\n                                                headers=headers,\n                                                timeout=timeout)\n        self.http_client.check_response_header(response)\n        resp_data = response.json()\n        if resp_data.get('code', None) != 200 or resp_data.get('msg', None) != 'success':\n            error_msg = f'[get_ppt_download_link] PPT generation request error! response: {resp_data}'\n            logger.error(error_msg)\n            raise Exception(error_msg)\n        download_link = resp_data['data']['download_url']\n        return download_link\n    \n    def run(self, message: Message, poll_request_times=60, poll_request_interval=5) -> Message:\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (Message): 输入消息，用于传入请求参数。\n            poll_request_times (int): 轮询请求结果次数，默认为60次。\n            poll_request_interval (int): 轮询请求的间隔时间（秒），默认为5秒。\n        \n        Returns:\n            Message: 模型运行后的输出消息，包含PPT下载链接。\n        \n        Raises:\n            Exception: 当输入参数中缺少必要的键时，抛出异常。\n        \n        \"\"\"\n        # 参数检查与设置\n        user_input = message.content\n        for key in ['file_key']:\n            if key not in user_input:\n                raise Exception(f'[PPTGenerationFromPaper] Missing key: {key}')\n        if user_input.get('pleader', '') is None or not user_input.get('pleader', '').strip():\n            user_input['pleader'] = DEFAULT_AUTHOR\n        if user_input.get('advisor', '') is None or not user_input.get('advisor', '').strip():\n            user_input['advisor'] = DEFAULT_AUTHOR\n        user_input = self.meta(**{k: v for k, v in user_input.items() if v is not None})\n        user_input = user_input.convert_params_to_dict()\n        \n        # 创建PPT生成任务\n        logger.info('Creating a PPT generation task...')\n        job_id = self.ppt_generation(user_input)\n        logger.info('Creating a PPT generation task succeeds.')\n        \n        # 查询PPT生成状态\n        logger.info('Generating PPT...')\n        status = self.get_ppt_generation_status(job_id,\n                                                request_times=poll_request_times,\n                                                request_interval=poll_request_interval)\n        logger.info('PPT generation task completed.')\n        \n        # 获取PPT下载链接\n        logger.info('Getting PPT download link...')\n        ppt_download_link = self.get_ppt_download_link(job_id)\n        logger.info('Getting PPT download link succeeds.')\n\n        return Message(ppt_download_link)\n\n    def tool_eval(self, stream: bool = False, **kwargs):\n        \"\"\"\n        使用指定的file_key来评估并获取相应的结果。\n        \n        Args:\n            stream (bool, optional): 是否以生成器的方式逐项返回结果，默认为False。\n            **kwargs: 关键字参数，用于传递其他参数，目前仅支持file_key。\n        \n        Returns:\n            如果stream为False，则直接返回结果。\n            如果stream为True，则逐个返回结果。\n        \n        Raises:\n            ValueError: 如果参数file_key为空，则抛出异常。\n        \n        \"\"\"\n        file_key = kwargs.get('file_key', '')\n        if not file_key:\n            raise ValueError('param `file_key` should not be empty.')\n        user_input = {\n            'file_key': file_key\n        }\n\n        message = Message(user_input)\n        result = self.run(message,\n                          poll_request_times=60,\n                          poll_request_interval=5)\n\n        ppt_download_link = result.content\n\n        if stream:\n            yield ppt_download_link\n        else:\n            return ppt_download_link"
  },
  {
    "path": "python/core/components/qrcode_ocr/README.md",
    "content": "# 二维码识别 (QRcodeOCR) \n\n## 简介\n二维码识别 (QRcodeOCR) 可对图片中的二维码、条形码进行检测和识别，返回存储的文字信息及其位置信息。\n\n\n### 功能介绍\n* 二维码识别\n\n    检测识别图片中的二维码（包括QR_CODE、DATA_MATRIX、AZTEC、PDF_417 4类），自动返回存储的内容。\n* 条形码识别\n\n    检测识别图片中的条形码（包括CODE_128、UPC_A、EAN_13、ITF、CODABAR 等9类），自动返回存储的内容。\n### 特色优势\n* 支持对图片中的二维码、条形码进行检测和识别，自动返回存储的内容。\n\n### 应用场景\n* 物品信息管理\n\n    解析识别各类物品的二维码或条形码信息，应用于商品、药品出入库管理及货物运输管理等场景，轻松一扫即可快速完成对物品信息的读取、登记和存储，简化物品管理流程\n## 基本用法\n\n下面是二维码识别的代码示例：\n\n示例图片为：\n![示例图片](https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6e74ab057ce26d50e966dc31ff083e6a9c41b)\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n            \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n            \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\nraw_image = requests.get(image_url).content\n# 创建二维码识别组件实例\nqrcode_ocr = appbuilder.QRcodeOCR()\n# 执行识别操作并获取结果\nout = qrcode_ocr.run(appbuilder.Message(content={\"raw_image\": raw_image}), location=\"true\")\nprint(out.content)\n# {'codes_result': [{'type': 'QR_CODE', 'text': ['ocr文字识别'], 'location': {'top': 506, 'left': 1302, 'width': 1972, 'height': 1961}}]}\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数 （以表格形式展示）\n| 参数名称     | 参数类型    | 是否必须 | 描述                                                                      | 示例值                                            |\n|----------|---------|------|-------------------------------------------------------------------------|------------------------------------------------|\n| message  | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数                                             | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n| location | String  | 否    | 是否输出二维码/条形码位置信息，false：不返回位置信息，true：默认值，返回图中二维码/条形码的位置信息，包括上边距、左边距、宽度、高度 | \"false\"                                        |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry    | Integer | 否    | HTTP重试次数                                                                | 3                                              |\n\n### 响应参数\n| 参数名称         | 参数类型     | 描述          | 示例值                                                                                                               |\n|--------------|----------|-------------|-------------------------------------------------------------------------------------------------------------------|\n| codes_result | Array[]  | 返回结果        | [{'type': 'QR_CODE', 'text': ['ocr文字识别'], 'location': {'top': 506, 'left': 1302, 'width': 1972, 'height': 1961}}] |\n| +type        | String   | 识别码类型条码类型   | 'QR_CODE'                                                                                                         |\n| +text        | Array[]  | 条形码/二维码识别内容 | ['ocr文字识别']                                                                                                       |\n| +location    | Object{} | 条形码/二维码位置信息 | {'top': 506, 'left': 1302, 'width': 1972, 'height': 1961}                                                         |\n| ++top\t       | Integer  | 条形码/二维码的上边距 | 506                                                                                                               |\n| ++left       | Integer  | 条形码/二维码的左边距 | 1302                                                                                                              |\n| ++width\t     | Integer  | 条形码/二维码的宽度  | 1972                                                                                                              |\n| ++height     | Integer  | 条形码/二维码的高度  | 1961                                                                                                              |\n\n\n### 响应示例\n```json\n{\n  \"codes_result\": [\n    {\n      \"type\": \"QR_CODE\",\n      \"text\": [\"ocr文字识别\"],\n      \"location\": {\n        \"top\": 506,\n        \"left\": 1302,\n        \"width\": 1972,\n        \"height\": 1961\n      }\n    }\n  ]\n}\n```\n### 错误码\n| 错误码 | 描述 |\n|-----|----|\n\n## 高级用法\n\n目前该模块仅提供基础的二维码识别功能。\n\n\n## 更新记录和贡献\n* 二维码识别能力 (2024-01)"
  },
  {
    "path": "python/core/components/qrcode_ocr/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/qrcode_ocr/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"qrcode ocr component.\"\"\"\n\nimport base64\nimport json\n\nfrom appbuilder.core import utils\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.qrcode_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass QRcodeOCR(Component):\n    r\"\"\"\n       对图片中的二维码、条形码进行检测和识别，返回存储的文字信息及其位置信息。\n\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           qrcode_ocr = appbuilder.QRcodeOCR()\n           with open(\"./qrcode_ocr_test.png\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read(),\"location\": \"true\"}))\n           print(out.content)\n\n        \"\"\"\n\n    name = \"qrcode_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"qrcode_ocr\",\n            \"description\": \"需要对图片中的二维码、条形码进行检测和识别，返回存储的文字信息及其位置信息，使用该工具\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别文件的文件名\"\n                    },\n                    \"location\": {\n                        \"type\": \"string\",\n                        \"description\": \"是否输出二维码/条形码位置信息\"\n                    }\n                },\n                \"required\": [\"file_names\"]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, location: str = \"true\", timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        执行二维码识别操作。\n        \n        Args:\n            message (Message): 输入的图片或图片URL下载地址，用于执行识别操作。例如：\n                Message(content={\"raw_image\": b\"...\", \"location\": \"\"}) 或\n                Message(content={\"url\": \"https://image/download/url\"})。\n            location (str, 可选): 是否需要返回二维码位置信息，默认为 \"true\"。\n            timeout (float, 可选): HTTP请求的超时时间。\n            retry (int, 可选): HTTP请求的重试次数。\n        \n        Returns:\n            Message: 识别结果，包含识别到的二维码信息。例如：\n                Message(name=msg, content={'codes_result': [{'type': 'QR_CODE', 'text': ['http://weixin.qq.com/r/cS7M1PHE5qyZrbW393tj'],\n                    'location': {'top': 63, 'left': 950, 'width': 220, 'height': 211}}, ...]}, mtype=dict)\n        \n        Raises:\n            InvalidRequestArgumentError: 如果 location 参数非法，将抛出该异常。\n        \"\"\"\n        inp = QRcodeInMsg(**message.content)\n        req = QRcodeRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        if not isinstance(location, str) or location not in ('true', 'false'):\n            raise InvalidRequestArgumentError(\n                f\"illegal location, expected location is 'true' or 'false', got {location}\")\n        req.location = location\n        result = self._recognize(req, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = QRcodeOutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: QRcodeRequest, timeout: float = None,\n                   retry: int = 0, request_id: str = None) -> QRcodeResponse:\n        r\"\"\"调用二维码识别底层能力\n                   参数:\n                       request (obj: `QRcodeRequest`) : 二维码识别输入参数\n                   返回：\n                       response (obj: `QRcodeResponse`): 二维码识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\n                \"request format error, one of image or url must be set\")\n\n        data = QRcodeRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        headers['Accept'] = 'application/json'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/qrcode\")\n        response = self.http_client.session.post(\n            url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        res = QRcodeResponse.from_json(json.dumps(data))\n        res.request_id = request_id\n        return res\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 二维码识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool, **kwargs):\n        \"\"\"\n        评估工具函数\n        \n        Args:\n            name (str): 工具名称\n            streaming (bool): 是否流式输出\n            **kwargs: 其他关键字参数\n        \n        Keyword Args:\n            traceid (str): 请求的traceid\n            file_names (List[str]): 文件名列表\n            locations (str): 是否需要获取位置信息，可选值为'true'或'false'，默认为'false'\n            file_urls (Dict[str, str]): 文件名到文件URL的映射\n        \n        Returns:\n            Union[str, Generator[Dict[str, Any], None, None]]: 如果streaming为True，则返回一个生成器，生成两个字典，分别代表LLM和用户可见的内容；\n                                                              如果streaming为False，则返回一个JSON字符串，包含评估结果\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误，或者位置信息不合法，则抛出该异常\n        \"\"\"\n        result = {}\n        traceid = kwargs.get(\"traceid\")\n        file_names = kwargs.get(\"file_names\", None)\n        location = kwargs.get(\"locations\", \"false\")\n        if not file_names:\n            file_names = kwargs.get(\"files\")\n\n        file_urls = kwargs.get(\"file_urls\", {})\n        for file_name in file_names:\n            if utils.is_url(file_name):\n                file_url = file_name\n            else:\n                file_url = file_urls.get(file_name, None)\n            if file_url is None:\n                raise InvalidRequestArgumentError(\n                    f\"request format error, file {file_name} url does not exist\")\n            req = QRcodeRequest()\n            req.url = file_url\n            if not isinstance(location, str) or location not in (\"true\", \"false\"):\n                raise InvalidRequestArgumentError(\n                    f\"illegal location, expected location is 'true' or 'false', got {location}\"\n                )\n            req.location = location\n            resp = self._recognize(req, request_id=traceid)\n            result[file_name] = [\n                item[\"text\"] for item in proto.Message.to_dict(resp).get(\"codes_result\", [])\n            ]\n\n        result = json.dumps(result, ensure_ascii=False)\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": result,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": \"user\",\n            }\n        else:\n            return result\n"
  },
  {
    "path": "python/core/components/qrcode_ocr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"qrcode ocr model.\"\"\"\nimport proto\n\nfrom typing import List\nfrom pydantic import BaseModel\n\n\nclass QRcodeRequest(proto.Message):\n    r\"\"\"二维码识别请求体参数.\n            属性:\n                image (str):\n                    可选。图像内容的base64编码。\n                url (str):\n                    可选。图像的URL地址，经过base64编码。\n                    图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n                location (str):\n                    可选。是否输出二维码/条形码位置信息\n                    - false：默认值，不返回位置信息；\n                    - true：返回图中二维码/条形码的位置信息，包括上边距、左边距、宽度、高度\n            必须设置image或url属性之一，如果两者都设置了，将使用image属性。\n        \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    location: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass QRcodeResponse(proto.Message):\n    \"\"\"二维码识别响应消息。\n\n        属性:\n            request_id (str): 请求ID。\n            log_id (int): 用于问题识别的唯一日志ID。\n            codes_result_num (int):识别结果数，表示codes_result的元素个数\n            result (List[QRcodeRes]): 定位和识别结果数组。\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=2,\n    )\n    codes_result_num: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    codes_result: 'QRcodeRes' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=4,\n        message='QRcodeRes',\n    )\n\n\nclass QRcodeRes(proto.Message):\n    \"\"\"二维码识别结果。\n\n        属性:\n            type (str):\n                识别码类型条码类型包括：9种条形码（UPC_A、UPC_E、EAN_13、EAN_8、CODE_39、CODE_93、CODE_128、ITF、CODABAR），\n                4种二维码（QR_CODE、DATA_MATRIX、AZTEC、PDF_417）。\n            text (str):\n                条形码/二维码识别内容,目前仅支持输出中英文结果。\n            location (QRcodeLocation):\n                条形码/二维码位置信息，包括上边距、左边距、宽度、高度，当请求参数 location = true 时返回\n    \"\"\"\n    type: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    text: str = proto.RepeatedField(\n        proto.STRING,\n        number=2,\n    )\n    location: 'QRcodeLocation' = proto.Field(\n        proto.MESSAGE,\n        number=3,\n        message=\"QRcodeLocation\",\n    )\n\n\nclass QRcodeLocation(proto.Message):\n    \"\"\"条形码/二维码位置信息。\n\n           属性:\n               top (int): 条形码/二维码的上边距。\n               left (int): 条形码/二维码的左边距。\n               width (int): 条形码/二维码的宽度。\n               height (int): 条形码/二维码的高度。\n       \"\"\"\n    top: int = proto.Field(\n        proto.INT32,\n        number=1,\n    )\n    left: int = proto.Field(\n        proto.INT32,\n        number=2,\n    )\n    width: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    height: int = proto.Field(\n        proto.INT32,\n        number=4,\n    )\n\n\nclass QRcodeInMsg(BaseModel):\n    \"\"\" 二维码识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''\n    url: str = \"\"\n\n\nclass QRcodeOCRLocation(BaseModel):\n    \"\"\" 条形码/二维码位置信息\n\n        属性:\n            top(int): 条形码/二维码的上边距\n            left(int): 条形码/二维码的左边距\n            width(int): 条形码/二维码的宽度\n            height(int): 条形码/二维码的高度\n    \"\"\"\n    top: int\n    left: int\n    width: int\n    height: int\n\n\nclass QRcodeOCRRes(BaseModel):\n    \"\"\" 条形码/二维码位置信息\n\n        属性:\n            type(int): 识别码类型条码类型\n            text(List[str]): 条形码/二维码识别内容\n            location(Object): 条形码/二维码位置信息\n    \"\"\"\n    type: str = \"\"\n    text: List[str]\n    location: QRcodeOCRLocation = {}\n\n\nclass QRcodeOutMsg(BaseModel):\n    r\"\"\"识别结果列表\"\"\"\n    codes_result: List[QRcodeOCRRes]  # 结果列表\n"
  },
  {
    "path": "python/core/components/rag_with_baidu_search/README.md",
    "content": "# 百度搜索RAG（deprecate）\n\n## 简介\n百度搜索（BaiduSearch），通过百度搜索引擎搜索相关内容。\n现推荐使用RagWithBaiduSearchPro\n|              | 旧组件（百度搜索RAG）| 新组件（百度搜索RAG_PRO） \n|--------------|------------------ |------------------\n| 指令         |        ☑️         |        ☑️               \n| 拒绝回答开关   |       ☑️         |        ❌                \n| 高亮开关      |       ☑️         |         ❌                \n| 友好度开关    |       ☑️          |        ❌           \n| 澄清开关    |       ☑️          |        ❌         \n| 溯源开关      |       ☑️         |         ☑️               \n| 流式请求      |       ☑️         |         ☑️               \n| temperature  |          ☑️          |        ☑️               \n| top_p        |          ☑️          |        ☑️               \n| 检索个数      |       ❌         |         ☑️               \n| 检索类型（网页、视频等） |    ❌     |        ☑️         \n\n### 功能介绍\n百度搜索是最大的中文搜索引擎，帮助用户在海量信息中找到最需要的内容。\n\n### 特色优势\n百度搜索凭借先进的中文搜索技术、个性化推荐、全面的信息覆盖、即时的搜索结果和强大的安全防护，为用户提供快速、准确、安全的搜索体验，满足多样化的信息需求。\n\n### 应用场景\n通用搜索领域\n\n## 基本用法\n以下是一个简单的例子来演示如何开始使用百度搜索组件：\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建rag_with_baidusearch对象\nrag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch(model=\"DeepSeek-V3.1\")\n\n# 运行rag_with_baidusearch基本组件\nmsg = appbuilder.Message(\"残疾人怎么办相关证件\")\nresult = rag_with_baidusearch_component.run(msg)\n\n# 获取reference\nreferences = result.extra\n\n# 输出运行结果\nprint(result)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n- `instruction (obj:Message, 可选)`: 可设定人设，如：你是问答助手，在回答问题前需要加上“很高兴为您解答：”\n- `reject (bool, 可选)`: 拒绝开关，如果为 True，则启用该能力。默认为 False。当输入的问题在搜索结果中没有找到答案时，开关开启时，模型会用特定话术(\"当前文档库找不到对应的答案，我可以尝试用我的常识来回答你。\")做回复的开头，并后接自有知识做回复内容。\n- `clarify (bool, 可选)`: 澄清开关，如果为 True，则启用该能力。默认为 False。 当输入的问题比较模糊、或者主体指代不清晰，且context_list中包含有可以回答该模糊问题的多种潜在备选答案时，开启该开关，大模型会以特定的话术做澄清反问，引导用户继续补充问题发问。举例子，query:发电机的续航时间？ Answer: 根据搜索结果得到了xx和xx两种型号的发电机，您的问题具体涉及到哪一个？请补充关键信息，作为完整的问题重新发问。\n- `highlight (bool, 可选)`: 重点强调开关，如果为 True，则启用该能力。默认为 False。开启该功能时，回复结果中会高亮显示关键部分的内容。\n- `friendly (bool, 可选)`: 友好性提升开关，如果为 True，则启用该能力。默认为 False。开关开启时，部分回复的开头会加礼貌用语。且如果回答涉及到大段的信息，会倾向于以<总-分>或者<总-分-总>的形式做分点论述，使得答案的格式更规整，可读性更强。\n- `cite (bool, 可选)`: 溯源开关，如果为 True，则启用该能力。默认为 False。开关开启时，回复内容后会使用引用标记来标注回答内容参考的搜索结果序号，如^[1]^ (引用单个搜索结果）,^[1][2]^（引用多个搜索结果）。例如：按照当地公安机关出入境管理部门规定的其他材料办理^[2]^。\n\n\n### 调用参数\n调用参数中的 instruction, reject, clarify, highlight, friendly 和 cite 会覆盖初始化时的参数。\n\n- `msg (obj:Message)`: 输入消息，包含用户提出的问题。这是一个必需的参数。\n- `instruction (obj:Message, 可选)`: 可设定人设，如：你是问答助手，在回答问题前需要加上“很高兴为您解答：”\n- `reject (bool, 可选)`: 拒绝开关，如果为 True，则启用该能力。默认为 False。当输入的问题在搜索结果中没有找到答案时，开关开启时，模型会用特定话术(\"当前文档库找不到对应的答案，我可以尝试用我的常识来回答你。\")做回复的开头，并后接自有知识做回复内容。\n- `clarify (bool, 可选)`: 澄清开关，如果为 True，则启用该能力。默认为 False。 当输入的问题比较模糊、或者主体指代不清晰，且context_list中包含有可以回答该模糊问题的多种潜在备选答案时，开启该开关，大模型会以特定的话术做澄清反问，引导用户继续补充问题发问。举例子，query:发电机的续航时间？ Answer: 根据搜索结果得到了xx和xx两种型号的发电机，您的问题具体涉及到哪一个？请补充关键信息，作为完整的问题重新发问。\n- `highlight (bool, 可选)`: 重点强调开关，如果为 True，则启用该能力。默认为 False。开启该功能时，回复结果中会高亮显示关键部分的内容。\n- `friendly (bool, 可选)`: 友好性提升开关，如果为 True，则启用该能力。默认为 False。开关开启时，部分回复的开头会加礼貌用语。且如果回答涉及到大段的信息，会倾向于以<总-分>或者<总-分-总>的形式做分点论述，使得答案的格式更规整，可读性更强。\n- `cite (bool, 可选)`: 溯源开关，如果为 True，则启用该能力。默认为 False。开关开启时，回复内容后会使用引用标记来标注回答内容参考的搜索结果序号，如^[1]^ (引用单个搜索结果）,^[1][2]^（引用多个搜索结果）。例如：按照当地公安机关出入境管理部门规定的其他材料办理^[2]^。\n- `stream (bool, 可选)`: 指定是否以流式形式返回响应。默认为 False。\n- `temperature (float, 可选)`: 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n- `top_p (float, 可选)`: 模型配置的top_p参数，top_p值越高输出文本越多样，top_p值越低输出文本越稳定。取值范围为 0.0 到 1.0，默认值为 1e-10。\n\n\n### 返回值\n- 返回一个 `Message` 对象，包含模型运行后的输出消息。\n\n\n## 高级用法\n该组件的高级用法包括定制化的输入处理、输出处理，以及更复杂的调用场景。用户可以根据具体需求扩展组件功能，实现个性化的问答系统。\n包括如下功能：\n1、人设\n2、拒答\n3、澄清反问\n4、重点强调\n5、友好度提升\n6、溯源\n\n\n### 代码样例\n\n```python\nimport appbuilder\nimport os\n\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建rag_with_baidusearch对象, 并初始化人设指令\nrag_with_baidusearch_component = appbuilder.RAGWithBaiduSearch(\n        model=\"DeepSeek-V3.1\", \n        instruction=appbuilder.Message(\"你是问答助手，在回答问题前需要加上: 很高兴为您解答\"))\n\n\n# 运行rag_with_baidusearch组件，开启拒答、澄清追问、重点强调、友好性提升、溯源能力功能\nmsg = appbuilder.Message(\"残疾人怎么办相关证件\")\nresult = rag_with_baidusearch_component.run(\n        msg, reject=True, clarify=True, highlight=True,\n        friendly=True, cite=True, temperature=0.5, stream=False)\n\n# 输出运行结果\nprint(result)\n```\n\n### 返回参数说明\n\n返回的message中具体字段说明如下：\n\n| 字段            | 字段说明   |\n|---------------|--------|\n| name          | 名称     | \n| mtype         | 类型     | \n| content       | 内容     |  \n| extra         | 引用     | \n| +search_baidu | 百度搜索结果 |\n| ++content     | 网页内容摘要 |\n| ++url         | 网页链接   |\n| ++ref_id      | 序号     |\n| ++title       | 标题     |\n| ++icon        | 网站图标   |\n| ++site_name   | 网站名    |\n\n\n### 典型返回样例\n```\nMessage(name=msg, content=您好，请问您是想询问关于残疾人办理什么证件的问题吗？如果是，我可以为您提供一些信息。\n\n首先，如果您是首次申请办理残疾人证，需要携带身份证、户口簿和三张两寸近期免冠白底彩色照片到县残联办证窗口提出申请。如果您因身体原因无法亲自前往，可以联系村（社区）工作人员代办申请。\n\n其次，如果您是指残疾类型等级证明，您需要携带相关材料到指定医院或医生进行评级，并由医生签名盖章。\n\n最后，如果您是指残疾人享受低保或残疾人贫困证的一级肢体、视力、智力、精神、多重及60周岁以上的一级听力、语言的重度残疾人可以享受重度残疾人生活补助，那么您需要携带身份证、户口本和残疾证申请表到县、市、区级残联进行办理。\n\n希望这些信息对您有所帮助。如果您还有其他问题，欢迎随时提问。^[2]^, mtype=dict, extra={'search_baidu': [{'content': '(一)3张两寸近期免冠白底彩色照片。 (二)身份证、户口簿原件及复印件。 (三)申请智力、精神类残疾人证和未成年人申请残疾人证需同时提供法定监护人的身份证、户口本原件及复印件和监护人的证明材料。监护人证明材料为以下三项中任意一项: (1)能体现双方直系血缘亲属关系的户口簿。 (2)申请人所在村(社区)出具的说明双方关系的证明材料。 (3)其他能够证明其双方关系的合法证件。(法院判决书、结婚证、出生证明等) (四)经常居住地的有效居住证(户籍地不在本市申请人需提供此证件,本市户籍申请人无需提供此证件)。 (五)经常居住地残联要求的其他材料。 残疾证办理事项及流程', 'icon': 'https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1505232404,3530227258&fm=195&app=88&f=JPEG?w=200&h=200', 'url': 'https://www.jingzhou.gov.cn/ztfwnew/shjz/cjrbl/index.shtml', 'ref_id': '1', 'site_name': '荆州市人民政府', 'title': '残疾人证办理服务'}, {'content': '{#}申请{@}. 首次申请办理残疾人证人员,需持申请人居民身份证,户口簿和3张两寸近期免冠白底彩照,到县残联办证窗口(县政务服务中心一楼1号窗口)提出办证申请,填写《中华人民共和国残疾人证申请表》.如因身体原因个人无法出行办证,可联系村(社区)工作人员代办申请.', 'icon': None, 'url': 'https://mp.weixin.qq.com/s?__biz=MzIxMzM5ODY5OQ==&mid=2247485042&idx=1&sn=26a4cad0122d24971d3f5ce598af3564&chksm=97b623b6a0c1aaa02f776c19f567e0b3fabdef3d9f5c957e1f260f286fe5356101fd1ac4e675&scene=27', 'ref_id': '2', 'site_name': '微信公众平台', 'title': '残疾人证如何办理?到哪里评定?你想知道的都在这里'}, {'content': '一、残疾人如何办残疾证 1、户口所在地的县、市、区级残联领取《残疾人证申请表》和《残疾评定表》; 2、身份证或户口本复印件一张; 3、两寸彩色相片2-6张(多带不碍事,各地标准不一); 4、残疾类型等级证明。残疾很明显的可以直接到残联进行评级(像肢体类)审核办理,不明显的必须到指定医院、指定医生进行评级签名并盖章。 一切手续完备,就到县、市、区级残联进行办理,快的话立等可取,慢的话7-15天也差不多了。 二、残疾证有什么用? 1、持有残疾证的残疾人可享受低保或持残疾人贫困证的一级肢体、视力、智力、精神、多重及60周岁以上的一级听力、语言的重度残疾人,可享受重度残疾人生活补助。 2、残疾人托(安)养方面,一级重度残疾人(不含听力、语言、视力残疾)或18至60周岁二级重度残疾人(不含听力、语言、视力残疾),集中托养:低保户、贫困户的对象补助每年补助现金按各地政策规定金额发放。', 'icon': 'https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=215799447,688541359&fm=195&app=88&f=JPEG?w=200&h=200', 'url': 'https://mip.66law.cn/laws/1060751.aspx', 'ref_id': '3', 'site_name': '华律网', 'title': '残疾人如何办残疾证-证件办理|华律办事直通车'}]})\n```\n"
  },
  {
    "path": "python/core/components/rag_with_baidu_search/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom .component import RAGWithBaiduSearch\n"
  },
  {
    "path": "python/core/components/rag_with_baidu_search/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent, ModelArgsConfig\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.message import Message\nfrom pydantic import Field\nfrom typing import Optional\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace\n\nfrom .model import RAGWithBaiduSearchArgs\n\n\nclass RAGWithBaiduSearch(CompletionBaseComponent):\n    name = \"rag_with_baidu_search\"\n    version = \"v1\"\n    meta: RAGWithBaiduSearchArgs\n\n    def __init__(\n        self, \n        model, \n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = False,\n        instruction: Optional[Message] = None, \n        reject: Optional[bool] = False, \n        clarify: Optional[bool] = False, \n        highlight: Optional[bool] = False, \n        friendly: Optional[bool] = False, \n        cite: Optional[bool] = False, \n        **kwargs\n    ):\n        \"\"\"初始化RAG with BaiduSearch组件\n\n        Args:\n            model (str): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n            instruction (Message, 可选): 人设指令，默认为空\n            reject (bool, 可选): 是否开启拒绝回答开关，默认为False\n            clarify (bool, 可选): 是否开启澄清开关，默认为False\n            highlight (bool, 可选): 是否开启高亮开关，默认为False\n            friendly (bool, 可选): 是否开启礼貌回答开关，默认为False\n            cite (bool, 可选): 是否开启溯源开关，默认为False\n\n        Returns:\n            None\n\n        \"\"\"\n        super().__init__(\n                RAGWithBaiduSearchArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n        self.instruction = instruction\n        self.reject = reject\n        self.clarify = clarify\n        self.highlight = highlight\n        self.friendly = friendly\n        self.cite = cite\n\n    @staticmethod\n    def __get_instruction_set():\n        \"\"\"\n        return: json格式的instruction_set\n        \"\"\"\n        return {\"reject\": \"如果答案不在搜索结果中得到，则在答案开头说明：\"\n                          \"“当前文档库找不到对应的答案，我可以尝试用我的常识来回答你”，\"\n                          \"并基于你的常识给出答案。\",\n                \"clarify\": \"当问题比较模糊，而检索结果包含多种可能的答案时，反向提问用户想问的具体内容，\"\n                           \"让用户补充关键信息后以完整的query重新发问。\",\n                \"highlight\": \"可以对答案中的核心部分进行markdown加粗（**加粗内容**）。\",\n                \"friendly\": \"答案尽量用礼貌用语开头，涉及到条目列举的内容需要在前面加序号并做分点描述，\"\n                            \"必要时可在每一点前面做小标题的汇总，并可以用总-分-总的形式展示分点式答案内容，使得答案内容可读性更强。\",\n                \"cite\": \"使用引用标记来标注回答内容参考的搜索结果序号，例如^[1]^ (引用单个搜索结果）,^[1][2]^（引用多个搜索结果），\"\n                        \"其中方括号中的数字是搜索结果序号。引用标记只能出现在句尾标点符号前。\"\n                }\n\n    def _get_search_input(self, text):\n        \"\"\"\n        获取检索query\n\n        BaiduSearch接口对query有长度要求，需要utf8编码不超过72字节\n        \"\"\"\n        max_bytes = 72\n        encoded = text.encode('utf-8')\n        if len(encoded) <= max_bytes:\n            return text\n\n        while max_bytes > 0:\n            try:\n                return encoded[:max_bytes].decode('utf-8')\n            except UnicodeDecodeError:\n                max_bytes -= 1\n        return \"\"\n\n    @components_run_trace\n    def run(\n        self, \n        message, \n        instruction=None, \n        reject=None,\n        clarify=None,\n        highlight=None,\n        friendly=None,\n        cite=None,\n        stream=False, \n        temperature=1e-10, \n        top_p=1e-10,\n    ):\n        \"\"\"\n        执行模型推理\n        \n        Args:\n            message (Message): 用户输入的消息对象\n            instruction (Instruction, optional): 用户提供的指令信息，默认为None。如果未提供，则使用默认的指令信息。\n            reject (bool, optional): 是否拒绝执行，默认为None。如果未提供，则使用默认设置。\n            clarify (bool, optional): 是否需要澄清，默认为None。如果未提供，则使用默认设置。\n            highlight (bool, optional): 是否高亮显示，默认为None。如果未提供，则使用默认设置。\n            friendly (bool, optional): 是否以友好的方式回答，默认为None。如果未提供，则使用默认设置。\n            cite (bool, optional): 是否引用原始信息，默认为None。如果未提供，则使用默认设置。\n            stream (bool, optional): 是否以流式方式返回结果，默认为False。\n            temperature (float, optional): 温度参数，用于控制生成文本的多样性，默认为1e-10。\n            top_p (float, optional): 截断概率阈值，用于控制生成文本的多样性，默认为1e-10。\n        \n        Returns:\n            Message: 推理结果消息对象\n        \n        Raises:\n            AppBuilderServerException: 如果输入消息内容过长（超过72个字符）或推理结果中存在错误，则抛出异常。\n        \"\"\"\n        instruction_set = self.__get_instruction_set()\n\n        # query 长度限制不能超过 72\n        if len(message.content) > 72:\n            raise AppBuilderServerException(service_err_message=\"query is too long, expected <= 72, got {}\".format(len(message.content)))\n        \n        instruction = instruction if instruction is not None else self.instruction\n        reject = reject if reject is not None else self.reject\n        clarify = clarify if clarify is not None else self.clarify\n        highlight = highlight if highlight is not None else self.highlight\n        friendly = friendly if friendly is not None else self.friendly\n        cite = cite if cite is not None else self.cite\n\n        inputs = {\n            \"reject\": instruction_set[\"reject\"] if reject else None,\n            \"clarify\": instruction_set[\"clarify\"] if clarify else None,\n            \"highlight\": instruction_set[\"highlight\"] if highlight else None,\n            \"friendly\": instruction_set[\"friendly\"] if friendly else None,\n            \"cite\": instruction_set[\"cite\"] if cite else None,\n            \"instruction\": instruction.content if instruction else None,\n            \"search_input\": self._get_search_input(message.content),\n        }\n        model_config_inputs = ModelArgsConfig(**{\"stream\": stream, \"temperature\": temperature, \"top_p\": top_p})\n        model_config = self.get_model_config(model_config_inputs)\n        response_mode = \"streaming\" if stream else \"blocking\"\n        user_id = message.id\n\n        request = self.gene_request(message.content, inputs, response_mode, user_id, model_config)\n\n        response = self.completion(self.version, self.base_url, request)\n        if response.error_no != 0:\n            raise AppBuilderServerException(service_err_code=response.error_no, service_err_message=response.error_msg)\n\n        return response.to_message()\n"
  },
  {
    "path": "python/core/components/rag_with_baidu_search/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.core.message import Message\nfrom pydantic import Field\n\n\nclass RAGWithBaiduSearchArgs(ComponentArguments):\n    \"\"\"\n    RAG with Baidusearch提示词配置\n    \"\"\"\n    message: Message = Field(...,\n                             variable_name=\"message\",\n                             description=\"输入用户query，例如'千帆平台都有哪些大模型？'\")\n    reject: bool = Field(...,\n                         variable_name=\"reject\",\n                         description=\"控制大模型拒答能力的开关，为true即为开启拒答功能，为false即为关闭拒答功能\")\n    clarify: bool = Field(...,\n                          variable_name=\"clarify\",\n                          description=\"控制大模型澄清能力的开关，为true即为开启澄清反问功能，为false即为关闭澄清反问功能\")\n    highlight: bool = Field(...,\n                            variable_name=\"highlight\",\n                            description=\"控制大模型重点强调能力的开关，为true即为开启重点强调功能，为false即为关闭重点强调功能\")\n    friendly: bool = Field(...,\n                           variable_name=\"friendly\",\n                           description=\"控制大模型友好对提升难过能力的开关，\"\n                                       \"为true即为开启友好度提升功能，为false即为关闭友好度提升功能\")\n    cite: bool = Field(...,\n                       variable_name=\"cite\",\n                       description=\"控制大模型溯源能力的开关，为true即为开启溯源功能，为false即为关闭溯源功能\")\n\n    instruction: Message = Field(...,\n                                 variable_name=\"instruction\",\n                                 description=\"系统人设\")"
  },
  {
    "path": "python/core/components/rag_with_baidu_search_pro/README.md",
    "content": "# 百度搜索RAG_PRO\n\n## 简介\n百度搜索RAG_PRO组件旨在解决传统生成模型在生成长文本时可能会受到信息获取不足的问题，核心思想是将百度搜索与LLM相结合，使得生成的文本可以借助检索到的信息进行增强，从而提高生成文本的质量和相关性。\n\n### 功能介绍\n基于百度搜索结果进行RAG检索增强问答。\n百度搜索RAG_PRO组件支持配置用户指令，temperature，top_p，以及溯源开关等，为用户提供了更灵活的控制选项。\n对比旧版百度搜索RAG，新版百度搜索RAG_PRO在支持配置检索个数和检索类型（网页、视频等）方面进行了升级。\n\n### 特色优势\n百度搜索RAG_PRO组件的综合优势在于通过结合百度搜索的搜索引擎技术和ERNIE模型的语义理解能力，可以更准确地理解用户的搜索意图，并提供与搜索查询相关性更高的搜索结果。\n\n### 应用场景\n通用搜索领域\n\n## 基本用法\n以下是一个简单的例子来演示如何开始使用百度搜索RAG_PRO组件：\n\n```python\nimport appbuilder\nimport os\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建rag_with_baidusearch_pro对象\nrag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model=\"DeepSeek-V3.1\")\n\n# 运行rag_with_baidusearch基本组件\nmsg = appbuilder.Message(\"残疾人怎么办相关证件\")\nresult = rag_with_baidu_search_pro.run(msg)\n\n# 获取reference\nreferences = result.extra\n\n# 输出运行结果\nprint(result)\n```\n\n## 参数说明\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n- `model`: 模型名称，用于指定要使用的千帆模型。\n- `instruction (obj:Message, 可选)`: 可设定人设，如：你是问答助手，在回答问题前需要加上“很高兴为您解答：”\n\n\n### 调用参数\n调用参数中的 instruction 会覆盖初始化时的参数。\n\n- `msg (obj:Message)`: 输入消息，包含用户提出的问题。这是一个必需的参数。\n- `instruction (obj:Message, 可选)`: 可设定人设，如：你是问答助手，在回答问题前需要加上“很高兴为您解答：”\n- `stream (bool, 可选)`: 指定是否以流式形式返回响应。默认为 False。\n- `temperature (float, 可选)`: 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n- `top_p (float, 可选)`: 模型配置的top_p参数，top_p值越高输出文本越多样，top_p值越低输出文本越稳定。取值范围为 0.0 到 1.0，默认值为 1e-10。\n- `search_top_k (int, 可选)`: 指定百度搜索返回的检索个数，最多10，默认为4。\n- `hide_corner_markers (bool, 可选)`: 溯源开关，True隐藏来源，False显示来源，默认为True，不显示结果来源。\n\n\n### 返回值\n- 返回一个 `Message` 对象，包含模型运行后的输出消息。\n\n\n## 高级用法\n该组件的高级用法包括定制化的输入处理、输出处理，以及更复杂的调用场景。用户可以根据具体需求扩展组件功能，实现个性化的问答系统。\n包括如下功能：\n1、人设\n2、溯源\n3、百度搜索检索个数\n\n\n### 代码样例\n\n```python\nimport appbuilder\nimport os\n\n# 设置环境变量\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 创建rag_with_baidusearch对象, 并初始化人设指令\nrag_with_baidusearch_pro = appbuilder.RagWithBaiduSearchPro(\n        model=\"DeepSeek-V3.1\", \n        instruction=appbuilder.Message(\"你是问答助手，在回答问题前需要加上: 很高兴为您解答\"))\n\n\n# 运行rag_with_baidusearch组件，开启拒答、澄清追问、重点强调、友好性提升、溯源能力功能\nmsg = appbuilder.Message(\"残疾人怎么办相关证件\")\nresult = rag_with_baidusearch_pro.run(\n        msg, temperature=0.5, stream=False)\n\n# 输出运行结果\nprint(result)\n```\n\n### 返回参数说明\n\n返回的message中具体字段说明如下：\n\n| 字段            | 字段说明   |\n|---------------|--------|\n| name          | 名称     | \n| mtype         | 类型     | \n| content       | 内容     |  \n| extra         | 引用     | \n| +search_baidu | 百度搜索结果 |\n| ++content     | 网页内容摘要 |\n| ++url         | 网页链接   |\n| ++ref_id      | 序号     |\n| ++title       | 标题     |\n| ++icon        | 网站图标   |\n| ++site_name   | 网站名    |\n\n\n### 典型返回样例\n```\nMessage(name=msg, content=您好，请问您是想询问关于残疾人办理什么证件的问题吗？如果是，我可以为您提供一些信息。\n\n首先，如果您是首次申请办理残疾人证，需要携带身份证、户口簿和三张两寸近期免冠白底彩色照片到县残联办证窗口提出申请。如果您因身体原因无法亲自前往，可以联系村（社区）工作人员代办申请。\n\n其次，如果您是指残疾类型等级证明，您需要携带相关材料到指定医院或医生进行评级，并由医生签名盖章。\n\n最后，如果您是指残疾人享受低保或残疾人贫困证的一级肢体、视力、智力、精神、多重及60周岁以上的一级听力、语言的重度残疾人可以享受重度残疾人生活补助，那么您需要携带身份证、户口本和残疾证申请表到县、市、区级残联进行办理。\n\n希望这些信息对您有所帮助。如果您还有其他问题，欢迎随时提问。^[2]^, mtype=dict, extra={'search_baidu': [{'content': '(一)3张两寸近期免冠白底彩色照片。 (二)身份证、户口簿原件及复印件。 (三)申请智力、精神类残疾人证和未成年人申请残疾人证需同时提供法定监护人的身份证、户口本原件及复印件和监护人的证明材料。监护人证明材料为以下三项中任意一项: (1)能体现双方直系血缘亲属关系的户口簿。 (2)申请人所在村(社区)出具的说明双方关系的证明材料。 (3)其他能够证明其双方关系的合法证件。(法院判决书、结婚证、出生证明等) (四)经常居住地的有效居住证(户籍地不在本市申请人需提供此证件,本市户籍申请人无需提供此证件)。 (五)经常居住地残联要求的其他材料。 残疾证办理事项及流程', 'icon': 'https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1505232404,3530227258&fm=195&app=88&f=JPEG?w=200&h=200', 'url': 'https://www.jingzhou.gov.cn/ztfwnew/shjz/cjrbl/index.shtml', 'ref_id': '1', 'site_name': '荆州市人民政府', 'title': '残疾人证办理服务'}, {'content': '{#}申请{@}. 首次申请办理残疾人证人员,需持申请人居民身份证,户口簿和3张两寸近期免冠白底彩照,到县残联办证窗口(县政务服务中心一楼1号窗口)提出办证申请,填写《中华人民共和国残疾人证申请表》.如因身体原因个人无法出行办证,可联系村(社区)工作人员代办申请.', 'icon': None, 'url': 'https://mp.weixin.qq.com/s?__biz=MzIxMzM5ODY5OQ==&mid=2247485042&idx=1&sn=26a4cad0122d24971d3f5ce598af3564&chksm=97b623b6a0c1aaa02f776c19f567e0b3fabdef3d9f5c957e1f260f286fe5356101fd1ac4e675&scene=27', 'ref_id': '2', 'site_name': '微信公众平台', 'title': '残疾人证如何办理?到哪里评定?你想知道的都在这里'}, {'content': '一、残疾人如何办残疾证 1、户口所在地的县、市、区级残联领取《残疾人证申请表》和《残疾评定表》; 2、身份证或户口本复印件一张; 3、两寸彩色相片2-6张(多带不碍事,各地标准不一); 4、残疾类型等级证明。残疾很明显的可以直接到残联进行评级(像肢体类)审核办理,不明显的必须到指定医院、指定医生进行评级签名并盖章。 一切手续完备,就到县、市、区级残联进行办理,快的话立等可取,慢的话7-15天也差不多了。 二、残疾证有什么用? 1、持有残疾证的残疾人可享受低保或持残疾人贫困证的一级肢体、视力、智力、精神、多重及60周岁以上的一级听力、语言的重度残疾人,可享受重度残疾人生活补助。 2、残疾人托(安)养方面,一级重度残疾人(不含听力、语言、视力残疾)或18至60周岁二级重度残疾人(不含听力、语言、视力残疾),集中托养:低保户、贫困户的对象补助每年补助现金按各地政策规定金额发放。', 'icon': 'https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=215799447,688541359&fm=195&app=88&f=JPEG?w=200&h=200', 'url': 'https://mip.66law.cn/laws/1060751.aspx', 'ref_id': '3', 'site_name': '华律网', 'title': '残疾人如何办残疾证-证件办理|华律办事直通车'}]})\n```\n"
  },
  {
    "path": "python/core/components/rag_with_baidu_search_pro/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"\ninit\n\"\"\"\n\nfrom .component import RagWithBaiduSearchPro\n"
  },
  {
    "path": "python/core/components/rag_with_baidu_search_pro/component.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport json\nfrom typing import Optional\nfrom pydantic import Field\nfrom appbuilder.core.component import Component, ComponentArguments\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.utils import ModelInfo, ttl_lru_cache\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.rag_with_baidu_search_pro.model import ParseRagProResponse\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace\nfrom pydantic import BaseModel, Field, conint, confloat\nfrom typing import Optional\n\n\nclass RagWithBaiduSearchProRequest(BaseModel):\n    \"\"\"\n    RagWithBaiduSearchPro 的请求\n\n    Attributes:\n        message (object): 用户的消息\n        stream (bool): 是否流式处理\n        instruction (str): 指令\n        model (Optional[str]): 模型名称\n        temperature (confloat(ge=0, le=1)): 温度，范围在0到1之间\n        top_p (confloat(ge=0, le=1)): top_p，范围在0到1之间\n        search_top_k (conint(ge=1)): search_top_k，\n    \"\"\"\n    message: object\n    stream: bool = False\n    instruction: str\n    model: Optional[str] = None\n    temperature: confloat(ge=0, le=1) = Field(1e-10, description=\"temperature范围在0到1之间\")\n    top_p: confloat(ge=0, le=1) = Field(1e-10, description=\"top_p范围在0到1之间\")\n    search_top_k: conint(ge=1) = Field(4, description=\"search_top_k必须是大于等于1的整数\")\n    hide_corner_markers: bool = True\n\n\nclass RagWithBaiduSearchProArgs(ComponentArguments):\n    \"\"\"\n    RagWithBaiduSearchPro 的参数\n\n    Args:\n        query (str): 用户的 query 输入\n    \"\"\"\n    query: str = Field(..., description=\"用户的 query 输入\", max_length=300)\n\n\nclass RagWithBaiduSearchPro(Component):\n    \"\"\"\n    RagWithBaiduSearchPro 组件\n    \"\"\"\n    name = \"rag_with_baidu_search_pro\"\n    version = \"v1\"\n    meta: RagWithBaiduSearchProArgs\n\n    def __init__(\n            self,\n            model: str,\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = False,\n            instruction: Optional[Message] = None,\n            **kwargs\n    ):\n        super().__init__(\n            meta=RagWithBaiduSearchProArgs, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n        self.model = model\n        self.instruction = instruction\n        self.server_sub_path = \"/v1/ai_engine/copilot_engine/service/v1/baidu_search_rag/general\"\n\n    @ttl_lru_cache(seconds_to_live=1 * 60 * 60)  # 1h\n    def set_secret_key_and_gateway(self, secret_key: Optional[str] = None, gateway: str = \"\"):\n        \"\"\"\n        设置API密钥和网关地址。\n        \n        Args:\n            secret_key (Optional[str], optional): API密钥，默认为None。如果为None，则不会更新现有的API密钥。\n            gateway (str, optional): 网关地址，默认为空字符串。如果为空字符串，则不会更新现有的网关地址。\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super(RagWithBaiduSearchPro, self).set_secret_key_and_gateway(\n            secret_key=secret_key, gateway=gateway)\n        self.__class__.model_info = ModelInfo(client=self.http_client)\n\n    @components_run_trace\n    def run(\n            self,\n            message,\n            stream=False,\n            instruction=None,\n            model=None,\n            temperature=1e-10,\n            top_p=1e-10,\n            search_top_k=4,\n            hide_corner_markers=True\n    ):\n        \"\"\"\n        执行模型推理。\n        \n        Args:\n            message (Message): 待处理的信息对象。\n            stream (bool, optional): 是否以流的形式接收响应数据。默认为False。\n            instruction (Instruction, optional): 指令信息对象。默认为None。\n            model (str, optional): 模型名称。默认为None，表示使用当前实例的模型。\n            temperature (float, optional): 温度参数，控制生成文本的随机性。默认为1e-10。\n            top_p (float, optional): 累积概率阈值，用于控制生成文本的多样性。默认为1e-10。\n            search_top_k (int, optional): 搜索候选结果的数量。默认为4。\n            hide_corner_markers (bool, optional): 是否隐藏响应中的边界标记。默认为True。\n        \n        Returns:\n            Message: 处理后的信息对象。\n        \n        Raises:\n            AppBuilderServerException: 如果输入信息或指令过长，将抛出此异常。\n        \"\"\"\n        if len(message.content) > 300:\n            raise AppBuilderServerException(service_err_message=\"query is too long, expected <= 300, got {}\"\n                                            .format(len(message.content)))\n        if instruction is not None and len(instruction.content) > 1024:\n            raise AppBuilderServerException(service_err_message=\"instruction is too long, expected <= 1024, got {}\"\n                                            .format(len(instruction)))\n\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n\n        req = RagWithBaiduSearchProRequest(\n            message=[\n                {\n                    \"role\": \"user\",\n                    \"content\": message.content\n                }\n            ],\n            stream=stream,\n            instruction=instruction.content if instruction else \"\",\n            model=self.model,\n            temperature=temperature,\n            top_p=top_p,\n            search_top_k=search_top_k,\n            hide_corner_markers=hide_corner_markers\n        )\n        server_url = self.http_client.service_url(sub_path=self.server_sub_path)\n        response = self.http_client.session.post(url=server_url, headers=headers, json=req.model_dump(), stream=stream)\n        self.http_client.check_response_header(response)\n\n        return ParseRagProResponse(response, stream).to_message()\n"
  },
  {
    "path": "python/core/components/rag_with_baidu_search_pro/model.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.core.components.llms.base import CompletionResponse\n\n\nclass ParseRagProResponse(CompletionResponse):\n\n    def __init__(self, response, stream: bool = False):\n        \"\"\"初始化客户端状态。\"\"\"\n        super().__init__(response, stream)\n        self.error_no = 0\n        self.error_msg = \"\"\n        self.log_id = response.headers.get(\"X-Appbuilder-Request-Id\", None)\n        self.extra = {}\n        self.token_usage = {}\n\n        if stream:\n            # 流式数据处理\n            def stream_data():\n                sse_client = SSEClient(response)\n                for event in sse_client.events():\n                    if not event:\n                        continue\n                    answer = self.parse_stream_data(event)\n                    if answer is not None:\n                        yield answer\n\n            self.result = stream_data()\n        else:\n            # 非流式数据的处理\n            if response.status_code != 200:\n                self.error_no = response.status_code\n                self.error_msg = \"error\"\n                self.result = response.text\n\n                raise AppBuilderServerException(self.log_id, self.error_no, self.result)\n\n            else:\n                data = response.json()\n\n                if \"code\" in data and \"message\" in data and \"requestId\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n\n                if \"code\" in data and \"message\" in data and \"status\" in data:\n                    raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n\n                res = data[\"result\"]\n                answer_message = res.get(\"answer_message\")\n                self.result = answer_message.get(\"content\")\n                self.token_usage = answer_message.get(\"token_usage\", {})\n                # 拼装百度搜索的结果\n                extra = answer_message.get(\"extra\")\n                search_baidu_list = []\n\n                for item in extra:\n                    search_baidu_list.append({\n                        \"content\": item.get(\"content\"),\n                        \"icon\": item.get(\"icon\"),\n                        \"url\": item.get(\"url\"),\n                        \"ref_id\": item.get(\"ref_num\"),\n                        \"site_name\": item.get(\"web_anchor\"),\n                        \"title\": item.get(\"title\")\n                    })\n                self.extra = {\n                    \"search_baidu\": search_baidu_list\n                }\n\n    def message_iterable_wrapper(self, message):\n        \"\"\"\n        对模型输出的 Message 对象进行包装。\n        当 Message 是流式数据时，数据被迭代完后，将重新更新 content 为 blocking 的字符串。\n        \"\"\"\n\n        class IterableWrapper:\n            def __init__(self, stream_content):\n                self._content = stream_content\n                self._concat = \"\"\n                self._token_usage = {}\n\n            def __iter__(self):\n                return self\n\n            def __next__(self):\n                try:\n                    result_json = next(self._content)\n\n                    res = result_json[\"result\"]\n                    answer_message = res.get(\"answer_message\")\n                    char = answer_message.get(\"content\", \"\")\n\n                    extra = answer_message.get(\"extra\")\n                    if extra is not None:\n                        search_baidu_list = []\n                        for item in extra:\n                            search_baidu_list.append({\n                                \"content\": item.get(\"content\"),\n                                \"icon\": item.get(\"icon\"),\n                                \"url\": item.get(\"url\"),\n                                \"ref_id\": item.get(\"ref_num\"),\n                                \"site_name\": item.get(\"web_anchor\"),\n                                \"title\": item.get(\"title\")\n                            })\n                        message.extra = {\n                            \"search_baidu\": search_baidu_list\n                        }\n                    else:\n                        message.extra = {}\n                    if \"token_usage\" in answer_message:\n                        self._token_usage = answer_message.get(\"token_usage\")\n                        message.token_usage = self._token_usage\n                    self._concat += char\n                    return char\n                except StopIteration:\n                    message.content = self._concat  # Update the original content\n                    raise\n\n        from collections.abc import Generator\n        if isinstance(message.content, Generator):\n            # Replace the original content with the custom iterable\n            message.content = IterableWrapper(message.content)\n        return message\n"
  },
  {
    "path": "python/core/components/retriever/README.md",
    "content": "# 向量检索\n\n## 简介\nAppbuilder提供多种向量数据库作为向量检索的底座，当前主要支持百度向量数据库、百度 ElasticSearch。\n\n### 功能介绍\n`向量检索-VDB`组件（Baidu VDB Retriever）以百度向量数据库作为向量存储和检索的底座。百度向量数据库是一个专注于多维向量数据的存储、检索和分析的企业级分布式数据库服务。基于百度自主研发的向量数据库内核，VectorDB在保证高性能和高可用性的同时，也特别注重易用性和可扩展性。它支持多种索引类型和相似度计算方法，能够满足各类复杂和多样化的数据应用需求。特别值得一提的是，VectorDB能够管理高达数十亿的向量规模，同时保持毫秒级的查询响应时间，非常适合进行大规模的向量检索和分析任务。\n\n`向量检索-BES`组件（Baidu ElasticSearch Retriever）以百度 ElasticSearch作为向量存储和检索的底座。百度 ElasticSearch是一款专为企业级需求设计的分布式搜索和分析服务，它在全面兼容开源ElasticSearch的基础上，提供了更多增强功能。这款服务的核心优势在于其高性能和高可靠性，它为处理结构化和非结构化数据提供了一个低成本且高效的平台。对于关注数据安全的客户来说，百度ElasticSearch提供了先进的权限管理机制，使得您可以根据业务需求自由地配置集群权限。\n\n"
  },
  {
    "path": "python/core/components/retriever/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .bes import BESVectorStoreIndex\nfrom .bes import BESRetriever\n\nfrom .baidu_vdb import BaiduVDBVectorStoreIndex\nfrom .baidu_vdb import BaiduVDBRetriever\nfrom .baidu_vdb import TableParams"
  },
  {
    "path": "python/core/components/retriever/baidu_vdb/README.md",
    "content": "# 向量检索-VectorDB（BaiduVectorDBRetriever）\n\n## 简介\n向量检索-VectorDB（BaiduVectorDBRetriever）基于一款百度向量数据库的内容检索组件，支持根据文本的向量的相似度进行内容检索。\n\n### 功能介绍\n向量检索-VectorDB（BaiduVectorDBRetriever）用于在将文本内容输入到百度向量数据库，根据文本的向量相似度进行高效的内容检索。\n\n### 特色优势\n高效准确：基于百度向量数据库的强大能力，提供高效且准确的内容检索功能。\n\n### 应用场景\n各种内容检索场景\n\n## 准备工作\n在使用向量检索-VectorDB（BaiduVectorDBRetriever）进行内容检索之前，需要到百度向量数据库官网创建相应的实例，[教程](https://cloud.baidu.com/doc/VDB/s/hlrsoazuf)。\n\n## 基本用法\n\n以下是有关如何开始使用向量检索-VectorDB（BaiduVectorDBRetriever）的代码示例：\n\n补充说明：\n- `you_vdb_instance_id` 为VectorDB 实例ID，请替换为您的实例ID，在VectorDB控制台界面上可以查看\n- `your_api_key` 为您在VectorDB上申请的账户密钥，请替换为您自己的root账户密钥，在VectorDB控制台界面上可以查看\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nsegments = appbuilder.Message([\"文心一言大模型\", \"百度在线科技有限公司\"])\n# 初始化构建索引\nvector_index = appbuilder.BaiduVDBVectorStoreIndex.from_params(\n    instance_id=your_instance_id,\n    api_key=your_api_key,\n    drop_exists=True,\n)\nvector_index.add_segments(segments)\n\nquery = appbuilder.Message(\"文心一言\")\nretriever = vector_index.as_retriever()\nres = retriever(query)\nprint(res)\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数说明：\n`BaiduVDBVectorStoreIndex()` 实例化参数说明：\n- instance_id（str，必填）：百度向量数据库的实例id，创建实例时获取\n- api_key    （str，必填）：连接向量数据库所需的密码，创建实例时获取\n- account    （str，非必填）：连接向量数据库所需的用户名，默认root\n- database_name （str，非必填） ：向量数据库的名称，默认为AppBuilderDatabase\n- table_params （TableParams，非必填） ：VectorDB table参数，参考链接[VectorDB table params](https://cloud.baidu.com/doc/VDB/s/mlrsob0p6)\n- embedding   （Embedding，非必填） ：appbuilder.Embedding类型，若有构造好的Embedding，可以增量插入，否则默认新建embedding\n\n-------\n\n`BaiduVDBVectorStoreIndex().from_params()` 构造函数参数说明：\n- instance_id（str，必填）：百度向量数据库的实例id，创建实例时获取\n- api_key    （str，必填）：连接向量数据库所需的密码，创建实例时获取\n- account    （str，非必填）：连接向量数据库所需的用户名，默认root\n- database_name （str，非必填） ：向量数据库的名称，默认为AppBuilderDatabase\n- table_name  （str，非必填） ：向量数据库的表名，默认为AppBuilderTable\n- drop_exists (bool, 非必填) ：是否清空数据库历史记录，默认为False\n\n-------\n\n\n### 调用参数：\n\n`BaiduVDBRetriever().run()` 函数参数说明：\n\n| 参数名称    | 参数类型   |是否必须 | 描述               | 示例值           |\n|---------|--------|--------|------------------|---------------|\n| message | String |是 | 需要检索的内容, 类型为Message，content类型为str, 长度要求(0,512)          | \"中国2023人均GDP\" |\n| top_k   | int    |否 | 返回相似度最高的top_k个内容,top_k的数值范围(1,embedding索引数量] | 1             |\n\n\n### 响应参数\n\n`BaiduVDBRetriever().run()` 函数返回值说明：\n\n| 参数名称 | 参数类型   | 描述  | 示例值                |\n|------|--------|-----|--------------------|\n| text | string | 检索结果 | \"中国2023年人均GDP8.94万元\" |\n| score | float  | 相似度 | 0.95               |\n| meta | dict   | 元信息 | \"\"                   |\n### 响应示例\n```json\n{\"text\": \"中国2023年人均GDP8.94万元\", \"score\": 0.95, \"meta\": \"\"}\n```\n\n## 高级用法：\n\n本组件根据向量的相似度进行检索，支持使用不同的embedding方法和索引方式来优化检索的效果。\n\n## 更新记录和贡献\n* 向量检索能力 (2024-03)\n"
  },
  {
    "path": "python/core/components/retriever/baidu_vdb/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .component import BaiduVDBVectorStoreIndex\nfrom .component import BaiduVDBRetriever\nfrom .component import TableParams"
  },
  {
    "path": "python/core/components/retriever/baidu_vdb/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n基于Baidu VDB的retriever\n\"\"\"\nimport os\nimport time\nfrom typing import Dict, Any\nfrom appbuilder.core.component import Component, Message\nfrom appbuilder.core.components.embeddings.component import Embedding\nfrom appbuilder.core.constants import GATEWAY_URL\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom .model import *\n\n\ndef _try_import() -> None:\n    try:\n        import pymochow\n    except ImportError:\n        raise ImportError(\n            \"pymochow module is not installed. \"\n            \"Please install it using 'pip install pymochow'.\"\n        )\n\nclass TableParams:\n    \"\"\"\n    Baidu VectorDB table params.\n    See the following documentation for details:\n    https://cloud.baidu.com/doc/VDB/s/mlrsob0p6\n    \n    Args:\n        dimension int: The dimension of vector.\n        replication int: The number of replicas in the table.\n        partition int: The number of partitions in the table.\n        index_type (Optional[str]): HNSW, FLAT... Default value is \"HNSW\"\n        metric_type (Optional[str]): L2, COSINE, IP. Default value is \"L2\"\n        drop_exists (Optional[bool]): Delete the existing Table. Default value is False.\n        vector_params (Optional[Dict]):\n          if HNSW set parameters: `M` and `efConstruction`, for example `{'M': 16, efConstruction: 200}`\n          default is HNSW\n    \"\"\"\n\n    def __init__(\n        self,\n        dimension: int,\n        table_name: str = DEFAULT_TABLE_NAME,\n        replication: int = DEFAULT_REPLICA,\n        partition: int = DEFAULT_PARTITION,\n        index_type: str = DEFAULT_INDEX_TYPE,\n        metric_type: str = DEFAULT_METRIC_TYPE,\n        drop_exists: bool = False,\n        vector_params: Dict = None,\n    ):\n        self.dimension = dimension\n        self.table_name = table_name\n        self.replication = replication\n        self.partition = partition\n        self.index_type = index_type\n        self.metric_type = metric_type\n        self.drop_exists = drop_exists\n        self.vector_params = vector_params\n\n\nclass BaiduVDBVectorStoreIndex:\n    \"\"\"\n    Baidu VDB向量存储检索工具\n    \"\"\"\n    vdb_uri_prefix = b\"/api/v1/bce/vdb/instance/\"\n\n    def __init__(\n        self,\n        instance_id: str,\n        api_key: str,\n        account: str = DEFAULT_ACCOUNT,\n        database_name: str = DEFAULT_DATABASE_NAME,\n        table_params: TableParams = TableParams(dimension=384),\n        embedding=None,\n    ):\n        if not isinstance(instance_id, str):\n            raise TypeError(\n                \"Parameter `instance_id` must be a string, but got {}\".format(\n                    type(instance_id)))\n        if not isinstance(api_key, str):\n            raise TypeError(\n                \"Parameter `api_key` must be a string, but got {}\".format(\n                    type(api_key)))\n        if not isinstance(account, str):\n            raise TypeError(\n                \"Parameter `account` must be a string, but got {}\".format(\n                    type(account)))\n        if not isinstance(database_name, str):\n            raise TypeError(\n                \"Parameter `database_name` must be a string, but got {}\".format(\n                    type(database_name)))\n        if not isinstance(table_params, TableParams):\n            raise TypeError(\n                \"Parameter `table_params` must be a TableParams, but got {}\".format(\n                    type(table_params)))\n        if embedding is not None and not isinstance(embedding, Embedding):\n            raise TypeError(\n                \"Parameter `embedding` must be a Embedding, but got {}\".format(\n                    type(embedding)))\n\n        if embedding is None:\n            embedding = Embedding()\n\n        self.embedding = embedding\n\n        self._init_client(instance_id, account, api_key)\n        self._create_database_if_not_exists(database_name)\n        self._create_table(table_params)\n\n    def _init_client(self, instance_id, account, api_key):\n        \"\"\"\n        创建一个vdb的client\n        \"\"\"\n        import pymochow\n        from pymochow.configuration import Configuration\n        from pymochow.auth.bce_credentials import AppBuilderCredentials\n\n        gateway = os.getenv(\"GATEWAY_URL\") if os.getenv(\n            \"GATEWAY_URL\") else GATEWAY_URL\n        appbuilder_token = os.getenv(\"APPBUILDER_TOKEN\")\n        uri_prefix = self.vdb_uri_prefix + instance_id.encode('utf-8')\n\n        config = Configuration(\n            credentials=AppBuilderCredentials(\n                account, api_key, appbuilder_token),\n            endpoint=gateway,\n            uri_prefix=uri_prefix,\n            connection_timeout_in_mills=DEFAULT_TIMEOUT_IN_MILLS,\n        )\n        self.vdb_client = pymochow.MochowClient(config)\n\n    def _create_database_if_not_exists(self, database_name: str) -> None:\n        db_list = self.vdb_client.list_databases()\n\n        if database_name in [db.database_name for db in db_list]:\n            self.database = self.vdb_client.database(database_name)\n        else:\n            self.database = self.vdb_client.create_database(database_name)\n\n    def _create_table(self, table_params: TableParams) -> None:\n        import pymochow\n\n        if table_params is None:\n            raise ValueError(VALUE_NONE_ERROR.format(\"table_params\"))\n\n        try:\n            self.table = self.database.describe_table(table_params.table_name)\n            if table_params.drop_exists:\n                self.database.drop_table(table_params.table_name)\n                # wait db release resource\n                time.sleep(5)\n                self._create_table_in_db(table_params)\n        except pymochow.exception.ServerError:\n            self._create_table_in_db(table_params)\n\n    def _create_table_in_db(\n        self,\n        table_params: TableParams,\n    ) -> None:\n        from pymochow.model.enum import FieldType\n        from pymochow.model.schema import Field, Schema, SecondaryIndex, VectorIndex\n        from pymochow.model.table import Partition\n\n        index_type = self._get_index_type(table_params.index_type)\n        metric_type = self._get_metric_type(table_params.metric_type)\n        vector_params = self._get_index_params(index_type, table_params)\n        fields = []\n        fields.append(\n            Field(\n                FIELD_ID,\n                FieldType.UINT64,\n                primary_key=True,\n                partition_key=True,\n                auto_increment=True,\n                not_null=True,\n            )\n        )\n        fields.append(Field(FIELD_METADATA, FieldType.STRING))\n        fields.append(Field(FIELD_TEXT, FieldType.STRING))\n        fields.append(\n            Field(\n                FIELD_VECTOR,\n                FieldType.FLOAT_VECTOR,\n                dimension=table_params.dimension,\n                not_null=True,\n            )\n        )\n\n        indexes = []\n        indexes.append(\n            VectorIndex(\n                index_name=INDEX_VECTOR,\n                index_type=index_type,\n                field=FIELD_VECTOR,\n                metric_type=metric_type,\n                params=vector_params,\n            )\n        )\n\n        schema = Schema(fields=fields, indexes=indexes)\n        self.table = self.database.create_table(\n            table_name=table_params.table_name,\n            replication=table_params.replication,\n            partition=Partition(partition_num=table_params.partition),\n            schema=Schema(fields=fields, indexes=indexes),\n            enable_dynamic_field=True,\n        )\n        # need wait 10s to wait proxy sync meta\n        time.sleep(10)\n\n    @staticmethod\n    def _get_index_params(index_type: Any, table_params: TableParams) -> None:\n        from pymochow.model.enum import IndexType\n        from pymochow.model.schema import HNSWParams\n\n        vector_params = (\n            {} if table_params.vector_params is None else table_params.vector_params\n        )\n\n        if index_type == IndexType.HNSW:\n            return HNSWParams(\n                m=vector_params.get(\"M\", DEFAULT_HNSW_M),\n                efconstruction=vector_params.get(\n                    \"efConstruction\", DEFAULT_HNSW_EF_CONSTRUCTION\n                ),\n            )\n        return None\n\n    @staticmethod\n    def _get_index_type(index_type_value: str) -> Any:\n        from pymochow.model.enum import IndexType\n\n        index_type_value = index_type_value or IndexType.HNSW\n        try:\n            return IndexType(index_type_value)\n        except ValueError:\n            support_index_types = [\n                d.value for d in IndexType.__members__.values()]\n            raise ValueError(\n                NOT_SUPPORT_INDEX_TYPE_ERROR.format(\n                    index_type_value, support_index_types\n                )\n            )\n\n    @staticmethod\n    def _get_metric_type(metric_type_value: str) -> Any:\n        from pymochow.model.enum import MetricType\n\n        metric_type_value = metric_type_value or MetricType.L2\n        try:\n            return MetricType(metric_type_value.upper())\n        except ValueError:\n            support_metric_types = [\n                d.value for d in MetricType.__members__.values()]\n            raise ValueError(\n                NOT_SUPPORT_METRIC_TYPE_ERROR.format(\n                    metric_type_value, support_metric_types\n                )\n            )\n\n    @property\n    def client(self) -> Any:\n        \"\"\"\n        获取客户端对象。\n        \n        Args:\n            无参数\n        \n        Returns:\n            Any: 返回客户端对象，具体类型依赖于vdb_client属性的值。\n        \"\"\"\n        return self.vdb_client\n\n    def as_retriever(self):\n        \"\"\"\n        将对象转化为retriever\n        \n        Args:\n            无\n        \n        Returns:\n            BaiduVDBRetriever: 转化后的retriever对象\n        \n        \"\"\"\n        return BaiduVDBRetriever(\n            embedding=self.embedding,\n            table=self.table,\n        )\n\n    def add_segments(self, segments: Message, metadata=\"\"):\n        \"\"\"\n        向bes中插入数据段\n        \n        Args:\n            segments (Message): 需要插入的数据段。\n            metadata (str, optional): 元数据，默认为空字符串。\n        \n        Returns:\n            无返回值\n        \n        Raises:\n            ValueError: 如果segments为空，则抛出此异常。\n        \n        \"\"\"\n        from pymochow.model.table import Row\n\n        segment_vectors = self.embedding.batch(segments)\n        segment_vectors = segment_vectors.content\n        vector_dims = len(segment_vectors[0])\n        segments = segments.content\n        if len(segments) == 0:\n            raise ValueError(\"segments is emtpty\")\n\n        rows = []\n        for segment, vector in zip(segments, segment_vectors):\n            row = Row(text=segment, vector=vector, metadata=metadata)\n            rows.append(row)\n        if len(rows) >= DEFAULT_BATCH_SIZE:\n            self.collection.upsert(rows=rows)\n            rows = []\n\n        if len(rows) > 0:\n            self.table.upsert(rows=rows)\n\n    @classmethod\n    def from_params(\n        cls,\n        instance_id: str,\n        api_key: str,\n        account: str = DEFAULT_ACCOUNT,\n        database_name: str = DEFAULT_DATABASE_NAME,\n        table_name: str = DEFAULT_TABLE_NAME,\n        drop_exists: bool = False,\n        **kwargs,\n    ):\n        \"\"\"\n        从参数中实例化类。\n        \n        Args:\n            cls (type): 类对象，即当前函数所属的类。\n            instance_id (str): 实例ID。\n            api_key (str): API密钥。\n            account (str, optional): 账户名，默认为'root'。 Defaults to DEFAULT_ACCOUNT.\n            database_name (str, optional): 数据库名，默认为'AppBuilderDatabase'。 Defaults to DEFAULT_DATABASE_NAME.\n            table_name (str, optional): 表名，默认为'AppBuilderTable'。 Defaults to DEFAULT_TABLE_NAME.\n            drop_exists (bool, optional): 是否删除已存在的表，默认为False。 Defaults to False.\n            **kwargs: 其他参数，可选的维度参数dimension默认为384。\n        \n        Returns:\n            cls: 类实例，包含实例ID、账户名、API密钥、数据库名、表参数等属性。\n        \n        \"\"\"\n        _try_import()\n        dimension = kwargs.get(\"dimension\", 384)\n\n        if not isinstance(instance_id, str):\n            raise TypeError(\"instance_id must be a string. but got {}\".format(\n                type(instance_id)))\n        if not isinstance(api_key, str):\n            raise TypeError(\"api_key must be a string. but got {}\".format(\n                type(api_key)))\n        if not isinstance(account, str):\n            raise TypeError(\"account must be a string. but got {}\".format(\n                type(account)))\n        if not isinstance(database_name, str):\n            raise TypeError(\"database_name must be a string. but got {}\".format(\n                type(database_name)))\n        if not isinstance(table_name, str):\n            raise TypeError(\"table_name must be a string. but got {}\".format(\n                type(table_name)))\n        if not isinstance(drop_exists, bool):\n            raise TypeError(\"drop_exists must be a boolean. but got {}\".format(\n                type(drop_exists)))\n\n        table_params = TableParams(\n            dimension=dimension,\n            table_name=table_name,\n            drop_exists=drop_exists,\n        )\n        return cls(\n            instance_id=instance_id,\n            account=account,\n            api_key=api_key,\n            database_name=database_name,\n            table_params=table_params,\n        )\n\n\nclass BaiduVDBRetriever(Component):\n    \"\"\"\n    向量检索组件，用于检索和query相匹配的内容\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        segments = appbuilder.Message([\"文心一言大模型\", \"百度在线科技有限公司\"])\n        vector_index = appbuilder.BaiduVDBVectorStoreIndex.from_params(\n                self.instance_id,\n                self.api_key,\n        )\n        vector_index.add_segments(segments)\n\n        query = appbuilder.Message(\"文心一言\")\n        time.sleep(5)\n        retriever = vector_index.as_retriever()\n        res = retriever(query)\n\n    \"\"\"\n    name: str = \"BaiduVectorDBRetriever\"\n    tool_desc: Dict[str, Any] = {\n        \"description\": \"a retriever based on Baidu VectorDB\"}\n\n    def __init__(self, \n                 embedding, \n                 table,\n                 **kwargs\n                 ):\n        super().__init__()\n\n        self.embedding = embedding\n        self.table = table\n\n    @components_run_trace\n    def run(self, query: Message, top_k: int = 1):\n        \"\"\"\n        根据query进行查询\n        \n        Args:\n            query (Message[str]): 需要查询的内容，类型为Message，包含要查询的文本。\n            top_k (int, optional): 查询结果中匹配度最高的top_k个结果，默认为1。\n        \n        Returns:\n            Message[Dict]: 查询到的结果，包含文本和匹配得分。\n        \n        Raises:\n            TypeError: 如果query不是Message类型，或者top_k不是整数类型。\n            ValueError: 如果top_k不是正整数，或者query的内容为空字符串，或者长度超过512个字符。\n        \n        \"\"\"\n        from pymochow.model.table import AnnSearch, HNSWSearchParams\n        from pymochow.model.enum import ReadConsistency\n\n        if not isinstance(query, Message):\n            raise TypeError(\"Parameter `query` must be a Message, but got {}\"\n                            .format(type(query)))\n        if not isinstance(top_k, int):\n            raise TypeError(\"Parameter `top_k` must be a int, but got {}\"\n                            .format(type(top_k)))\n        if top_k <= 0:\n            raise ValueError(\"Parameter `top_k` must be a positive integer, but got {}\"\n                             .format(top_k))\n\n        content = query.content\n        if not isinstance(content, str):\n            raise ValueError(\"Parameter `query` content is not a string, got: {}\"\n                             .format(type(content)))\n        if len(content) == 0:\n            raise ValueError(\"Parameter `query` content is empty\")\n        if len(content) > 512:\n            raise ValueError(\n                \"Parameter `query` content is too long, max length per batch size is 512\")\n\n        query_embedding = self.embedding(query)\n        anns = AnnSearch(\n            vector_field=FIELD_VECTOR,\n            vector_floats=query_embedding.content,\n            params=HNSWSearchParams(ef=10, limit=top_k),\n        )\n        res = self.table.search(\n            anns=anns, read_consistency=ReadConsistency.STRONG)\n        rows = res.rows\n        docs = []\n        if rows is None or len(rows) == 0:\n            return Message(docs)\n\n        for row in rows:\n            row_data = row.get(\"row\", {})\n            docs.append({\n                \"text\": row_data.get(FIELD_TEXT),\n                \"meta\": row_data.get(FIELD_METADATA),\n                \"score\": row.get(\"score\")\n            })\n\n        return Message(docs)\n"
  },
  {
    "path": "python/core/components/retriever/baidu_vdb/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n基于Baidu VDB的retriever\n\"\"\"\nimport os\nimport time\nfrom typing import Dict, Any\nfrom appbuilder.core.component import Message\nfrom appbuilder.core.components.embeddings.component import Embedding\nfrom appbuilder.core.constants import GATEWAY_URL\n\nDEFAULT_ACCOUNT = \"root\"\nDEFAULT_DATABASE_NAME = \"AppBuilderDatabase\"\nDEFAULT_TABLE_NAME = \"AppBuilderTable\"\nDEFAULT_TIMEOUT_IN_MILLS: int = 30 * 1000\n\nDEFAULT_PARTITION = 1\nDEFAULT_REPLICA = 3\nDEFAULT_INDEX_TYPE = \"HNSW\"\nDEFAULT_METRIC_TYPE = \"L2\"\n\nDEFAULT_HNSW_M = 16\nDEFAULT_HNSW_EF_CONSTRUCTION = 200\nDEFAULT_HNSW_EF = 10\n\nDEFAULT_BATCH_SIZE = 1000\n\nFIELD_ID: str = \"id\"\nFIELD_TEXT: str = \"text\"\nFIELD_VECTOR: str = \"vector\"\nFIELD_METADATA: str = \"metadata\"\nINDEX_VECTOR: str = \"vector_idx\"\n\nVALUE_NONE_ERROR = \"Parameter `{}` can not be None.\"\nNOT_SUPPORT_INDEX_TYPE_ERROR = (\n    \"Unsupported index type: `{}`, supported index types are {}\"\n)\nNOT_SUPPORT_METRIC_TYPE_ERROR = (\n    \"Unsupported metric type: `{}`, supported metric types are {}\"\n)\n"
  },
  {
    "path": "python/core/components/retriever/bes/README.md",
    "content": "# 向量检索-BES（BaiduElasticSearchRetriever）\n\n## 简介\n向量检索-BES组件（BaiduElasticSearchRetriever）基于一款Baidu ElasticSearch的内容检索组件，支持根据文本的向量的相似度进行内容检索。\n\n### 功能介绍\n向量检索-BES组件（BaiduElasticSearchRetriever）用于在将文本内容输入到Baidu ElasticSearch，根据文本的向量相似度进行高效的内容检索。\n\n### 特色优势\n- 高效准确：基于Baidu ElasticSearch的强大能力，提供高效且准确的内容检索功能。\n\n### 应用场景\n各种内容检索场景\n\n## 准备工作\n在使用BaiduElasticSearchRetriever进行内容检索之前，需要到Baidu ElasticSearch官网创建相应的集群，详情见[教程](https://cloud.baidu.com/doc/BES/s/gke3ocf89)。\n\n注：创建集群时请选择7.10.2版本的ES，否则可能无法使用本组件。\n\n## 基本用法\n\n以下是有关如何开始使用BESRetriever的代码示例：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nembedding = appbuilder.Embedding()\nsegments = appbuilder.Message([\"文心一言大模型\", \"百度在线科技有限公司\"])\n# 初始化构建索引\nvector_index = appbuilder.BESVectorStoreIndex.from_segments(segments=segments, cluster_id=es_cluster_id, user_name=es_username, \n                                                            password=es_password, embedding=embedding)\n# 获取当前索引中的全部内容\nall_content = vector_index.get_all_segments()\nprint(all_content)\n# 转化为retriever\nretriever = vector_index.as_retriever()\n# 按照query进行检索\nquery = appbuilder.Message(\"文心一言\")\nres = retriever(query=query, top_k=1)\nprint(res)\n# 删除当前索引中的全部内容\nvector_index.delete_all_segments()\n```\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数说明：\n\n- segments （Message[List[str]]，必填）：需要入库的文本段落\n- cluster_id （str，必填）：ElacticSearch集群的id，创建集群时获取\n- user_name  （str，必填）：连接ES集群所需的用户名，创建集群时获取\n- password   （str，必填）：连接ES集群所需的密码，创建集群时获取\n- embedding  （obj，非必填）：用于将文本转为向量的模型，默认为Embedding\n\n### 调用参数：\n| 参数名称    | 参数类型   |是否必须 | 描述               | 示例值           |\n|---------|--------|--------|------------------|---------------|\n| message | String |是 | 需要检索的内容          | \"中国2023人均GDP\" |\n| top_k   | int    |否 | 返回相似度最高的top_k个内容 | 1             |\n\n### 响应参数\n| 参数名称 | 参数类型   | 描述  | 示例值                |\n|------|--------|-----|--------------------|\n| text | string | 检索结果 | \"中国2023年人均GDP8.94万元\" |\n| score | float  | 相似度 | 0.95               |\n| meta | dict   | 元信息 | \"\"                   |\n### 响应示例\n```json\n{\"text\": \"中国2023年人均GDP8.94万元\", \"score\": 0.95, \"meta\": \"\"}\n```\n\n## 高级用法：\n\n本组件根据向量的相似度进行检索，支持使用不同的embedding方法和索引方式来优化检索的效果。\n\n## 更新记录和贡献\n* 向量检索能力 (2023-12)"
  },
  {
    "path": "python/core/components/retriever/bes/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .component import BESVectorStoreIndex\nfrom .component import BESRetriever\n"
  },
  {
    "path": "python/core/components/retriever/bes/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n基于baidu ES的retriever\n\"\"\"\nimport importlib\nimport os\nimport uuid\nimport random\nimport string\nfrom typing import Dict, Any\nfrom appbuilder.core.component import Component, Message\nfrom appbuilder.core.components.embeddings.component import Embedding\nfrom appbuilder.core.constants import GATEWAY_URL\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder import get_default_header\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass BESVectorStoreIndex:\n    \"\"\"\n    BES向量存储检索工具\n    \"\"\"\n    base_es_url: str = \"/v1/bce/bes/cluster/\"\n\n    def __init__(self, cluster_id, user_name, password, embedding=None, index_name=None,\n                 index_type=\"hnsw\", prefix=\"/rpc/2.0/cloud_hub\"):\n\n        if embedding is None:\n            embedding = Embedding()\n\n        self.embedding = embedding\n        self.index_name = index_name if index_name else BESVectorStoreIndex.generate_id()\n        self.index_type = index_type\n        self.prefix = prefix\n\n        self._es = None\n        self._helpers = None\n        self.bes_client = self._create_bes_client(cluster_id, user_name, password)\n\n    @property\n    def es(self):\n        \"\"\"\n        获取Elasticsearch客户端实例。\n        \n        Args:\n            无\n        \n        Returns:\n            Elasticsearch客户端实例。\n        \n        \"\"\"\n        self._lazy_import_es()\n        return self._es\n\n    @property\n    def helpers(self):\n        \"\"\"\n        获取帮助器实例。\n        \n        Args:\n            无\n        \n        Returns:\n            _helpers (对象): 帮助器实例。\n        \n        \"\"\"\n        self._lazy_import_es()\n        return self._helpers\n\n    def _lazy_import_es(self):\n        if self._es is None or self._helpers is None:\n            try:\n                from elasticsearch import Elasticsearch, helpers\n                self._es = Elasticsearch\n                self._helpers = helpers\n            except ImportError:\n                raise ImportError(\"Elasticsearch module is not installed. \"\n                                  \"Please install it using 'pip install elasticsearch==7.11.0'.\")\n\n    @staticmethod\n    def generate_id(length=16):\n        \"\"\"\n        生成随机的ID。\n        \n        Args:\n            length (int, optional): 生成ID的长度，默认为16。\n        \n        Returns:\n            str: 生成的随机ID。\n        \n        \"\"\"\n        return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length))\n\n    def _create_bes_client(self, cluster_id, user_name, password):\n        \"\"\"\n        创建一个BES客户端。\n        \n        Args:\n            cluster_id (str): BES集群的ID。\n            user_name (str): 用于连接BES的用户名。\n            password (str): 用于连接BES的密码。\n        \n        Returns:\n            Elasticsearch: 初始化好的BES客户端。\n        \n        Raises:\n            ConnectionError: 如果无法连接到BES集群，则抛出此异常。\n        \n        \"\"\"\n        secret_key = os.getenv(\"APPBUILDER_TOKEN\")\n        if not secret_key.startswith(\"Bearer\"):\n            secret_key = \"Bearer {}\".format(secret_key)\n\n        gateway = os.getenv(\"GATEWAY_URL\") if os.getenv(\"GATEWAY_URL\") else GATEWAY_URL\n\n        headers = get_default_header()\n        headers[\"X-Appbuilder-Request-Id\"] = str(uuid.uuid4())\n        headers[\"X-Appbuilder-Authorization\"] = f\"{secret_key}\"\n        connection_params = {\n            \"hosts\": [gateway + self.prefix + self.base_es_url + cluster_id],\n            \"http_auth\": (user_name, password),\n            \"headers\": headers\n        }\n\n        bes_client = self.es(**connection_params)\n\n        try:\n            bes_client.info()\n        except Exception as e:\n            logger.error(\"connecting to bes error: {}\".format(e))\n            raise ConnectionError(e)\n\n        return bes_client\n\n    def as_retriever(self):\n        \"\"\"\n        将当前对象转化为retriever。\n        \n        Args:\n            无\n        \n        Returns:\n            BESRetriever: 转化后的retriever对象\n        \n        \"\"\"\n        return BESRetriever(embedding=self.embedding, index_name=self.index_name, bes_client=self.bes_client,\n                            index_type=self.index_type)\n\n    @staticmethod\n    def create_index_mappings(index_type, vector_dims):\n        \"\"\"\n        创建索引的mapping\n        \n        Args:\n            index_type (str): 索引类型，如\"hnsw\"\n            vector_dims (int): 向量的维度\n        \n        Returns:\n            dict: 索引的mapping配置\n        \n        \"\"\"\n        mappings = {\n            'properties': {\n                \"vector\": {\n                    \"type\": \"bpack_vector\",\n                    \"dims\": vector_dims,\n                },\n            }\n        }\n        if index_type == \"hnsw\":\n            mappings[\"properties\"][\"vector\"][\"index_type\"] = \"hnsw\"\n            mappings[\"properties\"][\"vector\"][\"space_type\"] = \"cosine\"\n            mappings[\"properties\"][\"vector\"][\"parameters\"] = {\"m\": 4, \"ef_construction\": 200}\n        return mappings\n\n    def add_segments(self, segments: Message, metadata=\"\"):\n        \"\"\"\n        向BES中插入数据\n        \n        Args:\n            segments (Message[str]): 需要插入的内容，包含多个文本段\n            metadata (str, optional): 元数据，默认为空字符串。\n        \n        Returns:\n            无返回值\n        \"\"\"\n        segment_vectors = self.embedding.batch(segments)\n        segment_vectors = segment_vectors.content\n        vector_dims = len(segment_vectors[0])\n        segments = segments.content\n        documents = [\n            {\"_index\": self.index_name,\n             \"_source\": {\"text\": segment, \"vector\": vector, \"metadata\": metadata,\n                         \"id\": BESVectorStoreIndex.generate_id()}}\n            for segment, vector in zip(segments, segment_vectors)]\n\n        mappings = BESVectorStoreIndex.create_index_mappings(self.index_type, vector_dims)\n        self.bes_client.indices.create(index=self.index_name,\n                                       body={\"settings\": {\"index\": {\"knn\": True}}, \"mappings\": mappings})\n        self.helpers.bulk(self.bes_client, documents)\n\n    @classmethod\n    def from_segments(cls, segments, cluster_id, user_name, password, embedding=None, **kwargs):\n        \"\"\"\n        根据段落创建一个bes向量索引。\n        \n        Args:\n            segments (list): 切分的文本段落列表。\n            cluster_id (str): bes集群ID。\n            user_name (str): bes用户名。\n            password (str): bes用户密码。\n            embedding (Embedding, optional): 文本段落embedding工具，默认为None，使用默认的Embedding类。\n            **kwargs: 其他初始化参数。\n        \n        Returns:\n            BesVectorIndex: bes索引实例。\n        \n        \"\"\"\n        if embedding is None:\n            embedding = Embedding()\n\n        index_name = kwargs.get(\"index_name\", None)\n        index_type = kwargs.get(\"index_type\", \"hnsw\")\n        prefix = kwargs.get(\"prefix\", \"/rpc/2.0/cloud_hub\")\n\n        vector_index = cls(cluster_id, user_name, password, embedding, index_name, index_type, prefix)\n        vector_index.add_segments(segments)\n        return vector_index\n\n    def delete_all_segments(self):\n        \"\"\"\n        删除索引中的全部内容。\n        \n        Args:\n            无\n        \n        Returns:\n            无\n        \n        \"\"\"\n        query = {\n            'query': {\n                'match_all': {}\n            }\n        }\n        resp = self.bes_client.delete_by_query(index=self.index_name, body=query)\n        logger.debug(\"deleted {} documents in index {}\".format(resp['deleted'], self.index_name))\n\n    def get_all_segments(self):\n        \"\"\"\n        获取索引中的全部内容\n        \"\"\"\n        query = {\n            'query': {\n                'match_all': {}\n            }\n        }\n        return self.bes_client.search(index=self.index_name, body=query)\n\nclass BESRetriever(Component):\n    \"\"\"\n    向量检索组件，用于检索和query相匹配的内容\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        segments = appbuilder.Message([\"文心一言大模型\", \"百度在线科技有限公司\"])\n        vector_index = appbuilder.BESVectorStoreIndex.from_segments(segments, self.cluster_id, self.username,\n                                                                    self.password)\n        query = appbuilder.Message(\"文心一言\")\n        time.sleep(5)\n        retriever = vector_index.as_retriever()\n        res = retriever(query)\n\n    \"\"\"\n    name: str = \"BaiduElasticSearchRetriever\"\n    tool_desc: Dict[str, Any] = {\"description\": \"a retriever based on Baidu ElasticSearch\"}\n    base_es_url: str = \"/v1/bce/bes/cluster/\"\n\n    def __init__(self, \n                 embedding, \n                 index_name, \n                 bes_client, \n                 index_type=\"hnsw\",\n                 **kwargs\n                 ):\n        super().__init__()\n\n        self.embedding = embedding\n        self.index_name = index_name\n        self.bes_client = bes_client\n        self.index_type = index_type\n\n    @components_run_trace\n    def run(self, query: Message, top_k: int = 1):\n        \"\"\"\n        根据query进行查询\n        \n        Args:\n            query (Message[str]): 需要查询的内容，以Message对象的形式传递。\n            top_k (int, optional): 查询结果中匹配度最高的top_k个结果。默认为1。\n        \n        Returns:\n            obj (Message[Dict]): 查询到的结果，包含文本、元数据以及匹配得分，以Message对象的形式返回。\n        \n        \"\"\"\n        query_embedding = self.embedding(query)\n        vector_query = {\"vector\": query_embedding.content, \"k\": top_k}\n        if self.index_type == \"linear\":\n            vector_query[\"linear\"] = True\n        else:\n            vector_query[\"ef\"] = 10\n\n        query_body = {\n            \"size\": top_k,\n            \"query\": {\"knn\": {\"vector\": vector_query}}\n        }\n        res = self.bes_client.search(index=self.index_name, body=query_body)\n        docs = []\n        for r in res[\"hits\"][\"hits\"]:\n            docs.append({\"text\": r[\"_source\"][\"text\"], \"meta\": r[\"_source\"][\"metadata\"], \"score\": r[\"_score\"]})\n\n        return Message(docs)\n"
  },
  {
    "path": "python/core/components/retriever/reranker/README.md",
    "content": "# 文本精排（Reranker）\n\n## 简介\n文本精排能力，将Query召回到的N个候选文本段落进行精排；保证与Query相关程度越高的文本段落排序越靠前，提升检索效果。\n\n### 功能介绍\n文本精排（Reranker）用于检索排序，输入为Query和Top K个段落，输出为每个段落的排序得分；Query相关程度越高的文本段落排序越靠前，用于提升检索效果。\n\n### 特色优势\n- 高效准确：基于开源模型[\nbce-reranker](https://huggingface.co/maidalun1020/bce-reranker-base_v1)的能力，提供高效且准确的内容检索功能。[百度云推理服务Api](https://cloud.baidu.com/doc/WENXINWORKSHOP/s/xlu216rqn)\n\n### 应用场景\n检索排序场景\n\n\n## 基本用法\n\n以下是有关如何开始使用BESRetriever的代码示例：\n\n```python\nimport os\nimport appbuilder\nfrom appbuilder import Message\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\nreranker = appbuilder.Reranker()\nranked_1 = reranker(\"你好\", [\"他也好\", \"hello?\"])\nprint(ranked_1)\n\n# 使用上游的Message作为输入的代码示例\nranked_2 = reranker(appbuilder.Message(\"你好\"), appbuilder.Message([\"他也好\", \"hello?\"]))\nprint(ranked_2)\n```\n\n## 参数说明\n### 初始化参数说明：\n\n| 参数名称 | 参数类型 |是否必须 | 描述 | 示例值 |\n|---------|--------|--------|------------------|---------------|\n| model | str |是 | 指定底座模型的类型。当前仅支持 bce-reranker-base 作为可选值。若不指定，默认值为 bce-reranker-base。 | bce-reranker-base |\n\n\n### 调用参数：\n\n| 参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |\n|---------|--------|--------|------------------|---------------|\n| query | str |是 | 精排Query，长度小于1600。 | \"你好\" |\n| texts | List[str] | 是 | 精排输入段落，会对列表里的所有内容排序，最大长度为50. | [\"你好\", \"世界\"] |\n\n### 响应参数：\n\n| 参数名称 | 参数类型 | 描述 | 示例值 |\n|---------|--------|------------------|---------------|\n| +document | str | 输入的段落 | \"hello?\" |\n| +relevance_score | float | 精排的相关性分数 | 0.565118 |\n| +index | int | 输入段落的原始index | -- |\n\n\n### 响应示例\n#### 输入\n```python\nquery=\"你好\", text=[\"他也好\", \"hello?\"]\n```\n\n#### 响应\n```json\n[\n    {\n        \"document\": \"hello?\",\n        \"relevance_score\": 0.5651187300682068,\n        \"index\": 1\n    },\n    {\n        \"document\": \"他也好\",\n        \"relevance_score\": 0.47729530930519104,\n        \"index\": 0\n    }\n]\n```\n\n\n### 错误码\n\n无\n\n## 更新记录和贡献\n\n* reranker-base (2024-08)\n"
  },
  {
    "path": "python/core/components/retriever/reranker/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/retriever/reranker/component.py",
    "content": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\" Reranker 文本精排\n\"\"\"\nfrom typing import Union, List\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component, Message\nfrom appbuilder.core._exception import AppBuilderServerException, ModelNotSupportedException\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace\n\nfrom .model import RerankerArgs\n\n\nclass Reranker(Component):\n    \"\"\" \n    Reranker\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        from appbuilder import Message\n\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        reranker = appbuilder.Reranker()\n        ranked_1 = reranker(\"你好\", [\"他也好\", \"hello?\"])\n        print(ranked_1)\n    \"\"\"\n    name: str = \"reranker\"\n    version: str = \"v1\"\n\n    meta = RerankerArgs\n    base_urls = {\n        'bce-reranker-base' : \"/api/v1/component/component/bce_reranker_base\"\n    }\n    accepted_models = list(base_urls.keys())\n\n    def __init__(self, \n                 model=\"bce-reranker-base\",\n                 **kwargs\n                 ):\n        \"\"\"Reranker\"\"\"\n\n        if model not in self.accepted_models:\n            raise ModelNotSupportedException(f\"Model {model} not supported, only support {self.accepted_models}\")\n\n        if model in self.base_urls:\n            self.base_url = self.base_urls[model]\n        else:\n            raise ModelNotSupportedException(f\"Model {model} is not yet supported, only support {self.base_urls.keys()}\")\n\n        super().__init__(self.meta)\n\n    def _check_response_json(self, data: dict):\n        \"\"\"\n        check_response_json\n        \"\"\"\n\n        self.http_client.check_response_json(data)\n        if \"error_code\" in data and \"error_msg\" in data:\n            raise AppBuilderServerException(\n                service_err_code=data['error_code'],\n                service_err_message=data['error_msg'],\n            )\n\n    def _request(self, payload: dict) -> dict:\n        \"\"\"\n        request to gateway\n        \"\"\"\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        resp = self.http_client.session.post(\n            url=self.http_client.service_url(self.base_url, \"/\"),\n            headers=headers,\n            json=payload,\n        )\n        self.http_client.check_response_header(resp)\n        self._check_response_json(resp.json())\n\n        return resp.json()\n\n    def _batch(self, query, texts: List[str]) -> List[dict]:\n        \"\"\"\n        batch run implement\n        \"\"\"\n        if len(texts) > 50:\n            raise ValueError(f'Rerank texts max nums must be lower than 50, but got {len(texts)}')\n        for v in texts:\n            if not isinstance(v, str):\n                raise ValueError(f'Rerank texts must be str, but got {v}')\n\n        params = {\n            \"inputs\": {\n                \"query\": query,\n                \"texts\": texts\n            }\n        }\n        result = self._request(params)\n        result = result[\"result\"]\n        return result\n\n    @components_run_trace\n    def run(self, query: Union[Message[str], str],\n            texts: Union[Message[List[str]], List[str]]) -> Message[List[dict]]:\n        \"\"\"\n        运行查询，对给定的文本集合进行批量处理，并返回处理后的结果列表。\n        \n        Args:\n            query (Union[Message[str], str]): 查询条件，可以是字符串或Message对象。\n            texts (Union[Message[List[str]], List[str]]): 待处理的文本集合，可以是字符串列表或包含字符串列表的Message对象。\n        \n        Returns:\n            Message[List[dict]]: 处理后的结果列表，每个元素是一个字典，包含处理后的文本信息。\n        \"\"\"\n        _query = query if isinstance(query, str) else query.content\n        _texts = texts if isinstance(texts, List) else texts.content\n\n        return Message(self._batch(_query, _texts))\n"
  },
  {
    "path": "python/core/components/retriever/reranker/model.py",
    "content": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom typing import Union\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import ComponentArguments, Message\n\n\nclass RerankerArgs(ComponentArguments):\n    \"\"\"\n    配置\n\n    Attributes:\n        text: Union[Message[str], str]\n    \"\"\"\n\n    text: Union[Message[str], str]"
  },
  {
    "path": "python/core/components/table_ocr/README.md",
    "content": "# 表格文字识别 (TableOCR) \n\n## 简介\n表格文字识别 (TableOCR) 可支持识别图片中的表格内容，返回各表格的表头表尾内容、单元格文字内容及其行列位置信息，全面覆盖各类表格样式，包括常规有线表格、无线表格、含合并单元格表格。同时，支持多表格内容识别。\n### 功能介绍\n* 简单表格文字识别\n\n支持识别具备完整框线的常规简单表格，结构化输出表头、表尾及每个单元格的文字内容。\n* 复杂表格文字识别\n\n可识别无表格框线，但行、列位置明确的表格，支持含合并单元格的复杂表格文字识别。\n### 特色优势\n* 支持识别图片中的表格内容，返回各表格的表头表尾内容、单元格文字内容及其行列位置信息，全面覆盖各类表格样式，包括常规有线表格、无线表格、含合并单元格表格。同时，支持单图中多表格内容的识别。\n\n### 应用场景\n* 信息登记表识别\n\n  对个人、商品、公示内容等纸质信息登记表进行识别，用于登记信息的结构化整理和统计，大幅度降低人力录入成本，提升信息管理的便捷性\n* 财税报表识别\n\n  提取识别银行对账单、资产负债表、损益表等财税场景常用表格内容，快速实现表格内容的电子化，用于财税信息统计、存档及核算，大幅度提升信息录入效率\n## 基本用法\n\n下面是表格文字识别的代码示例：\n\n示例图片为\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6064079145ff4698856f477b820147768fc2187d3)\n\n```python\nimport os\nimport appbuilder\nimport requests\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n# 从BOS读取样例图片\nimage_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\" \\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024\" \\\n            \"-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\" \\\n            \"064079145ff4698856f477b820147768fc2187d3\"\nraw_image = requests.get(image_url).content\n# 创建表格文字识别组件实例\ntable_ocr = appbuilder.TableOCR()\n# 执行识别操作并获取结果\nout = table_ocr.run(appbuilder.Message(content={\"raw_image\": raw_image}))\nprint(out.content)\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数 （以表格形式展示）\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | String  | 是    | 输入的消息，用于模型的主要输入内容。这是一个必需的参数 | Message(content={\"raw_image\": b\"待识别的图片字节流数据\"}) |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n| retry   | Integer | 否    | HTTP重试次数                    | 3                                              |\n\n### 响应参数\n| 参数名称             | 参数类型    | 描述            | 示例值                                                                                                                                                                                      |\n|------------------|---------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| tables_result    | array[] | 返回结果          | [{\"table_location\": [],\"header\": [],\"body\": [],\"footer\": []}]                                                                                                                            |\n| +table_location\t | array[] | 单个表格的四角点x,y坐标 | [{ \"x\": 15, \"y\": 15 },{ \"x\": 371, \"y\": 15 },{ \"x\": 371, \"y\": 98 },{ \"x\": 15, \"y\": 98 }],                                                                                                 |\n| +header          | array[] | 表头信息          | [{'location': [{'x': 325, 'y': 40}, {'x': 528, 'y': 40}, {'x': 528, 'y': 71}, {'x': 325, 'y': 71}], 'words': '财务状况变动表'}, {...}]                                                          |\n| +body\t           | array[] | 单元格信息         | [{\"cell_location\": [{ \"x\": 15, \"y\": 15 },{ \"x\": 120, \"y\": 15 },{ \"x\": 120, \"y\": 58 },{ \"x\": 15, \"y\": 58 }],\"row_start\": 0,\"row_end\": 1,\"col_start\": 0,\"col_end\": 1,\"words\": \"参数\"},{...}] |\n| +footer\t         | array[] | 表尾信息          | [{'location': [...], 'words': '...'}, {...}]                                                                                                                                             |\n\n### 响应示例\n```json\n{\n  \"tables_result\": [\n    {\n      \"table_location\": [\n        { \"x\": 15, \"y\": 15 },\n        { \"x\": 371, \"y\": 15 },\n        { \"x\": 371, \"y\": 98 },\n        { \"x\": 15, \"y\": 98 }\n      ],\n      \"header\": [],\n      \"body\": [\n        {\n          \"cell_location\": [\n            { \"x\": 15, \"y\": 15 },\n            { \"x\": 120, \"y\": 15 },\n            { \"x\": 120, \"y\": 58 },\n            { \"x\": 15, \"y\": 58 }\n          ],\n          \"row_start\": 0,\n          \"row_end\": 1,\n          \"col_start\": 0,\n          \"col_end\": 1,\n          \"words\": \"参数\"\n        },\n        {\n          \"cell_location\": [\n            { \"x\": 120, \"y\": 15 },\n            { \"x\": 371, \"y\": 15 },\n            { \"x\": 371, \"y\": 58 },\n            { \"x\": 120, \"y\": 58 }\n          ],\n          \"row_start\": 0,\n          \"row_end\": 1,\n          \"col_start\": 1,\n          \"col_end\": 2,\n          \"words\": \"值\"\n        },\n        {\n          \"cell_location\": [\n            { \"x\": 15, \"y\": 58 },\n            { \"x\": 120, \"y\": 58 },\n            { \"x\": 120, \"y\": 98 },\n            { \"x\": 15, \"y\": 98 }\n          ],\n          \"row_start\": 1,\n          \"row_end\": 2,\n          \"col_start\": 0,\n          \"col_end\": 1,\n          \"words\": \"Content-Type\"\n        },\n        {\n          \"cell_location\": [\n            { \"x\": 120, \"y\": 58 },\n            { \"x\": 371, \"y\": 58 },\n            { \"x\": 371, \"y\": 98 },\n            { \"x\": 120, \"y\": 98 }\n          ],\n          \"row_start\": 1,\n          \"row_end\": 2,\n          \"col_start\": 1,\n          \"col_end\": 2,\n          \"words\": \"application/x-www-form-urlencoded\"\n        }\n      ],\n      \"footer\": []\n    }\n  ]\n}\n```\n### 错误码\n| 错误码 | 描述 |\n|-----|----|\n\n## 高级用法\n\n目前该模块仅提供基础的表格文字识别功能。\n\n\n## 更新记录和贡献\n* 表格文字识别能力 (2024-01)"
  },
  {
    "path": "python/core/components/table_ocr/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/table_ocr/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"table ocr component.\"\"\"\n\nimport base64\nimport json\n\nfrom appbuilder.core import utils\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.table_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass TableOCR(Component):\n    r\"\"\"\n       支持识别图片中的表格内容，返回各表格的表头表尾内容、单元格文字内容及其行列位置信息，全面覆盖各类表格样式，包括常规有线表格、\n       无线表格、含合并单元格表格。同时，支持多表格内容识别。\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           table_ocr = appbuilder.TableOCR()\n           with open(\"./table_ocr_test.png\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n           print(out.content)\n\n        \"\"\"\n\n    name = \"table_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"table_ocr\",\n            \"description\": \"需要识别图片中的表格内容，使用该工具, 但不支持html后缀文件的识别\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别图片的文件名\"\n                    }\n                },\n                \"required\": [\"file_names\"]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        表格文字识别\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作。\n                举例: Message(content={\"raw_image\": b\"...\"})\n                或 Message(content={\"url\": \"https://image/download/url\"})。\n            timeout (float, 可选): HTTP超时时间。\n            retry (int, 可选): HTTP重试次数。\n        \n        Returns:\n            message (Message): 识别结果。\n                举例: Message(name=msg, content={'tables_result': [{\n                'table_location': [{'x': 15, 'y': 15}, {'x': 371, 'y': 15}, {'x': 371, 'y': 98}, {'x': 15,\n                'y': 98}], 'header': [], 'body': [{'cell_location': [{'x': 15, 'y': 15}, {'x': 120, 'y': 15},\n                {'x': 120, 'y': 58}, {'x': 15, 'y': 58}], 'row_start': 0, 'row_end': 1, 'col_start': 0,\n                'col_end': 1, 'words': '参数'}, {'cell_location': [{'x': 120, 'y': 15}, {'x': 371, 'y': 15},\n                {'x': 371, 'y': 58}, {'x': 120, 'y': 58}], 'row_start': 0, 'row_end': 1, 'col_start': 1,\n                'col_end': 2, 'words': '值'}, {'cell_location': [{'x': 15, 'y': 58}, {'x': 120, 'y': 58},\n                {'x': 120, 'y': 98}, {'x': 15, 'y': 98}], 'row_start': 1, 'row_end': 2, 'col_start': 0,\n                'col_end': 1, 'words': 'Content-Type'}, {'cell_location': [{'x': 120, 'y': 58}, {'x': 371,\n                'y': 58}, {'x': 371, 'y': 98}, {'x': 120, 'y': 98}], 'row_start': 1, 'row_end': 2, 'col_start':\n                1, 'col_end': 2, 'words': 'application/x-www-form-urlencoded'}], 'footer': []}]}, mtype=dict)\n        \n        \"\"\"\n        inp = TableOCRInMsg(**message.content)\n        req = TableOCRRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        req.cell_contents = \"false\"\n        result = self._recognize(req, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = TableOCROutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: TableOCRRequest, timeout: float = None,\n                   retry: int = 0, request_id: str = None) -> TableOCRResponse:\n        r\"\"\"调用底层接口进行表格文字识别\n                   参数:\n                       request (obj: `TableOCRRequest`) : 表格文字识别输入参数\n                   返回：\n                       response (obj: `TableOCRResponse`): 表格文字识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\n                \"request format error, one of image or url must be set\")\n\n        data = TableOCRRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/table\")\n        response = self.http_client.session.post(\n            url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        res = TableOCRResponse.from_json(json.dumps(data))\n        res.request_id = request_id\n        return res\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 表格文字识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    def get_table_markdown(self, tables_result):\n        \"\"\"\n        将表格识别结果转换为Markdown格式。\n        \n        Args:\n            tables_result (list): 表格识别结果列表，每个元素是一个包含表格数据的字典，其中包含表格体（body）等字段。\n        \n        Returns:\n            list: 包含Markdown格式表格的字符串列表。\n        \n        \"\"\"\n        markdowns = []\n        for table in tables_result:\n            cells = table[\"body\"]\n            max_row = max(cell['row_end'] for cell in cells)\n            max_col = max(cell['col_end'] for cell in cells)\n            # 初始化表格数组\n            table_arr = [[''] * max_col for _ in range(max_row)]\n            # 填充表格数据\n            for cell in cells:\n                row = cell['row_start']\n                col = cell['col_start']\n                table_arr[row][col] = cell['words']\n\n            markdown_table = \"\"\n            for row in table_arr:\n                markdown_table += \"| \" + \" | \".join(row) + \" |\\n\"\n            # 生成分隔行\n            separator = \"| \" + \" | \".join(['---'] * max_col) + \" |\\n\"\n            # 插入分隔行在表头下方\n            header, body = markdown_table.split('\\n', 1)\n            markdown_table = header + '\\n' + separator + body\n            markdowns.append(markdown_table)\n        return markdowns\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool, **kwargs):\n        \"\"\"\n        对传入文件进行处理，并返回处理结果。\n        \n        Args:\n            name (str): 工具的名称。\n            streaming (bool): 是否为流式处理。若为True，则以生成器形式返回结果；若为False，则直接返回结果。\n            **kwargs: 关键字参数，包含以下参数：\n                traceid (str): 请求的唯一标识符。\n                file_names (List[str]): 文件名列表，表示需要处理的文件名。\n                files (List[str]): 同file_names，用于兼容老版本接口。\n                file_urls (Dict[str, str]): 文件名和对应URL的映射字典。\n        \n        Returns:\n            若streaming为True，则以生成器形式返回处理结果，每个元素为包含type和text的字典，type固定为\"text\"，text为处理结果的JSON字符串。\n            若streaming为False，则直接返回处理结果的JSON字符串。\n        \n        Raises:\n            InvalidRequestArgumentError: 若传入文件名在file_urls中未找到对应的URL，则抛出此异常。\n        \n        \"\"\"\n        result = {}\n        traceid = kwargs.get(\"traceid\")\n        file_names = kwargs.get(\"file_names\", None)\n        if not file_names:\n            file_names = kwargs.get(\"files\")\n        file_urls = kwargs.get(\"file_urls\", {})\n        for file_name in file_names:\n            if utils.is_url(file_name):\n                file_url = file_name\n            else:\n                file_url = file_urls.get(file_name, None)\n            if file_url is None:\n                raise InvalidRequestArgumentError(\n                    f\"request format error, file {file_name} url does not exist\"\n                )\n            req = TableOCRRequest()\n            req.url = file_url\n            req.cell_contents = \"false\"\n            resp = self._recognize(req, request_id=traceid)\n            tables_result = proto.Message.to_dict(resp)[\"tables_result\"]\n            markdowns = self.get_table_markdown(tables_result)\n            result[file_name] = markdowns\n\n        result = json.dumps(result, ensure_ascii=False)\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": result,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": \"user\",\n            }\n        else:\n            return result\n"
  },
  {
    "path": "python/core/components/table_ocr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"table ocr model.\"\"\"\nimport proto\n\nfrom typing import List, Dict\nfrom pydantic import BaseModel\n\n\nclass TableOCRRequest(proto.Message):\n    r\"\"\"表格文字识别请求体参数.\n            属性:\n                image (str):\n                    可选。图像内容的base64编码。\n                url (str):\n                    可选。图像的URL地址，经过base64编码。\n                    图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n                cell_contents (str):\n                    是否输出单元格文字位置信息，可选值包括：\n                    - false： 默认值，仅输出单元格行列信息及四角点坐标，不输出单元格内文字位置信息\n                    - true： 输出单元格内文字的外接四边形四角点坐标，若文字折行，则分行分别输出\n            必须设置image或url属性之一，如果两者都设置了，将使用image属性。\n        \"\"\"\n    image: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    cell_contents: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass TableOCRResponse(proto.Message):\n    \"\"\"表格文字识别响应消息\n\n        属性:\n            request_id (str): 请求ID。\n            log_id (int): 用于问题识别的唯一日志ID。\n            table_num (int): 检测到的表格数量。\n            result (List[TableRes]): 表格文字识别结果列表。\n    \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=2,\n    )\n    table_num: int = proto.Field(\n        proto.INT64,\n        number=3,\n    )\n    tables_result: 'TableRes' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=4,\n        message='TableRes',\n    )\n\n\nclass TableRes(proto.Message):\n    \"\"\"表格文字识别结果\n\n        属性:\n            table_location (List[Location]): 单个表格的四角点x,y坐标。\n            header (List[Header]): 表头信息。\n            body (List[Body]): 单元格信息。\n            footer (List[Footer]): 表尾信息。\n    \"\"\"\n    table_location: 'Location' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=1,\n        message=\"Location\"\n    )\n    header: 'Header' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=2,\n        message=\"Header\"\n    )\n    body: 'Body' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=3,\n        message=\"Body\"\n    )\n    footer: 'Footer' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=4,\n        message=\"Footer\"\n    )\n\n\nclass Header(proto.Message):\n    \"\"\"表头信息\n\n        属性:\n            location (List[Location]): 表头位置，四角点 x,y 坐标。\n            words (str): 表头文字内容，按行拆分。\n    \"\"\"\n    location: 'Location' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=1,\n        message=\"Location\"\n    )\n    words: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n\n\nclass Body(proto.Message):\n    \"\"\"单元格信息\n\n        属性:\n            cell_location (List[Location]): 表头位置，四角点 x,y 坐标。\n            row_start (str): 单元格行起始编号，横线编号从0开始。\n            row_end (str): 单元格行终止编号。\n            col_start (str): 单元格列起始编号，竖线编号从0开始。\n            col_end (str): 单元格列终止编号。\n            words (str): 单元格文字内容。\n            contents (str): 单元格内文字内容，分行显示，当请求参数 cell_contents = true 时返回。\n    \"\"\"\n    cell_location: 'Location' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=1,\n        message=\"Location\"\n    )\n    row_start: int = proto.Field(\n        proto.INT32,\n        number=2,\n    )\n    row_end: int = proto.Field(\n        proto.INT32,\n        number=3,\n    )\n    col_start: int = proto.Field(\n        proto.INT32,\n        number=4,\n    )\n    col_end: int = proto.Field(\n        proto.INT32,\n        number=5,\n    )\n    words: str = proto.Field(\n        proto.STRING,\n        number=6,\n    )\n    contents: str = proto.Field(\n        proto.STRING,\n        number=7,\n    )\n\n\nclass Footer(proto.Message):\n    \"\"\"表尾信息\n\n        属性:\n            location (List[Location]): 表头位置，四角点 x,y 坐标。\n            words (str): 表头文字内容，按行拆分。\n    \"\"\"\n    location: 'Location' = proto.RepeatedField(\n        proto.MESSAGE,\n        number=1,\n        message=\"Location\"\n    )\n    words: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n\n\nclass Location(proto.Message):\n    \"\"\"四角点坐标。\n\n            属性:\n                x (int): x坐标。\n                y (int): y坐标。\n    \"\"\"\n    x: int = proto.Field(\n        proto.INT64,\n        number=1,\n    )\n    y: int = proto.Field(\n        proto.INT64,\n        number=2,\n    )\n\n\nclass TableOCRInMsg(BaseModel):\n    \"\"\" 表格文字识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''\n    url: str = \"\"\n\n\nclass PyHeader(BaseModel):\n    \"\"\"表头信息\n\n        属性:\n            location (List[Dict[str, int]]): 表头位置，四角点 x,y 坐标。\n            words (str): 表头文字内容，按行拆分。\n    \"\"\"\n    location: List[Dict[str, int]]\n    words: str\n\n\nclass PyBody(BaseModel):\n    \"\"\"单元格信息\n\n        属性:\n            cell_location (List[Location]): 表头位置，四角点 x,y 坐标。\n            row_start (str): 单元格行起始编号，横线编号从0开始。\n            row_end (str): 单元格行终止编号。\n            col_start (str): 单元格列起始编号，竖线编号从0开始。\n            col_end (str): 单元格列终止编号。\n            words (str): 单元格文字内容。\n    \"\"\"\n    cell_location: List[Dict[str, int]]\n    row_start: int\n    row_end: int\n    col_start: int\n    col_end: int\n    words: str\n\n\nclass PyFooter(BaseModel):\n    \"\"\"表尾信息\n\n        属性:\n            location (List[Dict[str, int]]): 表头位置，四角点 x,y 坐标。\n            words (str): 表头文字内容，按行拆分。\n    \"\"\"\n    location: List[Dict[str, int]]\n    words: str\n\n\nclass TableOCRRes(BaseModel):\n    \"\"\"表格文字识别对象信息\n        属性:\n            table_location (List[Dict[str, int]]): 单个表格的四角点x,y坐标\n            header (List[PyHeader]): 表头信息\n            body (List[PyBody]): 单元格信息\n            footer (List[PyFooter]): 表尾信息\n    \"\"\"\n    table_location: List[Dict[str, int]]\n    header: List[PyHeader]\n    body: List[PyBody]\n    footer: List[PyFooter]\n\n\nclass TableOCROutMsg(BaseModel):\n    r\"\"\"识别结果列表\"\"\"\n    tables_result: List[TableOCRRes]  # 结果列表\n"
  },
  {
    "path": "python/core/components/text_to_image/README.md",
    "content": "# 文生图 (Text2Image)\n\n## 简介\n文生图（Text2Image）基于文心大模型，可以根据用户输入的文本，自动创作不限定风格的图，为内容创作者提供灵感和高质量配图。\n\n### 功能介绍\nAI一下，文字成画，AI 精准理解中文文本，支持用户自由输入，只需一句话，让文字秒变精美画作，支持自定义丰富的修饰词，可生成不同风格、不同构图、不同流派的图片，满足个性化的图片生成需求。\n### 特色优势\n利用知识增强扩散模型，学习过程融入语言、视觉、跨模态等多源知识，生成图像语义一致性更高，基于混合降噪专家网络，全球最大跨模态生成模型，参数规模达到240亿，根据生成阶段选择最优生成“专家”，从图像轮廓渐进优化细节，全面提升生成质量。\n### 应用场景\n图片素材、艺术插图、海报制作、故事插图、壁纸制作、电商应用、室内设计、影视制作、游戏原画设计、服务创意启发平台等。\n\n## 基本用法\n\n下面是文生图的代码示例: \n\n```python\nimport os\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\ntext2Image = appbuilder.Text2Image()\ncontent_data = {\"prompt\": \"上海的经典风景\", \"width\": 1024, \"height\": 1024, \"image_num\": 1}\nmsg = appbuilder.Message(content_data)\nout = text2Image.run(msg)\nprint(out.content)\n#{'img_urls': ['...']}\n```\n\n生成的\"上海的经典风景\"图片如下\n\n![示例图片](https://bj.bcebos.com/v1/appbuilder-sdk-components/shanghai.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-05-30T03%3A08%3A30Z%2F-1%2Fhost%2F64296a40b3f01d39776129e0b4ce732b1784f2f91e3afcf9dd7c1de8c3df6a0a)\n\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|message |String  |是 |输入的消息，输入的消息，用于模型的主要输入内容。这是一个必需的参数| Message(content={\"prompt\": \"上海的经典风景\"}) |\n|width|Integer|是 |图片宽度，支持：512x512、640x360、360x640、1024x1024、1280x720、720x1280、2048x2048、2560x1440、1440x2560。| 1024   |\n|height|Integer|是 |图片高度，支持：512x512、640x360、360x640、1024x1024、1280x720、720x1280、2048x2048、2560x1440、1440x2560。| 1024   |\n|image_num|Integer|是 |生成图片数量，默认一张，支持生成 1-8 张。| 1      |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer|是 |HTTP重试次数| 3      |\n\n### 响应参数\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|result  |String  |返回结果|[\"xxx\"]|\n\n### 响应示例\n```json\n{\"img_urls\": [\"xxx\"]}\n```\n### 错误码\n| 错误码 |描述|\n|---|---|\n| 282000 |服务器内部错误，请再次请求， 如果持续出现此类错误，请在控制台提交工单联系技术支持团队|\n| 282004 |请求中包含敏感词、非法参数、字数超限，或上传违规参考图，请检查后重新尝试|\n| 282003 |缺少必要参数|\n| 17 |日配额流量超限|\n| 18 |QPS 超限额|\n| 216630 |服务器内部错误，请再次请求，如果持续出现此类错误，请通过工单联系技术支持|\n| 501 |文本黄反拦截|\n| 201 |模型生图失败|\n| 216100 |参数不满足格式要求|\n| 216201 |参考图不满足格式要求|\n| 4 |错误信息为中文的“请求超限”指所有用户提交的 AI 作画总数超限制|\n| 13 |错误信息为中文的“QPS 超限”指单个用户使用提交请求接口的 QPS 超限|\n| 15 |错误信息为中文的“并发超限”指单个用户使用 AI 作画的并发超限|\n| 17 |错误信息为中文的“用量超限”指单个用户使用 AI 作画的用量超限|\n\n\n\n## 高级用法\n\n目前该模块仅提供基础的文生图功能。\n## 更新记录和贡献\n* 文生图能力 (2023-12)\n"
  },
  {
    "path": "python/core/components/text_to_image/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/text_to_image/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"Text2Image component.\n\"\"\"\nimport time\nimport math\n\nfrom typing import Optional\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, RiskInputException\nfrom appbuilder.core.components.text_to_image.model import Text2ImageSubmitRequest, Text2ImageQueryRequest, \\\n    Text2ImageQueryResponse, Text2ImageSubmitResponse, Text2ImageOutMessage, Text2ImageInMessage\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass Text2Image(Component):\n    r\"\"\"\n    文生图组件，即对于输入的文本，输出生成的图片url。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        text_to_image = appbuilder.Text2Image()\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        content_data = {\"prompt\": \"上海的经典风景\", \"width\": 1024, \"height\": 1024, \"image_num\": 1}\n        msg = appbuilder.Message(content_data)\n        out = text_to_image.run(inp)\n        # 打印生成结果\n        print(out.content) # eg: {\"img_urls\": [\"xxx\"]}\n    \"\"\"\n\n    manifests = [\n        {\n            \"name\": \"text_to_image\",\n            \"description\": \"文生图，该组件只用于图片创作。当用户需要进行场景、人物、海报等内容的绘制时，使用该画图组件。如果用户需要生成图表（柱状图、折线图、雷达图等），则必须使用代码解释器。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"文生图用的query。特别注意，这个字段只能由中文字符组成，不能含有任何英语描述。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(\n        self,\n        message: Message,\n        width: int = 1024,\n        height: int = 1024,\n        image_num: int = 1,\n        image: Optional[str] = None,\n        url: Optional[str] = None,\n        pdf_file: Optional[str] = None,\n        pdf_file_num: Optional[str] = None,\n        change_degree: Optional[int] = None,\n        text_content: Optional[str] = None,\n        task_time_out: Optional[int]= None,\n        text_check: Optional[int] = 1,\n        request_id: Optional[str] = None\n    ):\n        \"\"\"\n        执行文本到图像的生成任务。\n        \n        Args:\n            message (Message): 包含任务相关信息的消息对象。\n            width (int, optional): 生成的图像的宽度，默认为1024。\n            height (int, optional): 生成的图像的高度，默认为1024。\n            image_num (int, optional): 生成图像的数量，默认为1。\n            image (Optional[str], optional): 参考图像的路径或URL，默认为None。\n            url (Optional[str], optional): 参考图像的URL，默认为None。\n            pdf_file (Optional[str], optional): 参考PDF文件的路径，默认为None。\n            pdf_file_num (Optional[str], optional): 参考PDF文件中的页码范围，默认为None。\n            change_degree (Optional[int], optional): 图像变换的程度，默认为None。\n            text_content (Optional[str], optional): 需要转换的文本内容，默认为None。\n            task_time_out (Optional[int], optional): 任务超时时间，默认为None。\n            text_check (Optional[int], optional): 是否进行文本内容检查，默认为1。\n            request_id (Optional[str], optional): 请求的唯一标识，默认为None。\n        \n        Returns:\n            Message: 包含生成图像URL的消息对象。\n        \n        Raises:\n            HTTPError: 请求失败时抛出异常。\n        \n        \"\"\"\n        headers = self._http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        api_url = self._http_client.service_url(\"/v1/bce/aip/ernievilg/v1/txt2imgv2\")\n\n        req = Text2ImageSubmitRequest(\n            prompt=message.content[\"prompt\"],  \n            width=width,\n            height=height,\n            image_num=image_num,\n            image=image,\n            url=url,\n            pdf_file=pdf_file,\n            pdf_file_num=pdf_file_num,\n            change_degree=change_degree,\n            text_content=text_content,\n            task_time_out=task_time_out,\n            text_check=text_check\n        )\n        response = self.http_client.session.post(api_url, json=req.model_dump(), headers=headers, timeout=None)\n        self._http_client.check_response_header(response)\n        data = response.json()\n        resp= Text2ImageSubmitResponse(**data)\n\n        taskId = resp.data.task_id\n        if taskId is not None:\n            task_request_time = 1\n\n            while True:\n                request = Text2ImageQueryRequest(task_id=taskId)\n                text2ImageQueryResponse = self.queryText2ImageData(request, request_id=request_id)\n                if text2ImageQueryResponse.data.task_progress is not None:\n                    task_progress = float(text2ImageQueryResponse.data.task_progress)\n                    if math.isclose(1.0, task_progress, rel_tol=1e-9, abs_tol=0.0):\n                        break\n                    \n                    # NOTE(chengmo)：文生图组件的返回时间在10s以上，查询过于频繁会被限流，导致异常报错\n                    # 此处采用 yangyongzhen老师提供的方案，前三次查询间隔3s，后三次查询间隔逐渐增大\n                    if task_request_time <= 3:\n                        time.sleep(3)\n                    else:\n                        time.sleep(task_request_time)\n                    task_request_time += 1\n\n            img_urls = self.extract_img_urls(text2ImageQueryResponse)\n            out = Text2ImageOutMessage(img_urls=img_urls)\n            return Message(content=out.model_dump())\n\n    @HTTPClient.check_param\n    def submitText2ImageTask(\n        self,\n        request: Text2ImageSubmitRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> Text2ImageSubmitResponse:\n        \"\"\"\n        使用给定的输入并返回文生图的任务信息。\n        \n        Args:\n            request (obj:`Text2ImageSubmitRequest`): 输入请求，这是一个必需的参数。\n            timeout (float, optional): 请求的超时时间。默认为None。\n            retry (int, optional): 请求的重试次数。默认为0。\n            request_id (str, optional): 请求的唯一标识符。默认为None。\n        \n        Returns:\n            obj:`Text2ImageSubmitResponse`: 接口返回的输出消息。\n        \n        \"\"\"\n        url = self.http_client.service_url(\"/v1/bce/aip/ernievilg/v1/txt2imgv2\")\n        data = request.model_dump()\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/json'\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        response = self.http_client.session.post(url, json=data, headers=headers, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        response = Text2ImageSubmitResponse(**data)\n        return response\n\n    def queryText2ImageData(\n        self,\n        request: Text2ImageQueryRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> Text2ImageQueryResponse:\n        \"\"\"\n        将文本查询请求转换为图像数据。\n        \n        Args:\n            request (Text2ImageQueryRequest): 输入请求，必填参数。\n            timeout (float, optional): 请求的超时时间，默认为None。\n            retry (int, optional): 请求的重试次数，默认为0。\n            request_id (str, optional): 请求的唯一标识符，默认为None。\n        \n        Returns:\n            Text2ImageQueryResponse: 接口返回的输出消息。\n        \"\"\"\n        url = self.http_client.service_url(\"/v1/bce/aip/ernievilg/v1/getImgv2\")\n        data = {\n            \"task_id\": request.task_id\n        }\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/json'\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        response = self.http_client.session.post(url, json=data, headers=headers, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__.check_service_error(request_id, data)\n        response = Text2ImageQueryResponse(**data)\n        return response\n\n    def extract_img_urls(self, response: Text2ImageQueryResponse):\n        \"\"\"\n        从作画生成的返回结果中提取图片url。\n        \n        Args:\n            response (obj:`Text2ImageQueryResponse`): 作画生成的返回结果。\n        \n        Returns:\n            List[str]: 从返回体中提取的图片url列表。\n        \n        \"\"\"\n        img_urls = []\n        if response and response.data and response.data.sub_task_result_list:\n            for sub_task_result in response.data.sub_task_result_list:\n                if sub_task_result and sub_task_result.final_image_list:\n                    for final_image in sub_task_result.final_image_list:\n                        if final_image and final_image.img_url:\n                            img_urls.append(final_image.img_url)\n\n        return img_urls\n\n    @staticmethod\n    def check_service_error(request_id: str, data: dict):\n        \"\"\"\n        检查服务错误信息\n        \n        Args:\n            request_id (str): 请求ID\n            data (dict): 响应数据\n        \n        Raises:\n            AppBuilderServerException: 如果响应数据中包含错误信息，则抛出异常\n        \n        Returns:\n            None\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n"
  },
  {
    "path": "python/core/components/text_to_image/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nr\"\"\"Text2Image model.py.\n\"\"\"\nfrom typing import MutableSequence, List\n\nfrom typing import Optional, Union\nimport proto\nfrom pydantic import BaseModel, Field\n\n\nclass Text2ImageSubmitRequest(BaseModel):\n    prompt: str = Field(default='')\n    width: int = Field(default=1024)\n    height: int = Field(default=1024)\n    image_num: int = Field(default=1, ge=1, le=8)\n    image: Optional[str] = Field(default=\"\")\n    url: Optional[str] = Field(default=\"\")\n    pdf_file: Optional[str] = Field(default=\"\")\n    pdf_file_num: Optional[str] = Field(default=\"\")\n    change_degree: Optional[int] = None\n    text_content: Optional[str] = None\n    task_time_out: Optional[int] = None\n    text_check: Optional[int] = None\n\n\nclass Text2ImageSubmitErrorDetail(BaseModel):\n    msg: Optional[str]\n    words: Optional[list]\n\n\nclass Text2ImageSubmitResponseData(BaseModel):\n    primary_task_id: Optional[int] = None\n    task_id: Optional[str] = None\n\n\nclass Text2ImageSubmitResponse(BaseModel):\n    log_id: Optional[int] = None\n    data: Optional[Text2ImageSubmitResponseData] = Text2ImageSubmitResponseData()\n    error_msg: Optional[str] = None\n    error_detail: Optional[list[Text2ImageSubmitErrorDetail]] = None\n    error_code: Optional[int] = None\n\n\nclass Text2ImageQueryRequest(BaseModel):\n    task_id: Optional[str]\n\n\nclass FinalImage(BaseModel):\n    img_url: Optional[str] = None\n    height: Optional[int] = None\n    width: Optional[int] = None\n    img_approve_conclusion: Optional[str] = None\n\n\nclass SubTaskResult(BaseModel):\n    sub_task_status: Optional[str] = None\n    sub_task_progress_detail: Union[int, float, None] = None\n    sub_task_progress: Union[float, int, None] = None\n    sub_task_error_code: Optional[int] = None\n    final_image_list: Optional[list[FinalImage]] = None\n\n\nclass Text2ImageQueryResponseData(BaseModel):\n    task_id: Optional[int] = None\n    task_status: Optional[str] = None\n    task_progress_detail: Union[float, int, None] = None\n    task_progress: Union[float, int, None] = None\n    sub_task_result_list: Optional[list[SubTaskResult]] = None\n\n\nclass Text2ImageQueryResponse(BaseModel):\n    log_id: Union[str, int, None] = None\n    data: Optional[Text2ImageQueryResponseData] = Text2ImageQueryResponseData()\n\n\nclass Text2ImageInMessage(BaseModel):\n    \"\"\" 文生图组件输入message.\n        参数:\n            prompt(str):\n                生图的文本描述。仅支持中文、日常标点符号。不支持英文，特殊符号，限制 200 字。\n    \"\"\"\n    prompt: str\n\n\nclass Text2ImageOutMessage(BaseModel):\n    \"\"\" 文生图组件输出message.\n        参数:\n            img_urls(str):\n                图片所在 BOS http 地址，默认 1 小时失效。\n    \"\"\"\n    img_urls: List[str]\n"
  },
  {
    "path": "python/core/components/translate/README.md",
    "content": "# 文本翻译-通用版（Translation）\n\n## 简介\n\n文本翻译组件（Translation）提供多种语言互译的在线文本翻译服务。支持术语定制功能，用户可对翻译结果进行干预，快速提高翻译质量。可广泛应用于移动端、PC网站、智能硬件等不同产品形态中，满足多领域、多场景的翻译需求。   \n\n### 功能介绍\n\n支持200+语种互译，传入待翻译内容，并指定源语言（支持语种自动检测）和目标语言，即可获得翻译结果，并支持术语干预。  \n支持在【创建应用】-【添加工具组件】时，对以下语言的试用：\n\n|名称       | 代码   | 名称       | 代码   | 名称       | 代码   |\n|------------|--------|------------|--------|------------|--------|\n| 自动检测   | auto   | 中文       | zh     | 英语       | en     |\n| 粤语       | yue    | 文言文     | wyw    | 日语       | jp     |\n| 韩语       | kor    | 法语       | fra    | 西班牙语   | spa    |\n| 泰语       | th     | 阿拉伯语   | ara    | 俄语       | ru     |\n| 葡萄牙语   | pt     | 德语       | de     | 意大利语   | it     |\n| 希腊语     | el     | 荷兰语     | nl     | 波兰语     | pl     |\n| 保加利亚语 | bul    | 爱沙尼亚语 | est    | 丹麦语     | dan    |\n| 芬兰语     | fin    | 捷克语     | cs     | 罗马尼亚语 | rom    |\n| 斯洛文尼亚语 | slo   | 瑞典语     | swe    | 匈牙利语   | hu     |\n| 繁体中文   | cht    | 越南语     | vie    |            |        |\n\n### 特色优势\n\n1. 依托互联网数据资源和自然语言处理技术优势，上线全球首个互联网神经网络翻译系统，日均响应千亿字符请求\n2. 2019国际机器翻译评测（WMT19）中，获得中英翻译第一，提供业界领先的机器翻译服务\n3. 支持用户上传术语对翻译结果进行干预，优化翻译质量，用户可根据不同产品、不同领域创建多个术语库\n4. 翻译请求可实现实时响应，服务稳定性高，在海外也可及时获取翻译结果，保障用户稳定的服务体验\n\n### 应用场景\n\n1. 教育学习：在外语教学及学习场景中，通过实时句子翻译、单词释义、语音合成等功能，帮助师生沟通、外教课后点评，辅助阅读和写作，全面提升学习效率与质量\n2. 手机厂商：应用于手机系统中，实现手机系统取词翻译、对话文本翻译等服务。为手机应用开发者提供便捷的翻译功能\n3. 跨境电商：在商业全球化背景下，针对跨国商贸服务中产品名称、详情页等网站基本信息进行翻译，助力企业开拓国际市场\n4. 智能硬件：应用于翻译机、学习机、智能手表等硬件系统中，为用户提供文本翻译、词典及语音合成等能力，实现便捷准确的多语种互译功能\n\n## 基本用法\n\n通过如下示例代码可以快速开始使用文本翻译组件：\n\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = '...'\n\ntranslate = appbuilder.Translation()\nresp = translate(appbuilder.Message(\"你好\\n中国\"), from_lang=\"zh\", to_lang=\"en\")\n# 输出{'from_lang': 'zh', 'to_lang': 'en', 'trans_result': [{'src': '你好', 'dst': 'hello'}, {'src': '中国', 'dst': 'China'}]}\nprint(resp.content)\n```\n\n## 参数说明\n\n### 鉴权配置\n\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数说明\n\n无\n\n### 调用参数说明\n\n|参数名称 |参数类型 |是否必须 |描述 | 示例值    |\n|--------|--------|--------|----|--------|\n|message |obj:`Message`  |是 |输入的请求翻译文本| Message(\"你好\") |\n|from_lang|String|否 |翻译的源语言，默认为`auto`，表示自动检测语言。| zh    |\n|to_lang|Integer|否 |需要翻译的目标语言，默认为`en`，表示英语。| en  |\n|timeout| Float   | 否    | HTTP超时时间,单位：秒               |1||\n|retry|Integer|否 |HTTP重试次数| 3      |\n\n### 响应参数\n\n|参数名称 |参数类型 |描述 |示例值|\n|--------|--------|----|------|\n|from_lang  |String  |翻译源语言| zh|\n|to_lang  |String  |翻译目标语言|en|\n|trans_result  |List[Object]  |返回结果|[{'src': '你好', 'dst': 'hello'}]|\n|trans_result[0].src  |String  |源文本|你好|\n|trans_result[0].dst  |String  |目标文本|hello|\n\n### 响应示例\n\n```json\n{\n  \"from_lang\": \"zh\",\n  \"to_lang\": \"en\",\n  \"trans_result\": [\n    {\n      \"src\": \"你好\",\n      \"dst\": \"hello\"\n    }\n  ]\n}\n```\n\n### 错误码\n|错误码|描述|\n|------|---|\n\n## 更新记录和贡献\n* 文本翻译-通用版 (2024-01)\n\n## 语种列表\n\n|名称 |代码 |语种检测|\n|----|-----|------|\n| 阿拉伯语           | ara  | 是   |\n| 爱尔兰语           | gle  | 是   |\n| 奥克语             | oci  | 是   |\n| 阿尔巴尼亚语        | alb  | 是   |\n| 阿尔及利亚阿拉伯语   | arq  | 否   |\n| 阿肯语             | aka  | 否   |\n| 阿拉贡语           | arg  | 否   |\n| 阿姆哈拉语          | amh  | 是   |\n| 阿萨姆语           | asm  | 是   |\n| 艾马拉语           | aym  | 否   |\n| 阿塞拜疆语          | aze  | 是   |\n| 阿斯图里亚斯语       | ast  | 是   |\n| 奥塞梯语            | oss  | 否   |\n| 爱沙尼亚语          | est  | 是   |\n| 奥杰布瓦语          | oji  | 否   |\n| 奥里亚语            | ori  | 是   |\n| 奥罗莫语            | orm  | 否   |\n| 波兰语              | pl   | 是   |\n| 波斯语              | per  | 是   |\n| 布列塔尼语          | bre  | 是   |\n| 巴什基尔语          | bak  | 否   |\n| 巴斯克语            | baq  | 是   |\n| 巴西葡萄牙语        | pot  | 否   |\n| 白俄罗斯语          | bel  | 是   |\n| 柏柏尔语            | ber  | 是   |\n| 邦板牙语            | pam  | 否   |\n| 保加利亚语          | bul  | 是   |\n| 北方萨米语          | sme  | 否   |\n| 北索托语           | ped  | 否   |\n| 本巴语             | bem  | 否   |\n| 比林语             | bli  | 否   |\n| 比斯拉马语          | bis  | 否   |\n| 俾路支语            | bal  | 否   |\n| 冰岛语              | ice  | 是   |\n| 波斯尼亚语          | bos  | 是   |\n| 博杰普尔语          | bho  | 否   |\n| 楚瓦什语            | chv  | 否   |\n| 聪加语             | tso  | 否   |\n| 丹麦语             | dan  | 是   |\n| 德语               | de   | 是   |\n| 鞑靼语              | tat  | 是   |\n| 掸语               | sha  | 否   |\n| 德顿语              | tet  | 否   |\n| 迪维希语            | div  | 否   |\n| 低地德语            | log  | 是   |\n| 俄语               | ru   | 是   |\n| 法语               | fra  | 是   |\n| 菲律宾语            | fil  | 是   |\n| 芬兰语              | fin  | 是   |\n| 梵语               | san  | 否   |\n| 弗留利语            | fri  | 否   |\n| 富拉尼语            | ful  | 否   |\n| 法罗语              | fao  |   否   |\n| 盖尔语              | gla  | 否   |\n| 刚果语              | kon  | 否   |\n| 高地索布语          | ups  | 否   |\n| 高棉语             | hkm  | 是   |\n| 格陵兰语           | kal  | 否   |\n| 格鲁吉亚语         | geo  | 是   |\n| 古吉拉特语         | guj  | 是   |\n| 古希腊语           | gra  | 否   |\n| 古英语             | eno  | 否   |\n| 瓜拉尼语           | grn  | 否   |\n| 韩语               | kor  | 是   |\n| 荷兰语             | nl   | 是   |\n| 胡帕语             | hup  | 否   |\n| 哈卡钦语           | hak  | 否   |\n| 海地语             | ht   | 否   |\n| 豪萨语             | hau  | 否   |\n| 黑山语             | mot  | 否   |\n| 吉尔吉斯语          | kir  | 否   |\n| 加利西亚语          | glg  | 是   |\n| 加拿大法语          | frn  | 否   |\n| 加泰罗尼亚语        | cat  | 是   |\n| 捷克语             | cs   | 是   |\n| 卡拜尔语           | kab  | 是   |\n| 卡纳达语           | kan  | 是   |\n| 卡努里语           | kau  | 否   |\n| 卡舒比语           | kah  | 否   |\n| 康瓦尔语           | cor  | 否   |\n| 科萨语             | xho  | 是   |\n| 科西嘉语           | cos  | 否   |\n| 克里克语           | cre  | 否   |\n| 克里米亚鞑靼语      | cri  | 否   |\n| 克林贡语           | kli  | 否   |\n| 克罗地亚语         | hrv  | 是   |\n| 克丘亚语           | que  | 否   |\n| 克什米尔语         | kas  | 否   |\n| 孔卡尼语           | kok  | 否   |\n| 库尔德语           | kur  | 是   |\n| 拉丁语             | lat  | 是   |\n| 老挝语             | lao  | 否   |\n| 罗马尼亚语          | rom  | 是   |\n| 拉特加莱语          | lag  | 否   |\n| 拉脱维亚语          | lav  | 是   |\n| 林堡语             | lim  | 否   |\n| 林加拉语           | lin  | 否   |\n| 卢干达语           | lug  | 否   |\n| 卢森堡语           | ltz  | 否   |\n| 卢森尼亚语         | ruy  | 否   |\n| 卢旺达语           | kin  | 是   |\n| 立陶宛语           | lit  | 是   |\n| 罗曼什语           | roh  | 否   |\n| 罗姆语             | ro   | 否   |\n| 逻辑语             | loj  | 否   |\n| 马来语             | may  | 是   |\n| 缅甸语             | bur  | 是   |\n| 马拉地语           | mar  | 否   |\n| 马拉加斯语          | mg   | 是   |\n| 马拉雅拉姆语         | mal  | 是   |\n| 马其顿语            | mac  | 是   |\n| 马绍尔语            | mah  | 否   |\n| 迈蒂利语            | mai  | 是   |\n| 曼克斯语            | glv  | 否   |\n| 毛里求斯克里奥尔语    | mau  | 否   |\n| 毛利语              | mao  | 否   |\n| 孟加拉语            | ben  | 是   |\n| 马耳他语            | mlt  | 是   |\n| 苗语               | hmn  | 否   |\n| 挪威语              | nor  | 是   |\n| 那不勒斯语           | nea  | 否   |\n| 南恩德贝莱语         | nbl  | 否   |\n| 南非荷兰语           | afr  | 是   |\n| 南索托语             | sot  | 否   |\n| 尼泊尔语             | nep  | 是   |\n| 葡萄牙语             | pt   | 是   |\n| 旁遮普语             | pan  | 是   |\n| 帕皮阿门托语          | pap  | 否   |\n| 普什图语             | pus  | 否   |\n| 齐切瓦语             | nya  | 否   |\n| 契维语               | twi  | 否   |\n| 切罗基语             | chr  | 否   |\n| 日语                 | jp   | 是   |\n| 瑞典语               | swe  | 是   |\n| 萨丁尼亚语            | srd  | 否   |\n| 萨摩亚语              | sm   | 否   |\n| 塞尔维亚-克罗地亚语     | sec  | 否   |\n| 塞尔维亚语             | srp  | 是   |\n| 桑海语                | sol  | 否   |\n| 僧伽罗语              | sin  | 是   |\n| 世界语                | epo  | 是   |\n| 书面挪威语             | nob  | 是   |\n| 斯洛伐克语             | sk   | 是   |\n| 斯洛文尼亚语           | slo  | 是   |\n| 斯瓦希里语             | swa  | 是   |\n| 索马里语               | som  | 是   |\n| 塞尔维亚语（西里尔）     | src  | 否   |\n| 泰语                  | th   | 是   |\n| 土耳其语               | tr   | 是   |\n| 塔吉克语               | tgk  | 是   |\n| 泰米尔语               | tam  | 是   |\n| 他加禄语               | tgl  | 是   |\n| 提格利尼亚语            | tir  | 否   |\n| 泰卢固语               | tel  | 是   |\n| 突尼斯阿拉伯语          | tua  | 否   |\n| 土库曼语               | tuk  | 否   |\n| 乌克兰语               | ukr  | 是   |\n| 瓦隆语                 | wln  | 是   |\n| 威尔士语               | wel  | 是   |\n| 文达语                 | ven  | 否   |\n| 沃洛夫语               | wol  | 否   |\n| 乌尔都语               | urd  | 是   |\n| 西班牙语               | spa  | 是   |\n| 希伯来语               | heb  | 是   |\n| 希腊语                 | el   | 是   |\n| 匈牙利语               | hu   | 是   |\n| 西弗里斯语              | fry  | 是   |\n| 西里西亚语              | sil  | 否   |\n| 希利盖农语              | hil  | 否   |\n| 下索布语                | los  | 否   |\n| 夏威夷语                | haw  | 否   |\n| 新挪威语                | nno  | 是   |\n| 西非书面语              | nqo  | 否   |\n| 信德语                 | snd  | 否   |\n| 修纳语                 | sna  | 否   |\n| 宿务语                 | ceb  | 否   |\n| 叙利亚语               | syr  | 否   |\n| 巽他语                 | sun  | 否   |\n| 英语                   | en   | 是   |\n| 印地语                 | hi   | 是   |\n| 印尼语                 | id   | 是   |\n| 意大利语               | it   | 是   |\n| 越南语                 | vie  | 是   |\n| 意第绪语               | yid  | 否   |\n| 因特语                 | ina  | 否   |\n| 亚齐语                 | ach  | 否   |\n| 印古什语               | ing  | 否   |\n| 伊博语                 | ibo  | 否   |\n| 伊多语                 | ido  | 否   |\n| 约鲁巴语               | yor  | 否   |\n| 亚美尼亚语             | arm  | 是   |\n| 伊努克提图特语          | iku  | 否   |\n| 中文(简体)             | zh   | 是   |\n| 中文(繁体)             | cht  | 是   |\n| 中文(文言文)           | wyw  | 是   |\n| 中文(粤语)             | yue  | 是   |\n| 扎扎其语               | zaz  | 否   |\n| 中古法语               | frm  | 否   |\n| 祖鲁语                 | zul  | 否   |\n| 爪哇语                 | jav  | 否   |\n"
  },
  {
    "path": "python/core/components/translate/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/translate/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n文本翻译-通用版组件\n\"\"\"\nimport json\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.components.translate.model import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass Translation(Component):\n    r\"\"\"\n    文本翻译组件,可支持中、英、日、韩等200+语言互译，100+语种自动检测。\n    支持语种列表可参照 https://ai.baidu.com/ai-doc/MT/4kqryjku9#%E8%AF%AD%E7%A7%8D%E5%88%97%E8%A1%A8\n\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        translate = appbuilder.Translation()\n        resp = translate(appbuilder.Message(\"你好\\n中国\"), to_lang=\"en\")\n        # 输出 {'from_lang':'zh', 'to_lang':'en', 'trans_result':[{'src':'你好','dst':'hello'},{'src':'中国','dst':'China'}]}\n        print(resp.content)\n    \"\"\"\n\n    name = \"translate\"\n    version = \"v1\"\n\n    manifests = [\n        {\n            \"name\": \"translation\",\n            \"description\": \"文本翻译通用版工具，会根据指定的目标语言对文本进行翻译，并返回翻译后的文本。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"q\": {\n                        \"type\": \"string\",\n                        \"description\": \"需要翻译的源文本，文本翻译工具会将该文本翻译成对应的目标语言\"\n                    },\n                    \"to_lang\": {\n                        \"type\": \"string\",\n                        \"description\": \"翻译的目标语言类型，'en'表示翻译成英语, 'zh'表示翻译成中文，'yue'表示翻译成粤语，'wyw'表示翻译成文言文，\"\n                                       \"'jp'表示翻译成日语，'kor'表示翻译成韩语，'fra'表示翻译成法语，'spa'表示翻译成西班牙语，'th'表示翻译成泰语,\"\n                                       \"'ara'表示翻译成阿拉伯语，'ru'表示翻译成俄语，'pt'表示翻译成葡萄牙语，'de'表示翻译成德语，'it'表示翻译成意大利语，\"\n                                       \"'el'表示翻译成希腊语，'nl'表示翻译成荷兰语,'pl'表示翻译成波兰语,'bul'表示翻译成保加利亚语，'est'表示翻译成爱沙尼亚语，\"\n                                       \"'dan'表示翻译成丹麦语, 'fin'表示翻译成芬兰语，'cs'表示翻译成捷克语，'rom'表示翻译成罗马尼亚语，'slo'表示翻译成斯洛文尼亚语，\"\n                                       \"'swe'表示翻译成瑞典语，'hu'表示翻译成匈牙利语，'cht'表示翻译成繁体中文，'vie'表示翻译成越南语，默认为'en'\",\n                        \"enum\": [\"en\", \"zh\", \"yue\", \"wyw\", \"jp\", \"kor\", \"fra\", \"spa\", \"th\", \"ara\", \"ru\", \"pt\", \"de\",\n                                 \"it\", \"el\", \"nl\", \"pl\", \"bul\", \"est\", \"dan\", \"fin\", \"cs\", \"rom\", \"slo\", \"swe\", \"hu\",\n                                 \"cht\", \"vie\"]\n                    }\n                },\n                \"required\": [\n                    \"q\"\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, from_lang: str = \"auto\", to_lang: str = \"en\",\n            timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        根据提供的文本以及语种参数执行文本翻译\n\n        Args:\n            message (Message): 翻译文本。\n            from_lang (str): 翻译的源语言。默认为 \"auto\"。\n            to_lang (str): 翻译的目标语言。默认为 \"en\"。\n            timeout (float, optional): 翻译请求的超时时间。\n            retry (int, optional): 重试次数。\n\n        Returns:\n            Message: 返回的文本翻译结果。\n            例如，Message(content={'from_lang': 'zh', 'to_lang': 'en', 'trans_result': [{'src': '你好', 'dst': 'hello'}]})\n        \"\"\"\n        req = TranslateRequest()\n        req.q = message.content\n        req.from_lang = from_lang\n        req.to_lang = to_lang\n        result = self._translate(req, timeout=timeout, retry=retry)\n        result_dict = proto.Message.to_dict(result)\n\n        out = TranslateOutMsg(**result_dict[\"result\"])\n        return Message(content=out.model_dump())\n\n    def _translate(self, request: TranslateRequest, timeout: float = None,\n                   retry: int = 0, request_id: str = None) -> TranslateResponse:\n        \"\"\"\n        根据提供的 TranslateRequest 执行文本翻译。\n\n        Args:\n            request (TranslateRequest): 翻译请求参数。\n            timeout (float, optional): 请求超时时间。\n            retry (int, optional): 重试次数。\n\n        Returns:\n            TranslateResponse: 文本翻译结果的响应体。\n        \"\"\"\n        if not request.to_lang or not request.q:\n            raise ValueError(\"params `to_lang` and `q` must be set\")\n        if not request.from_lang:\n            request.from_lang = \"auto\"\n        request_data = TranslateRequest.to_json(request)\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/json;charset=utf-8'\n\n        url = self.http_client.service_url(\"/v1/bce/aip/mt/texttrans/v1\")\n\n        response = self.http_client.session.post(url, headers=headers, data=request_data, timeout=timeout)\n\n        self.http_client.check_response_header(response)\n        data = response.json()\n        request_id = self.http_client.response_request_id(response)\n        self.http_client.check_response_json(data)\n        if \"error_code\" in data and \"error_msg\" in data:\n            raise AppBuilderServerException(request_id=request_id, service_err_code=data[\"error_code\"],\n                                            service_err_message=data[\"error_msg\"])\n\n        json_str = json.dumps(data)\n        return TranslateResponse(TranslateResponse.from_json(json_str))\n\n    @components_run_stream_trace\n    def tool_eval(self, name: str, streaming: bool, **kwargs):\n        \"\"\"\n        工具函数，用于翻译指定的文本。\n        \n        Args:\n            name (str): 函数名称，此参数在本函数中未使用。\n            streaming (bool): 是否流式输出翻译结果。\n            **kwargs: 关键字参数，可以包含以下参数：\n                - traceid (str, optional): 请求的唯一标识符，默认为None。\n                - q (str): 待翻译的文本。\n                - to_lang (str, optional): 目标语言代码，默认为\"en\"。\n        \n        Returns:\n            如果streaming为True，则返回生成器，生成包含翻译结果的字典；\n            如果streaming为False，则返回包含翻译结果的JSON字符串。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果未设置参数\"q\"，则抛出此异常。\n        \n        \"\"\"\n        traceid = kwargs.get(\"traceid\")\n        req = TranslateRequest()\n        text = kwargs.get(\"q\", None)\n        if not text:\n            raise InvalidRequestArgumentError(\"param `q` must be set\")\n        req.q = text\n        to_lang = kwargs.get(\"to_lang\", \"en\")\n        req.to_lang = to_lang\n        results = proto.Message.to_dict(self._translate(req, request_id=traceid))[\"result\"]\n        trans_result = results[\"trans_result\"]\n        res = {\n            \"原文本\": \"\\n \".join(item[\"src\"] for item in trans_result),\n            \"翻译结果\": \"\\n \".join(item[\"dst\"] for item in trans_result)\n        }\n        res = json.dumps(res, ensure_ascii=False, indent=4)\n        if streaming:\n            yield {\n                \"type\": \"text\",\n                \"text\": res,\n                \"visible_scope\": 'llm',\n            }\n            yield {\n                \"type\": \"text\",\n                \"text\": \"\",\n                \"visible_scope\": 'user',\n            }\n        else:\n            return res\n"
  },
  {
    "path": "python/core/components/translate/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n文本翻译model\n\"\"\"\n\nimport proto\nfrom typing import List\nfrom pydantic import BaseModel\n\n\nclass TranslateRequest(proto.Message):\n    \"\"\"\n    文本翻译请求体。\n\n    Attributes:\n        from_lang (str): 翻译的源语言。\n        to_lang (str): 翻译的目标语言。\n        q (str): 待翻译的文本。\n    \"\"\"\n    from_lang: str = proto.Field(\n        proto.STRING,\n        number=1,\n        json_name=\"from\"\n    )\n    to_lang: str = proto.Field(\n        proto.STRING,\n        number=2,\n        json_name=\"to\"\n    )\n    q: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass TranslateResponse(proto.Message):\n    \"\"\"\n    文本翻译请求响应体。\n\n    Attributes:\n        log_id (int): 文本翻译请求的标识符。\n        result (TranslateRes): 文本翻译结果。\n    \"\"\"\n    log_id: int = proto.Field(\n        proto.INT64,\n        number=1,\n    )\n    result: \"TranslateRes\" = proto.Field(\n        proto.MESSAGE,\n        number=2,\n        message='TranslateRes',\n    )\n\n\nclass TranslateRes(proto.Message):\n    \"\"\"\n    表示翻译请求的结果。\n\n    Attributes:\n        from_lang (str): 翻译的源语言。\n        to_lang (str): 翻译的目标语言。\n        trans_result (List[TranslateResMeta]): 翻译结果列表。\n    \"\"\"\n    from_lang: str = proto.Field(\n        proto.STRING,\n        number=1,\n        json_name=\"from\"\n\n    )\n    to_lang: str = proto.Field(\n        proto.STRING,\n        number=2,\n        json_name=\"to\"\n    )\n    trans_result: \"TranslateResMeta\" = proto.RepeatedField(\n        proto.MESSAGE,\n        number=3,\n        message='TranslateResMeta',\n    )\n\n\nclass TranslateResMeta(proto.Message):\n    \"\"\"\n    表示与翻译结果关联的proto结构元数据。\n\n    Attributes:\n        dst (str): 翻译后的文本。\n        src (str): 源文本。\n    \"\"\"\n    dst: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    src: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n\n\nclass TranslateResult(BaseModel):\n    \"\"\"\n    表示与翻译结果关联的pydantic结构元数据。\n\n    Attributes:\n        src (str): 源文本。\n        dst (str): 翻译后的文本。\n    \"\"\"\n    src: str  # 源文本\n    dst: str  # 目标文本\n\n\nclass TranslateOutMsg(BaseModel):\n    \"\"\"\n    表示文本翻译输出的pydantic结构消息。\n\n    Attributes:\n        from_lang (str): 翻译的源语言。\n        to_lang (str): 翻译的目标语言。\n        trans_result (List[TranslateResult]): 一个包含翻译结果的列表。\n            如果请求参数 `q` 包含 `\\n`，则会以分段形式返回翻译结果。\n    \"\"\"\n    from_lang: str\n    to_lang: str\n    trans_result: List[TranslateResult]\n"
  },
  {
    "path": "python/core/components/tree_mind/README.md",
    "content": "# 树图 (TreeMind)\n\n## 简介\n树图（TreeMind）提供智能思维导图制作工具和丰富的模板，支持脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴、时间线等多种专业格式。\n\n### 功能介绍   \n树图（TreeMind）是一款智能思维导图制作工具，它提供了一个用户友好的平台来创建和编辑各种类型的图表。该工具支持多种专业格式，包括脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴和时间线等，满足不同用户在不同场景下的需求。\n\n### 特色优势\nTreeMind提供丰富的模板，支持多种图表格式，用户可以根据个人需求自由编辑和调整图表。\n\n### 应用场景  \n年度总结：用户可以利用TreeMind生成年度总结的思维导图，整理和回顾一年的工作成果和经验教训。\n项目管理：在项目管理中，TreeMind可以用来规划项目流程、组织架构和时间线，确保项目按计划进行。\n教育和学习：教师和学生可以使用TreeMind来创建课程大纲、学习笔记和复习资料，提高学习效率。\n商业策划：商业人士可以利用TreeMind来制定商业策略、市场分析和竞争对手分析等。\n会议记录：在会议中，TreeMind可以作为记录工具，帮助整理会议要点和行动计划。\n\n## 基本用法\n\n下面是文生图的代码示例: \n\n```python\nimport os\nimport appbuilder\n# 设置环境变量和初始化\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\ntreemind = appbuilder.TreeMind()\nquery = \"生成一份年度总结的思维导图\"\nmsg = appbuilder.Message(query)\nout = treemind.run(msg)\nprint(out.content)\n\n>>>\n{'result': '思维导图已经为您生成好了，您可以点击'img_link'对应的链接查看，如果您觉得这个思维导图还不够完美，或者您的想法需要更自由地表达，点击'edit_link'对应的链接，对思维导图变形、变色、变内容、甚至可以添加新的元素,    \n'img_link': 'https://static.shutu.cn/shutu/static/open6e/2024/05/24/dbd67eddec13f3a6a75857b9c6e06d85.jpeg',    \n'edit_link': 'https://gapi.shutu.cn/ai/edit-mind-url?works_guid=open5ab4af46187ff7c138fcd95de09efe92_bdappbuilder'}\n```\n\n生成的思维导图:<br/>![图片url](https://bj.bcebos.com/appbuilder-sdk-components/TreeMind-年终总结思维导图.jpeg)\n\n\n## 参数说明\n\n### 鉴权配置\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\n# 设置环境中的TOKEN，以下示例略\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\n```\n\n### 初始化参数\n无\n\n### 调用参数\n| 参数名称    | 参数类型    | 是否必须 | 描述                          | 示例值                                            |\n|---------|---------|------|-----------------------------|------------------------------------------------|\n| message | obj:`Message`  | 是    | 输入的消息，用于生成思维导图，这是一个必需的参数 | Message(content={\"query\": \"生成一张年终总结的思维导图\"}) |\n\n### 响应参数\n\n| 参数名称        |参数类型 | 描述   | 示例值 |\n|-------------|--------|------|------|\n| resp | obj:`Message` | 组件返回结果 | Message(name=msg, content={'result': '生成的思维导图：xxx。思维导图已经为您生成好了，如果您觉得这个思维导图还不够完美，或者您的想法需要更自由地表达，点击编辑按钮，对思维导图变形、变色、变内容、甚至可以添加新的元素，您可以通过这个链接编辑：xxx。', 'img_link': 'xxx', 'edit_link': 'xxx'}, mtype=dict)  |"
  },
  {
    "path": "python/core/components/tree_mind/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n# 版权所有 (c) 2023 百度公司。保留所有权利。\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License."
  },
  {
    "path": "python/core/components/tree_mind/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"树图工具\"\"\"\n\nimport json\nfrom typing import Dict, List, Optional, Any\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.tree_mind.model import TreeMindRequest, TreeMindResponse\n\n\nfrom appbuilder.core.component import Component\n\nclass TreeMind(Component):\n    r\"\"\"\n    树图工具，提供智能思维导图制作工具和丰富的模板，支持脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴、时间线等多种专业格式。\n    .. code-block:: python\n    \n        import os\n        import requests\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"GATEWAY_URL\"] = \"...\"\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n        treemind = appbuilder.TreeMind()\n        resp = treemind.run(appbuilder.Message(\"生成一份年度总结的思维导图\"), to_lang=\"en\")\n        print(resp.content)\n        # 输出 {'from_lang':'zh', 'to_lang':'en', 'trans_result':[{'src':'你好','dst':'hello'},{'src':'中国','dst':'China'}]}\n    \"\"\"\n\n    name = \"tree_mind\"\n    version = \"v1\"\n    manifests = [\n            {\n                \"name\": \"tree_mind\",\n                \"description\": \"根据用户输入的信息，生成详细智能思维导图、脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴、时间线等多种专业格式思维导图\",\n                \"parameters\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"query\": {\n                            \"type\": \"string\",\n                            \"description\": \"用户想要生成思维导图的内容\"\n                        },\n                    },\n                    \"required\": [\n                        \"query\"\n                    ]\n                }\n            }\n        ]\n\n    def _post(self, query, **kwargs):\n        if query is None or query == \"\":\n            raise InvalidRequestArgumentError(\"query is empty!\" )\n        request = TreeMindRequest(query_text=query)\n        headers = self.http_client.auth_header(kwargs.get(\"traceid\"))\n\n        headers['Content-Type'] = 'application/json'\n        tree_mind_url = self.http_client.service_url(\"/v1/component/component/query_mind_open\")\n\n        payload = TreeMindRequest.model_dump(request)\n\n        response = self.http_client.session.post(tree_mind_url, headers=headers, json=payload)\n        self.http_client.check_response_header(response)\n        data = response.text\n        treemind_dict = json.loads(data.split(\"data:\")[-1])\n        treemind_response = TreeMindResponse(**treemind_dict)\n        jump_link = treemind_response.info.downloadInfo.fileInfo.jumpLink\n        img_link = treemind_response.info.downloadInfo.fileInfo.pic\n        return img_link, jump_link\n\n    @components_run_stream_trace\n    def tool_eval(\n            self,\n            query,\n            **kwargs,\n    ):\n        r\"\"\"调用树图查询接口\n        Args:\n            query (string): 用户想要生成思维导图的内容\n        Returns:\n            dict: 返回生成的思维导图的图片链接和跳转链接\n        \"\"\"\n\n        img_link, jump_link = self._post(query, **kwargs)\n\n        inst = \"你必须遵循指令，输出无需总结，只需要将，“原样输出内容”对应的内容原样输出即可：\\n\"\n        img_res = f\"原样输出内容：![图片url]({img_link})\\n\"\n        jump_res = f\"{query}的思维导图已经为您生成好了，您可以通过这个链接编辑：编辑链接：{jump_link}。\"\n        end_talk = \"如果您觉得这个思维导图还不够完美，或者您的想法需要更自由地表达，点击编辑按钮，对思维导图变形、变色、变内容、甚至可以添加新的元素，快来试试吧！\"\n        result = inst + img_res + jump_res + end_talk\n        urls = [img_link, jump_link]\n        yield {\n            \"type\": \"text\",\n            \"text\": result,\n            \"visible_scope\": 'llm',\n        }\n        yield {\n            \"type\": \"urls\",\n            \"text\": urls,\n            \"visible_scope\": 'all',\n        }\n\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, **kwargs) -> Message:\n        \"\"\"运行组件\n        Args:\n            message (Message): 消息对象\n        Returns:\n            Message: 返回消息对象\n        \"\"\"\n        query = message.content\n        img_link, jump_link = self._post(query, **kwargs)\n\n        result = {\n            \"result\": \"思维导图已经为您生成好了，您可以点击'img_link'对应的链接查看，如果您觉得这个思维导图还不够完美，或者您的想法需要更自由地表达，点击'edit_link'对应的链接，对思维导图变形、变色、变内容、甚至可以添加新的元素\",\n            \"img_link\": img_link,\n            \"edit_link\": jump_link\n        }\n        return Message(content=result)"
  },
  {
    "path": "python/core/components/tree_mind/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"\n树图model\n\"\"\"\n\nimport proto\nfrom typing import List\nfrom pydantic import BaseModel\n\n\nclass TreeMindRequest(BaseModel):\n    query_text:str\n\nclass FileInfo(BaseModel):\n    jumpLink: str\n    jumpText: str\n    pic: str\n\nclass DownloadInfo(BaseModel):\n    fileInfo: FileInfo\n    endDesc: str\n\nclass Info(BaseModel):\n    downloadInfo: DownloadInfo\n\nclass TreeMindResponse(BaseModel):\n    errCode: str\n    errMsg: str\n    time_diff: int\n    info: Info\n\n\n\n"
  },
  {
    "path": "python/core/components/tts/README.md",
    "content": "# 短文本在线合成（TTS）\n\n## 简介\n短文本在线合成组件（TTS）提供高度拟人、流畅自然的语音合成服务，将文本朗读出来，基础音库性价比更高，精品音库听感更逼真。\n\n### 功能介绍\n提供高度拟人、流畅自然的语音合成服务。\n\n### 特色优势\n将文本朗读出来，基础音库性价比更高，精品音库听感更逼真。可实时生成语音输出，几乎没有延迟，更加自然流畅。\n\n### 应用场景\n文本朗读\n\n\n## 基本用法\n\n下面是语音合成的代码示例：\n```python\nimport os\nimport appbuilder\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\ntts = appbuilder.TTS()\ncwd = os.getcwd()\n\n# 使用baidu-tts模型, 默认返回MP3格式\ninp = appbuilder.Message(content={\"text\": \"欢迎使用语音合成\"})\nout = tts.run(inp)\nmp3_sample_path = os.path.join(cwd,\"sample.mp3\")\nwith open(mp3_sample_path, \"wb\") as f:\n    f.write(out.content[\"audio_binary\"])\nprint(\"成功将文本转语音，mp3格式文件已写入：{}\".format(mp3_sample_path))\n\n# 使用paddlespeech-tts模型，目前只支持返回WAV格式\nwav_sample_path = os.path.join(cwd,\"sample.wav\")\ninp = appbuilder.Message(content={\"text\": \"欢迎使用语音合成\"})\nout = tts.run(inp, model=\"paddlespeech-tts\", audio_type=\"wav\")\nwith open(wav_sample_path, \"wb\") as f:\n    f.write(out.content[\"audio_binary\"])\nprint(\"成功将文本转语音，wav格式文件已写入：{}\".format(wav_sample_path))\n```\n\n\n## 参数说明\n\n### 鉴权说明\n使用组件之前，请首先申请并设置鉴权参数，可参考[组件使用流程](https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5)。\n```python\nimport os \n\nos.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n```\n\n### 初始化参数\n\n无\n\n### 调用参数\n| 参数名称       | 参数类型    | 是否必须 | 描述                                                                                                                                                                                             | 示例值                                 |\n|------------|---------|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|\n| message    | String  | 是    | 待转成语音的文本                                                                                                                                                                                       | Message(content={\"text\": \"需合成的文本\"}) |\n| model      | String  | 否    | 默认是`baidu-tts`模型，可选值：`paddlespeech-tts`、`baidu-tts`                                                                                                                                            | paddlespeech-tts                    |\n| speed      | Integer | 否    | 语音语速，默认是5中等语速，取值范围在0~15之间，仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                  | 5                                   |\n| pitch      | Integer | 否    | 语音音调，默认是5中等音调，取值范围在0~15之间，仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                  | 5                                   |\n| volume     | Integer | 否    | 语音音量，默认是5中等音量，取值范围在0~15之间，,仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效                                                                                                                 | 5                                   |\n| person     | Integer | 否    | 语音人物特征，默认是0(度小美),普通音库可选值包括: 0(度小美)、1(度小宇)、3(度逍遥-基础)、4(度丫丫)；精品音库包括：5003(度逍遥-精品)、5118(度小鹿)、106(度博文)、110(度小童)、111(度小萌)、103(度米朵)、5(度小娇)；臻品音库包括：4003(度逍遥-情感男声)、4106(度博文-专业男主播)、4115(度小贤-电台男主播)、4119(度小鹿-甜美女声)、4105(度灵儿-清激女声)、4117(度小乔-活泼女声)、4100(度小雯-活力女主播)、4103(度米朵-可爱女声)、4144(度姗姗-娱乐女声)、4278(度小贝-知识女主播)、4143(度清风-配音男声)、4140(度小新-专业女主播)、4129(度小彦-知识男主播)、4149(度星河-广告男声)、4254(度小清-广告女声)、4206(度博文-综艺男声)、4226(南方-电台女主播)。仅当模型为`baidu-tts`参数有效，如果模型为`paddlespeech-tts`，参数自动失效 | 0                                   |\n| audio_type | String  | 否    | 音频文件格式，如果使用`baidu-tts`模型可选`mp3`, `wav`; 如果使用`paddlespeech-tts`模型非流式返回，参数只能设为`wav`;如果使用`paddlespeech-tts`模型流式返回，参数只能设为`pcm`                                                                     | wav                                 |\n| stream     | Bool    | 否    | 默认是False, 目前`paddlespeech-tts`模型支持流式返回，`baidu-tts`模型不支持流式返回                                                                                                                                    | False                               |\n| retry      | Integer | 否    | HTTP重试次数                                                                                                                                                                                       | 3                                   |\n| timeout    | Integer | 否    | HTTP超时时间                                                                                                                                                                                       | 5                                   |\n\n### 非流式语音响应参数\n| 参数名称          | 参数类型   | 描述     | 示例值     |\n|---------------|--------|--------|---------|\n| content       | Dict   | 消息内容   | 无       |\n| +audio_binary | Bytes  | 音频二进制流 | b'语音流'  |\n| +audio_type   | String | 音频类型   | wav/mp3 |\n\n\n### 流式语音响应参数\n| 参数名称    | 参数类型             | 描述       | 示例值 |\n|---------|------------------|----------|-----|\n| content | Python Generator | 可迭代的二进制流 | 无   |\n\n\n### 响应示例\n```json\n{\n\"content\": {\n             \"audio_binary\": \"\",\n              \"audio_type\": \"mp3\"\n           }\n}\n```\n\n\n### 错误码\n| 错误码 | 描述 |\n|-----|----|\n\n## 高级用法\n\n### TTS实时播放语音流\n```python\nimport os\nimport appbuilder\nimport pyaudio\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\ntts = appbuilder.TTS()\n# 使用paddlespeech-tts模型，目前只支持返回WAV格式\ninp = appbuilder.Message(content={\"text\": \"\"\"随着科技的迅速发展，教育领域也经历了巨大的变革。科技不仅改变了教学和学习的方式，还扩展了教育的可能性和边界。\n        从在线课程到交互式学习工具，科技为学生和教师提供了前所未有的资源和机遇。科技使得个性化学习成为可能。通过智能学习系统和适应性学习技术，\n        教育内容可以根据学生的学习速度和能力进行定制。\"\"\"})\n# 仅支持model为paddlespeech-tts，audio_type为pcm, stream为True\nout = tts.run(inp, model=\"paddlespeech-tts\", audio_type=\"pcm\", stream=True)\nplay = pyaudio.PyAudio()\nstream = play.open(format=play.get_format_from_width(2),\n                    channels=1,\n                    rate=24000,\n                    output=True,\n                    frames_per_buffer=2048)\n# 实时播放语音流\nfor pcm in out.content:\n    stream.write(pcm)\nstream.stop_stream()\nstream.close()\n```\n### pcm文件转wav\n\n```python\nimport os\nimport appbuilder\nimport wave\n\n# 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\nos.environ[\"APPBUILDER_TOKEN\"] = \"bce-YOURTOKEN\"\ntts = appbuilder.TTS()\ninp = appbuilder.Message(content={\"text\": \"\"\"随着科技的迅速发展，教育领域也经历了巨大的变革。科技不仅改变了教学和学习的方式，还扩展了教育的可能性和边界。\n        从在线课程到交互式学习工具，科技为学生和教师提供了前所未有的资源和机遇。科技使得个性化学习成为可能。通过智能学习系统和适应性学习技术，\n        教育内容可以根据学生的学习速度和能力进行定制。\"\"\"})\n# 仅支持model为paddlespeech-tts，audio_type为pcm, stream为True\nout = tts.run(inp, model=\"paddlespeech-tts\", audio_type=\"pcm\", stream=True)\ncount = 1\ncwd = os.getcwd()\nfor pcm in out.content:\n    wave_sample_path = os.path.join(cwd, \"{}.wav\".format(count))\n    wavfile = wave.open(wave_sample_path, 'wb')\n    wavfile.setnchannels(1)\n    wavfile.setsampwidth(2)\n    wavfile.setframerate(24000)\n    wavfile.writeframes(pcm)\n    wavfile.close()\n    print(\"成功将第{}个pcm语音块转换成wav格式，并将对应文件写入：{}\".format(count, wave_sample_path))\n    count += 1\n```\n\n\n## 更新记录和贡献\n* 短文本在线合成 (2024-01)\n* 增加流式能力 (2024-02)\n\n"
  },
  {
    "path": "python/core/components/tts/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/tts/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"text to speech component.\"\"\"\nimport base64\nimport traceback\n\nfrom typing import Literal\nfrom urllib.parse import quote_plus\nfrom appbuilder.core.component import Component\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.components.tts.model import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass TTS(Component):\n    r\"\"\"\n      文本转语音组件，即输入一段文本将其转为一段语音\n\n      Examples:\n\n      .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        tts = appbuilder.TTS()\n\n        # 默认使用baidu-tts模型, 默认返回MP3格式\n        inp = appbuilder.Message(content={\"text\": \"欢迎使用语音合成\"})\n        out = tts.run(inp)\n        with open(\"sample.mp3\", \"wb\") as f:\n            f.write(out.content[\"audio_binary\"])\n\n        # 使用paddlespeech-tts模型，目前只支持返回WAV格式\n        inp = appbuilder.Message(content={\"text\": \"欢迎使用语音合成\"})\n        out = tts.run(inp, model=\"paddlespeech-tts\", audio_type=\"wav\")\n        with open(\"sample.wav\", \"wb\") as f:\n            f.write(out.content[\"audio_binary\"])\n    \"\"\"\n    Baidu_TTS = \"baidu-tts\"\n    PaddleSpeech_TTS = \"paddlespeech-tts\"\n\n    def __init__(self, *args, **kwargs):\n        r\"\"\"初始化语音识别实例\n\n            参数:\n                *args (any, 可选): 位置参数\n                **kwargs(any, 可选)： 关键字参数\n            返回:\n                无\n           \"\"\"\n        r\"\"\"\"implement __init__ method\"\"\"\n        super().__init__(*args, **kwargs)\n        self.model = \"\"\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self,\n            message: Message,\n            model: Literal[\"baidu-tts\", \"paddlespeech-tts\"] = \"baidu-tts\",\n            speed: int = 5,\n            pitch: int = 5,\n            volume: int = 5,\n            person: int = 0,\n            audio_type: Literal[\"mp3\", \"wav\", \"pcm\"] = \"mp3\",\n            timeout: float = None,\n            retry: int = 0,\n            stream: bool = False) -> Message:\n        \"\"\"\n        执行文本转语音。\n        \n        Args:\n            message (Message): 待转为语音的文本。\n                举例: Message(content={\"text\": \"欢迎使用百度语音\"})如果选择baidu-tts模型，text最大文本长度为1024 GBK编码长度,大约为512个中英文字符;如果选择paddlespeech-tts模型, text最大文本长度是510个字符。\n            model (str, 可选): 默认是`baidu-tts`模型，可设置为`paddlespeech-tts`。\n            speed (int, 可选): 语音语速，默认是5中等语速，取值范围在0~15之间，\n                如果选择模型为paddlespeech-tts，参数自动失效。\n            pitch (int, 可选): 语音音调，默认是5中等音调，取值范围在0~15之间，\n                如果选择模型为paddlespeech-tts，参数自动失效。\n            volume (int, 音量): 语音音量，默认是5中等音量，取值范围在0~15之间，\n                如果选择模型为paddlespeech-tts，参数自动失效。\n            person (int, 可选): 语音人物特征，默认是0,\n                可选值包括:\n                度小宇=1 度小美=0 度逍遥（基础）=3 度丫丫=4 度逍遥（精品）=5003\n                度小鹿=5118 度博文=106 度小童=110 度小萌=111 度米朵=103 度小娇=5\n                度逍遥-情感男声=4003 度博文-专业男主播=4106 度小贤-电台男主播=4115\n                度小鹿-甜美女声=4119 度灵儿-清激女声=4105 度小乔-活泼女声=4117\n                度小雯-活力女主播=4100 度米朵-可爱女声=4103 度姗姗-娱乐女声=4144\n                度小贝-知识女主播=4278 度清风-配音男声=4143 度小新-专业女主播=4140\n                度小彦-知识男主播=4129 度星河-广告男声=4149 度小清-广告女声=4254\n                度博文-综艺男声=4206 南方-电台女主播=4226，\n                如果选择模型为paddlespeech-tts，参数自动失效。\n            audio_type (str, 可选): 音频文件格式，默认是`mp3`，\n                如果选择`paddlespeech-tts`模型，参数只能设为`wav`。\n            timeout (float, 可选): HTTP超时时间。\n            retry (int, 可选): HTTP重试次数。\n            stream (bool, 可选): 是否以流的形式返回音频数据，默认为False。\n        \n        Returns:\n            message (Message): 文本转语音结果。举例: Message(content={\"audio_binary\": b\"xxx\", \"audio_type\": \"mp3\"})\n        \"\"\"\n        if model != self.Baidu_TTS and model != self.PaddleSpeech_TTS:\n            raise InvalidRequestArgumentError(\n                f\"unsupported model {model}, expected model in {'baidu-tts', 'paddlespeech-tts'}\"\n            )\n        self.model = model\n        inp = TTSInMsg(**message.content)\n        if len(inp.text) == 0:\n            raise InvalidRequestArgumentError(\"request format error, text field is empty\")\n        if model == self.Baidu_TTS and (stream or audio_type not in [\"mp3\", \"wav\"]):\n            raise InvalidRequestArgumentError(\"Baidu_TTS argument error, expected audio type in {'mp3', 'wav'}\")\n        elif model == self.PaddleSpeech_TTS:\n            if stream and audio_type != \"pcm\":\n                raise InvalidRequestArgumentError(\"Invalid audio type, expected audio type is {'pcm'}\")\n            elif not stream and audio_type != \"wav\":\n                raise InvalidRequestArgumentError(\"Invalid audio type, expected audio type is {'wav'}\")\n\n        request = TTSRequest()\n        request.tex = inp.text\n        request.spd = speed\n        request.pit = pitch\n        request.vol = volume\n        request.per = person\n        request.stream = stream\n        if audio_type == \"mp3\":\n            request.aue = 3\n        elif audio_type == \"wav\" or audio_type == \"pcm\":\n            request.aue = 6\n        if stream and self.model == self.PaddleSpeech_TTS:\n            return Message(content=self.__synthesis(request=request, stream=True, retry=retry))\n        else:\n            response = self.__synthesis(request=request, timeout=timeout, retry=retry)\n            out = TTSOutMsg(audio_binary=response.binary, audio_type=audio_type)\n            return Message(content=out.model_dump())\n\n    def __synthesis(self,\n                    request: TTSRequest,\n                    stream: bool = False,\n                    timeout: float = None,\n                    retry: int = 0\n                    ) -> TTSResponse:\n        r\"\"\"调用底层接口进行语音合成\n\n            参数:\n                request (obj: `[PaddleTTSRequest, TTSRequest]`) : 语音合成输入参数\n\n            返回：\n                response (obj: `TTSResponse`): 语音合成输出参数\n        \"\"\"\n        request.ctp = \"1\"\n        request.lan = \"zh\"\n        request.cuid = \"1\"\n        if self.model == self.Baidu_TTS:\n            request.tex = quote_plus(request.tex)\n            request.validate_baidu_tts()\n            url = self.http_client.service_url(\"/v1/bce/aip_speech/tts_online\")\n        elif self.model == self.PaddleSpeech_TTS:\n            request.tp_project_id = \"paddlespeech\"\n            request.tp_per_id = \"100001\"\n            request.validate_paddle_speech_tts()\n            url = self.http_client.service_url(\"/v1/bce/paddle_speech/text2audio\")\n        else:\n            raise ValueError(\"model '{}' is not supported\".format(self.model))\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        auth_header = self.http_client.auth_header()\n        if self.model == self.Baidu_TTS:\n            response = self.http_client.session.post(url, data=TTSRequest.to_dict(request), timeout=timeout,\n                                                     headers=auth_header)\n        elif self.model == self.PaddleSpeech_TTS:\n            auth_header = self.http_client.auth_header()\n            auth_header['Content-type'] = \"application/json\"\n            if not stream:\n                response = self.http_client.session.post(url, json=TTSRequest.to_dict(request),\n                                                         timeout=timeout, headers=auth_header)\n            if stream:\n                response = self.http_client.session.post(url, json=TTSRequest.to_dict(request), timeout=(10, 200),\n                                                         headers=auth_header, stream=True)\n\n        self.http_client.check_response_header(response)\n        content_type = response.headers.get(\"Content-Type\", \"application/json\")\n        request_id = self.http_client.response_request_id(response)\n        if content_type.find(\"application/json\") != -1:\n            data = response.json()\n            self.http_client.check_response_json(data)\n            self.__class__.__check_service_error(request_id, data)\n        if not stream:\n            return TTSResponse(\n                binary=response.content,\n                request_id=request_id,\n                aue=request.aue\n            )\n        else:\n            return _iterate_chunk(request_id, response)\n\n    @staticmethod\n    def __check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response检查\n\n              参数:\n                  request (dict) : 文本转语音body返回\n              返回：\n                  无\n          \"\"\"\n\n        if \"err_no\" in data or \"err_msg\" in data or 'sn' in data or 'idx' in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"err_no\", 0),\n                service_err_message=\"{} . {} . {}]\".\n                format(data.get(\"err_msg\", \"\"),\n                       data.get(\"sn\", \"\"),\n                       data.get(\"idx\", \"\"))\n            )\n\n\ndef _iterate_chunk(request_id, response):\n    try:\n        for line in response.iter_lines():\n            chunk = line.decode('utf-8')\n            if chunk.startswith('data:'):\n                chunk = chunk.replace('data: ', '')\n                yield base64.b64decode(chunk)\n    except Exception as e:\n        raise AppBuilderServerException(request_id=request_id, message=traceback.format_exc())\n    finally:\n        response.close()\n"
  },
  {
    "path": "python/core/components/tts/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"short text to speech model.\"\"\"\nimport proto\n\nfrom pydantic import BaseModel\n\nclass TTSRequest(proto.Message):\n    r\"\"\"文本转语音请求参数.\n\n        属性:\n            tex (str): 如果选择`baidu-tts`模型，`tex`最大文本长度为1024 GBK编码长度, 如果选择`paddlespeech-tts`模型,\n            `tex`最大文本长度是510个字符.\n            tok (str, 可选): 用户token.\n            cuid (str, 可选): 用户ID.\n            ctp (str, 可选): 用户客户端类型.\n            lan (str): 目前仅支持中英-ZH.\n            spd(int, 可选): 语音语速，默认是5中等语速，取值范围在0~15之间，如果选择模型为paddlespeech-tts，参数自动失效.\n            pit(int, 可选): 语音音调，默认是5中等音调，取值范围在0~15之间，如果选择模型为paddlespeech-tts，参数自动失效.\n            vol(int, 音量): 语音音量，默认是5中等音量，取值范围在0~15之间，如果选择模型为paddlespeech-tts，参数自动失效.\n            per(int, 可选): 语音人物特征，默认是0,可选值包括度小宇=1 度小美=0 度逍遥（基础）=3 度丫丫=4 度逍遥（精品）=5003\n                度小鹿=5118 度博文=106 度小童=110 度小萌=111 度米朵=103 度小娇=5\n                度逍遥-情感男声=4003 度博文-专业男主播=4106 度小贤-电台男主播=4115\n                度小鹿-甜美女声=4119 度灵儿-清激女声=4105 度小乔-活泼女声=4117\n                度小雯-活力女主播=4100 度米朵-可爱女声=4103 度姗姗-娱乐女声=4144\n                度小贝-知识女主播=4278 度清风-配音男声=4143 度小新-专业女主播=4140\n                度小彦-知识男主播=4129 度星河-广告男声=4149 度小清-广告女声=4254\n                度博文-综艺男声=4206 南方-电台女主播=4226，\n                如果选择模型为paddlespeech-tts，参数自动失效.\n            aue(int, 可选): 语音格式, 默认是3(mp3)  4(pcm-16k) 5(pcm-8k) 6-wav.\n            tp_project_id(str): paddlespeech-tts项目ID\n            tp_per_id(str): paddlespeech-tts音频ID\n\n    \"\"\"\n    tex: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    tok: str = proto.Field(\n        proto.STRING,\n        number=2,\n        optional=True,\n    )\n    cuid: str = proto.Field(\n        proto.STRING,\n        number=3,\n        optional=True,\n    )\n    ctp: str = proto.Field(\n        proto.STRING,\n        number=4,\n    )\n    lan: str = proto.Field(\n        proto.STRING,\n        number=5,\n    )\n    spd: int = proto.Field(\n        proto.INT32,\n        number=6,\n    )\n    pit: int = proto.Field(\n        proto.INT32,\n        number=7,\n    )\n    vol: int = proto.Field(\n        proto.INT32,\n        number=8,\n    )\n    per: int = proto.Field(\n        proto.INT32,\n        number=9,\n    )\n    aue: int = proto.Field(\n        proto.INT32,\n        number=10,\n    )\n    tp_project_id: str = proto.Field(\n        proto.STRING,\n        number=11,\n        optional=True,\n    )\n    tp_per_id: str = proto.Field(\n        proto.STRING,\n        number=12,\n        optional=True,\n    )\n    stream: bool = proto.Field(\n        proto.BOOL,\n        number=13,\n        optional=True,\n    )\n\n    def __validate(self):\n        \"\"\"检查公共参数\"\"\"\n        if len(self.tex) == 0:\n            raise ValueError(\"tex field must be set\")\n        if self.spd < 0 or self.spd > 15:\n            raise ValueError(\"spd value must in [0,15]\")\n        if self.pit < 0 or self.pit > 15:\n            raise ValueError(\"pit value must in [0,15]\")\n        if self.vol < 0 or self.vol > 15:\n            raise ValueError(\"vol value must in [0,15]\")\n\n    def validate_baidu_tts(self):\n        \"\"\"检查baidu-tts模型请求参数\"\"\"\n        self.__validate()\n\n        _BAIDU_VALID_PER = {0, 1, 3, 4, 5, 103, 106, 110, 111, 4003, 4106, 4115, 4119,\n            4105, 4117, 4100, 4103, 4144, 4278, 4143, 4140, 4129, 4149, 4254, 4206, 4226, 5003, 5118}\n\n        if self.per not in _BAIDU_VALID_PER:\n            raise ValueError(\n                f\"per value is illegal, expected in {_BAIDU_VALID_PER}, got {self.per}\"\n            )\n        if self.aue == 0:\n            self.aue = 3\n        if self.aue not in {3, 4, 5, 6}:\n            raise ValueError(f\"aue value is illegal, exepect in {3, 4, 5, 6}, got {self.aue}\")\n\n    def validate_paddle_speech_tts(self):\n        \"\"\"验证参数是否合法\"\"\"\n        self.__validate()\n        if self.aue == 0:\n            self.aue = 6\n        if self.aue not in {6}:\n            raise ValueError(\"aue value is illegal, expectd aue value is 6, got{}\".format(self.aue))\n\n\nclass TTSResponse(proto.Message):\n    r\"\"\"文本转语音返回.\n\n         属性:\n             binary (bytes): 语音二进制流.\n             aue (int):语音格式, 3(mp3), 4(pcm-16k), 5(pcm-8k) 6(wav).\n             request_id(str): 请求ID\n     \"\"\"\n    binary: bytes = proto.Field(\n        proto.BYTES,\n        number=1\n    )\n    aue: int = proto.Field(\n        proto.INT32,\n        number=2,\n    )\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n\n\nclass TTSInMsg(BaseModel):\n    r\"\"\"文本转语音输入消息.\n\n        属性:\n            text(str): 待转为语音的文本, 如果选择`baidu-tts`模型，最大文本长度为1024 GBK编码长度\n            如果选择`paddlespeech-tts`模型, 最大文本长度是510个字符.\n    \"\"\"\n    text: str\n\n\nclass TTSOutMsg(BaseModel):\n    r\"\"\" 文本转语音输出消息.\n\n        属性:\n            audio_binary(bytes): 语音二进制流.\n            audio_type(AudioType): 语音类型，`mp3`或`wav`.\n    \"\"\"\n    audio_binary: bytes\n    audio_type: str\n"
  },
  {
    "path": "python/core/components/v2/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .animal_recognize.component import AnimalRecognition\nfrom .image_understand.component import  ImageUnderstand\nfrom .translate.component import Translation\nfrom .general_ocr.component import GeneralOCR\nfrom .llms.style_rewrite.component import StyleRewrite\nfrom .llms.hallucination_detection.component import HallucinationDetection\nfrom .qrcode_ocr.component import QRcodeOCR\nfrom .handwrite_ocr.component import HandwriteOCR\nfrom .mix_card_ocr.component import MixCardOCR\nfrom .table_ocr.component import TableOCR\nfrom .text_to_image.component import Text2Image\nfrom .llms.style_writing.component import StyleWriting\nfrom .tree_mind.component import TreeMind\nfrom .asr.component import ASR\nfrom .object_recognize.component import ObjectRecognition\nfrom .llms.similar_question.component import SimilarQuestion\nfrom .llms.oral_query_generation.component import OralQueryGeneration\nfrom .plant_recognize.component import PlantRecognition\nfrom .llms.query_rewrite.component import QueryRewrite\nfrom .llms.nl2pandas.component import Nl2pandasComponent\nfrom .llms.dialog_summary.component import DialogSummary\nfrom .llms.mrc.component import MRC\nfrom .llms.is_complex_query.component import IsComplexQuery\nfrom .llms.qa_pair_mining.component import QAPairMining\nfrom .llms.query_decomposition.component import QueryDecomposition\nfrom .llms.tag_extraction.component import TagExtraction\n\n__V2_COMPONENTS__ = [\n    \"AnimalRecognition\",\n    \"ImageUnderstand\",\n    \"Translation\",\n    \"GeneralOCR\",\n    \"StyleRewrite\",\n    \"HallucinationDetection\",\n    \"QRcodeOCR\",\n    \"HandwriteOCR\",\n    \"MixCardOCR\",\n    \"TableOCR\",\n    \"Text2Image\",\n    \"StyleWriting\",\n    \"TreeMind\",\n    \"ASR\",\n    \"ObjectRecognition\",\n    \"SimilarQuestion\",\n    \"OralQueryGeneration\",\n    \"PlantRecognition\",\n    \"QueryRewrite\",\n    \"Nl2pandasComponent\",\n    \"DialogSummary\",\n    \"MRC\",\n    \"IsComplexQuery\",\n    \"QAPairMining\",\n    \"QueryDecomposition\",\n    \"TagExtraction\"\n] # NOQA"
  },
  {
    "path": "python/core/components/v2/animal_recognize/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License."
  },
  {
    "path": "python/core/components/v2/animal_recognize/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"animal recognize component.\"\"\"\n\nimport base64\nimport json\n\nfrom typing import Optional\n\nfrom appbuilder.core.component import Component, ComponentOutput\nfrom appbuilder.core.components.animal_recognize.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom typing import Generator, Union\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nTOP_NUM = 1\nBAIKE_NUM = 0\n\n\nclass AnimalRecognition(Component):\n    r\"\"\"\n       用于识别一张图片，即对于输入的一张图片（可正常解码，且长宽比较合适），输出动物识别结果。\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           animal_recognition = appbuilder.AnimalRecognition()\n           with open(\"./animal_recognition_test.png\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n           print(out.content)\n\n        \"\"\"\n    name = \"animal_rec\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"animal_rec\",\n            \"description\": \"用于识别图片中动物类别，可识别近八千种动物\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名\"\n                    },\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        根据输入消息运行动物识别功能\n        \n        Args:\n            message (Message): 输入的消息对象，其中应包含需要识别的图像数据或URL\n            timeout (float, optional): 超时时间，单位为秒。默认为None，表示无超时限制。Defaults to None.\n            retry (int, optional): 重试次数。默认为0，表示不重试。Defaults to 0.\n        \n        Returns:\n            Message: 识别结果的消息对象\n        \n        \"\"\"\n        inp = AnimalRecognitionInMsg(**message.content)\n        req = AnimalRecognitionRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        req.top_num = 6\n        req.baike_num = 0\n        result, _ = self._recognize(req, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = AnimalRecognitionOutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(\n        self,\n        request: AnimalRecognitionRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> AnimalRecognitionResponse:\n        r\"\"\"调用底层接口进行动物识别\n\n                   参数:\n                       request (obj: `AnimalRecognitionRequest`) : 动物识别输入参数\n                   返回：\n                       response (obj: `AnimalRecognitionResponse`): 动物识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n\n        data = AnimalRecognitionRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/animal\")\n        response = self.http_client.session.post(url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        animalRes = AnimalRecognitionResponse.from_json(json.dumps(data))\n        animalRes.request_id = request_id\n        return animalRes, data\n\n    @components_run_stream_trace\n    def tool_eval(\n        self,\n        img_name: Optional[str] = \"\",\n        img_url: Optional[str] = \"\",\n        **kwargs,\n    ) -> Union[Generator[str, None, None], str]:\n        \"\"\"\n        对图像进行工具评估。\n        \n        Args:\n            img_name (str): 图像名称。\n            img_url (str): 图像URL地址。\n            **kwargs: 其他关键字参数。\n        \n        Returns:\n            Union[Generator[str, None, None], str]: 返回一个生成器，生成图像识别结果，或者返回图像识别结果的字符串。\n        \n        \"\"\"\n        if not img_name and not img_url:\n            raise ValueError(\"img_name or img_url is required\")\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        file_urls = kwargs.get(\"_sys_file_urls\", {})\n        yield from self._recognize_w_post_process(img_name, img_url, file_urls, request_id=traceid)\n\n    def _recognize_w_post_process(self, img_name, img_url, file_urls, request_id=None) -> str: # type: ignore\n        r\"\"\"调底层接口对图片或图片url进行动物识别，并返回类别及其置信度\n        Args:\n            img_name (str): 图片文件名\n            img_url (str): 图片url\n            file_urls (dict): 文件名与对应文件url的映射\n        Returns:\n            str: 动物识别结果，包括识别出的动物类别和相应的置信度信息\n        \"\"\"\n        req = AnimalRecognitionRequest()\n        if img_name in file_urls:\n            req.url = file_urls[img_name]\n        if img_url:\n            if img_url in file_urls:\n                img_url = file_urls[img_url]\n            req.url = img_url\n        req.top_num = TOP_NUM\n        req.baike_num = BAIKE_NUM\n        result, raw_data = self._recognize(req, request_id=request_id)\n        result_dict = proto.Message.to_dict(result)\n        rec_res = \"模型识别结果为：\\n\"\n        for rec_info in result_dict['result']:\n            rec_res += \"类别: {} 置信度: {}\\n\".format(rec_info['name'], rec_info['score'])\n        output = self.create_output(type=\"text\", text=rec_res, raw_data=raw_data)\n        yield output\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request_id (str) : 请求ID\n                data (dict) : 动物识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n"
  },
  {
    "path": "python/core/components/v2/asr/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/v2/asr/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"ASR component.\n\"\"\"\nimport os\nimport uuid\nimport json\n\nimport requests\nimport tempfile\nfrom urllib.parse import urlparse\nfrom typing import Optional\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.components.asr.model import ShortSpeechRecognitionRequest, ShortSpeechRecognitionResponse, \\\n    ASRInMsg, ASROutMsg\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nimport logging\n\nDEFAULT_AUDIO_MAX_DURATION = 55 * 1000  # 55s\n# 参考短语音极速版API(https://ai.baidu.com/ai-doc/SPEECH/Jlbxdezuf)\nDEFAULT_FRAME_RATE = 16000\nDEV_PID = \"80001\"\n\n\nclass ASR(Component):\n    r\"\"\"\n    ASR组件，即对于输入的语音文件，输出语音识别结果\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        asr = appbuilder.ASR()\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        with open(\"xxxx.pcm\", \"rb\") as f:\n            audio_data = f.read()\n        content_data = {\"audio_format\": \"pcm\", \"raw_audio\": audio_data, \"rate\": 16000}\n        msg = appbuilder.Message(content_data)\n        out = asr.run(msg)\n        print(out.content) # eg: {\"result\": [\"北京科技馆。\"]}\n     \"\"\"\n    name = \"asr\"\n    version = \"v1\"\n\n    manifests = [\n        {\n            \"name\": \"asr\",\n            \"description\": \"对于输入的语音文件进行识别，输出语音识别结果。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入语音文件的url,根据url获取到语音文件\"\n                    },\n                    \"file_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别语音文件名,用于生成获取语音的url\"\n                    },\n                    \"file_type\": {\n                        \"type\": \"string\",\n                        \"description\": \"语音文件类型,支持pcm/wav/amr/m4a\",\n                        \"enum\": [\"pcm\", \"wav\", \"amr\", \"m4a\"]\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"file_url\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"file_name\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, audio_format: str = \"pcm\", rate: int = 16000,\n            timeout: float = None, retry: int = 0, **kwargs) -> Message:\n        r\"\"\"\n        执行语音识别操作，并返回识别结果。\n        \n        Args:\n            message (Message): 输入消息对象，包含待识别的音频数据。该参数为必需项，格式如：Message(content={\"raw_audio\": b\"...\"})。\n            audio_format (str, optional): 音频文件格式，支持pcm/wav/amr/m4a，不区分大小写，推荐使用pcm格式。默认为\"pcm\"。\n            rate (int, optional): 音频采样率，固定为16000。默认为16000。\n            timeout (float, optional): HTTP请求超时时间。默认为None。\n            retry (int, optional): HTTP请求重试次数。默认为0。\n        \n        Returns:\n            Message: 语音识别结果，格式如：Message(content={\"result\": [\"识别结果\"]})。\n        \"\"\"\n        inp = ASRInMsg(**message.content)\n        request = ShortSpeechRecognitionRequest()\n        request.format = audio_format\n        request.rate = rate\n        request.cuid = str(uuid.uuid4())\n        request.dev_pid = DEV_PID\n        request.speech = inp.raw_audio\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        response, _ = self._recognize(request, timeout, retry, request_id=traceid)\n        out = ASROutMsg(result=list(response.result))\n        return Message(content=out.model_dump())\n\n    def _recognize(\n            self,\n            request: ShortSpeechRecognitionRequest,\n            timeout: float = None,\n            retry: int = 0,\n            request_id: str = None,\n    ) -> ShortSpeechRecognitionResponse:\n        \"\"\"\n        使用给定的输入并返回语音识别的结果。\n\n        参数:\n            request (obj:`ShortSpeechRecognitionRequest`): 输入请求，这是一个必需的参数。\n            timeout (float, 可选): 请求的超时时间。\n            retry (int, 可选): 请求的重试次数。\n\n        返回:\n            obj:`ShortSpeechRecognitionResponse`: 接口返回的输出消息。\n        \"\"\"\n        ContentType = \"audio/\" + request.format + \";rate=\" + str(request.rate)\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = ContentType\n        params = {\n            'dev_pid': request.dev_pid,\n            'cuid': request.cuid\n        }\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        response = self.http_client.session.post(self.http_client.service_url(\"/v1/bce/aip_speech/asrpro\"),\n                                                 params=params, headers=headers, data=request.speech, timeout=timeout)\n        logging.info('Sending POST request with params: %s, headers: %s, data: %s', params, headers, request.speech)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        response = ShortSpeechRecognitionResponse.from_json(payload=json.dumps(data))\n        response.request_id = request_id\n        return response, data\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n\n            参数:\n                request (dict) : 短语音识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"err_no\" in data and \"err_msg\" in data:\n            if data[\"err_no\"] != 0:\n                raise AppBuilderServerException(\n                    request_id=request_id,\n                    service_err_code=data[\"err_no\"],\n                    service_err_message=data[\"err_msg\"]\n                )\n\n    @components_run_stream_trace\n    def tool_eval(self,\n                  file_url: Optional[str] = '',\n                  file_name: Optional[str] = '',\n                  file_type: Optional[str] = '',\n                  **kwargs):    \n        \"\"\"\n        执行语音识别操作，并返回识别结果\n        \n        Args:\n            file_url (str, optional): 文件URL。默认为空字符串。\n            file_name (str, optional): 文件名。默认为空字符串。\n            file_type (str, optional): 文件类型。默认为空字符串。\n            **kwargs: 其他关键字参数。\n        \n        Returns:\n            Generator: 生成器，用于生成输出对象。\n        \n        Raises:\n            InvalidRequestArgumentError: 请求格式错误。\n        \n        \"\"\"\n        if not file_url:\n            file_urls = kwargs.get(\"_sys_file_urls\", {})\n            file_path = file_name\n            if not file_path:\n                raise InvalidRequestArgumentError(\"request format error, file name is not set\")\n            file_name = os.path.basename(file_path)\n            file_url = file_urls.get(file_name, None)\n            if not file_url:\n                raise InvalidRequestArgumentError(\n                    f\"request format error, file {file_url} url does not exist\"\n                )\n            \n        _, file_type = os.path.splitext(os.path.basename(urlparse(file_url).path))\n        file_type = file_type.strip('.')\n\n        audio_file = tempfile.NamedTemporaryFile(\"wb\", suffix=file_type)\n        audio_file.write(requests.get(file_url).content)\n\n        raw_audios = _convert(audio_file.name, file_type)\n        text = \"\"\n        for raw_audio in raw_audios:\n            request = ShortSpeechRecognitionRequest()\n            request.format = file_type\n            request.rate = DEFAULT_FRAME_RATE\n            request.cuid = str(uuid.uuid4())\n            request.dev_pid = DEV_PID\n            request.speech = raw_audio\n            traceid = kwargs.get(\"_sys_traceid\", \"\")\n            response, raw_data = self._recognize(request, request_id=traceid)\n            text += \"\".join(list(response.result))\n        results = {\"识别结果\": text}\n        audio_file.close()\n        res = json.dumps(results, ensure_ascii=False, indent=4)\n        yield self.create_output(type='text', text=res, raw_data=raw_data, visible_scope=\"llm\")\n        yield self.create_output(type='text', text=\"\", raw_data=raw_data, visible_scope=\"user\")\n\n\ndef _convert(path, file_type):\n    from pydub import AudioSegment\n    if file_type.lower() == \"mp3\":\n        audio = AudioSegment.from_mp3(path)\n    elif file_type.lower() == \"wav\":\n        audio = AudioSegment.from_wav(path)\n    # 如果是pcm格式，则直接读取并返回\n    elif file_type.lower() == \"pcm\":\n        with open(path, \"rb\") as f:\n            return [f.read()]\n    else:\n        # pydub自动检测音频类型\n        audio = AudioSegment.from_wav(path)\n    # 如果取样率为16000且时长小于60s，则直接读取音频并返回\n    if (audio.frame_rate == DEFAULT_FRAME_RATE and audio.frame_count() * 1000\n            / audio.frame_rate < DEFAULT_AUDIO_MAX_DURATION):\n        with open(path, \"rb\") as f:\n            return [f.read()]\n    audio = audio.set_frame_rate(DEFAULT_FRAME_RATE)\n    total_milliseconds = int(audio.frame_count() * 1000 / audio.frame_rate)\n    start = 0\n    raw_audios = []\n    while start < total_milliseconds:\n        end = start + DEFAULT_AUDIO_MAX_DURATION\n        if start + DEFAULT_AUDIO_MAX_DURATION > total_milliseconds:\n            end = total_milliseconds\n        audio_seg = audio[start:end]\n        audio_seg_file = tempfile.NamedTemporaryFile(\"wb\", suffix=\"wav\")\n        try:\n            audio_seg.export(audio_seg_file.name, format=\"wav\")\n            with open(audio_seg_file.name, \"rb\") as f:\n                raw_audios.append(f.read())\n        finally:\n            audio_seg_file.close()\n        start = end\n    return raw_audios\n\n\n\n"
  },
  {
    "path": "python/core/components/v2/general_ocr/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/v2/general_ocr/component.py",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"general ocr component.\"\"\"\nimport base64\nimport json\nimport logging\nimport requests\nimport os.path\n\nfrom typing import Optional\n\n\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.general_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.constants import COMPONENT_SUPPORT_FILE_NUMBER\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass GeneralOCR(Component):\n    r\"\"\"\n    提供通用文字识别能力，在通用文字识别的基础上，提供更高精度的识别服务，支持更多语种识别（丹麦语、荷兰语、马来语、\n    瑞典语、印尼语、波兰语、罗马尼亚语、土耳其语、希腊语、匈牙利语、泰语、越语、阿拉伯语、印地语及部分中国少数民族语言），\n    并将字库从1w+扩展到2w+，能识别所有常用字和大部分生僻字。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        general_ocr = appbuilder.GeneralOCR()\n        with open(\"./general_ocr_test.png\", \"rb\") as f:\n            out = general_ocr.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n        print(out.content)\n\n     \"\"\"\n    name = \"general_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"general_ocr\",\n            \"description\": \"提供更高精度的通用文字识别能力，能够识别图片中的文字，不支持html后缀文件的输入\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_urls\": {\n                        \"type\": \"array\",\n                        \"description\": \"待识别图片的url,根据该url能够获取图片\"\n                    },\n                    \"img_names\": {\n                        \"type\": \"array\",\n                        \"description\": \"待识别图片的文件名,用于生成图片url\"\n                    },\n                    \"language_type\": {\n                        \"type\": \"string\",\n                        \"description\": \"识别语言类型，'CHN_ENG'为中英文混合，'ENG'为英文， 'JAP'为日语，'KOR'为韩语，'FRE'为法语，'SPA'为西班牙语，'POR'为葡萄牙语，\"\n                        \"'GER'为德语，'ITA'为意大利语，'RUS'为俄语，'DAN'为丹麦语，'DUT'为荷兰语，'MAL'为马来语，'SWE'为瑞典语，'IND'为印尼语，'POL'为波兰语，'ROM'为罗马尼亚语，\"\n                        \"'TUR'为土耳其语，'GRE'为希腊语，'HUN'为匈牙利语，'THA'为泰语，'VIE'为越南语，'ARA'为阿拉伯语，'HIN'为印地语，默认为'CHN_ENG'\",\n                        \"enum\": ['CHN_ENG', 'ENG', 'JAP', 'KOR', 'FRE', 'SPA', 'POR', 'GER', 'ITA',\n                                 'RUS', 'DAN', 'DUT', 'MAL', 'SWE', 'IND', 'POL', 'ROM', 'TUR', \n                                 'GRE', 'HUN', 'THA', 'VIE', 'ARA', 'HIN'],\n                    },\n                    \"pdf_urls\": {\n                        \"type\": \"array\",\n                        \"description\": \"待识别pdf的url,根据该url能够获取pdf文件\"\n                    },\n                    \"pdf_names\": {\n                        \"type\": \"array\",\n                        \"description\": \"待识别pdf的文件名,用于生成pdf url\"\n                    },\n                    \"pdf_file_num\": {\n                        \"type\": \"object\",\n                        \"description\": \"需要识别的PDF文件的对应页码，key为pdf_names中的文件名，value为对应的页码，当 pdf_file 参数有效时，识别传入页码的对应页面内容，若不传入，则默认识别第 1 页\",\n                        \"additionalProperties\": {\n                            \"type\": \"string\"\n                        },\n                        \"default\": {}\n                    },\n                    \"detect_direction\": {\n                        \"type\": \"string\",\n                        \"description\": \"是否检测图像朝向,朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括: true-检测朝向; false-不检测朝向\"\n                        \"默认不检测\",\n                        \"default\": \"false\"\n                    },\n                    \"multidirectional_recognize\": {\n                        \"type\": \"string\",\n                        \"description\": \"是否开启行级别的多方向文字识别，可选值包括: true-识别, false-不识别; 若图内有不同方向的文字时，建议将此参数设置为“true”\"\n                        \"默认开启\",\n                        \"default\": \"true\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_urls\",\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_names\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"pdf_urls\",\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"pdf_names\",\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0, language_type: str = 'CHN_ENG') -> Message:\n        \"\"\"\n        在通用文字识别的基础上，提供更高精度的识别服务，支持更多语种识别\n        \n        Args:\n            message (Message): 包含识别任务的输入信息的消息对象。\n            timeout (float, optional): 超时时间，单位秒。默认为None，表示不设置超时。\n            retry (int, optional): 重试次数。默认为0，表示不重试。\n            language_type (str, optional): 识别语言类型，可选值为'CHN_ENG'（中英文）和'CHN'（中文）。默认为'CHN_ENG'。\n        \n        Returns:\n            Message: 包含识别结果的消息对象。\n        \n        \"\"\"\n        inp = GeneralOCRInMsg(**message.content)\n        request = GeneralOCRRequest()\n        if inp.image_base64:\n            request.image = (inp.image_base64)\n        elif inp.image_url:\n            request.url = inp.image_url\n        elif inp.pdf_base64:\n            request.pdf_file = inp.pdf_base64\n        elif inp.pdf_url:\n            raw_pdf = requests.get(inp.pdf_url).content\n            pdf_base64 = base64.b64encode(raw_pdf)\n            request.pdf_file = pdf_base64\n        request.pdf_file_num = inp.pdf_file_num\n        request.detect_direction = inp.detect_direction\n        request.multidirectional_recognize = inp.multidirectional_recognize\n        request.language_type = language_type\n        result, _ = self._recognize(request, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = GeneralOCROutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(\n        self,\n        request: GeneralOCRRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> GeneralOCRResponse:\n        r\"\"\"调用底层接口进行通用文字识别\n                   参数:\n                       request (obj: `GeneralOCRRequest`) : 通用文字识别输入参数\n\n                   返回：\n                       response (obj: `GeneralOCRResponse`): 通用文字识别返回结果\n               \"\"\"\n        if not request.image and not request.url and not request.pdf_file and not request.ofd_file:\n            raise ValueError(\n                \"request format error, one of image or url or must pdf_file or ofd_file be set\")\n        data = GeneralOCRRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/accurate_basic\")\n        response = self.http_client.session.post(\n            url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        ocr_response = GeneralOCRResponse.from_json(payload=json.dumps(data))\n        ocr_response.request_id = request_id\n        return ocr_response, data\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 通用文字识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    @components_run_stream_trace\n    def tool_eval(\n        self, \n        img_names: Optional[list] = [],\n        img_urls: Optional[list] = [],\n        pdf_names: Optional[list] = [],\n        pdf_urls: Optional[list] = [],\n        pdf_file_num: Optional[dict] = {},\n        language_type: Optional[str] = 'CHN_ENG',\n        detect_direction: Optional[str] = \"false\",\n        multidirectional_recognize: Optional[str] = \"true\",\n        **kwargs\n        ):\n        \"\"\"\n        对图片或PDF文件中的文字进行识别并返回结果。\n        \n        Args:\n            img_names (list): 图片文件名列表，用于指定要识别的图片文件。\n            img_urls (list): 图片URL地址列表，用于指定要识别的图片URL。\n            pdf_names (list): PDF文件名列表，用于指定要识别的PDF文件。\n            pdf_urls (list): PDF URL地址列表，用于指定要识别的PDF URL。\n            pdf_file_num (dict): PDF文件页码字典，key为pdf_names中的文件名，value为对应的页码。\n                                例如：{\"document1.pdf\": 1, \"document2.pdf\": 3} 表示识别document1.pdf的第1页，\n                                document2.pdf的第3页。如果未指定页码，默认为第1页。\n            language_type (str): 识别语言类型，可选值为'CHN_ENG'（中英文混合）、'ENG'（英文）、\n                                'JAP'（日语）、'KOR'（韩语）等，默认为'CHN_ENG'。\n            detect_direction (str): 是否检测图像朝向，可选值为'true'（检测）或'false'（不检测），\n                                  朝向是指输入图像是正常方向、逆时针旋转90/180/270度，默认为'false'。\n            multidirectional_recognize (str): 是否开启行级别的多方向文字识别，可选值为'true'（识别）\n                                            或'false'（不识别），若图内有不同方向的文字时，建议将此参数\n                                            设置为'true'，默认为'true'。\n            \n            **kwargs: 其他参数，目前支持以下参数：\n                _sys_traceid (str): 系统追踪ID，用于跟踪请求。\n                _sys_file_urls (dict): 文件URL字典，key为文件名，value为文件URL。\n                \n        Returns:\n            Generator: 生成器，每次生成一个包含识别结果的Output对象。\n                      对于图片文件，返回格式为：{\"图片文件名识别结果\": \"识别的文字内容\"}\n                      对于PDF文件，返回格式为：{\"PDF文件名识别结果\": \"识别的文字内容\"}\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误或文件URL不存在，将抛出此异常。\n        \n        Examples:\n            # 识别单个图片\n            img_names = [\"test.jpg\"]\n            img_urls = [\"http://example.com/test.jpg\"]\n            \n            # 识别多个PDF文件的不同页码\n            pdf_names = [\"doc1.pdf\", \"doc2.pdf\"]\n            pdf_urls = [\"http://example.com/doc1.pdf\", \"http://example.com/doc2.pdf\"]\n            pdf_file_num = {\"doc1.pdf\": 1, \"doc2.pdf\": 3}\n            \n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        if not img_names and not img_urls and not pdf_names and not pdf_urls:\n            raise InvalidRequestArgumentError(request_id=traceid,\n                                                message=\"img_names\\img_urls\\pdf_names\\pdf_urls can not both be empty\")\n        sys_file_urls = kwargs.get(\"_sys_file_urls\", {})\n        support_pdf_type = [\"pdf\"]\n        support_img_type = [\"png\", \"jpg\", \"jpeg\", \"webp\", \"heic\", \"tif\", \"tiff\", \"dcm\", \"mha\", \"nii.gz\"]\n        img_map = {}\n        pdf_map = {}\n        unsupported_files = []\n        unknown_files = []\n        img_names = [os.path.basename(name) for name in img_names]\n        pdf_names = [os.path.basename(name) for name in pdf_names]\n\n        for img_name in img_names:\n            if len(img_map) >= COMPONENT_SUPPORT_FILE_NUMBER:\n                break\n            file_type = img_name.split(\".\")[-1].lower()\n            if img_name in sys_file_urls:\n                if file_type in support_img_type:\n                    img_map[img_name] = sys_file_urls.get(img_name, \"\")\n                else:\n                    unsupported_files.append(img_name)\n            else:\n                unknown_files.append(img_name)\n\n        for pdf_name in pdf_names:\n            if len(img_map) + len(pdf_map) >= 10:\n                break\n            file_type = pdf_name.split(\".\")[-1].lower()\n            if pdf_name in sys_file_urls:\n                if file_type in support_pdf_type:\n                    pdf_map[pdf_name] = {\"url\": sys_file_urls.get(pdf_name, \"\"), \"page_num\": pdf_file_num.get(pdf_name, \"1\")}\n                else:\n                    unsupported_files.append(pdf_name)\n            else:\n                unknown_files.append(pdf_name)\n\n        for img_url in img_urls:\n            if len(img_map) + len(pdf_map) >= 10:\n                break\n            if img_url in list(sys_file_urls.values()):\n                continue\n            file_name = img_url.split(\"/\")[-1].split(\"?\")[0]\n            file_type = file_name.split(\".\")[-1].lower()\n            if file_type in support_img_type:\n                img_map[img_url] = img_url \n            else:\n                unsupported_files.append(img_url)\n\n        for pdf_url in pdf_urls:\n            if len(img_map) + len(pdf_map) >= 10:\n                break\n            if pdf_url in list(sys_file_urls.values()):\n                continue\n            file_name = pdf_url.split(\"/\")[-1].split(\"?\")[0]\n            file_type = file_name.split(\".\")[-1].lower()\n            if file_type in support_pdf_type:\n                pdf_map[pdf_url] = {\"url\": pdf_url, \"page_num\": pdf_file_num.get(file_name, \"1\")}\n            else:\n                unsupported_files.append(pdf_url)\n\n        if not img_map and not pdf_map:\n            raise InvalidRequestArgumentError(\n                f\"request format error, file url does not exist\")\n\n        if img_map:\n            for img_name, img_url in img_map.items():\n                try:\n                    req = GeneralOCRRequest(url=img_url)\n                    req.detect_direction = detect_direction\n                    req.language_type = language_type\n                    req.multidirectional_recognize = multidirectional_recognize\n                    result_response, raw_data = self._recognize(req, request_id=traceid)\n                    result = proto.Message.to_dict(result_response)\n                    results = {\n                        f\"{img_name}\": \" \\n\".join(item[\"words\"] for item in result[\"words_result\"])\n                    }\n                    res = json.dumps(results, ensure_ascii=False)\n                    yield self.create_output(type=\"text\", text=res, raw_data=raw_data, visible_scope=\"llm\")\n                    yield self.create_output(type=\"text\", text=\"\", raw_data=raw_data, visible_scope=\"user\")\n                except Exception as e:\n                    logging.warning(f\"{img_name} ocr failed with exception: {e}\")\n                    continue\n\n        if pdf_map:\n            for pdf_name, pdf_info in pdf_map.items():\n                try:\n                    pdf_url = pdf_info.get(\"url\", None)\n                    pdf_file_num = pdf_info.get(\"page_num\", \"1\")\n                    raw_pdf = requests.get(pdf_url).content\n                    pdf_base64 = base64.b64encode(raw_pdf)\n                    req = GeneralOCRRequest(pdf_file=pdf_base64, pdf_file_num=pdf_file_num)\n                    req.detect_direction = detect_direction\n                    req.language_type = language_type\n                    req.multidirectional_recognize = multidirectional_recognize\n                    result_response, raw_data = self._recognize(req, request_id=traceid)\n                    result = proto.Message.to_dict(result_response)\n                    results = {\n                        f\"{pdf_name}\": \" \\n\".join(item[\"words\"] for item in result[\"words_result\"])\n                    }\n                    res = json.dumps(results, ensure_ascii=False)\n                    yield self.create_output(type=\"text\", text=res, raw_data=raw_data, visible_scope=\"llm\")\n                    yield self.create_output(type=\"text\", text=\"\", raw_data=raw_data, visible_scope=\"user\")\n                except Exception as e:\n                    logging.warning(f\"{pdf_name} ocr failed with exception: {e}\")\n                    continue\n        \n        for file_name in unknown_files:\n            results = {\n                f\"{file_name}\": \"无法获取url，请确认是否上传成功\"\n            }\n            res = json.dumps(results, ensure_ascii=False)\n            llm_result = self.create_output(\n                type = \"text\",\n                visible_scope= \"llm\",\n                text=res,\n                name=\"llm_text\"\n            )\n            yield llm_result\n            user_result = self.create_output(\n                type = \"text\",\n                visible_scope= \"user\",\n                text=\"\",\n                name=\"user_text\"\n            )\n            yield user_result\n        \n        for file_name in unsupported_files:\n            results = {\n                f\"{file_name}\": \"不支持的文件类型，请确认是否为图片或者pdf文件\"\n            }\n            res = json.dumps(results, ensure_ascii=False)\n            llm_result = self.create_output(\n                type = \"text\",\n                visible_scope= \"llm\",\n                text=res,\n                name=\"llm_text\"\n            )\n            yield llm_result\n            user_result = self.create_output(\n                type = \"text\",\n                visible_scope= \"user\",\n                text=\"\",\n                name=\"user_text\"\n            )\n            yield user_result\n"
  },
  {
    "path": "python/core/components/v2/handwrite_ocr/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/v2/handwrite_ocr/component.py",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"手写文字识别组件\"\"\"\nimport base64\nimport json\nimport logging\nfrom typing import Optional\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.v2.handwrite_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core import utils\nfrom appbuilder.core.constants import COMPONENT_SUPPORT_FILE_NUMBER\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nclass HandwriteOCR(Component):\n    r\"\"\" 手写文字识别组件\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n        os.environ[\"GATEWAY_URL\"] = \"...\"\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n        # 从BOS存储读取样例文件\n        image_url=\"https://bj.bcebos.com/v1/appbuilder/test_handwrite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b\"\n        # 输入参数为一张图片\n        inp = appbuilder.Message(content={\"url\": image_url})\n        # 进行植物识别\n        handwrite_ocr = HandwriteOCR()\n        out = handwrite_ocr.run(inp)\n        # 打印识别结果\n        print(out.content)\n        \n     \"\"\"\n\n    name = \"handwriting_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"handwriting_ocr\",\n            \"description\": \"需要对图片中手写体文字进行识别时，使用该工具，不支持PDF文件，如果用户没有提供图片文件，应引导用户提供图片，而不是尝试使用该工具\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别文件的文件名\"\n                    },\n                    \"file_urls\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别文件的url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"file_names\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"file_urls\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        r\"\"\"\n        输入图片并识别其中的文字\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作.例如: Message(content={\"raw_image\": b\"...\"}) 或 Message(content={\"url\": \"https://image/download/url\"}).\n            timeout (float, optional): HTTP超时时间. 默认为None.\n            retry (int, optional): HTTP重试次数. 默认为0.\n        \n        Returns:\n            Message: 手写体模型识别结果.\n        \"\"\"\n        inp = HandwriteOCRInMsg(**message.content)\n        request = HandwriteOCRRequest()\n        if inp.url:\n            request.url = inp.url\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        request.recognize_granularity = \"big\"\n        request.probability = \"false\"\n        request.detect_direction = \"true\"\n        request.detect_alteration = \"true\"\n        response = self._recognize(request, timeout, retry)\n        out = HandwriteOCROutMsg()\n        out.direction = response.direction\n        [out.contents.append(\n            Content(text=w.words,\n                    position=Position(\n                        left=w.location.left,\n                        top=w.location.top,\n                        width=w.location.width,\n                        height=w.location.height\n                    )))\n            for w in response.words_result]\n        return Message(content=out.model_dump())\n\n    @components_run_stream_trace\n    def tool_eval(self,\n                  file_names: Optional[list] = [],\n                  file_urls: Optional[list] = [],\n                  **kwargs):\n        \"\"\"\n        工具评估函数\n        Args:\n            file_names (Optional[list]): 待识别文件的文件名列表\n            **kwargs: 其他参数\n        \n        Raises:\n            InvalidRequestArgumentError: 请求格式错误，文件url不存在\n        \n        Yields:\n            Generator[Output]: 生成器，每次迭代产生一个输出对象\n        \"\"\"\n        if not file_names and not file_urls:\n            raise InvalidRequestArgumentError(request_id=traceid,\n                                                message=\"file_names and file_urls cannot both be empty\")\n        supported_file_type = [\"png\", \"jpg\", \"jpeg\", \"webp\", \"heic\", \"tif\", \"tiff\", \"dcm\", \"mha\", \"nii.gz\"]\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n\n        sys_file_urls = kwargs.get('_sys_file_urls', {})\n        available_img_urls = {}\n        unsupported_files  = []\n        unknown_file_name = []\n\n        if file_names:\n            for file_name in file_names:\n                if len(available_img_urls) >= COMPONENT_SUPPORT_FILE_NUMBER:\n                    break\n                file_type = file_name.split(\".\")[-1].lower()\n                if file_name in sys_file_urls:\n                    if file_type in supported_file_type:\n                        available_img_urls[file_name] = sys_file_urls.get(file_name, \"\")\n                    else: #不支持的文件类型\n                        unsupported_files.append(file_name)\n                else: #url未知\n                    unknown_file_name.append(file_name)\n\n        for img_url in file_urls:\n            if len(available_img_urls) >= COMPONENT_SUPPORT_FILE_NUMBER:\n                break\n            if img_url in list(sys_file_urls.values()):  #只考虑用户手动传的file_url\n                continue\n            file_name = img_url.split(\"/\")[-1].split(\"?\")[0]\n            file_type = file_name.split(\".\")[-1].lower()\n            if file_type in supported_file_type:\n                available_img_urls[img_url] = img_url\n            else:   #不支持的文件类型\n                unsupported_files.append(img_url)\n\n        for file_name, file_url in available_img_urls.items():\n            try:\n                req = HandwriteOCRRequest()\n                req.url = file_url\n                req.recognize_granularity = \"big\"\n                req.probability = \"false\"\n                req.detect_direction = \"true\"\n                req.detect_alteration = \"true\"\n                response = self._recognize(req, request_id=traceid)\n                text = \"\".join([w.words for w in response.words_result])\n                results = {\n                    file_name: text\n                }\n                res = json.dumps(results, ensure_ascii=False)\n                llm_result = self.create_output(\n                    type = \"text\",\n                    visible_scope= \"llm\",\n                    text=res,\n                    name=\"llm_text\"\n                )\n                yield llm_result\n\n                user_result = self.create_output(\n                    type = \"text\",\n                    visible_scope= \"user\",\n                    text=\"\",\n                    name=\"user_text\"\n                )\n                yield user_result\n            except Exception as e:\n                logging.warning(f\"{file_name} ocr failed with exception: {e}\")\n                continue\n        \n        for file_name in unknown_file_name:\n            results = {\n                file_name: \"无法获取url，请确认是否上传成功\"\n            }\n            res = json.dumps(results, ensure_ascii=False)\n            llm_result = self.create_output(\n                type = \"text\",\n                visible_scope= \"llm\",\n                text=res,\n                name=\"llm_text\"\n            )\n            yield llm_result\n            user_result = self.create_output(\n                type = \"text\",\n                visible_scope= \"user\",\n                text=\"\",\n                name=\"user_text\"\n            )\n            yield user_result\n        \n        for file_name in unsupported_files:\n            results = {\n                file_name: \"不支持的文件类型，请确认是否为图片\"\n            }\n            res = json.dumps(results, ensure_ascii=False)\n            llm_result = self.create_output(\n                type = \"text\",\n                visible_scope= \"llm\",\n                text=res,\n                name=\"llm_text\"\n            )\n            yield llm_result\n            user_result = self.create_output(\n                type = \"text\",\n                visible_scope= \"user\",\n                text=\"\",\n                name=\"user_text\"\n            )\n            yield user_result\n\n    def _recognize(\n        self, \n        request: HandwriteOCRRequest, \n        timeout: float = None, \n        retry: int = 0,\n        request_id: str = None,\n    ) -> HandwriteOCRResponse:\n        r\"\"\"调用底层接口进行通用文字识别\n                    参数:\n                       request (obj: `HandwriteOCRRequest`) : 通用文字识别输入参数\n\n                   返回：\n                       response (obj: `HandwriteOCRResponse`): 通用文字识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        data = request.model_dump()\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/handwriting\")\n        response = self.http_client.session.post(url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        ocr_response = HandwriteOCRResponse(**data)\n        ocr_response.request_id = request_id\n        return ocr_response\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 通用文字识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n"
  },
  {
    "path": "python/core/components/v2/handwrite_ocr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"手写文字识别数据类\"\"\"\nimport proto\nfrom typing import List, Optional\nfrom pydantic import BaseModel, Field\n\nclass HandwriteOCRRequest(BaseModel):\n    \"\"\" 手写文字识别组件请求参数\n    属性:\n        image (str):\n            可选。图像内容的base64编码。\n        url (str):\n            可选。图像的URL地址，经过base64编码。\n            图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n        pdf_file (str):\n            可选。PDF文件内容的base64编码。\n        pdf_file_num (str):\n            可选。PDF文件的页数。\n        ofd_file (str):\n            可选。OFD（Open Format Document）文件内容的base64编码。\n        ofd_file_num (str):\n            可选。OFD文件的页数。\n        recognize_granularity(str):\n            可选，识别粒度：\n            可能的取值包括：\n            - \"big\": 不定位单字符位置\n            - \"small\": 定位单字符位置。\n        probability (str):\n            可选。是否输出置信度。默认为\"false\"。\n            可能的取值包括：\n            - \"true\": 返回识别结果中每行的置信度。\n            - \"false\": 不返回置信度。\n        detect_direction (str):\n            可选。是否检测文本方向。默认为\"false\"。\n            可能的取值包括：\n            - \"true\": 检测文本方向。\n            - \"false\": 不检测文本方向。\n        detect_alteration（str）：\n             可选，是否检测涂改痕迹，适用于手写作文场景，默认不检测\n             可选值包括：\n             - \"true\"：检测，涂改痕迹部分用“☰”返回；\n             - \"false\"：不检测\n    \"\"\"\n    image: str = Field(None, description=\"图像内容的base64编码\")\n    url: str = Field(None, description=\"图像的URL地址，经过base64编码\")\n    pdf_file: str = Field(None, description=\"PDF文件内容的base64编码\")\n    pdf_file_num: str = Field(None, description=\"PDF文件的页数\")\n    ofd_file: str = Field(None, description=\"OFD（Open Format Document）文件内容的base64编码\")\n    ofd_file_num: str = Field(None, description=\"OFD文件的页数\")\n    recognize_granularity: str = Field(\"small\", description=\"识别粒度\")\n    probability: str = Field(\"false\", description=\"是否输出置信度\")\n    detect_direction: str = Field(\"false\", description=\"是否检测文本方向\")\n    detect_alteration: str = Field(\"false\", description=\"是否检测涂改痕迹\")\n\nclass HandwriteLocation(BaseModel):\n    \"\"\" 手写体位置信息.\n\n        属性:\n            left (int): 表示定位位置的长方形左上顶点的水平坐标\n            top (int): 表示定位位置的长方形左上顶点的垂直坐标\n            width (int): 表示定位位置的长方形的宽度\n            height (int): 表示定位位置的长方形的高度\n         \"\"\"\n    left: Optional[int] = Field(None, description=\"表示定位位置的长方形左上顶点的水平坐标\")\n    top: Optional[int] = Field(None, description=\"表示定位位置的长方形左上顶点的垂直坐   标\")\n    width: Optional[int] = Field(None, description=\"表示定位位置的长方形的宽度\")\n    height: Optional[int] = Field(None, description=\"表示定位位置的长方形的高度\")\n\n\nclass HandwriteWordResult(BaseModel):\n    \"\"\" 手写文字识别结果\n\n        属性:\n            words (str): 识别出的文本\n            location (Location): 文本位置信息\n     \"\"\"\n    words: str = Field(None, description=\"识别出的文本\")\n    location: Optional[HandwriteLocation] = Field(None, description=\"文本位置信息\")\n\n\nclass HandwriteProbability(BaseModel):\n    \"\"\"手写体置信度\n\n       属性:\n            average (float): 每行的平均置信度\n            variance (float): 每行置信度的方差\n            min (float)：每行的最小置信度\n    \"\"\"\n    average: Optional[float] = Field(None, description=\"每行的平均置信度\")\n    variance: Optional[float] = Field(None, description=\"每行置信度的方差\")\n    min: Optional[float] = Field(None, description=\"每行的最小置信度\")\n\n\nclass HandwriteOCRResponse(BaseModel):\n    \"\"\"手写文字识别结果\n\n        属性:\n            request_id(str): 请求ID\n            log_id (int): 用于问题跟踪的唯一日志ID\n            words_result_num (int): 必填。识别结果的数量\n            words_result (List[WordResult]): 识别结果的数组\n            probability（Probability）：当probability=true 时返回该字段，表示识别结果中每一行的置信度值\n            direction (int): 当\n            detect_direction=true返回改字段，1（未定义）、\n            0（正向）、1（逆时针90度）、2（逆时针180度）、3（逆时针270度）\n            pdf_file_size (str): 输入PDF文件的总页数。当pdf_file参数有效时返回\n    \"\"\"\n    request_id: str = Field(None, description=\"请求ID\")\n    log_id: int = Field(None, description=\"用于问题跟踪的唯一日志ID\")\n    words_result_num: int = Field(None, description=\"必填。识别结果的数量\")\n    words_result: List[HandwriteWordResult] = Field(None, description=\"识别结果的数组\")\n    probability: Optional[HandwriteProbability] = Field(None, description=\"当probability=true 时返回该字段，表示识别结果中每一行的置信度值\")\n    direction: int = Field(None, description=\"当detect_direction=true返回改字段，1(未定义）、0（正向）、1（逆时针90度）、2（逆时针180度）、3（逆时针270度）\")\n    pdf_file_size: str = Field(None, description=\"输入PDF文件的总页数。当pdf_file参数有效时返回\")\n\n\nclass HandwriteOCRInMsg(BaseModel):\n    \"\"\" 手写体文字识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''  # 原始图片byte数组\n    url: str = \"\"  # 图片可下载链接\n\n\nclass Position(BaseModel):\n    \"\"\"位置信息\n\n       属性：\n            left (int): 表示定位位置的长方形左上顶点的水平坐标\n            top (int): 表示定位位置的长方形左上顶点的垂直坐标\n            width (int): 表示定位位置的长方形的宽度\n            height (int): 表示定位位置的长方形的高度\n    \"\"\"\n\n    left: int\n    top: int\n    width: int\n    height: int\n\n\nclass Content(BaseModel):\n    \"\"\" 识别文字\n\n        属性：\n            content(str):文字内容\n            position(Position): 文字内容的位置信息\n    \"\"\"\n    text: str\n    position: Optional[Position] = None\n\n\nclass HandwriteOCROutMsg(BaseModel):\n    \"\"\" 识别文字结果列表\n\n        属性：\n            contents(list[Content]): 手写体文字识别结果列表\n            direction(int): 图像旋转角度，0（正向），- 1（逆时针90度），- 2（逆时针180度），- 3（逆时针270度）\n    \"\"\"\n    contents: List[Content] = list()\n    direction: int = 0\n"
  },
  {
    "path": "python/core/components/v2/image_understand/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/v2/image_understand/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"图像内容理解\"\"\"\nimport base64\nimport time\nimport json\nimport logging\nfrom typing import Optional\n\nfrom appbuilder.core.component import Component, ComponentOutput\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, NoFileUploadedExecption, InvalidRequestArgumentError\nfrom appbuilder.core.components.image_understand.model import *\nfrom appbuilder.core.constants import COMPONENT_SUPPORT_FILE_NUMBER\nfrom typing import Generator, Union\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass ImageUnderstand(Component):\n    r\"\"\"\n    图像内容理解组件，即对于输入的一张图片（可正常解码，且长宽比适宜）与问题，输出对图片的描述\n\n    Examples:\n\n    .. code-block:: python\n    \n       import os\n       import appbuilder\n       os.environ[\"GATEWAY_URL\"] = \"...\"\n       os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n       # 从BOS存储读取样例文件\n       image_url = \"https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6\"\n       # 输入参数为一张图片\n       inp = Message(content={\"url\": image_url, \"question\": \"图片里内容是什么?\"})\n       # 进行图像内容理解\n       image_understand = ImageUnderstand()\n       out = image_understand.run(inp)\n       # 打印识别结果\n       print(out.content)\n     \"\"\"\n    name = \"image_understanding\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"image_understanding\",\n            \"description\": \"可对输入图片进行理解，可输出图片描述、OCR 及图像识别结果\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_names\": {\n                        \"type\": \"array\",\n                        \"description\": \"待识别图片的文件名\"\n                    },\n                    \"img_urls\": {\n                        \"type\": \"array\",\n                        \"description\": \"待识别图片的url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_names\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_urls\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        执行图像内容理解\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作. 举例: Message(content={\"raw_image\": b\"...\", \"question\": \"图片主要内容是什么？\"})\n                              或 Message(content={\"url\": \"https://image/download/url\", \"question\": \"图片主要内容是什么？\"}).\n            timeout (float, optional): HTTP超时时间. 默认为 None.\n            retry (int, optional): HTTP重试次数. 默认为 0.\n        \n        Returns:\n            Message: 模型识别结果.\n        \n        \"\"\"\n        inp = ImageUnderstandInMsg(**message.content)\n        request = ImageUnderstandRequest()\n        # 兼容新参数，确保输出结果一致\n        request.subject_detect = False\n        request.llm_switch = False\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            request.url = inp.url\n        if inp.question == \"\":\n            raise ValueError(\"request format error, question is empty\")\n        if len(inp.question) > 100:\n            raise ValueError(f\"request format error, expected len(question)>100, got {len(inp.question)}\")\n        if inp.language != \"zh-CN\" and inp.language != \"en\":\n            raise ValueError(f\"request format error, expected language in ['zh-CN', 'en'], got {inp.language}\")\n        request.question = inp.question\n        request.output_CHN = True\n        if inp.language == \"en\":\n            request.output_CHN = False\n        response, _ = self.__recognize(request, timeout, retry)\n        out = ImageUnderstandOutMsg(description=response.result.description_to_llm)\n        return Message(content=out.model_dump())\n\n    def __recognize(\n        self, \n        request: ImageUnderstandRequest, \n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> ImageUnderstandResponse:\n        r\"\"\"调用底层接口进行图像内容理解\n\n            参数:\n                request (obj: `ImageUnderstandRequest`) : 图像内容理解输入\n\n            返回：\n                response (obj: `ImageUnderstandResponse`): 图像内容理解输出\n        \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        data = ImageUnderstandRequest.to_dict(request)\n        headers = self.http_client.auth_header(request_id)\n        headers['Content-Type'] = 'application/json'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/image-understanding/request\")\n        try:\n            response = self.http_client.session.post(url, json=data, timeout=timeout, headers=headers)\n            response.raise_for_status()\n            data = response.json()\n            self.http_client.check_response_json(data)\n            request_id = self.http_client.response_request_id(response)\n            self.__class__.__check_create_task_service_error(request_id, data)\n        except Exception as e:\n            self.http_client.classify_exception(e)\n        task = ImageUnderstandTask(data, request_id=request_id)\n        task_id = task.result.get(\"task_id\", \"\")\n        if task_id == \"\":\n            raise AppBuilderServerException(request_id=request_id, service_err_message=\"empty task_id\")\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/image-understanding/get-result\")\n        while True:\n            try:\n                response = self.http_client.session.post(url, json={\"task_id\": task_id}, timeout=timeout, headers=headers)\n                response.raise_for_status()\n                data = response.json()\n                self.http_client.check_response_json(data)\n                request_id = self.http_client.response_request_id(response)\n                self.__class__.__check_service_error(request_id, data.get(\"result\", {}))\n            except Exception as e:\n                self.http_client.classify_exception(e)\n            # 处理成功\n            response = ImageUnderstandResponse(data)\n            if response.result.ret_code == 0:\n                return ImageUnderstandResponse(data), data\n            # 还在处理中\n            if response.result.ret_code == 1:\n                # 避免触发限流（>1QPS），等待1.1秒\n                time.sleep(1.1)\n\n    @components_run_stream_trace\n    def tool_eval(\n        self,\n        img_names: Optional[list] = [],\n        img_urls: Optional[list] = [],\n        **kwargs,\n    ) -> Union[Generator[str, None, None], str]:\n        \"\"\"\n        用于工具的执行，调用底层接口进行图像内容理解\n        \n        Args:\n            img_names (list): 图片文件名\n            img_urls (list): 图片url\n            **kwargs: 工具调用的额外关键字参数\n        \n        Returns:\n            Union[Generator[str, None, None], str]: 图片内容理解结果\n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\", '')\n        if not img_names and not img_urls:\n            raise InvalidRequestArgumentError(message=\"img_names and img_urls cannot both be empty\",\n                                              request_id=traceid)\n        supported_file_type = [\"png\", \"jpg\", \"jpeg\", \"webp\", \"heic\", \"tif\", \"tiff\", \"dcm\", \"mha\", \"nii.gz\"]\n        sys_file_urls = kwargs.get(\"_sys_file_urls\", {})\n        if not img_urls and not sys_file_urls:\n            raise NoFileUploadedExecption(\"No file uploaded!\")\n    \n        available_img_urls = {}\n        unsupported_files = []\n        unknown_files = []\n        if img_names:\n            for img_name in img_names:\n                if len(available_img_urls) >= COMPONENT_SUPPORT_FILE_NUMBER:\n                    break\n                file_type = img_name.split(\".\")[-1].lower()\n                if img_name in sys_file_urls:\n                    if file_type in supported_file_type:\n                        available_img_urls[img_name] = sys_file_urls.get(img_name, \"\")\n                    else:\n                        unsupported_files.append(img_name)\n                else:\n                    unknown_files.append(img_name)\n            \n        for img_url in img_urls:\n            if len(available_img_urls) >= COMPONENT_SUPPORT_FILE_NUMBER:\n                break\n            if img_url in list(sys_file_urls.values()):\n                continue\n            file_name = img_url.split(\"/\")[-1].split(\"?\")[0]\n            file_type = file_name.split(\".\")[-1].lower()\n            if file_type in supported_file_type:\n                available_img_urls[img_url] = img_url\n            else:\n                unsupported_files.append(img_url)\n        \n        for img_name, img_url in available_img_urls.items():\n            try:\n                rec_res, raw_data = self._recognize_w_post_process(img_name, img_url, available_img_urls, request_id=traceid)\n                rec_res = {\n                    img_name: rec_res\n                }\n                res = json.dumps(rec_res, ensure_ascii=False)\n                llm_result = self.create_output(type=\"text\", text=res, name=\"text_1\", raw_data=raw_data, visible_scope='llm')\n                yield llm_result\n                user_result = self.create_output(type=\"text\", text=\"\", name=\"text_2\", raw_data=raw_data, visible_scope='user')\n                yield user_result\n            except Exception as e:\n                logging.warning(f\"{img_name} ocr failed with exception: {e}\")\n                continue\n\n        for file in unsupported_files:\n            rec_res = {\n                file: \"不支持的文件类型，请确认是否为图片文件\"\n            }\n            res = json.dumps(rec_res, ensure_ascii=False)\n            yield self.create_output(type=\"text\", text=res, name=\"text_1\", visible_scope='llm')\n            yield self.create_output(type=\"text\", text=f\"\", name=\"text_2\", visible_scope='user')\n        \n        for file in unknown_files:\n            rec_res = {\n                file: \"无法获取url，请确认是否上传成功\"\n            }\n            res = json.dumps(rec_res, ensure_ascii=False)\n            yield self.create_output(type=\"text\", text=res, name=\"text_1\", visible_scope='llm')\n            yield self.create_output(type=\"text\", text=f\"\", name=\"text_2\", visible_scope='user')\n\n    def _recognize_w_post_process(\n        self,\n        img_name,\n        img_url,\n        file_urls,\n        question=\"图片内容有哪些\",\n        request_id=None,\n    ) -> str:\n        r\"\"\"\n            参数:\n                img_name (str): 图片文件名\n                img_url (bool): 图片url\n                question (str): 询问有关图片内容的问题\n                file_urls (dict): 文件名与对应文件url的映射\n\n            返回：\n                str: 图片内容理解结果\n        \"\"\"\n        req = ImageUnderstandRequest()\n        # 兼容新参数，确保输出结果一致\n        req.subject_detect = False\n        req.llm_switch = False\n        req.question = question\n        if img_name in file_urls:\n            req.url = file_urls[img_name]\n        if img_url:\n            if img_url in file_urls:\n                img_url = file_urls[img_url]\n            req.url = img_url\n        response, raw_data = self.__recognize(req, request_id=request_id)\n        description_to_llm = response.result.description_to_llm\n        description_processed = description_to_llm.rsplit(\"。\", 2)[0]\n        return description_processed, raw_data\n\n    @staticmethod\n    def __check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n\n            参数:\n                request (dict) : 图像内容理解body返回\n            返回：\n                无\n        \"\"\"\n        ret_code = data.get(\"ret_code\", 0)\n        if ret_code != 0 and ret_code != 1:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"ret_code\", \"\"),\n                service_err_message=data.get(\"ret_msg\", \"\")\n            )\n\n    @staticmethod\n    def __check_create_task_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request_id (str) : 任务请求ID\n                data (dict): 响应数据\n            返回：\n                无\n        \"\"\"\n\n        if \"error_code\" in data and \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\", \"\"),\n                service_err_message=data.get(\"error_msg\", \"\")\n            )\n\n\n\n\n\n"
  },
  {
    "path": "python/core/components/v2/llms/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/v2/llms/dialog_summary/__init__.py",
    "content": "\"\"\"DialogSummary\"\"\"\nfrom .component import DialogSummary"
  },
  {
    "path": "python/core/components/v2/llms/dialog_summary/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import Optional\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.llms.dialog_summary.base import DialogSummaryArgs\n\n\nclass DialogSummary(CompletionBaseComponent):\n    r\"\"\"\n    会话小结大模型组件， 基于生成式大模型对一段用户与坐席的对话生成总结，结果按{\"诉求\": \"\", \"回应\": \"\", \"解决情况\": \"\"}格式输出。\n\n    Examples:\n\n    .. code-block:: python\n\n        import app\n        import os\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        dialog_summary = appbuilder.DialogSummary(\"DeepSeek-V3.1\")\n        text = \"用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见\"\n        answer = dialog_summary(appbuilder.Message(text))\n        print(answer)\n\n    \"\"\"\n    name = \"dialog_summary\"\n    version = \"v1\"\n    meta = DialogSummaryArgs\n\n    manifests = [\n        {\n            \"name\": \"dialog_summary\",\n            \"description\": \"基于输入的对话，用大模型对该段对话生成总结, 结果按{\\\"诉求\\\": \\\"\\\", \\\"回应\\\": \\\"\\\", \\\"解决情况\\\": \\\"\\\"}格式输出。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入的对话，用于大模型根据该对话生成总结。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str = \"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化DialogSummary模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            DialogSummaryArgs, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, query: str, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=True, temperature=temperature, top_p=top_p)\n\n        for data in message.content:\n            yield self.create_output(type=\"text\", text=data, usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/llms/hallucination_detection/__init__.py",
    "content": "from .component import HallucinationDetection"
  },
  {
    "path": "python/core/components/v2/llms/hallucination_detection/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom pydantic import BaseModel, Field\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent, ModelArgsConfig\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.llms.hallucination_detection.base import HallucinationDetectionArgs\n        \n\nclass HallucinationDetection(CompletionBaseComponent):\n    \"\"\"\n    幻觉检测。输入<query, context, answer>，判断answer中是否存在幻觉。\n    *注：该组件推荐使用DeepSeek-V3.1模型。*\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ['APPBUILDER_TOKEN'] = '...'\n\n        hallucination_detection = appbuilder.HallucinationDetection()\n\n        query = ''\n        context = \\\n        '''澳门美食： 澳门新麻蒲韩国烤肉店\n        在澳门一年四季之中除了火锅，烤肉也相当受欢迎。提到韩烧，有一间令我印象最深刻，就是号称韩国第一的烤肉店－新麻蒲韩国烤肉店，光是韩国的分店便多达四百多间，海外分店更是遍布世界各地，2016年便落户澳门筷子基区，在原本已经食肆林立的地方一起百花齐放！店内的装修跟韩国分店还完度几乎没差，让食客彷如置身于韩国的感觉，还要大赞其抽风系统不俗，离开时身上都不会沾上烤肉味耶！\n        时间：周一至周日 下午5:00 - 上午3:00\n        电话：＋853 2823 4012\n        地址：澳门筷子基船澳街海擎天第三座地下O号铺96号\n        必食推介:\n        护心肉二人套餐\n        来新麻蒲必试的有两样东西，现在差不多每间烤肉店都有炉边烤蛋，但大家知道吗？原来新麻蒲就是炉边烤蛋的开创者，既然是始祖，这已经是个非吃不可的理由！还有一款必试的就是护心肉，即是猪的横隔膜与肝中间的部分，每头猪也只有200克这种肉，非常珍贵，其味道吃起来有种独特的肉香味，跟牛护心肉一样精彩！\n        秘制猪皮\n        很多怕胖的女生看到猪皮就怕怕，但其实猪皮含有大量胶原蛋白，营养价值很高呢！这里红通通的猪皮还经过韩国秘制酱汁处理过，会有一点点辣味。烤猪皮的时候也需特别注意火侯，这样吃起来才会有外脆内Q的口感！'''\n        answer = '澳门新麻蒲烤肉店并不是每天开门。'\n\n        inputs = {'query': query, 'context': context, 'answer': answer}\n        msg = appbuilder.Message(inputs)\n        result = hallucination_detection.run(msg)\n\n        print(result)\n    \"\"\"\n    name = 'hallucination_detection'\n    version = 'v1'\n    meta = HallucinationDetectionArgs\n\n    manifests = [\n        {\n            \"name\": \"hallucination_detection\",\n            \"description\": \"输入用户查询query、检索结果context以及根据检索结果context生成的用户查询query的回答answer，判断answer\" \\\n                           \"中是否存在幻觉。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"用户查询。\"\n                    },\n                    \"context\": {\n                        \"type\": \"string\",\n                        \"description\": \"检索结果。\"\n                    },\n                    \"answer\": {\n                        \"type\": \"string\",\n                        \"description\": \"根据检索结果context生成的用户查询query的回答answer。\"\n                    }\n                },\n                \"required\": [\n                    \"query\",\n                    \"context\",\n                    \"answer\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n        self, \n        model=\"DeepSeek-V3.1\",\n        secret_key: Optional[str] = None, \n        gateway: str = \"\",\n        lazy_certification: bool = True,\n        **kwargs,\n    ):\n        \"\"\"初始化幻觉检测组件。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。推荐使用DeepSeek-V3.1模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(HallucinationDetectionArgs,\n                         model=model,\n                         secret_key=secret_key,\n                         gateway=gateway,\n                         lazy_certification=lazy_certification)\n\n    def completion(self, version, base_url, request, timeout: float = None,\n                   retry: int = 0):\n        \"\"\"\n        Send a byte array of an audio file to obtain the result of speech recognition.\n        \n        Args:\n            version (str): API version.\n            base_url (str): Base URL of the API.\n            request (Request): Request object containing audio file and other parameters.\n            timeout (float, optional): Timeout for the request. Defaults to None.\n            retry (int, optional): Number of retries for the request. Defaults to 0.\n        \n        Returns:\n            Response: Processed response object.\n        \n        \"\"\"\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n\n        stream = True if request.response_mode == \"streaming\" else False\n        \n        url = self.http_client.service_url(\"/app/hallucination_detection\", self.base_url)\n        response = self.http_client.session.post(url, json=request.params, headers=headers, timeout=timeout,\n                                                 stream=stream)\n        return self.gene_response(response, stream)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (Message): 输入消息，包含 query、context 和 answer。是必需的参数。\n            stream (bool, 可选): 是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            result (Message): 模型运行后的输出消息。\n        \n        Raises:\n            AssertionError: 如果输入的 message 中缺少 query、context 或 answer。\n            AppBuilderServerException: 如果请求执行失败，将抛出异常，包含服务错误码和错误信息。\n        \"\"\"\n        inputs = message.content\n        query = inputs.pop('query', None)\n        assert query, 'You must input query and query should not be empty'\n        assert 'context' in inputs and inputs['context'], 'You must input context and context should not be empty'\n        assert 'answer' in inputs and inputs['answer'], 'You must input answer and answer should not be empty'\n        response_mode = \"streaming\" if stream else \"blocking\"\n        user_id = message.id\n        model_config_inputs = ModelArgsConfig(**{\"stream\": stream, \"temperature\": temperature, \"top_p\": top_p})\n        model_config = self.get_model_config(model_config_inputs)\n\n        request = self.gene_request(query, inputs, response_mode, user_id, model_config)\n        response = self.completion(self.version, self.base_url, request)\n\n        if response.error_no != 0:\n            raise AppBuilderServerException(service_err_code=response.error_no, service_err_message=response.error_msg)\n\n        result = response.to_message()\n\n        return result\n\n    @components_run_stream_trace\n    def tool_eval(self, \n                  query: str, \n                  context: str,\n                  answer: str,\n                  **kwargs):\n        \"\"\"\n        调用函数进行工具评估。\n        \n        Args:\n            - query (str): 查询语句。\n            - context (str): 上下文信息。\n            - answer (str): 参考答案。\n            **kwargs: 关键字参数，包含评估所需的输入参数。\n                - model_configs (dict, optional): 模型配置信息，默认为空字典。包含以下字段：\n                    - temperature (float, optional): 温度参数，用于控制生成文本的随机性，默认为1e-10。\n                    - top_p (float, optional): 截断概率，用于控制生成文本的质量，默认为0.0。\n        \n        Returns:\n            ComponentOutput: 组件输出结果，包含评估结果。\n        \n        Raises:\n            ValueError: 如果缺少query、context或answer参数，将引发此异常。\n        \"\"\"\n        if not query or not context or not answer:\n            raise ValueError('param `query` and `context` and `answer` are required')\n        msg = Message({'query': query, 'context': context, 'answer': answer})\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get('temperature', 1e-10)\n        top_p = model_configs.get('top_p', 0.0)\n        message = self.run(message=msg,\n                           stream=True,\n                           temperature=temperature,\n                           top_p=top_p)\n        \n        for data in message.content:\n            yield self.create_output(type=\"text\", text=data, usage=message.token_usage, name=\"text\")"
  },
  {
    "path": "python/core/components/v2/llms/is_complex_query/__init__.py",
    "content": "\nfrom .component import IsComplexQuery\n"
  },
  {
    "path": "python/core/components/v2/llms/is_complex_query/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\" is complex query\n\"\"\"\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.components.llms.is_complex_query.base import IsComplexQueryMeta\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass IsComplexQuery(CompletionBaseComponent):\n    r\"\"\" \n    基于输入的问题, 对问题进行初步的分类，方便下游使用不同类型的流程来处理当前的简单问题/复杂问题。广泛用于知识问答场景。\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        is_complex_query = appbuilder.IsComplexQuery(model=\"DeepSeek-V3.1\")\n\n        msg = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(msg)\n        answer = is_complex_query(msg)\n\n        print(\"Answer: \\n{}\".format(answer.content))\n    \"\"\"\n    name = \"is_complex_query\"\n    version = \"v1\"\n    meta = IsComplexQueryMeta\n\n    manifests = [\n        {\n            \"name\": \"is_complex_query\",\n            \"description\": \"基于输入的问题, 对问题进行初步的分类，方便下游使用不同类型的流程来处理当前的简单问题/复杂问题。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入的问题，用于大模型根据该问题进行初步的分类。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str = \"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化IsComplexQueryMeta任务。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            IsComplexQueryMeta, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, query: str, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p)\n\n        yield self.create_output(type=\"text\", text=str(message.content), name=\"text\", usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/llms/mrc/__init__.py",
    "content": "\nfrom .component import MRC\n"
  },
  {
    "path": "python/core/components/v2/llms/mrc/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import Optional\n\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent, ModelArgsConfig\nfrom appbuilder.core.components.llms.mrc.base import MrcArgs\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass MRC(CompletionBaseComponent):\n    \"\"\"\n    阅读理解问答组件，基于大模型进行阅读理解问答，支持拒答、澄清、重点强调、友好性提升、溯源等多种功能，可用于回答用户提出的问题。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        import os\n\n        # 设置环境变量\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        # 创建MRC对象\n        mrc_component = appbuilder.MRC()\n\n        #初始化参数\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        context_list = appbuilder.Message([\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；2、持有准驾车型为C1（听力残疾）、\n        C2（左下肢残疾、听力残疾\", \"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，\n        并有有效交强险凭证，C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n        北京市无障碍环境建设促进中心\"])\n\n        # 模拟运行MRC组件，开启拒答、澄清追问、重点强调、友好性提升和溯源能力五个功能\n        result = mrc_component.run(msg, context_list, reject=True,\n                                    clarify=True, highlight=True, friendly=True, cite=True)\n\n        # 输出运行结果\n        print(result)\n\n    \"\"\"\n    name = \"mrc\"\n    version = \"v1\"\n    meta: MrcArgs\n\n    manifests = [\n        {\n            \"name\": \"mrc\",\n            \"description\": \"对于输入的问题，基于大模型进行阅读理解问答，支持拒答、澄清、重点强调、友好性提升、溯源等多种功能，可用于回答用户提出的问题\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入用户query，例如'千帆平台都有哪些大模型？'\"\n                    },\n                    \"context_list\": {\n                        \"type\": \"list\",\n                        \"description\": \"用户输入检索片段list，例如[content1, content2, content3,...]，也可以为空, 即[]\"\n                    },\n                    \"reject\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型拒答能力的开关，为true即为开启拒答功能，为false即为关闭拒答功能\"\n                    },\n                    \"clarify\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型澄清能力的开关，为true即为开启澄清反问功能，为false即为关闭澄清反问功能\"\n                    },\n                    \"highlight\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型重点强调能力的开关，为true即为开启重点强调功能，为false即为关闭重点强调功能\"\n                    },\n                    \"friendly\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型友好对提升难过能力的开关，为true即为开启友好度提升功能，为false即为关闭友好度提升功能\"\n                    },\n                    \"cite\": {\n                        \"type\": \"bool\",\n                        \"description\": \"控制大模型溯源能力的开关，为true即为开启溯源功能，为false即为关闭溯源功能。\"\n                    }\n                },\n                \"required\": [\n                    \"query\",\n                    \"context_list\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str = \"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化MRC(阅读理解问答)模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            MrcArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    def __get_instruction_set(self):\n        \"\"\"\n        return: json格式的instruction_set\n        \"\"\"\n        return {\"reject\": \"如果答案不在搜索结果中得到，则在答案开头说明：\"\n                          \"“当前文档库找不到对应的答案，我可以尝试用我的常识来回答你”，\"\n                          \"并基于你的常识给出答案。\",\n                \"clarify\": \"当问题比较模糊，而检索结果包含多种可能的答案时，反向提问用户想问的具体内容，\"\n                           \"让用户补充关键信息后以完整的query重新发问。\",\n                \"highlight\": \"可以对答案中的核心部分进行markdown加粗（**加粗内容**）。\",\n                \"friendly\": \"答案尽量用礼貌用语开头，涉及到条目列举的内容需要在前面加序号并做分点描述，\"\n                            \"必要时可在每一点前面做小标题的汇总，并可以用总-分-总的形式展示分点式答案内容，使得答案内容可读性更强。\",\n                \"cite\": \"使用引用标记来标注回答内容参考的搜索结果序号，例如^[1]^ (引用单个搜索结果）,^[1][2]^（引用多个搜索结果），\"\n                        \"其中方括号中的数字是搜索结果序号。引用标记只能出现在句尾标点符号前。\"}\n\n    @components_run_trace\n    def run(self, message, context_list, reject=False, clarify=False,\n            highlight=False, friendly=False, cite=False, stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        运行阅读理解问答模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，包含用户提出的问题。这是一个必需的参数。\n            context_list (obj:`Message`): 用户输入的问题对应的段落文本列表。这是一个必需的参数。\n            reject (bool, 可选): 拒答开关，如果为 True，则启用拒答能力。默认为 False。\n            clarify (bool, 可选): 澄清开关，如果为 True，则启用澄清能力。默认为 False。\n            highlight (bool, 可选): 重点强调开关，如果为 True，则启用重点强调能力。默认为 False。\n            friendly (bool, 可选): 友好性提升开关，如果为 True，则启用友好性提升能力。默认为 False。\n            cite (bool, 可选): 溯源开关，如果为 True，则启用溯源能力。默认为 False。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        instruction_set = self.__get_instruction_set()\n        context_list = context_list.content\n        inputs = {\n            \"query\": message.content,\n            \"context_out\": \"\\n\\n\".join(f\"[{i + 1}] {s}\" for i, s in enumerate(context_list)),\n            \"reject\": instruction_set[\"reject\"] if reject else None,\n            \"clarify\": instruction_set[\"clarify\"] if clarify else None,\n            \"highlight\": instruction_set[\"highlight\"] if highlight else None,\n            \"friendly\": instruction_set[\"friendly\"] if friendly else None,\n            \"cite\": instruction_set[\"cite\"] if cite else None,\n        }\n        model_config_inputs = ModelArgsConfig(**{\"stream\": stream, \"temperature\": temperature, \"top_p\": top_p})\n        model_config = self.get_model_config(model_config_inputs)\n        query = inputs[\"query\"]\n        response_mode = \"streaming\" if stream else \"blocking\"\n        user_id = message.id\n\n        request = self.gene_request(query, inputs, response_mode, user_id, model_config)\n        response = self.completion(self.version, self.base_url, request)\n\n        if response.error_no != 0:\n            raise AppBuilderServerException(service_err_code=response.error_no, service_err_message=response.error_msg)\n\n        return response.to_message()\n\n    @components_run_stream_trace\n    def tool_eval(self,\n                  query: str,\n                  context_list: list,\n                  reject: bool = False,\n                  clarify: bool = False,\n                  highlight: bool = False,\n                  friendly: bool = False,\n                  cite: bool = False,\n                  **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        if not query or not context_list:\n            raise ValueError(\"param `query` and `context_list` are required\")\n        msg = Message(query)\n        context_list_msg = Message(context_list)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(\n            message=msg, context_list=context_list_msg, reject=reject, clarify=clarify,\n            highlight=highlight, friendly=friendly, cite=cite, stream=False, temperature=temperature,\n            top_p=top_p\n        )\n\n        yield self.create_output(type=\"text\", text=str(message.content), name=\"text\", usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/llms/nl2pandas/__init__.py",
    "content": "\"\"\"text to pandas\"\"\"\nfrom .component import Nl2pandasComponent"
  },
  {
    "path": "python/core/components/v2/llms/nl2pandas/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.components.llms.nl2pandas.base import Nl2pandasArgs\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass Nl2pandasComponent(CompletionBaseComponent):\n    \"\"\"\n    自然语言转pandas大模型组件， 基于生成式大模型对query进行理解并生成对应语义的可执行python代码（主要使用pandas），可用于基于表格的查询、问答等多种场景。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        table_info = '''表格列信息如下：\n        学校名 : 清华附小 , 字符串类型，代表小学学校的名称\n        所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\n        创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\n        类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\n        学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\n        教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\n        教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量\n        '''\n        query = \"海淀区有哪些学校\"\n        query = appbuilder.Message(query)\n        \n        nl2pandas = appbuilder.Nl2pandasComponent(model=\"DeepSeek-V3.1\")\n        answer = nl2pandas(query, table_info = table_info)\n    \"\"\"\n    name = \"nl2pandas\"\n    version = \"v1\"\n    meta = Nl2pandasArgs\n\n    manifests = [\n        {\n            \"name\": \"nl2pandas\",\n            \"description\": \"输入用户查询query，基于生成式大模型对query进行理解并生成对应语义的可执行python代码（主要使用pandas），可用于基于表格的查询、问答等多种场景\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入问题，一般是针对表格信息的提问，例如'海淀区的小学有哪些'\"\n                    },\n                    \"table_info\": {\n                        \"type\": \"string\",\n                        \"description\": \"表格信息，一般是表格列名以及对应列名的举例和释义，例如'表格列信息如下：\\n学校名 : 清华附小 , 字符串类型，代表小学学校的名称\"\n                    }\n                },\n                \"required\": [\n                    \"query\",\n                    \"table_info\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str = \"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化Nl2pandasComponent模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            Nl2pandasArgs, model=model, secret_key=secret_key, gateway=gateway, lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, table_info=None, stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入问题，通常是针对表格信息的提问，如'海淀区的小学有哪些'。这是一个必需的参数。\n            table_info (obj:`Message`, optional): 表格信息，包括表格列名、对应列名的示例和释义。默认值为 None，但这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, table_info=table_info, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, query: str, table_info: str, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        if not query or not table_info:\n            raise ValueError(\"param `query` and 'table_info' are required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, table_info=table_info, stream=True, temperature=temperature,\n                              top_p=top_p)\n\n        for data in message.content:\n            yield self.create_output(type=\"text\", text=data, name=\"text\", usage=message.token_usage)\n\n"
  },
  {
    "path": "python/core/components/v2/llms/oral_query_generation/__init__.py",
    "content": "from .component import OralQueryGeneration"
  },
  {
    "path": "python/core/components/v2/llms/oral_query_generation/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport json\nimport re\n\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent, ModelArgsConfig\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.llms.oral_query_generation.base import OralQueryGenerationArgs\n\n\nclass OralQueryGeneration(CompletionBaseComponent):\n    r\"\"\"\n    口语化Query生成，可用于问答场景下对文档增强索引。\n    *注：该组件推荐使用DeepSeek-V3.1模型。*\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        text = ('文档标题：在OPPO Reno5上使用视频超级防抖\\n'\n                '文档摘要：OPPO Reno5上的视频超级防抖，视频超级防抖3.0，多代视频防抖算法积累，这一代依旧超级防抖超级稳。 开启视频超级'\n                '防抖 开启路径：打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能，开启超级'\n                '防抖后手机屏幕将出现超级防抖Pro开关，点击即可开启或关闭。 除此之外，前置视频同样加持防抖算法，边走边拍也能稳定聚焦脸部'\n                '，实时视频分享您的生活。')\n        oral_query_generation = appbuilder.OralQueryGeneration(model='DeepSeek-V3.1')\n        answer = oral_query_generation(appbuilder.Message(text), query_type='全部', output_format='str')\n        print(answer.content)\n    \"\"\"\n    name = 'query_generation'\n    version = 'v1'\n    meta = OralQueryGenerationArgs\n\n    manifests = [\n        {\n            \"name\": \"query_generation\",\n            \"description\": \"输入文本、待生成的query类型和输出格式，生成query，并按照要求的格式进行输出。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"text\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入文本，组件会根据该输入文本生成query。\"\n                    },\n                    \"query_type\": {\n                        \"type\": \"string\",\n                        \"description\": \"待生成的query类型，可选问题、短语以及全部（问题 + 短语）。\"\n                    },\n                    \"output_format\": {\n                        \"type\": \"string\",\n                        \"description\": \"输出格式，可选json或str，str格式与老版本输出格式相同。\"\n                    }\n                },\n                \"required\": [\n                    \"text\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str=\"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化StyleRewrite模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            OralQueryGenerationArgs, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n    \n    def regenerate_output(self, model_output, output_format):\n        \"\"\"\n        兼容老版本的输出格式\n        \"\"\"\n        if not isinstance(model_output, str):\n            return model_output\n        \n        match_obj = re.search(r'```json\\n(.+)\\n```', model_output, flags=re.DOTALL)\n\n        regenerated_output = None\n        if match_obj:\n            regenerated_output = json.loads(match_obj.group(1))\n        else:\n            dict_json_match_obj = re.search(r'\\{(.|\\n)+\\}', model_output)\n            dict_json_text = dict_json_match_obj.group(0) if dict_json_match_obj else None\n            regenerated_output = json.loads(dict_json_text) if dict_json_text is not None else model_output\n\n        if output_format == 'json' or not isinstance(regenerated_output, dict):\n            return json.dumps(regenerated_output, ensure_ascii=False, indent=4)\n\n        queries = []\n        for key in ['问题', '短语']:\n            queries += regenerated_output.pop(key, [])\n        for value in regenerated_output.values():\n            queries += value\n        \n        regenerated_output = '\\n'.join([f'{index}. {query}' for index, query in enumerate(queries, 1)])\n        return regenerated_output\n\n    def completion(self, version, base_url, request, timeout: float = None,\n                   retry: int = 0):\n        r\"\"\"Send a byte array of an audio file to obtain the result of speech recognition.\"\"\"\n\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n\n        stream = True if request.response_mode == \"streaming\" else False\n        \n        url = self.http_client.service_url(\"/app/query_generation\", self.base_url)\n        response = self.http_client.session.post(url, json=request.params, headers=headers, timeout=timeout,\n                                                 stream=stream)\n        return self.gene_response(response, stream)\n\n    @components_run_trace\n    def run(self, message, query_type='全部', output_format='str', stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (Message): 输入消息，包含query、context和answer等信息。这是一个必需的参数。\n            query_type (str, 可选): 待生成的query类型，包括问题、短语和全部（问题+短语）。默认为全部。\n            output_format (str, 可选): 输出格式，包括json和str，当stream为True时，只能以json形式输出。默认为str。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            result (Message): 模型运行后的输出消息。\n        \n        \"\"\"\n        text = message.content\n        assert text, 'Input text should be a valid string'\n        inputs = {\n            'text': text,\n            'query_type': query_type\n        }\n        response_mode = \"streaming\" if stream else \"blocking\"\n        user_id = message.id\n        model_config_inputs = ModelArgsConfig(**{\"stream\": stream, \"temperature\": temperature, \"top_p\": top_p})\n        model_config = self.get_model_config(model_config_inputs)\n\n        request = self.gene_request('', inputs, response_mode, user_id, model_config)\n        response = self.completion(self.version, self.base_url, request)\n\n        if response.error_no != 0:\n            raise AppBuilderServerException(service_err_code=response.error_no, service_err_message=response.error_msg)\n\n        result = response.to_message()\n        result.content = self.regenerate_output(result.content, output_format)\n\n        return result\n\n    @components_run_stream_trace\n    def tool_eval(self,\n                  text: str,\n                  query_type: str = '全部',\n                  output_format: str = 'str',\n                  **kwargs):\n        \"\"\"\n        根据给定的文本和查询类型生成输出。\n        \n        Args:\n            text (str): 要处理的文本。\n            query_type (str, optional): 查询类型，默认为'全部'。\n            output_format (str, optional): 输出格式，默认为'str'。\n            **kwargs: 其他关键字参数，例如模型配置等。\n        \n        Returns:\n            generator: 生成输出数据的生成器。\n        \n        \"\"\"\n        msg = Message(text)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get('temperature', 1e-10)\n        top_p = model_configs.get('top_p', 0.0)\n        message = self.run(message=msg,\n                           query_type=query_type,\n                           output_format=output_format,\n                           stream=True,\n                           temperature=temperature,\n                           top_p=top_p)\n        \n        for data in message.content:\n            yield self.create_output(type=\"text\", text=data, usage=message.token_usage)\n        \n"
  },
  {
    "path": "python/core/components/v2/llms/qa_pair_mining/__init__.py",
    "content": "\nfrom .component import QAPairMining\n"
  },
  {
    "path": "python/core/components/v2/llms/qa_pair_mining/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.components.llms.qa_pair_mining.base import QAPairMiningMeta\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass QAPairMining(CompletionBaseComponent):\n    \"\"\" \n    基于输入文本内容，快速生成多个问题及对应答案,极大提高信息提炼的效率和准确性.广泛用于在线客服、智能问答等领域。\n\n    Examples:\n\n    .. code-block:: python\n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        qa_mining = appbuilder.QAPairMining(model=\"DeepSeek-V3.1\")\n        # 输入文本（对此文本挖掘问答对）\n        msg =  '2017年，工商银行根据外部宏观环境变化，及时调整业务策略，优化资产负债结构，' + \\\n            '保持存贷款业务协调发展，提升资产负债配置效率。' + \\\n            '2018年3月末，工商银行总资产264,937.81亿元，比上年末增加4,067.38亿元。'\n        msg = appbuilder.Message(msg)\n        answer = qa_mining(msg)\n\n        print(\">>> Output: {}\".format(answer.content))\n    \n    \"\"\"\n    name = \"qa_pair_mining\"\n    version = \"v1\"\n    meta = QAPairMiningMeta\n\n    manifests = [\n        {\n            \"name\": \"qa_pair_mining\",\n            \"description\": \"基于输入文本内容，快速生成多个问题及对应答案，极大提高信息提炼的效率和准确性。广泛用于在线客服、智能问答等领域。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入消息，用于模型的输入，一般为文档段落。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str = \"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化QAPairMining(问答对挖掘)模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            QAPairMiningMeta, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, query: str, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p)\n\n        yield self.create_output(type=\"text\", text=str(message.content), name=\"text\", usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/llms/query_decomposition/__init__.py",
    "content": "\nfrom .component import QueryDecomposition\n"
  },
  {
    "path": "python/core/components/v2/llms/query_decomposition/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\" query decomposition\n\"\"\"\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.components.llms.query_decomposition.base import QueryDecompositionMeta\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass QueryDecomposition(CompletionBaseComponent):\n    r\"\"\" 尝试对已经判定为复杂问题的原始问题进行拆解，把复杂问题拆解为一个个简单问题。广泛用于知识问答场景。\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        query_decomposition = appbuilder.QueryDecomposition(model=\"DeepSeek-V3.1\")\n\n        msg = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(msg)\n        answer = query_decomposition(msg)\n\n        print(\"Answer: \\n{}\".format(answer.content))\n    \"\"\"\n    name = \"query_decomposition\"\n    version = \"v1\"\n    meta = QueryDecompositionMeta\n\n    manifests = [\n        {\n            \"name\": \"query_decomposition\",\n            \"description\": \"尝试对已经判定为复杂问题的原始问题进行拆解，把复杂问题拆解为一个个简单问题。广泛用于知识问答场景。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入消息，用于模型的输入，一般为问题。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str = \"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化QueryDecompositionMeta任务。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            QueryDecompositionMeta, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, query: str, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p)\n\n        yield self.create_output(type=\"text\", text=str(message.content), name=\"text\", usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/llms/query_rewrite/__init__.py",
    "content": "\"\"\"query_rewrite\"\"\"\nfrom .component import QueryRewrite\n"
  },
  {
    "path": "python/core/components/v2/llms/query_rewrite/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"\n多轮改写\n\"\"\"\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.llms.query_rewrite.base import QueryRewriteArgs\n\n\nclass QueryRewrite(CompletionBaseComponent):\n    \"\"\"\n    多轮改写大模型组件， 基于生成式大模型进行多轮对话query改写的组件。它主要用于理解和优化用户与机器人的交互过程，进行指代消解及省略补全。该组件支持不同的改写类型，可根据对话历史生成更准确的用户查询。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        query_rewrite = appbuilder.QueryRewrite(model=\"DeepSeek-V3.1\")\n        answer = query_rewrite(appbuilder.Message(['我应该怎么办理护照？', \n                                                    '您可以查询官网或人工咨询', \n                                                    '我需要准备哪些材料？', \n                                                    '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', \n                                                    '在哪里办']), \n                                                    rewrite_type=\"带机器人回复\")\n                        \n    \"\"\"\n\n    name = \"query_rewrite\"\n    version = \"v1\"\n    meta = QueryRewriteArgs\n\n    manifests = [\n        {\n            \"name\": \"query_rewrite\",\n            \"description\": \"多轮改写大模型组件， 基于生成式大模型进行多轮对话query改写的组件。它主要用于理解和优化用户与机器人\"\n                           \"的交互过程，进行指代消解及省略补全。该组件支持不同的改写类型，可根据对话历史生成更准确的用户查询。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入消息，用于模型的主要输入内容\"\n                    },\n                    \"rewrite_type\": {\n                        \"type\": \"string\",\n                        \"enum\": [\n                            \"带机器人回复\",\n                            \"仅用户查询\"\n                        ],\n                        \"description\": \"改写类型选项，可选值为 '带机器人回复'和 '仅用户查询'。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str = \"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"QueryRewrite模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            QueryRewriteArgs, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, rewrite_type=\"带机器人回复\", stream=False, temperature=1e-10, top_p=0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            rewrite_type (str, 可选): 改写类型选项，可选值为 '带机器人回复'(改写时参考user查询历史和assistant回复历史)，\n                                      '仅用户查询'(改写时参考user查询历史)。默认为\"带机器人回复\"。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                                       取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                                       默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                                 取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                                 默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \n        Raises:\n            ValueError: 如果输入消息为空或不符合要求，将抛出 ValueError 异常。\n        \n        \"\"\"\n        if message is None:\n            raise ValueError(\"input message is required\")\n\n        sum_len = sum(len(item) for item in message.content)\n        if len(message.content) > 10 or len(message.content) % 2 == 0:\n            raise ValueError(f\"illegal input，expected len(message.content) in {1, 3, 5, 9}, got {len(message.content)}\")\n        if sum_len > 4000:\n            raise ValueError(f\"illegal input, expected length <= 4000, got {sum_len}\")\n        if rewrite_type == \"带机器人回复\":\n            converted_input = ''.join([f\"{'User:' if i % 2 == 0 else 'Assistant:'}\\\n                                       {message.content[i]}\\n\" for i in range(len(message.content))])\n        else:\n            converted_input = ''.join([f\"User1: {message.content[i]}\\n\" for i in range(0, len(message.content), 2)])\n        message.content = converted_input\n\n        return super().run(message=message, rewrite_type=rewrite_type, stream=stream, temperature=temperature,\n                           top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self,\n                  query: str,\n                  rewrite_type: str = \"带机器人回复\",\n                  **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, rewrite_type=rewrite_type, stream=True, temperature=temperature,\n                              top_p=top_p)\n\n        for data in message.content:\n            yield self.create_output(type=\"text\", text=data, usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/llms/similar_question/__init__.py",
    "content": "\nfrom .component import SimilarQuestion\n"
  },
  {
    "path": "python/core/components/v2/llms/similar_question/component.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\" similar question\n\"\"\"\nfrom typing import Optional\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.llms.similar_question.base import SimilarQuestionMeta\n\n\nclass SimilarQuestion(CompletionBaseComponent):\n    r\"\"\" \n    基于输入的问题, 挖掘出与该问题相关的类似问题。广泛用于客服、问答等场景。\n    \n    Examples:\n\n    .. code-block:: python\n        \n        import os\n        import appbuilder\n\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n\n        qa_mining = appbuilder.SimilarQuestion(model=\"DeepSeek-V3.1\")\n\n        msg = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n        msg = appbuilder.Message(msg)\n        answer = qa_mining(msg)\n\n        print(\"Answer: \\n{}\".format(answer.content))\n    \"\"\"\n    name = \"similar_question\"\n    version = \"v1\"\n    meta = SimilarQuestionMeta\n\n    manifests = [\n        {\n            \"name\": \"similar_question\",\n            \"description\": \"基于输入的问题，挖掘出与该问题相关的类似问题。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入的问题，用于大模型根据该问题输出相关的类似问题。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str=\"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化StyleRewrite模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n            **kwargs: 其他关键字参数.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            SimilarQuestionMeta, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification, **kwargs)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0, request_id=None):\n        \"\"\"\n        给定输入（message）到模型运行，同时指定运行参数，并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p(float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p, request_id=request_id)\n\n    @components_run_stream_trace\n    def tool_eval(self, \n                  query: str,\n                  **kwargs):\n        \"\"\"\n        根据给定的query和可选参数生成并返回文本输出。\n        \n        Args:\n            query (str): 需要生成文本的输入查询字符串。\n            **kwargs: 其他可选参数。\n        \n        Returns:\n            Generator[Output]: 返回一个生成器，生成类型为Output的对象。\n        \n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n        \n        yield self.create_output(type=\"text\", text=str(message.content), name=\"text\", usage=message.token_usage)"
  },
  {
    "path": "python/core/components/v2/llms/style_rewrite/__init__.py",
    "content": "\"\"\"StyleRewrite\"\"\"\nfrom .component import StyleRewrite\n"
  },
  {
    "path": "python/core/components/v2/llms/style_rewrite/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\n\nfrom typing import Optional\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.llms.style_rewrite.base import StyleRewriteArgs\n\n\nclass StyleRewrite(CompletionBaseComponent):\n    \"\"\"\n    文本风格转写大模型组件， 基于生成式大模型对文本的风格进行改写，支持有营销、客服、直播、激励及教学五种话术。\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        style_rewrite = appbuilder.StyleRewrite(model=\"DeepSeek-V3.1\")\n        answer = style_rewrite(appbuilder.Message(\"文心大模型发布新版本\"), style=\"激励话术\")\n\n    \"\"\"\n    name = \"style_rewrite\"\n    version = \"v1\"\n    meta = StyleRewriteArgs\n\n    manifests = [\n        {\n            \"name\": \"style_rewrite\",\n            \"description\": \"能够将一段文本转换成不同的风格（营销、客服、直播、激励及教学话术），同时保持原文的基本意义不变。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"需要改写的文本。\"\n                    },\n                    \"style\": {\n                        \"type\": \"string\",\n                        \"description\": \"想要转换的文本风格，目前有营销、客服、直播、激励及教学五种话术可选. 默认是营销话术。\",\n                        \"enum\": [\"营销话术\", \"客服话术\", \"直播话术\", \"激励话术\", \"教学话术\"]\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str=\"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化StyleRewrite模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n            **kwargs: 其他关键字参数.\n            \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            StyleRewriteArgs, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification, **kwargs)\n\n    @components_run_trace\n    def run(self, message, style=\"营销话术\", stream=False, temperature=1e-10, top_p=0.0, request_id=None):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            style (str, optional): 想要转换的文本风格，目前有营销、客服、直播、激励及教学五种话术可选。默认为\"营销话术\"。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \n        \"\"\"\n        return super().run(message=message, style=style, stream=stream, temperature=temperature, top_p=top_p, request_id=request_id)\n\n    @components_run_stream_trace \n    def tool_eval(self, query: str, style: str = \"营销话术\", **kwargs):\n        \"\"\"\n        执行工具评估函数\n        \n        Args:\n            name (str): 函数名称，本函数不使用该参数，但保留以符合某些框架的要求。\n            streaming (bool, optional): 是否以流的形式返回结果。默认为 False，即一次性返回结果。如果设置为 True，则以生成器形式逐个返回结果。\n            **kwargs: 其他参数，包含但不限于：\n                _sys_traceid (str): 请求的跟踪ID，用于日志记录和跟踪。\n                model_configs (dict, optional): 模型配置参数，可选的键包括：\n                    temperature (float, optional): 温度参数，用于控制生成文本的随机性。默认为 1e-10。\n                    top_p (float, optional): top_p 采样参数，用于控制生成文本的多样性。默认为 0.0。\n        \n        Returns:\n            如果 streaming 为 False，则直接返回评估结果字符串。\n            如果 streaming 为 True，则以生成器形式逐个返回评估结果字符串。\n        \n        Raises:\n            ValueError: 如果缺少参数 'query'。\n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        if style not in [\"营销话术\", \"客服话术\", \"直播话术\", \"激励话术\", \"教学话术\"]:\n            style = \"营销话术\"\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, style=style, stream=False, temperature=temperature, top_p=top_p, request_id=traceid)\n        \n        yield self.create_output(type=\"text\", text=str(message.content), name=\"text\", usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/llms/style_writing/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom .component import StyleWriting\n"
  },
  {
    "path": "python/core/components/v2/llms/style_writing/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.message import Message\n\nfrom appbuilder.core.component import ComponentArguments\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nfrom pydantic import Field\nfrom typing import Optional\n\nfrom appbuilder.core.components.llms.style_writing.base import StyleQueryChoices, LengthChoices, StyleWritingArgs\n\nclass StyleWritingArgs(ComponentArguments):\n    \"\"\"\n    风格写作配置\n\n    Attributes:\n        message: Message = Field(...)\n        style_query: StyleQueryChoices = Field(...)\n        length: LengthChoices = Field(...)\n    \"\"\"\n    message: Message = Field(...,\n                             variable_name=\"query\",\n                             description=\"输入消息，用于模型的主要输入内容，例如'帮我生成一个介绍保温杯的话术'\")\n    style_query: StyleQueryChoices = Field(...,\n                                           variable_name=\"style_query\",\n                                           description=\"风格查询选项，可选值为 'B站', '小红书', '通用'。\")\n    length: LengthChoices = Field(...,\n                                  variable_name=\"length\",\n                                  description=\"输出长度，可选值为 '短' (100), '中' (300), '长' (600)。\")\n\n\nclass StyleWriting(CompletionBaseComponent):\n    \"\"\"\n    风格写作大模型组件， 基于生成式大模型进行风格写作，支持B站、小红书等多种风格，可用于文案、广告等多种场景。\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        style_writing = appbuilder.StyleWriting(model=\"DeepSeek-V3.1\")\n        answer = style_writing(appbuilder.Message(\"帮我写一篇关于人体工学椅的文案\"), style_query=\"小红书\", length=100)\n\n    \"\"\"\n\n    name = \"style_writing\"\n    version = \"v1\"\n    meta = StyleWritingArgs\n\n    manifests = [\n        {\n            \"name\": \"style_writing\",\n            \"description\": \"根据用户输入的文案要求和文案风格，生成符合特定风格的产品介绍或宣传文案。目前支持生成小红书风格、B站风格或通用风格的文案。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"用于描述生成文案的主题和要求。\"\n                    },\n                    \"style\": {\n                        \"type\": \"string\",\n                        \"description\": \"用于定义文案生成的风格，包括通用、B站、小红书，默认为通用。\",\n                        \"enum\": [\"通用\", \"B站\", \"小红书\"]\n                    },\n                    \"length\": {\n                        \"type\": \"integer\",\n                        \"description\": \"用于定义输出内容的长度。有效的选项包括 100（短）、300（中）、600（长），默认值为 100。\",\n                        \"enum\": [100, 300, 600]\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str=\"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化StyleRewrite模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n            **kwargs: 其他关键字参数.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            StyleWritingArgs, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification, **kwargs)\n\n    @components_run_trace\n    def run(self, message, style_query=\"通用\", length=100, stream=False, temperature=1e-10, top_p=0, request_id=None):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`): 输入消息，用于模型的主要输入内容。这是一个必需的参数。\n            style_query (str): 风格查询选项，用于指定写作风格。有效的选项包括 'B站', '小红书', '通用'。默认值为 '通用'。\n            length (int): 输出内容的长度。有效的选项包括 100（短），300（中），600（长）。默认值为 100。\n            stream (bool, optional): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, optional): 模型配置的温度参数，用于调整模型的生成概率。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 1e-10。\n            top_p (float, optional): 影响输出文本的多样性，取值越大，生成文本的多样性越强。取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。默认值为 0。\n            request_id (str, optional): 请求ID，用于跟踪和识别请求。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, style_query=style_query, length=length, stream=stream,\n                           temperature=temperature, top_p=top_p, request_id=request_id)\n\n    @components_run_stream_trace\n    def tool_eval(self, \n                  query: str,\n                  style: str = \"通用\",\n                  length: int = 100,\n                  **kwargs):\n        \"\"\"\n        使用指定的模型和参数对输入的查询进行评估，并生成输出。\n        \n        Args:\n            query (str): 要评估的查询字符串。\n            style (str, optional): 评估的风格。默认为 \"通用\"。\n            length (int, optional): 输出文本的长度。默认为 100。\n            **kwargs: 关键字参数，可以包含以下可选参数：\n                _sys_traceid (str): 系统跟踪ID。\n                model_configs (dict): 模型配置字典，可以包含 \"temperature\" 和 \"top_p\" 两个键。\n        \n        Raises:\n            ValueError: 如果查询字符串为空，则引发 ValueError 异常。\n        \n        Yields:\n            Output: 生成的输出对象，包含文本类型和文本内容。\n        \n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        try:\n            length = int(length)\n            if length not in [100, 300, 600]:\n                length = 100\n        except:\n            length = 100\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, style_query=style, length=length, stream=False,\n                              temperature=temperature, top_p=top_p, request_id=traceid)\n        \n        yield self.create_output(type=\"text\", text=str(message.content), usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/llms/tag_extraction/__init__.py",
    "content": "\nfrom .component import TagExtraction"
  },
  {
    "path": "python/core/components/v2/llms/tag_extraction/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\nfrom typing import Optional\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent\nfrom appbuilder.core.components.llms.tag_extraction.base import TagExtractionArgs\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass TagExtraction(CompletionBaseComponent):\n    \"\"\"\n    标签抽取组件，基于生成式大模型进行关键标签的抽取。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        tag_extraction = appbuilder.TagExtraction(model=\"DeepSeek-V3.1\")\n        answer = tag_extraction(appbuilder.Message(\"从这段文本中抽取关键标签\"))\n\n    \"\"\"\n\n    name = \"tag_extraction\"\n    version = \"v1\"\n    meta = TagExtractionArgs\n\n    manifests = [\n        {\n            \"name\": \"tag_extraction\",\n            \"description\": \"标签抽取组件，基于生成式大模型进行关键标签的抽取。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"输入消息，用于模型的主要输入内容\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    def __init__(\n            self,\n            model: str = \"DeepSeek-V3.1\",\n            secret_key: Optional[str] = None,\n            gateway: str = \"\",\n            lazy_certification: bool = True,\n            **kwargs\n    ):\n        \"\"\"初始化TagExtraction模型。\n        \n        Args:\n            model (str|None): 模型名称，用于指定要使用的千帆模型。\n            secret_key (str, 可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n            gateway (str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            lazy_certification (bool, 可选): 延迟认证，为True时在第一次运行时认证. Defaults to False.\n        \n        Returns:\n            None\n        \n        \"\"\"\n        super().__init__(\n            TagExtractionArgs, model=model, secret_key=secret_key, gateway=gateway,\n            lazy_certification=lazy_certification)\n\n    @components_run_trace\n    def run(self, message, stream=False, temperature=1e-10, top_p=0.0):\n        \"\"\"\n        使用给定的输入运行模型并返回结果。\n        \n        Args:\n            message (obj:`Message`, 必选): 输入消息，用于模型的主要输入内容。\n            stream (bool, 可选): 指定是否以流式形式返回响应。默认为 False。\n            temperature (float, 可选): 模型配置的温度参数，用于调整模型的生成概率。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                默认值为 1e-10。\n            top_p (float, 可选): 影响输出文本的多样性，取值越大，生成文本的多样性越强。\n                取值范围为 0.0 到 1.0，其中较低的值使生成更确定性，较高的值使生成更多样性。\n                默认值为 0。\n        \n        Returns:\n            obj:`Message`: 模型运行后的输出消息。\n        \"\"\"\n        return super().run(message=message, stream=stream, temperature=temperature, top_p=top_p)\n\n    @components_run_stream_trace\n    def tool_eval(self, query: str, **kwargs):\n        \"\"\"\n        tool_eval for function call\n        \"\"\"\n        if not query:\n            raise ValueError(\"param `query` is required\")\n        msg = Message(query)\n        model_configs = kwargs.get('model_configs', {})\n        temperature = model_configs.get(\"temperature\", 1e-10)\n        top_p = model_configs.get(\"top_p\", 0.0)\n        message = super().run(message=msg, stream=False, temperature=temperature, top_p=top_p)\n\n        yield self.create_output(type=\"text\", text=str(message.content), usage=message.token_usage)\n"
  },
  {
    "path": "python/core/components/v2/mix_card_ocr/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/v2/mix_card_ocr/component.py",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"身份证混贴识别组件\"\"\"\nimport base64\nimport json\nfrom typing import Optional\nfrom appbuilder.core import utils\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.v2.mix_card_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass MixCardOCR(Component):\n    r\"\"\" 身份证混贴识别组件\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import requests\n        import appbuilder\n\n        os.environ[\"GATEWAY_URL\"] = \"...\"\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n        # 从BOS存储读取样例文件\n        image_url=\"https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe1865e4393da5a3515e90d72d81ef18296bd29598\"\n        raw_image = requests.get(image_url).content\n        # 输入参数为一张图片\n        inp = appbuilder.Message(content={\"raw_image\": raw_image})\n        # 进行识别\n        mix_card_ocr = MixCardOCR()\n        out = mix_card_ocr.run(inp)\n        # 打印识别结果\n        print(out.content)\n     \"\"\"\n\n    name = \"mixcard_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"mixcard_ocr\",\n            \"description\": \"当身份证正反面在同一张图片上，需要识别图片中身份证正反面所有字段时，使用该工具\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别文件的文件名\"\n                    }\n                },\n                \"required\": [\"file_names\"]\n            }\n        }\n    ]\n\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        执行身份证识别操作\n\n        Args:\n            message (Message): 包含待识别图片或图片下载URL的Message对象.\n                示例: Message(content={\"raw_image\": b\"...\"}) 或 Message(content={\"url\": \"https://image/download/url\"}).\n            timeout (float, 可选): HTTP请求的超时时间，默认为None.\n            retry (int, 可选): HTTP请求的重试次数，默认为0.\n\n        Returns:\n            Message: 包含身份证识别结果的Message对象.\n        \"\"\"\n        inp = MixCardOCRInMsg(**message.content)\n        request = MixCardOCRRequest()\n        if inp.url:\n            request.url = inp.url\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        request.detect_risk = \"false\"\n        request.detect_quality = \"false\"\n        request.detect_photo = \"false\"\n        request.detect_card = \"false\"\n        response = self._recognize(request, timeout, retry)\n        out = MixCardOCROutMsg()\n        for res in response.words_result:\n            card_type = res.card_info.card_type\n            if card_type != \"idcard_back\" and card_type != \"idcard_front\":\n                continue\n            ref = out.front\n            if card_type == \"idcard_back\":\n                ref = out.back\n            loc = res.card_info.card_location\n            ref.position = MixCardPosition(\n                left=loc.left, top=loc.top, width=loc.width, height=loc.height)\n            for key, val in res.card_result.items():\n                position = MixCardPosition(left=val.location.left, top=val.location.top, width=val.location.width,\n                                           height=val.location.height)\n                ref.fields.append(MixCardField(\n                    key=key, value=val.words, position=position))\n        out.direction = response.direction\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: MixCardOCRRequest, timeout: float = None, retry: int = 0, request_id: str = None) -> MixCardOCRResponse:\n        r\"\"\"调用底层身份证混贴识别\n                参数:\n                    request (obj: `GeneralOCRRequest`) : 通用文字识别输入参数\n\n                返回：\n                    response (obj: `GeneralOCRResponse`): 通用文字识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\n                \"request format error, one of image or url must be set\")\n        data = request.model_dump()\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/multi_idcard\")\n        response = self.http_client.session.post(\n            url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        response = MixCardOCRResponse(**data)\n        response.request_id = request_id\n        return response\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 通用文字识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    @components_run_stream_trace\n    def tool_eval(self,\n                  file_names: Optional[list] = [],\n                  **kwargs):\n        \"\"\"\n        对指定文件进行OCR识别。\n\n        Args:\n            file_names (Optional[List], optional): 要识别的文件名列表。 \n            **kwargs: 其他参数。\n\n        Returns:\n            ComponentOutput: 识别结果。\n\n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误，即文件URL不存在时抛出。\n\n        \"\"\"\n        result = {}\n\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n\n        sys_file_names = file_names\n        if not sys_file_names:\n            sys_file_names = kwargs.get(\"_sys_file_names\", [])\n\n        sys_file_urls = kwargs.get(\"_sys_file_urls\", {})\n\n        for file_name in sys_file_names:\n            if utils.is_url(file_name):\n                file_url = file_name\n            else:\n                file_url = sys_file_urls.get(file_name, None)\n            if file_url is None:\n                raise InvalidRequestArgumentError(\n                    f\"request format error, file {file_name} url does not exist\")\n\n            request = MixCardOCRRequest()\n            request.url = file_url\n            request.detect_risk = \"false\"\n            request.detect_quality = \"false\"\n            request.detect_photo = \"false\"\n            request.detect_card = \"false\"\n            response = self._recognize(request, request_id=traceid)\n            out = MixCardOCROutMsg()\n            for res in response.words_result:\n                card_type = res.card_info.card_type\n                if card_type != \"idcard_back\" and card_type != \"idcard_front\":\n                    continue\n                ref = out.front\n                if card_type == \"idcard_back\":\n                    ref = out.back\n                for key, val in res.card_result.items():\n                    ref.fields.append(MixCardField(\n                        key=key, value=val.words, position=None))\n            out.direction = response.direction\n            result[file_name] = out.model_dump()\n\n        result = json.dumps(result, ensure_ascii=False)\n        llm_result = self.create_output(\n            type=\"text\",\n            visible_scope=\"llm\",\n            text={\"info\": result},\n            name=\"llm_text\"\n        )\n        yield llm_result\n\n        user_result = self.create_output(\n            type=\"text\",\n            visible_scope=\"user\",\n            text=\"\",\n            name=\"user_text\"\n        )\n        yield user_result\n"
  },
  {
    "path": "python/core/components/v2/mix_card_ocr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"身份证混贴数据类\"\"\"\nimport proto\nfrom typing import List, Optional\nfrom pydantic import BaseModel, Field\n\n\nclass MixCardOCRRequest(BaseModel):\n    \"\"\" 身份证混贴识别\n    属性:\n        image (str):\n            可选。图像内容的base64编码\n        url (str):\n            可选，图像的URL地址，经过base64编码\n            图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素\n        detect_risk（str）:\n            是否检测风险（身份证复印件、临时身份证、身份证翻拍、修改过的身份证）类型，可选值是\"true\"或“false”\n        detect_quality（str）:\n            是否开启身份证质量类型(边框/四角不完整、头像或关键字段被遮挡/马赛克)检测功能,可选值是\"true\"或“false”\n        detect_photo（str）:\n            是否检测头像内容，默认不检测,可选值是\"true\"或“false”\n        detect_card（str）:\n            是否检测身份证并进行裁剪,\"true\"或“false”\n    \"\"\"\n    image: str = Field(default=\"\", description=\"图像内容的base64编码\")\n    url: str = Field(default=\"\", description=\"图像的URL地址，经过base64编码\")\n    detect_risk: str = Field(\n        default=\"\", description=\"是否检测风险（身份证复印件、临时身份证、身份证翻拍、修改过的身份证）类型，可选值是\\\"true\\\"或“false\\\"\")\n    detect_quality: str = Field(default=\"\", description=\"是否开启身份证质量类型(边框\"\n                                \"四角不完整、头像或关键字段被遮挡/马赛克)检测功能,可选值是\\\"true\\\"或“false\\\"\")\n    detect_photo: str = Field(\n        default=\"\", description=\"是否检测头像内容，默认不检测,可选值是\\\"true\\\"或“false\\\"\")\n    detect_card: str = Field(\n        default=\"\", description=\"是否检测身份证并进行裁剪,\\\"true\\\"或“false\\\"\")\n\n\nclass MixCardOCRLocation(BaseModel):\n    \"\"\" 位置信息.\n\n        属性:\n            left (int): 表示定位位置的长方形左上顶点的水平坐标\n            top (int): 表示定位位置的长方形左上顶点的垂直坐标\n            width (int): 表示定位位置的长方形的宽度\n            height (int): 表示定位位置的长方形的高度\n         \"\"\"\n    left: int = Field(default=0, description=\"表示定位位置的长方形左上顶点的水平坐标\")\n    top: int = Field(default=0, description=\"表示定位位置的长方形左上顶点的垂直坐标\")\n    width: int = Field(default=0, description=\"表示定位位置的长方形的宽度\")\n    height: int = Field(default=0, description=\"表示定位位置的长方形的高度\")\n\n\nclass MixCardOCRInfo(BaseModel):\n    \"\"\" 身份证混贴手识别结果\n\n        属性:\n            card_location (MixCardLocation): 身份证的位置信息（坐标0点为左上角）\n            card_type（str）: idcard_front(头像面)、idcard_back（国徽面）\n            image_status (str): normal-识别正常、 non_idcard-上传的图片中不包含身份证 、blurred-身份证模糊\n            other_type_card-其他类型证照 、over_exposure-身份证关键字段反光或过曝 、over_dark-身份证欠曝（亮度过低）\n            unknown-未知状态\n     \"\"\"\n    card_location: Optional[MixCardOCRLocation] = Field(\n        default=None, description=\"身份证的位置信息（坐标0点为左上角）\")\n    card_type: str = Field(\n        default=\"\", description=\"idcard_front(头像面)、idcard_back（国徽面）\")\n    image_status: str = Field(\n        default=\"\", description=\"normal-识别正常、 non_idcard-上传的图片中不包含身份证 、blurred-身份证模糊\")\n    direction: int = Field(default=0, description=\"身份证正反面，0-正面，1-背面\")\n    idcard_number_type: int = Field(\n        default=0, description=\"身份证号类型，0-普通身份证号码，1-港澳台身份证号码，2-护照号码\")\n\n\nclass MixCardOCRResult(BaseModel):\n    \"\"\"身份证混贴别结果\n\n        属性:\n            words (str): 文本信息\n            location（MixCardOCRLocation）: 位置信息\n    \"\"\"\n    words: str = Field(default=\"\", description=\"文本信息\")\n    location: Optional[MixCardOCRLocation] = Field(\n        default=None, description=\"位置信息\")\n\n\nclass MixOCRCardInfoResult(BaseModel):\n    \"\"\"身份证混贴信息\n\n        属性:\n            card_result (Map[str,MixCardOCRResult]): 身份证字段信息\n            card_info（MixCardOCRInfo）: 身份证信息\n    \"\"\"\n    card_result: Optional[dict[str, MixCardOCRResult]] = Field(\n        default=None, description=\"身份证字段信息\")\n    card_info: Optional[MixCardOCRInfo] = Field(\n        default=None, description=\"身份证信息\")\n\n\nclass MixCardOCRResponse(BaseModel):\n    \"\"\"身份证混贴识别结果\n\n        属性:\n            request_id(str): 请求ID\n            log_id (int): 用于问题跟踪的唯一日志ID\n            words_result (List[MixOCRCardInfoResult]): 识别结果列表\n            direction (int): 当detect_direction=true返回改字段，1（未定义）、\n            0（正向）、1（逆时针90度）、2（逆时针180度）、3（逆时针270度）\n            pdf_file_size (str): 输入PDF文件的总页数。当pdf_file参数有效时返回\n    \"\"\"\n    request_id: str = Field(default=\"\", description=\"请求ID\")\n    log_id: int = Field(default=0, description=\"用于问题跟踪的唯一日志ID\")\n    words_result: Optional[list[MixOCRCardInfoResult]\n                           ] = Field(default=None, description=\"识别结果列表\")\n    direction: int = Field(\n        default=0, description=\"当detect_direction=true返回改字段，1（未定义）、0（正向）、1（逆时针90度）、2（逆时针180度）、3（逆时针270度）\")\n\n\nclass MixCardOCRInMsg(BaseModel):\n    \"\"\" 手写体文字识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = b''  # 原始图片byte数组\n    url: str = \"\"  # 图片可下载链接\n\n\nclass MixCardPosition(BaseModel):\n    \"\"\"位置信息\n\n       属性：\n            left (int): 表示定位位置的长方形左上顶点的水平坐标\n            top (int): 表示定位位置的长方形左上顶点的垂直坐标\n            width (int): 表示定位位置的长方形的宽度\n            height (int): 表示定位位置的长方形的高度\n    \"\"\"\n\n    left: int\n    top: int\n    width: int\n    height: int\n\n\nclass MixCardField(BaseModel):\n    \"\"\" 字段信息\n\n        属性：\n            key（str): 字段名\n            value (str): 字段值\n            position(MixCardPosition): 字段位置信息\n      \"\"\"\n\n    key: str\n    value: str\n    position: Optional[MixCardPosition] = None\n\n\nclass MixCardContent(BaseModel):\n    \"\"\"正/反识别结果\n\n        属性：\n            fields(List[MixCardField]):字段列表\n            position(MixCardPosition): 正/反面在图像中的位置信息\n    \"\"\"\n    fields: List[MixCardField] = list()\n    position: MixCardPosition = None\n\n\nclass MixCardOCROutMsg(BaseModel):\n    \"\"\"身份证混贴识别结果\n\n        属性：\n            front（MixCardField）: 人像面信息\n            back(MixCardField): 国徽面信息\n            direction(int): 图像旋转角度，0（正向），- 1（逆时针90度），- 2（逆时针180度），- 3（逆时针270度）\n    \"\"\"\n    front: MixCardContent = MixCardContent()\n    back: MixCardContent = MixCardContent()\n    direction: int = 0\n"
  },
  {
    "path": "python/core/components/v2/object_recognize/__init__.py",
    "content": "# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/components/v2/object_recognize/component.py",
    "content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"object recognize component.\"\"\"\n\nimport base64\nimport json\nimport os\n\nfrom typing import Optional\n\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.components.object_recognize.model import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\nclass ObjectRecognition(Component):\n    r\"\"\"\n       提供通用物体及场景识别能力，即对于输入的一张图片（可正常解码，且长宽比适宜），输出图片中的多\n       个物体及场景标签。\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           object_recognition = appbuilder.ObjectRecognition()\n           with open(\"./object_recognition_test.jepg\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n           print(out.content)\n\n        \"\"\"\n    name = \"object_recognition\"\n    version = \"v1\"\n\n    manifests = [\n        {\n            \"name\": \"object_recognition\",\n            \"description\": \"提供通用物体及场景识别能力，即对于输入的一张图片，输出图片中的多个物体及场景标签。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url,根据该url能够获取图片\"\n                    },\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名,用于生成图片url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        通用物体识别\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作。\n                例如: Message(content={\"raw_image\": b\"...\"}) 或 Message(content={\"url\": \"https://image/download/url\"})。\n            timeout (float, optional): HTTP超时时间，默认为None。\n            retry (int, optional): HTTP重试次数，默认为0。\n        \n        Returns:\n            Message: 模型识别结果。\n                例如: Message(content={\"result\":[{\"keyword\":\"苹果\",\n                    \"score\":0.94553,\"root\":\"植物-蔷薇科\"},{\"keyword\":\"姬娜果\",\"score\":0.730442,\"root\":\"植物-其它\"},\n                    {\"keyword\":\"红富士\",\"score\":0.505194,\"root\":\"植物-其它\"}]})\n        \"\"\"\n        inp = ObjectRecognitionInMsg(**message.content)\n        req = ObjectRecognitionRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        result, _ = self._recognize(req, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = ObjectRecognitionOutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: ObjectRecognitionRequest, timeout: float = None,\n                  retry: int = 0, request_id: str = None) -> ObjectRecognitionResponse:\n        r\"\"\"调用底层接口进行通用物体与场景识别\n                   参数:\n                       request (obj: `ObjectRecognitionRequest`) : 通用物体与场景识别输入参数\n                   返回：\n                       response (obj: `ObjectRecognitionResponse`): 通用物体与场景识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n\n        data = ObjectRecognitionRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v2/advanced_general\")\n        response = self.http_client.session.post(url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id,data)\n        object_response = ObjectRecognitionResponse.from_json(payload=json.dumps(data))\n        object_response.request_id = request_id\n        return object_response, data\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 通用物体与场景识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    @components_run_stream_trace\n    def tool_eval(self,\n                  img_url: Optional[str] = '',\n                  img_name: Optional[str] = '',\n                  **kwargs):\n        \"\"\"\n        对给定的图片进行物体识别，并返回识别结果。\n        \n        Args:\n            img_url (str, optional): 图片的URL地址。默认为空字符串。\n            img_name (str, optional): 图片的名称。默认为空字符串。\n            **kwargs: 其他关键字参数。\n        \n        Returns:\n            Generator[Output, NoneType, NoneType]: 生成器，包含识别结果的输出对象。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误，例如文件名未设置或文件URL不存在，则引发此异常。\n        \n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        if not img_url:\n            file_urls = kwargs.get(\"_sys_file_urls\", {})\n            img_path = img_name\n            if not img_path:\n                raise InvalidRequestArgumentError(\"request format error, file name is not set\")\n            img_name = os.path.basename(img_path)\n            img_url = file_urls.get(img_name, None)\n            if not img_url:\n                raise InvalidRequestArgumentError(f\"request format error, file {img_name} url does not exist\")\n        score_threshold = kwargs.get(\"score_threshold\", 0.5)\n        req = ObjectRecognitionRequest(url=img_url)\n        result, raw_data = self._recognize(req, request_id=traceid)\n        result = proto.Message.to_dict(result)\n        results = []\n        for item in result[\"result\"]:\n            if item[\"score\"] < score_threshold and len(results) > 0:\n                continue\n            res = {\n                \"物体或场景名称\": item[\"keyword\"],\n                \"置信度\": item[\"score\"],\n                \"所属类别\": item[\"root\"],\n            }\n            results.append(res)\n        res = json.dumps(results, ensure_ascii=False, indent=4)\n        yield self.create_output(type=\"text\", text=res, raw_data=raw_data, visible_scope='llm')\n        yield self.create_output(type=\"text\", text=\"\", raw_data=raw_data, visible_scope='user')"
  },
  {
    "path": "python/core/components/v2/plant_recognize/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/v2/plant_recognize/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"植物识别组件\"\"\"\nimport base64\n\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.plant_recognize.model import *\nfrom typing import Generator, Union\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.plant_recognize.model import TOP_NUM, BAIKE_NUM\n\n\n\nclass PlantRecognition(Component):\n    r\"\"\"\n    植物识别组件，即对于输入的一张图片（可正常解码，且长宽比适宜），输出图片中的植物识别结果\n\n    Examples:\n\n    .. code-block:: python\n    \n        import os\n        import requests\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"GATEWAY_URL\"] = \"...\"\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/palnt_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2Faa2217067f78f0236c8262cdd89a4b4f4b2188d971ca547c53d01742af4a2cbe\"\n\n        # 从BOS存储读取样例文件\n        raw_image = requests.get(image_url).content\n        inp = appbuilder.Message(content={\"raw_image\": raw_image})\n        # inp = Message(content={\"url\": image_url})\n\n        # 运行植物识别\n        plant_recognize = appbuilder.PlantRecognition()\n        out = plant_recognize.run(inp)\n        # 打印识别结果\n        print(out.content)\n     \"\"\"\n    name = \"plant_rec\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"plant_rec\",\n            \"description\": \"用于识别图片中植物类别\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名\"\n                    },\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        输入图片并识别其中的植物\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作. 举例: Message(content={\"raw_image\": b\"...\"})\n            或 Message(content={\"url\": \"https://image/download/uel\"}).\n            timeout (float, optional): HTTP超时时间，默认为None\n            retry (int, optional): HTTP重试次数，默认为0\n        \n        Returns:\n            Message: 模型识别结果\n        \"\"\"\n        inp = PlantRecognitionInMsg(**message.content)\n        request = PlantRecognitionRequest()\n        if inp.url:\n            request.url = inp.url\n        if inp.raw_image:\n            request.image = base64.b64encode(inp.raw_image)\n        request.top_num = 5\n        request.baike_num = 0\n        response = self.__recognize(request, timeout, retry)\n        plant_score_list = []\n        [plant_score_list.append(PlantScore(name=plant.name, score=plant.score)) for plant in response.result]\n        out = PlantRecognitionOutMsg(plant_score_list=plant_score_list)\n        return Message(content=out.model_dump())\n\n    def __recognize(\n        self,\n        request: PlantRecognitionRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> PlantRecognitionResponse:\n        r\"\"\"调用底层接口植物识别\n\n            参数:\n                request (obj: `PlantRecognitionRequest`) : 植物识别输入参数\n\n            返回：\n                response (obj: `PlantRecognitionResponse`): 植物识别返回结果\n        \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\"request format error, one of image or url must be set\")\n        data = PlantRecognitionRequest.to_dict(request)\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/image-classify/v1/plant\")\n        response = self.http_client.session.post(url, data=data, timeout=timeout, headers=headers)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__.__check_service_error(request_id, data)\n        return PlantRecognitionResponse(data, request_id=request_id)\n\n    @components_run_stream_trace\n    def tool_eval(\n        self,\n        img_name: str = \"\",\n        img_url: str = \"\",\n        **kwargs,\n    ) -> Union[Generator[str, None, None], str]:\n        \"\"\"\n        用于工具的执行，通过调用底层接口进行植物识别\n        \n        Args:\n            name (str): 工具名\n            streaming (bool): 是否流式返回\n            origin_query (str): 用户原始query\n            **kwargs: 工具调用的额外关键字参数\n        \n        Returns:\n            Union[Generator[str, None, None], str]: 植物识别结果，包括识别出的植物类别和相应的置信度信息\n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        file_urls = kwargs.get(\"_sys_file_urls\", {})\n        rec_res = self._recognize_w_post_process(img_name, img_url, file_urls, request_id=traceid)\n\n        rec_res = self.create_output(\n            type=\"text\",\n            text=rec_res,\n        )\n        yield rec_res\n\n    def _recognize_w_post_process(self, img_name, img_url, file_urls, request_id=None):\n        r\"\"\"调底层接口对图片或图片url进行植物识别，并返回类别及其置信度\n            参数:\n               img_name (str): 图片文件名\n               img_url (str): 图片url\n               file_urls (dict): 文件名与对应文件url的映射\n            返回：\n               str: 植物识别结果，包括识别出的动物类别和相应的置信度信息\n         \"\"\"\n        req = PlantRecognitionRequest()\n        if img_name in file_urls:\n            req.url = file_urls[img_name]\n        if img_url:\n            if img_url in file_urls:\n                img_url = file_urls[img_url]\n            req.url = img_url\n        req.top_num = TOP_NUM\n        req.baike_num = BAIKE_NUM\n        result = self.__recognize(req, request_id=request_id)\n        result_dict = proto.Message.to_dict(result)\n        rec_res = \"模型识别结果为：\\n\"\n        for rec_info in result_dict['result']:\n            rec_res += \"类别: {} 置信度: {}\\n\".format(rec_info['name'], rec_info['score'])\n        return rec_res\n\n    @staticmethod\n    def __check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n\n            参数:\n                request (dict) : 地标识别body返回\n            返回：\n                无\n        \"\"\"\n\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n\n"
  },
  {
    "path": "python/core/components/v2/qrcode_ocr/__init__.py",
    "content": ""
  },
  {
    "path": "python/core/components/v2/qrcode_ocr/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"qrcode ocr component.\"\"\"\n\nimport base64\nimport json\nfrom typing import Optional\n\nfrom appbuilder.core import utils\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.v2.qrcode_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass QRcodeOCR(Component):\n    r\"\"\"\n       对图片中的二维码、条形码进行检测和识别，返回存储的文字信息及其位置信息。\n\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           qrcode_ocr = appbuilder.QRcodeOCR()\n           with open(\"./qrcode_ocr_test.png\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read(),\"location\": \"true\"}))\n           print(out.content)\n\n        \"\"\"\n\n    name = \"qrcode_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"qrcode_ocr\",\n            \"description\": \"需要对图片中的二维码、条形码进行检测和识别，返回存储的文字信息及其位置信息，使用该工具\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别文件的文件名\"\n                    },\n                    \"location\": {\n                        \"type\": \"string\",\n                        \"description\": \"是否输出二维码/条形码位置信息\"\n                    }\n                },\n                \"required\": [\"file_names\"]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, location: str = \"true\", timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        执行二维码识别操作。\n        \n        Args:\n            message (Message): 输入的图片或图片URL下载地址，用于执行识别操作。例如：\n                Message(content={\"raw_image\": b\"...\", \"location\": \"\"}) 或\n                Message(content={\"url\": \"https://image/download/url\"})。\n            location (str, 可选): 是否需要返回二维码位置信息，默认为 \"true\"。\n            timeout (float, 可选): HTTP请求的超时时间。\n            retry (int, 可选): HTTP请求的重试次数。\n        \n        Returns:\n            Message: 识别结果，包含识别到的二维码信息。例如：\n                Message(name=msg, content={'codes_result': [{'type': 'QR_CODE', 'text': ['http://weixin.qq.com/r/cS7M1PHE5qyZrbW393tj'],\n                    'location': {'top': 63, 'left': 950, 'width': 220, 'height': 211}}, ...]}, mtype=dict)\n        \n        Raises:\n            InvalidRequestArgumentError: 如果 location 参数非法，将抛出该异常。\n        \"\"\"\n        inp = QRcodeInMsg(**message.content)\n        req = QRcodeRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        if not isinstance(location, str) or location not in ('true', 'false'):\n            raise InvalidRequestArgumentError(\n                f\"illegal location, expected location is 'true' or 'false', got {location}\")\n        req.location = location\n        result = self._recognize(req, timeout, retry)\n        out = QRcodeOutMsg(**result.model_dump())\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: QRcodeRequest, timeout: float = None,\n                   retry: int = 0, request_id: str = None) -> QRcodeResponse:\n        r\"\"\"调用二维码识别底层能力\n                   参数:\n                       request (obj: `QRcodeRequest`) : 二维码识别输入参数\n                   返回：\n                       response (obj: `QRcodeResponse`): 二维码识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\n                \"request format error, one of image or url must be set\")\n\n        data = QRcodeRequest.model_dump(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        headers['Accept'] = 'application/json'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/qrcode\")\n        response = self.http_client.session.post(\n            url, headers=headers, data=data, timeout=timeout)\n        \n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        res = QRcodeResponse(**data)\n\n        res.request_id = request_id\n        return res\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 二维码识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    @components_run_stream_trace\n    def tool_eval(self, file_names:Optional[list]=[], location: Optional[str]=\"false\",  **kwargs):\n        \"\"\"\n        ToolEval方法，用于执行二维码识别操作。\n        \n        Args:\n            file_names (list, 可选): 待识别文件的文件名列表。\n            location (str, 可选): 是否需要返回二维码位置信息，默认为 \"false\"。\n            \n        Yields:\n            ComponentOutput: 识别结果，包含识别到的二维码信息。\n        \"\"\"\n        result = {}\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        # file_name\n        sys_file_names = file_names\n        if not sys_file_names:\n            sys_file_names = kwargs.get(\"_sys_file_names\", [])\n\n        sys_file_urls = kwargs.get(\"_sys_file_urls\", {})\n\n        for file_name in sys_file_names:\n            if utils.is_url(file_name):\n                file_url = file_name\n            else:\n                file_url = sys_file_urls.get(file_name, None)\n            if file_url is None:\n                raise InvalidRequestArgumentError(\n                    f\"request format error, file {file_name} url does not exist\")\n            req = QRcodeRequest()\n            req.url = file_url\n            if not isinstance(location, str) or location.lower() not in (\"true\", \"false\"):\n                raise InvalidRequestArgumentError(\n                    f\"illegal location, expected location is 'true' or 'false', got {location}\"\n                )\n            req.location = location.lower()\n            resp = self._recognize(req, request_id=traceid)\n            result[file_name] = [\n                item[\"text\"] for item in resp.model_dump().get(\"codes_result\", [])\n            ]\n\n        result = json.dumps(result, ensure_ascii=False)\n        \n        llm_result = self.create_output(\n            type=\"text\",\n            visible_scope=\"llm\",\n            text={\"info\": result},\n            name=\"llm_text\"\n        )\n        yield llm_result\n\n        user_result = self.create_output(\n            type=\"text\",\n            visible_scope=\"user\",\n            text={\"info\": \"\"},\n            name=\"user_text\"\n        )\n        yield user_result\n"
  },
  {
    "path": "python/core/components/v2/qrcode_ocr/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"qrcode ocr model.\"\"\"\nimport proto\n\nfrom typing import List, Optional\nfrom pydantic import BaseModel, Field\n\n\nclass QRcodeRequest(BaseModel):\n    \"\"\"二维码识别请求体参数.\n\n    Attributes:\n        image (str): 可选。图像内容的base64编码。\n        url (str): 可选。图像的URL地址，经过base64编码。\n                   图像大小必须小于4MB，图像的最短边长大于15像素，最长边长大于4096像素。\n        location (str): 可选。是否输出二维\n            - false：默认值，不返回位置信息；\n            - true：返回图中二维码/条形码的位置信息，包括上边距、左边距、宽度、高度\n        必须设置image或url属性之一，如果两者都设置了，将使用image属性。\n    \"\"\"\n    image: str = Field(default=\"\", description=\"可选。图像内容的base64编码\")\n    url: str = Field(\n        default=\"\", description=\n        \"可选。图像的URL地址，经过base64编码,图像大小必须小于4MB，\\n\"\n        \"图像的最短边长大于15像素，最长边长大于4096像素 \")\n    location: str = Field(default=\"false\", description=\"可选。是否输出二维码/条形码位置信息\")\n\nclass QRcodeLocation(BaseModel):\n    \"\"\"条形码/二维码位置信息。\n\n           属性:\n               top (int): 条形码/二维码的上边距。\n               left (int): 条形码/二维码的左边距。\n               width (int): 条形码/二维码的宽度。\n               height (int): 条形码/二维码的高度。\n       \"\"\"\n    top: int = Field(default=0, description=\"条形码/二维码的上边距\")\n    left: int = Field(default=0, description=\"条形码/二维码的左边距\")\n    width: int = Field(default=0, description=\"条形码/二维码的宽度\")\n    height: int = Field(default=0, description=\"条形码/二维码的高度\")\n\nclass QRcodeRes(BaseModel):\n    \"\"\"二维码识别结果。\n\n        属性:\n            type (str):\n                识别码类型条码类型包括：9种条形码（UPC_A、UPC_E、EAN_13、EAN_8、CODE_39、CODE_93、CODE_128、ITF、CODABAR），\n                4种二维码（QR_CODE、DATA_MATRIX、AZTEC、PDF_417）。\n                text (list[str]):\n                    条形码/二维码识别内容,目前仅支持输出中英文结果。\n                location (QRcodeLocation):\n                    条形码/二维码位置信息，包括上边距、左边距、宽度、高度，当请求参数 location = true 时返回\n    \"\"\"\n    type: str = Field(default=\"\", description=\"识别码类型条码类型包括：9种条形码（UPC_A、UPC_E、EAN_13\\n\"\n                                              \"、EAN_8、CODE_39、CODE_93、CODE_128、ITF、CODABAR），\\n\"\n                                              \"4种二维码（QR_CODE、DATA_MATRIX、AZTEC、PDF_417）。\")\n    text: list[str] = Field(default=[], description=\"条形码/二维码识别内容,目前仅支持输出中英文结果\")\n    location: Optional[QRcodeLocation] = Field(default=None, description=\"条形码/二维码位置信息，包括上边距、左边距、宽度、高度，当请求参数 location = true 时返回\")\n\n\n\nclass QRcodeResponse(BaseModel):\n    \"\"\"二维码识别响应消息。\n    Attributes:\n        request_id (str): 请求ID。\n        log_id (int): 用于问题识别的唯一日志ID。\n        codes_result_num (int):识别结果数，表示codes_result的元素个数\n        result (List[QRcodeRes]): 定位和识别结果数组。\n    \"\"\"\n    request_id: str = Field(default=\"\", description=\"请求ID\")\n    log_id: int = Field(default=0, description=\"用于问题识别的唯一日志ID\")\n    codes_result_num: int = Field(default=0, description=\"识别结果数，表示codes_result的元素个数\")\n    codes_result: Optional[list[QRcodeRes]] = Field(default=[], description=\"定位和识别结果数组\")\n\n\nclass QRcodeInMsg(BaseModel):\n    \"\"\" 二维码识别输入消息\n\n        属性:\n            raw_image(bytes): 图像原始内容\n            url(str): 图像下载链接\n    \"\"\"\n    raw_image: bytes = Field(default=b\"\", description=\"图像原始内容\")\n    url: str = Field(default=\"\", description=\"图像下载链接\")\n\n\nclass QRcodeOCRLocation(BaseModel):\n    \"\"\" 条形码/二维码位置信息\n\n        属性:\n            top(int): 条形码/二维码的上边距\n            left(int): 条形码/二维码的左边距\n            width(int): 条形码/二维码的宽度\n            height(int): 条形码/二维码的高度\n    \"\"\"\n    top: int = Field(default=0, description=\"条形码/二维码的上边距\")\n    left: int = Field(default=0, description=\"条形码/二维码的左边距\")\n    width: int = Field(default=0, description=\"条形码/二维码的宽度\")\n    height: int = Field(default=0, description=\"条形码/二维码的高度\")\n\n\nclass QRcodeOCRRes(BaseModel):\n    \"\"\" 条形码/二维码位置信息\n\n        属性:\n            type(int): 识别码类型条码类型\n            text(List[str]): 条形码/二维码识别内容\n            location(Object): 条形码/二维码位置信息\n    \"\"\"\n    type: str = Field(default=\"\", description=\"识别码类型条码类型\")\n    text: List[str] = Field(default=[], description=\"条形码/二维码识别内容\")\n    location: QRcodeOCRLocation = Field(default=QRcodeOCRLocation(), description=\"条形码/二维码位置信息\")\n\n\nclass QRcodeOutMsg(BaseModel):\n    r\"\"\"识别结果列表\"\"\"\n    codes_result: List[QRcodeOCRRes]  = Field(default=[], description=\"识别结果列表\")\n"
  },
  {
    "path": "python/core/components/v2/table_ocr/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License."
  },
  {
    "path": "python/core/components/v2/table_ocr/component.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"table ocr component.\"\"\"\n\nimport base64\nimport json\nimport logging\n\nfrom typing import Optional\n\nfrom appbuilder.core import utils\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.components.table_ocr.model import *\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.constants import COMPONENT_SUPPORT_FILE_NUMBER\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass TableOCR(Component):\n    r\"\"\"\n       支持识别图片中的表格内容，返回各表格的表头表尾内容、单元格文字内容及其行列位置信息，全面覆盖各类表格样式，包括常规有线表格、\n       无线表格、含合并单元格表格。同时，支持多表格内容识别。\n\n       Examples:\n\n       .. code-block:: python\n\n           import appbuilder\n           # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n           os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n           table_ocr = appbuilder.TableOCR()\n           with open(\"./table_ocr_test.png\", \"rb\") as f:\n               out = self.component.run(appbuilder.Message(content={\"raw_image\": f.read()}))\n           print(out.content)\n\n        \"\"\"\n\n    name = \"table_ocr\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"table_ocr\",\n            \"description\": \"需要识别图片中的表格内容，使用该工具, 但不支持html后缀文件的识别\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"file_names\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别图片的文件名\"\n                    },\n                    \"file_urls\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\"\n                        },\n                        \"description\": \"待识别图片的文件url\"\n                    }\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"file_names\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"file_urls\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        表格文字识别\n        \n        Args:\n            message (Message): 输入图片或图片url下载地址用于执行识别操作。\n                举例: Message(content={\"raw_image\": b\"...\"})\n                或 Message(content={\"url\": \"https://image/download/url\"})。\n            timeout (float, 可选): HTTP超时时间。\n            retry (int, 可选): HTTP重试次数。\n        \n        Returns:\n            message (Message): 识别结果。\n                举例: Message(name=msg, content={'tables_result': [{\n                'table_location': [{'x': 15, 'y': 15}, {'x': 371, 'y': 15}, {'x': 371, 'y': 98}, {'x': 15,\n                'y': 98}], 'header': [], 'body': [{'cell_location': [{'x': 15, 'y': 15}, {'x': 120, 'y': 15},\n                {'x': 120, 'y': 58}, {'x': 15, 'y': 58}], 'row_start': 0, 'row_end': 1, 'col_start': 0,\n                'col_end': 1, 'words': '参数'}, {'cell_location': [{'x': 120, 'y': 15}, {'x': 371, 'y': 15},\n                {'x': 371, 'y': 58}, {'x': 120, 'y': 58}], 'row_start': 0, 'row_end': 1, 'col_start': 1,\n                'col_end': 2, 'words': '值'}, {'cell_location': [{'x': 15, 'y': 58}, {'x': 120, 'y': 58},\n                {'x': 120, 'y': 98}, {'x': 15, 'y': 98}], 'row_start': 1, 'row_end': 2, 'col_start': 0,\n                'col_end': 1, 'words': 'Content-Type'}, {'cell_location': [{'x': 120, 'y': 58}, {'x': 371,\n                'y': 58}, {'x': 371, 'y': 98}, {'x': 120, 'y': 98}], 'row_start': 1, 'row_end': 2, 'col_start':\n                1, 'col_end': 2, 'words': 'application/x-www-form-urlencoded'}], 'footer': []}]}, mtype=dict)\n        \n        \"\"\"\n        inp = TableOCRInMsg(**message.content)\n        req = TableOCRRequest()\n        if inp.raw_image:\n            req.image = base64.b64encode(inp.raw_image)\n        if inp.url:\n            req.url = inp.url\n        req.cell_contents = \"false\"\n        result, _ = self._recognize(req, timeout, retry)\n        result_dict = proto.Message.to_dict(result)\n        out = TableOCROutMsg(**result_dict)\n        return Message(content=out.model_dump())\n\n    def _recognize(self, request: TableOCRRequest, timeout: float = None,\n                   retry: int = 0, request_id: str = None) -> TableOCRResponse:\n        r\"\"\"调用底层接口进行表格文字识别\n                   参数:\n                       request (obj: `TableOCRRequest`) : 表格文字识别输入参数\n                   返回：\n                       response (obj: `TableOCRResponse`): 表格文字识别返回结果\n               \"\"\"\n        if not request.image and not request.url:\n            raise ValueError(\n                \"request format error, one of image or url must be set\")\n\n        data = TableOCRRequest.to_dict(request)\n        if self.http_client.retry.total != retry:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/x-www-form-urlencoded'\n        url = self.http_client.service_url(\"/v1/bce/aip/ocr/v1/table\")\n        response = self.http_client.session.post(\n            url, headers=headers, data=data, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        res = TableOCRResponse.from_json(json.dumps(data))\n        res.request_id = request_id\n        return res, data\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"个性化服务response参数检查\n            参数:\n                request (dict) : 表格文字识别body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data.get(\"error_code\"),\n                service_err_message=data.get(\"error_msg\")\n            )\n\n    def get_table_markdown(self, tables_result):\n        \"\"\"\n        将表格识别结果转换为Markdown格式。\n        \n        Args:\n            tables_result (list): 表格识别结果列表，每个元素是一个包含表格数据的字典，其中包含表格体（body）等字段。\n        \n        Returns:\n            list: 包含Markdown格式表格的字符串列表。\n        \n        \"\"\"\n        markdowns = []\n        for table in tables_result:\n            cells = table[\"body\"]\n            max_row = max(cell['row_end'] for cell in cells)\n            max_col = max(cell['col_end'] for cell in cells)\n            # 初始化表格数组\n            table_arr = [[''] * max_col for _ in range(max_row)]\n            # 填充表格数据\n            for cell in cells:\n                row = cell['row_start']\n                col = cell['col_start']\n                table_arr[row][col] = cell['words']\n\n            markdown_table = \"\"\n            for row in table_arr:\n                markdown_table += \"| \" + \" | \".join(row) + \" |\\n\"\n            # 生成分隔行\n            separator = \"| \" + \" | \".join(['---'] * max_col) + \" |\\n\"\n            # 插入分隔行在表头下方\n            header, body = markdown_table.split('\\n', 1)\n            markdown_table = header + '\\n' + separator + body\n            markdowns.append(markdown_table)\n        return markdowns\n\n    @components_run_stream_trace\n    def tool_eval(self, \n                  file_names: Optional[List[str]] = [],\n                  file_urls: Optional[List[str]] = [],\n                  **kwargs):\n        \"\"\"\n        处理并评估传入的文件列表，并返回表格数据的Markdown格式表示。\n        \n        Args:\n            file_names (List[str]): 待处理的文件列表。\n            file_urls(List[str]): 待处理的文件url。\n            **kwargs: 其他可选参数。\n        \n        Returns:\n            Generator: 生成包含处理结果的生成器。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果请求格式错误，文件URL不存在。\n        \n        \"\"\"\n        if not file_names and not file_urls:\n            raise InvalidRequestArgumentError(\n                request_id=kwargs.get(\"_sys_traceid\", \"\"),\n                message=\"file_names and file_urls cannot both be empty\"\n            )\n        supported_file_type = [\"png\", \"jpg\", \"jpeg\", \"webp\", \"heic\", \"tif\", \"tiff\", \"dcm\", \"mha\", \"nii.gz\"]\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        sys_file_urls = kwargs.get(\"_sys_file_urls\", {})\n        available_file_urls = {}\n        unsupported_files = []\n        unknown_files = []\n        if file_names:\n            for file_name in file_names:\n                if len(available_file_urls) >= 10:\n                    break\n                file_type = file_name.split(\".\")[-1].lower()\n                if file_name in sys_file_urls:\n                    if file_type in supported_file_type:\n                        available_file_urls[file_name] = sys_file_urls.get(file_name, \"\")\n                    else:\n                        unsupported_files.append(file_name)\n                else:\n                    unknown_files.append(file_name)\n\n        if file_names:\n            for img_name in file_names:\n                if img_name in sys_file_urls:\n                    available_file_urls[img_name] = sys_file_urls.get(img_name, \"\")\n\n        for file_url in file_urls:\n            if len(available_file_urls) >= 10:\n                break\n            if file_url in list(sys_file_urls.values()):\n                continue\n            file_name = file_url.split(\"/\")[-1].split(\"?\")[0]\n            file_type = file_name.split(\".\")[-1].lower()\n            if file_type in supported_file_type:\n                available_file_urls[file_url] = file_url\n            else:\n                unsupported_files.append(file_url)\n            \n        for file_name, file_url in available_file_urls.items():\n            try:\n                req = TableOCRRequest()\n                req.url = file_url\n                req.cell_contents = \"false\"\n                resp, raw_data = self._recognize(req, request_id=traceid)\n                tables_result = proto.Message.to_dict(resp)[\"tables_result\"]\n                markdowns = self.get_table_markdown(tables_result)\n                rec_res = {\n                    file_name: markdowns\n                }\n                res = json.dumps(rec_res, ensure_ascii=False)\n                yield self.create_output(type=\"text\", text=res, raw_data=raw_data, visible_scope=\"llm\")\n                yield self.create_output(type=\"text\", text=\"\", raw_data=raw_data, visible_scope=\"user\")\n            except Exception as e:\n                logging.warning(f\"{file_name} ocr failed with exception: {e}\")\n                continue\n\n        for file in unsupported_files:\n            rec_res = {\n                file: \"不支持的文件类型，请确认是否为图片文件\"\n            }\n            res = json.dumps(rec_res, ensure_ascii=False)\n            yield self.create_output(type=\"text\", text=res, name=\"text_1\", visible_scope='llm')\n            yield self.create_output(type=\"text\", text=f\"\", name=\"text_2\", visible_scope='user')\n        \n        for file in unknown_files:\n            rec_res = {\n                file: \"无法获取url，请确认是否上传成功\"\n            }\n            res = json.dumps(rec_res, ensure_ascii=False)\n            yield self.create_output(type=\"text\", text=res, name=\"text_1\", visible_scope='llm')\n            yield self.create_output(type=\"text\", text=f\"\", name=\"text_2\", visible_scope='user')\n"
  },
  {
    "path": "python/core/components/v2/text_to_image/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/v2/text_to_image/component.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"Text2Image component.\n\"\"\"\nimport time\nimport math\n\nfrom typing import Generator, Union, Optional\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.utils import get_filename_from_url\nfrom appbuilder.core._exception import AppBuilderServerException, RiskInputException\nfrom appbuilder.core.components.text_to_image.model import Text2ImageSubmitRequest, Text2ImageQueryRequest, \\\n    Text2ImageQueryResponse, Text2ImageSubmitResponse, Text2ImageOutMessage\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass Text2Image(Component):\n    r\"\"\"\n    文生图组件，即对于输入的文本，输出生成的图片url。\n\n    Examples:\n    \n    .. code-block:: python\n        import appbuilder\n        text_to_image = appbuilder.Text2Image()\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        content_data = {\"prompt\": \"上海的经典风景\", \"width\": 1024, \"height\": 1024, \"image_num\": 1}\n        msg = appbuilder.Message(content_data)\n        out = text_to_image.run(inp)\n        # 打印生成结果\n        print(out.content) # eg: {\"img_urls\": [\"xxx\"]}\n    \"\"\"\n    name = \"text_to_image\"\n    version = \"v1\"\n    manifests = [\n        {\n            \"name\": \"text_to_image\",\n            \"description\": \"文生图，该组件只用于图片创作。当用户需要进行场景、人物、海报等内容的绘制时，使用该画图组件。如果用户需要生成图表（柱状图、折线图、雷达图等），则必须使用代码解释器。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"query\": {\n                        \"type\": \"string\",\n                        \"description\": \"文生图用的query。特别注意，这个字段只能由中文字符组成，不能含有任何英语描述。\"\n                    }\n                },\n                \"required\": [\n                    \"query\"\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(\n        self,\n        message: Message,\n        width: int = 1024,\n        height: int = 1024,\n        image_num: int = 1,\n        image: Optional[str] = None,\n        url: Optional[str] = None,\n        pdf_file: Optional[str] = None,\n        pdf_file_num: Optional[str] = None,\n        change_degree: Optional[int] = None,\n        text_content: Optional[str] = None,\n        task_time_out: Optional[int]= None,\n        text_check: Optional[int] = 1,\n        request_id: Optional[str] = None\n    ):\n        \"\"\"\n        执行文本到图像的生成任务。\n        \n        Args:\n            message (Message): 包含任务相关信息的消息对象。\n            width (int, optional): 生成的图像的宽度，默认为1024。\n            height (int, optional): 生成的图像的高度，默认为1024。\n            image_num (int, optional): 生成图像的数量，默认为1。\n            image (Optional[str], optional): 参考图像的路径或URL，默认为None。\n            url (Optional[str], optional): 参考图像的URL，默认为None。\n            pdf_file (Optional[str], optional): 参考PDF文件的路径，默认为None。\n            pdf_file_num (Optional[str], optional): 参考PDF文件中的页码范围，默认为None。\n            change_degree (Optional[int], optional): 图像变换的程度，默认为None。\n            text_content (Optional[str], optional): 需要转换的文本内容，默认为None。\n            task_time_out (Optional[int], optional): 任务超时时间，默认为None。\n            text_check (Optional[int], optional): 是否进行文本内容检查，默认为1。\n            request_id (Optional[str], optional): 请求的唯一标识，默认为None。\n        \n        Returns:\n            Message: 包含生成图像URL的消息对象。\n        \n        Raises:\n            HTTPError: 请求失败时抛出异常。\n        \n        \"\"\"\n        prompt=message.content[\"prompt\"]\n        img_urls, _ = self._recognize(\n                            prompt =  prompt,\n                            width = width,\n                            height = height,\n                            image_num = image_num,\n                            image = image,\n                            url = url,\n                            pdf_file = pdf_file,\n                            pdf_file_num = pdf_file_num,\n                            change_degree = change_degree,\n                            text_content = text_content,\n                            task_time_out = task_time_out,\n                            text_check = text_check,\n                            request_id = request_id\n                            )\n        if len(img_urls) == 0:\n            raise RiskInputException(f'prompt{prompt} 中可能存在敏感词')\n        out = Text2ImageOutMessage(img_urls=img_urls)\n        return Message(content=out.model_dump())\n\n    @components_run_stream_trace\n    def tool_eval(\n        self,\n        query: str,\n        **kwargs,\n    ) -> Union[Generator[str, None, None], str]:\n        \"\"\"\n        根据输入的查询内容生成输出。\n        \n        Args:\n            query (str): 查询内容。\n            **kwargs: 其他参数，包含：\n                _sys_traceid (str, optional): 系统追踪ID，默认为None。\n                width (int, optional): 图片宽度，默认为1024。\n                height (int, optional): 图片高度，默认为1024。\n                image_num (int, optional): 图片数量，默认为1。\n                image (Union[str, bytes], optional): 图片数据，默认为None。\n                url (str, optional): 图片URL，默认为None。\n                pdf_file (Union[str, bytes], optional): PDF文件数据，默认为None。\n                pdf_file_num (int, optional): PDF文件页数，默认为None。\n                change_degree (int, optional): 图片旋转角度，默认为None。\n                text_content (str, optional): 文本内容，默认为None。\n                task_time_out (int, optional): 任务超时时间，默认为None。\n                text_check (int, optional): 文本校验等级，默认为1。\n        \n        Returns:\n            Union[Generator[str, None, None], str]: 生成的输出。\n        \n        Raises:\n            RiskInputException: 当查询内容中存在敏感词时抛出。\n        \n        \"\"\"\n        request_id = kwargs.get(\"_sys_traceid\", None)\n        prompt = query\n        width = kwargs.get(\"width\", 1024)\n        height = kwargs.get(\"height\", 1024)\n        image_num = kwargs.get(\"image_num\", 1)\n        image = kwargs.get(\"image\", None)\n        url = kwargs.get(\"url\", None)\n        pdf_file = kwargs.get(\"pdf_file\", None)\n        pdf_file_num = kwargs.get(\"pdf_file_num\", None)\n        change_degree = kwargs.get(\"change_degree\", None)\n        text_content = kwargs.get(\"text_content\", None)\n        task_time_out = kwargs.get(\"task_time_out\", None)\n        text_check = kwargs.get(\"text_check\", 1)\n\n        img_urls, raw_data = self._recognize(\n                            prompt = prompt,\n                            width = width,\n                            height = height,\n                            image_num = image_num,\n                            image = image,\n                            url = url,\n                            pdf_file = pdf_file,\n                            pdf_file_num = pdf_file_num,\n                            change_degree = change_degree,\n                            text_content = text_content,\n                            task_time_out = task_time_out,\n                            text_check = text_check,\n                            request_id = request_id\n                            )\n\n        if len(img_urls) == 0:\n            raise RiskInputException(f'query：{query} 中可能存在敏感词')\n\n        for url_number in range(len(img_urls)):\n            yield self.create_output(\n                type='image', \n                text={\n                    'filename': get_filename_from_url(img_urls[url_number]),\n                    'url': img_urls[url_number],\n                },  \n                raw_data=raw_data,\n                visible_scope='all',\n                )\n\n    def _recognize(\n        self,\n        prompt: str,\n        width: int = 1024,\n        height: int = 1024,\n        image_num: int = 1,\n        image: Optional[str] = None,\n        url: Optional[str] = None,\n        pdf_file: Optional[str] = None,\n        pdf_file_num: Optional[str] = None,\n        change_degree: Optional[int] = None,\n        text_content: Optional[str] = None,\n        task_time_out: Optional[int]= None,\n        text_check: Optional[int] = 1,\n        request_id: Optional[str] = None\n        ):\n        \"\"\"\n        识别并生成图片。\n        \n        Args:\n            prompt (str): 提示文本，用于生成图片。\n            width (int, optional): 图片宽度，默认为1024。\n            height (int, optional): 图片高度，默认为1024。\n            image_num (int, optional): 生成图片的数量，默认为1。\n            image (str, optional): 传入图片路径，默认为None。\n            url (str, optional): 图片URL，默认为None。\n            pdf_file (str, optional): PDF文件路径，默认为None。\n            pdf_file_num (str, optional): 需要转换的PDF页数，默认为None。\n            change_degree (int, optional): 图片旋转角度，默认为None。\n            text_content (str, optional): 文本内容，默认为None。\n            task_time_out (int, optional): 任务超时时间，默认为None。\n            text_check (int, optional): 文本校验选项，默认为1。\n            request_id (str, optional): 请求ID，默认为None。\n        \n        Returns:\n            tuple: 包含生成的图片URL列表和返回数据的元组。\n        \n        \"\"\"\n        headers = self._http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        api_url = self._http_client.service_url(\"/v1/bce/aip/ernievilg/v1/txt2imgv2\")\n\n        req = Text2ImageSubmitRequest(\n            prompt=prompt,  \n            width=width,\n            height=height,\n            image_num=image_num,\n            image=image,\n            url=url,\n            pdf_file=pdf_file,\n            pdf_file_num=pdf_file_num,\n            change_degree=change_degree,\n            text_content=text_content,\n            task_time_out=task_time_out,\n            text_check=text_check\n        )\n        response = self.http_client.session.post(api_url, json=req.model_dump(), headers=headers, timeout=None)\n        self._http_client.check_response_header(response)\n        request_id = self._http_client.response_request_id(response)\n        data = response.json()\n        self.check_service_error(request_id, data)\n        resp= Text2ImageSubmitResponse(**data)\n\n        taskId = resp.data.task_id\n        if taskId is not None:\n            task_request_time = 1\n\n            while True:\n                request = Text2ImageQueryRequest(task_id=taskId)\n                text2ImageQueryResponse, data = self.queryText2ImageData(request, request_id=request_id)\n                if text2ImageQueryResponse.data.task_progress is not None:\n                    task_progress = float(text2ImageQueryResponse.data.task_progress)\n                    if math.isclose(1.0, task_progress, rel_tol=1e-9, abs_tol=0.0):\n                        break\n\n                    # NOTE(chengmo)：文生图组件的返回时间在10s以上，查询过于频繁会被限流，导致异常报错\n                    # 此处采用 yangyongzhen老师提供的方案，前三次查询间隔3s，后三次查询间隔逐渐增大\n                    if task_request_time <= 3:\n                        time.sleep(3)\n                    else:\n                        time.sleep(task_request_time)\n                    task_request_time += 1\n\n            img_urls = self.extract_img_urls(text2ImageQueryResponse)\n\n            return img_urls, data\n\n        else:\n            error_msg = resp.error_msg\n            if error_msg is not None:\n                error_detail = resp.error_detail\n                if error_detail is not None:\n                    error_msg = \"\"\n                    for error_item in error_detail:\n                        msg = error_item.msg\n                        words = error_item.words\n                        if msg:\n                            error_msg += msg\n                        if words:\n                            error_msg += \":\" + \",\".join(words) + \";\"\n            else:\n                error_msg = \"文生图组件执行失败\"\n            raise RiskInputException(error_msg)\n\n    def queryText2ImageData(\n        self,\n        request: Text2ImageQueryRequest,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ) -> Text2ImageQueryResponse:\n        \"\"\"\n        将文本查询请求转换为图像数据。\n        \n        Args:\n            request (Text2ImageQueryRequest): 输入请求，必填参数。\n            timeout (float, optional): 请求的超时时间，默认为None。\n            retry (int, optional): 请求的重试次数，默认为0。\n            request_id (str, optional): 请求的唯一标识符，默认为None。\n        \n        Returns:\n            Text2ImageQueryResponse: 接口返回的输出消息。\n        \"\"\"\n        url = self.http_client.service_url(\"/v1/bce/aip/ernievilg/v1/getImgv2\")\n        data = {\n            \"task_id\": request.task_id\n        }\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/json'\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        response = self.http_client.session.post(url, json=data, headers=headers, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__.check_service_error(request_id, data)\n        response = Text2ImageQueryResponse(**data)\n        return response, data\n\n    def extract_img_urls(self, response: Text2ImageQueryResponse):\n        \"\"\"\n        从作画生成的返回结果中提取图片url。\n        \n        Args:\n            response (obj:`Text2ImageQueryResponse`): 作画生成的返回结果。\n        \n        Returns:\n            List[str]: 从返回体中提取的图片url列表。\n        \n        \"\"\"\n        img_urls = []\n        if response and response.data and response.data.sub_task_result_list:\n            for sub_task_result in response.data.sub_task_result_list:\n                if sub_task_result and sub_task_result.final_image_list:\n                    for final_image in sub_task_result.final_image_list:\n                        if final_image and final_image.img_url:\n                            img_urls.append(final_image.img_url)\n\n        return img_urls\n\n    @staticmethod\n    def check_service_error(request_id: str, data: dict):\n        \"\"\"\n        检查服务错误信息\n        \n        Args:\n            request_id (str): 请求ID\n            data (dict): 响应数据\n        \n        Raises:\n            AppBuilderServerException: 如果响应数据中包含错误信息，则抛出异常\n        \n        Returns:\n            None\n        \"\"\"\n        if \"error_code\" in data or \"error_msg\" in data:\n            service_err_message = data.get(\"error_msg\")\n            service_err_code=data.get(\"error_code\")\n            if \"error_detail\" in data:\n                error_detail = data.get(\"error_detail\", [])\n                if error_detail:\n                    service_err_message += \": \"\n                for error_item in error_detail:\n                    msg = error_item.get(\"msg\", \"\")\n                    words = error_item.get(\"words\", [])\n                    if msg:\n                        service_err_message += msg\n                    if words:\n                        service_err_message += \":\" + \",\".join(words) + \";\"\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=service_err_code,\n                service_err_message=service_err_message\n            )"
  },
  {
    "path": "python/core/components/v2/translate/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/components/v2/translate/component.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# -*- coding: utf-8 -*-\n\"\"\"\n文本翻译-通用版组件\n\"\"\"\nimport json\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import AppBuilderServerException, InvalidRequestArgumentError\nfrom appbuilder.core.components.translate.model import *\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\n\n\nclass Translation(Component):\n    r\"\"\"\n    文本翻译组件,可支持中、英、日、韩等200+语言互译，100+语种自动检测。\n    支持语种列表可参照 https://ai.baidu.com/ai-doc/MT/4kqryjku9#%E8%AF%AD%E7%A7%8D%E5%88%97%E8%A1%A8\n\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        translate = appbuilder.Translation()\n        resp = translate(appbuilder.Message(\"你好\\n中国\"), to_lang=\"en\")\n        # 输出 {'from_lang':'zh', 'to_lang':'en', 'trans_result':[{'src':'你好','dst':'hello'},{'src':'中国','dst':'China'}]}\n        print(resp.content)\n    \"\"\"\n\n    name = \"translate\"\n    version = \"v1\"\n\n    manifests = [\n        {\n            \"name\": \"translation\",\n            \"description\": \"文本翻译通用版工具，会根据指定的目标语言对文本进行翻译，并返回翻译后的文本。\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"q\": {\n                        \"type\": \"string\",\n                        \"description\": \"需要翻译的源文本，文本翻译工具会将该文本翻译成对应的目标语言\"\n                    },\n                    \"to_lang\": {\n                        \"type\": \"string\",\n                        \"description\": \"翻译的目标语言类型，'en'表示翻译成英语, 'zh'表示翻译成中文，'yue'表示翻译成粤语，'wyw'表示翻译成文言文，\"\n                                       \"'jp'表示翻译成日语，'kor'表示翻译成韩语，'fra'表示翻译成法语，'spa'表示翻译成西班牙语，'th'表示翻译成泰语,\"\n                                       \"'ara'表示翻译成阿拉伯语，'ru'表示翻译成俄语，'pt'表示翻译成葡萄牙语，'de'表示翻译成德语，'it'表示翻译成意大利语，\"\n                                       \"'el'表示翻译成希腊语，'nl'表示翻译成荷兰语,'pl'表示翻译成波兰语,'bul'表示翻译成保加利亚语，'est'表示翻译成爱沙尼亚语，\"\n                                       \"'dan'表示翻译成丹麦语, 'fin'表示翻译成芬兰语，'cs'表示翻译成捷克语，'rom'表示翻译成罗马尼亚语，'slo'表示翻译成斯洛文尼亚语，\"\n                                       \"'swe'表示翻译成瑞典语，'hu'表示翻译成匈牙利语，'cht'表示翻译成繁体中文，'vie'表示翻译成越南语，默认为'en'\",\n                        \"enum\": [\"en\", \"zh\", \"yue\", \"wyw\", \"jp\", \"kor\", \"fra\", \"spa\", \"th\", \"ara\", \"ru\", \"pt\", \"de\",\n                                 \"it\", \"el\", \"nl\", \"pl\", \"bul\", \"est\", \"dan\", \"fin\", \"cs\", \"rom\", \"slo\", \"swe\", \"hu\",\n                                 \"cht\", \"vie\"]\n                    }\n                },\n                \"required\": [\n                    \"q\"\n                ]\n            }\n        }\n    ]\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, from_lang: str = \"auto\", to_lang: str = \"en\",\n            timeout: float = None, retry: int = 0) -> Message:\n        \"\"\"\n        根据提供的文本以及语种参数执行文本翻译\n\n        Args:\n            message (Message): 翻译文本。\n            from_lang (str): 翻译的源语言。默认为 \"auto\"。\n            to_lang (str): 翻译的目标语言。默认为 \"en\"。\n            timeout (float, optional): 翻译请求的超时时间。\n            retry (int, optional): 重试次数。\n\n        Returns:\n            Message: 返回的文本翻译结果。\n            例如，Message(content={'from_lang': 'zh', 'to_lang': 'en', 'trans_result': [{'src': '你好', 'dst': 'hello'}]})\n        \"\"\"\n        req = TranslateRequest()\n        req.q = message.content\n        req.from_lang = from_lang\n        req.to_lang = to_lang\n        result, data = self._translate(req, timeout=timeout, retry=retry)\n        result_dict = proto.Message.to_dict(result)\n\n        out = TranslateOutMsg(**result_dict[\"result\"])\n        return Message(content=out.model_dump())\n\n    def _translate(self, request: TranslateRequest, timeout: float = None,\n                   retry: int = 0, request_id: str = None) -> TranslateResponse:\n        \"\"\"\n        根据提供的 TranslateRequest 执行文本翻译。\n\n        Args:\n            request (TranslateRequest): 翻译请求参数。\n            timeout (float, optional): 请求超时时间。\n            retry (int, optional): 重试次数。\n\n        Returns:\n            TranslateResponse: 文本翻译结果的响应体。\n        \"\"\"\n        if not request.to_lang or not request.q:\n            raise ValueError(\"params `to_lang` and `q` must be set\")\n        if not request.from_lang:\n            request.from_lang = \"auto\"\n        request_data = TranslateRequest.to_json(request)\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        headers = self.http_client.auth_header(request_id)\n        headers['content-type'] = 'application/json;charset=utf-8'\n\n        url = self.http_client.service_url(\"/v1/bce/aip/mt/texttrans/v1\")\n\n        response = self.http_client.session.post(url, headers=headers, data=request_data, timeout=timeout)\n\n        self.http_client.check_response_header(response)\n        data = response.json()\n        request_id = self.http_client.response_request_id(response)\n        self.http_client.check_response_json(data)\n        if \"error_code\" in data and \"error_msg\" in data:\n            raise AppBuilderServerException(request_id=request_id, service_err_code=data[\"error_code\"],\n                                            service_err_message=data[\"error_msg\"])\n\n        json_str = json.dumps(data)\n        return TranslateResponse(TranslateResponse.from_json(json_str)), data\n\n    @components_run_stream_trace\n    def tool_eval(self, \n                  q: str,\n                  to_lang: str = \"en\",\n                  **kwargs):\n        \"\"\"\n        评估翻译工具的功能。\n        \n        Args:\n            q (str): 需要翻译的文本。\n            to_lang (str, optional): 目标语言，默认为 \"en\"。\n            **kwargs: 其他参数。\n        \n        Returns:\n            生成器，生成翻译结果。\n        \n        Raises:\n            InvalidRequestArgumentError: 如果参数 `q` 未设置，则引发此异常。\n        \n        \"\"\"\n        traceid = kwargs.get(\"_sys_traceid\", \"\")\n        text = q\n        req = TranslateRequest()\n        if not text:\n            raise InvalidRequestArgumentError(\"param `q` must be set\")\n        req.q = text\n        req.to_lang = to_lang\n        result_response, raw_data = self._translate(req, request_id=traceid)\n        results = proto.Message.to_dict(result_response)[\"result\"]\n        trans_result = results[\"trans_result\"]\n        res = {\n            \"原文本\": \"\\n \".join(item[\"src\"] for item in trans_result),\n            \"翻译结果\": \"\\n \".join(item[\"dst\"] for item in trans_result)\n        }\n        res = json.dumps(res, ensure_ascii=False, indent=4)\n        yield self.create_output(type=\"text\", text=res, raw_data=raw_data, visible_scope='llm')\n        yield self.create_output(type=\"text\", text=\"\", raw_data=raw_data, visible_scope='user')\n"
  },
  {
    "path": "python/core/components/v2/tree_mind/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n# 版权所有 (c) 2023 百度公司。保留所有权利。\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License."
  },
  {
    "path": "python/core/components/v2/tree_mind/component.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nr\"\"\"树图工具\"\"\"\n\nimport json\nfrom urllib.parse import urlparse, unquote\nfrom typing import Dict, List, Optional, Any\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import *\nfrom appbuilder.core.utils import get_filename_from_url\nfrom appbuilder.utils.trace.tracer_wrapper import components_run_trace, components_run_stream_trace\nfrom appbuilder.core.components.v2.tree_mind.model import TreeMindRequest, TreeMindResponse\n\n\nfrom appbuilder.core.component import Component\n\nclass TreeMind(Component):\n    r\"\"\"\n    树图工具，提供智能思维导图制作工具和丰富的模板，支持脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴、时间线等多种专业格式。\n    .. code-block:: python\n    \n        import os\n        import requests\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"GATEWAY_URL\"] = \"...\"\n        os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n        treemind = appbuilder.TreeMind()\n        resp = treemind.run(appbuilder.Message(\"生成一份年度总结的思维导图\"), to_lang=\"en\")\n        print(resp.content)\n        # 输出 {'from_lang':'zh', 'to_lang':'en', 'trans_result':[{'src':'你好','dst':'hello'},{'src':'中国','dst':'China'}]}\n    \"\"\"\n\n    name = \"tree_mind\"\n    version = \"v1\"\n    manifests = [\n            {\n                \"name\": \"tree_mind\",\n                \"description\": \"根据用户输入的信息，生成详细智能思维导图、脑图、逻辑图、树形图、鱼骨图、组织架构图、时间轴、时间线等多种专业格式思维导图\",\n                \"parameters\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                        \"query\": {\n                            \"type\": \"string\",\n                            \"description\": \"用户想要生成思维导图的内容\"\n                        },\n                    },\n                    \"required\": [\n                        \"query\"\n                    ]\n                }\n            }\n        ]\n\n    def _post(self, query, **kwargs):\n        if query is None or query == \"\":\n            raise InvalidRequestArgumentError(\"query is empty!\" )\n        request = TreeMindRequest(query_text=query)\n        headers = self.http_client.auth_header(kwargs.get(\"_sys_traceid\"))\n\n        headers['Content-Type'] = 'application/json'\n        tree_mind_url = self.http_client.service_url(\"/v1/component/component/query_mind_open\")\n\n        payload = TreeMindRequest.model_dump(request)\n\n        response = self.http_client.session.post(tree_mind_url, headers=headers, json=payload)\n        self.http_client.check_response_header(response)\n        data = response.text\n        treemind_dict = json.loads(data.split(\"data:\")[-1])\n        treemind_response = TreeMindResponse(**treemind_dict)\n        if treemind_response.errCode == '0':\n            jump_link = treemind_response.info.downloadInfo.fileInfo.jumpLink\n            img_link = treemind_response.info.downloadInfo.fileInfo.pic\n            return img_link, jump_link, None\n        else:\n            return None, None, treemind_response.errMsg\n\n    @components_run_stream_trace\n    def tool_eval(\n            self,\n            query,\n            **kwargs,\n    ):\n        r\"\"\"调用树图查询接口\n        Args:\n            query (string): 用户想要生成思维导图的内容\n        Returns:\n            dict: 返回生成的思维导图的图片链接和跳转链接\n        \"\"\"\n\n        img_link, jump_link, errMsg = self._post(query, **kwargs)\n        if not errMsg:\n            inst = \"你必须遵循指令，输出无需总结，只需要将，“原样输出内容”对应的内容原样输出即可：\\n\"\n            img_res = f\"原样输出内容：![图片url]({img_link})\\n\"\n            jump_res = f\"{query}的思维导图已经为您生成好了，您可以通过这个链接编辑：编辑链接：{jump_link}。\"\n            end_talk = \"如果您觉得这个思维导图还不够完美，或者您的想法需要更自由地表达，点击编辑按钮，对思维导图变形、变色、变内容、甚至可以添加新的元素，快来试试吧！\"\n            result = inst + img_res + jump_res + end_talk\n\n            llm_result = self.create_output(\n                type=\"text\",\n                text=result,\n                visible_scope='llm',\n                name=\"text\",\n                raw_data={\"event_status\": \"done\"}\n            )\n            yield llm_result\n            \n            img_link_result = self.create_output(\n                type=\"image\",\n                text={\n                    \"filename\": get_filename_from_url(img_link),\n                    \"url\": img_link\n                },\n                visible_scope='all',\n                name=\"img_link_url\",\n                raw_data={\"event_status\": \"done\"}\n            )\n            yield img_link_result\n\n            jump_link_result = self.create_output(\n                type=\"urls\",\n                text={\n                    \"url\": jump_link\n                },\n                visible_scope='all',\n                name=\"jump_link_url\"\n            )\n            yield jump_link_result\n        else:\n            result = \"生成失败，\" + errMsg\n            llm_result = self.create_output(\n                type=\"text\",\n                text=result,\n                visible_scope='llm',\n                name=\"text\",\n                raw_data={\"event_status\": \"done\"}\n            )\n            yield llm_result\n\n\n    @HTTPClient.check_param\n    @components_run_trace\n    def run(self, message: Message, **kwargs) -> Message:\n        \"\"\"运行组件\n        Args:\n            message (Message): 消息对象\n        Returns:\n            Message: 返回消息对象\n        \"\"\"\n        query = message.content\n        img_link, jump_link, errMsg = self._post(query, **kwargs)\n\n        if not errMsg:\n            result = {\n                \"result\": \"思维导图已经为您生成好了，您可以点击'img_link'对应的链接查看，如果您觉得这个思维导图还不够完美，或者您的想法需要更自由地表达，点击'edit_link'对应的链接，对思维导图变形、变色、变内容、甚至可以添加新的元素\",\n                \"img_link\": img_link,\n                \"edit_link\": jump_link\n            }\n            return Message(content=result)\n        else:\n            return Message(content={\"error\": errMsg})"
  },
  {
    "path": "python/core/components/v2/tree_mind/model.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"\n树图model\n\"\"\"\n\nimport proto\nfrom typing import List, Optional\nfrom pydantic import BaseModel\n\n\nclass TreeMindRequest(BaseModel):\n    query_text:str\n\nclass FileInfo(BaseModel):\n    jumpLink: str\n    jumpText: str\n    pic: str\n\nclass DownloadInfo(BaseModel):\n    fileInfo: FileInfo\n    endDesc: str\n\nclass Info(BaseModel):\n    downloadInfo: DownloadInfo\n\nclass TreeMindResponse(BaseModel):\n    errCode: str\n    errMsg: str\n    time_diff: Optional[int] = None\n    info: Optional[Info] = None\n\n\n\n"
  },
  {
    "path": "python/core/console/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .dataset import Dataset\nfrom .rag import RAG\nfrom .appbuilder_client import AppBuilderClient\nfrom .appbuilder_client import get_app_list, describe_apps, describe_app\nfrom .knowledge_base import KnowledgeBase\nfrom .knowledge_base import CustomProcessRule"
  },
  {
    "path": "python/core/console/ai_search/__init__.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .ai_search import AISearch\n"
  },
  {
    "path": "python/core/console/ai_search/ai_search.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport json\nfrom appbuilder.core.component import Message, Component\nfrom appbuilder.core.console.ai_search import data_class\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.core._exception import AppBuilderServerException\n\n\nclass AISearch(Component):\n\n    def __init__(self,  **kwargs):\n        super().__init__(**kwargs)\n\n    def run(self,\n            messages,\n            search_source=None,\n            resource_type_filter=None,\n            search_filter=None,\n            search_recency_filter=None,\n            search_domain_filter=None,\n            model=None,\n            instruction=None,\n            temperature=None,\n            top_p=None,\n            prompt_template=None,\n            search_mode=None,\n            enable_reasoning=None,\n            enable_deep_search=None,\n            additional_knowledge=None,\n            max_completion_tokens=None,\n            response_format=\"auto\",\n            enable_corner_markers=True,\n            enable_followup_queries=False,\n            stream=False,\n            safety_level=None,\n            max_refer_search_items=None,\n            config_id=None,\n            model_appid=None):\n        req = data_class.AISearchRequest(\n            messages=messages,\n            search_source=search_source,\n            resource_type_filter=resource_type_filter,\n            search_filter=search_filter,\n            search_recency_filter=search_recency_filter,\n            search_domain_filter=search_domain_filter,\n            model=model,\n            instruction=instruction,\n            temperature=temperature,\n            top_p=top_p,\n            prompt_template=prompt_template,\n            search_mode=search_mode,\n            enable_reasoning=enable_reasoning,\n            enable_deep_search=enable_deep_search,\n            additional_knowledge=additional_knowledge,\n            max_completion_tokens=max_completion_tokens,\n            response_format=response_format,\n            enable_corner_markers=enable_corner_markers,\n            enable_followup_queries=enable_followup_queries,\n            stream=stream,\n            safety_level=safety_level,\n            max_refer_search_items=max_refer_search_items,\n            config_id=config_id,\n            model_appid=model_appid\n        )\n        headers = self.http_client.auth_header_v2()\n        headers[\"Content-Type\"] = \"application/json\"\n        url = self.http_client.service_url_v2(\"/ai_search/chat/completions\")\n        response = self.http_client.session.post(\n            url, headers=headers, json=req.model_dump(exclude_none=True), timeout=None, stream=True\n        )\n        self.http_client.check_response_header(response)\n        request_id = self.http_client.response_request_id(response)\n        if stream:\n            client = SSEClient(response)\n            return Message(content=self._iterate_events(request_id, client.events()))\n        else:\n            data = response.json()\n            resp = data_class.AISearchResponse(**data)\n            return Message(content=resp)\n\n    @staticmethod\n    def _iterate_events(request_id, events):\n        for event in events:\n            try:\n                data = event.data\n                if len(data) == 0:\n                    data = event.raw\n                data = json.loads(data)\n            except json.JSONDecodeError as e:\n                raise AppBuilderServerException(\n                    request_id=request_id,\n                    message=\"json decoder failed {}\".format(str(e)),\n                )\n            resp = data_class.AISearchResponse(**data)\n            yield resp\n"
  },
  {
    "path": "python/core/console/ai_search/data_class.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom pydantic import BaseModel, Field\nfrom typing import Optional, Union, Annotated, List\nfrom typing_extensions import Literal, override, TypeAlias\n\n\nPropertyFormat = Literal[\"iso8601\", \"base64\", \"custom\"]\n\n\nclass PropertyInfo:\n    \"\"\"Metadata class to be used in Annotated types to provide information about a given type.\n\n    For example:\n\n    class MyParams(TypedDict):\n        account_holder_name: Annotated[str, PropertyInfo(alias='accountHolderName')]\n\n    This means that {'account_holder_name': 'Robert'} will be transformed to\n    {'accountHolderName': 'Robert'} before being sent to the API.\n    \"\"\"\n\n    alias: Optional[str]\n    format: Optional[PropertyFormat]\n    format_template: Optional[str]\n    discriminator: Optional[str]\n\n    def __init__(\n        self,\n        *,\n        alias: Optional[str] = None,\n        format: Optional[PropertyFormat] = None,\n        format_template: Optional[str] = None,\n        discriminator: Optional[str] = None,\n    ) -> None:\n        self.alias = alias\n        self.format = format\n        self.format_template = format_template\n        self.discriminator = discriminator\n\n    @override\n    def __repr__(self) -> str:\n        return (\n            f\"{self.__class__.__name__}(alias='{self.alias}', format={self.format}, \"\n            f\"format_template='{self.format_template}', discriminator='{self.discriminator}')\"\n        )\n\n\nclass ImageURL(BaseModel):\n    \"\"\"image url\"\"\"\n\n    url: str\n\n\nclass ImageURLContentBlock(BaseModel):\n    \"\"\"A block containing an image URL.\"\"\"\n\n    image_url: ImageURL\n    type: Literal[\"image_url\"] = \"image_url\"\n\n\nclass TextContentBlock(BaseModel):\n    \"\"\"A block containing plain text.\"\"\"\n\n    text: str = \"text\"\n    type: Literal[\"text\"]\n\n\nMessageContent: TypeAlias = Annotated[\n    Union[ImageURLContentBlock, TextContentBlock],\n    PropertyInfo(discriminator=\"type\"),\n]\n\n\nclass Message(BaseModel):\n    role: str = Field(..., description=\"角色设定，可选值：user：用户，assistant：模型\")\n    content: Union[str, list[MessageContent]] = Field(..., description=\"消息内容\")\n\n\nclass SearchResource(BaseModel):\n    \"\"\"搜索资源类型模型。\"\"\"\n\n    top_k: int = Field(..., description=\"要检索的搜索结果数量\")\n    type: str = Field(..., description=\"模态类型(网页/图片内容/视频)\")\n\n\nclass PageTime(BaseModel):\n    \"\"\"时间过滤\"\"\"\n\n    gth: Optional[str] = Field(\"\")\n    gt: Optional[str] = Field(\"\")\n    lth: Optional[str] = Field(\"\")\n    lt: Optional[str] = Field(\"\")\n\n\nclass Range(BaseModel):\n    \"\"\"区间查找\"\"\"\n\n    page_time: Optional[PageTime] = Field(\n        None, description=\"模态类型(网页/图片内容/视频)\"\n    )\n\n\nclass Match(BaseModel):\n    \"\"\"匹配查找\"\"\"\n\n    site: Optional[list[str]] = Field([], description=\"搜索站点\")\n\n\nclass SearchFilter(BaseModel):\n    \"\"\"搜索资源类型模型。\"\"\"\n\n    range: Optional[Range] = Field(None)\n    match: Optional[Match] = Field(None)\n\n\nclass KnowledgeData(BaseModel):\n    \"\"\"知识数据模型。\"\"\"\n\n    content: str = Field(..., description=\"知识内容\")\n    title: Optional[str] = Field(None, description=\"知识标题\")\n    url: Optional[str] = Field(None, description=\"知识链接\")\n    release_date: Optional[str] = Field(None, description=\"发布日期\")\n\n\nclass Knowledge(BaseModel):\n    \"\"\"自定义知识模型。\"\"\"\n\n    priority: Optional[int] = Field(\n        0, ge=-20, le=20, description=\"优先级范围[-20,20],默认值0, 值越小优先级越高\"\n    )\n    data_type: Optional[str] = Field(None, description=\"数据类型\")\n    id: Optional[int] = Field(None, description=\"知识ID\")\n    data: KnowledgeData = Field(..., description=\"详细知识内容\")\n\n\nclass AISearchRequest(BaseModel):\n    \"\"\"\n    请求参数：参考文档：https://cloud.baidu.com/doc/AppBuilder/s/amaxd2det\n    \"\"\"\n\n    messages: List[Message] = Field(\n        ...,\n        description=\"搜索输入；array的长度需要是奇数, role必须是user-assistant-user交替，以user开始以user结束;在百度搜索时，仅支持单论输入，若传入多轮输入，则以用户传入最后的content为输入查询。\",\n    )\n    search_source: Optional[str] = Field(\n        \"使用的搜索引擎版本；可选值：baidu_search_v1、baidu_search_v2。智能搜索生成时均可输入，兼容性考虑默认为baidu_search_v1。V2相比于V1：提升了性能表现，提升了数据内容的丰富度，更适用于结合大模型使用的场景，建议默认使用V2。\"\n    )\n    resource_type_filter: Optional[List[SearchResource]] = Field(\n        [SearchResource(type=\"web\", top_k=20)], description=\"单次搜索最大返回数量。\"\n    )\n    search_filter: Optional[SearchFilter] = Field(\n        None,\n        description=\"根据SearchFilter下的子条件做检索过滤，使用方式详见后文；仅search_source为baidu_search_v2时生效\",\n    )\n    search_recency_filter: Optional[str] = Field(\n        None,\n        description=\"根据网页发布时间进行筛选；week:最近7天/month:最近30天/semiyear:最近180天/year:最近一年\",\n    )\n    search_domain_filter: Optional[List[str]] = Field(\n        None,\n        description='支持设置基于站点的过滤条件，对搜索到的结果按指定站点进行筛选，仅返回来自所设站点的内容。例如：设置[\"baidu.com\"] ，在搜索到的结果中仅返回来自 baidu.com 的搜索结果。',\n    )\n    model: Optional[str] = Field(\n        None,\n        description=\"使用的模型名。不传模型名称时，搜索模式为百度搜索，传入模型名称时则为智能搜索生成\",\n    )\n    instruction: Optional[str] = Field(\n        \"\", description=\"人设指令，用于设定输出风格等。注意：字符长度需要小于等于2000\"\n    )\n    temperature: Optional[float] = Field(\n        1e-10,\n        gt=0,\n        le=1,\n        description=\"模型采样参数。较高的数值会使输出更加随机，而较低的数值会使其更加集中和确定。\",\n    )\n    top_p: Optional[float] = Field(\n        1e-10,\n        gt=0,\n        le=1,\n        description=\"模型采样参数。影响输出文本的多样性，取值越大，生成文本的多样性越强。\",\n    )\n    prompt_template: Optional[str] = Field(\n        None, description=\"面向高阶用户开放自定义prompt模版，普通用户不需要设置。\"\n    )\n    search_mode: Optional[str] = Field(\n        default=\"auto\",\n        description=\"搜索模式，默认auto，(auto:自动判断是否需要搜索/required:必须执行搜索/disabled:禁用搜索功能仅模型回答)\",\n    )\n    enable_reasoning: Optional[bool] = Field(\n        True,\n        description=\"是否开启深度思考，仅对DeepSeek-R1、文心X1模型生效，开启后，在总结前会进行模型推理和思考并输出相关内容。\",\n    )\n    enable_deep_search: Optional[bool] = Field(\n        False,\n        description=\"是否开启深搜索。深搜索会产生10次以内的智能搜索生成服务调用。\",\n    )\n    additional_knowledge: Optional[List[Knowledge]] = Field(\n        [],\n        description=\"调用方提供的定制化知识内容集合，与公开的联网搜索结果构成合集，注入到模型中进行问答总结。知识注入的条数和长度， 与模型有关，限制最大10条。可以配合 priority（优先级参数）使用，让本地搜索结果在能回答问题时优先被采用。当前支持三个优先级：-1、0、1，数值越小优先级越高，回答时会优先选择高优先级的内容。其中，百度搜索结果的优先级为 0。\",\n    )\n    max_completion_tokens: Optional[int] = Field(\n        2048, description=\"默认2048，不同模型支持的最大输出token不一样。\"\n    )\n    response_format: Optional[str] = Field(\n        \"auto\",\n        description=\"输出内容样式。默认值 auto。auto：智能判断是纯文本输出还是图文混排输出。text：文本输出。rich_text: 图文混排输出。如：在美食和旅游两个场景下，输出文本中嵌入markdown语法的图片内容。\",\n    )\n    enable_corner_markers: Optional[bool] = Field(\n        True,\n        description=\"用于设置在最后生成的总结内容正文时，是否返回角标用于标记模型输出内容的参考来源。true：开启角标，false：隐藏角标。\",\n    )\n    enable_followup_queries: Optional[bool] = Field(\n        False,\n        description=\"针对用户问题和大模型回答结果，给出推荐的追问。true: 开启追问。false：不开启追问。\",\n    )\n    stream: Optional[bool] = Field(False, description=\"是否使用流式响应\")\n    safety_level: Optional[str] = Field(\n        \"standard\", description=\"安全等级参数，standard-标准, strict-严格\"\n    )\n    max_refer_search_items: Optional[int] = Field(\n        100, description=\"调节用于模型问答总结的最大搜索条数，默认是全部搜索结果。\"\n    )\n    config_id: Optional[str] = Field(\n        None,\n        description=\"指定使用该配置id下的领域知识注入、网页黑名单、问答干预策略等配置\",\n    )\n    model_appid: Optional[str] = Field(None, description=\"模型调用appid\")\n\n\nclass Usage(BaseModel):\n    completion_tokens: Optional[int] = Field(None, description=\"完成的token数\")\n    prompt_tokens: Optional[int] = Field(None, description=\"提示的token数\")\n    total_tokens: Optional[int] = Field(None, description=\"总共的token数\")\n\n\nclass VideoDetail(BaseModel):\n    url: Optional[str] = Field(None, description=\"视频链接\")\n    height: Optional[str] = Field(None, description=\"视频高度\")\n    width: Optional[str] = Field(None, description=\"视频宽度\")\n    size: Optional[str] = Field(None, description=\"视频大小，单位Bytes\")\n    duration: Optional[str] = Field(None, description=\"视频长度，单位秒\")\n    hover_pic: Optional[str] = Field(None, description=\"视频封面图\")\n\n\nclass ImageDetail(BaseModel):\n    url: Optional[str] = Field(None, description=\"图片链接\")\n    height: Optional[str] = Field(None, description=\"图片高度\")\n    width: Optional[str] = Field(None, description=\"图片宽度\")\n\n\nclass Reference(BaseModel):\n    id: Optional[int] = Field(..., description=\"引用编号1、2、3\")\n    title: Optional[str] = Field(..., description=\"网页标题\")\n    url: Optional[str] = Field(..., description=\"网页地址\")\n    web_anchor: Optional[str] = Field(..., description=\"网站锚文本或网站标题\")\n\n    icon: Optional[str] = Field(None, description=\"站点图标\")\n    content: Optional[str] = Field(None, description=\"网站内容\")\n    date: Optional[str] = Field(None, description=\"网页日期\")\n    type: Optional[Literal[\"web\", \"image\", \"video\"]] = Field(\n        None, description=\"检索资源类型\"\n    )\n    image: Optional[ImageDetail] = Field(None, description=\"图片详情\")\n    video: Optional[VideoDetail] = Field(None, description=\"视频详情\")\n\n\nclass Delta(BaseModel):\n    \"\"\"\n    AI响应增量数据对象，用于流式传输场景\n    \"\"\"\n\n    content: str = Field(..., description=\"completion内容\")\n    role: Literal[\"assistant\"] = Field(..., description=\"固定值assistant\")\n    reasoning_content: Optional[str] = Field(\n        None,\n        description=\"仅适用于 deepseek思考系列模型。内容为 assistant 消息中在最终答案之前的推理内容\",\n    )\n\n\nclass ChoiceMessage(BaseModel):\n    \"\"\"\n    AI响应消息实体，封装完整对话交互数据\n    \"\"\"\n\n    content: str = Field(..., min_length=1, description=\"生成内容主体，要求非空字符串\")\n    role: Literal[\"assistant\"] = Field(\n        \"assistant\", description=\"消息角色标识符，固定为assistant\"\n    )\n    reasoning_content: Optional[str] = Field(\n        None, min_length=1, description=\"推理逻辑内容，仅deepseek思考系列模型返回时有效\"\n    )\n\n\nclass Choice(BaseModel):\n    \"\"\"\n    模型生成结果选择器，封装不同格式的响应输出\n    \"\"\"\n\n    index: int = Field(..., ge=0, description=\"生成结果在选择列表中的序号，从0开始计数\")\n    finish_reason: Optional[Literal[\"stop\", \"length\"]] = Field(\n        None, description=\"生成终止原因：stop=自然停止 | length=长度限制\"\n    )\n    message: Optional[ChoiceMessage] = Field(\n        None, description=\"完整响应消息（非流式模式使用）\"\n    )\n    delta: Optional[Delta] = Field(None, description=\"增量响应数据（流式模式使用）\")\n\n\nclass AISearchResponse(BaseModel):\n    request_id: str = Field(\n        ...,\n        description=\"请求request_id\",\n    )\n    is_safe: Optional[bool] = Field(\n        None,  description=\"query是否安全\")\n    choices: Optional[List[Choice]] = Field(\n        None, min_items=1, description=\"\t模型生成的 completion 的选择列表\"\n    )\n    code: Optional[str] = Field(None, description=\"错误代码，当发生异常时返回\")\n    message: Optional[str] = Field(\n        None, min_length=5, description=\"错误信息，当发生异常时返回\"\n    )\n    usage: Optional[\"Usage\"] = Field(None, description=\"token开销\")\n    references: Optional[List[Reference]] = Field(\n        None, description=\"模型回答参考引用内容\"\n    )\n    followup_queries: Optional[List[str]] = Field(\n        None,\n        description=\"追问问题\",\n    )\n"
  },
  {
    "path": "python/core/console/appbuilder_client/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .appbuilder_client import AppBuilderClient\nfrom .appbuilder_client import get_app_list, describe_apps, describe_app"
  },
  {
    "path": "python/core/console/appbuilder_client/appbuilder_client.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"AppBuilderClient组件\"\"\"\nimport os\nimport json\nfrom typing import Optional, Union, Any\nfrom appbuilder.core.component import Message, Component\nfrom appbuilder.core.manifest.models import Manifest\nfrom appbuilder.core.console.appbuilder_client import data_class\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.utils.func_utils import deprecated\nfrom appbuilder.utils.trace.tracer_wrapper import client_run_trace, client_tool_trace\n\n\n@deprecated(reason=\"use describe_apps instead\")\n@client_tool_trace\ndef get_app_list(\n    limit: int = 10,\n    after: str = \"\",\n    before: str = \"\",\n    secret_key: Optional[str] = None,\n    gateway_v2: Optional[str] = None,\n) -> list[data_class.AppOverview]:\n    \"\"\"\n    该接口查询用户下状态为已发布的应用列表\n\n    Args:\n        limit (int, optional): 返回结果的最大数量，默认值为10。\n        after (str, optional): 返回结果中第一个应用的游标值，用于分页查询。默认值为空字符串。\n        before (str, optional): 返回结果中最后一个应用的游标值，用于分页查询。默认值为空字符串。\n        secret_key (Optional[str], optional): 认证密钥。如果未指定，则使用默认的密钥。默认值为None。\n        gateway_v2 (Optional[str], optional): 网关地址。如果未指定，则使用默认的地址。默认值为None。\n\n    Returns:\n        list[data_class.AppOverview]: 应用列表。\n\n    \"\"\"\n\n    client = HTTPClient(secret_key=secret_key, gateway_v2=gateway_v2)\n    headers = client.auth_header_v2()\n    headers[\"Content-Type\"] = \"application/json\"\n    url = client.service_url_v2(\"/apps\")\n\n    request = data_class.AppBuilderClientAppListRequest(\n        limit=limit, after=after, before=before\n    )\n\n    response = client.session.get(\n        url=url,\n        headers=headers,\n        params=request.model_dump(),\n    )\n\n    client.check_console_response(response)\n    client.check_response_header(response)\n    data = response.json()\n    resp = data_class.AppBuilderClientAppListResponse(**data)\n    out = resp.data\n    return out\n\n\n@client_tool_trace\ndef describe_apps(\n    marker: Optional[str] = None,\n    maxKeys: int = 10,\n    secret_key: Optional[str] = None,\n    gateway: Optional[str] = None,\n) -> list[data_class.AppOverview]:\n    \"\"\"\n    该接口查询用户下状态为已发布的应用列表\n\n    Args:\n        maxKeys (int, optional): 返回结果的最大数量，默认值为10，最大为100。\n        marker (str, optional): 起始位置，即从哪个游标开始查询，默认值为空字符串。\n        secret_key (Optional[str], optional): 认证密钥。如果未指定，则使用默认的密钥。默认值为None。\n        gateway (Optional[str], optional): 网关地址。如果未指定，则使用默认的地址。默认值为None。\n\n    Returns:\n        DescribeAppsResponse: 应用列表。\n\n    \"\"\"\n    client = HTTPClient(secret_key=secret_key, gateway_v2=gateway)\n    headers = client.auth_header_v2()\n    headers[\"Content-Type\"] = \"application/json\"\n    url = client.service_url_v2(\"/app?Action=DescribeApps\")\n    request = data_class.DescribeAppsRequest(MaxKeys=maxKeys, Marker=marker)\n    response = client.session.post(\n        url=url,\n        json=request.model_dump(),\n        headers=headers,\n    )\n\n    client.check_response_header(response)\n    data = response.json()\n    resp = data_class.DescribeAppsResponse(**data)\n    out = resp.data\n    return out\n\n\n@client_tool_trace\ndef describe_app(\n    app_id: str,\n    secret_key: Optional[str] = None,\n    gateway: Optional[str] = None,\n) -> data_class.DescribeAppResponse:\n    \"\"\"\n    查询用户的应用详情。\n\n    Args:\n        app_id (str): 应用ID。\n\n    Returns:\n        DescribeAppResponse: 应用详情。\n\n    \"\"\"\n    client = HTTPClient(secret_key=secret_key, gateway_v2=gateway)\n    headers = client.auth_header_v2()\n    headers[\"Content-Type\"] = \"application/json\"\n    url = client.service_url_v2(\"/app?Action=DescribeApp\")\n    request = data_class.DescribeAppRequest(id=app_id)\n    response = client.session.post(\n        url=url,\n        json=request.model_dump(),\n        headers=headers,\n    )\n\n    client.check_response_header(response)\n    data = response.json()\n    resp = data_class.DescribeAppResponse(**data)\n    return resp\n\n\n@client_tool_trace\ndef get_all_apps():\n    \"\"\"\n    获取所有应用列表。\n\n    Args:\n        无参数。\n\n    Returns:\n        List[App]: 包含所有应用信息的列表，每个元素为一个App对象，\n        其中App对象的结构取决于get_app_list函数的返回结果。\n\n    \"\"\"\n    app_list = []\n    response_per_time = describe_apps(maxKeys=100)\n    list_len_per_time = len(response_per_time)\n    if list_len_per_time != 0:\n        app_list.extend(response_per_time)\n    while list_len_per_time == 100:\n        after_id = response_per_time[-1].id\n        response_per_time = describe_apps(marker=after_id, maxKeys=100)\n        list_len_per_time = len(response_per_time)\n        if list_len_per_time != 0:\n            app_list.extend(response_per_time)\n\n    return app_list\n\n\nclass AppBuilderClient(Component):\n    r\"\"\"\n    AppBuilderClient 组件支持调用在[百度智能云千帆AppBuilder](https://cloud.baidu.com/product/AppBuilder)平台上\n    构建并发布的智能体应用，具体包括创建会话、上传文档、运行对话等。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        # 可在Console 应用页面获取\n        app_id = \"app_id\"\n        client = appbuilder.AppBuilderClient(\"app_id\")\n        conversation_id = client.create_conversation()\n        file_id = client.upload_local_file(conversation_id, \"/path/to/file\")\n        message = client.run(conversation_id, \"今天你好吗？\")\n        # 打印对话结果\n        print(message.content)\n\n    \"\"\"\n\n    def __init__(self, app_id: str, **kwargs):\n        r\"\"\"初始化智能体应用\n\n        Args:\n            app_id (str: 必须) : 应用唯一ID\n\n        Returns:\n            response (obj: `AppBuilderClient`): 智能体实例\n        \"\"\"\n        super().__init__(**kwargs)\n        if (not isinstance(app_id, str)) or len(app_id) == 0:\n            raise ValueError(\n                \"app_id must be a str, and length is bigger then zero,\"\n                \"please go to official website which is 'https://cloud.baidu.com/product/AppBuilder'\"\n                \" to get a valid app_id after your application is published.\"\n            )\n        self.app_id = app_id\n        self._mcp_context = None\n\n    @client_tool_trace\n    def create_conversation(self) -> str:\n        r\"\"\"创建会话并返回会话ID\n\n        会话ID在服务端用于上下文管理、绑定会话文档等，如需开始新的会话，请创建并使用新的会话ID\n\n        Args:\n            无\n\n        Returns:\n            response (str): 唯一会话ID\n\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"Content-Type\"] = \"application/json\"\n        url = self.http_client.service_url_v2(\"/app/conversation\")\n        response = self.http_client.session.post(\n            url, headers=headers, json={\"app_id\": self.app_id}, timeout=None\n        )\n        self.http_client.check_response_header(response)\n        data = response.json()\n        resp = data_class.CreateConversationResponse(**data)\n        return resp.conversation_id\n\n    @client_tool_trace\n    def upload_local_file(self, conversation_id, local_file_path: str) -> str:\n        r\"\"\"上传文件并将文件与会话ID进行绑定，后续可使用该文件ID进行对话，目前仅支持上传xlsx、jsonl、pdf、png等文件格式\n\n        该接口用于在对话中上传文件供大模型处理，文件的有效期为7天并且不超过对话的有效期。一次只能上传一个文件。\n\n        Args:\n            conversation_id (str) : 会话ID\n            local_file_path (str) : 本地文件路径\n\n        Returns:\n            response (str): 唯一文件ID\n        \"\"\"\n        return self.upload_file(conversation_id, local_file_path=local_file_path)\n\n    @client_tool_trace\n    def upload_file(self, conversation_id, local_file_path: str=None, file_url: str=None) -> str:\n        r\"\"\"上传文件并将文件与会话ID进行绑定，后续可使用该文件ID进行对话，目前仅支持上传xlsx、jsonl、pdf、png等文件格式\n\n        该接口用于在对话中上传文件供大模型处理，文件的有效期为7天并且不超过对话的有效期。一次只能上传一个文件。\n\n        Args:\n            conversation_id (str) : 会话ID\n            local_file_path (str) : 本地文件路径\n            file_url(str): 待上传的文件url\n\n        Returns:\n            response (str): 唯一文件ID\n\n        \"\"\"\n        if len(conversation_id) == 0:\n            raise ValueError(\n                \"conversation_id is empty, you can run self.create_conversation to get a conversation_id\"\n            )\n\n        if local_file_path is None and file_url is None:\n            raise ValueError(\n                \"local_file_path and file_url cannot both be empty\"\n            )\n        if local_file_path:\n            filepath = os.path.abspath(local_file_path)\n            if not os.path.exists(filepath):\n                raise FileNotFoundError(f\"{filepath} and {file_url} does not exist\")\n\n        headers = self.http_client.auth_header_v2()\n        url = self.http_client.service_url_v2(\"/app/conversation/file/upload\")\n\n        multipart_form_data = {\n            \"app_id\": (None, self.app_id),\n            \"conversation_id\": (None, conversation_id),\n        }\n        if local_file_path:\n            multipart_form_data[\"file\"] = (\n                os.path.basename(local_file_path),\n                open(local_file_path, \"rb\"),\n            )\n        else:\n            multipart_form_data[\"file_url\"] = (None, file_url)\n        response = self.http_client.session.post(\n            url, files=multipart_form_data, headers=headers\n        )\n\n        self.http_client.check_response_header(response)\n        data = response.json()\n        resp = data_class.FileUploadResponse(**data)\n        return resp.id\n\n    @client_run_trace\n    def run(\n        self,\n        conversation_id: str,\n        query: str = \"\",\n        file_ids: list = [],\n        stream: bool = False,\n        tools: list[Union[data_class.Tool, Manifest, data_class.MCPTool]] = None,\n        tool_outputs: list[data_class.ToolOutput] = None,\n        tool_choice: data_class.ToolChoice = None,\n        end_user_id: str = None,\n        action: data_class.Action = None,\n        mcp_authorization: list[dict] = None,\n        parameters: dict[str, Any] = None,\n        custom_metadata: data_class.CustomMetadata = None,\n        **kwargs,\n    ) -> Message:\n        r\"\"\"运行智能体应用\n\n        Args:\n            query (str): query内容\n            conversation_id (str): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\n            file_ids (list[str]): 文件ID列表\n            stream (bool): 为True时，流式返回，需要将message.content.answer拼接起来才是完整的回答；为False时，对应非流式返回\n            tools (list[Union[data_class.Tool,Manifest,data_class.MCPTool]]): 一个Tool或Manifest组成的列表，其中每个Tool(Manifest)对应一个工具的配置, 默认为None\n            tool_outputs (list[data_class.ToolOutput]): 工具输出列表，格式为list[ToolOutput], ToolOutputd内容为本地的工具执行结果，以自然语言/json dump str描述，默认为None\n            tool_choice (data_class.ToolChoice): 控制大模型使用组件的方式，默认为None\n            end_user_id (str): 用户ID，用于区分不同用户\n            action (data_class.Action): 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n            mcp_authorization (list[dict]): mcp鉴权配置:目前仅适配百度网盘\n            parameters: 用户在工作流Agent中自定义添加的参数，对应画布中开始节点用户新增的参数。例如：\n                            \"parameters\":\n                            {\"custom_variable1\": \"abc\",\n                            \"custom_variable2\": 1.23\n                            }\n            custom_metadata: 自定义角色指令，适用于自主规划agent\n            kwargs: 其他参数\n\n        Returns:\n            message (Message): 对话结果，一个Message对象，使用message.content获取内容。\n        \"\"\"\n\n        if len(conversation_id) == 0:\n            raise ValueError(\n                \"conversation_id is empty, you can run self.create_conversation to get a conversation_id\"\n            )\n\n        if query == \"\" and (tool_outputs is None or len(tool_outputs) == 0):\n            raise ValueError(\n                \"AppBuilderClient Run API: query and tool_outputs cannot both be empty\"\n            )\n\n        if not tool_outputs:\n            self._mcp_context = None\n        formatted_tools = []\n        if tools:\n            formatted_tools = [\n                data_class.ToAppBuilderTool(tool)[0] for tool in tools\n            ]\n            for tool in tools:\n                _, is_mcp_tool = data_class.ToAppBuilderTool(tool)\n                if is_mcp_tool and self._mcp_context is None:\n                    self._mcp_context = \"client\"\n\n        req = data_class.AppBuilderClientRequest(\n            app_id=self.app_id,\n            conversation_id=conversation_id,\n            query=query,\n            stream=True if stream else False,\n            file_ids=file_ids,\n            tools=formatted_tools,\n            tool_outputs=tool_outputs,\n            tool_choice=tool_choice,\n            end_user_id=end_user_id,\n            action=action,\n            mcp_authorization=mcp_authorization,\n            parameters=parameters,\n            custom_metadata=custom_metadata,\n        )\n\n        headers = self.http_client.auth_header_v2(mcp_context=self._mcp_context)\n        headers[\"Content-Type\"] = \"application/json\"\n        url = self.http_client.service_url_v2(\"/app/conversation/runs\")\n        response = self.http_client.session.post(\n            url, headers=headers, json=req.model_dump(), timeout=None, stream=True\n        )\n        self.http_client.check_response_header(response)\n        request_id = self.http_client.response_request_id(response)\n        if stream:\n            client = SSEClient(response)\n            return Message(content=self._iterate_events(request_id, client.events()))\n        else:\n            data = response.json()\n            resp = data_class.AppBuilderClientResponse(**data)\n            out = data_class.AppBuilderClientAnswer()\n            AppBuilderClient._transform(resp, out)\n            return Message(content=out)\n\n    @client_run_trace\n    def feedback(\n        self,\n        conversation_id: str,\n        message_id: str,\n        type: str,\n        flag: list[str] = None,\n        reason: str = None,\n    ):\n        r\"\"\"点踩点赞\n\n        Args:\n            conversation_id (str): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\n            message_id (str): 消息ID，对话后会返回消息ID\n            type (str): 点赞点踩枚举值 cancel：取消评论, upvote：点赞, downvote：点踩\n            flag(list[str]): 点踩原因枚举值:答非所问、内容缺失、没有帮助、逻辑问题、偏见歧视、事实错误\n            reason(str): 对于点赞点踩额外补充的原因。\n\n        Returns:\n            request_id (str): 请求ID\n        \"\"\"\n\n        if len(conversation_id) == 0:\n            raise ValueError(\n                \"conversation_id is empty, you can run self.create_conversation to get a conversation_id\"\n            )\n\n        req = data_class.FeedbackRequest(\n            app_id=self.app_id,\n            conversation_id=conversation_id,\n            message_id=message_id,\n            type=type,\n            flag=flag,\n            reason=reason,\n        )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"Content-Type\"] = \"application/json\"\n        url = self.http_client.service_url_v2(\"/app/conversation/feedback\")\n        response = self.http_client.session.post(\n            url, headers=headers, json=req.model_dump(exclude_none=True), timeout=None, stream=True\n        )\n        self.http_client.check_response_header(response)\n        request_id = self.http_client.response_request_id(response)\n        return request_id\n\n    def run_with_handler(\n        self,\n        conversation_id: str,\n        query: str = \"\",\n        file_ids: list = [],\n        tools: list[Union[data_class.Tool, Manifest, data_class.MCPTool]] = None,\n        stream: bool = False,\n        event_handler=None,\n        action=None,\n        **kwargs,\n    ):\n        r\"\"\"运行智能体应用，并通过事件处理器处理事件\n\n        Args:\n            conversation_id (str): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\n            query (str): 查询字符串\n            file_ids (list): 文件ID列表\n            tools(list[Union[data_class.Tool,Manifest,data_class.MCPTool]], 可选): 一个Tool或Manifest组成的列表，其中每个Tool(Manifest)对应一个工具的配置, 默认为None\n            stream (bool): 是否流式响应\n            event_handler (EventHandler): 事件处理器\n            action(data_class.Action) 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n            kwargs: 其他参数\n\n        Returns:\n            EventHandler: 事件处理器\n        \"\"\"\n        assert event_handler is not None, \"event_handler is None\"\n        event_handler.init(\n            appbuilder_client=self,\n            conversation_id=conversation_id,\n            query=query,\n            file_ids=file_ids,\n            tools=tools,\n            stream=stream,\n            action=action,\n            **kwargs,\n        )\n\n        return event_handler\n\n    def run_multiple_dialog_with_handler(\n        self,\n        conversation_id: str,\n        queries: iter = None,\n        file_ids: iter = None,\n        tools: iter = None,\n        stream: bool = False,\n        event_handler=None,\n        actions: iter = None,\n        **kwargs,\n    ):\n        r\"\"\"运行智能体应用，并通过事件处理器处理事件\n\n        Args:\n            conversation_id (str): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\n            queries (iter): 查询字符串可迭代对象\n            file_ids (iter): 文件ID列表\n            tools(iter, 可选): 一个Tool或Manifest组成的列表，其中每个Tool(Manifest)对应一个工具的配置, 默认为None\n            stream (bool): 是否流式响应\n            event_handler (EventHandler): 事件处理器\n            actions(iter) 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n\n            kwargs: 其他参数\n        Returns:\n            EventHandler: 事件处理器\n        \"\"\"\n        assert event_handler is not None, \"event_handler is None\"\n        assert queries is not None, \"queries is None\"\n\n        iter_queries = iter(queries)\n        iter_file_ids = iter(file_ids) if file_ids else iter([])\n        iter_tools = iter(tools) if tools else iter([])\n        iter_actions = iter(actions) if actions else iter([])\n\n        for index, query in enumerate(iter_queries):\n            file_id = next(iter_file_ids, None)\n            tool = next(iter_tools, None)\n            action = next(iter_actions, None)\n\n            if index == 0:\n                yield from self.run_with_handler(\n                    conversation_id=conversation_id,\n                    query=query,\n                    file_ids=file_id,\n                    tools=tool,\n                    stream=stream,\n                    event_handler=event_handler,\n                    action=action,\n                    **kwargs,\n                )\n            else:\n                event_handler.new_dialog(\n                    query=query,\n                    file_ids=file_id,\n                    tools=tool,\n                    stream=stream,\n                    action=action,\n                )\n                yield event_handler\n        event_handler.reset_state()\n\n    @staticmethod\n    def _iterate_events(request_id, events):\n        for event in events:\n            try:\n                data = event.data\n                if len(data) == 0:\n                    data = event.raw\n                data = json.loads(data)\n            except json.JSONDecodeError as e:\n                raise AppBuilderServerException(\n                    request_id=request_id,\n                    message=\"json decoder failed {}\".format(str(e)),\n                )\n            inp = data_class.AppBuilderClientResponse(**data)\n            out = data_class.AppBuilderClientAnswer()\n            AppBuilderClient._transform(inp, out)\n            yield out\n\n    @staticmethod\n    def _check_console_response(request_id: str, data):\n        if data[\"code\"] != 0:\n            raise AppBuilderServerException(\n                request_id=request_id,\n                service_err_code=data[\"code\"],\n                service_err_message=\"message={}\".format(data[\"message\"]),\n            )\n\n    @staticmethod\n    def _transform(\n        inp: data_class.AppBuilderClientResponse, out: data_class.AppBuilderClientAnswer\n    ):\n        out.answer = inp.answer\n        out.message_id = inp.message_id\n        for ev in inp.content:\n            event = data_class.Event(\n                code=ev.event_code,\n                message=ev.event_message,\n                status=ev.event_status,\n                event_type=ev.event_type,\n                content_type=ev.content_type,\n                detail=ev.outputs,\n                usage=ev.usage,\n                tool_calls=ev.tool_calls,\n            )\n            out.events.append(event)\n\n\nclass AgentBuilder(AppBuilderClient):\n    r\"\"\"AgentBuilder是继承自AppBuilderClient的一个子类，用于构建和管理智能体应用。\n    支持调用在[百度智能云千帆AppBuilder](https://cloud.baidu.com/product/AppBuilder)平台上\n    构建并发布的智能体应用，具体包括创建会话、上传文档、运行对话等。\n\n    Examples:\n\n    .. code-block:: python\n\n        import appbuilder\n        # 请前往千帆AppBuilder官网创建密钥，流程详见：https://cloud.baidu.com/doc/AppBuilder/s/Olq6grrt6#1%E3%80%81%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        # 可在Console 应用页面获取\n        app_id = \"app_id\"\n        client = appbuilder.AppBuilderClient(\"app_id\")\n        conversation_id = client.create_conversation()\n        file_id = client.upload_local_file(conversation_id, \"/path/to/file\")\n        message = client.run(conversation_id, \"今天你好吗？\")\n        # 打印对话结果\n        print(message.content)\n\n    \"\"\"\n\n    @deprecated(\n        reason=\"AgentBuilder is deprecated, please use AppBuilderClient instead\",\n        version=\"1.0.0\",\n    )\n    def __init__(self, app_id: str):\n        r\"\"\"初始化方法，用于创建一个新的实例对象。\n\n        为了避免歧义，减少用户上手门槛，推荐使用该类调用AgentBuilder\n\n        Args:\n            app_id (str): 应用程序的唯一标识符。\n\n        Returns:\n            response (obj: `AgentBuilder`): 智能体实例\n\n        \"\"\"\n        super().__init__(app_id)\n"
  },
  {
    "path": "python/core/console/appbuilder_client/async_appbuilder_client.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport json\nimport os\nfrom typing import Union, Any\nfrom aiohttp import FormData\nfrom appbuilder.core.component import Message, Component\nfrom appbuilder.core.console.appbuilder_client import data_class, AppBuilderClient\nfrom appbuilder.core.manifest.models import Manifest\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.utils.sse_util import AsyncSSEClient\n\n\nclass AsyncAppBuilderClient(Component):\n    def __init__(self, app_id, **kwargs):\n        super().__init__(is_aysnc=True, **kwargs)\n        if (not isinstance(app_id, str)) or len(app_id) == 0:\n            raise ValueError(\n                \"app_id must be a str, and length is bigger then zero,\"\n                \"please go to official website which is 'https://cloud.baidu.com/product/AppBuilder'\"\n                \" to get a valid app_id after your application is published.\"\n            )\n        self.app_id = app_id\n        self._mcp_context = None\n\n    async def create_conversation(self) -> str:\n        r\"\"\"异步创建会话并返回会话ID\n\n        会话ID在服务端用于上下文管理、绑定会话文档等，如需开始新的会话，请创建并使用新的会话ID\n\n        Args:\n            无\n\n        Returns:\n            response (str): 唯一会话ID\n\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"Content-Type\"] = \"application/json\"\n        url = self.http_client.service_url_v2(\"/app/conversation\")\n        response = await self.http_client.session.post(\n            url, headers=headers, json={\"app_id\": self.app_id}, timeout=None\n        )\n        await self.http_client.check_response_header(response)\n        data = await response.json()\n        resp = data_class.CreateConversationResponse(**data)\n        return resp.conversation_id\n\n    async def run(\n        self,\n        conversation_id: str,\n        query: str = \"\",\n        file_ids: list = [],\n        stream: bool = False,\n        tools: list[Union[data_class.Tool, Manifest, data_class.MCPTool]] = None,\n        tool_outputs: list[data_class.ToolOutput] = None,\n        tool_choice: data_class.ToolChoice = None,\n        end_user_id: str = None,\n        action: data_class.Action = None,\n        mcp_authorization: list[dict] = None,\n        parameters: dict[str, Any] = None,\n        custom_metadata: data_class.CustomMetadata = None,\n        **kwargs,\n    ) -> Message:\n        r\"\"\"异步运行智能体应用\n\n        Args:\n            query (str): query内容\n            conversation_id (str): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\n            file_ids (list[str]): 文件ID列表\n            stream (bool): 为True时，流式返回，需要将message.content.answer拼接起来才是完整的回答；为False时，对应非流式返回\n            tools (list[Union[data_class.Tool,Manifest,data_class.MCPTool]]): 一个Tool或Manifest组成的列表，其中每个Tool(Manifest)对应一个工具的配置, 默认为None\n            tool_outputs (list[data_class.ToolOutput]): 工具输出列表，格式为list[ToolOutput], ToolOutputd内容为本地的工具执行结果，以自然语言/json dump str描述，默认为None\n            tool_choice (data_class.ToolChoice): 控制大模型使用组件的方式，默认为None\n            end_user_id (str): 用户ID，用于区分不同用户\n            action (data_class.Action): 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n            mcp_authorization (list[dict]): mcp鉴权配置:目前仅适配百度网盘\n            parameters: 用户在工作流Agent中自定义添加的参数，对应画布中开始节点用户新增的参数。例如：\n                            \"parameters\":\n                            {\"custom_variable1\": \"abc\",\n                            \"custom_variable2\": 1.23\n                            }\n            custom_metadata: 自定义角色指令，适用于自主规划agent\n            kwargs: 其他参数\n\n        Returns:\n            message (Message): 对话结果，一个Message对象，使用message.content获取内容。\n        \"\"\"\n\n        if len(conversation_id) == 0:\n            raise ValueError(\n                \"conversation_id is empty, you can run self.create_conversation to get a conversation_id\"\n            )\n\n        if query == \"\" and (tool_outputs is None or len(tool_outputs) == 0):\n            raise ValueError(\n                \"AppBuilderClient Run API: query and tool_outputs cannot both be empty\"\n            )\n\n        if not tool_outputs:\n            self._mcp_context = None\n        formatted_tools = []\n        if tools:\n            formatted_tools = [\n                data_class.ToAppBuilderTool(tool)[0] for tool in tools\n            ]\n            for tool in tools:\n                _, is_mcp_tool = data_class.ToAppBuilderTool(tool)\n                if is_mcp_tool and self._mcp_context is None:\n                    self._mcp_context = \"client\"\n\n        req = data_class.AppBuilderClientRequest(\n            app_id=self.app_id,\n            conversation_id=conversation_id,\n            query=query,\n            stream=True if stream else False,\n            file_ids=file_ids,\n            tools=formatted_tools,\n            tool_outputs=tool_outputs,\n            tool_choice=tool_choice,\n            end_user_id=end_user_id,\n            action=action,\n            mcp_authorization=mcp_authorization,\n            parameters=parameters,\n            custom_metadata=custom_metadata,\n        )\n\n        headers = self.http_client.auth_header_v2(mcp_context=self._mcp_context)\n        headers[\"Content-Type\"] = \"application/json\"\n        url = self.http_client.service_url_v2(\"/app/conversation/runs\")\n        response = await self.http_client.session.post(\n            url, headers=headers, json=req.model_dump(), timeout=None\n        )\n        await self.http_client.check_response_header(response)\n        request_id = await self.http_client.response_request_id(response)\n        if stream:\n            client = AsyncSSEClient(response)\n            return Message(content=self._iterate_events(request_id, client.events()))\n        else:\n            data = await response.json()\n            resp = data_class.AppBuilderClientResponse(**data)\n            out = data_class.AppBuilderClientAnswer()\n            AppBuilderClient._transform(resp, out)\n            return Message(content=out)\n\n    async def upload_local_file(self, conversation_id, local_file_path: str) -> str:\n        r\"\"\"异步运行，上传文件并将文件与会话ID进行绑定，后续可使用该文件ID进行对话，目前仅支持上传xlsx、jsonl、pdf、png等文件格式\n\n        该接口用于在对话中上传文件供大模型处理，文件的有效期为7天并且不超过对话的有效期。一次只能上传一个文件。\n\n        Args:\n            conversation_id (str) : 会话ID\n            local_file_path (str) : 本地文件路径\n\n        Returns:\n            response (str): 唯一文件ID\n\n        \"\"\"\n        return await self.upload_local_file(conversation_id, local_file_path)\n\n    async def upload_file(self, conversation_id, local_file_path: str=None, file_url: str=None) -> str:\n        r\"\"\"异步运行，上传文件并将文件与会话ID进行绑定，后续可使用该文件ID进行对话，目前仅支持上传xlsx、jsonl、pdf、png等文件格式\n\n        该接口用于在对话中上传文件供大模型处理，文件的有效期为7天并且不超过对话的有效期。一次只能上传一个文件。\n\n        Args:\n            conversation_id (str) : 会话ID\n            local_file_path (str) : 本地文件路径\n            file_url (str) : 文件URL\n\n        Returns:\n            response (str): 唯一文件ID\n\n        \"\"\"\n        if len(conversation_id) == 0:\n            raise ValueError(\n                \"conversation_id is empty, you can run self.create_conversation to get a conversation_id\"\n            )\n\n        if local_file_path is None and file_url is None:\n            raise ValueError(\n                \"local_file_path and file_url cannot both be empty\"\n            )\n        if local_file_path:\n            filepath = os.path.abspath(local_file_path)\n            if not os.path.exists(filepath):\n                raise FileNotFoundError(f\"{filepath} does not exist\")\n\n        multipart_form_data = FormData()\n        multipart_form_data.add_field(name=\"app_id\", value=self.app_id)\n        multipart_form_data.add_field(\n            name=\"conversation_id\", value=conversation_id)\n\n        if local_file_path:\n            multipart_form_data.add_field(\n                name=\"file\",\n                value=open(local_file_path, \"rb\"),\n                filename=os.path.basename(local_file_path),\n            )\n        else:\n            multipart_form_data.add_field(name=\"file_url\", value=file_url)\n\n        headers = self.http_client.auth_header_v2()\n        url = self.http_client.service_url_v2(\"/app/conversation/file/upload\")\n        response = await self.http_client.session.post(\n            url, data=multipart_form_data, headers=headers\n        )\n        await self.http_client.check_response_header(response)\n        data = await response.json()\n        resp = data_class.FileUploadResponse(**data)\n        return resp.id\n\n    async def run_with_handler(\n        self,\n        conversation_id: str,\n        query: str = \"\",\n        file_ids: list = [],\n        tools: list[Union[data_class.Tool, Manifest, data_class.MCPTool]] = None,\n        stream: bool = False,\n        event_handler=None,\n        action=None,\n        **kwargs,\n    ):\n        r\"\"\"异步运行智能体应用，并通过事件处理器处理事件\n\n        Args:\n            conversation_id (str): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\n            query (str): 查询字符串\n            file_ids (list): 文件ID列表\n            tools(list[Union[data_class.Tool,Manifest,data_class.MCPTool]], 可选): 一个Tool或Manifest组成的列表，其中每个Tool(Manifest)对应一个工具的配置, 默认为None\n            stream (bool): 是否流式响应\n            event_handler (EventHandler): 事件处理器\n            action(data_class.Action) 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n            kwargs: 其他参数\n\n        Returns:\n            EventHandler: 事件处理器\n        \"\"\"\n        assert event_handler is not None, \"event_handler is None\"\n        await event_handler.init(\n            appbuilder_client=self,\n            conversation_id=conversation_id,\n            query=query,\n            file_ids=file_ids,\n            tools=tools,\n            stream=stream,\n            action=action,\n            **kwargs,\n        )\n\n        return event_handler\n\n    async def run_multiple_dialog_with_handler(\n        self,\n        conversation_id: str,\n        queries: iter = None,\n        file_ids: iter = None,\n        tools: iter = None,\n        stream: bool = False,\n        event_handler=None,\n        actions: iter = None,\n        **kwargs,\n    ):\n        r\"\"\"运行智能体应用，并通过事件处理器处理事件\n\n        Args:\n            conversation_id (str): 唯一会话ID，如需开始新的会话，请使用self.create_conversation创建新的会话\n            queries (iter): 查询字符串可迭代对象\n            file_ids (iter): 文件ID列表\n            tools(iter, 可选): 一个Tool或Manifest组成的列表，其中每个Tool(Manifest)对应一个工具的配置, 默认为None\n            stream (bool): 是否流式响应\n            event_handler (EventHandler): 事件处理器\n            actions(iter) 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n\n            kwargs: 其他参数\n        Returns:\n            EventHandler: 事件处理器\n        \"\"\"\n        assert event_handler is not None, \"event_handler is None\"\n        assert queries is not None, \"queries is None\"\n\n        iter_queries = iter(queries)\n        iter_file_ids = iter(file_ids) if file_ids else iter([])\n        iter_tools = iter(tools) if tools else iter([])\n        iter_actions = iter(actions) if actions else iter([])\n\n        for index, query in enumerate(iter_queries):\n            file_id = next(iter_file_ids, None)\n            tool = next(iter_tools, None)\n            action = next(iter_actions, None)\n\n            if index == 0:\n                await event_handler.init(\n                    appbuilder_client=self,\n                    conversation_id=conversation_id,\n                    query=query,\n                    file_ids=file_id,\n                    tools=tool,\n                    stream=stream,\n                    action=action,\n                    **kwargs,\n                )\n                yield event_handler\n            else:\n                await event_handler.new_dialog(\n                    query=query,\n                    file_ids=file_id,\n                    tools=tool,\n                    stream=stream,\n                    action=action,\n                )\n                yield event_handler\n        await event_handler.reset_state()\n\n    @staticmethod\n    async def _iterate_events(request_id, events):\n        async for event in events:\n            try:\n                data = event.data\n                if len(data) == 0:\n                    data = event.raw\n                data = json.loads(data)\n            except json.JSONDecodeError as e:\n                raise AppBuilderServerException(\n                    request_id=request_id,\n                    message=\"json decoder failed {}\".format(str(e)),\n                )\n            inp = data_class.AppBuilderClientResponse(**data)\n            out = data_class.AppBuilderClientAnswer()\n            AppBuilderClient._transform(inp, out)\n            yield out\n"
  },
  {
    "path": "python/core/console/appbuilder_client/async_event_handler.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder.core.console.appbuilder_client import data_class\n\n\nclass AppBuilderClientRunContext(object):\n    def __init__(self) -> None:\n        \"\"\"\n        初始化方法。\n\n        Args:\n            无参数。\n\n        Returns:\n            None\n\n        \"\"\"\n        self.current_event = None\n        self.current_tool_calls = None\n        self.current_status = None\n        self.need_tool_submit = False\n        self.is_complete = False\n        self.current_thought = \"\"\n\n\nclass AsyncAppBuilderEventHandler(object):\n    def __init__(self):\n        pass\n\n    async def init(\n        self,\n        appbuilder_client,\n        conversation_id,\n        query,\n        file_ids=None,\n        tools=None,\n        stream: bool = False,\n        event_handler=None,\n        action=None,\n        **kwargs,\n    ):\n        \"\"\"\n        初始化类实例并设置相关参数。\n\n        Args:\n            appbuilder_client (object): AppBuilder客户端实例对象。\n            conversation_id (str): 对话ID。\n            query (str): 用户输入的查询语句。\n            file_ids (list, optional): 文件ID列表，默认为None。\n            tools (list, optional): 工具列表，默认为None。\n            stream (bool, optional): 是否使用流式处理，默认为False。\n            event_handler (callable, optional): 事件处理函数，默认为None。\n            action (object, optional): 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n            **kwargs: 其他可选参数。\n\n        Returns:\n            None\n\n        \"\"\"\n        self._appbuilder_client = appbuilder_client\n        self._conversation_id = conversation_id\n        self._query = query\n        self._file_ids = file_ids\n        self._tools = tools\n        self._stream = stream\n        self._event_handler = event_handler\n        self._kwargs = kwargs\n        self._is_complete = False\n        self._need_tool_call = False\n        self._last_tool_output = None\n        self._action = action\n\n        self._iterator = (\n            self.__run_process__()\n            if not self._stream\n            else self.__stream_run_process__()\n        )\n\n    async def __run_process__(self):\n        \"\"\"\n        运行进程，并在每次执行后生成结果。\n\n        Args:\n            无参数。\n\n        Returns:\n            Generator: 生成器，每次执行后返回结果。\n\n        \"\"\"\n        while not self._is_complete:\n            if not self._need_tool_call:\n                res = await self._run()\n                await self.__event_process__(res)\n            else:\n                res = await self._submit_tool_output()\n                await self.__event_process__(res)\n            yield res\n        if self._need_tool_call and self._is_complete:\n            await self.reset_state()\n\n    async def __async_run_process__(self):\n        \"\"\"\n        异步运行进程，并在每次执行后生成结果\n\n        Args:\n            无参数\n\n        Returns:\n            Generator[Any, None, None]: 生成器，每次执行后返回结果\n        \"\"\"\n        while not self._is_complete:\n            if not self._need_tool_call:\n                res = await self._run()\n                await self.__event_process__(res)\n            else:\n                res = await self._submit_tool_output()\n                await self.__event_process__(res)\n            yield res\n        if self._need_tool_call and self._is_complete:\n            await self.reset_state()\n\n    async def __event_process__(self, run_response):\n        \"\"\"\n        处理事件响应。\n\n        Args:\n            run_response (RunResponse): 运行时响应对象。\n\n        Returns:\n            None\n\n        Raises:\n            ValueError: 当解析事件时发生异常或工具输出为空时。\n        \"\"\"\n        try:\n            event = run_response.content.events[-1]\n        except Exception as e:\n            raise ValueError(e)\n\n        event_status = event.status\n\n        if event.status == \"success\":\n            self._is_complete = True\n        elif event.status == \"interrupt\":\n            self._need_tool_call = True\n\n        context_func_map = {\n            \"preparing\": self.preparing,\n            \"running\": self.running,\n            \"error\": self.error,\n            \"done\": self.done,\n            \"interrupt\": self.interrupt,\n            \"success\": self.success,\n        }\n\n        run_context = AppBuilderClientRunContext()\n        await self._update_run_context(run_context, run_response.content)\n        await self.handle_event_type(run_context, run_response.content)\n        await self.handle_content_type(run_context, run_response.content)\n        if event_status in context_func_map:\n            func = context_func_map[event_status]\n            func_res = await func(run_context, run_response.content)\n\n            if event_status == \"interrupt\":\n                assert isinstance(func_res, list)\n                if len(func_res) == 0:\n                    raise ValueError(\"Tool output is empty\")\n                else:\n                    if not isinstance(func_res[0], data_class.ToolOutput):\n                        try:\n                            check_tool_output = data_class.ToolOutput(\n                                **func_res[0])\n                        except Exception as e:\n                            logger.error(\n                                \"func interrupt's output should be list[ToolOutput] or list[dict(can be trans to ToolOutput)]\"\n                            )\n                            raise ValueError(e)\n                self._last_tool_output = func_res\n        else:\n            logger.warning(\n                \"Unknown status: {}, response data: {}\".format(\n                    event_status, run_response\n                )\n            )\n\n    async def __stream_run_process__(self):\n        \"\"\"\n        异步流式运行处理函数\n\n        Args:\n            无参数\n\n        Returns:\n            Generator[Any, None, None]: 返回处理结果的生成器\n        \"\"\"\n        while not self._is_complete:\n            if not self._need_tool_call:\n                res = await self._run()\n            else:\n                res = await self._submit_tool_output()\n            async for msg in self.__stream_event_process__(res):\n                yield msg\n\n    async def __stream_event_process__(self, run_response):\n        \"\"\"\n        处理流事件，并调用对应的方法\n\n        Args:\n            run_response: 包含流事件信息的响应对象\n\n        Returns:\n            None\n\n        Raises:\n            ValueError: 当处理事件时发生异常或中断时工具输出为空时\n        \"\"\"\n        async for msg in run_response.content:\n            if len(msg.events) == 0:\n                continue\n            try:\n                event = msg.events[-1]\n            except Exception as e:\n                raise ValueError(e)\n\n            event_status = event.status\n\n            if event.status == \"success\":\n                self._is_complete = True\n            elif event.status == \"interrupt\":\n                self._need_tool_call = True\n\n            context_func_map = {\n                \"preparing\": self.preparing,\n                \"running\": self.running,\n                \"error\": self.error,\n                \"done\": self.done,\n                \"interrupt\": self.interrupt,\n                \"success\": self.success,\n            }\n\n            run_context = AppBuilderClientRunContext()\n            await self._update_run_context(run_context, msg)\n            await self.handle_event_type(run_context, msg)\n            await self.handle_content_type(run_context, msg)\n            if event_status in context_func_map:\n                func = context_func_map[event_status]\n                func_res = await func(run_context, msg)\n\n                if event_status == \"interrupt\":\n                    assert isinstance(func_res, list)\n                    if len(func_res) == 0:\n                        raise ValueError(\"Tool output is empty\")\n                    else:\n                        if not isinstance(func_res[0], data_class.ToolOutput):\n                            try:\n                                check_tool_output = data_class.ToolOutput(\n                                    **func_res[0])\n                            except Exception as e:\n                                logger.info(\n                                    \"func interrupt's output should be list[ToolOutput] or list[dict(can be trans to ToolOutput)]\"\n                                )\n                                raise ValueError(e)\n                    self._last_tool_output = func_res\n            else:\n                logger.warning(\n                    \"Unknown status: {}, response data: {}\".format(\n                        event_status, run_response\n                    )\n                )\n\n            yield msg\n\n    async def _update_run_context(self, run_context, run_response):\n        \"\"\"\n        更新运行上下文。\n\n        Args:\n            run_context (dict): 运行上下文字典。\n            run_response (object): 运行响应对象。\n\n        Returns:\n            None\n\n        \"\"\"\n        run_context.current_event = run_response.events[-1]\n        run_context.current_tool_calls = run_context.current_event.tool_calls\n        run_context.current_status = run_context.current_event.status\n        run_context.need_tool_submit = run_context.current_status == \"interrupt\"\n        run_context.is_complete = run_context.current_status == \"success\"\n        try:\n            run_context.current_thought = (\n                run_context.current_event.detail.get(\"text\", {})\n                .get(\"function_call\", {})\n                .get(\"thought\", \"\")\n            )\n            if run_context.current_thought == \"\":\n                run_context.current_thought = run_response.events[0].detail.get(\n                    \"text\", \"\"\n                )\n        except Exception:\n            pass\n\n    async def _run(self):\n        res = await self._appbuilder_client.run(\n            conversation_id=self._conversation_id,\n            query=self._query,\n            file_ids=self._file_ids,\n            stream=self._stream,\n            tools=self._tools,\n            action=self._action,\n        )\n        return res\n\n    async def _submit_tool_output(self):\n        assert self._last_tool_output is not None\n        res = await self._appbuilder_client.run(\n            conversation_id=self._conversation_id,\n            file_ids=self._file_ids,\n            stream=self._stream,\n            tool_outputs=self._last_tool_output,\n        )\n        return res\n\n    async def __anext__(self):\n        return await self._iterator.__anext__()\n\n    async def __aiter__(self):\n        async for item in self._iterator:\n            yield item\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_val, exc_tb) -> None:\n        if exc_type is not None:\n            raise exc_val\n\n        return\n\n    async def reset_state(self):\n        \"\"\"\n        重置该对象的状态，将所有实例变量设置为默认值。\n\n        Args:\n            无\n\n        Returns:\n            无\n\n        \"\"\"\n        self._appbuilder_client = None\n        self._conversation_id = None\n        self._query = None\n        self._file_ids = None\n        self._tools = None\n        self._stream = False\n        self._event_handler = None\n        self._kwargs = None\n        self._last_tool_output = None\n        self._is_complete = False\n        self._need_tool_call = False\n        self._iterator = None\n\n    async def new_dialog(\n        self,\n        query=None,\n        file_ids=None,\n        tools=None,\n        action=None,\n        stream: bool = None,\n        event_handler=None,\n        **kwargs,\n    ):\n        \"\"\"\n        重置handler部分参数，用于复用该handler进行多轮对话。\n\n        Args:\n            query (str): 用户输入的查询语句。\n            file_ids (list, optional): 文件ID列表，默认为None。\n            tools (list, optional): 工具列表，默认为None。\n            stream (bool, optional): 是否使用流式处理，默认为False。\n            action (object, optional): 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n            event_handler (callable, optional): 事件处理函数，默认为None。\n            **kwargs: 其他可选参数。\n\n        Returns:\n            None\n\n        \"\"\"\n        self._query = query or self._query\n        self._stream = stream or self._stream\n\n        self._file_ids = file_ids\n        self._tools = tools\n        self._event_handler = event_handler\n        self._kwargs = kwargs\n        self._action = action\n\n        # 重置部分状态\n        self._is_complete = False\n        self._need_tool_call = False\n        self._last_tool_output = None\n        self._iterator = (\n            self.__run_process__()\n            if not self._stream\n            else self.__stream_run_process__()\n        )\n\n    async def until_done(self):\n        \"\"\"\n        迭代并遍历内部迭代器中的所有元素，直到迭代器耗尽。\n\n        Args:\n            无参数。\n\n        Returns:\n            无返回值。\n\n        \"\"\"\n        async for _ in self._iterator:\n            pass\n\n    async def handle_content_type(self, run_context, run_response):\n        # 用户可重载该方法，用于处理不同类型的content_type\n        pass\n\n    async def handle_event_type(self, run_context, run_response):\n        # 用户可重载该方法，用于处理不同类型的event_type\n        pass\n\n    async def interrupt(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为interrupt时，会调用该方法\n        pass\n\n    async def preparing(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为preparing时，会调用该方法\n        pass\n\n    async def running(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为running时，会调用该方法\n        pass\n\n    async def error(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为error时，会调用该方法\n        pass\n\n    async def done(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为done时，会调用该方法\n        pass\n\n    async def success(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为success时，会调用该方法\n        pass\n\n\nclass AsyncToolCallEventHandler(AsyncAppBuilderEventHandler):\n    def __init__(self, mcp_client=None, functions=[]):\n        super().__init__()\n        self.mcp_client = mcp_client\n        self.functions = functions\n        self.result = \"\"\n\n    async def init(\n        self,\n        appbuilder_client,\n        conversation_id,\n        query,\n        file_ids=None,\n        tools=None,\n        stream: bool = False,\n        event_handler=None,\n        action=None,\n        **kwargs,\n    ):\n        await super().init(\n            appbuilder_client,\n            conversation_id,\n            query,\n            file_ids,\n            tools,\n            stream,\n            event_handler,\n            action,\n            **kwargs,\n        )\n        self.result = \"\"\n\n    async def reset_state(self):\n        await super().reset_state()\n        self.result = \"\"\n\n    async def new_dialog(\n        self,\n        query=None,\n        file_ids=None,\n        tools=None,\n        action=None,\n        stream=None,\n        event_handler=None,\n        **kwargs,\n    ):\n        await super().new_dialog(\n            query, file_ids, tools, action, stream, event_handler, **kwargs\n        )\n        self.result = \"\"\n\n    async def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        logger.debug(\"Agent 中间思考: {}\\n\".format(thought))\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            function_name = tool_call.function.name\n            function_arguments = tool_call.function.arguments\n            result = \"\"\n            function_map = {f.__name__: f for f in self.functions}\n            if function_name in function_map:\n                result = function_map[function_name](\n                    **tool_call.function.arguments)\n                logger.debug(\"ToolCall结果: {}\\n\".format(result))\n            elif self.mcp_client:\n                logger.debug(\n                    \"MCP工具名称: {}, MCP参数:{}\\n\".format(\n                        function_name, function_arguments\n                    )\n                )\n                mcp_server_result = await self.mcp_client.call_tool(\n                    function_name, function_arguments\n                )\n                logger.debug(\"MCP ToolCall结果: {}\\n\".format(mcp_server_result))\n                for i, content in enumerate(mcp_server_result.content):\n                    if content.type == \"text\":\n                        result = result + mcp_server_result.content[i].text\n            else:\n                logger.warning(f\"Tool not found: {function_name}\")\n            tool_output.append(\n                {\n                    \"tool_call_id\": tool_call.id,\n                    \"output\": result,\n                }\n            )\n        return tool_output\n\n    async def running(self, run_context, run_response):\n        if self._stream and run_response.answer and run_response.answer != \"\":\n            logger.debug(\"Agent 流式回答: {}\".format(run_response.answer))\n            self.result += run_response.answer\n\n    async def success(self, run_context, run_response):\n        if not self._stream:\n            logger.debug(\"Agent 非流式回答: {}\".format(run_response.answer))\n            self.result = run_response.answer\n"
  },
  {
    "path": "python/core/console/appbuilder_client/data_class.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom pydantic import BaseModel\nfrom pydantic import Field\nfrom typing import Union, Any\nfrom typing import Optional\nfrom appbuilder.core.manifest.models import Manifest\n\n\nclass Function(BaseModel):\n    name: str = Field(..., description=\"工具名称\")\n    description: str = Field(..., description=\"工具描述\")\n    parameters: dict = Field(..., description=\"工具参数, json_schema格式\")\n\n\nclass Tool(BaseModel):\n    type: str = \"function\"\n    function: Function = Field(..., description=\"工具信息\")\n\n\nclass MCPTool(BaseModel):\n    name: str = Field(..., description=\"工具名称\")\n    description: str = Field(..., description=\"工具描述\")\n    inputSchema: dict = Field(..., description=\"工具参数, json_schema格式\")\n\n\ndef ToAppBuilderTool(tool):\n    if \"type\" in tool and tool[\"type\"]:\n        return Tool(**tool), False\n    if hasattr(tool, 'inputSchema') and hasattr(tool, 'inputSchema'):\n        return Tool(type=\"function\",\n                    function=Function(name=tool.name, description=tool.description, parameters=tool.inputSchema)), True\n    else:\n        return tool, False\n\n\nclass ToolOutput(BaseModel):\n    tool_call_id: str = Field(..., description=\"工具调用ID\")\n    output: str = Field(..., description=\"工具输出\")\n\n\nclass FunctionCallDetail(BaseModel):\n    name: str = Field(..., description=\"函数的名称\")\n    arguments: dict = Field(..., description=\"模型希望您传递给函数的参数\")\n\n\nclass ToolCall(BaseModel):\n    id: str = Field(..., description=\"工具调用ID\")\n    type: str = Field(\n        \"function\", description=\"需要输出的工具调用的类型。就目前而言，这始终是function\")\n    function: FunctionCallDetail = Field(..., description=\"函数定义\")\n\n\nclass ToolChoiceFunction(BaseModel):\n    name: str = Field(\n        ...,\n        description=\"组件的英文名称（唯一标识），用户通过工作流完成自定义组件后，可在个人空间-组件下查看组件英文名称\",\n    )\n    input: dict = Field(\n        ...,\n        description=\"当组件没有入参或者必填的入参只有一个时可省略，必填的入参只有一个且省略时，使用query字段的值作为入参\",\n    )\n\n\nclass ToolChoice(BaseModel):\n    type: str = Field(\n        ...,\n        description=\"auto/function，auto表示由LLM自动判断调什么组件；function表示由用户指定调用哪个组件\",\n    )\n    function: Optional[ToolChoiceFunction] = Field(\n        ..., description=\"当type为function时，需要指定调用哪个组件\"\n    )\n\n\nclass ActionInterruptEvent(BaseModel):\n    id: str = Field(..., description=\"要回复的'信息收集节点'中断事件ID\")\n    type: str = Field(..., description=\"要回复的'信息收集节点'中断事件类型，当前仅chat\")\n\n\nclass ActionParameters(BaseModel):\n    interrupt_event: ActionInterruptEvent = Field(\n        ..., description=\"要回复的'信息收集节点'中断事件\")\n\n\nclass CustomMetadata(BaseModel):\n    override_role_instruction: str = Field(..., description=\"自定义角色指令，适用于自主规划agent\")\n\n\nclass Action(BaseModel):\n    action_type: str = Field(...,\n                             description=\"action类型,目前可用值'resume', 用于回复信息收集节点的消息\")\n    parameters: ActionParameters = Field(\n        ...,\n        description=\"对话时要进行的特殊操作。如回复工作流agent中'信息收集节点'的消息。\",\n    )\n\n    @classmethod\n    def create_resume_action(cls, event_id):\n        return {\n            \"action_type\": \"resume\",\n            \"parameters\": {\n                \"interrupt_event\": {\n                    \"id\": event_id,\n                    \"type\": \"chat\"\n                }\n            }\n        }\n\n\nclass AppBuilderClientRequest(BaseModel):\n    \"\"\"会话请求参数\n        属性:\n            query (str): 查询参数\n            response_mode (str): streaming或blocking\n            conversation_id (str): 会话ID\n            file_ids(list[str]): 文件ID\n            app_id：应用ID\n    \"\"\"\n    query: Optional[str] = None\n    stream: Optional[bool] = False\n    conversation_id: str\n    file_ids: Optional[list[str]] = None\n    app_id: str\n    tools: Optional[list[Union[Tool, Manifest]]] = None\n    tool_outputs: Optional[list[ToolOutput]] = None\n    tool_choice: Optional[ToolChoice] = None\n    end_user_id: Optional[str] = None\n    action: Optional[Action] = None\n    mcp_authorization: Optional[list[dict]] = None\n    parameters: Optional[dict[str, Any]] = None\n    custom_metadata: Optional[CustomMetadata] = None\n\n\nclass Usage(BaseModel):\n    \"\"\"\n    模型用量 仅Chat Agent和Function Call有，按照各个独立的event_type计数。\n    \"\"\"\n    prompt_tokens: int = 0\n    completion_tokens: int = 0\n    total_tokens: int = 0\n    name: str = \"\"\n\n\nclass OriginalEvent(BaseModel):\n    \"\"\"会话请求参数\n        属性:\n            event_code (int): 0代表成功，非0为失败\n            event_message (str): 错误详情\n            event_type（str）：事件类型\n            event_status（str）:事件状态\n            content_type（str）:内容类型\n            outputs（dict）：事件输出\n    \"\"\"\n    event_code: int = \"\"\n    event_message: str = \"\"\n    event_type: str = \"\"\n    event_id: str = \"\"\n    event_status: str = \"\"\n    content_type: str = \"\"\n    outputs: dict = {}\n    usage: Optional[Usage] = None\n    tool_calls: Optional[list[ToolCall]] = None\n\n\nclass AppBuilderClientResponse(BaseModel):\n    \"\"\"会话请求参数\n        属性:\n            request_id (int): 请求ID\n            date (str): 消息返回时间的时间戳\n            answer (str): 模型回答\n            conversation_id（str）: 会话ID\n            message_id(str): 消息ID\n            is_completion(bool): 是否结束\n            content(list): 内容详情\n    \"\"\"\n    request_id: str = \"\"\n    date: str = \"\"\n    answer: str = \"\"\n    conversation_id: str = \"\"\n    message_id: str = \"\"\n    is_completion: Optional[bool] = False\n    content: list[OriginalEvent] = []\n\n\nclass TextDetail(BaseModel):\n    \"\"\"content_type=text，详情内容\n            属性:\n                text(str): 文本详情\n    \"\"\"\n    text: str = \"\"\n\n\nclass CodeDetail(BaseModel):\n    \"\"\"content_type=code，详情内容\n             属性:\n                 text(str): 文本详情\n                 code: 代码解释器工具生产的代码\n                 files: 代码解释器生成的可下载文件地址列表\n     \"\"\"\n    text: str = \"\"\n    code: str = \"\"\n    files: list[str] = []\n\n\nclass RAGReference(BaseModel):\n    \"\"\"RAG应用详情\n           属性:\n               id (int): 对应来源ID\n               from (str): 信息来源\n               url (str): BaiduSearch 的专用字段\n               content（str）: 般用来当做文档名或者链接的title使用，前端展示可以根据情况截断。\n               segment_id(str): 片段ID\n               document_id(str): 文档ID\n               document_name(str): 文档名\n               knowledgebase_id(str): 知识库id  知识问答专有字段 \n       \"\"\"\n    id: str = \"\"\n    from_: str = Field(..., alias='from')\n    url: str = \"\"\n    content: str = \"\"\n    segment_id: str = \"\"\n    document_id: str = \"\"\n    dataset_id: str = \"\"\n    document_name: str = \"\"\n    knowledgebase_id: str = \"\"\n\n\nclass RAGDetail(BaseModel):\n    \"\"\"content_type=rag，详情内容\n            属性:\n                text(str): 文本详情\n                references(list[RAGReference]): 引用详情\n    \"\"\"\n    text: str = \"\"\n    references: list[RAGReference] = []\n\n\nclass FunctionCallDetail(BaseModel):\n    \"\"\"content_type=function_call，详情内容\n             属性:\n                 text(str): 文本详情\n     \"\"\"\n    text: Union[str, dict] = \"\"\n    image: str = \"\"\n    audio: str = \"\"\n    video: str = \"\"\n\n\nclass ImageDetail(BaseModel):\n    \"\"\"content_type=function_call，详情内容\n            属性:\n                image(str): 图片下载地址\n    \"\"\"\n    image: str = \"\"\n\n\nclass AudioDetail(BaseModel):\n    \"\"\"content_type=audio，详情内容\n            属性:\n                image(str): 音频下载地址\n    \"\"\"\n    audio: str = \"\"\n\n\nclass VideoDetail(BaseModel):\n    \"\"\"content_type=video，详情内容\n            属性:\n                video(str): 视频下载地址\n    \"\"\"\n    video: str = \"\"\n\n\nclass StatusDetail(BaseModel):\n    pass\n\n\nclass DefaultDetail(BaseModel):\n    \"\"\"content_type为其它时，详情内容\n        属性:\n            urls(list[str]): 件链接列表\n            files(list[str]): 下载文件地址列表\n            image(str): 工具生成的图片url\n            video(str): 工具生成的语音url\n            audio(str):工具生成的音频url\n       \"\"\"\n    urls: list[str] = []\n    files: list[str] = []\n    image: str = \"\"\n    video: str = \"\"\n    audio: str = \"\"\n\n\nclass Event(BaseModel):\n    \"\"\"执行步骤的具体内容\n        属性:\n            code (int): 响应code码\n            message (str): 错误详情\n            status (str): 状态描述，preparing（准备运行）running（运行中）error（执行错误） done（执行完成）\n            event_type（str）: 事件类型\n            content_type（str）: 内容类型\n            detail(dict): 事件详情\n            usage(Usage): 模型调用的token用量\n    \"\"\"\n    code: int = 0\n    message: str = \"\"\n    status: str = \"\"\n    event_type: str = \"\"\n    content_type: str = \"\"\n    detail: dict = {}\n    usage: Optional[Usage] = None\n    tool_calls: Optional[list[ToolCall]] = None\n\n\nclass AppBuilderClientAnswer(BaseModel):\n    \"\"\"执行步骤的具体内容\n        属性:\n            answer(str): query回答内容\n            events( list[Event]): 事件列表\n       \"\"\"\n    answer: str = \"\"\n    message_id: str = \"\"\n    events: list[Event] = []\n\n\nclass FileUploadResponse(BaseModel):\n    \"\"\"文档上传结果\n           属性:\n             request_id (str): 请求ID\n             id (str): 文件ID\n             conversation_id (str): 对话ID\n    \"\"\"\n    request_id: str = \"\"\n    id: str = \"\"\n    conversation_id: str = \"\"\n\n\nclass CreateConversationResponse(BaseModel):\n    \"\"\"文档上传结果\n           属性:\n             code (int): 响应code码\n             request_id (str): 请求ID\n             conversation_id (str): 对话ID\n    \"\"\"\n    request_id: str = \"\"\n    conversation_id: str = \"\"\n\n\nclass AppBuilderClientAppListRequest(BaseModel):\n    limit: int = Field(\n        default=10, description=\"当次查询的数据大小，默认10，最大值100\", le=100, ge=1)\n    after: str = Field(\n        default=\"\",\n        description=\"用于分页的游标。after 是一个应用的id，它定义了在列表中的位置。例如，如果你发出一个列表请求并收到 10个对象，以 app_id_123 结束，那么你后续的调用可以包含 after=app_id_123 以获取列表的下一页数据。\")\n    before: str = Field(default=\"\", description=\"用于分页的游标。与after相反，填写它将获取前一页数据\")\n\n\nclass AppOverview(BaseModel):\n    id: str = Field(\"\", description=\"应用ID\")\n    name: str = Field(\"\", description=\"应用名称\")\n    description: str = Field(\"\", description=\"应用简介\")\n    appType: Optional[str] = Field(\n        None,\n        description=\"应用类型:agent、chatflow。agent:自主规划Agent, chatflow:工作流Agent。\"\n    )\n    isPublished: Optional[bool] = Field(None, description=\"是否已发布\")\n    updateTime: Optional[int] = Field(None, description=\"更新时间。时间戳，单位秒\")\n\n\nclass AppBuilderClientAppListResponse(BaseModel):\n    request_id: str = Field(\"\", description=\"请求ID\")\n    data: Optional[list[AppOverview]] = Field(\n        [], description=\"应用概览列表\")\n\n\nclass DescribeAppsRequest(BaseModel):\n    maxKeys: int = Field(\n        default=10, description=\"当次查询的数据大小，默认10，最大值100\", le=100, ge=1)\n    marker: str = Field(\n        default=None,\n        description=\"用于分页的游标。marker 是应用的id，它定义了在列表中的位置。例如，如果你发出一个列表请求并收到 10个对象，以 app_id_123 开始，那么可以使用 marker=app_id_123 来获取列表的下一页数据\")\n\n\nclass DescribeAppsResponse(BaseModel):\n    requestId: str = Field(\"\", description=\"请求ID\")\n    marker: str = Field(\"\", description=\"起始位置\")\n    isTruncated: bool = Field(False, description=\"是否有更多数据\")\n    nextMarker: str = Field(\"\", description=\"下一次起始位置\")\n    maxKeys: int = Field(0, description=\"最大返回数量\")\n    data: list[AppOverview] = Field([], description=\"应用概览列表\")\n\n\nclass DescribeAppRequest(BaseModel):\n    id: str = Field(..., description=\"应用ID\")\n\n\nclass DescribeAppResponse(BaseModel):\n    requestId: str = Field(\"\", description=\"请求ID\")\n    id: str = Field(\"\", description=\"应用ID\")\n    name: str = Field(\"\", description=\"应用名称\")\n    description: str = Field(\"\", description=\"应用描述\")\n    instruction: str = Field(\"\", description=\"用户指令\")\n    prologue: str = Field(\"\", description=\"开场白\")\n    exampleQueries: list[str] = Field(\"\", description=\"推荐问题\")\n    followupQueries: dict = Field(\"\", description=\"追问\")\n    components: Optional[list[dict]] = Field(None, description=\"引用组件列表\")\n    knowledgeBaseConfig: Optional[dict] = Field(None, description=\"知识库配置\")\n    modelConfig: Optional[dict] = Field(None, description=\"模型配置\")\n    background: Optional[dict] = Field(None, description=\"背景图配置\")\n\n\nclass FeedbackRequest(BaseModel):\n    app_id: str = Field(..., description=\"应用ID\")\n    conversation_id: str = Field(..., description=\"对话ID\")\n    message_id: str = Field(..., description=\"对应的消息ID\")\n    type: str = Field(\n        ...,\n        description=\"点赞点踩枚举值 cancel：取消评论, upvote：点赞, downvote：点踩\",\n    )\n    flag: Optional[list[str]] = Field(\n        None,\n        description=\"点踩原因枚举值:答非所问、内容缺失、没有帮助、逻辑问题、偏见歧视、事实错误\",\n    )\n    reason: Optional[str] = Field(None, description=\"对于点赞点踩额外补充的原因。\")\n"
  },
  {
    "path": "python/core/console/appbuilder_client/event_handler.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder.core.console.appbuilder_client import data_class\n\n\nclass AppBuilderClientRunContext(object):\n    def __init__(self) -> None:\n        \"\"\"\n        初始化方法。\n\n        Args:\n            无参数。\n\n        Returns:\n            None\n\n        \"\"\"\n        self.current_event = None\n        self.current_tool_calls = None\n        self.current_status = None\n        self.need_tool_submit = False\n        self.is_complete = False\n        self.current_thought = \"\"\n\n\nclass AppBuilderEventHandler(object):\n    def __init__(self):\n        pass\n\n    def init(\n        self,\n        appbuilder_client,\n        conversation_id,\n        query,\n        file_ids=None,\n        tools=None,\n        stream: bool = False,\n        event_handler=None,\n        action=None,\n        **kwargs\n    ):\n        \"\"\"\n        初始化类实例并设置相关参数。\n\n        Args:\n            appbuilder_client (object): AppBuilder客户端实例对象。\n            conversation_id (str): 对话ID。\n            query (str): 用户输入的查询语句。\n            file_ids (list, optional): 文件ID列表，默认为None。\n            tools (list, optional): 工具列表，默认为None。\n            stream (bool, optional): 是否使用流式处理，默认为False。\n            event_handler (callable, optional): 事件处理函数，默认为None。\n            action (object, optional): 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n            **kwargs: 其他可选参数。\n\n        Returns:\n            None\n\n        \"\"\"\n        self._appbuilder_client = appbuilder_client\n        self._conversation_id = conversation_id\n        self._query = query\n        self._file_ids = file_ids\n        self._tools = tools\n        self._stream = stream\n        self._event_handler = event_handler\n        self._kwargs = kwargs\n        self._is_complete = False\n        self._need_tool_call = False\n        self._last_tool_output = None\n        self._action = action\n\n        self._iterator = self.__run_process__(\n        ) if not self._stream else self.__stream_run_process__()\n\n    def __run_process__(self):\n        \"\"\"\n        运行进程，并在每次执行后生成结果。\n\n        Args:\n            无参数。\n\n        Returns:\n            Generator: 生成器，每次执行后返回结果。\n\n        \"\"\"\n        while not self._is_complete:\n            if not self._need_tool_call:\n                res = self._run()\n                self.__event_process__(res)\n            else:\n                res = self._submit_tool_output()\n                self.__event_process__(res)\n            yield res\n        if self._need_tool_call and self._is_complete:\n            self.reset_state()\n\n    def __event_process__(self, run_response):\n        \"\"\"\n        处理事件响应。\n\n        Args:\n            run_response (RunResponse): 运行时响应对象。\n\n        Returns:\n            None\n\n        Raises:\n            ValueError: 当解析事件时发生异常或工具输出为空时。\n        \"\"\"\n        try:\n            event = run_response.content.events[-1]\n        except Exception as e:\n            raise ValueError(e)\n\n        event_status = event.status\n\n        if event.status == 'success':\n            self._is_complete = True\n        elif event.status == 'interrupt':\n            self._need_tool_call = True\n\n        context_func_map = {\n            \"preparing\": self.preparing,\n            \"running\": self.running,\n            \"error\": self.error,\n            \"done\": self.done,\n            \"interrupt\": self.interrupt,\n            \"success\": self.success,\n        }\n\n        run_context = AppBuilderClientRunContext()\n        self._update_run_context(run_context, run_response.content)\n        self.handle_event_type(run_context, run_response.content)\n        self.handle_content_type(run_context, run_response.content)\n        if event_status in context_func_map:\n            func = context_func_map[event_status]\n            func_res = func(run_context, run_response.content)\n\n            if event_status == \"interrupt\":\n                assert isinstance(func_res, list)\n                if len(func_res) == 0:\n                    raise ValueError(\"Tool output is empty\")\n                else:\n                    if not isinstance(func_res[0], data_class.ToolOutput):\n                        try:\n                            check_tool_output = data_class.ToolOutput(\n                                **func_res[0])\n                        except Exception as e:\n                            logger.error(\n                                \"func interrupt's output should be list[ToolOutput] or list[dict(can be trans to ToolOutput)]\")\n                            raise ValueError(e)\n                self._last_tool_output = func_res\n        else:\n            logger.warning(\n                \"Unknown status: {}, response data: {}\".format(event_status, run_response))\n\n    def __stream_run_process__(self):\n        \"\"\"\n        流式运行处理函数\n\n        Args:\n            无参数。\n\n        Returns:\n            Generator[Any, None, None]: 返回处理结果的生成器。\n\n        \"\"\"\n        while not self._is_complete:\n            if not self._need_tool_call:\n                res = self._run()\n            else:\n                res = self._submit_tool_output()\n            for msg in self.__stream_event_process__(res):\n                yield msg\n\n    def __stream_event_process__(self, run_response):\n        \"\"\"\n        处理流事件，并调用对应的方法\n\n        Args:\n            run_response: 包含流事件信息的响应对象\n\n        Returns:\n            None\n\n        Raises:\n            ValueError: 当处理事件时发生异常或中断时工具输出为空时\n        \"\"\"\n        for msg in run_response.content:\n            if len(msg.events) == 0:\n                continue\n            try:\n                event = msg.events[-1]\n            except Exception as e:\n                raise ValueError(e)\n\n            event_status = event.status\n\n            if event.status == 'success':\n                self._is_complete = True\n            elif event.status == 'interrupt':\n                self._need_tool_call = True\n\n            context_func_map = {\n                \"preparing\": self.preparing,\n                \"running\": self.running,\n                \"error\": self.error,\n                \"done\": self.done,\n                \"interrupt\": self.interrupt,\n                \"success\": self.success,\n            }\n\n            run_context = AppBuilderClientRunContext()\n            self._update_run_context(run_context, msg)\n            self.handle_event_type(run_context, msg)\n            self.handle_content_type(run_context, msg)\n            if event_status in context_func_map:\n                func = context_func_map[event_status]\n                func_res = func(run_context, msg)\n\n                if event_status == \"interrupt\":\n                    assert isinstance(func_res, list)\n                    if len(func_res) == 0:\n                        raise ValueError(\"Tool output is empty\")\n                    else:\n                        if not isinstance(func_res[0], data_class.ToolOutput):\n                            try:\n                                check_tool_output = data_class.ToolOutput(\n                                    **func_res[0])\n                            except Exception as e:\n                                logger.info(\n                                    \"func interrupt's output should be list[ToolOutput] or list[dict(can be trans to ToolOutput)]\")\n                                raise ValueError(e)\n                    self._last_tool_output = func_res\n            else:\n                logger.warning(\n                    \"Unknown status: {}, response data: {}\".format(event_status, run_response))\n\n            yield msg\n\n    def _update_run_context(self, run_context, run_response):\n        \"\"\"\n        更新运行上下文。\n\n        Args:\n            run_context (dict): 运行上下文字典。\n            run_response (object): 运行响应对象。\n\n        Returns:\n            None\n\n        \"\"\"\n        run_context.current_event = run_response.events[-1]\n        run_context.current_tool_calls = run_context.current_event.tool_calls\n        run_context.current_status = run_context.current_event.status\n        run_context.need_tool_submit = run_context.current_status == 'interrupt'\n        run_context.is_complete = run_context.current_status == 'success'\n        try:\n            run_context.current_thought = run_context.current_event.detail.get(\n                \"text\", {}).get(\n                    \"function_call\", {}).get(\n                        \"thought\", \"\")\n            if run_context.current_thought == \"\":\n                run_context.current_thought = (\n                    run_response.events[0].detail.get(\"text\", \"\")\n                )\n        except Exception:\n            pass\n\n    def _run(self):\n        res = self._appbuilder_client.run(\n            conversation_id=self._conversation_id,\n            query=self._query,\n            file_ids=self._file_ids,\n            stream=self._stream,\n            tools=self._tools,\n            action=self._action,\n        )\n        return res\n\n    def _submit_tool_output(self):\n        assert self._last_tool_output is not None\n        res = self._appbuilder_client.run(\n            conversation_id=self._conversation_id,\n            file_ids=self._file_ids,\n            stream=self._stream,\n            tool_outputs=self._last_tool_output\n        )\n        return res\n\n    def __next__(self):\n        return self._iterator.__next__()\n\n    def __iter__(self):\n        for item in self._iterator:\n            yield item\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_val, exc_tb) -> None:\n        if exc_type is not None:\n            raise exc_val\n\n        return\n\n    def reset_state(self):\n        \"\"\"\n        重置该对象的状态，将所有实例变量设置为默认值。\n\n        Args:\n            无\n\n        Returns:\n            无\n\n        \"\"\"\n        self._appbuilder_client = None\n        self._conversation_id = None\n        self._query = None\n        self._file_ids = None\n        self._tools = None\n        self._stream = False\n        self._event_handler = None\n        self._kwargs = None\n        self._last_tool_output = None\n        self._is_complete = False\n        self._need_tool_call = False\n        self._iterator = None\n\n    def new_dialog(\n        self,\n        query=None,\n        file_ids=None,\n        tools=None,\n        action=None,\n        stream: bool = None,\n        event_handler=None,\n        **kwargs\n    ):\n        \"\"\"\n        重置handler部分参数，用于复用该handler进行多轮对话。\n\n        Args:\n            query (str): 用户输入的查询语句。\n            file_ids (list, optional): 文件ID列表，默认为None。\n            tools (list, optional): 工具列表，默认为None。\n            stream (bool, optional): 是否使用流式处理，默认为False。\n            action (object, optional): 对话时要进行的特殊操作。如回复工作流agent中“信息收集节点“的消息。\n            event_handler (callable, optional): 事件处理函数，默认为None。\n            **kwargs: 其他可选参数。\n\n        Returns:\n            None\n\n        \"\"\"\n        self._query = query or self._query\n        self._stream = stream or self._stream\n\n        self._file_ids = file_ids\n        self._tools = tools\n        self._event_handler = event_handler\n        self._kwargs = kwargs\n        self._action = action\n\n        # 重置部分状态\n        self._is_complete = False\n        self._need_tool_call = False\n        self._last_tool_output = None\n        self._iterator = (\n            self.__run_process__()\n            if not self._stream\n            else self.__stream_run_process__()\n        )\n\n    def until_done(self):\n        \"\"\"\n        迭代并遍历内部迭代器中的所有元素，直到迭代器耗尽。\n\n        Args:\n            无参数。\n\n        Returns:\n            无返回值。\n\n        \"\"\"\n        for _ in self._iterator:\n            pass\n\n    def handle_content_type(self, run_context, run_response):\n        # 用户可重载该方法，用于处理不同类型的content_type\n        pass\n\n    def handle_event_type(self, run_context, run_response):\n        # 用户可重载该方法，用于处理不同类型的event_type\n        pass\n\n    def interrupt(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为interrupt时，会调用该方法\n        pass\n\n    def preparing(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为preparing时，会调用该方法\n        pass\n\n    def running(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为running时，会调用该方法\n        pass\n\n    def error(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为error时，会调用该方法\n        pass\n\n    def done(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为done时，会调用该方法\n        pass\n\n    def success(self, run_context, run_response):\n        # 用户可重载该方法，当event_status为success时，会调用该方法\n        pass\n\n\nclass ToolCallEventHandler(AppBuilderEventHandler):\n    def __init__(self, functions):\n        super().__init__()\n        self.functions = functions\n        self.result = \"\"\n\n    def init(\n        self,\n        appbuilder_client,\n        conversation_id,\n        query,\n        file_ids=None,\n        tools=None,\n        stream: bool = False,\n        event_handler=None,\n        action=None,\n        **kwargs\n    ):\n        super().init(appbuilder_client, conversation_id, query,\n                     file_ids, tools, stream, event_handler, action, **kwargs)\n        self.result = \"\"\n\n    def reset_state(self):\n        super().reset_state()\n        self.result = \"\"\n\n    def new_dialog(self, query=None, file_ids=None, tools=None, action=None, stream=None, event_handler=None, **kwargs):\n        super().new_dialog(query, file_ids, tools, action, stream, event_handler, **kwargs)\n        self.result = \"\"\n\n    def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        logger.debug(\"Agent 中间思考: {}\\n\".format(thought))\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            function_name = tool_call.function.name\n            function_arguments = tool_call.function.arguments\n            result = \"\"\n            function_map = {f.__name__: f for f in self.functions}\n            if function_name in function_map:\n                result = function_map[function_name](**function_arguments)\n                logger.debug(\"ToolCall结果: {}\\n\".format(result))\n            else:\n                logger.error(\n                    \"{} is not a valid tool\".format(function_name))\n            tool_output.append(\n                {\n                    \"tool_call_id\": tool_call.id,\n                    \"output\": result,\n                }\n            )\n        return tool_output\n\n    def running(self, run_context, run_response):\n        if self._stream and run_response.answer and run_response.answer != \"\":\n            logger.debug(\"Agent 流式回答: {}\".format(run_response.answer))\n            self.result += run_response.answer\n\n    def success(self, run_context, run_response):\n        if not self._stream:\n            logger.debug(\"Agent 非流式回答: {}\".format(run_response.answer))\n            self.result = run_response.answer\n"
  },
  {
    "path": "python/core/console/base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.llms.base import CompletionResponse, LLMMessage\n\n\nclass ConsoleLLMMessage(LLMMessage):\n    conversation_id: str = \"\"\n\n    def __str__(self):\n        return f\"Message(name={self.name}, content={self.content}, mtype={self.mtype}, extra={self.extra}, conversation_id={self.conversation_id})\"\n\n\nclass ConsoleCompletionResponse(CompletionResponse):\n    \"\"\"\n    console端大模型返回结果解析\n    \"\"\"\n    error_no = 0\n    error_msg = \"\"\n    result = None\n    log_id = \"\"\n    extra = None\n    conversation_id = \"\"\n\n    def __init__(self, response, stream: bool = False):\n        \"\"\"初始化客户端状态。\"\"\"\n        super().__init__(response, stream)\n        self.error_no = 0\n        self.error_msg = \"\"\n        self.log_id = response.headers.get(\"X-Appbuilder-Request-Id\", None)\n        self.extra = {}\n        \n        if not stream:\n        \n            data = response.json()\n\n            if \"code\" in data and data.get(\"code\") != 0:\n                raise AppBuilderServerException(self.log_id, data[\"code\"], data[\"message\"])\n\n            self.result = data.get(\"result\").get(\"answer\", None)\n            self.conversation_id = data.get(\"result\").get(\"conversation_id\", \"\")\n            content = data.get(\"result\").get(\"content\", None)\n            if content:\n                for item in content:\n                    if item.get(\"content_type\") == \"references\":\n                        references = item.get(\"outputs\").get(\"references\")\n                        if references:\n                            for ref in references:\n                                key = ref[\"from\"]\n                                if key in self.extra.keys():\n                                    self.extra[key].append(ref)\n                                else:\n                                    self.extra[key] = [ref]\n\n    def message_iterable_wrapper(self, message):\n        \"\"\"\n        对模型输出的 Message 对象进行包装。\n        当 Message 是流式数据时，数据被迭代完后，将重新更新 content 为 blocking 的字符串。\n        \"\"\"\n\n        class IterableWrapper:\n            def __init__(self, stream_content):\n                self._content = stream_content\n                self._concat = \"\"\n                self._extra = {}\n\n            def __iter__(self):\n                return self\n\n            def __next__(self):\n                try:\n                    resp = next(self._content)\n                    result_json = resp.get(\"result\")\n                    char = result_json.get(\"answer\", \"\")\n                    conversation_id = result_json.get(\"conversation_id\", \"\")\n                    content = result_json.get(\"content\", None)\n                    if content:\n                        for item in content:\n                            if item.get(\"content_type\") == \"references\":\n                                references = item.get(\"outputs\").get(\"references\")\n                                if references:\n                                    for ref in references:\n                                        key = ref[\"from\"]\n                                        if key in self._extra.keys():\n                                            self._extra[key].append(ref)\n                                        else:\n                                            self._extra[key] = [ref]\n                    message.extra = self._extra  # Update the original extra\n                    message.conversation_id = conversation_id\n                    self._concat += char\n                    return char\n                except StopIteration:\n                    message.content = self._concat  # Update the original content\n                    raise\n\n        from collections.abc import Generator\n        if isinstance(message.content, Generator):\n            # Replace the original content with the custom iterable\n            message.content = IterableWrapper(message.content)\n        return message\n\n    def to_message(self):\n        \"\"\"将响应结果转换为Message对象。\n\n        Returns:\n            Message: Message对象。\n\n        \"\"\"\n        message = ConsoleLLMMessage()\n        message.id = self.log_id\n        message.content = self.result\n        message.extra = self.extra\n        message.conversation_id = self.conversation_id\n        return self.message_iterable_wrapper(message)\n"
  },
  {
    "path": "python/core/console/component_client/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .component_client import ComponentClient"
  },
  {
    "path": "python/core/console/component_client/component_client.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"组件\"\"\"\nimport json\nfrom appbuilder.core.component import Component, Message\nfrom appbuilder.core.console.component_client import data_class\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder.utils.trace.tracer_wrapper import client_run_trace\nfrom appbuilder.utils.sse_util import SSEClient\n\n\nclass ComponentClient(Component):\n    def __init__(self, **kwargs):\n        r\"\"\"初始化\n\n        Returns:\n            response (obj: `ComponentClient`): 组件实例\n        \"\"\"\n        super().__init__(**kwargs)\n\n    @client_run_trace\n    def run(\n        self,\n        component_id: str,\n        sys_origin_query: str,\n        version: str = None,\n        action: str = None,\n        stream: bool = False,\n        sys_file_urls: dict = None,\n        sys_conversation_id: str = None,\n        sys_end_user_id: str = None,\n        sys_chat_history: list = None,\n        **kwargs,\n    ) -> Message:\n        \"\"\" 组件运行\n        Args:\n            component_id (str): 工作流组件ID或官方组件名称\n            sys_origin_query (str): 用户输入的原始查询语句\n            version (str): 组件版本号\n            action (str): 组件动作\n            stream (bool): 是否流式返回\n            sys_file_urls (dict): 文件地址\n            sys_conversation_id (str): 会话ID\n            sys_end_user_id (str): 用户ID\n            sys_chat_history (list): 聊天\n            kwargs: 其他参数\n        Returns:\n            message (Message): 对话结果，一个Message对象，使用message.content获取内容。\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"Content-Type\"] = \"application/json\"\n        headers[\"X-Appbuilder-From\"] = \"sdk\"\n\n        url_suffix = f\"/components/{component_id}\"\n        if version is not None:\n            url_suffix += f\"/version/{version}\"\n        if action is not None:\n            url_suffix += f\"?action={action}\"\n        url = self.http_client.service_url_v2(url_suffix)\n\n        all_params = {\n            '_sys_origin_query': sys_origin_query,\n            '_sys_file_urls': sys_file_urls,\n            '_sys_conversation_id': sys_conversation_id,\n            '_sys_chat_history': sys_chat_history,\n            '_sys_end_user_id': sys_end_user_id,\n            **kwargs\n        }\n        parameters = data_class.RunRequest.Parameters(**all_params)\n        request = data_class.RunRequest(\n            stream=stream,\n            parameters=parameters,\n        )\n\n        response = self.http_client.session.post(\n            url,\n            headers=headers,\n            json=request.model_dump(exclude_none=True, by_alias=True),\n            timeout=None,\n        )\n        request_id = self.http_client.check_response_header(response)\n\n        if stream:\n            client = SSEClient(response)\n            return Message(content=self._iterate_events(request_id, client.events()))\n        else:\n            data = response.json()\n            resp = data_class.RunResponse(**data)\n            return Message(content=resp)\n\n    @staticmethod\n    def _iterate_events(request_id, events):\n        for event in events:\n            try:\n                data = event.data\n                if len(data) == 0:\n                    data = event.raw\n                data = json.loads(data)\n            except json.JSONDecodeError as e:\n                raise AppBuilderServerException(\n                    request_id=request_id,\n                    message=\"json decoder failed {}\".format(str(e)),\n                )\n            resp = data_class.RunResponse(**data)\n            yield resp\n"
  },
  {
    "path": "python/core/console/component_client/data_class.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom pydantic import BaseModel\nfrom pydantic import Field\nfrom typing import Optional, Union\nfrom appbuilder.core.component import ComponentOutput, Content\n\n\nclass RunRequest(BaseModel):\n    \"\"\" Component Run方法请求体 \"\"\"\n    class Parameters(BaseModel, extra=\"allow\"):\n        \"\"\" Parameters\"\"\"\n        class Message(BaseModel):\n            \"\"\" Message\"\"\"\n            role: str = Field(..., description=\"对话角色，枚举：user、assistant\")\n            content: str = Field(..., description=\"对话内容\")\n\n        sys_origin_query: str = Field(\n            ..., description=\"用户query文字，画布中开始节点的系统参数rawQuery\", alias=\"_sys_origin_query\"\n        )\n        sys_file_urls: Optional[dict] = Field(\n            None,\n            description='{\"xxx.pdf\": \"http:///\"}，画布中开始节点的系统参数fileUrls', alias=\"_sys_file_urls\"\n        )\n        sys_conversation_id: Optional[str] = Field(\n            None,\n            description=\"对话id，可通过新建会话接口创建, 画布中开始节点的系统参数conversationId\", alias=\"_sys_conversation_id\"\n        )\n        sys_end_user_id: Optional[str] = Field(\n            None, description=\"终端用户id，画布中开始节点的系统参数end_user_id\", alias=\"_sys_end_user_id\"\n        )\n        sys_chat_history: Optional[list[Message]] = Field(\n            None, description=\"聊天历史记录\", alias=\"_sys_chat_history\"\n        )\n\n    stream: bool = Field(default=False, description='是否流式返回')\n    parameters: Parameters = Field(..., description=\"调用传参\")\n\n\nclass ContentWithEvent(Content):\n    \"\"\" ContentWithEvent \"\"\"\n\n    class Event(BaseModel):\n        \"\"\" Event\"\"\"\n        id: str = Field(..., description=\"事件id\")\n        status: str = Field(...,\n                            description=\"事件状态，枚举：preparing、running、error、done\")\n        name: str = Field(\n            ...,\n            description=\"事件名，相当于调用的深度，深度与前端的渲染逻辑有关系\",\n        )\n        created_time: str = Field(\n            ...,\n            description=\"当前event发送时间\",\n        )\n        error_code: str = Field(\n            None,\n            description=\"错误码\",\n        )\n        error_message: str = Field(\n            None,\n            description=\"错误信息\",\n        )\n\n    event: Event = Field(None, description=\"事件信息\")\n\nclass RunResponse(BaseModel):\n    \"\"\" Component Run方法响应体 \"\"\"\n    conversation_id: str = Field(None, description=\"对话id\")\n    message_id: str = Field(None, description=\"消息id\")\n    trace_id: str = Field(None, description=\"追踪id\")\n    user_id: str = Field(None, description=\"开发者UUID（计费依赖）\")\n    end_user_id: str = Field(None, description=\"终端用户id\")\n    status: str = Field(None, description=\"对话状态，有interrupt, running, error, done四种枚举值\")\n    role: str = Field(None, description=\"当前消息来源，默认tool\")\n    content: list[ContentWithEvent] = Field(\n        None,\n        description=\"当前组件返回内容的主要payload，List[ContentWithEvent]，每个 Content 包括了当前 event 的一个元素\",\n    )\n    request_id: str = Field(None, description=\"请求id\")\n    code: Union[str, int] = Field(None, description=\"响应码\")\n    message: str = Field(None, description=\"响应消息\")\n"
  },
  {
    "path": "python/core/console/dataset/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom .dataset import Dataset\n"
  },
  {
    "path": "python/core/console/dataset/dataset.py",
    "content": "from typing import List, Dict\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.console.dataset.model import DocumentListResponse, AddDocumentsResponse\nfrom appbuilder.core.constants import MAX_DOCUMENTS_NUM, SUPPORTED_FILE_TYPE\nimport json\nimport os\nfrom appbuilder.utils.func_utils import deprecated\nfrom appbuilder.utils.trace.tracer_wrapper import client_tool_trace\n\n\nclass Dataset:\n    r\"\"\"\n    console知识库操作工具\n    \n    Examples:\n    \n    .. code-block:: python\n        \n        import appbuilder\n        import os\n\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n\n        dataset = appbuilder.Dataset.create_dataset(\"baidu-test\")\n\n        # 上传文档\n        file_paths = [\"./test.pdf\"]\n        document_infos = dataset.add_documents(file_paths)\n\n        # 获取第一页的文档列表, 每页10条\n        document_list = dataset.get_documents(1, 10)\n\n        # 删除文档\n        document_ids = [document_infos.document_ids[0]]\n        dataset.delete_documents(document_ids)\n\n    \"\"\"\n    create_url: str = \"/v1/ai_engine/agi_platform/v1/datasets/create\"\n    add_file_url: str = \"/v1/ai_engine/agi_platform/v1/datasets/documents\"\n    get_file_list_url: str = \"/v1/ai_engine/agi_platform/v1/datasets/documents/list_page\"\n    delete_file_url: str = \"/v1/ai_engine/agi_platform/v1/datasets/document/delete\"\n    upload_file_url: str = \"/v1/ai_engine/agi_platform/v1/datasets/files/upload\"\n\n    def __init__(self, dataset_id: str = \"\", dataset_name: str = \"\"):\n        r\"\"\"\n        初始化Dataset实例\n\n        Args:\n            dataset_id: 知识库ID\n            dataset_name: 知识库名称\n\n        Returns:\n            Dataset: 知识库实例\n        \"\"\"\n        self.dataset_id = dataset_id\n        self.dataset_name = dataset_name\n        self._http_client = None\n\n    @property\n    def http_client(self):\n        if self._http_client is None:\n            self._http_client = HTTPClient()\n        return self._http_client\n\n    @classmethod\n    def create_dataset(cls, dataset_name: str):\n        r\"\"\"\n        创建知识库\n        \n        Args:\n            dataset_name: 知识库名称\n            \n        Returns:\n            Dataset: 创建成功的知识库实例\n        \"\"\"\n        payload = json.dumps({\"name\": dataset_name})\n        http_client = HTTPClient()\n        headers = http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        response = http_client.session.post(url=http_client.service_url(cls.create_url),\n                                            headers=headers, data=payload)\n        http_client.check_response_header(response)\n        http_client.check_console_response(response)\n        response = response.json()[\"result\"]\n        return Dataset(dataset_id=response[\"id\"], dataset_name=response[\"name\"])\n\n    @deprecated()\n    def add_documents(self, file_path_list: List[str], is_custom_process_rule: bool = False,\n                      custom_process_rule: Dict = None, is_enhanced: bool = False) -> AddDocumentsResponse:\n        r\"\"\"\n        向知识库中添加文档\n        \n        Args:\n            file_path_list: 文档路径列表\n            is_custom_process_rule: 是否使用自定义文档处理规则, 默认为False, 使用平台的默认规则，为True时使用自定义规则\n            custom_process_rule: 自定义文档规则，当is_custom_process_rule为True时生效，格式示例如下：\n            {\n                \"separators\": [\"。\", \"，\"],    # 文本切分符，支持这几种[ , , \"？\", , \"!\", \"?\", \"……\"]\n                \"target_length\": 300,         # 文本切片片段长度，取值范围[300, 800]\n                \"overlap_rate\": 0.3           # 文本片段重叠率，取值范围[0, 0.3]\n            }\n            is_enhanced: 是否开启知识增强, 默认为False，在检索问答时通过知识点来索引到对应的切片，大模型根据切片内容生成答案，开启知识增强会调用大模型抽取更加丰富的知识点，增加切片的召回率\n            \n        Returns:\n            AddDocumentsResponse: 添加文档的响应结果，包含以下属性：\n            - dataset_id (str): 知识库id\n            - document_ids (List[str]): 文档id列表\n        \"\"\"\n        for file_path in file_path_list:\n            file_type = file_path.split(\".\")[-1].lower()\n            if file_type not in SUPPORTED_FILE_TYPE:\n                raise ValueError(f\"Unsupported file type: {file_path}, only support file types: {SUPPORTED_FILE_TYPE}\")\n\n        documents = self.get_documents(1, MAX_DOCUMENTS_NUM)\n        current_documents_num = len(documents.data)\n        if len(file_path_list) + current_documents_num > MAX_DOCUMENTS_NUM:\n            raise ValueError(f\"too much documents. at most upload {MAX_DOCUMENTS_NUM} documents per dataset，left {MAX_DOCUMENTS_NUM-current_documents_num} documents can be uploaded\")\n\n        file_ids = []\n        for file_path in file_path_list:\n            upload_res = self._upload_document(file_path)\n            file_ids.append(upload_res[\"id\"])\n        payload = {\"dataset_id\": self.dataset_id, \"file_ids\": file_ids,\n                   \"is_custom_process_rule\": is_custom_process_rule, \"is_enhanced\": is_enhanced}\n        if is_custom_process_rule and custom_process_rule:\n            payload[\"custom_process_rule\"] = custom_process_rule\n        payload = json.dumps(payload)\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        response = self.http_client.session.post(url=self.http_client.service_url(self.add_file_url),\n                                                 headers=headers, data=payload)\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        res = AddDocumentsResponse.parse_obj(response.json()[\"result\"])\n        return res\n\n    def _upload_document(self, file_path: str):\n        r\"\"\"\n        上传文档\n        \n        Args:\n            file_path: 文档路径\n            \n        Returns:\n            上传文档的信息\n        \"\"\"\n        headers = self.http_client.auth_header()\n        with open(file_path, 'rb') as file:\n            files = {'file': (os.path.basename(file_path), file)}\n            response = self.http_client.session.post(url=self.http_client.service_url(self.upload_file_url),\n                                                     files=files, headers=headers)\n            self.http_client.check_response_header(response)\n            self.http_client.check_console_response(response)\n            res = response.json()[\"result\"]\n        return res\n\n    @deprecated()\n    def delete_documents(self, document_ids: List[str]):\n        r\"\"\"\n        删除知识库中的文档\n        \n        Args:\n            document_ids: 文档id列表\n\n        Returns:\n            None\n        \"\"\"\n        for document_id in document_ids:\n            self._delete_document(document_id)\n\n    def _delete_document(self, document_id):\n        \"\"\"\n        删除知识库中的文档\n        参数：\n            document_id: 文档id\n        \"\"\"\n        payload = json.dumps({\"dataset_id\": self.dataset_id, \"document_id\": document_id})\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        response = self.http_client.session.post(url=self.http_client.service_url(self.delete_file_url),\n                                                 headers=headers, data=payload)\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n\n    @deprecated()\n    def get_documents(self, page: int, limit: int, keyword: str = \"\") -> DocumentListResponse:\n        r\"\"\"\n        获取知识库中的文档列表\n        \n        Args:\n            page: 第几页\n            limit: 每页文档数\n            keyword: 文件名关键字，支持模糊查询\n            \n        Returns:\n            DocumentListResponses实例，返回示例：\n            {\n            \"data\": [\n                {\n                    \"id\":\"d2d1bc1a-1763-4162-88b2-0dad225da16f\", # 文档id\n                    \"name\": \"唐诗三百首（全集）全新编辑版.pdf\", # 文档名称\n                    \"created_from\": \"web\", # 创建来源\n                    \"created_by\": \"76efed91-cf19-435d-993c-cdd901d6d13c\", # 创建人\n                    \"created_at\": 1705958975, # 创建时间\n                    \"indexing_status\": \"indexing\", # 文档处理状态\n                    \"error\": null, # 文档处理错误信息\n                    \"enabled\": true, # 文档是否启用\n                    \"disabled_at\": null, # 文档禁用时间\n                    \"disabled_by\": null, # 文档禁用人\n                    \"display_status\": \"indexing\", # 文档显示状态，和前端展示状态一致\n                    \"word_count\": 5024 # 文档字数\n                }\n            ],\n            \"has_more\": false, # 是否还有下一页\n            \"limit\": 10, # 每页文档数\n            \"total\": 1, # 总页数\n            \"page\": 1 # 当前页\n            }\n        \"\"\"\n        payload = json.dumps({\"dataset_id\": self.dataset_id, \"page\": page, \"limit\": limit, \"keyword\": keyword})\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        response = self.http_client.session.post(url=self.http_client.service_url(self.get_file_list_url),\n                                                 headers=headers, data=payload)\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        res = DocumentListResponse.parse_obj(response.json()[\"result\"])\n        return res\n"
  },
  {
    "path": "python/core/console/dataset/model.py",
    "content": "from typing import List, Optional\nfrom pydantic import BaseModel\n\n\nclass DocumentInfo(BaseModel):\n    id: str\n    name: str\n    created_at: int\n    indexing_status: str\n    error: Optional[str] = None\n    enabled: bool\n    disabled_at: Optional[int] = None\n    disabled_by: Optional[str] = None\n    display_status: str\n    word_count: int\n\n\nclass DocumentListResponse(BaseModel):\n    data: List[DocumentInfo]\n    has_more: bool\n    limit: int\n    total: int\n    page: int\n\n\nclass AddDocumentsResponse(BaseModel):\n    dataset_id: str\n    document_ids: List[str]\n"
  },
  {
    "path": "python/core/console/knowledge_base/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom .knowledge_base import KnowledgeBase\nfrom .data_class import (\n    CustomProcessRule,\n    DocumentSource,\n    DocumentSourceUrlConfig,\n    DocumentProcessOption,\n    DocumentChoices,\n    DocumentSeparator,\n    DocumentPattern,\n    DocumentChunker,\n)\n"
  },
  {
    "path": "python/core/console/knowledge_base/data_class.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom __future__ import annotations\nfrom datetime import datetime\nfrom pydantic import BaseModel, Field\nfrom enum import Enum\nfrom typing import Union, Optional, List\n\n\nclass KnowledgeBaseUploadFileResponse(BaseModel):\n    request_id: str = Field(..., description=\"请求ID\")\n    id: str = Field(..., description=\"文件ID\")\n    name: str = Field(..., description=\"文件名称\")\n\n\nclass CustomProcessRule(BaseModel):\n    separators: list[str] = Field(..., description=\"分段符号列表\", example=[\n                                  \",\", \"?\"])\n    target_length: int = Field(..., description=\"分段最大长度\", ge=300, le=1200)\n    overlap_rate: float = Field(\n        ..., description=\"分段重叠最大字数占比，推荐值0.25\", ge=0, le=0.3, example=0.2\n    )\n\n\nclass KnowledgeBaseAddDocumentRequest(BaseModel):\n    knowledge_base_id: str = Field(..., description=\"知识库ID\")\n    content_type: str = Field(\n        \"raw_text\", description=\"文档类型\", enum=[\"raw_text\", \"qa\"]\n    )\n    file_ids: list[str] = Field(..., description=\"文件ID列表\")\n    is_enhanced: bool = Field(False, description=\"是否开启知识增强\")\n    custom_process_rule: Optional[CustomProcessRule] = Field(\n        None, description=\"自定义分段规则\"\n    )\n\n\nclass KnowledgeBaseAddDocumentResponse(BaseModel):\n    request_id: str = Field(..., description=\"请求ID\")\n    knowledge_base_id: str = Field(..., description=\"知识库ID\")\n    document_ids: list[str] = Field(..., description=\"成功新建的文档id集合\")\n\n\nclass KnowledgeBaseDeleteDocumentRequest(BaseModel):\n    knowledge_base_id: str = Field(..., description=\"知识库ID\")\n    document_id: str = Field(..., description=\"待删除的文档id\")\n\n\nclass KnowledgeBaseDeleteDocumentResponse(BaseModel):\n    request_id: str = Field(..., description=\"请求ID\")\n\n\nclass KnowledgeBaseGetDocumentsListRequest(BaseModel):\n    knowledge_base_id: str = Field(..., description=\"知识库ID\")\n    limit: int = Field(\n        10, description=\"返回文档数量大小，默认10，最大值100\", le=100, ge=1\n    )\n    after: str = Field(\n        \"\",\n        description=\"用于分页的游标。after 是一个文档的id，它定义了在列表中的位置。例如，如果你发出一个列表请求并收到 10个对象，以 app_id_123 结束，那么你后续的调用可以包含 after=app_id_123 以获取列表的下一页数据。\",\n    )\n    before: str = Field(\n        \"\",\n        description=\"用于分页的游标。与after相反，填写它将获取前一页数据,如果和after都传，两个参数都会起到分页效果，维度是创建时间\",\n    )\n\n\nclass DocumentMeta(BaseModel):\n    source: Optional[str] = Field(None, description=\"文档来源\")\n    file_id: Optional[str] = Field(None, description=\"文档对应的文件ID\")\n    url: Optional[str] = Field(None, description=\"原文件下载链接\")\n    mime_type: Optional[str] = Field(\n        None,\n        description=\"文件类型，目前支持doc/txt/docx/pdf/ppt/pptx/xlsx/xls/csv/json这几种文件类型。如果是通过url方式导入的文档，该值为url\",\n    )\n    file_size: Optional[int] = Field(None, description=\"文件大小，单位bytes\")\n\n\nclass Document(BaseModel):\n    id: str = Field(..., description=\"文档ID\")\n    name: str = Field(..., description=\"文档名称\")\n    created_at: int = Field(..., description=\"文档创建时间\")\n    word_count: int = Field(..., description=\"文档字数\")\n    enabled: bool = Field(True, description=\"文档是否可用\")\n    meta: Optional[DocumentMeta] = Field(\n        ..., description=\"文档元信息，包括source、file_id\"\n    )\n\n\nclass KnowledgeBaseGetDocumentsListResponse(BaseModel):\n    request_id: str = Field(..., description=\"请求ID\")\n    data: list[Document] = Field([], description=\"文档信息列表\")\n\n\nclass DescribeDocumentsRequest(BaseModel):\n    knowledgeBaseId: str = Field(..., description=\"知识库ID\")\n    marker: Optional[str] = Field(None, description=\"起始位置\")\n    maxKeys: int = Field(\n        10, description=\"返回文档数量大小，默认10，最大值100\"\n    )\n\n\nclass DescribeDocumentMeata(BaseModel):\n    source: Optional[str] = Field(None, description=\"文档来源\")\n    fileId: Optional[str] = Field(None, description=\"文档对应的文件ID\")\n\nclass DescribeDocument(BaseModel):\n    id: str = Field(..., description=\"文档ID\")\n    name: str = Field(..., description=\"文档名称\")\n    createdAt: str = Field(..., description=\"文档创建时间\")\n    wordCount: int = Field(..., description=\"文档字数\")\n    enabled: bool = Field(True, description=\"文档是否可用\")\n    displayStatus: str = Field(\n        ...,\n        description=\"文档状态。available：可用，queuing：排队中，notConfigured：数据待配置，parsing：解析中，indexing：处理中，parseError：解析失败，error：处理失败, retrainingSegmentUnusable：重建切片中，切片不可用, retrainErrSegmentUsable：重建切片错误，旧切片可用\",\n    )\n    meta: Optional[DescribeDocumentMeata] = Field(..., description=\"文档元信息，包括source、fileId\")\n\n\nclass DescribeDocumentsResponse(BaseModel):\n    requestId: str = Field(..., description=\"请求ID\")\n    marker: str = Field(..., description=\"起始位置\")\n    isTruncated: bool = Field(\n        ..., description=\"true表示后面还有数据，false表示已经是最后一页\"\n    )\n    nextMarker: str = Field(..., description=\"下一页起始位置\")\n    maxKeys: int = Field(..., description=\"本次查询包含的最大结果集数量\")\n    data: list[DescribeDocument] = Field(..., description=\"文档信息列表\")\n\n\nclass KnowledgeBaseConfigIndex(BaseModel):\n    type: str = Field(..., description=\"索引类型\", enum=[\"public\", \"bes\", \"vdb\"])\n    clusterId: Optional[str] = Field(None, description=\"集群/实例 ID\")\n    username: Optional[str] = Field(None, description=\"bes用户名\")\n    password: Optional[str] = Field(None, description=\"bes密码\")\n    location: Optional[str] = Field(\n        None, description=\"托管资源的区域\", enum=[\"bj\", \"bd\", \"sz\", \"gz\"])\n\n\nclass KnowledgeBaseConfigCatalogue(BaseModel):\n    pathPrefix: Optional[str] = Field(None, description=\"知识库所属目录绝对路径\")\n\n\nclass KnowledgeBaseConfig(BaseModel):\n    index: Optional[KnowledgeBaseConfigIndex] = Field(..., description=\"索引配置\")\n    catalogue: Optional[KnowledgeBaseConfigCatalogue] = Field(\n        None, description=\"知识库目录配置\")\n\n\nclass KnowledgeBaseCreateKnowledgeBaseRequest(BaseModel):\n    name: str = Field(..., description=\"知识库名称\")\n    description: str = Field(None, description=\"知识库描述\")\n    config: Optional[KnowledgeBaseConfig] = Field(..., description=\"知识库配置\")\n\n\nclass KnowledgeBaseGetDetailRequest(BaseModel):\n    id: str = Field(..., description=\"知识库ID\")\n\n\nclass KnowledgeBaseDetailResponse(BaseModel):\n    requestId: str = Field(..., description=\"请求ID\")\n    id: str = Field(..., description=\"知识库ID\")\n    name: str = Field(..., description=\"知识库名称\")\n    description: Optional[str] = Field(None, description=\"知识库描述\")\n    config: Optional[KnowledgeBaseConfig] = Field(..., description=\"知识库配置\")\n\n\nclass KnowledgeBaseModifyRequest(BaseModel):\n    id: str = Field(..., description=\"知识库ID\")\n    name: Optional[str] = Field(None, description=\"知识库名称\")\n    description: Optional[str] = Field(None, description=\"知识库描述\")\n    config: Optional[KnowledgeBaseConfig] = Field(None, description=\"知识库配置\")\n\n\nclass KnowledgeBaseDeleteRequest(BaseModel):\n    id: str = Field(..., description=\"知识库ID\")\n\n\nclass KnowledgeBaseGetListRequest(BaseModel):\n    marker: Optional[str] = Field(None, description=\"起始位置\")\n    keyword: Optional[str] = Field(None, description=\"搜索关键字\")\n    maxKeys: int = Field(\n        10, description=\"返回文档数量大小，默认10，最大值100\", le=100, ge=1\n    )\n\n\nclass KnowledgeBaseGetListConfigIndex(BaseModel):\n    type: str = Field(None, description=\"索引类型\")\n    esUrl: Optional[str] = Field('', description=\"es地址\")\n\n\nclass KnowledgeBaseGetListConfig(BaseModel):\n    index: Optional[KnowledgeBaseGetListConfigIndex] = Field(\n        ..., description=\"索引配置\")\n\n\nclass KnowledgeBaseGetListDetailResponse(BaseModel):\n    id: str = Field(..., description=\"知识库ID\")\n    name: str = Field(..., description=\"知识库名称\")\n    description: Optional[str] = Field(None, description=\"知识库描述\")\n    config: Optional[KnowledgeBaseGetListConfig] = Field(\n        ..., description=\"知识库配置\")\n\n\nclass KnowledgeBaseGetListResponse(BaseModel):\n    requestId: str = Field(..., description=\"请求ID\")\n    data: list[KnowledgeBaseGetListDetailResponse] = Field(\n        [], description=\"知识库详情列表\")\n    marker: str = Field(..., description=\"起始位置\")\n    nextMarker: str = Field(..., description=\"下一页起始位置\")\n    maxKeys: int = Field(10, description=\"返回文档数量大小，默认10，最大值100\")\n    isTruncated: bool = Field(..., description=\"是否有更多结果\")\n\n\nclass DocumentSourceUrlConfig(BaseModel):\n    frequency: int = Field(\n        ...,\n        description=\"更新频率，目前支持的更新频率为-1(不自动更新),1（每天）,3（每3天）,7（每7天）,30（每30天）。\",\n    )\n\n\nclass DocumentSource(BaseModel):\n    type: str = Field(..., description=\"数据来源类型\", enum=[\"bos\", \"web\"])\n    urls: list[str] = Field(None, description=\"文档URL\")\n    urlDepth: int = Field(None, description=\"url下钻深度，1时不下钻\")\n    urlConfigs: Optional[list[DocumentSourceUrlConfig]] = Field(\n        None, description=\"该字段的长度需要和source、urls字段长度保持一致。\")\n\n\nclass DocumentChoices(BaseModel):\n    choices: list[str] = Field(..., description=\"选择项\")\n\n\nclass DocumentSeparator(BaseModel):\n    separators: list[str] = Field(..., description=\"分段符号\")\n    targetLength: int = Field(..., description=\"分段最大长度\")\n    overlapRate: float = Field(..., description=\"分段重叠最大字数占比，推荐值0.25\")\n\n\nclass DocumentPattern(BaseModel):\n    markPosition: str = Field(\n        ...,\n        description=\"命中内容放置策略, head：前序切片, tail：后序切片, drop：匹配后丢弃\",\n        enum=[\"head\", \"tail\", \"drop\"],\n    )\n    regex: str = Field(..., description=\"正则表达式\")\n    targetLength: int = Field(..., description=\"分段最大长度\")\n    overlapRate: float = Field(..., description=\"分段重叠最大字数占比，推荐值0.25\")\n\n\nclass DocumentChunker(BaseModel):\n    choices: list[str] = Field(\n        ...,\n        description=\"使用哪些chunker方法 (separator | pattern | onePage)，separator：自定义切片—标识符，pattern：自定义切片—标识符中选择正则表达式，onePage：整文件切片\",\n    )\n    prependInfo: list[str] = Field(\n        None,\n        description=\"chunker关联元数据，可选值为title (增加标题), filename(增加文件名)\",\n    )\n    separator: Optional[DocumentSeparator] = Field(None, description=\"分段符号\")\n    pattern: Optional[DocumentPattern] = Field(None, description=\"正则表达式\")\n\n\nclass DocumentProcessOption(BaseModel):\n    template: str = Field(\n        ...,\n        description=\"模板类型，ppt: 模版配置—ppt幻灯片, resume：模版配置—简历文档, paper：模版配置—论文文档, custom：自定义配置—自定义切片, default：自定义配置—默认切分\",\n        enum=[\"ppt\", \"paper\", \"qaPair\", \"resume\", \" custom\", \"default\"],\n    )\n    parser: Optional[DocumentChoices] = Field(\n        None,\n        description=\"解析方法(文字提取默认启动，参数不体现，layoutAnalysis版面分析，ocr光学字符识别，pageImageAnalysis文档图片解析，chartAnalysis图表解析，tableAnalysis表格深度解析，按需增加)\",\n    )\n    knowledgeAugmentation: Optional[DocumentChoices] = Field(\n        None,\n        description=\"知识增强，faq、spokenQuery、spo、shortSummary按需增加。问题生成:faq、spokenQuery，段落摘要:shortSummary，三元组知识抽取:spo\",\n    )\n    chunker: Optional[DocumentChunker] = Field(None, description=\"分段器类型\")\n\n\nclass KnowledgeBaseCreateDocumentsRequest(BaseModel):\n    id: str = Field(..., description=\"知识库ID\")\n    source: DocumentSource = Field(..., description=\"文档来源\")\n    contentFormat: str = Field(\n        ...,\n        description=\"文档内容格式, (rawText 普通文件上传)\"\n    )\n    processOption: Optional[DocumentProcessOption] = Field(\n        None, description=\"文档处理选项\"\n    )\n\n\nclass KnowledgeBaseCreateDocumentsResponse(BaseModel):\n    requestId: str = Field(..., description=\"请求ID\")\n    documentIds: list[str] = Field(..., description=\"文档ID列表\")\n\n\nclass KnowledgeBaseUploadDocumentsResponse(BaseModel):\n    requestId: str = Field(..., description=\"请求ID\")\n    documentId: str = Field(..., description=\"文档ID\")\n\n\nclass CreateChunkRequest(BaseModel):\n    knowledgeBaseId: str = Field(None, description=\"知识库ID\")\n    documentId: str = Field(..., description=\"文档ID\")\n    content: str = Field(..., description=\"文档内容\")\n\n\nclass CreateChunkResponse(BaseModel):\n    id: str = Field(..., description=\"切片ID\")\n\n\nclass ModifyChunkRequest(BaseModel):\n    knowledgeBaseId: str = Field(None, description=\"知识库ID\")\n    chunkId: str = Field(..., description=\"切片ID\")\n    content: str = Field(..., description=\"文档内容\")\n    enable: bool = Field(..., description=\"是否启用\")\n\n\nclass DeleteChunkRequest(BaseModel):\n    knowledgeBaseId: str = Field(None, description=\"知识库ID\")\n    chunkId: str = Field(..., description=\"切片ID\")\n\n\nclass DescribeChunkRequest(BaseModel):\n    knowledgeBaseId: str = Field(None, description=\"知识库ID\")\n    chunkId: str = Field(..., description=\"切片ID\")\n\n\nclass DescribeChunkResponse(BaseModel):\n    id: str = Field(..., description=\"切片ID\")\n    type: str = Field(..., description=\"切片类型\")\n    knowledgeBaseId: str = Field(..., description=\"知识库ID\")\n    documentId: str = Field(..., description=\"文档ID\")\n    content: str = Field(..., description=\"文档内容\")\n    enabled: bool = Field(..., description=\"是否启用\")\n    wordCount: int = Field(..., description=\"切片内字符数量\")\n    tokenCount: int = Field(..., description=\"切片内token数量\")\n    status: str = Field(..., description=\"切片状态\")\n    statusMessage: str = Field(..., description=\"切片状态信息\")\n    imageUrls: list[str] = Field(..., description=\"图片地址\")\n    createTime: int = Field(..., description=\"创建时间\")\n    updateTime: int = Field(None, description=\"更新时间\")\n\n\nclass DescribeChunksRequest(BaseModel):\n    knowledgeBaseId: str = Field(None, description=\"知识库ID\")\n    documentId: str = Field(..., description=\"文档ID\")\n    marker: Optional[str] = Field(None, description=\"起始位置\")\n    maxKeys: Optional[int] = Field(\n        None, description=\"返回文档数量大小，默认10，最大值100\"\n    )\n    type: Optional[str] = Field(\n        None, description=\"切片类型。RAW：原文切片、NEW：新增切片、COPY：复制切片\"\n    )\n    keyword: Optional[str] = Field(\n        None, description=\"根据关键字模糊匹配切片，最大长度2000字符\"\n    )\n\n\nclass DescribeChunksResponse(BaseModel):\n    data: list[DescribeChunkResponse] = Field(..., description=\"切片列表\")\n    marker: str = Field(..., description=\"起始位置\")\n    isTruncated: bool = Field(\n        ..., description=\"true表示后面还有数据，false表示已经是最后一页\"\n    )\n    nextMarker: str = Field(..., description=\"下一页起始位置\")\n    maxKeys: int = Field(..., description=\"本次查询包含的最大结果集数量\")\n\n\nclass MetadataFilter(BaseModel):\n    operator: str = Field(..., description=\"操作符名称。==:等于，in:在数组中，not_in:不在数组中\")\n    field: str = Field(None, description=\"字段名，目前支持doc_id\")\n    value: Union[str, list[str]] = Field(\n        ..., description=\"字段值，如果是in操作符，value为数组\"\n    )\n\n\nclass MetadataFilters(BaseModel):\n    filters: list[MetadataFilter] = Field(..., description=\"过滤条件\")\n    condition: str = Field(..., description=\"文档组合条件。and:与，or:或\")\n\n\nclass PreRankingConfig(BaseModel):\n    bm25_weight: float = Field(\n        None, description=\"粗排bm25比重，取值范围在 [0, 1]，默认0.75\"\n    )\n    vec_weight: float = Field(\n        None, description=\"粗排向量余弦分比重，取值范围在 [0, 1]，默认0.25\"\n    )\n    bm25_b: float = Field(\n        None, description=\"控制文档长度对评分影响的参数，取值范围在 [0, 1]，默认0.75\"\n    )\n    bm25_k1: float = Field(\n        None,\n        description=\"词频饱和因子，控制词频（TF）对评分的影响，常取值范围在 [1.2, 2.0]，默认1.5\",\n    )\n    bm25_max_score: float = Field(\n        None, description=\"得分归一化参数，不建议修改，默认50\"\n    )\n\n\nclass QueryType(str, Enum):\n    FULLTEXT = \"fulltext\"  # 全文检索\n    SEMANTIC = \"semantic\"  # 语义检索\n    HYBRID = \"hybrid\"  # 混合检索\n\n\nclass ElasticSearchRetrieveConfig(BaseModel):  # 托管资源为共享资源 或 BES资源时使用该配置\n    name: str = Field(..., description=\"配置名称\")\n    type: str = Field(None, description=\"elastic_search标志，该节点为es全文检索\")\n    threshold: float = Field(None, description=\"得分阈值，默认0.1\")\n    top: int = Field(None, description=\"召回数量，默认400\")\n\n\nclass VectorDBRetrieveConfig(BaseModel):\n    name: str = Field(..., description=\"该节点的自定义名称。\")\n    type: str = Field(\"vector_db\", description=\"该节点的类型，默认为vector_db。\")\n    threshold: Optional[float] = Field(\n        0.1, description=\"得分阈值。取值范围：[0, 1]\", ge=0.0, le=1.0)\n    top: Optional[int] = Field(\n        400, description=\"召回数量。取值范围：[0, 800]\", ge=0, le=800)\n    pre_ranking: Optional[PreRankingConfig] = Field(None, description=\"粗排配置\")\n\n\nclass SmallToBigConfig(BaseModel):\n    name: str = Field(..., description=\"配置名称\")\n    type: str = Field(\n        \"small_to_big\", description=\"small_to_big标志，该节点为small_to_big节点\")\n\n\nclass RankingConfig(BaseModel):\n    name: str = Field(..., description=\"配置名称\")\n    type: str = Field(None, description=\"ranking标志，该节点为ranking节点\")\n    inputs: list[str] = Field(\n        ...,\n        description='输入的节点名，如es检索配置的名称为pipeline_001，则该inputs为[\"pipeline_001\"]',\n    )\n    model_name: str = Field(None, description=\"ranking模型名（当前仅一种，暂不生效）\")\n    top: int = Field(None, description=\"取切片top进行排序，默认20，最大400\")\n\n\nclass QueryPipelineConfig(BaseModel):\n    id: str = Field(\n        None, description=\"配置唯一标识，如果用这个id，则引用已经配置好的QueryPipeline\"\n    )\n    pipeline: list[Union[ElasticSearchRetrieveConfig, RankingConfig, VectorDBRetrieveConfig, SmallToBigConfig]] = Field(\n        None, description=\"配置的Pipeline，如果没有用id，可以用这个对象指定一个新的配置\"\n    )\n\n\nclass QueryKnowledgeBaseRequest(BaseModel):\n    query: str = Field(..., description=\"检索query\")\n    type: Optional[QueryType] = Field(\n        None, description=\"检索策略的枚举, fulltext:全文检索, semantic:语义检索, hybrid:混合检索\")\n    top: int = Field(None, description=\"返回结果数量\")\n    skip: int = Field(\n        None,\n        description=\"跳过多少条记录, 通过top和skip可以实现类似分页的效果，比如top 10 skip 0，取第一页的10个，top 10 skip 10，取第二页的10个\",\n    )\n    rank_score_threshold: float = Field(\n        0.4,\n        description=\"重排序匹配分阈值，只有rank_score大于等于该分值的切片重排序时才会被筛选出来。当且仅当，pipeline_config中配置了ranking节点时，该过滤条件生效。取值范围： [0, 1]。\",\n        ge=0.0,\n        le=1.0,\n    )\n    knowledgebase_ids: list[str] = Field(..., description=\"知识库ID列表\")\n    metadata_filters: Optional[MetadataFilters] = Field(None, description=\"元数据过滤条件\")\n    pipeline_config: Optional[QueryPipelineConfig] = Field(None, description=\"检索配置\")\n\n\nclass RowLine(BaseModel):\n    key: str = Field(..., description=\"列名\")\n    index: int = Field(..., description=\"列号\")\n    value: str = Field(..., description=\"列值\")\n    enable_indexing: bool = Field(..., description=\"是否索引\")\n    enable_response: bool = Field(\n        ...,\n        description=\"是否参与问答（即该列数据是否对大模型可见）。当前值固定为true。\",\n    )\n\n\nclass ChunkLocation(BaseModel):\n    page_num: list[int] = Field(..., description=\"页面\")\n    box: list[list[int]] = Field(\n        ...,\n        description=\"文本内容位置，在视觉上是文本框，格式是长度为4的int数组，含义是[x, y, width, height]\",\n    )\n\n\nclass Chunk(BaseModel):\n    chunk_id: str = Field(..., description=\"切片ID\")\n    knowledgebase_id: str = Field(..., description=\"知识库ID\")\n    document_id: str = Field(..., description=\"文档ID\")\n    document_name: str = Field(None, description=\"文档名称\")\n    meta: dict = Field(None, description=\"文档元数据\")\n    chunk_type: str = Field(..., description=\"切片类型\")\n    content: str = Field(..., description=\"切片内容\")\n    create_time: datetime = Field(..., description=\"创建时间\")\n    update_time: datetime = Field(..., description=\"更新时间\")\n    retrieval_score: float = Field(..., description=\"粗检索得分\")\n    rank_score: float = Field(..., description=\"rerank得分\")\n    locations: ChunkLocation = Field(None, description=\"切片位置\")\n    children: List[Chunk] = Field(None, description=\"子切片\")\n\n\nclass QueryKnowledgeBaseResponse(BaseModel):\n    requestId: str = Field(None, description=\"请求ID\")\n    code: str = Field(None, description=\"状态码\")\n    message: str = Field(None, description=\"状态信息\")\n    chunks: list[Chunk] = Field(..., description=\"切片列表\")\n    total_count: int = Field(..., description=\"切片总数\")\n"
  },
  {
    "path": "python/core/console/knowledge_base/knowledge_base.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport json\nimport uuid\nfrom typing import Optional\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.console.knowledge_base import data_class\nfrom appbuilder.core.component import Message, Component\nfrom appbuilder.utils.func_utils import deprecated\nfrom appbuilder.utils.trace.tracer_wrapper import client_tool_trace\n\n\nclass KnowledgeBase(Component):\n    r\"\"\"\n    console知识库操作工具，用于创建、删除、查询、更新知识库等操作\n\n    Examples:\n\n    .. code-block:: python\n\n        import os\n        import appbuilder\n        os.environ[\"APPBUILDER_TOKEN\"] = \"your_appbuilder_token\"\n\n        my_knowledge_base_id = \"your_knowledge_base_id\"\n        my_knowledge = appbuilder.KnowledgeBase(my_knowledge_base_id)\n        print(\"知识库ID: \", my_knowledge.knowledge_id)\n\n        list_res = my_knowledge.describe_documents()\n        print(\"文档列表: \", list_res)\n    \"\"\"\n\n    def __init__(\n        self,\n        knowledge_id: Optional[str] = None,\n        knowledge_name: Optional[str] = None,\n        **kwargs\n    ):\n        r\"\"\"\n        初始化KnowledgeBase类实例\n\n        Args:\n            knowledge_id (Optional[str]): 知识库ID\n            knowledge_name (Optional[str]): 知识库名称\n        \"\"\"\n        super().__init__(**kwargs)\n        self.knowledge_id = knowledge_id\n        self.knowledge_name = knowledge_name\n\n    @classmethod\n    @deprecated()\n    def create_knowledge(cls, knowledge_name: str) -> \"KnowledgeBase\":\n        r\"\"\" 创建知识库\n\n        Deprecated: use create_knowledge_base instead\n\n        Args:\n            knowledge_name (str): 知识库名称\n\n        Returns:\n            KnowledgeBase: 返回一个KnowledgeBase对象\n        \"\"\"\n        payload = json.dumps({\"name\": knowledge_name})\n        http_client = HTTPClient()\n        headers = http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        create_url = \"/v1/ai_engine/agi_platform/v1/datasets/create\"\n        response = http_client.session.post(\n            url=http_client.service_url(create_url), headers=headers, data=payload\n        )\n        http_client.check_response_header(response)\n        http_client.check_console_response(response)\n        response = response.json()[\"result\"]\n        return KnowledgeBase(\n            knowledge_id=response[\"id\"], knowledge_name=response[\"name\"]\n        )\n\n    @deprecated()\n    def upload_file(\n        self, file_path: str, client_token: str = None\n    ) -> data_class.KnowledgeBaseUploadFileResponse:\n        r\"\"\"\n        上传文件到知识库\n\n        Args:\n            file_path (str): 文件路径\n            client_token (str, optional): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n\n        Returns:\n            KnowledgeBaseUploadFileResponse: 返回一个KnowledgeBaseUploadFileResponse对象，包含以下属性：\n            - request_id (int): 请求id\n            - id (str): 文件id\n            - name (dict): 文件名称\n        \"\"\"\n        if not os.path.exists(file_path):\n            raise FileNotFoundError(\"File {} does not exist\".format(file_path))\n\n        headers = self.http_client.auth_header_v2()\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\"/file\", client_token=client_token)\n\n        with open(file_path, \"rb\") as f:\n            multipart_form_data = {\"file\": (os.path.basename(file_path), f)}\n\n            response = self.http_client.session.post(\n                url=url,\n                headers=headers,\n                files=multipart_form_data,\n            )\n\n            self.http_client.check_response_header(response)\n            self.http_client.check_console_response(response)\n            data = response.json()\n            resp = data_class.KnowledgeBaseUploadFileResponse(**data)\n\n        return resp\n\n    @deprecated()\n    def add_document(\n        self,\n        content_type: str,\n        file_ids: list[str] = [],\n        is_enhanced: bool = False,\n        custom_process_rule: Optional[data_class.CustomProcessRule] = None,\n        knowledge_base_id: Optional[str] = None,\n        client_token: str = None,\n    ) -> data_class.KnowledgeBaseAddDocumentResponse:\n        r\"\"\"\n        添加文档到知识库\n\n        Args:\n            content_type (str): 内容类型，可选值有\"raw_text\", \"qa\"。\n            file_ids (List[str], optional): 文件ID列表。默认为空列表。\n            is_enhanced (bool, optional): 是否增强。默认为False。\n            custom_process_rule (Optional[data_class.CustomProcessRule], optional): 自定义处理规则。默认为None。\n            knowledge_base_id (Optional[str], optional): 知识库ID。默认为None，此时使用当前类的knowledge_id属性。\n            client_token (str): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n\n        Returns:\n            KnowledgeBaseAddDocumentResponse: 添加文档的相应结果。包含以下属性：\n            - request_id (str): 请求ID\n            - knowledge_base_id (str): 知识库ID\n            - document_ids (list[str]): 成功新建的文档id集合\n        \"\"\"\n        if self.knowledge_id == None and knowledge_base_id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledge_base/document\", client_token=client_token\n        )\n\n        request = data_class.KnowledgeBaseAddDocumentRequest(\n            knowledge_base_id=knowledge_base_id or self.knowledge_id,\n            content_type=content_type,\n            file_ids=file_ids,\n            is_enhanced=is_enhanced,\n            custom_process_rule=custom_process_rule,\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump()\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.KnowledgeBaseAddDocumentResponse(**data)\n        return resp\n\n    def delete_document(\n        self,\n        document_id: str,\n        knowledge_base_id: Optional[str] = None,\n        client_token: str = None,\n    ) -> data_class.KnowledgeBaseDeleteDocumentResponse:\n        r\"\"\"\n        删除知识库中的文档\n\n        Args:\n            document_id (str): 文档ID\n            knowledge_base_id (Optional[str], optional): 知识库ID。默认为None，此时使用当前类的knowledge_id属性。\n            client_token (str): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n\n        Returns:\n            KnowledgeBaseDeleteDocumentResponse: 删除文档的响应消息,包含以下属性：\n            - request_id (str): 请求ID\n        \"\"\"\n        if self.knowledge_id == None and knowledge_base_id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledge_base/document\", client_token=client_token\n        )\n        request = data_class.KnowledgeBaseDeleteDocumentRequest(\n            knowledge_base_id=knowledge_base_id or self.knowledge_id,\n            document_id=document_id,\n        )\n        response = self.http_client.session.delete(\n            url=url, headers=headers, params=request.model_dump()\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.KnowledgeBaseDeleteDocumentResponse(**data)\n        return resp\n\n    def describe_documents(self, knowledge_base_id: Optional[str]=None, marker: Optional[str] = None, maxKeys: int = 10):\n        r\"\"\"\n        获取知识库中的文档列表\n        Args:\n            knowledge_base_id (Optional[str], optional): 知识库ID。默认为None，此时使用当前类的knowledge_id属性。\n            marker (Optional[str], optional): 分页标记。默认为None。\n            maxKeys (int, optional): 最大键数。默认为10。\n\n        Returns:\n            DescribeDocumentsResponse: 描述文档的响应消息, 一个DescribeDocumentsResponse对象,包含以下属性：\n            - data (list[DescribeDocument]): 切片列表\n            - marker (str): 起始位置\n            - isTruncated (bool): true表示后面还有数据，false表示已经是最后一页\n            - nextMarker (str): 下一页起始位置\n            - maxKeys (int): 本次查询包含的最大结果集数量\n        \"\"\"\n        if self.knowledge_id == None and knowledge_base_id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        url = self.http_client.service_url_v2(\"/knowledgeBase?Action=DescribeDocuments\")\n        request = data_class.DescribeDocumentsRequest(\n            knowledgeBaseId=knowledge_base_id or self.knowledge_id,\n            marker=marker,\n            maxKeys=maxKeys\n        )\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.DescribeDocumentsResponse(**data)\n        return resp\n\n    @deprecated(\"use describe_documents instead\")\n    def get_documents_list(\n        self,\n        limit: int = 10,\n        after: Optional[str] = \"\",\n        before: Optional[str] = \"\",\n        knowledge_base_id: Optional[str] = None,\n    ) -> data_class.KnowledgeBaseGetDocumentsListResponse:\n        r\"\"\"\n        获取知识库中的文档列表\n\n        Args:\n            limit (int, optional): 限制数量。默认为10。\n            after (Optional[str], optional): 起始位置。默认为空字符串\"\"。\n            before (Optional[str], optional): 结束位置。默认为空字符串\"\"。\n            knowledge_base_id (Optional[str], optional): 知识库ID。默认为None，此时使用当前类的knowledge_id属性。\n\n        Returns:\n            KnowledgeBaseGetDocumentsListResponse: 知识库文档列表服务的响应消息,包含以下属性：\n            - request_id (str): 请求ID\n            - data (list[Document]): 文档信息列表\n        \"\"\"\n        if self.knowledge_id == None and knowledge_base_id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        url = self.http_client.service_url_v2(\"/knowledge_base/documents\")\n        request = data_class.KnowledgeBaseGetDocumentsListRequest(\n            knowledge_base_id=knowledge_base_id or self.knowledge_id,\n            limit=limit,\n            after=after,\n            before=before,\n        )\n        response = self.http_client.session.get(\n            url=url, headers=headers, params=request.model_dump()\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.KnowledgeBaseGetDocumentsListResponse(**data)\n        return resp\n\n    def create_knowledge_base(\n        self,\n        name: str,\n        description: str,\n        type: str = \"public\",\n        clusterId: str = None,\n        esUserName: str = None,\n        esPassword: str = None,\n        location: str = None,\n        client_token: str = None,\n        pathPrefix: str = None,\n    ) -> data_class.KnowledgeBaseDetailResponse:\n        r\"\"\"\n        创建知识库\n\n        Args:\n            name (str): 知识库名称。\n            description (str): 知识库描述。\n            type (str, optional): 知识库类型。默认为\"public\"。\n            esUrl (str, optional): Elasticsearch服务器地址。默认为None。\n            esUserName (str, optional): Elasticsearch用户名。默认为None。\n            esPassword (str, optional): Elasticsearch密码。默认为None。\n            client_token (str, optional): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n            pathPrefix (str, optional): 知识库所属目录绝对路径。默认为None。\n\n\n        Returns:\n            KnowledgeBaseDetailResponse: 创建知识库的响应消息,包含以下属性：\n            - id (str): 知识库ID\n            - name (str): 知识库名称\n            - description (Optional[str], optional): 知识库描述\n            - config (Optional[KnowledgeBaseConfig], optional): 知识库配置\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=CreateKnowledgeBase\", client_token=client_token\n        )\n\n        request = data_class.KnowledgeBaseCreateKnowledgeBaseRequest(\n            name=name,\n            description=description,\n            config={\n                \"index\": {\n                    \"type\": type,\n                    \"clusterId\": clusterId,\n                    \"username\": esUserName,\n                    \"password\": esPassword,\n                    \"location\": location,\n                },\n            },\n        )\n\n        if pathPrefix != None:\n            request.config.catalogue = {\n                \"pathPrefix\": pathPrefix,\n            }\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.KnowledgeBaseDetailResponse(**data)\n        self.knowledge_id = resp.id\n        self.knowledge_name = resp.name\n        return resp\n\n    def get_knowledge_base_detail(\n        self, knowledge_base_id: Optional[str] = None\n    ) -> data_class.KnowledgeBaseDetailResponse:\n        r\"\"\"\n        获取知识库详情\n\n        Args:\n            knowledge_base_id (Optional[str], optional): 知识库ID，如果不指定则使用当前实例的knowledge_id属性。默认值为None。\n\n        Returns:\n            KnowledgeBaseDetailResponse: 知识库详情，返回一个KnowledgeBaseDetailResponse对象,包含以下属性：\n            - id (str): 知识库ID\n            - name(str): 知识库名称\n            - description(Optional[str], optional): 知识库描述\n            - config(Optional[KnowledgeBaseConfig], optional): 知识库配置\n        \"\"\"\n        if self.knowledge_id == None and knowledge_base_id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n\n        request = data_class.KnowledgeBaseGetDetailRequest(\n            id=knowledge_base_id or self.knowledge_id\n        )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=DescribeKnowledgeBase\"\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump()\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.KnowledgeBaseDetailResponse(**data)\n        return resp\n\n    def modify_knowledge_base(\n        self,\n        knowledge_base_id: Optional[str] = None,\n        name: Optional[str] = None,\n        description: Optional[str] = None,\n        client_token: str = None,\n        pathPrefix: str = None,\n    ):\n        r\"\"\"\n        修改知识库信息\n\n        Args:\n            knowledge_base_id (Optional[str], optional): 知识库ID，如果不指定则使用当前实例的knowledge_id属性。默认值为None。\n            name (Optional[str], optional): 新的知识库名称。默认值为None。\n            description (Optional[str], optional): 新的知识库描述。默认值为None。\n            client_token (str, optional): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n            pathPrefix (str, optional): 知识库所属目录绝对路径。默认为None。\n\n        Returns:\n            dict: 响应数据，包含请求ID: requestId。\n        \"\"\"\n        if self.knowledge_id == None and knowledge_base_id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n        request = data_class.KnowledgeBaseModifyRequest(\n            id=knowledge_base_id or self.knowledge_id,\n            name=name,\n            description=description,\n        )\n\n        if pathPrefix != None:\n            request.config = {\n                \"catalogue\": {\n                    \"pathPrefix\": pathPrefix,\n                }\n            }\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=ModifyKnowledgeBase\", client_token=client_token\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        return data\n\n    def delete_knowledge_base(\n        self, knowledge_base_id: Optional[str] = None, client_token: str = None\n    ):\n        r\"\"\"\n        删除知识库\n\n        Args:\n            knowledge_base_id (Optional[str], optional): 知识库ID，如果不指定则使用当前实例的knowledge_id属性。默认值为None。\n            client_token (str, optional): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n\n        Returns:\n            响应数据，包含请求ID: requestId\n        \"\"\"\n        if self.knowledge_id == None and knowledge_base_id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n        request = data_class.KnowledgeBaseDeleteRequest(\n            id=knowledge_base_id or self.knowledge_id\n        )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=DeleteKnowledgeBase\", client_token=client_token\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump()\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        return data\n\n    def create_documents(\n        self,\n        id: Optional[str] = None,\n        contentFormat: str = \"\",\n        source: data_class.DocumentSource = None,\n        processOption: data_class.DocumentProcessOption = None,\n        client_token: str = None,\n    ) -> data_class.KnowledgeBaseCreateDocumentsResponse:\n        r\"\"\"\n        创建文档\n\n        Args:\n            id (Optional[str], optional): 知识库ID，如果不指定则使用当前实例的knowledge_id属性。默认值为None。\n            contentFormat (str, optional): 文档内容格式，可以是\"rawText\"。默认值为\"\"。\n            source (data_class.DocumentSource, optional): 文档源数据。默认值为None。\n            processOption (data_class.DocumentProcessOption, optional): 文档处理选项。默认值为None。\n            client_token (str, optional): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n\n        Returns:\n            KnowledgeBaseCreateDocumentsResponse: 创建知识库文档的响应消息，返回一个KnowledgeBaseCreateDocumentsResponse对象，包含以下属性：\n            - requestId (str): 请求ID\n            - documentIds (list[str]): 文档ID列表\n        \"\"\"\n        if self.knowledge_id == None and id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=CreateDocuments\", client_token=client_token\n        )\n\n        request = data_class.KnowledgeBaseCreateDocumentsRequest(\n            id=id or self.knowledge_id,\n            source=source,\n            contentFormat=contentFormat,\n            processOption=processOption,\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.KnowledgeBaseCreateDocumentsResponse(**data)\n        return resp\n\n    def get_knowledge_base_list(\n        self,\n        knowledge_base_id: Optional[str] = None,\n        maxKeys: int = 10,\n        keyword: Optional[str] = None,\n    ) -> data_class.KnowledgeBaseGetListResponse:\n        r\"\"\"\n        获取知识库列表\n\n        Args:\n            knowledge_base_id (Optional[str], optional): 知识库ID，如果不指定则使用当前实例的knowledge_id属性。默认值为None。\n            maxKeys (int, optional): 最大键数。默认值为10。\n            keyword (Optional[str], optional): 关键字。默认值为None。\n\n        Returns:\n            KnowledgeBaseGetListResponse: 获取知识库列表的响应消息，返回一个KnowledgeBaseGetListResponse对象，包含以下属性：\n            - requestId (str): 请求ID\n            - data (list[KnowledgeBaseDetailResponse]): 知识库详情列表\n            - marker (str): 起始位置\n            - nextMarker (str): 下一页起始位置\n            - maxKeys (int): 返回文档数量大小，默认10，最大值100\n            - isTruncated (bool): 是否有更多结果\n        \"\"\"\n        request = data_class.KnowledgeBaseGetListRequest(\n            marker=knowledge_base_id or self.knowledge_id,\n            maxKeys=maxKeys,\n            keyword=keyword,\n        )\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=DescribeKnowledgeBases\"\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.KnowledgeBaseGetListResponse(**data)\n        return resp\n\n    def upload_documents(\n        self,\n        file_path: str,\n        content_format: str = \"rawText\",\n        id: Optional[str] = None,\n        processOption: data_class.DocumentProcessOption = None,\n        client_token: str = None,\n    ) -> data_class.KnowledgeBaseUploadDocumentsResponse:\n        r\"\"\"\n        上传文档\n\n        Args:\n            file_path (str): 文件路径\n            content_format (str, optional): 内容格式。默认值为\"rawText\"。\n            id (Optional[str], optional): 知识库ID，如果不指定则使用当前实例的knowledge_id属性。默认值为None。\n            processOption (data_class.DocumentProcessOption, optional): 文档处理选项。默认值为None。\n            client_token (str, optional): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n\n        Returns:\n            KnowledgeBaseUploadDocumentsResponse: 创建知识库文档的响应消息，返回一个KnowledgeBaseUploadDocumentsResponse对象，包含以下属性：\n            - requestId (str): 请求ID\n            - documentId (str): 文档ID\n        \"\"\"\n        if not os.path.exists(file_path):\n            raise FileNotFoundError(\"File {} does not exist\".format(file_path))\n\n        headers = self.http_client.auth_header_v2()\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=UploadDocuments\", client_token=client_token\n        )\n\n        with open(file_path, \"rb\") as f:\n            multipart_form_data = {\"file\": (os.path.basename(file_path), f)}\n\n            request = data_class.KnowledgeBaseCreateDocumentsRequest(\n                id=id or self.knowledge_id,\n                source=data_class.DocumentSource(type=\"file\"),\n                contentFormat=content_format,\n                processOption=processOption,\n            )\n\n            data = {\n                \"payload\": request.model_dump_json(exclude_none=True),\n            }\n\n            response = self.http_client.session.post(\n                url=url,\n                headers=headers,\n                data=data,\n                files=multipart_form_data,\n            )\n\n            self.http_client.check_response_header(response)\n            self.http_client.check_console_response(response)\n            data = response.json()\n            resp = data_class.KnowledgeBaseUploadDocumentsResponse(**data)\n\n        return resp\n\n    def create_chunk(\n        self,\n        documentId: str,\n        content: str,\n        client_token: str = None,\n        knowledgebase_id: Optional[str] = None,\n    ) -> data_class.CreateChunkResponse:\n        r\"\"\"\n        创建文档块\n\n        Args:\n            documentId (str): 文档ID\n            content (str): 内容\n            client_token (str, optional): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n\n        Returns:\n            CreateChunkResponse: 创建文档块的相应消息, 包含以下属性：\n            - id (str): 切片ID\n        \"\"\"\n\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=CreateChunk\", client_token=client_token\n        )\n\n        request = data_class.CreateChunkRequest(\n            knowledgeBaseId=knowledgebase_id or self.knowledge_id,\n            documentId=documentId,\n            content=content,\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.CreateChunkResponse(**data)\n        return resp\n\n    def modify_chunk(\n        self,\n        chunkId: str,\n        content: str,\n        enable: bool,\n        knowledgebase_id: Optional[str] = None,\n        client_token: str = None,\n    ):\n        r\"\"\"\n        修改文档块\n\n        Args:\n            chunkId (str): 文档块ID\n            content (str): 内容\n            enable (bool): 是否启用\n\n        Returns:\n            dict: 响应数据，包含请求ID: requestId\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=ModifyChunk\", client_token=client_token\n        )\n\n        request = data_class.ModifyChunkRequest(\n            knowledgeBaseId=knowledgebase_id or self.knowledge_id,\n            chunkId=chunkId,\n            content=content,\n            enable=enable,\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        return data\n\n    def delete_chunk(\n        self,\n        chunkId: str,\n        knowledgebase_id: Optional[str] = None,\n        client_token: str = None,\n    ):\n        r\"\"\"\n        删除文档块\n\n        Args:\n            chunkId (str): 文档块ID\n            client_token (str, optional): 客户端令牌。默认为None，此时会自动生成一个随机UUID作为客户端令牌。\n\n        Returns:\n            dict: 响应数据，包含请求ID: requestId\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        if not client_token:\n            client_token = str(uuid.uuid4())\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=DeleteChunk\", client_token=client_token\n        )\n\n        request = data_class.DeleteChunkRequest(\n            knowledgeBaseId=knowledgebase_id or self.knowledge_id,\n            chunkId=chunkId,\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        return data\n\n    def describe_chunk(\n        self,\n        chunkId: str,\n        knowledgebase_id: Optional[str] = None,\n    ) -> data_class.DescribeChunkResponse:\n        r\"\"\"\n        获取文档块详情\n\n        Args:\n            chunkId (str): 文档块ID\n\n        Returns:\n            DescribeChunkResponse: 文档块详情，一个DescribeChunkResponse对象,包含以下属性：\n            - id (str): 切片ID\n            - type (str): 切片类型\n            - knowledgeBaseId (str): 知识库ID\n            - documentId (str): 文档ID\n            - content (str): 文档内容\n            - enabled (bool): 是否启用\n            - wordCount (int): 切片内字符数量\n            - tokenCount (int): 切片内token数量\n            - status (str): 切片状态\n            - statusMessage (str): 切片状态信息\n            - createTime (int): 创建时间\n            - updateTime (int): 更新时间\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        url = self.http_client.service_url_v2(\"/knowledgeBase?Action=DescribeChunk\")\n\n        request = data_class.DescribeChunkRequest(\n            knowledgeBaseId=knowledgebase_id or self.knowledge_id,\n            chunkId=chunkId,\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.DescribeChunkResponse(**data)\n        return resp\n\n    def describe_chunks(\n        self,\n        documentId: str,\n        knowledgebase_id: Optional[str] = None,\n        marker: str = None,\n        maxKeys: int = None,\n        type: str = None,\n        keyword: str = None,\n    ) -> data_class.DescribeChunksResponse:\n        r\"\"\"\n        获取文档块列表\n\n        Args:\n            documentId (str): 文档ID\n            marker (str, optional): 分页标记，用于指定从哪个位置开始返回结果。默认为None，表示从头开始返回结果。\n            maxKeys (int, optional): 最大返回数量，用于限制每次请求返回的最大文档块数目。默认为None，表示不限制返回数量。\n            type (str, optional): 文档块类型。默认为None，表示不限定类型。\n            keyword (str, optional): 根据关键字模糊匹配切片，最大长度2000字符。\n\n        Returns:\n            DescribeChunksResponse: 文档块列表，一个DescribeChunksResponse对象,包含以下属性：\n            - data (list[DescribeChunkResponse]): 切片列表\n            - marker (str): 起始位置\n            - isTruncated (bool): true表示后面还有数据，false表示已经是最后一页\n            - nextMarker (str): 下一页起始位置\n            - maxKeys (int): 本次查询包含的最大结果集数量\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        url = self.http_client.service_url_v2(\n            \"/knowledgeBase?Action=DescribeChunks\")\n\n        request = data_class.DescribeChunksRequest(\n            knowledgeBaseId=knowledgebase_id or self.knowledge_id,\n            documentId=documentId,\n            marker=marker,\n            maxKeys=maxKeys,\n            type=type,\n            keyword=keyword,\n        )\n\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.DescribeChunksResponse(**data)\n        return resp\n\n    def get_all_documents(self, knowledge_base_id: Optional[str] = None) -> list:\n        \"\"\"\n        获取知识库中所有文档。\n\n        Args:\n            knowledge_base_id (Optional[str], optional): 知识库的ID。如果为None，则使用当前实例的knowledge_id。默认为None。\n\n        Returns:\n            list: 包含所有文档的列表。\n\n        Raises:\n            ValueError: 如果knowledge_base_id为空，且当前实例没有已创建的knowledge_id时抛出。\n        \"\"\"\n\n        if self.knowledge_id == None and knowledge_base_id == None:\n            raise ValueError(\n                \"knowledge_base_id cannot be empty, please call `create` first or use existing one\"\n            )\n        knowledge_base_id = knowledge_base_id or self.knowledge_id\n        doc_list = []\n        response_per_time = self.get_documents_list(\n            knowledge_base_id=knowledge_base_id, limit=100\n        )\n        list_len_per_time = len(response_per_time.data)\n        if list_len_per_time != 0:\n            doc_list.extend(response_per_time.data)\n        while list_len_per_time == 100:\n            after_id = response_per_time.data[-1].id\n            response_per_time = self.get_documents_list(\n                knowledge_base_id=knowledge_base_id, after=after_id, limit=100\n            )\n            list_len_per_time = len(response_per_time.data)\n            if list_len_per_time != 0:\n                doc_list.extend(response_per_time.data)\n\n        return doc_list\n\n    def query_knowledge_base(\n        self,\n        query: str,\n        knowledgebase_ids: list[str],\n        type: Optional[data_class.QueryType] = None,\n        metadata_filters: Optional[data_class.MetadataFilters] = None,\n        pipeline_config: Optional[data_class.QueryPipelineConfig] = None,\n        rank_score_threshold: Optional[float] = 0.4,\n        top: int = 6,\n        skip: int = 0,\n    ) -> data_class.QueryKnowledgeBaseResponse:\n        \"\"\"\n        检索知识库\n\n        Args:\n            request (data_class.QueryKnowledgeBaseRequest): 检索知识库的请求对象\n\n        Returns:\n            data_class.QueryKnowledgeBaseResponse: 检索知识库的响应对象\n        \"\"\"\n        headers = self.http_client.auth_header_v2()\n        headers[\"content-type\"] = \"application/json\"\n\n        url = self.http_client.service_url_v2(\"/knowledgebases/query\")\n        request = data_class.QueryKnowledgeBaseRequest(\n            query=query,\n            knowledgebase_ids=knowledgebase_ids,\n            type=type,\n            metadata_filters=metadata_filters,\n            pipeline_config=pipeline_config,\n            rank_score_threshold=rank_score_threshold,\n            top=top,\n            skip=skip,\n        )\n        response = self.http_client.session.post(\n            url=url, headers=headers, json=request.model_dump(\n                exclude_none=True)\n        )\n\n        self.http_client.check_response_header(response)\n        self.http_client.check_console_response(response)\n        data = response.json()\n\n        resp = data_class.QueryKnowledgeBaseResponse(**data)\n        return resp\n"
  },
  {
    "path": "python/core/console/rag/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom .rag import RAG\n"
  },
  {
    "path": "python/core/console/rag/rag.py",
    "content": "import json\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core.component import Message, Component\nfrom appbuilder.core.console.base import ConsoleCompletionResponse\n\n\nclass RAG(Component):\n    \"\"\"\n    console RAG组件，利用console端RAG应用进行问答\n    \n    Examples:\n    \n    .. code-block:: python\n    \n        import appbuilder\n        import os\n\n        os.environ[\"APPBUILDER_TOKEN\"] = '...'\n        conversation_id = '...'\n        app_id = '...' # 线上知识库ID\n        conversation_id = '...' # 会话ID，可选参数，不传默认新建会话\n        rag_app = appbuilder.console.RAG(app_id)\n        query = \"中国的首都在哪里\"\n        answer = rag_app.run(appbuilder.Message(query)) # 新建会话\n        print(answer)\n        conversation_id = answer.conversation_id # 获取会话ID，可用于下次会话\n        print(conversation_id)\n        query = \"它有哪些旅游景点\"\n        answer = rag_app.run(appbuilder.Message(query), conversation_id) # 接上次会话\n        print(answer.content)\n        print(answer.extra)  # 获取结果来源\n\n    \"\"\"\n    name = \"rag\"\n    integrated_url: str = \"/v1/ai_engine/agi_platform/v1/instance/integrated\"\n    # debug_url: str = \"/debug\"\n\n    def __init__(self, app_id: str = \"\"):\n        super().__init__()\n        self.app_id = app_id\n        self._http_client = None\n\n    @property\n    def http_client(self):\n        if self._http_client is None:\n            self._http_client = HTTPClient()\n        return self._http_client\n\n    def run(self, query: Message, conversation_id: str = \"\", stream: bool = False) -> Message:\n        \"\"\"\n        RAG问答\n        \n        Args:\n            query: 用户输入的文本\n            stream: 是否开启流式模式\n            conversation_id: 会话ID，不传表示新建对话\n            \n        Returns:\n            Message: rag答案\n        \"\"\"\n        response_mode = \"streaming\" if stream else \"blocking\"\n        payload = json.dumps({\"query\": query.content, \"app_id\": self.app_id,\n                              \"response_mode\": response_mode, \"conversation_id\": conversation_id})\n        headers = self.http_client.auth_header()\n        headers[\"Content-Type\"] = \"application/json\"\n        response = self.http_client.session.post(url=self.http_client.service_url(self.integrated_url),\n                                                 headers=headers, data=payload, stream=True)\n        response = ConsoleCompletionResponse(response, stream)\n        return response.to_message()\n\n    def debug(self, query: Message):\n        pass\n"
  },
  {
    "path": "python/core/constants.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nSECRET_KEY_PREFIX = \"Bearer\"\n\nGATEWAY_URL = \"https://appbuilder.baidu.com\"\nGATEWAY_INNER_URL = \"http://appbuilder.sdns.baidu.com\"\n\nGATEWAY_URL_V2 = \"https://qianfan.baidubce.com\"\nCONSOLE_OPENAPI_VERSION = \"/v2\"\nCONSOLE_OPENAPI_PREFIX = \"\"\n\nMAX_DOCUMENTS_NUM = 800\nSUPPORTED_FILE_TYPE = [\"txt\", \"pdf\", \"doc\", \"docx\"]\n\nCOMPONENT_SUPPORT_FILE_NUMBER = 10"
  },
  {
    "path": "python/core/context.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport uuid\nimport logging\nfrom typing import Optional\nfrom contextvars import ContextVar\n\n\n_LOCAL_KEY = 'LOCAL-'\n\nclass SessionContext:\n    \"\"\"\n    维护当前 Session 的上下文信息。\n    \"\"\"\n    id: str\n    session_id: str\n    request_id: str\n    user_id: Optional[str]\n    session_vars_dict: dict\n    \n    def __init__(self, id: str, session_id: str, request_id: str, user_id: Optional[str] = None):\n        self.id = id\n        self.session_id = session_id\n        self.request_id = request_id\n        self.user_id = user_id\n        self.session_vars_dict = {}\n\n\ncontext_var: ContextVar[SessionContext] = ContextVar(\"appbuilder_session\")\n\n\ndef init_context(\n    session_id: str,\n    request_id: str,\n    user_id: Optional[str] = None,\n) -> SessionContext:\n    \"\"\"\n    初始化 Session 的上下文信息。\n    \"\"\"\n    ctx = SessionContext(\n        id=str(uuid.uuid4()),\n        session_id=session_id,\n        request_id=request_id,\n        user_id=user_id,\n    )\n    context_var.set(ctx)\n    return ctx\n\n\ndef get_context() -> SessionContext:\n    \"\"\"\n    获取当前 Session 的上下文信息。\n    \"\"\"\n    try:\n        return context_var.get()\n    except LookupError:\n        session_id = _LOCAL_KEY + str(uuid.uuid4())[:-len(_LOCAL_KEY)]\n        request_id = _LOCAL_KEY + str(uuid.uuid4())[:-len(_LOCAL_KEY)]\n        logging.debug(\n            \"Unable to find the AgentRuntime context. You need to use UserSession \"\n            \"in AgentRuntime.serve or AgentRuntime.chainlit_demo. \"\n            f\"Generate session_id({session_id}) and request_id({request_id}) here for local debugging.\")\n        ctx = init_context(session_id=session_id, request_id=request_id)\n        return ctx"
  },
  {
    "path": "python/core/functional.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/core/manifest/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "python/core/manifest/manifest_decorator.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport inspect\nfrom typing import Any, Dict, Optional\n\nfrom pydantic.v1 import BaseModel as PydanticBaseModel  # noqa: F403 # type: ignore\nfrom pydantic.v1 import create_model\n\nfrom appbuilder.core.manifest.manifest_signature import get_signature\nfrom appbuilder.core.manifest.models import Manifest, PropertyModel, ParametersModel\n\ndef manifest(\n    *,\n    description: Optional[str] = None,\n    name: Optional[str] = None,\n):\n    \"\"\"\n    Decorator for functions. Use some information to extract meta about function.\n    Priority as follows:\n    1. User provided value via arguments\n    2. Function signature + annotations\n\n    Args:\n        description (str, optional): The functionality of the function, general user guideline.\n        name (str, optional): The name of the function.\n    \"\"\"\n\n    def decorator(func):\n        \"\"\"Decorator for function.\"\"\"\n\n        # Get meta from signature\n        sig_params, sig_returns = get_signature(func=func)\n\n        # Get meta from decorator\n        dec_params_list = (\n            func.__ab_manifest_parameters__\n            if hasattr(func, \"__ab_manifest_parameters__\")\n            else []\n        )\n        dec_params = {item.name: item for item in dec_params_list}\n\n        properties = {}\n        required_fields = []\n        for param in sig_params:\n            dec_param = dec_params.get(param[\"name\"])\n            param_type = param.get(\"type_\") or getattr(dec_param, \"type\", None)\n\n            param_info = {\n                \"name\": param[\"name\"],  # 参数名称\n                \"type\": param_type,\n                \"description\": getattr(\n                    dec_params.get(param[\"name\"]), \"description\", None\n                ),  # 描述\n                \"required\": param.get(\n                    \"required\", getattr(dec_params.get(param[\"name\"]), \"required\", True)\n                ),  # 是否必需\n            }\n\n            # 构造 PropertyModel\n            properties[param[\"name\"]] = PropertyModel(\n                name=param_info[\"name\"],\n                type=param_info[\"type\"],\n                description=param_info[\"description\"],\n                required=param_info[\"required\"],\n            )\n\n            # 记录必需参数\n            if param_info[\"required\"]:\n                required_fields.append(param[\"name\"])\n\n        # 确定函数的最终名称和描述\n        final_name = name or func.__name__\n        final_desc = description or func.__doc__\n\n        parameters_model = ParametersModel(\n            type=\"object\",\n            properties={\n                k: v.model_dump(exclude_none=False) for k, v in properties.items()\n            },\n            required=required_fields,\n        )\n\n        view = Manifest(\n            type=\"function\",\n            function={\n                \"name\": final_name,\n                \"description\": final_desc,\n                \"parameters\": parameters_model.model_dump(),\n            },\n        )\n\n        # Attach view to function.\n        func.__ab_manifest__ = view\n\n        # Compatible to semantic kernel 0.9 ~ 1.6 according to this url: https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/functions/kernel_function_decorator.py\n        func.__kernel_function__ = True\n        func.__kernel_function_description__ = final_desc\n        func.__kernel_function_name__ = final_name\n\n        return func\n\n    return decorator\n\n\ndef manifest_parameter(\n    *,\n    name: str,\n    description: str = None,\n    type: str = None,\n    required: bool = True,\n):\n    \"\"\"\n    Decorator for function parameters.\n\n    Args:\n        name -- The name of the parameter\n        description -- The description of the parameter\n        default_value -- The default value of the parameter\n        type -- The type of the parameter, used for function calling\n        required -- Whether the parameter is required\n        example -- The example of the parameter\n\n    \"\"\"\n\n    def decorator(func):\n        \"\"\"Decorator for function parameter.\"\"\"\n\n        new_view = PropertyModel(\n            name=name,\n            type=type,\n            description=description,\n            required=required,\n        )\n        # Update parameter view lists for function_parameter decorator.\n        # This will be merged into ManifestView if function decorator runs last like:\n        # @manifest\n        # @manifest_parameter\n        # @manifest_parameter\n        if hasattr(func, \"__ab_manifest_parameters__\"):\n            current_views = func.__ab_manifest_parameters__\n        else:\n            current_views = []\n        current_views.append(new_view)\n        func.__ab_manifest_parameters__ = current_views\n\n        if hasattr(func, \"__ab_manifest__\"):\n            # 获取现有的 parameters\n            parameters_dict = func.__ab_manifest__.function.get(\"parameters\", {})\n            parameters_model = ParametersModel(**parameters_dict)\n\n            # 更新 properties\n            existing_property = parameters_model.properties.get(new_view.name)\n            if existing_property:\n                merged_property = PropertyModel.merge(existing_property, new_view)\n                parameters_model.properties[new_view.name] = merged_property\n            else:\n                parameters_model.properties[new_view.name] = new_view\n\n            # 更新 required 字段\n            if new_view.required:\n                if new_view.name not in parameters_model.required:\n                    parameters_model.required.append(new_view.name)\n            else:\n                if new_view.name in parameters_model.required:\n                    parameters_model.required.remove(new_view.name)\n\n            # 更新 func.__ab_manifest__.function[\"parameters\"]\n            func.__ab_manifest__.function[\"parameters\"] = parameters_model.model_dump()\n\n        # Compatible to semantic kernel 0.9 ~ 1.6 according to this url: https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/functions/kernel_function_decorator.py\n        if hasattr(func, \"__kernel_function_parameters__\"):\n            item = {\n                \"name\": name,\n                \"description\": description,\n                \"type\": type,\n                \"required\": required,\n            }\n\n            new_list = _update_list(\n                item,\n                func.__kernel_function_parameters__,\n                lambda item, new_item: item[\"name\"] == new_item[\"name\"],\n                lambda item, new_item: _merge_dict(item, new_item),\n            )\n            func.__kernel_function_parameters__ = new_list\n\n        return func\n\n    return decorator\n\n\ndef _merge_dict(current_dict, new_dict):\n    result = current_dict.copy()\n    for k, v in new_dict.items():\n        if v:\n            result[k] = v\n    return result\n\n\n# Replace the parameter with the same name and keep order.\n# Since there are few parameters for each function, keep use list for simplicity\ndef _update_list(new_item, list, condition, replacer):\n    new_list = []\n    replaced = False\n    for item in list:\n        if condition(item, new_item):\n            replaced = True\n            merged_item = replacer(item, new_item)\n            new_list.append(merged_item)\n    # Missing parameter append to the end.\n    if not replaced:\n        new_list.append(new_item)\n    return new_list\n"
  },
  {
    "path": "python/core/manifest/manifest_signature.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport inspect\nfrom inspect import Parameter, Signature\nfrom typing import Any, Dict, Union, Optional, List, get_origin, get_args\nimport logging\n\nNoneType = type(None)\n\n# 映射内置泛型类型到 typing 模块的名称\nTYPE_MAPPING = {\n    dict: \"Dict\",\n    list: \"List\",\n    set: \"Set\",\n    tuple: \"Tuple\",\n    Union: \"Union\",\n    Optional: \"Optional\",\n    Any: \"Any\",\n    int: \"int\",\n    str: \"str\",\n    float: \"float\",\n    bool: \"bool\",\n    # 根据需要添加更多映射\n}\n\n\ndef get_signature(func):\n    \"\"\"\n    获取函数的签名视图。\n\n    Args:\n        func (function): 目标函数。\n\n    Returns:\n        tuple: 包含两个元素的元组，第一个元素为函数参数的解析结果列表，第二个元素为函数返回值的解析结果字典。\n\n    \"\"\"\n\n    signature = inspect.signature(func)\n    _parameters = [\n        _parse_parameter(param)\n        for param in signature.parameters.values()\n        if param.name != \"self\"\n    ]\n    signature_returns = (\n        _parse_annotation(signature.return_annotation)\n        if signature.return_annotation != Signature.empty\n        else {}\n    )\n    return _parameters, signature_returns\n\n\ndef _parse_parameter(param: Parameter) -> Dict[str, Any]:\n    ret = {}\n    if param != Parameter.empty:\n        ret = _parse_annotation(param.annotation)\n    ret[\"name\"] = param.name\n    if param.default != Parameter.empty:\n        ret[\"default_value\"] = param.default\n        ret[\"required\"] = False\n    return ret\n\n\ndef _parse_annotation(annotation: Parameter) -> Dict[str, Any]:\n    # The keys of this dict is compatible with semantic-kernel, do not change them\n    if annotation == Signature.empty:\n        return {\"type_\": \"Any\", \"required\": True}\n    if isinstance(annotation, str):\n        return {\"type_\": annotation, \"required\": True}\n    ret = _parse_internal_annotation(annotation, True)\n    if hasattr(annotation, \"__metadata__\") and annotation.__metadata__:\n        ret[\"description\"] = annotation.__metadata__[0]\n    return ret\n\n\ndef _parse_internal_annotation(annotation: Any, required: bool) -> Dict[str, Any]:\n    if hasattr(annotation, \"__forward_arg__\"):\n        return {\"type_\": annotation.__forward_arg__, \"required\": required}\n\n    # 获取 origin 和 args\n    origin = get_origin(annotation)\n    args = get_args(annotation)\n\n    # 确定 parent_type\n    if origin is not None:\n        parent_type = TYPE_MAPPING.get(\n            origin, origin.__name__ if hasattr(origin, \"__name__\") else str(origin)\n        )\n    else:\n        parent_type = TYPE_MAPPING.get(\n            annotation,\n            annotation.__name__ if hasattr(annotation, \"__name__\") else str(annotation),\n        )\n\n    if parent_type == \"Optional\":\n        required = False\n\n    if args:\n        results = [_parse_internal_annotation(arg, required) for arg in args]\n        type_objects = [\n            result[\"type_object\"]\n            for result in results\n            if \"type_object\" in result and result[\"type_object\"] is not NoneType\n        ]\n        str_results = [result[\"type_\"] for result in results]\n\n        if \"NoneType\" in str_results:\n            str_results.remove(\"NoneType\")\n            required = False\n\n            if parent_type == \"Union\":\n                if len(str_results) == 1:\n                    type_ = f\"Optional[{str_results[0]}]\"\n                else:\n                    type_ = f\"Union[{', '.join(str_results)}]\"\n            else:\n                type_ = f\"{parent_type}[{', '.join(str_results)}]\"\n        else:\n            if parent_type == \"Union\":\n                # 所有选项都为非必需\n                required = not (all(not result[\"required\"] for result in results))\n            type_ = f\"{parent_type}[{', '.join(str_results)}]\"\n\n        ret = {\"type_\": type_, \"required\": required}\n        if type_objects and len(type_objects) == 1:\n            ret[\"type_object\"] = type_objects[0]\n        logging.debug(\n            f\"Parsed annotation: {annotation}, type_: {type_}, required: {required}\"\n        )\n        return ret\n\n    type_ = TYPE_MAPPING.get(\n        annotation,\n        annotation.__name__ if hasattr(annotation, \"__name__\") else str(annotation),\n    )\n    logging.debug(\n        f\"Parsed annotation: {annotation}, type_: {type_}, required: {required}\"\n    )\n    return {\n        \"type_\": type_,\n        \"type_object\": annotation,\n        \"required\": required,\n    }\n"
  },
  {
    "path": "python/core/manifest/models.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom pydantic import BaseModel, Field\nfrom typing import Dict, List, Literal, Any, Optional\n\nfrom appbuilder.core.manifest.manifest_signature import get_signature\n\n\nclass PropertyModel(BaseModel):\n    \"\"\"参数属性模型，用于描述函数参数的类型和元数据。\n\n    Attributes:\n        type (Optional[str]): 参数的类型。\n        description (Optional[str]): 参数的描述信息。\n    \"\"\"\n\n    name: str\n    type: Optional[str]\n    description: Optional[str]\n    required: bool = True\n\n    @classmethod\n    def merge(cls, a: \"PropertyModel\", b: \"PropertyModel\") -> \"PropertyModel\":\n        \"\"\"Merge two parameter views.\"\"\"\n        return cls(\n            name=a.name,\n            description=(b.description or a.description),\n            type=(b.type or a.type),\n            required=(b.required if b.required is not None else a.required),\n        )\n\n\nclass ParametersModel(BaseModel):\n    \"\"\"函数参数模型，用于定义函数的参数结构。\n\n    Attributes:\n        type (Literal[\"object\"]): 表示参数集合的类型，固定为 \"object\"。\n        properties (Dict[str, PropertyModel]): 参数的具体属性映射，其中键是参数名，值是对应的属性模型。\n        required (List[str]): 必须提供的参数列表。\n    \"\"\"\n\n    type: Literal[\"object\"]\n    properties: Dict[str, PropertyModel]\n    required: List[str]\n\n\nclass Manifest(BaseModel):\n    \"\"\"函数模型，用于描述函数的元信息。\n\n    Attributes:\n        type (Literal[\"function\"]): 表示模型的类型，固定为 \"function\"。\n        function (Dict[str, Any]): 函数的详细信息，包括名称、描述、参数、返回值等。\n    \"\"\"\n\n    type: Literal[\"function\"]\n    function: Dict[str, Any]\n\n    @classmethod\n    def from_function(cls, func) -> \"Manifest\":\n        \"\"\"\n        利用 manifest_signature.py 提供的 get_signature 方法解析函数的签名和参数信息，\n        并生成一个 Manifest 实例。\n\n        Args:\n            func: 要转换的函数。\n\n        Returns:\n            Manifest: 包含函数元信息的模型。\n        \"\"\"\n        # 使用 manifest_signature 提取函数签名信息\n        sig_params, sig_returns = get_signature(func)\n\n        # 构造参数模型\n        properties = {}\n        required = []\n\n        if hasattr(func, \"__ab_manifest__\"):\n            return func.__ab_manifest__\n\n        for param in sig_params:\n            param_info = {\n                \"name\": param[\"name\"],  # 参数名称\n                \"type\": param.get(\"type_\", None),  # 类型\n                \"description\": param.get(\"description\", None),  # 描述\n                \"required\": param.get(\"required\", False),  # 是否必需\n            }\n\n            # 验证类型字段是否有有效值\n            if not param_info[\"type\"]:\n                param_info[\"type\"] = \"Any\"\n\n            # 构造 PropertyModel\n            properties[param[\"name\"]] = PropertyModel(\n                name=param_info[\"name\"],\n                type=param_info[\"type\"],\n                description=param_info[\"description\"],\n                required=param_info[\"required\"],\n            )\n\n            # 记录必需参数\n            if param_info[\"required\"]:\n                required.append(param[\"name\"])\n\n        # 构造 ParametersModel\n        parameters_model = ParametersModel(\n            type=\"object\",\n            properties=properties,\n            required=required,\n        )\n\n        # 构造 Manifest 对象\n        manifest = cls(\n            type=\"function\",\n            function={\n                \"name\": func.__name__,\n                \"description\": func.__doc__,  # 去掉多余的空格\n                \"parameters\": parameters_model.model_dump(),\n            },\n        )\n\n        return manifest\n"
  },
  {
    "path": "python/core/message.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\nimport uuid\n\nfrom pydantic import BaseModel\nfrom typing import Optional, TypeVar, Generic\n\n\n_T = TypeVar(\"_T\")\n\n\nclass Message(BaseModel, Generic[_T], extra='allow'):\n    \"\"\"\n    Message class\n\n    Attributes:\n        content: The message content\n        name: The message name\n        mtype: The message type\n        id: The message id\n    \"\"\"\n    content: Optional[_T] = {}\n    name: Optional[str] = \"msg\"\n    mtype: Optional[str] = \"dict\"\n    id: Optional[str] = str(uuid.uuid4())\n\n    def __init__(self, content: Optional[_T] = None, **data):\n        if content is not None:\n            data['content'] = content\n        super().__init__(**data)\n        self.mtype = type(self.content).__name__\n\n    def __str__(self):\n        return f\"Message(name={self.name}, content={self.content}, mtype={self.mtype})\"\n\n    def __repr__(self):\n        return f\"{self.__class__.__name__}(name={self.name!r}, content={self.content!r}, mtype={self.mtype!r})\""
  },
  {
    "path": "python/core/session_message.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport datetime\nimport uuid\n\ndb = None\n\ndef get_db_base_class():\n    try:\n        from sqlalchemy.orm import declarative_base\n    except ImportError as e:\n        raise ImportError(\"Please install SQLAlchemy first: python3 -m pip install SQLAlchemy==2.0.31\")\n    \n    global db\n\n    if not db:\n        db = declarative_base()\n\n    return db\n\nclass SessionMessage(get_db_base_class()):\n        \"\"\"\n        会话 Message 数据模型，用于在数据库中存储和管理会话消息。\n\n        以下是每个字段的注释：\n        __tablename__：数据库表名为 appbuilder_session_messages，这是该类对应的数据库表名。\n        id：主键字段，使用UUID作为默认值，确保每条记录的唯一性。\n        session_id：会话ID字段，不允许为空，用于标识会话。\n        request_id：请求ID字段，不允许为空，用于标识请求。\n        message_key：Message 键字段，不允许为空，用于标识 Message 的关键字。\n        message_value：Message 值字段，不允许为空，用于存储 Message 的具体内容，使用JSON格式存储。\n        created_at：创建时间字段，使用当前时间作为默认值，不允许为空。\n        updated_at：更新时间字段，使用当前时间作为默认值，不允许为空。\n        deleted：删除标记字段，使用False作为默认值，不允许为空。当该字段为True时，表示该条记录已被删除。\n        \"\"\"\n        from sqlalchemy import create_engine, Column, Integer, String, JSON, DateTime, Boolean\n        __tablename__ = 'appbuilder_session_messages'\n\n        id = Column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()), unique=True)\n        session_id = Column(String(36), nullable=False)\n        request_id = Column(String(36), nullable=False)\n        message_key = Column(String(128), nullable=False)\n        message_value = Column(JSON, nullable=False)\n        created_at = Column(DateTime, default=datetime.datetime.now, nullable=False)\n        updated_at = Column(DateTime, default=datetime.datetime.now, nullable=False)\n        deleted = Column(Boolean, default=False, nullable=False)"
  },
  {
    "path": "python/core/user_session.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport datetime\nimport uuid\nimport json\nimport os\nimport logging\nfrom typing import Union, List, Dict, Optional, Any\n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.context import get_context, _LOCAL_KEY\n\n\ndef lazy_import_sqlalchemy():\n    try:\n        import sqlalchemy\n        from sqlalchemy import create_engine, Column, Integer, String, JSON, DateTime, Boolean\n        from sqlalchemy.orm import declarative_base, sessionmaker\n    except ImportError as e:\n        raise ImportError(\"Please install SQLAlchemy first: python3 -m pip install SQLAlchemy==2.0.31\")\n\nclass UserSession(object):\n    \"\"\"\n    会话数据管理工具，实例化后将是一个全局变量。\n    提供保存对话数据与获取历史数据的方法，**必须**在 AgentRuntime 启动的服务中使用。\n    \"\"\"\n    _instance = None\n    _initialized = False\n\n    def __new__(cls, *args, **kwargs):\n        \"\"\"\n        单例模式\n        \"\"\"\n        lazy_import_sqlalchemy()\n\n        if cls._instance is None:\n            cls._instance = object.__new__(cls)\n        return cls._instance\n\n    def __init__(self, user_session_config: Optional[Union[Any, str]] = None):\n        \"\"\"\n        初始化 UserSession\n        \n        Args:\n            user_session_config (str|None): Session 配置字符串，遵循 sqlalchemy 后端定义，参考文档\n              https://docs.sqlalchemy.org/en/20/core/engines.html#backend-specific-urls\n        \n        Returns:\n            None\n        \"\"\"\n        if self._initialized:\n            return\n        self._initialized = True\n\n        import sqlalchemy\n        from sqlalchemy.orm import sessionmaker\n        from sqlalchemy.orm import declarative_base\n        from sqlalchemy import create_engine\n        from appbuilder.core. session_message import get_db_base_class\n        \n        _db = get_db_base_class()\n\n        if user_session_config is None:\n            user_session_config = \"sqlite:///user_session.db\"\n        if not isinstance(user_session_config, (sqlalchemy.engine.URL, str)):\n            raise ValueError(\"user_session_config must be sqlalchemy.URL or str\")\n        logging.info(f\"create user_session by {user_session_config}\")\n        engine = create_engine(user_session_config)\n        _db.metadata.create_all(engine) # 创建表\n        Session = sessionmaker(engine)\n        self._db_session = Session()\n    \n\n    def get_history(self, key: str, limit: int=10) -> List[Message]:\n        \"\"\"\n        获取同个 session 中名为 key 的历史变量。\n        在非服务化版本中从内存获取。在服务化版本中，将从数据库获取。\n        \n        Args:\n            key (str): 变量名\n            limit (int): 最近 limit 条 Message 数据\n        \n        Returns:\n            List[Message]\n        \"\"\"\n        from appbuilder.core.session_message import SessionMessage\n        ctx = get_context()\n        if ctx.session_id.startswith(_LOCAL_KEY):\n            # 非服务化版本使用内存存储\n            if key not in ctx.session_vars_dict:\n                return []\n            session_messages = ctx.session_vars_dict[key][-limit:]\n            return session_messages\n        else:\n            # 服务化版本使用数据库存储\n            session_messages = self._db_session.query(SessionMessage).filter(\n                SessionMessage.session_id == ctx.session_id,\n                SessionMessage.message_key == key,\n                SessionMessage.deleted == False).order_by(\n                    SessionMessage.updated_at.desc()).limit(limit).all()\n            return [Message(content=item.message_value) for item in session_messages][::-1]\n\n    def append(self, message_dict: Dict[str, Message]) -> None:\n        \"\"\"\n        将 message_dict 中的变量保存到 session 中。\n        在非服务化版本中使用内存存储。在服务化版本中，将使用数据库进行存储。\n\n        Args:\n            message_dict (Dict[str, Message]): 包含 Message 的字典，其中键为字符串类型，值为 Message 类型。\n\n        Returns:\n            None\n        \"\"\"\n        ctx = get_context()\n        if ctx.session_id.startswith(_LOCAL_KEY):\n            # 非服务化版本使用内存存储\n            for key, message in message_dict.items():\n                if not isinstance(message, Message):\n                    raise ValueError(\"session format error, message must be Message type\")\n                if key not in ctx.session_vars_dict:\n                    ctx.session_vars_dict[key] = []\n                ctx.session_vars_dict[key].append(message)\n        else:\n            # 服务化版本使用数据库存储\n            for key, message in message_dict.items():\n                if not isinstance(message, Message):\n                    raise ValueError(\"session format error, message must be Message type\")\n                if key in ctx.session_vars_dict:\n                    raise KeyError(\n                        f\"session format error, key {key} has already been appended\"\n                    )\n                ctx.session_vars_dict[key] = message\n\n    def _post_append(self) -> None:\n        \"\"\"\n        后置保存。流式数据不能直接保存到数据库，需要通过该方法后置保存。\n        \n        Args:\n            None\n        \n        Returns:\n            None\n        \"\"\"\n        from appbuilder.core.session_message import SessionMessage\n        ctx = get_context()\n        try:\n            for key, message_value in ctx.session_vars_dict.items():\n                message = SessionMessage(\n                    session_id=ctx.session_id,\n                    request_id=ctx.request_id,\n                    message_key=key,\n                    message_value=json.loads(message_value.json(exclude_none=True)),\n                    created_at=datetime.datetime.now(),\n                    updated_at=datetime.datetime.now())\n                self._db_session.add(message)\n                self._db_session.commit()\n            ctx.session_vars_dict = {}\n        except Exception as e:\n            logging.error(e)\n            self._db_session.rollback()\n            raise e\n"
  },
  {
    "path": "python/core/utils.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport time\nimport itertools\nfrom typing import List\nfrom urllib.parse import urlparse, unquote\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.core._exception import TypeNotSupportedException, ModelNotSupportedException\nfrom appbuilder.utils.model_util import GetModelListRequestV2, Models, RemoteModelCollector\nfrom functools import lru_cache\n\n\ndef utils_get_user_agent():\n    return 'appbuilder-sdk-python/{}'.format(\"__version__\")\n\n# Todo(chengmo): 此处返回的模型名称为原始名称，并非推荐使用的short name\n# 应当返回一个详细的列表，告知用户原始名 + 对应的short名\n# 同时考虑是否返回每个模型可用的余额\ndef get_model_list(\n        secret_key: str = \"\", \n        api_type_filter: List[str] = [], \n        is_available: bool = False,\n        refresh_type: str = \"tolerant\",\n        force_refresh: bool = False\n    ) -> list:\n    \"\"\"\n    返回用户的模型列表。\n\n    参数:\n        secret_key(str,可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\")。\n        api_type_filter(List[str], 可选): 根据apiType过滤，[\"chat\", \"completions\", \"embeddings\", \"text2image\"]，不填包括所有的。\n        is_available(bool, 可选): 是否返回可用模型列表, 默认返回所有模型。\n        refresh_type(str, 可选): 获取模型列表的方式，默认在出错时使用兜底策略。\n        force_refresh(bool, 可选): 是否强制刷新缓存，默认不强制刷新。\n\n    返回:\n        list: 模型列表。\n    \"\"\"\n    api_type_set = {\"chat\", \"completions\", \"embeddings\", \"text2image\", \"image2text\", \"rerankers\", \"multimodal\"}\n    if api_type_filter and not set(api_type_filter).issubset(api_type_set):\n        raise TypeNotSupportedException(\n            f\"mismatched argument api_type_filter, expected in {api_type_set}\"\n        )\n    request = GetModelListRequestV2(refresh_type=refresh_type, force_refresh=force_refresh)\n    model = Models(secret_key=secret_key)\n    response = model.list_v2(request)\n    models = []\n\n    for model in itertools.chain(response.result.common, response.result.custom):\n        if (\n            (is_available and model.chargeStatus not in [\"Opened\", \"Free\"])\n            or model.serviceType not in api_type_filter\n        ):\n            continue\n        models.append(model.name)\n    return models \n\ndef get_filename_from_url(url):\n    \"\"\"从给定URL中提取文件名\"\"\"\n    parsed_url = urlparse(url)\n    # 提取路径部分\n    path = parsed_url.path\n    # 从路径中获取文件名\n    filename = path.split('/')[-1]\n    # 解码URL编码的文件名\n    return unquote(filename)\n\ndef convert_cloudhub_url(client: HTTPClient, qianfan_url: str) -> str:\n    \"\"\"将千帆url转换为AppBuilder url\"\"\"\n    qianfan_url_prefix = \"rpc/2.0/ai_custom/v1/wenxinworkshop\"\n    cloudhub_url_prefix = \"rpc/2.0/cloud_hub/v1/bce/wenxinworkshop/ai_custom/v1\"\n    index = str.find(qianfan_url, qianfan_url_prefix)\n    if index == -1:\n        raise ValueError(f\"url format error, {qianfan_url} is not a valid qianfan url\")\n    url_suffix = qianfan_url[index + len(qianfan_url_prefix):]\n    return \"{}/{}{}\".format(client.gateway, cloudhub_url_prefix, url_suffix)\n\n\ndef convert_cloudhub_url_v2(client: HTTPClient, qianfan_url: str) -> str:\n    \"\"\"将千帆url转换为AppBuilder url\"\"\"\n    qianfan_url_prefix = \"rpc/2.0/ai_custom/v1/wenxinworkshop\"\n    cloudhub_url_prefix = \"rpc/2.0/cloud_hub/v1/bce/wenxinworkshop/ai_custom/v1\"\n    index = str.find(qianfan_url, qianfan_url_prefix)\n    if index == -1:\n        raise ValueError(f\"url format error, {qianfan_url} is not a valid qianfan url\")\n    url_suffix = qianfan_url[index + len(qianfan_url_prefix):]\n    return \"{}/{}{}\".format(client.gateway, cloudhub_url_prefix, url_suffix)\n\n\ndef is_url(string):\n    \"\"\"\n    判断字符串是否是URL\n    :param string:\n    :return:\n    \"\"\"\n    result = urlparse(string)\n    return all([result.scheme, result.netloc])\n\n\ndef ttl_lru_cache(seconds_to_live: int, maxsize: int = 128):\n    \"\"\"\n    Time aware lru caching\n    \"\"\"\n    def wrapper(func):\n        @lru_cache(maxsize)\n        def inner(__ttl, *args, **kwargs):\n            # Note that __ttl is not passed down to func,\n            # as it's only used to trigger cache miss after some time\n            return func(*args, **kwargs)\n        return lambda *args, **kwargs: inner(time.time() // seconds_to_live, *args, **kwargs)\n    return wrapper\n\n\nclass ModelInfo:\n    \"\"\" 模型信息类 \"\"\"\n\n    def __init__(self, client: HTTPClient):\n        \"\"\"根据模型名称获取并初始化模型信息\"\"\"\n        self.client = client\n        response = Models(client).list()\n        self.model_list = [*response.result.common, *response.result.custom]\n\n    def get_model_url(self, model_name: str) -> str:\n        \"\"\"获取模型在工作台网关的请求url\"\"\"\n        short_name = model_name\n        remote_model_name_collector = RemoteModelCollector()\n        origin_name = remote_model_name_collector.get_remote_name_by_short_name(short_name)\n        if not origin_name:\n            origin_name = short_name\n        for model in self.model_list:\n            if model.name == origin_name:\n                return model.url\n                # return convert_cloudhub_url(self.client, model.url)\n        raise ModelNotSupportedException(f\"Model[{model_name}] not available! \"\n                                         f\"You can query available models through: appbuilder.get_model_list()\")\n\n    def get_model_type(self, model_name: str) -> str:\n        \"\"\"获取模型类型\"\"\"\n        short_name = model_name\n        remote_model_name_collector = RemoteModelCollector()\n        origin_name = remote_model_name_collector.get_remote_name_by_short_name(short_name)\n        if not origin_name:\n            origin_name = short_name\n        for model in self.model_list:\n            if model.name == origin_name:\n                return model.apiType\n        raise ModelNotSupportedException(f\"Model[{model_name}] not available! \"\n                                         f\"You can query available models through: appbuilder.get_model_list()\")\n"
  },
  {
    "path": "python/mcp_server/README.md",
    "content": "# MCP Component Server\n\nThe MCP Component Server is a FastMCP server based implementation that converts AppBuilder Components into FastMCP tools, enabling seamless integration of Baidu cloud AI services into MCP-compatible environments.\n\n## Overview\n\nThe `MCPComponentServer` class provides a bridge between AppBuilder Components and FastMCP tools, allowing you to:\n- Convert AppBuilder Components into MCP-compatible tools\n- Handle various content types (text, images, audio, references)\n- Manage visibility scopes for different audiences\n- Support streaming responses through generators\n\n## Features\n\n- Automatic conversion of AppBuilder Components to MCP tools\n- Support for multiple content types:\n  - Text content\n  - Image content\n  - Audio content\n  - Reference content\n- Configurable host and port settings\n- Built-in error handling and logging\n- Support for custom tool registration\n- Automatic MIME type detection for media content\n\n## Usage\n\n### Basic Setup\n\n```python\nfrom appbuilder import GeneralOCR, TextGeneration\nfrom mcp.server import MCPComponentServer\n\n# Create server instance\nserver = MCPComponentServer(\"AI Service\", host=\"localhost\", port=8000)\n\n# Add AppBuilder components\nocr = GeneralOCR()\nserver.add_component(ocr)\n\ntext_gen = TextGeneration()\nserver.add_component(text_gen)\n\n# Run the server\nserver.run()\n```\n\n### Adding Custom Tools\n\n```python\n@server.tool()\ndef custom_function(param1: str, param2: int) -> str:\n    \"\"\"Custom tool description\"\"\"\n    return f\"Processed: {param1} {param2}\"\n```\n\n### Adding Resources\n\n```python\n@server.resource()\ndef get_resource():\n    \"\"\"Resource description\"\"\"\n    return {\"data\": \"resource content\"}\n```\n\n## Content Type Handling\n\nThe server automatically handles various content types:\n\n1. **Text Content**: Converts text outputs to MCP TextContent\n2. **Image Content**: Handles both base64 and URL-based images\n3. **Audio Content**: Processes audio files with automatic MIME type detection\n4. **Reference Content**: Manages document references and citations\n\n\n## Configuration\n\nThe server can be configured with various parameters:\n\n```python\nserver = MCPComponentServer(\n    name=\"Service Name\",\n    host=\"localhost\",  # Default: \"localhost\"\n    port=8000,        # Default: 8000\n    **kwargs          # Additional FastMCP arguments\n)\n```\n"
  },
  {
    "path": "python/mcp_server/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n#     http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicable law or agreed to in writing, software\r\n# distributed under the License is distributed on an \"AS IS\" BASIS,\r\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n# See the License for the specific language governing permissions and\r\n# limitations under the License.\r\n\r\nfrom .server import MCPComponentServer\r\nfrom .client import MCPClient\r\nfrom .openapi import OpenAPIMCPConverter\r\nfrom .ai_search.ai_search_server import AIsearch\r\nfrom .knowledge_base.knowledge_base_server import (\r\n    create_knowledge_base,\r\n    query_knowledge_base,\r\n    describe_knowledge_base,\r\n    list_knowledge_bases,\r\n    upload_document,\r\n    list_documents,\r\n)\r\nfrom .app.app_server import (\r\n    list_apps,\r\n    create_conversation,\r\n    run\r\n)\r\n\r\n\r\n__all__ = [\r\n    \"MCPComponentServer\",\r\n    \"MCPClient\",\r\n    \"OpenAPIMCPConverter\"\r\n    \"AIsearch\",\r\n    \"create_knowledge_base\",\r\n    \"query_knowledge_base\",\r\n    \"describe_knowledge_base\",\r\n    \"list_knowledge_bases\",\r\n    \"upload_document\",\r\n    \"list_documents\",\r\n    \"list_apps\",\r\n    \"create_conversation\",\r\n    \"run\",\r\n]\r\n"
  },
  {
    "path": "python/mcp_server/ai_search/README.md",
    "content": "# Baidu AI Search\n\nBaidu AI Search component combines Baidu's search capabilities with large language model technology to provide intelligent responses with real-time web information references, supporting various industry application scenarios. It offers rich standardized capabilities such as:\n\n- Custom persona settings\n- Model selection \n- Query rewriting (including time-sensitive and multi-turn approaches to enhance search results)\n- Search scope configuration (choice of modalities, site ranges and publication dates)\n- Customizable number of reference links\n\n## Quick Start\n\n1. Get your AppBuilder API Key from the console\n2. Format your authorization token as: `Bearer+<AppBuilder API Key>` (keep the \"+\" in between)\n3. Config with\n\n```json\n{\n  \"mcpServers\": {\n    \"baidu_ai_search\": {\n      \"url\": \"http://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key=Bearer+bce-v3/ALTAK...\"\n    }\n  }\n}\n```\n\nFor more details, please refer to [百度AI搜索](https://cloud.baidu.com/doc/AppBuilder/s/zm8pn5cju)"
  },
  {
    "path": "python/mcp_server/ai_search/__init__.py",
    "content": "\"\"\"\r\nMCP Server for AI Search.\r\n\r\nThis module provides an integrated AI search solution that combines Baidu Search capabilities with\r\nLarge Language Models (LLMs). It enables Retrieval-Augmented Generation (RAG) workflows by retrieving\r\nrelevant information from Baidu Search and using LLMs to generate contextually appropriate responses.\r\n\"\"\"\r\n\r\nfrom .ai_search_server import AIsearch, server\r\n\r\n__all__ = [\"AIsearch\", \"server\"]\r\n"
  },
  {
    "path": "python/mcp_server/ai_search/ai_search_server.py",
    "content": "\"\"\"\nBaidu AI Search MCP Server stdio server file.\nWe also support access via SSE protocol. The access address is:\nhttp://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key=<your api_key>\nYou can refer to this webpage https://cloud.baidu.com/doc/AppBuilder/s/klv2eywua to obtain the api_key, in the format of \"Bearer+bce…\".\n\"\"\"\nimport os\nimport json\nfrom mcp.server import FastMCP\nfrom appbuilder.core.components.rag_with_baidu_search_pro import RagWithBaiduSearchPro\nfrom types import SimpleNamespace\n\n# You can refer to this webpage https://cloud.baidu.com/doc/AppBuilder/s/klv2eywua to obtain the api_key\n# format is \"bce-v3/ALTAK-...\"\n# os.environ[\"APPBUILDER_TOKEN\"] = \"bce-v3/ALTAK-...\"\nserver = FastMCP(name=\"AB Component Server\")\n\n# You can switch to other models supported by AppBuilder\ninit_args = {\n    \"model\": \"DeepSeek-V3.1\",\n}\n\n\n@server.tool()\ndef AIsearch(\n    query,\n    stream=False,\n    instruction=None,\n    temperature=1e-10,\n    top_p=1e-10,\n    search_top_k=4,\n    hide_corner_markers=True,\n):\n    \"\"\"\n    执行搜索。\n\n    Args:\n        query (str): 搜索请求。\n        stream (bool, optional): 是否以流的形式接收响应数据。默认为False。\n        instruction (Instruction, optional): 指令信息对象。默认为None。\n        temperature (float, optional): 温度参数，控制生成文本的随机性。默认为1e-10。\n        top_p (float, optional): 累积概率阈值，用于控制生成文本的多样性。默认为1e-10。\n        search_top_k (int, optional): 搜索候选结果的数量。默认为4。\n        hide_corner_markers (bool, optional): 是否隐藏响应中的边界标记。默认为True。\n\n    Returns:\n        Message: 处理后的信息对象。\n\n    Raises:\n        AppBuilderServerException: 如果输入信息或指令过长，将抛出此异常。\n    \"\"\"\n    os.environ[\"APPBUILDER_SDK_MCP_CONTEXT\"] = \"server\"\n    message = SimpleNamespace(role=\"user\", content=\"{}\".format(query))\n    search_instance = RagWithBaiduSearchPro(\n        model=init_args[\"model\"]\n    )\n    response = search_instance.run(\n        message=message,\n        stream=stream,\n        instruction=instruction,\n        model=init_args[\"model\"],\n        temperature=temperature,\n        top_p=top_p,\n        search_top_k=search_top_k,\n        hide_corner_markers=hide_corner_markers,\n    )\n    return response.content + \"\\n\\n\" + json.dumps(response.extra, ensure_ascii=False)\n\n\nif __name__ == \"__main__\":\n    server.run()\n"
  },
  {
    "path": "python/mcp_server/app/README.md",
    "content": "# App MCP Server\n\nApp MCP Server provides a set of tools for using Agent from AppBuilder through the MCP protocol. It allows you to list apps, create conversations, run with AppBuilder Agent.\n\n## Features\n\n* **List Apps**: Get your AppBuilder application list.\n* **Create Conversation**: Create a new conversation_id, which is valid for 7 days. After that, it may not work and needs to be regenerated.\n* **Run**: Send messages to the agent application during a conversation.\n\n## Quick Start\n\n1. Get your AppBuilder API Key from the console\n2. Format your authorization token as: `Bearer+<AppBuilder API Key>` (keep the \"+\" in between)\n3. Config with\n\n```json\n{\n  \"mcpServers\": {\n    \"appbuilder-app\": {\n      \"url\": \"http://appbuilder.baidu.com/v2/app/mcp/sse?api_key=Bearer+bce-v3/ALTAK...\"\n    }\n  }\n}\n```\n\n## Available Tools\n\n### get_all_apps\n\nRetrieve a list of all available AppBuilder applications.\n\n**Parameters:**\nNo parameter required\n\n**Returns:**\n- List of dictionaries, each containing an app's id, name, and description.\n\n### create_conversation\n\nCreate a new conversation session for a specific AppBuilder application.\n\n**Parameters:**\n- `app_id` (str): ID of the Application.\n\n**Returns:**\n- `converstaion_id`(str) : ID of the conversation.\n\n### run\n\nExecute a conversation query with a specific AppBuilder application.\n\n**Parameters:**\n- `app_id` (str): The unique identifier of the target application\n- `conversation_id `(str): The conversation session identifier\n- `query `(str): The input text/query to send to the application\n\n**Returns:**\n- The response content from the conversation\n\n## Usage Examples\n\n### Get your AppBuilder application list\n\n```python\nimport asyncio\nimport os\nimport json\nfrom appbuilder.mcp_server.client import MCPClient\n\nos.environ[\"APPBUILDER_TOKEN\"] = \"YOUR_APPBUILDER_TOKEN\"\n\nasync def main():\n    client = MCPClient()\n    await client.connect_to_server(service_url=service_url)\n    print(client.tools)\n    result = await client.call_tool(\n        \"get_all_apps\", {}\n    )\n    print(result)\n\nif __name__ == \"__main__\":\n    service_url = \"http://appbuilder.baidu.com/v2/app/mcp/sse?api_key=Bearer+\" + os.environ.get(\"APPBUILDER_TOKEN\")\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n\n```\n\n### Chat with AppBuilder Application\n\n```python\nimport asyncio\nimport json\nimport os\nfrom appbuilder.mcp_server.client import MCPClient\n\nos.environ[\"APPBUILDER_TOKEN\"] = \"YOUR_APPBUILDER_TOKEN\"\nos.environ[\"APP_ID\"] = \"YOUR_APP_ID\"\n\nasync def main():    \n    client = MCPClient()\n    await client.connect_to_server(service_url=service_url)\n    app_id = os.environ.get(\"APP_ID\")\n    result = await client.call_tool(\n        \"create_conversation\", {\"app_id\": app_id}\n    )\n    conversation_id = result.content[0].text\n    print(conversation_id)\n    result = await client.call_tool(\n        \"run\",\n        {\n            \"app_id\": app_id,\n            \"conversation_id\": conversation_id,\n            \"query\": \"hello\",\n        },\n    )\n    print(result.content[0].text)\n\nif __name__ == \"__main__\":\n    service_url = \"http://appbuilder.baidu.com/v2/app/mcp/sse?api_key=Bearer+\" + os.environ.get(\"APPBUILDER_TOKEN\")\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n\n```\n\n"
  },
  {
    "path": "python/mcp_server/app/__init__.py",
    "content": "\"\"\"\r\nMCP Server for AppBuilder App.\r\n\r\nThis module provides functionality for App operations.\r\n\"\"\"\r\n\r\nfrom .app_server import server\r\n\r\n__all__ = [\"server\"]\r\n"
  },
  {
    "path": "python/mcp_server/app/app_server.py",
    "content": "\"\"\"\r\nBaidu AppBuilder MCP Server\r\n\r\nThis server provides MCP (Model Context Protocol) tools for interacting with Baidu AppBuilder applications.\r\nIt supports both stdio and SSE (Server-Sent Events) protocols.\r\n\r\nSSE Access:\r\n    URL: http://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key=<your api_key>\r\n\r\nAuthentication:\r\n    - Requires an AppBuilder API key in the format \"bce-v3/ALTAK-...\"\r\n    - Get your API key from: https://cloud.baidu.com/doc/AppBuilder/s/klv2eywua\r\n\r\nFeatures:\r\n    - List all available AppBuilder applications\r\n    - Create new conversations with specific apps\r\n    - Run with queries and get responses\r\n\r\nExample Usage:\r\n    1. Set your AppBuilder token:\r\n       os.environ[\"APPBUILDER_TOKEN\"] = \"bce-v3/ALTAK-...\"\r\n    \r\n    2. Run the server:\r\n       python app_server.py\r\n\r\n    3. Use MCP client to interact with the server tools:\r\n       - get_all_apps()\r\n       - create_conversation(app_id)\r\n       - run(app_id, conversation_id, query)\r\n\"\"\"\r\nimport os\r\nfrom typing import Optional, List, Dict\r\nfrom mcp.server import FastMCP\r\nimport appbuilder\r\nfrom appbuilder.core.component import Component\r\n\r\nserver = FastMCP(name=\"AppBuilder App MCP Server\")\r\n\r\n\r\n@server.tool()\r\ndef list_apps() -> List[Dict]:\r\n    \"\"\"\r\n    Retrieve a list of all available AppBuilder applications.\r\n\r\n    Returns:\r\n        List[Dict]: A list of dictionaries containing app details with the following keys:\r\n            - id (str): Unique identifier of the app\r\n            - name (str): Name of the app\r\n            - description (str): Description of the app\r\n            - appType (str): Type of the app\r\n            - isPublished (bool): Publication status of the app\r\n            - updateTime (str): Last update timestamp\r\n    \"\"\"\r\n    apps = appbuilder.get_all_apps()\r\n    return [{\r\n        \"id\": app.id,\r\n        \"name\": app.name,\r\n        \"description\": app.description,\r\n        \"appType\": app.appType,\r\n        \"isPublished\": app.isPublished,\r\n        \"updateTime\": app.updateTime\r\n    } for app in apps]\r\n\r\n\r\n@server.tool()\r\ndef create_conversation(app_id: str) -> str:\r\n    \"\"\"\r\n    Create a new conversation session for a specific AppBuilder application.\r\n\r\n    Args:\r\n        app_id (str): The unique identifier of the target application\r\n\r\n    Returns:\r\n        str: A unique conversation identifier that can be used for subsequent interactions\r\n\r\n    Example:\r\n        conversation_id = create_conversation(\"fcc766c4-2bf2-46a3-a63b-1341b05bac49\")\r\n    \"\"\"\r\n    client = appbuilder.AppBuilderClient(app_id)\r\n    conversation_id = client.create_conversation()\r\n    return conversation_id\r\n\r\n\r\n@server.tool()\r\ndef run(app_id: str, conversation_id: str, query: str) -> str:\r\n    \"\"\"\r\n    Execute a conversation query with a specific AppBuilder application.\r\n\r\n    Args:\r\n        app_id (str): The unique identifier of the target application\r\n        conversation_id (str): The conversation session identifier\r\n        query (str): The input text/query to send to the application\r\n\r\n    Returns:\r\n        str: The response content from the conversation\r\n\r\n    Example:\r\n        response = run_conversation(\r\n            \"fcc766c4-2bf2-46a3-a63b-1341b05bac49\",\r\n            \"conv-123\",\r\n            \"今天北京天气如何\"\r\n        )\r\n    \"\"\"\r\n    client = appbuilder.AppBuilderClient(app_id)\r\n    output = client.run(conversation_id, query)\r\n    return output.content.answer\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    server.run()\r\n"
  },
  {
    "path": "python/mcp_server/client.py",
    "content": "# Based on https://modelcontextprotocol.io/quickstart/client\nimport sys\nfrom typing import Optional\nfrom contextlib import AsyncExitStack\n\nfrom mcp.client.session import ClientSession\nfrom mcp.client.stdio import StdioServerParameters\nfrom mcp.client.stdio import stdio_client\nfrom mcp.client.sse import sse_client\nfrom appbuilder.utils.logger_util import logger\n\n\nclass MCPClient:\n    def __init__(self):\n        # Initialize session and client objects\n        self.session: Optional[ClientSession] = None\n        self.exit_stack = AsyncExitStack()\n        self.tools = None\n        self.sessions = {}\n        self.tool_to_server = {}\n        self._session_context = None\n        self._streams_context = None\n\n    async def connect_to_server(\n        self, server_script_path: str = None, service_url: str = None, env: dict = None\n    ):\n        \"\"\"Connect to an MCP server\n\n        Args:\n            server_script_path: Path to the server script (.py or .js)\n            service_url: URL of the service\n        \"\"\"\n        if server_script_path is not None:\n            await self._connect_to_stdio_server(server_script_path, env=env)\n        elif service_url is not None:\n            await self._connect_to_sse_server(service_url)\n        else:\n            raise ValueError(\n                \"Either server_script_path or service_url must be provided.\"\n            )\n\n    async def _connect_to_stdio_server(self, server_script_path: str, env: dict = None):\n        is_python = server_script_path.endswith(\".py\")\n        is_js = server_script_path.endswith(\".js\")\n        if not (is_python or is_js):\n            raise ValueError(\"Server script must be a .py or .js file\")\n\n        command = sys.executable if is_python else \"node\"\n        server_params = StdioServerParameters(\n            command=command, args=[server_script_path], env=env\n        )\n\n        stdio_transport = await self.exit_stack.enter_async_context(\n            stdio_client(server_params)\n        )\n        self.stdio, self.write = stdio_transport\n        self.session = await self.exit_stack.enter_async_context(\n            ClientSession(self.stdio, self.write)\n        )\n\n        await self.session.initialize()\n        response = await self.session.list_tools()\n        tools = response.tools\n        self.tools = tools\n        logger.info(\n            \"\\nConnected to server with tools:\" +\n            str([tool.name for tool in tools])\n        )\n        cmd_key = f\"{command} {' '.join(server_script_path)}\"\n        self._store_session_and_tools(cmd_key)\n\n    async def _connect_to_sse_server(self, service_url: str):\n        self._streams_context = sse_client(url=service_url)\n        streams = await self._streams_context.__aenter__()\n        self._session_context = ClientSession(*streams)\n        self.session: ClientSession = await self._session_context.__aenter__()\n        await self.session.initialize()\n        response = await self.session.list_tools()\n        tools = response.tools\n        self.tools = tools\n        logger.info(\n            \"\\nConnected to server with tools:\" +\n            str([tool.name for tool in tools])\n        )\n        self._store_session_and_tools(service_url)\n\n    def _store_session_and_tools(self, cmd_key):\n        new_sessions = {cmd_key: self.session}\n        new_sessions.update(self.sessions)\n        self.sessions = new_sessions\n        for tool in self.tools:\n            if tool.name in self.tool_to_server:\n                raise ValueError(f\"Duplicate tool name: {tool.name}\")\n            self.tool_to_server[tool.name] = cmd_key\n\n    async def call_tool(self, tool_name, tool_args):\n        server_cmd = self.tool_to_server.get(tool_name)\n        if server_cmd is None:\n            raise ValueError(f\"Tool '{tool_name}' not found\")\n        session = self.sessions[server_cmd]\n        result = await session.call_tool(name=tool_name, arguments=tool_args)\n        return result\n\n    async def cleanup(self):\n        \"\"\"Clean up resources\"\"\"\n        await self.exit_stack.aclose()\n        \"\"\"Properly clean up the session and streams\"\"\"\n        if self._session_context:\n            await self._session_context.__aexit__(None, None, None)\n        if self._streams_context:\n            await self._streams_context.__aexit__(None, None, None)\n"
  },
  {
    "path": "python/mcp_server/http_client.py",
    "content": "import asyncio\nimport json\nimport logging\nfrom typing import Any, Dict, Optional, Union, List, Tuple\n\nimport aiohttp\nfrom aiohttp import ClientTimeout\n\n# Set up logging\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\n\nclass HTTPClient:\n    \"\"\"\n    HTTP client with retry mechanism, timeout handling, and error reporting.\n    Supports exponential backoff for retries.\n    \"\"\"\n\n    def __init__(\n        self,\n        base_url: Optional[str] = None,\n        headers: Optional[Dict[str, str]] = None,\n        default_timeout: int = 30,\n        max_retries: int = 3,\n    ):\n        \"\"\"\n        Initialize the HTTP client.\n\n        Args:\n            base_url: Base URL for all requests\n            headers: Default headers to include in all requests\n            default_timeout: Default timeout in seconds\n            max_retries: Maximum number of retry attempts\n        \"\"\"\n        self.base_url = base_url\n        self.headers = headers or {}\n        self.default_timeout = default_timeout\n        self.max_retries = max_retries\n        self.session: Optional[aiohttp.ClientSession] = None\n\n    async def _ensure_session(self) -> None:\n        \"\"\"Ensure aiohttp session exists and is open\"\"\"\n        if self.session is None or self.session.closed:\n            self.session = aiohttp.ClientSession(\n                timeout=ClientTimeout(total=self.default_timeout),\n                headers=self.headers\n            )\n\n    async def close(self) -> None:\n        \"\"\"Close the HTTP session\"\"\"\n        if self.session and not self.session.closed:\n            await self.session.close()\n            self.session = None\n\n    async def request(\n        self,\n        method: str,\n        url: str,\n        params: Optional[Dict[str, Any]] = None,\n        headers: Optional[Dict[str, Any]] = None,\n        data: Optional[str] = None,\n        json_data: Optional[Dict[str, Any]] = None,\n        timeout: Optional[int] = None,\n        max_retries: Optional[int] = None,\n    ) -> Dict[str, Any]:\n        \"\"\"\n        Make an HTTP request with retry mechanism.\n\n        Args:\n            method: HTTP method (GET, POST, PUT, DELETE, etc.)\n            url: URL path (will be joined with base_url if provided)\n            params: Query parameters\n            headers: Additional headers (will be merged with default headers)\n            data: Request body as string\n            json_data: Request body as JSON (will be serialized)\n            timeout: Request timeout in seconds (overrides default_timeout)\n            max_retries: Maximum retry attempts (overrides default max_retries)\n\n        Returns:\n            Dictionary with response data or error information\n        \"\"\"\n        # Use provided values or fall back to defaults\n        timeout = timeout or self.default_timeout\n        max_retries = max_retries if max_retries is not None else self.max_retries\n        \n        # Merge headers\n        merged_headers = dict(self.headers)\n        if headers:\n            merged_headers.update(headers)\n            \n        # Handle JSON data\n        if json_data:\n            data = json.dumps(json_data)\n            merged_headers['Content-Type'] = 'application/json'\n            \n        # Construct full URL\n        from urllib.parse import urljoin\n        full_url = urljoin(self.base_url, url) if self.base_url else url\n        \n        await self._ensure_session()\n        \n        # Implement retry logic\n        retries = 0\n        while retries <= max_retries:\n            try:\n                logger.info(f\"Making {method} request to {full_url} (Attempt {retries+1}/{max_retries+1})\")\n                \n                async with self.session.request(\n                    method=method.upper(),\n                    url=full_url,\n                    params=params,\n                    headers=merged_headers,\n                    data=data,\n                    timeout=ClientTimeout(total=timeout)\n                ) as response:\n                    response.raise_for_status()\n                    \n                    # Handle different response content types\n                    content_type = response.headers.get('content-type', '')\n                    \n                    if 'application/json' in content_type:\n                        result = await response.json()\n                    else:\n                        result = await response.text()\n                        \n                    return {\n                        'success': True,\n                        'status_code': response.status,\n                        'content_type': content_type,\n                        'data': result\n                    }\n                    \n            except (aiohttp.ClientResponseError, aiohttp.ClientConnectorError) as e:\n                error_message = str(e)\n                error_body = None\n                \n                if isinstance(e, aiohttp.ClientResponseError):\n                    try:\n                        error_body = await response.json()\n                    except:\n                        try:\n                            error_body = await response.text()\n                        except:\n                            error_body = \"Could not read response body\"\n                    \n                    error_message = f\"{error_message} - {error_body}\"\n                \n                retries += 1\n                if retries <= max_retries:\n                    wait_time = 2 ** retries  # Exponential backoff\n                    logger.warning(f\"Request failed: {error_message}. Retrying in {wait_time} seconds...\")\n                    await asyncio.sleep(wait_time)\n                else:\n                    logger.error(f\"Request failed after {max_retries+1} attempts: {error_message}\")\n                    return {\n                        'success': False,\n                        'error': {\n                            'type': 'http_error' if isinstance(e, aiohttp.ClientResponseError) else 'network_error',\n                            'status_code': e.status if isinstance(e, aiohttp.ClientResponseError) else None,\n                            'detail': error_message\n                        }\n                    }\n            except aiohttp.ClientError as e:\n                logger.error(f\"Client error: {str(e)}\")\n                return {\n                    'success': False,\n                    'error': {\n                        'type': 'network_error',\n                        'detail': str(e)\n                    }\n                }\n            except asyncio.TimeoutError:\n                retries += 1\n                if retries <= max_retries:\n                    wait_time = 2 ** retries  # Exponential backoff\n                    logger.warning(f\"Request timed out after {timeout} seconds. Retrying in {wait_time} seconds...\")\n                    await asyncio.sleep(wait_time)\n                else:\n                    logger.error(f\"Request timed out after {max_retries+1} attempts\")\n                    return {\n                        'success': False,\n                        'error': {\n                            'type': 'timeout_error',\n                            'detail': f\"Request timed out after {timeout} seconds\"\n                        }\n                    }\n            except Exception as e:\n                logger.error(f\"Unexpected error: {str(e)}\")\n                return {\n                    'success': False,\n                    'error': {\n                        'type': 'unexpected_error',\n                        'detail': str(e)\n                    }\n                }\n                \n    async def get(self, url: str, **kwargs) -> Dict[str, Any]:\n        \"\"\"Convenience method for GET requests\"\"\"\n        return await self.request(\"GET\", url, **kwargs)\n        \n    async def post(self, url: str, **kwargs) -> Dict[str, Any]:\n        \"\"\"Convenience method for POST requests\"\"\"\n        return await self.request(\"POST\", url, **kwargs)\n        \n    async def put(self, url: str, **kwargs) -> Dict[str, Any]:\n        \"\"\"Convenience method for PUT requests\"\"\"\n        return await self.request(\"PUT\", url, **kwargs)\n        \n    async def patch(self, url: str, **kwargs) -> Dict[str, Any]:\n        \"\"\"Convenience method for PATCH requests\"\"\"\n        return await self.request(\"PATCH\", url, **kwargs)\n        \n    async def delete(self, url: str, **kwargs) -> Dict[str, Any]:\n        \"\"\"Convenience method for DELETE requests\"\"\"\n        return await self.request(\"DELETE\", url, **kwargs)\n"
  },
  {
    "path": "python/mcp_server/knowledge_base/README.md",
    "content": "# Knowledge Base MCP Server\n\nKnowledge Base MCP Server provides a set of tools for managing knowledge bases and documents through the MCP protocol. It allows you to create, query, and manage knowledge bases and their contents.\n\n## Features\n\n* **Knowledge Base Creation and Management**: Create new knowledge bases and list all available knowledge bases.\n* **Document Management**: Upload files to knowledge bases and list all documents in a knowledge base.\n* **Knowledge Base Querying**: Search knowledge bases with query strings.\n\n## Quick Start\n\n1. Get your AppBuilder API Key from the console\n2. Format your authorization token as: `Bearer+<AppBuilder API Key>` (keep the \"+\" in between)\n3. Config with\n\n```json\n{\n  \"mcpServers\": {\n    \"knowledge_base\": {\n      \"url\": \"http://appbuilder.baidu.com/v2/knowledgeBase/mcp/sse?api_key=Bearer+bce-v3/ALTAK...\"\n    }\n  }\n}\n```\n\n## Available Tools\n\n### create_knowledge_base\n\nCreates a new knowledge base.\n\n**Parameters:**\n- `name` (str): Name of the KnowledgeBase.\n- `description` (str): Description of the KnowledgeBase.\n\n**Returns:**\n- Dictionary containing the knowledge base ID, name, description, and request ID.\n\n### describe_knowledge_base\n\nGet details of a specific KnowledgeBase.\n\n**Parameters:**\n- `id` (str): ID of the KnowledgeBase.\n\n**Returns:**\n- Dictionary containing the knowledge base ID, name, and description.\n\n### list_knowledge_bases\n\nList all KnowledgeBases.\n\n**Parameters:**\n- `max_keys` (int, optional): Maximum number of KnowledgeBases to return. Default is 10.\n\n**Returns:**\n- List of dictionaries, each containing a knowledge base's ID, name, and description.\n\n### query_knowledge_base\n\nQuery content from KnowledgeBases.\n\n**Parameters:**\n- `query` (str): Search query string.\n- `id_list` (list[str]): List of KnowledgeBase IDs to search in.\n\n**Returns:**\n- List of dictionaries, each containing a chunk's ID, content, document ID, and document name.\n\n### upload_document\n\nUpload documents to a KnowledgeBase.\n\n**Parameters:**\n- `id` (str): KnowledgeBase ID.\n- `file_path` (str): Path to the file to upload.\n- `template` (str, optional): Optional processing template to use. Options: \"ppt\", \"paper\", \"resume\", or \"default\". Default is \"default\".\n\n**Returns:**\n- Dictionary containing the document ID and request ID.\n\n### list_documents\n\nGet all documents in a KnowledgeBase.\n\n**Parameters:**\n- `id` (str): Knowledge base ID.\n\n**Returns:**\n- List of dictionaries, each containing a document's ID, name, and word count.\n\n## Usage Examples\n\n```python\nimport asyncio\nimport json\nimport io\nimport os\nimport appbuilder\nfrom appbuilder.mcp_server.client import MCPClient\n\nos.environ[\"APPBUILDER_TOKEN\"] = \"YOUR_APPBUILDER_TOKEN\"\n\nasync def main():\n    mcp_client = MCPClient()\n    await mcp_client.connect_to_server(service_url=service_url)\n\n    # case create_knowledge_base\n    result = await mcp_client.call_tool(\n        \"create_knowledge_base\",\n        {\"name\": \"mcp测试可删\", \"description\": \"mcp测试，可删\"},\n    )\n    knowledge_base_info = json.loads(result.content[0].text)\n    knowledge_base_id = knowledge_base_info.get(\"id\")\n    assert knowledge_base_id is not None\n\n    # case describe_knowledge_base\n    appbuilder.logger.debug(f\"create knowledge base success: {knowledge_base_id}\")\n    result = await mcp_client.call_tool(\n        \"describe_knowledge_base\",\n        {\"id\": knowledge_base_id},\n    )\n    knowledge_base_info = json.loads(result.content[0].text)\n    knowledge_base_id = knowledge_base_info.get(\"id\")\n    assert knowledge_base_id is not None\n    appbuilder.logger.debug(f\"describe knowledge base success: {knowledge_base_id}\")\n\n    # case list_knowledge_bases\n    result = await mcp_client.call_tool(\n        \"list_knowledge_bases\",\n        {\"max_keys\": 10},\n    )\n    assert len(result.content) == 10\n    appbuilder.logger.debug(f\"list knowledge bases success: {len(result.content)}\")\n\n    # case upload_document\n    file_content = \"这里是你的文件内容字符串\"\n    with io.BytesIO(file_content.encode(\"utf-8\")) as f:\n        result = await mcp_client.call_tool(\n            \"upload_document\",\n            {\"id\": knowledge_base_id, \"file_data\": f, \"file_name\": \"test.txt\"},\n        )\n    document_info = json.loads(result.content[0].text)\n\n    document_id = document_info.get(\"documentId\")\n    assert document_id is not None\n    appbuilder.logger.debug(f\"upload document success: {document_id}\")\n\n    # case list_documents\n    result = await mcp_client.call_tool(\n        \"list_documents\",\n        {\"id\": knowledge_base_id},\n    )\n    print(result)\n    appbuilder.logger.debug(f\"list documents base success: {knowledge_base_id}\")\n\n    # case query_knowledge_base\n    result = await mcp_client.call_tool(\n        \"query_knowledge_base\",\n        {\"query\": \"分子\", \"id_list\": [knowledge_base_id]},\n    )\n    assert result.content[0].text is not None\n    appbuilder.logger.debug(\"query knowledge base success\")\n\n\nif __name__ == \"__main__\":\n    service_url = (\n        \"http://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key=\"\n        + os.environ.get(\"APPBUILDER_TOKEN\")\n    )\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n\n```\n"
  },
  {
    "path": "python/mcp_server/knowledge_base/__init__.py",
    "content": "\"\"\"\nMCP Server for Knowledge Base.\n\nThis module provides functionality for knowledge base operations.\n\"\"\"\n\nfrom .knowledge_base_server import (\n    create_knowledge_base,\n    query_knowledge_base,\n    describe_knowledge_base,\n    list_knowledge_bases,\n    upload_document,\n    list_documents,\n    server\n)\n\n__all__ = [\n    \"create_knowledge_base\",\n    \"query_knowledge_base\",\n    \"describe_knowledge_base\",\n    \"list_knowledge_bases\",\n    \"upload_document\",\n    \"list_documents\",\n    \"server\"\n]\n"
  },
  {
    "path": "python/mcp_server/knowledge_base/knowledge_base_server.py",
    "content": "\"\"\"\nBaidu AI Search MCP Server stdio server file.\nWe also support access via SSE protocol. The access address is:\nhttp://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key=<your api_key>\nYou can refer to this webpage https://cloud.baidu.com/doc/AppBuilder/s/klv2eywua to obtain the api_key, in the format of \"Bearer+bce…\".\n\"\"\"\n\nfrom enum import Enum\nfrom typing import Literal\n\nfrom mcp.server import FastMCP\nfrom appbuilder import KnowledgeBase, DocumentProcessOption, DocumentChoices\n\nclass TemplateType(str, Enum):\n    PPT = \"ppt\"\n    PAPER = \"paper\"\n    RESUME = \"resume\"\n    CUSTOM = \"custom\"\n    DEFAULT = \"default\"\n    QA_PAIR = \"qaPair\"\n\nclass ParserChoices(str, Enum):\n    LAYOUT_ANALYSIS = \"layoutAnalysis\"\n    OCR = \"ocr\"\n    PAGE_IMAGE_ANALYSIS = \"pageImageAnalysis\"\n    CHART_ANALYSIS = \"chartAnalysis\"\n    TABLE_ANALYSIS = \"tableAnalysis\"\n\nserver = FastMCP(name=\"AppBuilder KnowledgeBase MCP Server\")\n\n@server.tool()\ndef create_knowledge_base(name: str, description: str):\n    \"\"\"\n    Create a new KnowledgeBase.\n    \n    Args:\n        name: Name of the KnowledgeBase\n        description: Description of the KnowledgeBase\n    \"\"\"\n    client = KnowledgeBase()\n    kb = client.create_knowledge_base(name=name, description=description, type=\"public\")\n    return {\n        \"id\": kb.id,\n        \"name\": kb.name,\n        \"description\": kb.description,\n        \"requestId\": kb.requestId\n    }\n\n@server.tool()\ndef describe_knowledge_base(id: str):\n    \"\"\"\n    Get details of a specific KnowledgeBase.\n    \n    Args:\n        id: ID of the KnowledgeBase\n    \"\"\"\n    client = KnowledgeBase()\n    kb = client.get_knowledge_base_detail(id)\n    return {\n        \"id\": kb.id,\n        \"name\": kb.name,\n        \"description\": kb.description\n    }\n\n@server.tool()\ndef list_knowledge_bases(max_keys: int = 10):\n    \"\"\"\n    List all KnowledgeBase.\n    \n    Args:\n        max_keys: Maximum number of KnowledgeBase to return (default: 10)\n    \"\"\"\n    client = KnowledgeBase()\n    resp = client.get_knowledge_base_list(maxKeys=max_keys)\n    return [{\n        \"id\": kb.id,\n        \"name\": kb.name,\n        \"description\": kb.description\n    } for kb in resp.data]\n\n@server.tool()\ndef query_knowledge_base(query: str, id_list: list[str]):\n    \"\"\"\n    Query content from KnowledgeBases.\n    \n    Args:\n        query: Search query string\n        id_list: List of KnowledgeBase ID to search in\n    \"\"\"\n    client = KnowledgeBase()\n    resp = client.query_knowledge_base(query, knowledgebase_ids=id_list)\n    return [{\n        \"chunk_id\": chunk.chunk_id,\n        \"content\": chunk.content,\n        \"document_id\": chunk.document_id,\n        \"document_name\": chunk.document_name\n    } for chunk in resp.chunks]\n\n@server.tool()\ndef upload_document(\n    id: str, \n    file_path: str, \n    template: Literal[\"ppt\", \"paper\", \"resume\", \"default\"] = \"default\",\n    ):\n    \"\"\"\n    Upload documents to a KnowledgeBase.\n    \n    Args:\n        id: KnowledgeBase ID\n        file_path: Path to the file to upload\n        template: Optional processing template to use. Options:\n            - ppt: PPT slides\n            - paper: Academic papers\n            - resume: Resume documents\n            - default: Default configuration\n    \"\"\"\n    if template not in TemplateType.__members__.values():\n        raise ValueError(f\"Invalid template. Must be one of: {list(TemplateType.__members__.values())}\")\n\n    content_format: str = \"rawText\"\n    option = DocumentProcessOption(template=template)\n    option.parser = DocumentChoices(choices=[\"layoutAnalysis\", \"ocr\", \"pageImageAnalysis\", \"chartAnalysis\", \"tableAnalysis\"])\n\n    client = KnowledgeBase()\n    resp = client.upload_documents(\n        id=id,\n        content_format=content_format,\n        file_path=file_path,\n        processOption=option\n    )\n    \n    return {\n        \"documentId\": resp.documentId,\n        \"requestId\": resp.requestId\n    }\n\n@server.tool()\ndef list_documents(id: str):\n    \"\"\"\n    Get all documents in a KnowledgeBase.\n    \n    Args:\n        id: Knowledge base ID\n    \"\"\"\n    client = KnowledgeBase()\n    resp = client.get_all_documents(id)\n    return [{\n        \"id\": doc.id,\n        \"name\": doc.name,\n        \"word_count\": doc.word_count\n    } for doc in resp]\n\nif __name__ == \"__main__\":\n    server.run()\n"
  },
  {
    "path": "python/mcp_server/openapi.py",
    "content": "from dataclasses import dataclass\r\nfrom typing import Dict, List, Any, Optional, Callable, Awaitable\r\nimport asyncio\r\nimport yaml\r\nimport json\r\nimport aiohttp\r\nfrom .http_client import HTTPClient\r\n\r\n@dataclass\r\nclass MCPTool:\r\n    name: str\r\n    description: str\r\n    input_schema: Dict[str, Any]\r\n    operation_id: str\r\n    method: str\r\n    path: str\r\n    parameters: List[Dict[str, Any]]\r\n    request_body: Optional[Dict[str, Any]] = None\r\n\r\n    def create_handler(self, converter: 'OpenAPIMCPConverter') -> Callable:\r\n        \"\"\"\r\n        Create a handler function for this tool that can be registered with MCP.\r\n\r\n        Returns:\r\n            Callable: An async function that handles tool execution\r\n        \"\"\"\r\n        async def handler(arguments: Dict[str, Any]) -> Dict[str, Any]:\r\n            # Prepare request parameters\r\n            url = self.path\r\n            query_params = {}\r\n            headers = {}\r\n            body = None\r\n\r\n            # Handle path parameters\r\n            for param in self.parameters:\r\n                if 'name' not in param:\r\n                    continue\r\n\r\n                param_name = param['name']\r\n                if param_name in arguments:\r\n                    value = arguments[param_name]\r\n\r\n                    # Convert to string if needed\r\n                    if isinstance(value, (int, float, bool)):\r\n                        value = str(value)\r\n\r\n                    if param.get('in') == 'path':\r\n                        url = url.replace(f\"{{{param_name}}}\", value)\r\n                    elif param.get('in') == 'query':\r\n                        query_params[param_name] = value\r\n                    elif param.get('in') == 'header':\r\n                        headers[param_name] = value\r\n\r\n            # Handle request body\r\n            if self.request_body:\r\n                content_type = next(iter(self.request_body['content'].keys()))\r\n                body_schema = self.request_body['content'][content_type]['schema']\r\n                body = {}\r\n\r\n                for prop_name in body_schema.get('properties', {}):\r\n                    if prop_name in arguments:\r\n                        body[prop_name] = arguments[prop_name]\r\n\r\n            # Make the API call using the converter's HTTP client\r\n            response = await converter.http_client.request(\r\n                method=self.method,\r\n                url=url,\r\n                params=query_params,\r\n                headers=headers,\r\n                json=body if body else None\r\n            )\r\n\r\n            return response\r\n\r\n        # Set metadata on the handler\r\n        handler.__name__ = self.name\r\n        handler.__doc__ = self.description\r\n\r\n        return handler\r\n\r\nclass OpenAPIMCPConverter:\r\n    def __init__(self,\r\n                 base_url: Optional[str] = None,\r\n                 headers: Optional[Dict[str, str]] = None,\r\n                 timeout: float = 30.0,\r\n                 max_retries: int = 3):\r\n        \"\"\"\r\n        Initialize the converter\r\n\r\n        Args:\r\n            base_url: Base URL for API calls\r\n            headers: Default headers for API calls\r\n            timeout: Timeout for API calls in seconds\r\n            max_retries: Maximum number of retry attempts\r\n        \"\"\"\r\n        self.base_url = base_url\r\n        self.headers = headers or {}\r\n        self.tools: Dict[str, MCPTool] = {}\r\n        self.http_client = HTTPClient(\r\n            base_url=base_url,\r\n            headers=headers,\r\n            default_timeout=timeout,\r\n            max_retries=max_retries\r\n        )\r\n\r\n    def create_tools(self, prefix: str = \"\") -> Dict[str, Callable]:\r\n        \"\"\"\r\n        Create callable handlers for all tools with optional prefix\r\n\r\n        Args:\r\n            prefix: Optional prefix to add to tool names\r\n\r\n        Returns:\r\n            Dict[str, Callable]: Dictionary of tool name to handler function\r\n        \"\"\"\r\n        handlers = {}\r\n        for tool_name, tool in self.tools.items():\r\n            prefixed_name = f\"{prefix}{tool_name}\" if prefix else tool_name\r\n            handlers[prefixed_name] = tool.create_handler(self)\r\n        return handlers\r\n\r\n    async def close(self) -> None:\r\n        \"\"\"Close the HTTP client session\"\"\"\r\n        await self.http_client.close()\r\n\r\n    async def load_spec(self, spec_source: str) -> None:\r\n        \"\"\"\r\n        Load OpenAPI spec from URL or file\r\n\r\n        Args:\r\n            spec_source: URL or file path to OpenAPI spec\r\n        \"\"\"\r\n        if spec_source.startswith(('http://', 'https://')):\r\n            # Use HTTP client to fetch the spec\r\n            response = await self.http_client.get(spec_source)\r\n\r\n            if not response.get('success', False):\r\n                error = response.get('error', {})\r\n                raise Exception(f\"Failed to load spec: {error.get('detail', 'Unknown error')}\")\r\n\r\n            # Parse the response data\r\n            if isinstance(response['data'], dict):\r\n                spec = response['data']\r\n            else:\r\n                # If data is not a dict, try to parse it as JSON\r\n                spec = json.loads(response['data'])\r\n        else:\r\n            with open(spec_source, 'r', encoding='utf-8') as f:\r\n                if spec_source.endswith(('.yaml', '.yml')):\r\n                    spec = yaml.safe_load(f)\r\n                else:\r\n                    spec = json.load(f)\r\n\r\n        # Set base URL if not provided\r\n        if not self.base_url and 'servers' in spec:\r\n            self.base_url = spec['servers'][0]['url']\r\n            # Update HTTP client with new base_url\r\n            self.http_client.base_url = self.base_url\r\n\r\n        await self._process_spec(spec)\r\n\r\n    async def _process_spec(self, spec: Dict[str, Any]) -> None:\r\n        \"\"\"Process OpenAPI spec and create MCP tools\"\"\"\r\n        for path, path_item in spec['paths'].items():\r\n            for method, operation in path_item.items():\r\n                if method.lower() not in ['get', 'post', 'put', 'delete', 'patch']:\r\n                    continue\r\n\r\n                tool = self._create_tool(path, method, operation)\r\n                self.tools[tool.name] = tool\r\n\r\n    def _create_tool(self, path: str, method: str, operation: Dict[str, Any]) -> MCPTool:\r\n        \"\"\"Create MCPTool from OpenAPI operation\"\"\"\r\n        # Use operationId if available, otherwise create from method and path\r\n        operation_id = operation.get('operationId') or f\"{method}_{path}\"\r\n\r\n        # Collect parameters\r\n        parameters = operation.get('parameters', [])\r\n        required_params = []\r\n\r\n        # Build input schema\r\n        properties = {}\r\n        for param in parameters:\r\n            # Skip parameters without a name\r\n            if 'name' not in param:\r\n                print(f\"Warning: Parameter without name in {path} {method}\")\r\n                continue\r\n\r\n            param_name = param['name']\r\n            if param.get('required', False):\r\n                required_params.append(param_name)\r\n\r\n            param_schema = param.get('schema', {}).copy()  # Create a copy to modify\r\n\r\n            # Handle parameter enums\r\n            if 'enum' in param_schema:\r\n                param_schema['enum'] = [str(v) for v in param_schema['enum']]\r\n\r\n            # Handle parameter types\r\n            if param_schema.get('type') == 'integer':\r\n                param_schema['type'] = ['integer', 'string']  # Allow string input for integers\r\n\r\n            properties[param_name] = {\r\n                'type': param_schema.get('type', 'string'),\r\n                'description': param.get('description', ''),\r\n                'required': param.get('required', False)\r\n            }\r\n\r\n            # Add enum values if present\r\n            if 'enum' in param_schema:\r\n                properties[param_name]['enum'] = param_schema['enum']\r\n\r\n        # Add request body if present\r\n        if 'requestBody' in operation:\r\n            content = operation['requestBody']['content']\r\n            if 'application/json' in content:\r\n                body_schema = content['application/json']['schema']\r\n                if 'properties' in body_schema:\r\n                    for prop_name, prop_schema in body_schema['properties'].items():\r\n                        properties[prop_name] = {\r\n                            'type': prop_schema.get('type', 'string'),\r\n                            'description': prop_schema.get('description', ''),\r\n                            'required': prop_name in body_schema.get('required', [])\r\n                        }\r\n                        if 'enum' in prop_schema:\r\n                            properties[prop_name]['enum'] = prop_schema['enum']\r\n\r\n        input_schema = {\r\n            'type': 'object',\r\n            'properties': properties,\r\n            'required': required_params\r\n        }\r\n\r\n        return MCPTool(\r\n            name=operation_id,\r\n            description=operation.get('summary', operation.get('description', '')),\r\n            input_schema=input_schema,\r\n            operation_id=operation_id,\r\n            method=method,\r\n            path=path,\r\n            parameters=parameters,\r\n            request_body=operation.get('requestBody')\r\n        )\r\n\r\n    def list_tools(self) -> List[Dict[str, Any]]:\r\n        \"\"\"Return list of tools in MCP format\"\"\"\r\n        return [\r\n            {\r\n                'name': tool.name,\r\n                'description': tool.description,\r\n                'input_schema': tool.input_schema\r\n            }\r\n            for tool in self.tools.values()\r\n        ]\r\n\r\n    async def call_tool(self, tool_name: str, arguments: Dict[str, Any] = None, max_retries: int = None, timeout: int = None) -> Dict[str, Any]:\r\n        \"\"\"Execute tool by making API call\"\"\"\r\n        if arguments is None:\r\n            arguments = {}\r\n\r\n        if tool_name not in self.tools:\r\n            return {\r\n                'error': {\r\n                    'type': 'tool_not_found',\r\n                    'detail': f\"Tool '{tool_name}' not found\"\r\n                }\r\n            }\r\n\r\n        tool = self.tools[tool_name]\r\n\r\n        # Prepare request parameters\r\n        url = tool.path\r\n        query_params = {}\r\n        headers = {}\r\n\r\n        # Handle path parameters\r\n        for param in tool.parameters:\r\n            # Skip parameters without a name\r\n            if 'name' not in param:\r\n                continue\r\n\r\n            param_name = param['name']\r\n            if param_name in arguments:\r\n                value = arguments[param_name]\r\n\r\n                # Convert to string if needed\r\n                if isinstance(value, (int, float, bool)):\r\n                    value = str(value)\r\n\r\n                if param.get('in') == 'path':\r\n                    url = url.replace(f\"{{{param_name}}}\", value)\r\n                elif param.get('in') == 'query':\r\n                    query_params[param_name] = value\r\n                elif param.get('in') == 'header':\r\n                    headers[param_name] = value\r\n\r\n        # Handle request body\r\n        if tool.request_body:\r\n            body_params = {\r\n                k: v for k, v in arguments.items()\r\n                if k not in query_params and k not in headers\r\n            }\r\n            if body_params:\r\n                json_data = body_params\r\n            else:\r\n                json_data = None\r\n        else:\r\n            json_data = None\r\n\r\n        # Make the request using our HTTP client\r\n        response = await self.http_client.request(\r\n            method=tool.method,\r\n            url=url,\r\n            params=query_params,\r\n            headers=headers,\r\n            json_data=json_data,\r\n            timeout=timeout,\r\n            max_retries=max_retries\r\n        )\r\n\r\n        # Handle the response\r\n        if response.get('success', False):\r\n            result = response['data']\r\n            return {\r\n                'content': [\r\n                    {\r\n                        'type': 'json' if isinstance(result, (dict, list)) else 'text',\r\n                        'json' if isinstance(result, (dict, list)) else 'text': result\r\n                    }\r\n                ]\r\n            }\r\n        else:\r\n            # Return the error information\r\n            return {\r\n                'error': response.get('error', {\r\n                    'type': 'unknown_error',\r\n                    'detail': 'Unknown error occurred'\r\n                })\r\n            }\r\n\r\n\r\n\r\n"
  },
  {
    "path": "python/mcp_server/server.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n#     http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicable law or agreed to in writing, software\r\n# distributed under the License is distributed on an \"AS IS\" BASIS,\r\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n# See the License for the specific language governing permissions and\r\n# limitations under the License.\r\n\r\nimport os\r\nimport appbuilder\r\nfrom appbuilder.core.component import Component, Image, Audio, References, Content\r\nfrom appbuilder.core._exception import *\r\nfrom appbuilder.mcp_server.sse import SseServerTransport\r\nfrom appbuilder.mcp_server.openapi import OpenAPIMCPConverter\r\nfrom starlette.applications import Starlette\r\nfrom starlette.routing import Mount, Route\r\nfrom typing import Any, Literal, Optional, Dict\r\nfrom collections.abc import Generator\r\nfrom starlette.requests import Request\r\nimport logging\r\nimport inspect\r\nimport requests\r\nimport base64\r\nimport io\r\nfrom functools import wraps\r\nlogging.basicConfig(level=logging.INFO)\r\n\r\ntry:\r\n    from mcp.server.fastmcp import FastMCP\r\n    from mcp.server.fastmcp.server import _convert_to_content\r\n    from mcp.types import (\r\n        ImageContent,\r\n        TextContent,\r\n        EmbeddedResource,\r\n        TextResourceContents,\r\n        BlobResourceContents,\r\n        Annotations\r\n    )\r\nexcept ImportError:\r\n    raise ImportError(\r\n        \"Could not import FastMCP. Please install MCP package with: \"\r\n        \"pip install mcp\"\r\n    )\r\n\r\nclass MCPComponentServer:\r\n    \"\"\"\r\n    A server that converts Appbuilder Components to FastMCP tools.\r\n    \r\n    Examples:\r\n    \r\n    .. code-block:: python\r\n    \r\n        # Create server\r\n        server = MCPComponentServer(\"AI Service\")\r\n        \r\n        # Add components with default URLs based on their names\r\n        ocr = GeneralOCR()\r\n        server.add_component(ocr)  # Will use default URL based on component name\r\n        \r\n        # Add component with custom URL\r\n        text_gen = TextGeneration() \r\n        server.add_component(text_gen)  # Will use default URL based on component name\r\n        \r\n        # Add custom tool\r\n        @server.tool()\r\n        def add(a: int, b: int) -> int:\r\n            '''Add two numbers'''\r\n            return a + b\r\n            \r\n        # Run server\r\n        server.run()\r\n    \"\"\"\r\n\r\n    def __init__(self, name: str, host: str = \"localhost\", port: int = 8000, **kwargs: Any):\r\n        \"\"\"\r\n        Initialize the ComponentMCPServer.\r\n\r\n        Args:\r\n            name (str): Name of the server\r\n            host (str): Host address to bind to (default: \"localhost\")\r\n            port (int): Port number to listen on (default: 8000)\r\n            **kwargs: Additional arguments passed to FastMCP\r\n        \"\"\"\r\n        self.mcp = FastMCP(name, host=host, port=port, **kwargs)\r\n\r\n    def tool(self, *args, **kwargs):\r\n        \"\"\"\r\n        Decorator to register a custom tool function.\r\n        Passes through to FastMCP's tool decorator.\r\n\r\n        Args:\r\n            *args: Positional arguments for FastMCP tool decorator\r\n            **kwargs: Keyword arguments for FastMCP tool decorator\r\n        \"\"\"\r\n        return self.mcp.tool(*args, **kwargs)\r\n\r\n    def resource(self, *args, **kwargs):\r\n        \"\"\"\r\n        Decorator to register a resource.\r\n        Passes through to FastMCP's resource decorator.\r\n\r\n        Args:\r\n            *args: Positional arguments for FastMCP resource decorator\r\n            **kwargs: Keyword arguments for FastMCP resource decorator\r\n        \"\"\"\r\n        return self.mcp.resource(*args, **kwargs)\r\n\r\n\r\n    async def add_openapi_spec(\r\n        self,\r\n        spec_url: str,\r\n        prefix: str = \"\",\r\n        base_url: Optional[str] = None,\r\n        headers: Optional[Dict[str, str]] = None\r\n    ) -> Dict[str, Any]:\r\n        \"\"\"\r\n        Add an OpenAPI specification and register its tools.\r\n\r\n        Args:\r\n            spec_url: OpenAPI specification URL or file path (.json or .yaml)\r\n            prefix: Optional prefix for all tool names from this spec\r\n            base_url: Optional base URL for API calls\r\n            headers: Optional default headers for API calls\r\n\r\n        Returns:\r\n            Dict containing success status and list of added tools\r\n        \"\"\"\r\n        try:\r\n            # Create and configure converter\r\n            converter = OpenAPIMCPConverter(\r\n                base_url=base_url,\r\n                headers=headers\r\n            )\r\n            \r\n            # Load spec\r\n            await converter.load_spec(str(spec_url))\r\n            \r\n            # Register tools\r\n            tools_added = []\r\n            for tool_name, handler in converter.create_tools(prefix).items():\r\n                self.mcp.add_tool(\r\n                    handler,\r\n                    name=tool_name,\r\n                    description=handler.__doc__\r\n                )\r\n                tools_added.append(tool_name)\r\n            \r\n            # Store converter for cleanup\r\n            self._converters[prefix or \"default\"] = converter\r\n            \r\n            return {\r\n                'success': True,\r\n                'tools_added': tools_added\r\n            }\r\n            \r\n        except Exception as e:\r\n            return {\r\n                'success': False,\r\n                'error': str(e)\r\n            }\r\n\r\n    def _convert_visible_scope_to_audience(\r\n        self,\r\n        visible_scope: str\r\n    ) -> list[str]:\r\n        if visible_scope == \"llm\":\r\n            return [\"assistant\"]\r\n        elif visible_scope == \"user\":\r\n            return [\"user\"]\r\n        else:\r\n            return [\"user\", \"assistant\"]\r\n\r\n    def _get_mimetype_from_bytes(self, data: bytes) -> str:\r\n        import filetype\r\n        kind = filetype.guess(data)\r\n        return kind.mime\r\n\r\n    def _convert_image_to_image_content(\r\n            self, \r\n            text: Image,\r\n            audience: list[str]\r\n        ) -> ImageContent:\r\n        \"\"\"convert base64 data, such as image/audio  to ImageContent\"\"\"\r\n        try:\r\n            if text.base64:\r\n                logging.info(\"create ImageContent from Image.byte\")\r\n                base64_data = text.base64\r\n                image_byte = io.BytesIO(base64.b64decode(base64_data))\r\n            else:\r\n                logging.info(\"create ImageContent from Image.url\")\r\n                response = requests.get(text.url)\r\n                response.raise_for_status()\r\n                image = response.content\r\n                base64_data = base64.b64encode(image).decode('utf-8')\r\n                image_byte = io.BytesIO(image)\r\n\r\n            mime_type = self._get_mimetype_from_bytes(image_byte)\r\n\r\n            # create ImageContent\r\n            return ImageContent(\r\n                type=\"image\",\r\n                data=base64_data,\r\n                mimeType=mime_type,\r\n                annotations=Annotations(\r\n                    audience=audience\r\n                )\r\n            )\r\n        except Exception as e:\r\n            logging.error(\"failed convet image to ImageContent\")\r\n            raise e\r\n\r\n    def _convert_audio_to_embedded_resource(\r\n        self,\r\n        text: Audio,\r\n        audience: str = Literal[\"user\", \"assistant\"]\r\n    ) -> EmbeddedResource:\r\n        \"\"\"convert audio to EmebeddedResource\"\"\"\r\n        try:\r\n            if text.base64:\r\n                logging.info(\"convert audio to EmbeddedResource from Audio.byte\")\r\n                base64_data = text.base64\r\n                audio_byte = io.BytesIO(base64.b64decode(base64_data))\r\n            else:\r\n                logging.info(\"convert audio to EmbeddedResource from Audio.url\")\r\n                # get data\r\n                response = requests.get(text.url)\r\n                response.raise_for_status()\r\n                # convert to base64\r\n                base64_data = base64.b64encode(response.content).decode('utf-8')\r\n                audio_byte = io.BytesIO(response.content)\r\n\r\n            # detect audio type\r\n            audio_type = self._get_mimetype_from_bytes(audio_byte)\r\n\r\n            # create EmbeddedResource\r\n            return EmbeddedResource(\r\n                type=\"resource\",\r\n                resource=BlobResourceContents(\r\n                    blob=base64_data,\r\n                    uri=text.url,\r\n                    mimeType=audio_type\r\n                ),\r\n                annotations=Annotations(\r\n                    audience=audience\r\n                )\r\n            )\r\n        except Exception as e:\r\n            logging.error(\"failed to convert audio to EmbeddedResource\")\r\n            raise e\r\n\r\n    def _convert_reference_to_embedded_resource(\r\n        self,\r\n        text: References,\r\n        audience: str = Literal[\"user\", \"assistant\"]\r\n    ) -> EmbeddedResource:\r\n        \"\"\"convert reference to EmbeddedResource\"\"\"\r\n        from urllib.parse import unquote\r\n        return EmbeddedResource(\r\n            type=\"resource\",\r\n            resource=TextResourceContents(\r\n                uri=unquote(text.doc_id),\r\n                text=text.content,\r\n                mimeType=\"text/plain\"\r\n            ),\r\n            annotations=Annotations(\r\n                audience=audience\r\n            )\r\n        )\r\n\r\n    def _convert_component_output_to_text_content(\r\n        self,\r\n        text: Content,\r\n        audience: str = Literal[\"user\", \"assistant\"]\r\n    ) -> TextContent:\r\n        \"\"\"convert ComponentOutput to json_str\"\"\"\r\n        return TextContent(\r\n            type=\"text\",\r\n            text=text.model_dump_json(),\r\n            annotations=Annotations(\r\n                audience=audience\r\n            )\r\n        )\r\n\r\n    def _convert_generator(\r\n        self,\r\n        result: Generator\r\n    ) -> list[TextContent|ImageContent|EmbeddedResource]:\r\n        \"\"\"convert geneartor to list of TextContent, ImageContent and EmbeddedResource\"\"\"\r\n        output = []\r\n        for iter in result:\r\n            type = iter.content[0].type\r\n            text = iter.content[0].text\r\n            visible_scope = iter.content[0].visible_scope\r\n            audience = self._convert_visible_scope_to_audience(visible_scope)\r\n            if type in [\"text\", \"oral_text\"]:\r\n                text_output = TextContent(\r\n                    type=\"text\", \r\n                    text=iter.content[0].text.info, \r\n                    annotations=Annotations(\r\n                        audience=audience\r\n                    )\r\n                )\r\n                output.append(text_output)\r\n            else:\r\n                match type:\r\n                    case \"image\":\r\n                        image_output = self._convert_image_to_image_content(\r\n                            text, audience\r\n                        )\r\n                        output.append(image_output)\r\n                    case \"references\":\r\n                        reference_output = self._convert_reference_to_embedded_resource(\r\n                            text,\r\n                            audience\r\n                        )\r\n                        output.append(reference_output)\r\n                    case \"audio\":\r\n                        audio_output = self._convert_audio_to_embedded_resource(text, audience)\r\n                        output.append(audio_output)\r\n                iter_output = self._convert_component_output_to_text_content(iter, audience)\r\n                output.append(iter_output)\r\n        output = _convert_to_content(output)\r\n        return output\r\n\r\n    def convert_component_to_tool(self, component: Component) -> None:\r\n        \"\"\"\r\n        Add an Appbuilder Component and register its tools under the component's URL namespace.\r\n\r\n        Args:\r\n            component (Component): The component instance to add\r\n        \"\"\"\r\n\r\n        # Register each manifest as a separate tool\r\n        for manifest in component.manifests:\r\n            tool_name = manifest[\"name\"]\r\n            tool_decription = manifest[\"description\"]\r\n            def create_tool_fn(func):\r\n                signature = inspect.signature(func)\r\n                @wraps(func)\r\n                def wrapper(*args, **kwargs) -> Any:\r\n                    try:\r\n                        # call tool_eval\r\n                        bound_values = signature.bind(*args, **kwargs)\r\n                        os.environ[\"APPBUILDER_SDK_MCP_CONTEXT\"] = \"server\"\r\n                        if \"kwargs\" in bound_values.kwargs:\r\n                            inner_kwargs = bound_values.kwargs[\"kwargs\"]\r\n                            if isinstance(inner_kwargs, dict):\r\n                                outer_kwargs = bound_values.kwargs\r\n                                outer_kwargs.pop(\"kwargs\")\r\n                                inner_kwargs.update(outer_kwargs)\r\n                                new_bound_values = signature.bind(*args, **inner_kwargs)\r\n                                result = func(*new_bound_values.args, **new_bound_values.kwargs) \r\n                            else:\r\n                                result = func(*bound_values.args, **bound_values.kwargs)     \r\n                        else:\r\n                            result = func(*bound_values.args, **bound_values.kwargs)                \r\n                        \r\n                        if result is NotImplementedError:\r\n                            logging.error(f\"tool_eval not implemented in {tool_name}\")\r\n                            raise NotImplementedError(f\"tool_eval not implemented in {tool_name}\")\r\n\r\n                        list_result = self._convert_generator(result)\r\n                        return list_result\r\n\r\n                    except Exception as e:\r\n                        logging.error(f\"Error in {tool_name}: {str(e)}\")\r\n                        raise\r\n                wrapper.__signature__ = signature\r\n                return wrapper\r\n\r\n            # Create tool function with metadata\r\n            tool_fn = create_tool_fn(component.tool_eval)\r\n            tool_fn.__name__ = tool_name\r\n            tool_fn.__doc__ = tool_decription\r\n\r\n            # Register with FastMCP using name and description from manifest\r\n            self.mcp.tool(name=tool_name, description=tool_decription)(tool_fn)\r\n\r\n    def add_component(\r\n            self,\r\n            component: Component,\r\n        ):\r\n        \"\"\"add AppBuilder official tool as MCP server\"\"\"\r\n        try:    \r\n            component_name = component.__class__.__name__\r\n            self.convert_component_to_tool(component)\r\n            logging.info(f\"component: {component_name} has been added\")\r\n\r\n        except Exception as e:\r\n            logging.exception(f\"Failed to add component {component_name}: {str(e)}\")\r\n            raise e\r\n\r\n    def run(self, transport: Literal[\"stdio\", \"sse\"] = \"stdio\", redis_client=None) -> None:\r\n        \"\"\"Run the FastMCP server. Note this is a synchronous function.\r\n\r\n        Args:\r\n            transport: Transport protocol to use (\"stdio\" or \"sse\")\r\n        \"\"\"\r\n        if transport == \"sse\":\r\n            return self.create_sse_app(redis_client)\r\n        self.mcp.run()\r\n\r\n    def create_sse_app(self, redis_client = None) -> Starlette:\r\n        \"\"\"Return an instance of the SSE server app.\"\"\"\r\n        mcp_server = self.mcp._mcp_server\r\n        sse = SseServerTransport(\"/mcp/messages/\", redis_client=redis_client)\r\n\r\n        async def handle_sse(request: Request):\r\n            async with sse.connect_sse(\r\n                request.scope,\r\n                request.receive,\r\n                request._send, \r\n            ) as streams:\r\n                await mcp_server.run(\r\n                    streams[0],\r\n                    streams[1],\r\n                    mcp_server.create_initialization_options(),\r\n                )\r\n\r\n        return Starlette(\r\n            routes=[\r\n                Route(\"/mcp/sse\", endpoint=handle_sse),\r\n                Mount(\"/mcp/messages\", app=sse.handle_post_message),\r\n            ],\r\n        )\r\n"
  },
  {
    "path": "python/mcp_server/sse.py",
    "content": "\"\"\"\nSSE Server Transport Module\n\nThis module implements a Server-Sent Events (SSE) transport layer for MCP servers.\n\nExample usage:\n```\n    # Create an SSE transport at an endpoint\n    sse = SseServerTransport(endpoint=\"/messages/\", redis_client=None)\n\n    # Create Starlette routes for SSE and message handling\n    routes = [\n        Route(\"/sse\", endpoint=handle_sse),\n        Mount(\"/messages/\", app=sse.handle_post_message),\n    ]\n\n    # Define handler functions\n    async def handle_sse(request):\n        async with sse.connect_sse(\n            request.scope, request.receive, request._send\n        ) as streams:\n            await app.run(\n                streams[0], streams[1], app.create_initialization_options()\n            )\n\n    # Create and run Starlette app\n    starlette_app = Starlette(routes=routes)\n    uvicorn.run(starlette_app, host=\"0.0.0.0\", port=port)\n```\n\nSee SseServerTransport class documentation for more details.\n\"\"\"\n\nimport logging\nimport pickle\nfrom contextlib import asynccontextmanager\nfrom typing import Any\nfrom urllib.parse import quote\nfrom uuid import UUID, uuid4\n\nimport anyio\nfrom anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream\nfrom pydantic import ValidationError\nfrom sse_starlette import EventSourceResponse\nfrom starlette.requests import Request\nfrom starlette.responses import Response\nfrom starlette.types import Receive, Scope, Send\n\nimport mcp.types as types\n\nlogger = logging.getLogger(__name__)\n\n\nclass SseServerTransport:\n    \"\"\"\n    SSE server transport for MCP. This class provides _two_ ASGI applications,\n    suitable to be used with a framework like Starlette and a server like Hypercorn:\n\n        1. connect_sse() is an ASGI application which receives incoming GET requests,\n           and sets up a new SSE stream to send server messages to the client.\n        2. handle_post_message() is an ASGI application which receives incoming POST\n           requests, which should contain client messages that link to a\n           previously-established SSE session.\n    \"\"\"\n\n    _endpoint: str\n    _read_stream_writers: dict[\n        UUID, MemoryObjectSendStream[types.JSONRPCMessage | Exception]\n    ]\n\n    def __init__(self, endpoint: str, redis_client=None) -> None:\n        \"\"\"\n        Creates a new SSE server transport, which will direct the client to POST\n        messages to the relative or absolute URL given.\n        redis_client: redis client based on aioredis.\n        \"\"\"\n        super().__init__()\n        self._redis_client = redis_client\n        self._endpoint = endpoint\n        self._read_stream_writers = {}\n        logger.debug(f\"SseServerTransport initialized with endpoint: {endpoint}\")\n\n    @asynccontextmanager\n    async def connect_sse(self, scope: Scope, receive: Receive, send: Send):\n        if scope[\"type\"] != \"http\":\n            logger.error(\"connect_sse received non-HTTP request\")\n            raise ValueError(\"connect_sse can only handle HTTP requests\")\n\n        logger.debug(\"Setting up SSE connection\")\n        read_stream: MemoryObjectReceiveStream[types.JSONRPCMessage | Exception]\n        read_stream_writer: MemoryObjectSendStream[types.JSONRPCMessage | Exception]\n\n        write_stream: MemoryObjectSendStream[types.JSONRPCMessage]\n        write_stream_reader: MemoryObjectReceiveStream[types.JSONRPCMessage]\n\n        read_stream_writer, read_stream = anyio.create_memory_object_stream(0)\n        write_stream, write_stream_reader = anyio.create_memory_object_stream(0)\n\n        session_id = uuid4()\n        session_uri = f\"{quote(self._endpoint)}?session_id={session_id.hex}\"\n        self._read_stream_writers[session_id] = read_stream_writer\n        logger.debug(f\"Created new session with ID: {session_id}\")\n\n        sse_stream_writer, sse_stream_reader = anyio.create_memory_object_stream[\n            dict[str, Any]\n        ](0)\n\n        async def sse_writer():\n            logger.debug(\"Starting SSE writer\")\n            async with sse_stream_writer, write_stream_reader:\n                await sse_stream_writer.send({\"event\": \"endpoint\", \"data\": session_uri})\n                logger.debug(f\"Sent endpoint event: {session_uri}\")\n\n                async for message in write_stream_reader:\n                    logger.debug(f\"Sending message via SSE: {message}\")\n                    await sse_stream_writer.send(\n                        {\n                            \"event\": \"message\",\n                            \"data\": message.model_dump_json(\n                                by_alias=True, exclude_none=True\n                            ),\n                        }\n                    )\n\n        async with anyio.create_task_group() as tg:\n            response = EventSourceResponse(\n                content=sse_stream_reader, data_sender_callable=sse_writer\n            )\n            logger.debug(\"Starting SSE response task\")\n            tg.start_soon(response, scope, receive, send)\n            if self._redis_client:\n                tg.start_soon(self._subscribe_loop, session_id)\n            logger.debug(\"Yielding read and write streams\")\n            yield (read_stream, write_stream)\n\n    async def _subscribe_loop(self, session_id: UUID):\n        pubsub = self._redis_client.pubsub()\n        await pubsub.psubscribe(self._redis_channel(session_id))\n        async for message in pubsub.listen():\n            if message[\"type\"] == \"pmessage\":\n                json_data = pickle.loads(message[\"data\"])\n                logger.debug(f\"Received message on {session_id.hex}: {json_data}\")\n                try:\n                    message = types.JSONRPCMessage.model_validate(json_data)\n                    logger.debug(\n                        f\"{session_id.hex} Validated client message: {message}\"\n                    )\n                except ValidationError as err:\n                    logger.error(f\"{session_id} Failed to parse message: {err}\")\n                    await self._read_stream_writers[session_id].send(err)\n                    return\n\n                logger.debug(f\"{session_id.hex} Sending message to writer: {message}\")\n                await self._read_stream_writers[session_id].send(message)\n\n    async def handle_post_message(\n        self, scope: Scope, receive: Receive, send: Send\n    ) -> None:\n        logger.debug(\"Handling POST message\")\n        request = Request(scope, receive)\n\n        session_id_param = request.query_params.get(\"session_id\")\n        if session_id_param is None:\n            logger.warning(\"Received request without session_id\")\n            response = Response(\"session_id is required\", status_code=400)\n            return await response(scope, receive, send)\n\n        try:\n            session_id = UUID(hex=session_id_param)\n            logger.debug(f\"Parsed session ID: {session_id}\")\n        except ValueError:\n            logger.warning(f\"Received invalid session ID: {session_id_param}\")\n            response = Response(\"Invalid session ID\", status_code=400)\n            return await response(scope, receive, send)\n\n        writer = self._read_stream_writers.get(session_id)\n        if not writer:\n            logger.warning(f\"Could not find session for ID: {session_id}\")\n            response = Response(\"Could not find session\", status_code=404)\n            return await response(scope, receive, send)\n\n        body = await request.body()\n        logger.debug(f\"Received JSON: {body}\")\n        if self._redis_client:\n            response = Response(\"Accepted\", status_code=202)\n            json_data = await request.json()\n            await response(scope, receive, send)\n            await self._redis_client.publish(\n                self._redis_channel(session_id), pickle.dumps(json_data)\n            )\n            return\n\n        try:\n            message = types.JSONRPCMessage.model_validate_json(body)\n            logger.debug(f\"Validated client message: {message}\")\n        except ValidationError as err:\n            logger.error(f\"Failed to parse message: {err}\")\n            response = Response(\"Could not parse message\", status_code=400)\n            await response(scope, receive, send)\n            await writer.send(err)\n            return\n\n        logger.debug(f\"Sending message to writer: {message}\")\n        response = Response(\"Accepted\", status_code=202)\n        await response(scope, receive, send)\n        await writer.send(message)\n\n    def _redis_channel(self, session_id: UUID) -> str:\n        return f\"mcp-{session_id.hex}\"\n"
  },
  {
    "path": "python/tests/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/tests/component_check.py",
    "content": "import json\nimport os\nimport inspect\nfrom jsonschema import validate\nfrom pydantic import BaseModel\nfrom appbuilder.utils.func_utils import Singleton\nfrom appbuilder.tests.component_schemas import type_to_json_schemas\nfrom appbuilder.utils.json_schema_to_model import json_schema_to_pydantic_model\n\nclass CheckInfo(BaseModel):\n    check_rule_name: str\n    check_result: bool\n    check_detail: str\n\n\nclass RuleBase(object):\n    def __init__(self):\n        self.invalid = False\n\n    def check(self, component_cls) -> CheckInfo:\n        raise NotImplementedError\n\n    def reset_state(self):\n        self.invalid = False\n\n\nclass ComponentCheckBase(metaclass=Singleton):\n    def __init__(self):\n        self.rules = {}\n\n    def register_rule(self, rule_name: str, rule_obj: RuleBase):\n        if not isinstance(rule_obj, RuleBase):\n            raise TypeError(\"rule_obj must be a subclass of RuleBase\")\n        if rule_name in self.rules:\n            raise ValueError(f\"Rule {rule_name} already exists.\")\n        self.rules[rule_name] = rule_obj\n\n    def remove_rule(self, rule_name: str):\n        del self.rules[rule_name]\n\n    def notify(self, component_obj, component_case) -> tuple[bool, list]:\n        check_pass = True\n        check_details = {}\n        reasons = []\n        for rule_name, rule_obj in self.rules.items():\n            if rule_name == \"ToolEvalOutputJsonRule\":\n                res = rule_obj.check(component_obj, component_case)\n            else:\n                res = rule_obj.check(component_obj)\n            check_details[rule_name] = res\n            if res.check_result == False:\n                check_pass = False\n                reasons.append(res.check_detail)\n\n        if check_pass:\n            return True, reasons\n        else:\n            return False, reasons\n\nclass ManifestValidRule(RuleBase):\n    \"\"\"\n    通过尝试将component的manifest转换为pydantic模型来检查manifest是否符合规范\n    \"\"\"\n    def __init__(self, **kwargs):\n        super().__init__()\n        self.rule_name = \"ManifestValidRule\"\n\n    def check(self, component_obj) -> CheckInfo:\n        check_pass_flag = True\n        invalid_details = []\n\n        try:\n            if not hasattr(component_obj, \"manifests\"):\n                raise ValueError(\"No manifests found\")\n            manifests = component_obj.manifests\n            # NOTE(暂时检查manifest中的第一个mainfest)\n            if not manifests or len(manifests) == 0:\n                raise ValueError(\"No manifests found\")\n            manifest = manifests[0]\n            tool_name = manifest['name']\n            tool_desc = manifest['description']\n            schema = manifest[\"parameters\"]\n            schema[\"title\"] = tool_name\n            # 第一步，将json schema转换为pydantic模型\n            pydantic_model = json_schema_to_pydantic_model(schema, tool_name)\n            check_to_json = pydantic_model.schema_json()\n            json_to_dict = json.loads(check_to_json)\n\n            if \"properties\" in schema:\n                properties = schema[\"properties\"]\n                for key, value in properties.items():\n                    if \"type\" not in value:\n                        invalid_details.append(\"\\'type' must be in properties item: {}\".format(key))\n                    if \"description\" not in value:\n                        invalid_details.append(\"\\'description' must be in properties item: {}\".format(key))\n            \n        except Exception as e:\n            print(e)\n            check_pass_flag = False\n            invalid_details.append(str(e))\n                \n        if len(invalid_details) > 0:\n            check_pass_flag = False\n            invalid_details = \",\".join(invalid_details)\n        else:\n            check_pass_flag = True\n            invalid_details = \"\"\n        return CheckInfo(\n            check_rule_name=self.rule_name,\n            check_result=check_pass_flag,\n            check_detail=invalid_details)\n\nData_Type = {\n    'string': str,\n    'integer': int,\n    'object': int,\n    'array': list,\n    'boolean': bool,\n    'null': None,\n}\n\nclass InitKwargsRule(RuleBase):\n    def __init__(self):\n        super().__init__()\n        self.rule_name = \"InitKwargsRule\"\n\n    def _accepts_kwargs(self, func):\n        \"\"\"\n        检查函数是否接受 **kwargs 参数。\n        \"\"\"\n        sig = inspect.signature(func)\n        params = sig.parameters\n        return any(p.kind == inspect.Parameter.VAR_KEYWORD for p in params.values())\n\n    def check(self, component_obj) -> CheckInfo:\n        if not self._accepts_kwargs(component_obj.__init__):\n            return CheckInfo(\n                check_rule_name=self.rule_name,\n                check_result=False,\n                check_detail=\"组件的__init__初始化方法需要添加**kwargs参数\"\n            )\n        else:\n            return CheckInfo(\n                check_rule_name=self.rule_name,\n                check_result=True,\n                check_detail=\"\"\n            )\n\nclass ToolEvalKwargsRule(RuleBase):\n    def __init__(self):\n        super().__init__()\n        self.rule_name = \"ToolEvalKwargsRule\"\n\n    def _accepts_kwargs(self, func):\n        \"\"\"\n        检查函数是否接受 **kwargs 参数。\n        \"\"\"\n        sig = inspect.signature(func)\n        params = sig.parameters\n        return any(p.kind == inspect.Parameter.VAR_KEYWORD for p in params.values())\n\n    def check(self, component_obj) -> CheckInfo:\n        if not self._accepts_kwargs(component_obj.tool_eval):\n            return CheckInfo(\n                check_rule_name=self.rule_name,\n                check_result=False,\n                check_detail=\"组件的__init__初始化方法需要添加**kwargs参数\"\n            )\n        else:\n            return CheckInfo(\n                check_rule_name=self.rule_name,\n                check_result=True,\n                check_detail=\"\"\n            )\n        \n\nclass MainfestMatchToolEvalRule(RuleBase):\n    def __init__(self):\n        super().__init__()\n        self.rule_name = \"MainfestMatchToolEvalRule\"\n\n\n    def check(self, component_obj) -> CheckInfo:\n        check_pass_flag = True\n        invalid_details = []\n\n        try:\n            if not hasattr(component_obj, \"manifests\"):\n                raise ValueError(\"No manifests found\")\n            manifests = component_obj.manifests\n            # NOTE(暂时检查manifest中的第一个mainfest)\n            if not manifests or len(manifests) == 0:\n                raise ValueError(\"No manifests found\")\n            manifest = manifests[0]\n            if 'parameters' in manifest and 'properties' in manifest['parameters']:\n                properties = manifest['parameters']['properties']\n                manifest_var = properties.keys()\n            else:\n                manifest_var = []\n            \n            # 交互检查\n            tool_eval_input_params = []\n            print(\"required_params: {}\".format(manifest_var))\n            signature = inspect.signature(component_obj.tool_eval)\n            ileagal_params = []\n            for param_name, param in signature.parameters.items():\n                if param_name == 'kwargs' or param_name == 'args' or param_name == 'self':\n                    continue\n                tool_eval_input_params.append(param_name)\n                if param_name not in manifest_var:\n                    check_pass_flag = False\n                    ileagal_params.append(param_name)\n\n            if len(ileagal_params) > 0:\n                invalid_details.append(\"tool_eval 参数 {} 不在 mainfest 参数列表中\".format(\",\".join(ileagal_params)))\n\n            ileagal_params =[]\n            for required_param in manifest_var:\n                if required_param not in tool_eval_input_params:\n                    check_pass_flag = False\n                    ileagal_params.append(required_param)\n            if len(ileagal_params) > 0:\n                invalid_details.append(\"mainfest 参数 {} 不在 tool_eval 参数列表中\".format(\",\".join(ileagal_params)))\n\n            return CheckInfo(\n                check_rule_name=self.rule_name,\n                check_result=check_pass_flag,\n                check_detail=\",\".join(invalid_details))\n\n        except Exception as e:\n            check_pass_flag = False\n            invalid_details.append(str(e))\n            return CheckInfo(\n                check_rule_name=self.rule_name,\n                check_result=check_pass_flag,\n                check_detail=\",\".join(invalid_details))\n\n\nclass ToolEvalInputNameRule(RuleBase):\n    \"\"\"\n    检查tool_eval的输入参数中，是否包含系统保留的输入名称\n    \"\"\"\n    def __init__(self):\n        super().__init__()\n        self.rule_name = 'ToolEvalInputNameRule'\n        self.system_input_name = [\n            \"_sys_name\",\n            \"_sys_origin_query\",\n            \"_sys_user_instruction\",\n            \"_sys_file_names\",\n            \"_sys_file_urls\",\n            \"_sys_current_time\",\n            \"_sys_chat_history\",\n            \"_sys_used_tool\",\n            \"_sys_uid\",\n            \"_sys_traceid\",\n            \"_sys_conversation_id\",\n            \"_sys_gateway_endpoint\",\n            \"_sys_appbuiler_token\",\n            \"_sys_debug\",\n            \"_sys_custom_variables\",\n            \"_sys_thought_model_config\",\n            \"_sys_rag_model_config\",\n            \"_sys_parent_span_id\",\n            \"_sys_span_id\",\n            \"_sys_memory\",\n            \"_sys_code_execution_endpoint\",\n            \"_sys_session_id\"\n        ]\n\n    def check(self, component_obj) -> CheckInfo:\n        tool_eval_signature = inspect.signature(component_obj.tool_eval)\n        params = tool_eval_signature.parameters\n        invalid_details = []\n        check_pass_flag = True\n        for param_name in params:\n            if param_name == 'self':\n                continue\n            if param_name in self.system_input_name:\n                invalid_details.append(param_name)\n                check_pass_flag = False\n\n\n        return CheckInfo(\n            check_rule_name=self.rule_name,\n            check_result=check_pass_flag,\n            check_detail=\"以下ToolEval方法参数名称是系统保留字段，请更换：{}\".format(\"，\".join(invalid_details)) if len(invalid_details) > 0 else \"\")\n\n\nclass ToolEvalOutputJsonRule(RuleBase):\n    \"\"\"\n    检查tool_eval的输出结果是否符合对应的json schema\n    \"\"\"\n    def __init__(self, **kwargs):\n        super().__init__()\n        self.rule_name = 'ToolEvalOutputJsonRule'\n\n    def _check_pre_format(self, outputs):\n        invalid_details = []\n        if \"content\" not in outputs:\n            invalid_details.append(\"ToolEval返回值不符合规范：返回内容缺少content\")\n            return invalid_details\n        \n        for content in outputs[\"content\"]:\n            if \"type\" not in content:\n                invalid_details.append(\"ToolEval返回值不符合规范：返回content缺少type\")\n                break\n            \n            out_type = content[\"type\"]\n            if out_type not in type_to_json_schemas:\n                invalid_details.append(\"ToolEval返回值不符合JSON Schema：返回content.type={} 不是合法的输出类型\".format(out_type))\n                break\n        return invalid_details\n        \n    def _check_jsonschema(self, outputs, output_schemas):\n        \"\"\"检查输出格式是否符合对应的json schema\n        \"\"\"\n        invalid_details = []\n        if len(self._check_pre_format(outputs)) > 0 :\n            return invalid_details\n    \n        for content in outputs[\"content\"]: \n            out_type = content[\"type\"]\n            out_schema = type_to_json_schemas[out_type]\n            if out_schema not in output_schemas:\n                invalid_details.append(\"ToolEval返回值不符合JSON Schema：{} 不是该组件期望的Json Schema输出类型\".format(out_schema['$schema']))\n                continue\n            try:\n                validate(instance=content, schema=out_schema)\n            except Exception as e:\n                invalid_details.append(\"ToolEval返回值不符合JSON Schema: {}\\n\".format(e.message))\n        return invalid_details\n\n    def _gather_iter_outputs(self, outputs):\n        text_output = \"\"\n        oral_text_output = \"\"\n        code_output = \"\"\n        for content in outputs.content:\n            out_type = content.type\n            if out_type == \"text\":\n                text_output += content.text.info\n            elif out_type == \"oral_text\":\n                oral_text_output += content.text.info\n            elif out_type == \"code\":\n                code_output += content.text.code\n        return {\n            \"text\": text_output,\n            \"oral_text\": oral_text_output,\n            \"code\": code_output,\n        }\n        \n    def _check_text_and_code(self, component_case, output_dict):\n        \"\"\"检查输出的内容是否符合预期，只检查text(包含oral_text)和code\n        \"\"\"\n        if not hasattr(component_case,\"outputs\"):\n            return []\n\n        expected_output = component_case.outputs()\n        expected_output_texts = []\n        expected_output_oral_texts = []\n        expected_output_codes = []\n        if \"text\" in expected_output:\n            expected_output_texts = expected_output[\"text\"] \n        if \"oral_text\" in expected_output:\n            expected_output_oral_texts = expected_output[\"oral_text\"] \n        if \"code\" in expected_output:\n            expected_output_codes = expected_output[\"code\"]\n    \n        lost_texts = []\n        lost_oral_texts = []\n        lost_code = []\n        for expected_output_text in expected_output_texts:\n            if expected_output_text not in output_dict[\"text\"]:\n                lost_texts.append(expected_output_text)\n\n        for expected_output_oral_text in expected_output_oral_texts:\n            if expected_output_oral_text not in output_dict[\"oral_text\"]:\n                lost_oral_texts.append(expected_output_oral_text)\n\n        for expected_output_code in expected_output_codes:\n            if expected_output_code not in output_dict[\"code\"]:\n                lost_code.append(expected_output_code)\n\n        error_message = \"\"\n        if len(lost_texts) > 0:\n            error_message += \"应包含text:{}\".format(\", \".join(lost_texts))\n        if len(lost_oral_texts) > 0:\n            error_message += \"应包含oral_text:{}\".format(\", \".join(lost_oral_texts))\n        if len(lost_code) > 0:\n            error_message += \"应包含code:{}\".format(\", \".join(lost_code))\n            \n        if error_message != \"\":\n            return [\"ToolEval返回内容与预期不符: \" + error_message]\n        else:\n            return []\n        \n    def check(self, component_obj, component_case) -> CheckInfo:\n        invalid_details = []\n        \n        input_dict = component_case.inputs()\n        output_json_schemas = component_case.schemas()\n        \n        try:\n            stream_output_dict = {\"text\": \"\", \"oral_text\":\"\", \"code\": \"\"}\n            stream_outputs = component_obj.tool_eval(**input_dict)\n            for stream_output in stream_outputs:\n                iter_invalid_detail = self._check_jsonschema(stream_output.model_dump(), output_json_schemas)\n                invalid_details.extend(iter_invalid_detail)\n                iter_output_dict = self._gather_iter_outputs(stream_output)\n                stream_output_dict[\"text\"] += iter_output_dict[\"text\"]\n                stream_output_dict[\"oral_text\"] += iter_output_dict[\"oral_text\"]\n                stream_output_dict[\"code\"] += iter_output_dict[\"code\"]\n            if len(invalid_details) == 0:\n                invalid_details.extend(self._check_text_and_code(component_case, stream_output_dict))\n        except Exception as e:\n            invalid_details.append(\"ToolEval执行失败: {}\".format(e))\n                    \n        if len(invalid_details) > 0:\n            return CheckInfo(\n                check_rule_name=self.rule_name,\n                check_result=False,\n                check_detail=\",\".join(invalid_details))\n        else:\n            return CheckInfo(\n                check_rule_name=self.rule_name,\n                check_result=True,\n                check_detail=\"\")\n\n\ndef register_component_check_rule(rule_name: str, rule_cls: RuleBase):\n    component_checker = ComponentCheckBase()\n    component_checker.register_rule(rule_name, rule_cls())\n\n\ndef check_component_with_retry(component_import_res_tuple):\n    \"\"\"\n    使用重试机制检查组件。测试用例失败后会重试两次。\n    \n    Args:\n        component_import_res_tuple (tuple): 包含组件和导入结果的元组。\n    \n    Returns:\n        list: 包含错误信息的数据列表。\n    \n    \"\"\"\n    component, import_res, component_case_cls = component_import_res_tuple\n    component_check_base = ComponentCheckBase()\n    if inspect.isclass(component):\n        component_name = component.__name__\n    else:\n        component_name = component\n    error_data = []\n    max_retries = 2  # 设置最大重试次数\n    attempts = 0\n\n    while attempts <= max_retries:\n        if import_res[\"import_error\"] != \"\":\n            error_data.append({\"Component Name\": component_name, \"Error Message\": import_res[\"import_error\"]})\n            print(\"组件名称:{} 错误信息:{}\".format(component_name, import_res[\"import_error\"]))\n            break\n        \n        component_case = component_case_cls()\n        envs = component_case.envs()\n        os.environ.update(envs)\n        component_cls = import_res[\"obj\"]\n        component_obj = component_cls(**component_case.init_args())\n        \n        try:\n            # 此处的self.component_check_base.notify需要根据实际情况修改\n            pass_check, reasons = component_check_base.notify(component_obj, component_case) # 示例修改\n            reasons = list(set(reasons))\n            if not pass_check:\n                error_data.append({\"Component Name\": component_name, \"Error Message\": \", \".join(reasons)})\n                print(\"组件名称:{} 错误信息:{}\".format(component_name, \", \".join(reasons)))\n                # 如果检查失败，增加尝试次数并重试\n                attempts += 1\n                if attempts <= max_retries:\n                    print(\"组件名称:{} 将重试，当前尝试次数:{}\".format(component_name, attempts))\n                continue\n            # 如果检查通过，则退出循环\n            break\n        except Exception as e:\n            error_data.append({\"Component Name\": component_name, \"Error Message\": str(e)})\n            print(\"组件名称:{} 错误信息:{}\".format(component_name, str(e)))\n            # 如果发生异常，增加尝试次数并重试\n            attempts += 1\n            if attempts <= max_retries:\n                print(\"组件名称:{} 将重试，当前尝试次数:{}\".format(component_name, attempts))\n            continue\n        \n        finally:\n            for env in envs:\n                os.environ.pop(env)\n        \n    return error_data\n\ndef write_error_data(txt_file_path, error_df, error_stats):\n    \"\"\"将组件错误信息写入文件\n\n    Args:\n        error_df (Union[pd.DataFrame, None]): 错误信息表格\n        error_stats (dict): 错误统计信息\n    \"\"\"\n    with open(txt_file_path, 'w') as file:\n        file.write(\"Component Name\\tError Message\\n\")\n        for _, row in error_df.iterrows():\n            file.write(f\"{row['Component Name']}\\t{row['Error Message']}\\n\")\n        file.write(\"\\n错误统计信息:\\n\")\n        for error, count in error_stats.items():\n            file.write(f\"错误信息: {error}, 出现次数: {count}\\n\")\n    print(f\"\\n错误信息已写入: {txt_file_path}\")\n\n\nregister_component_check_rule(\"ManifestValidRule\", ManifestValidRule)\nregister_component_check_rule(\"MainfestMatchToolEvalRule\", MainfestMatchToolEvalRule)\nregister_component_check_rule(\"ToolEvalInputNameRule\", ToolEvalInputNameRule)\nregister_component_check_rule(\"ToolEvalOutputJsonRule\", ToolEvalOutputJsonRule)\nregister_component_check_rule(\"InitKwargsRule\", InitKwargsRule)\nregister_component_check_rule(\"ToolEvalKwargsRule\", ToolEvalKwargsRule)"
  },
  {
    "path": "python/tests/component_collector.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport appbuilder\n\n# SKIP名单中的组件无需检查，直接跳过\nSKIP_COMPONENTS = [\n]\n\nV2_SKIP_COMPONENTS = [\n    \"ASR\",\n    \"TreeMind\",\n    \"Text2Image\"# 偶现性报错，暂时跳过\n]\n\n# 白名单中的组件因历史原因，检查失败，但可以正常使用，因此加入白名单\nCOMPONENT_WHITE_LIST = [\n    \"RagWithBaiduSearchPro\",\n    \"RAGWithBaiduSearch\",\n    \"MRC\",\n    \"OralQueryGeneration\",\n    \"QAPairMining\",\n    \"SimilarQuestion\",\n    \"StyleWriting\",\n    \"StyleRewrite\",\n    \"TagExtraction\",\n    \"Nl2pandasComponent\",\n    \"QueryRewrite\",\n    \"DialogSummary\",\n    \"HallucinationDetection\",\n    \"Playground\",\n    \"ASR\",\n    \"GeneralOCR\",\n    \"ObjectRecognition\",\n    \"Text2Image\",\n    \"LandmarkRecognition\",\n    \"TTS\",\n    \"ExtractTableFromDoc\",\n    \"DocParser\",\n    \"DocSplitter\",\n    \"BESRetriever\",\n    \"BESVectorStoreIndex\",\n    \"BaiduVDBVectorStoreIndex\",\n    \"BaiduVDBRetriever\",\n    \"TableParams\",\n    \"Reranker\",\n    \"PPTGenerationFromInstruction\",\n    \"PPTGenerationFromPaper\",\n    \"PPTGenerationFromFile\",\n    \"DishRecognition\",\n    \"Translation\",\n    \"AnimalRecognition\",\n    \"DocCropEnhance\",\n    \"QRcodeOCR\",\n    \"TableOCR\",\n    \"DocFormatConverter\",\n    \"Embedding\",\n    \"Matching\",\n    \"NL2Sql\",\n    \"SelectTable\",\n    \"PlantRecognition\",\n    \"HandwriteOCR\",\n    \"ImageUnderstand\",\n    \"MixCardOCR\",\n    \"DocumentUnderstanding\",\n    \"TreeMind\"\n]\n\n\ndef get_component_white_list():\n    return COMPONENT_WHITE_LIST\n\ndef get_components(components_list, import_prefix, skip_components):\n    components = {}\n    for component in components_list:\n        if not isinstance(component, str):\n            component = component.__name__\n        \n        if component in skip_components:\n            continue\n\n        try:\n            component_obj = eval(import_prefix+component)\n            components[component]= {\n                \"obj\": component_obj,\n                \"import_error\": \"\"\n            }\n        except Exception as e:\n            print(\"Component: {} import with error: {}\".format(component, str(e)))\n            components[component]= {\n                \"obj\": None,\n                \"import_error\": str(e)\n            }\n\n    return components\n\ndef get_all_components():\n    from appbuilder import __COMPONENTS__\n    all_components = get_components(__COMPONENTS__, \"appbuilder.\", SKIP_COMPONENTS)\n    return all_components\n\ndef get_v2_components():\n    from appbuilder.core.components.v2 import __V2_COMPONENTS__\n    v2_components = get_components(__V2_COMPONENTS__, \"appbuilder.core.components.v2.\", V2_SKIP_COMPONENTS)\n    return v2_components\n\nif __name__ == '__main__':\n    all_components = get_all_components()\n    v2_components = get_v2_components()\n    print(\"all_components: \", all_components)\n    print(\"v2_components: \", v2_components)"
  },
  {
    "path": "python/tests/component_schemas.py",
    "content": "import copy\nbase_item_schema = {\n  \"$schema\": \"base iter template\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"type\": {\n      \"type\": \"string\"\n    },\n    \"name\": {\n      \"type\": \"string\"\n    },\n    \"text\": {\n      \"type\": \"object\"\n    },\n    \"visible_scope\": {\n      \"enum\": [\"llm\", \"user\", \"all\"]\n    },\n    \"raw_data\": {\n      \"type\": \"object\"\n    },\n    \"usage\": {\n      \"type\": \"object\",\n      \"properties\": {\n          \"prompt_tokens\": {\n              \"type\": \"integer\"\n          },\n          \"completion_tokens\": {\n              \"type\": \"integer\"\n          },\n          \"total_tokens\": {\n              \"type\": \"integer\"\n          },\n          \"name\": {\n              \"type\": \"string\"\n          }\n      },\n    },\n    \"metrics\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"first_token_time(s)\": {\n          \"type\": \"number\"\n        },\n        \"total_time(s)\": {\n          \"type\": \"number\"\n        },\n        \"memory_used(MB)\": {\n          \"type\": \"number\"\n        }\n      }\n    }\n  },\n  \"required\": [\"type\", \"text\"]\n}\n\ntext_schema = copy.deepcopy(base_item_schema)\ntext_schema[\"$schema\"] = \"text_schema\"\ntext_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"text\"]\n}\ntext_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n      \"info\": {\n          \"type\": \"string\"\n      }\n  },\n  \"required\": [\"info\"]\n}\n\ncode_schema = copy.deepcopy(base_item_schema)\ncode_schema[\"$schema\"] = \"code_schema\"\ncode_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"code\"]\n}\ncode_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"code\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"code\"]\n}\n\nfile_schema = copy.deepcopy(base_item_schema)\nfile_schema[\"$schema\"] = \"file_schema\"\nfile_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"files\"]\n}\nfile_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"filename\": {\n      \"type\": \"string\"\n    },\n    \"url\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"filename\", \"url\"]\n}\n\nurl_schema = copy.deepcopy(base_item_schema)\nurl_schema[\"$schema\"] = \"url_schema\"\nurl_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"urls\"]\n}\nurl_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"url\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"url\"]\n}\n\noral_text_schema = copy.deepcopy(base_item_schema)\noral_text_schema[\"$schema\"] = \"oral_text_schema\"\noral_text_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"oral_text\"]\n}\noral_text_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"info\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"info\"]\n}\n\nreferences_schema = copy.deepcopy(base_item_schema)\nreferences_schema[\"$schema\"] = \"references_schema\"\nreferences_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"references\"]\n}\nreferences_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"type\": {\n      \"type\": \"string\"\n    },\n    \"doc_id\": {\n      \"type\": \"string\"\n    },\n    \"content\": {\n      \"type\": \"string\"\n    },\n    \"title\": {\n      \"type\": \"string\"\n    },\n    \"source\": {\n      \"type\": \"string\"\n    },\n    \"extra\": {\n      \"type\": \"object\"\n    }\n  },\n  \"required\": [\"type\", \"doc_id\", \"content\", \"title\", \"source\"]\n}\n\nimage_schema = copy.deepcopy(base_item_schema)\nimage_schema[\"$schema\"] = \"image_schema\"\nimage_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"image\"]\n}\nimage_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"filename\": {\n      \"type\": \"string\"\n    },\n    \"url\": {\n      \"type\": \"string\"\n    },\n    \"base64\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"filename\", \"url\"]\n}\n\nchart_schema = copy.deepcopy(base_item_schema)\nchart_schema[\"$schema\"] = \"chart_schema\"\nchart_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"chart\"]\n}\nchart_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"type\": {\n      \"type\": \"string\"\n    },\n    \"data\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"type\", \"data\"]\n}\n\naudio_schema = copy.deepcopy(base_item_schema)\naudio_schema[\"$schema\"] = \"audio_schema\"\naudio_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"audio\"]\n}\naudio_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"filename\": {\n      \"type\": \"string\"\n    },\n    \"url\": {\n      \"type\": \"string\"\n    },\n    \"base64\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"filename\", \"url\"]\n}\n\njson_schema = copy.deepcopy(base_item_schema)\njson_schema[\"$schema\"] = \"json_schema\"\njson_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"json\"]\n}\njson_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"data\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"data\"]\n}\n\nplan_schema = copy.deepcopy(base_item_schema)\nplan_schema[\"$schema\"] = \"plan_schema\"\nplan_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"plan\"]\n}\nplan_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"detail\": {\n      \"type\": \"string\"\n    },\n    \"steps\": {\n      \"type\": \"array\",\n      \"items\": {\n          \"type\": \"object\",\n          \"properties\": {\n              \"name\": {\"type\": \"string\"},\n              \"arguments\": {\n                \"type\": \"object\",\n                \"additionalProperties\": True\n              }\n          },\n          \"required\": [\"name\", \"arguments\"]\n      }\n    }\n  },\n  \"required\": [\"detail\", \"steps\"]\n}\n\n\nfunction_call_schema = copy.deepcopy(base_item_schema)\nfunction_call_schema[\"$schema\"] = \"function_call_schema\"\nfunction_call_schema[\"properties\"][\"type\"] = {\n    \"type\": \"string\",\n    \"enum\": [\"function_call\"]\n}\nfunction_call_schema[\"properties\"][\"text\"] = {\n  \"type\": \"object\",\n  \"properties\": {\n    \"thought\": {\n      \"type\": \"string\"\n    },\n    \"name\": {\n      \"type\": \"string\",\n    },\n    \"arguments\": {\n      \"type\": \"object\",\n      \"additionalProperties\": True\n    }\n  },\n  \"required\": [\"thought\", \"name\", \"arguments\"],\n}\n\n\ntype_to_json_schemas = {\n  \"text\": text_schema,\n  'code': code_schema,\n  \"files\": file_schema,\n  \"urls\": url_schema,\n  \"oral_text\": oral_text_schema,\n  \"references\": references_schema,\n  \"image\": image_schema,\n  \"chart\": chart_schema,\n  \"audio\": audio_schema,\n  \"json\": json_schema,\n  \"plan\": plan_schema,\n  \"function_call\": function_call_schema,\n}"
  },
  {
    "path": "python/tests/component_tool_eval_cases.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nfrom appbuilder.core.component import Component\nfrom appbuilder.tests.component_schemas import text_schema, url_schema, image_schema, code_schema, file_schema, \\\n    oral_text_schema, references_schema, chart_schema, audio_schema, plan_schema, function_call_schema\n\n\nclass Case():\n    def init_args(self):\n        return {}\n\n    def inputs(self):\n        return NotImplementedError()\n\n    def outputs(self):\n        return {}\n\n    def schemas(self):\n        return NotImplementedError()\n\n    def envs(self):\n        return {}\n\n\nclass AnimalRecognitionCase(Case):\n    def inputs(self):\n        return {\n            \"img_name\": \"\",\n            \"img_url\": \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                       \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                       \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                       \"62cf937c03f8c5260d51c6ae\"\n        }\n\n    def outputs(self):\n        return {\"text\": [\"熊猫\"]}\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass ASRCase(Case):\n    def inputs(self):\n        return {\n            \"file_url\": \"https://bj.bcebos.com/v1/appbuilder/asr_test.pcm?authorization=bce-auth-v1\" \\\n                        \"%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A56%3A41Z%2F-1%2Fhost\" \\\n                        \"%2Fa6c4d2ca8a3f0259f4cae8ae3fa98a9f75afde1a063eaec04847c99ab7d1e411\"\n        }\n\n    def outputs(self):\n        return {\"text\": [\"北京科技馆\"]}\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass TreeMindCase(Case):\n    def inputs(self):\n        return {\"query\": \"生成一份年度总结的思维导图\"}\n\n    def schemas(self):\n        return [text_schema, url_schema]\n\n\nclass ImageUnderstandCase(Case):\n    def inputs(self):\n        return {\n            \"img_url\": \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                       \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                       \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                       \"62cf937c03f8c5260d51c6ae\",\n            \"img_name\": \"test_img.jpg\"\n        }\n\n    def outputs(self):\n        return {\"text\": [\"熊猫\"]}\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass Text2ImageCase(Case):\n    def inputs(self):\n        return {\"query\": \"生成一张熊猫图片\"}\n\n    def schemas(self):\n        return [url_schema]\n\n\nclass StyleRewriteCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\"query\": \"文心大模型发布新版\"}\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass QRcodeOCRCase(Case):\n    def inputs(self):\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        return {\n            \"file_names\": [\"text\"],\n            \"_sys_file_urls\": {\"text\": image_url}\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"ocr文字识别\"]}\n\n\nclass HallucinationDetectionCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": '澳门新麻蒲烤肉店每天开门吗？',\n            \"context\": ('澳门美食： 澳门新麻蒲韩国烤肉店\\n'\n                        '在澳门一年四季之中除了火锅，烤肉也相当受欢迎。提到韩烧，有一间令我印象最深刻，就是号称韩国第一的烤肉店－新麻蒲韩国烤肉店，光是韩国的分店便多'\n                        '达四百多间，海外分店更是遍布世界各地，2016年便落户澳门筷子基区，在原本已经食肆林立的地方一起百花齐放！店内的装修跟韩国分店还完度几乎没差，让'\n                        '食客彷如置身于韩国的感觉，还要大赞其抽风系统不俗，离开时身上都不会沾上烤肉味耶！\\n'\n                        '时间：周一至周日 下午5:00 - 上午3:00\\n'\n                        '电话：＋853 2823 4012\\n'\n                        '地址：澳门筷子基船澳街海擎天第三座地下O号铺96号\\n'\n                        '必食推介:\\n'\n                        '护心肉二人套餐\\n'\n                        '来新麻蒲必试的有两样东西，现在差不多每间烤肉店都有炉边烤蛋，但大家知道吗？原来新麻蒲就是炉边烤蛋的开创者，既然是始祖，这已经是个非吃不可的理'\n                        '由！还有一款必试的就是护心肉，即是猪的横隔膜与肝中间的部分，每头猪也只有200克这种肉，非常珍贵，其味道吃起来有种独特的肉香味，跟牛护心肉一样'\n                        '精彩！\\n'\n                        '秘制猪皮\\n'\n                        '很多怕胖的女生看到猪皮就怕怕，但其实猪皮含有大量胶原蛋白，营养价值很高呢！这里红通通的猪皮还经过韩国秘制酱汁处理过，会有一点点辣味。烤猪皮的'\n                        '时候也需特别注意火侯，这样吃起来才会有外脆内Q的口感！'),\n            \"answer\": '澳门新麻蒲烤肉店并不是每天开门，周日休息。'\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"存在幻觉\"]}\n\n\nclass HandWriteOCRCase(Case):\n    def inputs(self):\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/test_handw\" \\\n                    \"rite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8\" \\\n                    \"m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2\" \\\n                    \"F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b\"\n        return {\n            \"file_names\": [\"text\"],\n            \"_sys_file_urls\": {\"text\": image_url}\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"银杏树\"]}\n\n\nclass MixCardOCRCase(Case):\n    def inputs(self):\n        image_url = (\"https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?\"\n                     \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06\"\n                     \"%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe\"\n                     \"1865e4393da5a3515e90d72d81ef18296bd29598\")\n        return {\n            \"file_names\": [\"test\"],\n            \"_sys_file_urls\": {\"test\": image_url}\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"北京市公安局\"]}\n\n\nclass TranslationCase(Case):\n    def inputs(self):\n        return {\n            \"q\": \"你好\",\n            \"to_lang\": \"en\",\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"hello\"]}\n\n\nclass GeneralOCRCase(Case):\n    def inputs(self):\n        return {\n            \"img_url\": \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\" \\\n                       \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                       \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\" \\\n                       \"857a27513734d765495f89ffa5f73\",\n            \"img_name\": \"test_img.jpg\"\n        }\n\n    def outputs(self):\n        return {\"text\": [\"识别结果\"]}\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass TableOCRCase(Case):\n    def inputs(self):\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\" \\\n                    \"064079145ff4698856f477b820147768fc2187d3\"\n        return {\n            \"file_names\": [image_url]\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"http\"]}\n\n\nclass Text2ImageCase(Case):\n    def inputs(self):\n        return {\n            'query': '生成一张小猫图片',\n        }\n\n    def schemas(self):\n        return [image_schema]\n\n\nclass StyleWritingCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"帮我写一篇关于足球的文案\",\n            \"style\": \"小红书\",\n            \"length\": 100,\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"足球\"]}\n\n\nclass TreeMindCase(Case):\n    def inputs(self):\n        return {\n            \"query\": \"生成一份年度总结的思维导图\"\n        }\n\n    def schemas(self):\n        return [text_schema, url_schema, image_schema]\n\n\nclass PlantRecognitionCase(Case):\n    def inputs(self):\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                  \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                  \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                  \"62cf937c03f8c5260d51c6ae\"\n        img_name = \"test_img.jpg\"\n        return {\n            \"img_url\": img_url,\n            \"img_name\": img_name\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"非植物\"]}\n\n\nclass ASRCase(Case):\n    def inputs(self):\n        audio_file_url = \"https://bj.bcebos.com/v1/appbuilder/asr_test.pcm?authorization=bce-auth-v1\" \\\n                         \"%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A56%3A41Z%2F-1%2Fhost\" \\\n                         \"%2Fa6c4d2ca8a3f0259f4cae8ae3fa98a9f75afde1a063eaec04847c99ab7d1e411\"\n\n        return {\n            \"file_url\": audio_file_url\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"北京科技馆\"]}\n\n\nclass ObjectRecognitionCase(Case):\n    def inputs(self):\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?\" \\\n                  \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                  \"11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc\" \\\n                  \"1ba1de0a8f072bc5a87102bd32f9e3\"\n        return {\n            \"img_url\": img_url\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"苹果\"]}\n\n\nclass SimilarQuestionCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"冰淇淋\"]}\n\n\nclass OralQueryGenerationCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        text = ('文档标题：在OPPO Reno5上使用视频超级防抖\\n'\n                '文档摘要：OPPO Reno5上的视频超级防抖，视频超级防抖3.0，多代视频防抖算法积累，这一代依旧超级防抖超级稳。 开启视频超级'\n                '防抖 开启路径：打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能，开启超级'\n                '防抖后手机屏幕将出现超级防抖Pro开关，点击即可开启或关闭。 除此之外，前置视频同样加持防抖算法，边走边拍也能稳定聚焦脸部'\n                '，实时视频分享您的生活。')\n        return {\n            \"text\": text\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"OPPO\"]}\n\n\nclass QueryRewriteCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\",\n            \"rewrite_type\": \"带机器人回复\"\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"冰淇淋\"]}\n\n\nclass Nl2pandasComponentCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"给我一份2020年到2022年每年的销售额\",\n            \"table_info\": '''表格列信息如下：\n                学校名 : 清华附小 , 字符串类型，代表小学学校的名称\n                所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\n                创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\n                类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\n                学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\n                教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\n                教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量\n                '''\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass DialogSummaryCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"请给我总结一下这段对话\",\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass MRCCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"残疾人怎么办相关证件\",\n            \"context_list\": [\n                \"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n                1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n                2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n                听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\nC5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"\n            ]\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass IsComplexQueryCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\",\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n    def outputs(self):\n        return {\"text\": [\"复杂问题\"]}\n\n\nclass QAPairMiningCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"2017年，工商银行根据外部宏观环境变化...\",\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass QueryDecompositionCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\",\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n\nclass TagExtractionCase(Case):\n    def init_args(self):\n        return {\"model\": \"DeepSeek-V3.1\"}\n\n    def inputs(self):\n        return {\n            \"query\": \"本实用新型公开了一种可利用热能的太阳能光伏光热一体化组件，包括太阳能电池，还包括有吸热板，太阳能电池粘附在吸热板顶面，吸热板内嵌入有热电材料制成的内芯，吸热板底面设置有蛇形管。本实用新型结构紧凑，安装方便，能充分利用太阳能电池散发的热能，具有较高的热能利用率。\",\n        }\n\n    def schemas(self):\n        return [text_schema]\n\n\ncomponent_tool_eval_cases = {\n    \"AnimalRecognition\": AnimalRecognitionCase,\n    \"ImageUnderstand\": ImageUnderstandCase,\n    \"ASR\": ASRCase,\n    \"TreeMind\": TreeMindCase,\n    \"StyleRewrite\": StyleRewriteCase,\n    \"HallucinationDetection\": HallucinationDetectionCase,\n    \"QRcodeOCR\": QRcodeOCRCase,\n    \"HandwriteOCR\": HandWriteOCRCase,\n    \"MixCardOCR\": MixCardOCRCase,\n    \"Translation\": TranslationCase,\n    \"GeneralOCR\": GeneralOCRCase,\n    \"TableOCR\": TableOCRCase,\n    \"Text2Image\": Text2ImageCase,\n    \"StyleWriting\": StyleWritingCase,\n    \"TreeMind\": TreeMindCase,\n    \"PlantRecognition\": PlantRecognitionCase,\n    \"ASR\": ASRCase,\n    \"ObjectRecognition\": ObjectRecognitionCase,\n    \"SimilarQuestion\": SimilarQuestionCase,\n    \"OralQueryGeneration\": OralQueryGenerationCase,\n    \"QueryRewrite\": QueryRewriteCase,\n    \"Nl2pandasComponent\": Nl2pandasComponentCase,\n    \"DialogSummary\": DialogSummaryCase,\n    \"MRC\": MRCCase,\n    \"IsComplexQuery\": IsComplexQueryCase,\n    \"QAPairMining\": QAPairMiningCase,\n    \"QueryDecomposition\": QueryDecompositionCase,\n    \"TagExtraction\": TagExtractionCase,\n}"
  },
  {
    "path": "python/tests/data/ghes-3.0.json",
    "content": "{\n  \"openapi\": \"3.1.0\",\n  \"info\": {\n    \"version\": \"1.1.4\",\n    \"title\": \"GitHub v3 REST API\",\n    \"description\": \"GitHub's v3 REST API.\",\n    \"license\": {\n      \"name\": \"MIT\",\n      \"url\": \"https://spdx.org/licenses/MIT\"\n    },\n    \"termsOfService\": \"https://docs.github.com/articles/github-terms-of-service\",\n    \"contact\": {\n      \"name\": \"Support\",\n      \"url\": \"https://support.github.com/contact?tags=dotcom-rest-api\"\n    }\n  },\n  \"tags\": [\n    {\n      \"name\": \"actions\",\n      \"description\": \"Endpoints to manage GitHub Actions using the REST API.\"\n    },\n    {\n      \"name\": \"activity\",\n      \"description\": \"Activity APIs provide access to notifications, subscriptions, and timelines.\"\n    },\n    {\n      \"name\": \"apps\",\n      \"description\": \"Information for integrations and installations.\"\n    },\n    {\n      \"name\": \"billing\",\n      \"description\": \"Monitor charges and usage from Actions and Packages.\"\n    },\n    {\n      \"name\": \"checks\",\n      \"description\": \"Rich interactions with checks run by your integrations.\"\n    },\n    {\n      \"name\": \"code-scanning\",\n      \"description\": \"Retrieve code scanning alerts from a repository.\"\n    },\n    {\n      \"name\": \"codes-of-conduct\",\n      \"description\": \"Insight into codes of conduct for your communities.\"\n    },\n    {\n      \"name\": \"codespaces\",\n      \"description\": \"Endpoints to manage Codespaces using the REST API.\"\n    },\n    {\n      \"name\": \"emojis\",\n      \"description\": \"List emojis available to use on GitHub.\"\n    },\n    {\n      \"name\": \"enterprise-admin\",\n      \"description\": \"Administer a GitHub enterprise.\"\n    },\n    {\n      \"name\": \"dependabot\",\n      \"description\": \"Endpoints to manage Dependabot.\"\n    },\n    {\n      \"name\": \"gists\",\n      \"description\": \"View, modify your gists.\"\n    },\n    {\n      \"name\": \"git\",\n      \"description\": \"Raw Git functionality.\"\n    },\n    {\n      \"name\": \"gitignore\",\n      \"description\": \"View gitignore templates\"\n    },\n    {\n      \"name\": \"interactions\",\n      \"description\": \"Owner or admin management of users interactions.\"\n    },\n    {\n      \"name\": \"issues\",\n      \"description\": \"Interact with GitHub Issues.\"\n    },\n    {\n      \"name\": \"licenses\",\n      \"description\": \"View various OSS licenses.\"\n    },\n    {\n      \"name\": \"markdown\",\n      \"description\": \"Render GitHub flavored markdown\"\n    },\n    {\n      \"name\": \"meta\",\n      \"description\": \"Endpoints that give information about the API.\"\n    },\n    {\n      \"name\": \"migrations\",\n      \"description\": \"Move projects to or from GitHub.\"\n    },\n    {\n      \"name\": \"oauth-authorizations\",\n      \"description\": \"Manage access of OAuth applications\"\n    },\n    {\n      \"name\": \"orgs\",\n      \"description\": \"Interact with GitHub Orgs.\"\n    },\n    {\n      \"name\": \"packages\",\n      \"description\": \"Manage packages for authenticated users and organizations.\"\n    },\n    {\n      \"name\": \"projects\",\n      \"description\": \"Interact with GitHub Projects.\"\n    },\n    {\n      \"name\": \"pulls\",\n      \"description\": \"Interact with GitHub Pull Requests.\"\n    },\n    {\n      \"name\": \"rate-limit\",\n      \"description\": \"Check your current rate limit status\"\n    },\n    {\n      \"name\": \"reactions\",\n      \"description\": \"Interact with reactions to various GitHub entities.\"\n    },\n    {\n      \"name\": \"repos\",\n      \"description\": \"Interact with GitHub Repos.\"\n    },\n    {\n      \"name\": \"scim\",\n      \"description\": \"Provisioning of GitHub organization membership for SCIM-enabled providers.\"\n    },\n    {\n      \"name\": \"search\",\n      \"description\": \"Look for stuff on GitHub.\"\n    },\n    {\n      \"name\": \"secret-scanning\",\n      \"description\": \"Retrieve secret scanning alerts from a repository.\"\n    },\n    {\n      \"name\": \"server-statistics\",\n      \"description\": \"GHES statistics\"\n    },\n    {\n      \"name\": \"teams\",\n      \"description\": \"Interact with GitHub Teams.\"\n    },\n    {\n      \"name\": \"users\",\n      \"description\": \"Interact with and view information about users and also current user.\"\n    }\n  ],\n  \"servers\": [\n    {\n      \"url\": \"{protocol}://{hostname}/api/v3\",\n      \"variables\": {\n        \"hostname\": {\n          \"description\": \"Self-hosted Enterprise Server or Enterprise Cloud hostname\",\n          \"default\": \"HOSTNAME\"\n        },\n        \"protocol\": {\n          \"description\": \"Self-hosted Enterprise Server or Enterprise Cloud protocol\",\n          \"default\": \"http\"\n        }\n      }\n    }\n  ],\n  \"externalDocs\": {\n    \"description\": \"GitHub Enterprise Developer Docs\",\n    \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/\"\n  },\n  \"paths\": {\n    \"/\": {\n      \"get\": {\n        \"summary\": \"GitHub API Root\",\n        \"description\": \"Get Hypermedia links to resources accessible in GitHub's REST API\",\n        \"tags\": [\n          \"meta\"\n        ],\n        \"operationId\": \"meta/root\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"current_user_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"current_user_authorizations_html_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"authorizations_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"code_search_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"commit_search_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"emails_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"emojis_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"events_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"feeds_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"followers_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"following_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"gists_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"hub_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"issue_search_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"issues_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"keys_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"label_search_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"notifications_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"organization_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"organization_repositories_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"organization_teams_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"public_gists_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"rate_limit_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"repository_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"repository_search_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"current_user_repositories_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"starred_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"starred_gists_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"topic_search_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"user_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"user_organizations_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"user_repositories_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    },\n                    \"user_search_url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri-template\"\n                    }\n                  },\n                  \"required\": [\n                    \"current_user_url\",\n                    \"current_user_authorizations_html_url\",\n                    \"authorizations_url\",\n                    \"code_search_url\",\n                    \"commit_search_url\",\n                    \"emails_url\",\n                    \"emojis_url\",\n                    \"events_url\",\n                    \"feeds_url\",\n                    \"followers_url\",\n                    \"following_url\",\n                    \"gists_url\",\n                    \"hub_url\",\n                    \"issue_search_url\",\n                    \"issues_url\",\n                    \"keys_url\",\n                    \"label_search_url\",\n                    \"notifications_url\",\n                    \"organization_url\",\n                    \"organization_repositories_url\",\n                    \"organization_teams_url\",\n                    \"public_gists_url\",\n                    \"rate_limit_url\",\n                    \"repository_url\",\n                    \"repository_search_url\",\n                    \"current_user_repositories_url\",\n                    \"starred_url\",\n                    \"starred_gists_url\",\n                    \"user_url\",\n                    \"user_organizations_url\",\n                    \"user_repositories_url\",\n                    \"user_search_url\"\n                  ]\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"meta\"\n        },\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#root-endpoint\"\n        }\n      }\n    },\n    \"/admin/hooks\": {\n      \"get\": {\n        \"summary\": \"List global webhooks\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/list-global-webhooks\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-global-webhooks\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"accept\",\n            \"description\": \"This API is under preview and subject to change.\",\n            \"in\": \"header\",\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"application/vnd.github.superpro-preview+json\"\n            },\n            \"required\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/global-hook\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/global-hook-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"global-webhooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"superpro\",\n              \"note\": \"The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.superpro-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a global webhook\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/create-global-webhook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-global-webhook\"\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/global-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/global-hook\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"Must be passed as \\\"web\\\".\"\n                  },\n                  \"config\": {\n                    \"type\": \"object\",\n                    \"description\": \"Key/value pairs to provide settings for this webhook.\",\n                    \"properties\": {\n                      \"url\": {\n                        \"type\": \"string\",\n                        \"description\": \"The URL to which the payloads will be delivered.\"\n                      },\n                      \"content_type\": {\n                        \"type\": \"string\",\n                        \"description\": \"The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.\"\n                      },\n                      \"secret\": {\n                        \"type\": \"string\",\n                        \"description\": \"If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#delivery-headers) header.\"\n                      },\n                      \"insecure_ssl\": {\n                        \"type\": \"string\",\n                        \"description\": \"Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.**\"\n                      }\n                    },\n                    \"required\": [\n                      \"url\"\n                    ]\n                  },\n                  \"events\": {\n                    \"type\": \"array\",\n                    \"description\": \"The [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"active\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.\",\n                    \"default\": true\n                  }\n                },\n                \"required\": [\n                  \"name\",\n                  \"config\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"web\",\n                \"events\": [\n                  \"organization\",\n                  \"user\"\n                ],\n                \"config\": {\n                  \"url\": \"https://example.com/webhook\",\n                  \"content_type\": \"json\",\n                  \"secret\": \"secret\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"global-webhooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"superpro\",\n              \"note\": \"The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.superpro-preview+json\\n```\"\n            }\n          ]\n        },\n        \"parameters\": [\n          {\n            \"name\": \"accept\",\n            \"description\": \"This API is under preview and subject to change.\",\n            \"in\": \"header\",\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"application/vnd.github.superpro-preview+json\"\n            },\n            \"required\": true\n          }\n        ]\n      }\n    },\n    \"/admin/hooks/{hook_id}\": {\n      \"get\": {\n        \"summary\": \"Get a global webhook\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-global-webhook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-global-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"accept\",\n            \"description\": \"This API is under preview and subject to change.\",\n            \"in\": \"header\",\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"application/vnd.github.superpro-preview+json\"\n            },\n            \"required\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/global-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/global-hook\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"global-webhooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"superpro\",\n              \"note\": \"The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.superpro-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a global webhook\",\n        \"description\": \"Parameters that are not provided will be overwritten with the default value or removed if no default exists.\",\n        \"operationId\": \"enterprise-admin/update-global-webhook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-a-global-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"accept\",\n            \"description\": \"This API is under preview and subject to change.\",\n            \"in\": \"header\",\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"application/vnd.github.superpro-preview+json\"\n            },\n            \"required\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/global-hook-2\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/global-hook-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"config\": {\n                    \"type\": \"object\",\n                    \"description\": \"Key/value pairs to provide settings for this webhook.\",\n                    \"properties\": {\n                      \"url\": {\n                        \"type\": \"string\",\n                        \"description\": \"The URL to which the payloads will be delivered.\"\n                      },\n                      \"content_type\": {\n                        \"type\": \"string\",\n                        \"description\": \"The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.\"\n                      },\n                      \"secret\": {\n                        \"type\": \"string\",\n                        \"description\": \"If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#delivery-headers) header.\"\n                      },\n                      \"insecure_ssl\": {\n                        \"type\": \"string\",\n                        \"description\": \"Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.**\"\n                      }\n                    },\n                    \"required\": [\n                      \"url\"\n                    ]\n                  },\n                  \"events\": {\n                    \"type\": \"array\",\n                    \"description\": \"The [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"active\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.\",\n                    \"default\": true\n                  }\n                }\n              },\n              \"example\": {\n                \"events\": [\n                  \"organization\"\n                ],\n                \"config\": {\n                  \"url\": \"https://example.com/webhook\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"global-webhooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"superpro\",\n              \"note\": \"The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.superpro-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a global webhook\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/delete-global-webhook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-global-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"accept\",\n            \"description\": \"This API is under preview and subject to change.\",\n            \"in\": \"header\",\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"application/vnd.github.superpro-preview+json\"\n            },\n            \"required\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"global-webhooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"superpro\",\n              \"note\": \"The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.superpro-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/hooks/{hook_id}/pings\": {\n      \"post\": {\n        \"summary\": \"Ping a global webhook\",\n        \"description\": \"This will trigger a [ping event](https://docs.github.com/enterprise-server@3.0/webhooks/#ping-event) to be sent to the webhook.\",\n        \"operationId\": \"enterprise-admin/ping-global-webhook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#ping-a-global-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"accept\",\n            \"description\": \"This API is under preview and subject to change.\",\n            \"in\": \"header\",\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"application/vnd.github.superpro-preview+json\"\n            },\n            \"required\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"global-webhooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"superpro\",\n              \"note\": \"The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.superpro-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/keys\": {\n      \"get\": {\n        \"summary\": \"List public keys\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/list-public-keys\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-public-keys\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"name\": \"sort\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"accessed\"\n              ],\n              \"default\": \"created\"\n            }\n          },\n          {\n            \"name\": \"since\",\n            \"description\": \"Only show public keys accessed after the given time.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/public-key-full\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/enterprise-public-key-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/admin/keys/{key_ids}\": {\n      \"delete\": {\n        \"summary\": \"Delete a public key\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/delete-public-key\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-public-key\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/key-ids\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/admin/ldap/teams/{team_id}/mapping\": {\n      \"patch\": {\n        \"summary\": \"Update LDAP mapping for a team\",\n        \"description\": \"Updates the [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. [LDAP synchronization](https://docs.github.com/enterprise/admin/guides/user-management/using-ldap/#enabling-ldap-sync) must be enabled to map LDAP entries to a team. Use the [Create a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#create-a-team) endpoint to create a team with LDAP mapping.\\n\\nIf you pass the `hellcat-preview` media type, you can also update the LDAP mapping of a child team.\",\n        \"operationId\": \"enterprise-admin/update-ldap-mapping-for-team\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-ldap-mapping-for-a-team\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/ldap-mapping-team\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/ldap-mapping-team\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"ldap_dn\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team.\"\n                  }\n                },\n                \"required\": [\n                  \"ldap_dn\"\n                ]\n              },\n              \"example\": {\n                \"ldap_dn\": \"cn=Enterprise Ops,ou=teams,dc=github,dc=com\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"ldap\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"hellcat\",\n              \"note\": \"The Nested Teams API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2017-08-30-preview-nested-teams) for full details. To access the API, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.hellcat-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/ldap/teams/{team_id}/sync\": {\n      \"post\": {\n        \"summary\": \"Sync LDAP mapping for a team\",\n        \"description\": \"Note that this API call does not automatically initiate an LDAP sync. Rather, if a `201` is returned, the sync job is queued successfully, and is performed when the instance is ready.\",\n        \"operationId\": \"enterprise-admin/sync-ldap-mapping-for-team\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#sync-ldap-mapping-for-a-team\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"status\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"example\": {\n                  \"status\": \"queued\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"ldap\"\n        }\n      }\n    },\n    \"/admin/ldap/users/{username}/mapping\": {\n      \"patch\": {\n        \"summary\": \"Update LDAP mapping for a user\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/update-ldap-mapping-for-user\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-ldap-mapping-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/ldap-mapping-user\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/ldap-mapping-user\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"ldap_dn\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team.\"\n                  }\n                },\n                \"required\": [\n                  \"ldap_dn\"\n                ]\n              },\n              \"example\": {\n                \"ldap_dn\": \"uid=asdf,ou=users,dc=github,dc=com\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"ldap\"\n        }\n      }\n    },\n    \"/admin/ldap/users/{username}/sync\": {\n      \"post\": {\n        \"summary\": \"Sync LDAP mapping for a user\",\n        \"description\": \"Note that this API call does not automatically initiate an LDAP sync. Rather, if a `201` is returned, the sync job is queued successfully, and is performed when the instance is ready.\",\n        \"operationId\": \"enterprise-admin/sync-ldap-mapping-for-user\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#sync-ldap-mapping-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"status\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"example\": {\n                  \"status\": \"queued\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"ldap\"\n        }\n      }\n    },\n    \"/admin/organizations\": {\n      \"post\": {\n        \"summary\": \"Create an organization\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/create-org\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-an-organization\"\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/organization-simple\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-simple\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"login\": {\n                    \"type\": \"string\",\n                    \"description\": \"The organization's username.\"\n                  },\n                  \"admin\": {\n                    \"type\": \"string\",\n                    \"description\": \"The login of the user who will manage this organization.\"\n                  },\n                  \"profile_name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The organization's display name.\"\n                  }\n                },\n                \"required\": [\n                  \"login\",\n                  \"admin\"\n                ]\n              },\n              \"example\": {\n                \"login\": \"github\",\n                \"profile_name\": \"GitHub, Inc.\",\n                \"admin\": \"monalisaoctocat\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"orgs\"\n        }\n      }\n    },\n    \"/admin/organizations/{org}\": {\n      \"patch\": {\n        \"summary\": \"Update an organization name\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/update-org-name\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-an-organization-name\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"example\": {\n                  \"message\": \"Job queued to rename organization. It may take a few minutes to complete.\",\n                  \"url\": \"https://<hostname>/api/v3/organizations/1\"\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"login\": {\n                    \"type\": \"string\",\n                    \"description\": \"The organization's new name.\"\n                  }\n                },\n                \"required\": [\n                  \"login\"\n                ]\n              },\n              \"example\": {\n                \"login\": \"the-new-octocats\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"orgs\"\n        }\n      }\n    },\n    \"/admin/pre-receive-environments\": {\n      \"get\": {\n        \"summary\": \"List pre-receive environments\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/list-pre-receive-environments\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-pre-receive-environments\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"name\": \"sort\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"name\"\n              ],\n              \"default\": \"created\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/pre-receive-environment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pre-receive-environment-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-environments\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a pre-receive environment\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/create-pre-receive-environment\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-pre-receive-environment\"\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pre-receive-environment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pre-receive-environment\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The new pre-receive environment's name.\"\n                  },\n                  \"image_url\": {\n                    \"type\": \"string\",\n                    \"description\": \"URL from which to download a tarball of this environment.\"\n                  }\n                },\n                \"required\": [\n                  \"name\",\n                  \"image_url\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"DevTools Hook Env\",\n                \"image_url\": \"https://my_file_server/path/to/devtools_env.tar.gz\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-environments\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/pre-receive-environments/{pre_receive_environment_id}\": {\n      \"get\": {\n        \"summary\": \"Get a pre-receive environment\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-pre-receive-environment\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-pre-receive-environment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pre-receive-environment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pre-receive-environment\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-environments\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a pre-receive environment\",\n        \"description\": \"You cannot modify the default environment. If you attempt to modify the default environment, you will receive a `422 Unprocessable Entity` response.\",\n        \"operationId\": \"enterprise-admin/update-pre-receive-environment\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-a-pre-receive-environment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pre-receive-environment\"\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/pre-receive-environment-default-response\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"description\": \"Client Errors\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                          \"resource\": {\n                            \"type\": \"string\"\n                          },\n                          \"code\": {\n                            \"type\": \"string\"\n                          },\n                          \"message\": {\n                            \"type\": \"string\"\n                          }\n                        }\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"client-errors\": {\n                    \"value\": {\n                      \"message\": \"Validation Failed\",\n                      \"errors\": [\n                        {\n                          \"resource\": \"PreReceiveEnvironment\",\n                          \"code\": \"custom\",\n                          \"message\": \"Cannot modify or delete the default environment\"\n                        }\n                      ]\n                    }\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"This pre-receive environment's new name.\"\n                  },\n                  \"image_url\": {\n                    \"type\": \"string\",\n                    \"description\": \"URL from which to download a tarball of this environment.\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-environments\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a pre-receive environment\",\n        \"description\": \"If you attempt to delete an environment that cannot be deleted, you will receive a `422 Unprocessable Entity` response.\\n\\nThe possible error messages are:\\n\\n*   _Cannot modify or delete the default environment_\\n*   _Cannot delete environment that has hooks_\\n*   _Cannot delete environment when download is in progress_\",\n        \"operationId\": \"enterprise-admin/delete-pre-receive-environment\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-pre-receive-environment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"422\": {\n            \"description\": \"Client Errors\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                          \"resource\": {\n                            \"type\": \"string\"\n                          },\n                          \"code\": {\n                            \"type\": \"string\"\n                          },\n                          \"message\": {\n                            \"type\": \"string\"\n                          }\n                        }\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"client-errors\": {\n                    \"value\": {\n                      \"message\": \"Validation Failed\",\n                      \"errors\": [\n                        {\n                          \"resource\": \"PreReceiveEnvironment\",\n                          \"code\": \"custom\",\n                          \"message\": \"Cannot modify or delete the default environment\"\n                        }\n                      ]\n                    }\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-environments\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/pre-receive-environments/{pre_receive_environment_id}/downloads\": {\n      \"post\": {\n        \"summary\": \"Start a pre-receive environment download\",\n        \"description\": \"Triggers a new download of the environment tarball from the environment's `image_url`. When the download is finished, the newly downloaded tarball will overwrite the existing environment.\\n\\nIf a download cannot be triggered, you will receive a `422 Unprocessable Entity` response.\\n\\nThe possible error messages are:\\n\\n* _Cannot modify or delete the default environment_\\n* _Can not start a new download when a download is in progress_\",\n        \"operationId\": \"enterprise-admin/start-pre-receive-environment-download\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#start-a-pre-receive-environment-download\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n          }\n        ],\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pre-receive-environment-download-status\"\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/pre-receive-environment-download-status-default-response\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"description\": \"Client Errors\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                          \"resource\": {\n                            \"type\": \"string\"\n                          },\n                          \"code\": {\n                            \"type\": \"string\"\n                          },\n                          \"message\": {\n                            \"type\": \"string\"\n                          }\n                        }\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"client-errors\": {\n                    \"value\": {\n                      \"message\": \"Validation Failed\",\n                      \"errors\": [\n                        {\n                          \"resource\": \"PreReceiveEnvironment\",\n                          \"code\": \"custom\",\n                          \"message\": \"Can not start a new download when a download is in progress\"\n                        }\n                      ]\n                    }\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-environments\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest\": {\n      \"get\": {\n        \"summary\": \"Get the download status for a pre-receive environment\",\n        \"description\": \"In addition to seeing the download status at the \\\"[Get a pre-receive environment](#get-a-pre-receive-environment)\\\" endpoint, there is also this separate endpoint for just the download status.\",\n        \"operationId\": \"enterprise-admin/get-download-status-for-pre-receive-environment\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-the-download-status-for-a-pre-receive-environment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pre-receive-environment-download-status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pre-receive-environment-download-status\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-environments\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/pre-receive-hooks\": {\n      \"get\": {\n        \"summary\": \"List pre-receive hooks\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/list-pre-receive-hooks\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-pre-receive-hooks\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"One of `created` (when the repository was starred) or `updated` (when it was last pushed to) or `name`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"name\"\n              ],\n              \"default\": \"created\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/pre-receive-hook\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pre-receive-hook-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a pre-receive hook\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/create-pre-receive-hook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-pre-receive-hook\"\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pre-receive-hook\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the hook.\"\n                  },\n                  \"script\": {\n                    \"type\": \"string\",\n                    \"description\": \"The script that the hook runs.\"\n                  },\n                  \"script_repository\": {\n                    \"type\": \"object\",\n                    \"description\": \"The GitHub repository where the script is kept.\",\n                    \"properties\": {\n                    },\n                    \"additionalProperties\": true\n                  },\n                  \"environment\": {\n                    \"type\": \"object\",\n                    \"description\": \"The pre-receive environment where the script is executed.\",\n                    \"properties\": {\n                    },\n                    \"additionalProperties\": true\n                  },\n                  \"enforcement\": {\n                    \"type\": \"string\",\n                    \"description\": \"The state of enforcement for this hook. default: `disabled`\"\n                  },\n                  \"allow_downstream_configuration\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Whether enforcement can be overridden at the org or repo level. default: `false`\"\n                  }\n                },\n                \"required\": [\n                  \"name\",\n                  \"script\",\n                  \"script_repository\",\n                  \"environment\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"Check Commits\",\n                \"script\": \"scripts/commit_check.sh\",\n                \"enforcement\": \"disabled\",\n                \"allow_downstream_configuration\": false,\n                \"script_repository\": {\n                  \"full_name\": \"DevIT/hooks\"\n                },\n                \"environment\": {\n                  \"id\": 2\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/pre-receive-hooks/{pre_receive_hook_id}\": {\n      \"get\": {\n        \"summary\": \"Get a pre-receive hook\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-pre-receive-hook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-pre-receive-hook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pre-receive-hook\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a pre-receive hook\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/update-pre-receive-hook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-a-pre-receive-hook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pre-receive-hook-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the hook.\"\n                  },\n                  \"script\": {\n                    \"type\": \"string\",\n                    \"description\": \"The script that the hook runs.\"\n                  },\n                  \"script_repository\": {\n                    \"type\": \"object\",\n                    \"description\": \"The GitHub repository where the script is kept.\",\n                    \"properties\": {\n                    },\n                    \"additionalProperties\": true\n                  },\n                  \"environment\": {\n                    \"type\": \"object\",\n                    \"description\": \"The pre-receive environment where the script is executed.\",\n                    \"properties\": {\n                    },\n                    \"additionalProperties\": true\n                  },\n                  \"enforcement\": {\n                    \"type\": \"string\",\n                    \"description\": \"The state of enforcement for this hook.\"\n                  },\n                  \"allow_downstream_configuration\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Whether enforcement can be overridden at the org or repo level.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"name\": \"Check Commits\",\n                \"environment\": {\n                  \"id\": 1\n                },\n                \"allow_downstream_configuration\": true\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a pre-receive hook\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/delete-pre-receive-hook\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-pre-receive-hook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/admin/tokens\": {\n      \"get\": {\n        \"summary\": \"List personal access tokens\",\n        \"description\": \"Lists personal access tokens for all users, including admin users.\",\n        \"operationId\": \"enterprise-admin/list-personal-access-tokens\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-personal-access-tokens\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/authorization\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/admin/tokens/{token_id}\": {\n      \"delete\": {\n        \"summary\": \"Delete a personal access token\",\n        \"description\": \"Deletes a personal access token. Returns a `403 - Forbidden` status when a personal access token is in use. For example, if you access this endpoint with the same personal access token that you are trying to delete, you will receive this error.\",\n        \"operationId\": \"enterprise-admin/delete-personal-access-token\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-personal-access-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/token-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/admin/users\": {\n      \"post\": {\n        \"summary\": \"Create a user\",\n        \"description\": \"If an external authentication mechanism is used, the login name should match the login name in the external system. If you are using LDAP authentication, you should also [update the LDAP mapping](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-ldap-mapping-for-a-user) for the user.\\n\\nThe login name will be normalized to only contain alphanumeric characters or single hyphens. For example, if you send `\\\"octo_cat\\\"` as the login, a user named `\\\"octo-cat\\\"` will be created.\\n\\nIf the login name or email address is already associated with an account, the server will return a `422` response.\",\n        \"operationId\": \"enterprise-admin/create-user\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-user\"\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/simple-user\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"login\": {\n                    \"type\": \"string\",\n                    \"description\": \"The user's username.\"\n                  },\n                  \"email\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Required for built-in authentication.** The user's email address. This parameter can be omitted when using CAS, LDAP, or SAML. For details on built-in and centrally-managed authentication, see the the [GitHub authentication guide](https://docs.github.com/enterprise/2.18/admin/guides/user-management/authenticating-users-for-your-github-enterprise-server-instance/).\"\n                  }\n                },\n                \"required\": [\n                  \"login\"\n                ]\n              },\n              \"example\": {\n                \"login\": \"monalisa\",\n                \"email\": \"octocat@github.com\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/admin/users/{username}\": {\n      \"patch\": {\n        \"summary\": \"Update the username for a user\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/update-username-for-user\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-the-username-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"example\": {\n                  \"message\": \"Job queued to rename user. It may take a few minutes to complete.\",\n                  \"url\": \"https://api.github.com/user/1\"\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"login\": {\n                    \"type\": \"string\",\n                    \"description\": \"The user's new username.\"\n                  }\n                },\n                \"required\": [\n                  \"login\"\n                ]\n              },\n              \"example\": {\n                \"login\": \"thenewmonalisa\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a user\",\n        \"description\": \"Deleting a user will delete all their repositories, gists, applications, and personal settings. [Suspending a user](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#suspend-a-user) is often a better option.\\n\\nYou can delete any user account except your own.\",\n        \"operationId\": \"enterprise-admin/delete-user\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/admin/users/{username}/authorizations\": {\n      \"post\": {\n        \"summary\": \"Create an impersonation OAuth token\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/create-impersonation-o-auth-token\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-an-impersonation-oauth-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"scopes\": {\n                    \"type\": \"array\",\n                    \"description\": \"A list of [scopes](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete an impersonation OAuth token\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/delete-impersonation-o-auth-token\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-an-impersonation-oauth-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/app\": {\n      \"get\": {\n        \"summary\": \"Get the authenticated app\",\n        \"description\": \"Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the \\\"[List installations for the authenticated app](https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-installations-for-the-authenticated-app)\\\" endpoint.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/get-authenticated\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-the-authenticated-app\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/integration\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/integration\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/app-manifests/{code}/conversions\": {\n      \"post\": {\n        \"summary\": \"Create a GitHub App from a manifest\",\n        \"description\": \"Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/create-from-manifest\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-github-app-from-a-manifest\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"code\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"additionalProperties\": false\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"allOf\": [\n                    {\n                      \"$ref\": \"#/components/schemas/integration\"\n                    },\n                    {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"client_id\": {\n                          \"type\": \"string\"\n                        },\n                        \"client_secret\": {\n                          \"type\": \"string\"\n                        },\n                        \"webhook_secret\": {\n                          \"type\": [\n                            \"string\",\n                            \"null\"\n                          ]\n                        },\n                        \"pem\": {\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"required\": [\n                        \"client_id\",\n                        \"client_secret\",\n                        \"webhook_secret\",\n                        \"pem\"\n                      ],\n                      \"additionalProperties\": true\n                    }\n                  ]\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/integration-from-manifest\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/app/hook/config\": {\n      \"get\": {\n        \"summary\": \"Get a webhook configuration for an app\",\n        \"description\": \"Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \\\"[Creating a GitHub App](/developers/apps/creating-a-github-app).\\\"\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/get-webhook-config-for-app\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-a-webhook-configuration-for-an-app\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/webhook-config\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/webhook-config\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a webhook configuration for an app\",\n        \"description\": \"Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \\\"[Creating a GitHub App](/developers/apps/creating-a-github-app).\\\"\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/update-webhook-config-for-app\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#update-a-webhook-configuration-for-an-app\"\n        },\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"url\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-url\"\n                  },\n                  \"content_type\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                  },\n                  \"secret\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                  },\n                  \"insecure_ssl\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                  }\n                },\n                \"example\": {\n                  \"content_type\": \"json\",\n                  \"insecure_ssl\": \"0\",\n                  \"secret\": \"********\",\n                  \"url\": \"https://example.com/webhook\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/webhook-config\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/webhook-config\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/app/installations\": {\n      \"get\": {\n        \"summary\": \"List installations for the authenticated app\",\n        \"description\": \"You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\\n\\nThe permissions the installation has are included under the `permissions` key.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/list-installations\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-installations-for-the-authenticated-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"name\": \"outdated\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The permissions the installation has are included under the `permissions` key.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/installation\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/base-installation-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/app/installations/{installation_id}\": {\n      \"get\": {\n        \"summary\": \"Get an installation for the authenticated app\",\n        \"description\": \"Enables an authenticated GitHub App to find an installation's information using the installation id.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/get-installation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-an-installation-for-the-authenticated-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/installation-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/installation\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/base-installation\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete an installation for the authenticated app\",\n        \"description\": \"Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the \\\"[Suspend an app installation](https://docs.github.com/enterprise-server@3.0/rest/reference/apps/#suspend-an-app-installation)\\\" endpoint.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/delete-installation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#delete-an-installation-for-the-authenticated-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/installation-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/app/installations/{installation_id}/access_tokens\": {\n      \"post\": {\n        \"summary\": \"Create an installation access token for an app\",\n        \"description\": \"Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/create-installation-access-token\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps/#create-an-installation-access-token-for-an-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/installation-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"repositories\": {\n                    \"description\": \"List of repository names that the token should have access to\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"rails\"\n                      ]\n                    }\n                  },\n                  \"repository_ids\": {\n                    \"description\": \"List of repository IDs that the token should have access to\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\"\n                    },\n                    \"examples\": [\n                      1\n                    ]\n                  },\n                  \"permissions\": {\n                    \"$ref\": \"#/components/schemas/app-permissions\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/installation-token\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/installation-token\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/app/installations/{installation_id}/suspended\": {\n      \"put\": {\n        \"summary\": \"Suspend an app installation\",\n        \"description\": \"Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub Enterprise Server API or webhook events is blocked for that account.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/suspend-installation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#suspend-an-app-installation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/installation-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Unsuspend an app installation\",\n        \"description\": \"Removes a GitHub App installation suspension.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/unsuspend-installation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#unsuspend-an-app-installation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/installation-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/applications/grants\": {\n      \"get\": {\n        \"summary\": \"List your grants\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\\n\\nYou can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `[\\\"repo\\\", \\\"user\\\"]`.\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/list-grants\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#list-your-grants\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"name\": \"client_id\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"description\": \"The client ID of your GitHub app.\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/application-grant\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/application-grant-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/applications/grants/{grant_id}\": {\n      \"get\": {\n        \"summary\": \"Get a single grant\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/get-grant\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#get-a-single-grant\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/grant-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/application-grant\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/application-grant\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Delete a grant\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\\n\\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/delete-grant\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#delete-a-grant\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/grant-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/applications/{client_id}/grant\": {\n      \"delete\": {\n        \"summary\": \"Delete an app authorization\",\n        \"description\": \"OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.\\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).\",\n        \"operationId\": \"apps/delete-authorization\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#delete-an-app-authorization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"access_token\": {\n                    \"type\": \"string\",\n                    \"description\": \"The OAuth access token used to authenticate to the GitHub API.\"\n                  }\n                },\n                \"required\": [\n                  \"access_token\"\n                ]\n              },\n              \"example\": {\n                \"access_token\": \"e72e16c7e42f292c6912e7710c838347ae178b4a\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        }\n      }\n    },\n    \"/applications/{client_id}/grants/{access_token}\": {\n      \"delete\": {\n        \"summary\": \"Revoke a grant for an application\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\\n\\nOAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted.\\n\\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under \\\"Authorized OAuth Apps\\\" on GitHub Enterprise Server](https://github.com/settings/applications#authorized).\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/revoke-grant-for-application\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#revoke-a-grant-for-an-application\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/access-token\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2021-05-05\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/applications/{client_id}/token\": {\n      \"post\": {\n        \"summary\": \"Check a token\",\n        \"description\": \"OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/check-token\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#check-a-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"access_token\": {\n                    \"description\": \"The access_token of the OAuth application.\",\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"access_token\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-with-user\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Reset a token\",\n        \"description\": \"OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \\\"token\\\" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/reset-token\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#reset-a-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"access_token\": {\n                    \"description\": \"The access_token of the OAuth application.\",\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"access_token\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-with-user\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete an app token\",\n        \"description\": \"OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/delete-token\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#delete-an-app-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"access_token\": {\n                    \"type\": \"string\",\n                    \"description\": \"The OAuth access token used to authenticate to the GitHub API.\"\n                  }\n                },\n                \"required\": [\n                  \"access_token\"\n                ]\n              },\n              \"example\": {\n                \"access_token\": \"e72e16c7e42f292c6912e7710c838347ae178b4a\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        }\n      }\n    },\n    \"/applications/{client_id}/token/scoped\": {\n      \"post\": {\n        \"summary\": \"Create a scoped access token\",\n        \"description\": \"Use a non-scoped user-to-server OAuth access token to create a repository scoped and/or permission scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/scope-token\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-scoped-access-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"access_token\": {\n                    \"type\": \"string\",\n                    \"description\": \"The OAuth access token used to authenticate to the GitHub API.\",\n                    \"examples\": [\n                      \"e72e16c7e42f292c6912e7710c838347ae178b4a\"\n                    ]\n                  },\n                  \"target\": {\n                    \"description\": \"The name of the user or organization to scope the user-to-server access token to. **Required** unless `target_id` is specified.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"octocat\"\n                    ]\n                  },\n                  \"target_id\": {\n                    \"description\": \"The ID of the user or organization to scope the user-to-server access token to. **Required** unless `target` is specified.\",\n                    \"type\": \"integer\",\n                    \"examples\": [\n                      1\n                    ]\n                  },\n                  \"repositories\": {\n                    \"description\": \"The list of repository names to scope the user-to-server access token to. `repositories` may not be specified if `repository_ids` is specified.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"rails\"\n                      ]\n                    }\n                  },\n                  \"repository_ids\": {\n                    \"description\": \"The list of repository IDs to scope the user-to-server access token to. `repository_ids` may not be specified if `repositories` is specified.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\"\n                    },\n                    \"examples\": [\n                      1\n                    ]\n                  },\n                  \"permissions\": {\n                    \"$ref\": \"#/components/schemas/app-permissions\"\n                  }\n                },\n                \"required\": [\n                  \"access_token\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/scope-token\"\n                  }\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        }\n      }\n    },\n    \"/applications/{client_id}/tokens/{access_token}\": {\n      \"get\": {\n        \"summary\": \"Check an authorization\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\\n\\nOAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/check-authorization\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#check-an-authorization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/access-token\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"anyOf\": [\n                    {\n                      \"type\": \"null\"\n                    },\n                    {\n                      \"$ref\": \"#/components/schemas/authorization\"\n                    }\n                  ]\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-with-user\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2021-05-05\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        },\n        \"deprecated\": true\n      },\n      \"post\": {\n        \"summary\": \"Reset an authorization\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\\n\\nOAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \\\"token\\\" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/reset-authorization\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#reset-an-authorization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/access-token\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-with-user\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2021-05-05\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Revoke an authorization for an application\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\\n\\nOAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/revoke-authorization-for-application\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#revoke-an-authorization-for-an-application\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/access-token\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2021-05-05\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"apps\",\n          \"subcategory\": \"oauth-applications\"\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/apps/{app_slug}\": {\n      \"get\": {\n        \"summary\": \"Get an app\",\n        \"description\": \"**Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).\\n\\nIf the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/get-by-slug\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps/#get-an-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/app-slug\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/integration\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/integration\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/authorizations\": {\n      \"get\": {\n        \"summary\": \"List your authorizations\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/list-authorizations\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#list-your-authorizations\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"name\": \"client_id\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"description\": \"The client ID of your GitHub app.\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/authorization\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      },\n      \"post\": {\n        \"summary\": \"Create a new authorization\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\\n\\n**Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\\n\\nCreates OAuth tokens using [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \\\"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\\\"\\n\\nTo create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them.\\n\\nYou can also create tokens on GitHub Enterprise Server from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://docs.github.com/articles/creating-an-access-token-for-command-line-use).\\n\\nOrganizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://docs.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on).\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/create-authorization\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#create-a-new-authorization\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"scopes\": {\n                    \"description\": \"A list of scopes that this authorization is in.\",\n                    \"type\": [\n                      \"array\",\n                      \"null\"\n                    ],\n                    \"items\": {\n                      \"type\": \"string\"\n                    },\n                    \"examples\": [\n                      \"public_repo\",\n                      \"user\"\n                    ]\n                  },\n                  \"note\": {\n                    \"description\": \"A note to remind you what the OAuth token is for.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Update all gems\"\n                    ]\n                  },\n                  \"note_url\": {\n                    \"description\": \"A URL to remind you what app the OAuth token is for.\",\n                    \"type\": \"string\"\n                  },\n                  \"client_id\": {\n                    \"description\": \"The OAuth app client key for which to create the token.\",\n                    \"maxLength\": 20,\n                    \"type\": \"string\"\n                  },\n                  \"client_secret\": {\n                    \"description\": \"The OAuth app client secret for which to create the token.\",\n                    \"maxLength\": 40,\n                    \"type\": \"string\"\n                  },\n                  \"fingerprint\": {\n                    \"description\": \"A unique string to distinguish an authorization from others created for the same client ID and user.\",\n                    \"type\": \"string\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/authorizations/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/authorizations/clients/{client_id}\": {\n      \"put\": {\n        \"summary\": \"Get-or-create an authorization for a specific app\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\\n\\n**Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\\n\\nCreates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.\\n\\nIf you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \\\"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\\\"\\n\\n**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/get-or-create-authorization-for-app\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"client_secret\": {\n                    \"description\": \"The OAuth app client secret for which to create the token.\",\n                    \"maxLength\": 40,\n                    \"type\": \"string\"\n                  },\n                  \"scopes\": {\n                    \"description\": \"A list of scopes that this authorization is in.\",\n                    \"type\": [\n                      \"array\",\n                      \"null\"\n                    ],\n                    \"items\": {\n                      \"type\": \"string\"\n                    },\n                    \"examples\": [\n                      \"public_repo\",\n                      \"user\"\n                    ]\n                  },\n                  \"note\": {\n                    \"description\": \"A note to remind you what the OAuth token is for.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Update all gems\"\n                    ]\n                  },\n                  \"note_url\": {\n                    \"description\": \"A URL to remind you what app the OAuth token is for.\",\n                    \"type\": \"string\"\n                  },\n                  \"fingerprint\": {\n                    \"description\": \"A unique string to distinguish an authorization from others created for the same client ID and user.\",\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"client_secret\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"if returning an existing token\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"response-if-returning-an-existing-token\": {\n                    \"$ref\": \"#/components/examples/authorization-response-if-returning-an-existing-token-2\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/authorizations/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"**Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/authorizations/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/authorizations/clients/{client_id}/{fingerprint}\": {\n      \"put\": {\n        \"summary\": \"Get-or-create an authorization for a specific app and fingerprint\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\\n\\n**Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\\n\\nThis method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.\\n\\nIf you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \\\"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\\\"\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/client-id\"\n          },\n          {\n            \"name\": \"fingerprint\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"client_secret\": {\n                    \"description\": \"The OAuth app client secret for which to create the token.\",\n                    \"maxLength\": 40,\n                    \"type\": \"string\"\n                  },\n                  \"scopes\": {\n                    \"description\": \"A list of scopes that this authorization is in.\",\n                    \"type\": [\n                      \"array\",\n                      \"null\"\n                    ],\n                    \"items\": {\n                      \"type\": \"string\"\n                    },\n                    \"examples\": [\n                      \"public_repo\",\n                      \"user\"\n                    ]\n                  },\n                  \"note\": {\n                    \"description\": \"A note to remind you what the OAuth token is for.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Update all gems\"\n                    ]\n                  },\n                  \"note_url\": {\n                    \"description\": \"A URL to remind you what app the OAuth token is for.\",\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"client_secret\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"if returning an existing token\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"response-if-returning-an-existing-token\": {\n                    \"$ref\": \"#/components/examples/authorization-response-if-returning-an-existing-token\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/authorizations/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Response if returning a new token\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-3\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/authorizations/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/authorizations/{authorization_id}\": {\n      \"get\": {\n        \"summary\": \"Get a single authorization\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/get-authorization\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#get-a-single-authorization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/authorization-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      },\n      \"patch\": {\n        \"summary\": \"Update an existing authorization\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\\n\\nIf you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \\\"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\\\"\\n\\nYou can only send one of these scope keys at a time.\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/update-authorization\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#update-an-existing-authorization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/authorization-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"scopes\": {\n                    \"description\": \"A list of scopes that this authorization is in.\",\n                    \"type\": [\n                      \"array\",\n                      \"null\"\n                    ],\n                    \"items\": {\n                      \"type\": \"string\"\n                    },\n                    \"examples\": [\n                      \"public_repo\",\n                      \"user\"\n                    ]\n                  },\n                  \"add_scopes\": {\n                    \"description\": \"A list of scopes to add to this authorization.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"remove_scopes\": {\n                    \"description\": \"A list of scopes to remove from this authorization.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"note\": {\n                    \"description\": \"A note to remind you what the OAuth token is for.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Update all gems\"\n                    ]\n                  },\n                  \"note_url\": {\n                    \"description\": \"A URL to remind you what app the OAuth token is for.\",\n                    \"type\": \"string\"\n                  },\n                  \"fingerprint\": {\n                    \"description\": \"A unique string to distinguish an authorization from others created for the same client ID and user.\",\n                    \"type\": \"string\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authorization\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authorization-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Delete an authorization\",\n        \"description\": \"**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\",\n        \"tags\": [\n          \"oauth-authorizations\"\n        ],\n        \"operationId\": \"oauth-authorizations/delete-authorization\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#delete-an-authorization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/authorization-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2020-11-13\",\n          \"deprecationDate\": \"2020-02-14\",\n          \"category\": \"oauth-authorizations\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/codes_of_conduct\": {\n      \"get\": {\n        \"summary\": \"Get all codes of conduct\",\n        \"description\": \"\",\n        \"tags\": [\n          \"codes-of-conduct\"\n        ],\n        \"operationId\": \"codes-of-conduct/get-all-codes-of-conduct\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/codes-of-conduct#get-all-codes-of-conduct\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/code-of-conduct\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-of-conduct-simple-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"codes-of-conduct\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/codes_of_conduct/{key}\": {\n      \"get\": {\n        \"summary\": \"Get a code of conduct\",\n        \"description\": \"\",\n        \"tags\": [\n          \"codes-of-conduct\"\n        ],\n        \"operationId\": \"codes-of-conduct/get-conduct-code\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/codes-of-conduct#get-a-code-of-conduct\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"key\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/code-of-conduct\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-of-conduct\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"codes-of-conduct\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/emojis\": {\n      \"get\": {\n        \"summary\": \"Get emojis\",\n        \"description\": \"Lists all the emojis available to use on GitHub Enterprise Server.\",\n        \"operationId\": \"emojis/get\",\n        \"tags\": [\n          \"emojis\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/emojis#get-emojis\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"additionalProperties\": {\n                    \"type\": \"string\"\n                  }\n                }\n              }\n            },\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"emojis\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/enterprise/announcement\": {\n      \"get\": {\n        \"summary\": \"Get the global announcement banner\",\n        \"description\": \"Gets the current message and expiration date of the global announcement banner in your enterprise.\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"operationId\": \"enterprise-admin/get-announcement\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/announcement\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/announcement\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"announcement\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Set the global announcement banner\",\n        \"description\": \"Sets the message and expiration time for the global announcement banner in your enterprise.\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"operationId\": \"enterprise-admin/set-announcement\",\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/announcement\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/announcement\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/announcement\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"announcement\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove the global announcement banner\",\n        \"description\": \"Removes the global announcement banner in your enterprise.\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"operationId\": \"enterprise-admin/remove-announcement\",\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"announcement\"\n        }\n      }\n    },\n    \"/enterprise/settings/license\": {\n      \"get\": {\n        \"summary\": \"Get license information\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-license-information\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-license-information\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/license-info\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/license-info\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"license\"\n        }\n      }\n    },\n    \"/enterprise/stats/all\": {\n      \"get\": {\n        \"summary\": \"Get all statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-all-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-overview\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/enterprise-overview\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/comments\": {\n      \"get\": {\n        \"summary\": \"Get comment statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-comment-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-comment-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-comment-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/gists\": {\n      \"get\": {\n        \"summary\": \"Get gist statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-gist-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-gist-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-gist-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/hooks\": {\n      \"get\": {\n        \"summary\": \"Get hooks statistics\",\n        \"operationId\": \"enterprise-admin/get-hooks-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-hooks-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-hook-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/issues\": {\n      \"get\": {\n        \"summary\": \"Get issue statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-issue-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-issues-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-issue-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/milestones\": {\n      \"get\": {\n        \"summary\": \"Get milestone statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-milestone-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-milestone-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-milestone-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/orgs\": {\n      \"get\": {\n        \"summary\": \"Get organization statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-org-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-organization-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-organization-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/pages\": {\n      \"get\": {\n        \"summary\": \"Get pages statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-pages-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-pages-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-page-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/pulls\": {\n      \"get\": {\n        \"summary\": \"Get pull request statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-pull-request-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-pull-requests-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-pull-request-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/repos\": {\n      \"get\": {\n        \"summary\": \"Get repository statistics\",\n        \"operationId\": \"enterprise-admin/get-repo-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-repository-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-repository-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprise/stats/users\": {\n      \"get\": {\n        \"summary\": \"Get users statistics\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-user-stats\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-users-statistics\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-user-overview\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"admin-stats\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/permissions\": {\n      \"get\": {\n        \"summary\": \"Get GitHub Actions permissions for an enterprise\",\n        \"description\": \"Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/get-github-actions-permissions-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-github-actions-permissions-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/actions-enterprise-permissions\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/actions-enterprise-permissions\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set GitHub Actions permissions for an enterprise\",\n        \"description\": \"Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/set-github-actions-permissions-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-github-actions-permissions-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled_organizations\": {\n                    \"$ref\": \"#/components/schemas/enabled-organizations\"\n                  },\n                  \"allowed_actions\": {\n                    \"$ref\": \"#/components/schemas/allowed-actions\"\n                  }\n                },\n                \"required\": [\n                  \"enabled_organizations\"\n                ]\n              },\n              \"example\": {\n                \"enabled_organizations\": \"all\",\n                \"allowed_actions\": \"selected\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/permissions/organizations\": {\n      \"get\": {\n        \"summary\": \"List selected organizations enabled for GitHub Actions in an enterprise\",\n        \"description\": \"Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\\\"\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/list-selected-organizations-enabled-github-actions-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"organizations\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/organization-simple\"\n                      }\n                    }\n                  },\n                  \"required\": [\n                    \"total_count\",\n                    \"organizations\"\n                  ]\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-targets\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set selected organizations enabled for GitHub Actions in an enterprise\",\n        \"description\": \"Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\\\"\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/set-selected-organizations-enabled-github-actions-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"selected_organization_ids\": {\n                    \"description\": \"List of organization IDs to enable for GitHub Actions.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the organization.\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"selected_organization_ids\"\n                ]\n              },\n              \"example\": {\n                \"selected_organization_ids\": [\n                  32,\n                  91\n                ]\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/permissions/organizations/{org_id}\": {\n      \"put\": {\n        \"summary\": \"Enable a selected organization for GitHub Actions in an enterprise\",\n        \"description\": \"Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\\\"\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/enable-selected-organization-github-actions-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#enable-a-selected-organization-for-github-actions-in-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/org-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Disable a selected organization for GitHub Actions in an enterprise\",\n        \"description\": \"Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\\\"\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/disable-selected-organization-github-actions-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#disable-a-selected-organization-for-github-actions-in-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/org-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/permissions/selected-actions\": {\n      \"get\": {\n        \"summary\": \"Get allowed actions for an enterprise\",\n        \"description\": \"Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\\\"\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/get-allowed-actions-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-allowed-actions-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/selected-actions\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/selected-actions\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set allowed actions for an enterprise\",\n        \"description\": \"Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\\\"\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/set-allowed-actions-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-allowed-actions-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/selected-actions\"\n              },\n              \"examples\": {\n                \"selected_actions\": {\n                  \"$ref\": \"#/components/examples/selected-actions\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runner-groups\": {\n      \"get\": {\n        \"summary\": \"List self-hosted runner groups for an enterprise\",\n        \"description\": \"Lists all self-hosted runner groups for an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/list-self-hosted-runner-groups-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runner-groups-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"runner_groups\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/runner-groups-enterprise\"\n                      }\n                    }\n                  },\n                  \"required\": [\n                    \"total_count\",\n                    \"runner_groups\"\n                  ]\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-groups-enterprise\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a self-hosted runner group for an enterprise\",\n        \"description\": \"Creates a new self-hosted runner group for an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/create-self-hosted-runner-group-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-self-hosted-runner-group-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"Name of the runner group.\",\n                    \"type\": \"string\"\n                  },\n                  \"visibility\": {\n                    \"description\": \"Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: `all` or `selected`\",\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"selected\",\n                      \"all\"\n                    ]\n                  },\n                  \"selected_organization_ids\": {\n                    \"description\": \"List of organization IDs that can access the runner group.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the organization.\"\n                    }\n                  },\n                  \"runners\": {\n                    \"description\": \"List of runner IDs to add to the runner group.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the runner.\"\n                    }\n                  },\n                  \"allows_public_repositories\": {\n                    \"description\": \"Whether the runner group can be used by `public` repositories.\",\n                    \"type\": \"boolean\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"Expensive hardware runners\",\n                \"visibility\": \"selected\",\n                \"selected_organization_ids\": [\n                  32,\n                  91\n                ],\n                \"runners\": [\n                  9,\n                  2\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner-groups-enterprise\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-group-enterprise\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}\": {\n      \"get\": {\n        \"summary\": \"Get a self-hosted runner group for an enterprise\",\n        \"description\": \"Gets a specific self-hosted runner group for an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/get-self-hosted-runner-group-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-group-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner-groups-enterprise\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-group-enterprise\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a self-hosted runner group for an enterprise\",\n        \"description\": \"Updates the `name` and `visibility` of a self-hosted runner group in an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/update-self-hosted-runner-group-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#update-a-self-hosted-runner-group-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"Name of the runner group.\",\n                    \"type\": \"string\"\n                  },\n                  \"visibility\": {\n                    \"description\": \"Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: `all` or `selected`\",\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"selected\",\n                      \"all\"\n                    ],\n                    \"default\": \"all\"\n                  },\n                  \"allows_public_repositories\": {\n                    \"description\": \"Whether the runner group can be used by `public` repositories.\",\n                    \"type\": \"boolean\",\n                    \"default\": false\n                  }\n                }\n              },\n              \"example\": {\n                \"name\": \"Expensive hardware runners\",\n                \"visibility\": \"selected\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner-groups-enterprise\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-group-update-enterprise\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a self-hosted runner group from an enterprise\",\n        \"description\": \"Deletes a self-hosted runner group for an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/delete-self-hosted-runner-group-from-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\": {\n      \"get\": {\n        \"summary\": \"List organization access to a self-hosted runner group in an enterprise\",\n        \"description\": \"Lists the organizations with access to a self-hosted runner group.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/list-org-access-to-self-hosted-runner-group-in-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-organization-access-to-a-self-hosted-runner-group-in-a-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"organizations\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/organization-simple\"\n                      }\n                    }\n                  },\n                  \"required\": [\n                    \"total_count\",\n                    \"organizations\"\n                  ]\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-targets\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set organization access for a self-hosted runner group in an enterprise\",\n        \"description\": \"Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/set-org-access-to-self-hosted-runner-group-in-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-organization-access-to-a-self-hosted-runner-group-in-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"selected_organization_ids\": {\n                    \"description\": \"List of organization IDs that can access the runner group.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the organization.\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"selected_organization_ids\"\n                ]\n              },\n              \"example\": {\n                \"selected_organization_ids\": [\n                  32,\n                  91\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}\": {\n      \"put\": {\n        \"summary\": \"Add organization access to a self-hosted runner group in an enterprise\",\n        \"description\": \"Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \\\"[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise).\\\"\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/add-org-access-to-self-hosted-runner-group-in-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/org-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove organization access to a self-hosted runner group in an enterprise\",\n        \"description\": \"Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \\\"[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise).\\\"\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/remove-org-access-to-self-hosted-runner-group-in-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/org-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\": {\n      \"get\": {\n        \"summary\": \"List self-hosted runners in a group for an enterprise\",\n        \"description\": \"Lists the self-hosted runners that are in a specific enterprise group.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/list-self-hosted-runners-in-group-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"runners\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/runner\"\n                      }\n                    }\n                  },\n                  \"required\": [\n                    \"total_count\",\n                    \"runners\"\n                  ]\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set self-hosted runners in a group for an enterprise\",\n        \"description\": \"Replaces the list of self-hosted runners that are part of an enterprise runner group.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/set-self-hosted-runners-in-group-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"runners\": {\n                    \"description\": \"List of runner IDs to add to the runner group.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the runner.\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"runners\"\n                ]\n              },\n              \"example\": {\n                \"runners\": [\n                  9,\n                  2\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\": {\n      \"put\": {\n        \"summary\": \"Add a self-hosted runner to a group for an enterprise\",\n        \"description\": \"Adds a self-hosted runner to a runner group configured in an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise`\\nscope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/add-self-hosted-runner-to-group-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove a self-hosted runner from a group for an enterprise\",\n        \"description\": \"Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/remove-self-hosted-runner-from-group-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runners\": {\n      \"get\": {\n        \"summary\": \"List self-hosted runners for an enterprise\",\n        \"description\": \"Lists all self-hosted runners configured for an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/list-self-hosted-runners-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"runners\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/runner\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runners/downloads\": {\n      \"get\": {\n        \"summary\": \"List runner applications for an enterprise\",\n        \"description\": \"Lists binaries for the runner application that you can download and run.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/list-runner-applications-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-runner-applications-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/runner-application\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-application-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runners/registration-token\": {\n      \"post\": {\n        \"summary\": \"Create a registration token for an enterprise\",\n        \"description\": \"Returns a token that you can pass to the `config` script. The token expires after one hour.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\\n\\n#### Example using registration token\\n\\nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\\n\\n```\\n./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN\\n```\",\n        \"operationId\": \"enterprise-admin/create-registration-token-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-registration-token-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authentication-token\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authentication-token\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runners/remove-token\": {\n      \"post\": {\n        \"summary\": \"Create a remove token for an enterprise\",\n        \"description\": \"Returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\\n\\n#### Example using remove token\\n\\nTo remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by this\\nendpoint.\\n\\n```\\n./config.sh remove --token TOKEN\\n```\",\n        \"operationId\": \"enterprise-admin/create-remove-token-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-remove-token-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authentication-token\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authentication-token-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/enterprises/{enterprise}/actions/runners/{runner_id}\": {\n      \"get\": {\n        \"summary\": \"Get a self-hosted runner for an enterprise\",\n        \"description\": \"Gets a specific self-hosted runner configured in an enterprise.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/get-self-hosted-runner-for-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-for-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a self-hosted runner from an enterprise\",\n        \"description\": \"Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\\n\\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\",\n        \"operationId\": \"enterprise-admin/delete-self-hosted-runner-from-enterprise\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-self-hosted-runner-from-an-enterprise\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/enterprise\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": false,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/events\": {\n      \"get\": {\n        \"summary\": \"List public events\",\n        \"description\": \"We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-public-events\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-events\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/feeds\": {\n      \"get\": {\n        \"summary\": \"Get feeds\",\n        \"description\": \"GitHub Enterprise Server provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user:\\n\\n*   **Timeline**: The GitHub Enterprise Server global public timeline\\n*   **User**: The public timeline for any user, using [URI template](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#hypermedia)\\n*   **Current user public**: The public timeline for the authenticated user\\n*   **Current user**: The private timeline for the authenticated user\\n*   **Current user actor**: The private timeline for activity created by the authenticated user\\n*   **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.\\n*   **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub Enterprise Server.\\n\\n**Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/get-feeds\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-feeds\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/feed\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/feed\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"feeds\"\n        }\n      }\n    },\n    \"/gists\": {\n      \"get\": {\n        \"summary\": \"List gists for the authenticated user\",\n        \"description\": \"Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/list\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gists-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/base-gist\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/base-gist-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a gist\",\n        \"description\": \"Allows you to add a new gist with one or more files.\\n\\n**Note:** Don't name your files \\\"gistfile\\\" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.\",\n        \"operationId\": \"gists/create\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#create-a-gist\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"description\": {\n                    \"description\": \"Description of the gist\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Example Ruby script\"\n                    ]\n                  },\n                  \"files\": {\n                    \"description\": \"Names and content for the files that make up the gist\",\n                    \"type\": \"object\",\n                    \"additionalProperties\": {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"content\": {\n                          \"description\": \"Content of the file\",\n                          \"readOnly\": false,\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"required\": [\n                        \"content\"\n                      ]\n                    },\n                    \"examples\": [\n                      {\n                        \"hello.rb\": {\n                          \"content\": \"puts \\\"Hello, World!\\\"\"\n                        }\n                      }\n                    ]\n                  },\n                  \"public\": {\n                    \"oneOf\": [\n                      {\n                        \"description\": \"Flag indicating whether the gist is public\",\n                        \"type\": \"boolean\",\n                        \"default\": false,\n                        \"examples\": [\n                          true\n                        ]\n                      },\n                      {\n                        \"type\": \"string\",\n                        \"default\": \"false\",\n                        \"enum\": [\n                          \"true\",\n                          \"false\"\n                        ],\n                        \"examples\": [\n                          \"true\"\n                        ]\n                      }\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"files\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gist-simple\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/gists/aa5a315d61ae9438b18d\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gists/public\": {\n      \"get\": {\n        \"summary\": \"List public gists\",\n        \"description\": \"List public gists sorted by most recently updated to least recently updated.\\n\\nNote: With [pagination](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/list-public\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-public-gists\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/base-gist\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/base-gist-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gists/starred\": {\n      \"get\": {\n        \"summary\": \"List starred gists\",\n        \"description\": \"List the authenticated user's starred gists:\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/list-starred\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-starred-gists\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/base-gist\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/base-gist-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gists/{gist_id}\": {\n      \"get\": {\n        \"summary\": \"Get a gist\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#get-a-gist\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gist-simple\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden_gist\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a gist\",\n        \"description\": \"Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged.\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/update\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists/#update-a-gist\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"description\": {\n                    \"description\": \"Description of the gist\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Example Ruby script\"\n                    ]\n                  },\n                  \"files\": {\n                    \"description\": \"Names of files to be updated\",\n                    \"type\": \"object\",\n                    \"additionalProperties\": {\n                      \"type\": [\n                        \"object\",\n                        \"null\"\n                      ],\n                      \"properties\": {\n                        \"content\": {\n                          \"description\": \"The new content of the file\",\n                          \"type\": \"string\"\n                        },\n                        \"filename\": {\n                          \"description\": \"The new filename for the file\",\n                          \"type\": [\n                            \"string\",\n                            \"null\"\n                          ]\n                        }\n                      },\n                      \"anyOf\": [\n                        {\n                          \"required\": [\n                            \"content\"\n                          ]\n                        },\n                        {\n                          \"required\": [\n                            \"filename\"\n                          ]\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"maxProperties\": 0\n                        }\n                      ]\n                    },\n                    \"examples\": [\n                      {\n                        \"hello.rb\": {\n                          \"content\": \"blah\",\n                          \"filename\": \"goodbye.rb\"\n                        }\n                      }\n                    ]\n                  }\n                },\n                \"anyOf\": [\n                  {\n                    \"required\": [\n                      \"description\"\n                    ]\n                  },\n                  {\n                    \"required\": [\n                      \"files\"\n                    ]\n                  }\n                ],\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gist-simple\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a gist\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/delete\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#delete-a-gist\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gists/{gist_id}/comments\": {\n      \"get\": {\n        \"summary\": \"List gist comments\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/list-comments\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gist-comments\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/gist-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": \"comments\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a gist comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/create-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#create-a-gist-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"body\": {\n                    \"description\": \"The comment text.\",\n                    \"type\": \"string\",\n                    \"maxLength\": 65535,\n                    \"examples\": [\n                      \"Body of the attachment\"\n                    ]\n                  }\n                },\n                \"type\": \"object\",\n                \"required\": [\n                  \"body\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gist-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist-comment\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/gists/a6db0bec360bb87e9418/comments/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": \"comments\"\n        }\n      }\n    },\n    \"/gists/{gist_id}/comments/{comment_id}\": {\n      \"get\": {\n        \"summary\": \"Get a gist comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/get-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#get-a-gist-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gist-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist-comment\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden_gist\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": \"comments\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a gist comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/update-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#update-a-gist-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"body\": {\n                    \"description\": \"The comment text.\",\n                    \"type\": \"string\",\n                    \"maxLength\": 65535,\n                    \"examples\": [\n                      \"Body of the attachment\"\n                    ]\n                  }\n                },\n                \"type\": \"object\",\n                \"required\": [\n                  \"body\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gist-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist-comment\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": \"comments\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a gist comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/delete-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#delete-a-gist-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": \"comments\"\n        }\n      }\n    },\n    \"/gists/{gist_id}/commits\": {\n      \"get\": {\n        \"summary\": \"List gist commits\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/list-commits\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gist-commits\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/gist-commit\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist-commit-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"example\": \"<https://api.github.com/resource?page=2>; rel=\\\"next\\\"\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gists/{gist_id}/forks\": {\n      \"get\": {\n        \"summary\": \"List gist forks\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/list-forks\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gist-forks\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/gist-simple\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist-fork-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      },\n      \"post\": {\n        \"summary\": \"Fork a gist\",\n        \"description\": \"**Note**: This was previously `/gists/:gist_id/fork`.\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/fork\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#fork-a-gist\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/base-gist\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/base-gist\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/gists/aa5a315d61ae9438b18d\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gists/{gist_id}/star\": {\n      \"get\": {\n        \"summary\": \"Check if a gist is starred\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/check-is-starred\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#check-if-a-gist-is-starred\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response if gist is starred\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if gist is not starred\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                  },\n                  \"additionalProperties\": false\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      },\n      \"put\": {\n        \"summary\": \"Star a gist\",\n        \"description\": \"Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/star\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#star-a-gist\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Unstar a gist\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/unstar\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#unstar-a-gist\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gists/{gist_id}/{sha}\": {\n      \"get\": {\n        \"summary\": \"Get a gist revision\",\n        \"description\": \"\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/get-revision\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#get-a-gist-revision\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gist-id\"\n          },\n          {\n            \"name\": \"sha\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gist-simple\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gist\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gitignore/templates\": {\n      \"get\": {\n        \"summary\": \"Get all gitignore templates\",\n        \"description\": \"List all templates available to pass as an option when [creating a repository](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-for-the-authenticated-user).\",\n        \"operationId\": \"gitignore/get-all-templates\",\n        \"tags\": [\n          \"gitignore\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gitignore#get-all-gitignore-templates\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"example\": [\n                  \"Actionscript\",\n                  \"Android\",\n                  \"AppceleratorTitanium\",\n                  \"Autotools\",\n                  \"Bancha\",\n                  \"C\",\n                  \"C++\"\n                ]\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"gitignore\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/gitignore/templates/{name}\": {\n      \"get\": {\n        \"summary\": \"Get a gitignore template\",\n        \"description\": \"The API also allows fetching the source of a single template.\\nUse the raw [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) to get the raw contents.\",\n        \"operationId\": \"gitignore/get-template\",\n        \"tags\": [\n          \"gitignore\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gitignore#get-a-gitignore-template\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"name\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gitignore-template\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gitignore-template\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"gitignore\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/installation/repositories\": {\n      \"get\": {\n        \"summary\": \"List repositories accessible to the app installation\",\n        \"description\": \"List repositories that an app installation can access.\\n\\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/list-repos-accessible-to-installation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-repositories-accessible-to-the-app-installation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"repositories\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"repositories\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/repository\"\n                      }\n                    },\n                    \"repository_selection\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"selected\"\n                      ]\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-paginated-2\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"apps\",\n          \"subcategory\": \"installations\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"mercy\",\n              \"note\": \"The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.mercy-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/installation/token\": {\n      \"delete\": {\n        \"summary\": \"Revoke an installation access token\",\n        \"description\": \"Revokes the installation token you're using to authenticate as an installation and access this endpoint.\\n\\nOnce an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the \\\"[Create an installation access token for an app](https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-an-installation-access-token-for-an-app)\\\" endpoint.\\n\\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/revoke-installation-access-token\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#revoke-an-installation-access-token\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"apps\",\n          \"subcategory\": \"installations\"\n        }\n      }\n    },\n    \"/issues\": {\n      \"get\": {\n        \"summary\": \"List issues assigned to the authenticated user\",\n        \"description\": \"List issues assigned to the authenticated user across all visible repositories including owned repositories, member\\nrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not\\nnecessarily assigned to you.\\n\\n\\n**Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\\nreason, \\\"Issues\\\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \\\"Issues\\\" endpoints will be an _issue id_. To find out the pull\\nrequest id, use the \\\"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\\\" endpoint.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issues-assigned-to-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"filter\",\n            \"description\": \"Indicates which sorts of issues to return. Can be one of:  \\n\\\\* `assigned`: Issues assigned to you  \\n\\\\* `created`: Issues created by you  \\n\\\\* `mentioned`: Issues mentioning you  \\n\\\\* `subscribed`: Issues you're subscribed to updates for  \\n\\\\* `all` or `repos`: All issues the authenticated user can see, regardless of participation or creation\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"assigned\",\n                \"created\",\n                \"mentioned\",\n                \"subscribed\",\n                \"repos\",\n                \"all\"\n              ],\n              \"default\": \"assigned\"\n            }\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/labels\"\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"What to sort results by. Can be either `created`, `updated`, `comments`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"comments\"\n              ],\n              \"default\": \"created\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"name\": \"collab\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"boolean\"\n            }\n          },\n          {\n            \"name\": \"orgs\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"boolean\"\n            }\n          },\n          {\n            \"name\": \"owned\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"boolean\"\n            }\n          },\n          {\n            \"name\": \"pulls\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"boolean\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/issue\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-with-repo-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"issues\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"machine-man\",\n              \"note\": \"If an issue event is created via a GitHub App, the response will include the `performed_via_github_app` object with\\tinformation about the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo receive the `performed_via_github_app` object in the response, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/licenses\": {\n      \"get\": {\n        \"summary\": \"Get all commonly used licenses\",\n        \"description\": \"\",\n        \"tags\": [\n          \"licenses\"\n        ],\n        \"operationId\": \"licenses/get-all-commonly-used\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/licenses#get-all-commonly-used-licenses\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"featured\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"boolean\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/license-simple\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/license-simple-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"licenses\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/licenses/{license}\": {\n      \"get\": {\n        \"summary\": \"Get a license\",\n        \"description\": \"\",\n        \"tags\": [\n          \"licenses\"\n        ],\n        \"operationId\": \"licenses/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/licenses#get-a-license\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"license\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/license\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/license\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"licenses\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/markdown\": {\n      \"post\": {\n        \"summary\": \"Render a Markdown document\",\n        \"description\": \"\",\n        \"operationId\": \"markdown/render\",\n        \"tags\": [\n          \"markdown\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/markdown#render-a-markdown-document\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"text\": {\n                    \"description\": \"The Markdown text to render in HTML.\",\n                    \"type\": \"string\"\n                  },\n                  \"mode\": {\n                    \"description\": \"The rendering mode. Can be either `markdown` or `gfm`.\",\n                    \"enum\": [\n                      \"markdown\",\n                      \"gfm\"\n                    ],\n                    \"default\": \"markdown\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"markdown\"\n                    ]\n                  },\n                  \"context\": {\n                    \"description\": \"The repository context to use when creating references in `gfm` mode.  For example, setting `context` to `octo-org/octo-repo` will change the text `#42` into an HTML link to issue 42 in the `octo-org/octo-repo` repository.\",\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"text\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"headers\": {\n              \"Content-Type\": {\n                \"$ref\": \"#/components/headers/content-type\"\n              },\n              \"Content-Length\": {\n                \"example\": \"279\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"X-CommonMarker-Version\": {\n                \"$ref\": \"#/components/headers/x-common-marker-version\"\n              }\n            },\n            \"content\": {\n              \"text/html\": {\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"markdown\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/markdown/raw\": {\n      \"post\": {\n        \"summary\": \"Render a Markdown document in raw mode\",\n        \"description\": \"You must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.\",\n        \"operationId\": \"markdown/render-raw\",\n        \"tags\": [\n          \"markdown\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/markdown#render-a-markdown-document-in-raw-mode\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"text/plain\": {\n              \"schema\": {\n                \"type\": \"string\"\n              }\n            },\n            \"text/x-markdown\": {\n              \"schema\": {\n                \"type\": \"string\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"headers\": {\n              \"X-CommonMarker-Version\": {\n                \"$ref\": \"#/components/headers/x-common-marker-version\"\n              }\n            },\n            \"content\": {\n              \"text/html\": {\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"markdown\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/meta\": {\n      \"get\": {\n        \"summary\": \"Get GitHub Enterprise Server meta information\",\n        \"description\": \"\",\n        \"tags\": [\n          \"meta\"\n        ],\n        \"operationId\": \"meta/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/meta#get-github-meta-information\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/api-overview\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/api-overview\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"meta\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/networks/{owner}/{repo}/events\": {\n      \"get\": {\n        \"summary\": \"List public events for a network of repositories\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-public-events-for-repo-network\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-events-for-a-network-of-repositories\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"301\": {\n            \"$ref\": \"#/components/responses/moved_permanently\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/notifications\": {\n      \"get\": {\n        \"summary\": \"List notifications for the authenticated user\",\n        \"description\": \"List all notifications for the current user, sorted by most recently updated.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-notifications-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-notifications-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/all\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/participating\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/before\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/thread\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/thread-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Mark notifications as read\",\n        \"description\": \"Marks all notifications as \\\"read\\\" removes it from the [default view on GitHub Enterprise Server](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub Enterprise Server will run an asynchronous process to mark notifications as \\\"read.\\\" To check whether any \\\"unread\\\" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/mark-notifications-as-read\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#mark-notifications-as-read\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"last_read_at\": {\n                    \"description\": \"Describes the last point that notifications were checked.\",\n                    \"type\": \"string\",\n                    \"format\": \"date-time\"\n                  },\n                  \"read\": {\n                    \"description\": \"Whether the notification has been read.\",\n                    \"type\": \"boolean\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"205\": {\n            \"description\": \"Reset Content\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      }\n    },\n    \"/notifications/threads/{thread_id}\": {\n      \"get\": {\n        \"summary\": \"Get a thread\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/get-thread\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-a-thread\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/thread-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/thread\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/thread\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Mark a thread as read\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/mark-thread-as-read\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#mark-a-thread-as-read\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/thread-id\"\n          }\n        ],\n        \"responses\": {\n          \"205\": {\n            \"description\": \"Reset Content\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      }\n    },\n    \"/notifications/threads/{thread_id}/subscription\": {\n      \"get\": {\n        \"summary\": \"Get a thread subscription for the authenticated user\",\n        \"description\": \"This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-a-repository-subscription).\\n\\nNote that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/get-thread-subscription-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-a-thread-subscription-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/thread-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/thread-subscription\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/thread-subscription\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set a thread subscription\",\n        \"description\": \"If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.\\n\\nYou can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.\\n\\nUnsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-thread-subscription) endpoint.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/set-thread-subscription\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#set-a-thread-subscription\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/thread-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"ignored\": {\n                    \"description\": \"Whether to block all notifications from a thread.\",\n                    \"default\": false,\n                    \"type\": \"boolean\"\n                  }\n                },\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/thread-subscription\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/thread-subscription\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a thread subscription\",\n        \"description\": \"Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#set-a-thread-subscription) endpoint and set `ignore` to `true`.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/delete-thread-subscription\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-thread-subscription\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/thread-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      }\n    },\n    \"/octocat\": {\n      \"get\": {\n        \"summary\": \"Get Octocat\",\n        \"description\": \"Get the octocat as ASCII art\",\n        \"tags\": [\n          \"meta\"\n        ],\n        \"operationId\": \"meta/get-octocat\",\n        \"parameters\": [\n          {\n            \"name\": \"s\",\n            \"in\": \"query\",\n            \"description\": \"The words to show in Octocat's speech bubble\",\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"required\": false\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/octocat-stream\": {\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/meta#get-octocat\"\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"meta\"\n        }\n      }\n    },\n    \"/organizations\": {\n      \"get\": {\n        \"summary\": \"List organizations\",\n        \"description\": \"Lists all organizations, in the order that they were created on GitHub Enterprise Server.\\n\\n**Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organizations\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/since-org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/organization-simple\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-simple-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"example\": \"<https://api.github.com/organizations?since=135>; rel=\\\"next\\\"\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/orgs/{org}\": {\n      \"get\": {\n        \"summary\": \"Get an organization\",\n        \"description\": \"To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).\\n\\nGitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub Enterprise Server plan. See \\\"[Authenticating with GitHub Apps](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/)\\\" for details. For an example response, see 'Response with GitHub Enterprise Server plan information' below.\\\"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/organization-full\"\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/organization-full-default-response\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"surtur\",\n              \"note\": \"New repository creation permissions are available to preview. You can now use `members_can_create_public_repositories`, `members_can_create_private_repositories`, and `members_can_create_internal_repositories`. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. These parameters provide more granular permissions to configure the type of repositories organization members can create.\\n\\nTo access these new parameters during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.surtur-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update an organization\",\n        \"description\": \"**Parameter Deprecation Notice:** GitHub Enterprise Server will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).\\n\\nEnables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/update\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs/#update-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"billing_email\": {\n                    \"type\": \"string\",\n                    \"description\": \"Billing email address. This address is not publicized.\"\n                  },\n                  \"company\": {\n                    \"type\": \"string\",\n                    \"description\": \"The company name.\"\n                  },\n                  \"email\": {\n                    \"type\": \"string\",\n                    \"description\": \"The publicly visible email address.\"\n                  },\n                  \"twitter_username\": {\n                    \"type\": \"string\",\n                    \"description\": \"The Twitter username of the company.\"\n                  },\n                  \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"The location.\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The shorthand name of the company.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"The description of the company.\"\n                  },\n                  \"has_organization_projects\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Toggles whether an organization can use organization projects.\"\n                  },\n                  \"has_repository_projects\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Toggles whether repositories that belong to the organization can use repository projects.\"\n                  },\n                  \"default_repository_permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"Default permission level members have for organization repositories:  \\n\\\\* `read` - can pull, but not push to or administer this repository.  \\n\\\\* `write` - can pull and push, but not administer this repository.  \\n\\\\* `admin` - can pull, push, and administer this repository.  \\n\\\\* `none` - no permissions granted by default.\",\n                    \"enum\": [\n                      \"read\",\n                      \"write\",\n                      \"admin\",\n                      \"none\"\n                    ],\n                    \"default\": \"read\"\n                  },\n                  \"members_can_create_repositories\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Toggles the ability of non-admin organization members to create repositories. Can be one of:  \\n\\\\* `true` - all organization members can create repositories.  \\n\\\\* `false` - only organization owners can create repositories.  \\nDefault: `true`  \\n**Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details.\",\n                    \"default\": true\n                  },\n                  \"members_can_create_internal_repositories\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of:  \\n\\\\* `true` - all organization members can create internal repositories.  \\n\\\\* `false` - only organization owners can create internal repositories.  \\nDefault: `true`. For more information, see \\\"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\\\" in the GitHub Help documentation.\"\n                  },\n                  \"members_can_create_private_repositories\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of:  \\n\\\\* `true` - all organization members can create private repositories.  \\n\\\\* `false` - only organization owners can create private repositories.  \\nDefault: `true`. For more information, see \\\"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\\\" in the GitHub Help documentation.\"\n                  },\n                  \"members_can_create_public_repositories\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of:  \\n\\\\* `true` - all organization members can create public repositories.  \\n\\\\* `false` - only organization owners can create public repositories.  \\nDefault: `true`. For more information, see \\\"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\\\" in the GitHub Help documentation.\"\n                  },\n                  \"members_allowed_repository_creation_type\": {\n                    \"type\": \"string\",\n                    \"description\": \"Specifies which types of repositories non-admin organization members can create. Can be one of:  \\n\\\\* `all` - all organization members can create public and private repositories.  \\n\\\\* `private` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud.  \\n\\\\* `none` - only admin members can create repositories.  \\n**Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details.\",\n                    \"enum\": [\n                      \"all\",\n                      \"private\",\n                      \"none\"\n                    ]\n                  },\n                  \"members_can_create_pages\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Toggles whether organization members can create GitHub Pages sites. Can be one of:  \\n\\\\* `true` - all organization members can create GitHub Pages sites.  \\n\\\\* `false` - no organization members can create GitHub Pages sites. Existing published sites will not be impacted.\",\n                    \"default\": true\n                  },\n                  \"members_can_fork_private_repositories\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Toggles whether organization members can fork private organization repositories. Can be one of:  \\n\\\\* `true` - all organization members can fork private repositories within the organization.  \\n\\\\* `false` - no organization members can fork private repositories within the organization.\",\n                    \"default\": false\n                  },\n                  \"blog\": {\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"\\\"http://github.blog\\\"\"\n                    ]\n                  }\n                }\n              },\n              \"example\": {\n                \"billing_email\": \"mona@github.com\",\n                \"company\": \"GitHub\",\n                \"email\": \"mona@github.com\",\n                \"twitter_username\": \"github\",\n                \"location\": \"San Francisco\",\n                \"name\": \"github\",\n                \"description\": \"GitHub, the company.\",\n                \"default_repository_permission\": \"read\",\n                \"members_can_create_repositories\": true,\n                \"members_allowed_repository_creation_type\": \"all\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/organization-full\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-full\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"description\": \"Validation failed\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"oneOf\": [\n                    {\n                      \"$ref\": \"#/components/schemas/validation-error\"\n                    },\n                    {\n                      \"$ref\": \"#/components/schemas/validation-error-simple\"\n                    }\n                  ]\n                }\n              }\n            }\n          },\n          \"409\": {\n            \"$ref\": \"#/components/responses/conflict\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"surtur\",\n              \"note\": \"New repository creation permissions are available to preview. You can now use `members_can_create_public_repositories`, `members_can_create_private_repositories`, and `members_can_create_internal_repositories`. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. These parameters provide more granular permissions to configure the type of repositories organization members can create.\\n\\nTo access these new parameters during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.surtur-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/actions/permissions\": {\n      \"get\": {\n        \"summary\": \"Get GitHub Actions permissions for an organization\",\n        \"description\": \"Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\",\n        \"operationId\": \"actions/get-github-actions-permissions-organization\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-github-actions-permissions-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/actions-organization-permissions\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/actions-organization-permissions\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set GitHub Actions permissions for an organization\",\n        \"description\": \"Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.\\n\\nIf the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\",\n        \"operationId\": \"actions/set-github-actions-permissions-organization\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-github-actions-permissions-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled_repositories\": {\n                    \"$ref\": \"#/components/schemas/enabled-repositories\"\n                  },\n                  \"allowed_actions\": {\n                    \"$ref\": \"#/components/schemas/allowed-actions\"\n                  }\n                },\n                \"required\": [\n                  \"enabled_repositories\"\n                ]\n              },\n              \"example\": {\n                \"enabled_repositories\": \"all\",\n                \"allowed_actions\": \"selected\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/permissions/repositories\": {\n      \"get\": {\n        \"summary\": \"List selected repositories enabled for GitHub Actions in an organization\",\n        \"description\": \"Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\\\"\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\",\n        \"operationId\": \"actions/list-selected-repositories-enabled-github-actions-organization\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-selected-repositories-enabled-for-github-actions-in-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"repositories\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"repositories\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/repository\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-paginated\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set selected repositories enabled for GitHub Actions in an organization\",\n        \"description\": \"Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\\\"\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\",\n        \"operationId\": \"actions/set-selected-repositories-enabled-github-actions-organization\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-enabled-for-github-actions-in-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"selected_repository_ids\": {\n                    \"description\": \"List of repository IDs to enable for GitHub Actions.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the repository.\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"selected_repository_ids\"\n                ]\n              },\n              \"example\": {\n                \"selected_repository_ids\": [\n                  32,\n                  42\n                ]\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/permissions/repositories/{repository_id}\": {\n      \"put\": {\n        \"summary\": \"Enable a selected repository for GitHub Actions in an organization\",\n        \"description\": \"Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\\\"\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\",\n        \"operationId\": \"actions/enable-selected-repository-github-actions-organization\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#enable-a-selected-repository-for-github-actions-in-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repository-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Disable a selected repository for GitHub Actions in an organization\",\n        \"description\": \"Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\\\"\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\",\n        \"operationId\": \"actions/disable-selected-repository-github-actions-organization\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#disable-a-selected-repository-for-github-actions-in-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repository-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/permissions/selected-actions\": {\n      \"get\": {\n        \"summary\": \"Get allowed actions for an organization\",\n        \"description\": \"Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\\\"\\\"\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\",\n        \"operationId\": \"actions/get-allowed-actions-organization\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-allowed-actions-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/selected-actions\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/selected-actions\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set allowed actions for an organization\",\n        \"description\": \"Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\\\"\\n\\nIf the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.\\n\\nTo use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\",\n        \"operationId\": \"actions/set-allowed-actions-organization\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-allowed-actions-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/selected-actions\"\n              },\n              \"examples\": {\n                \"selected_actions\": {\n                  \"$ref\": \"#/components/examples/selected-actions\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runner-groups\": {\n      \"get\": {\n        \"summary\": \"List self-hosted runner groups for an organization\",\n        \"description\": \"Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/list-self-hosted-runner-groups-for-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"runner_groups\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"runner_groups\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/runner-groups-org\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-groups-org\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a self-hosted runner group for an organization\",\n        \"description\": \"The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see \\\"[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products).\\\"\\n\\nCreates a new self-hosted runner group for an organization.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/create-self-hosted-runner-group-for-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-self-hosted-runner-group-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"Name of the runner group.\",\n                    \"type\": \"string\"\n                  },\n                  \"visibility\": {\n                    \"description\": \"Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: `all`, `selected`, or `private`.\",\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"selected\",\n                      \"all\",\n                      \"private\"\n                    ],\n                    \"default\": \"all\"\n                  },\n                  \"selected_repository_ids\": {\n                    \"description\": \"List of repository IDs that can access the runner group.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the repository.\"\n                    }\n                  },\n                  \"runners\": {\n                    \"description\": \"List of runner IDs to add to the runner group.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the runner.\"\n                    }\n                  },\n                  \"allows_public_repositories\": {\n                    \"description\": \"Whether the runner group can be used by `public` repositories.\",\n                    \"type\": \"boolean\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"Expensive hardware runners\",\n                \"visibility\": \"selected\",\n                \"selected_repository_ids\": [\n                  32,\n                  91\n                ],\n                \"runners\": [\n                  9,\n                  2\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner-groups-org\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-group\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runner-groups/{runner_group_id}\": {\n      \"get\": {\n        \"summary\": \"Get a self-hosted runner group for an organization\",\n        \"description\": \"Gets a specific self-hosted runner group for an organization.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/get-self-hosted-runner-group-for-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-group-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner-groups-org\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-group-item\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a self-hosted runner group for an organization\",\n        \"description\": \"Updates the `name` and `visibility` of a self-hosted runner group in an organization.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/update-self-hosted-runner-group-for-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#update-a-self-hosted-runner-group-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"Name of the runner group.\",\n                    \"type\": \"string\"\n                  },\n                  \"visibility\": {\n                    \"description\": \"Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: `all`, `selected`, or `private`.\",\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"selected\",\n                      \"all\",\n                      \"private\"\n                    ]\n                  },\n                  \"allows_public_repositories\": {\n                    \"description\": \"Whether the runner group can be used by `public` repositories.\",\n                    \"type\": \"boolean\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"Expensive hardware runners\",\n                \"visibility\": \"selected\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner-groups-org\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-group\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a self-hosted runner group from an organization\",\n        \"description\": \"Deletes a self-hosted runner group for an organization.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/delete-self-hosted-runner-group-from-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\": {\n      \"get\": {\n        \"summary\": \"List repository access to a self-hosted runner group in an organization\",\n        \"description\": \"The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see \\\"[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products).\\\"\\n\\nLists the repositories with access to a self-hosted runner group configured in an organization.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/list-repo-access-to-self-hosted-runner-group-in-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-repository-access-to-a-self-hosted-runner-group-in-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"repositories\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"repositories\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/minimal-repository\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository-paginated\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set repository access for a self-hosted runner group in an organization\",\n        \"description\": \"Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/set-repo-access-to-self-hosted-runner-group-in-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-repository-access-to-a-self-hosted-runner-group-in-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"selected_repository_ids\": {\n                    \"description\": \"List of repository IDs that can access the runner group.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the repository.\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"selected_repository_ids\"\n                ]\n              },\n              \"example\": {\n                \"selected_repository_ids\": [\n                  32,\n                  91\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}\": {\n      \"put\": {\n        \"summary\": \"Add repository access to a self-hosted runner group in an organization\",\n        \"description\": \"Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \\\"[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization).\\\"\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/add-repo-access-to-self-hosted-runner-group-in-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-repository-acess-to-a-self-hosted-runner-group-in-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repository-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove repository access to a self-hosted runner group in an organization\",\n        \"description\": \"Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \\\"[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization).\\\"\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/remove-repo-access-to-self-hosted-runner-group-in-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repository-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners\": {\n      \"get\": {\n        \"summary\": \"List self-hosted runners in a group for an organization\",\n        \"description\": \"Lists self-hosted runners that are in a specific organization group.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/list-self-hosted-runners-in-group-for-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"runners\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"number\"\n                    },\n                    \"runners\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/runner\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set self-hosted runners in a group for an organization\",\n        \"description\": \"Replaces the list of self-hosted runners that are part of an organization runner group.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/set-self-hosted-runners-in-group-for-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"runners\": {\n                    \"description\": \"List of runner IDs to add to the runner group.\",\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\",\n                      \"description\": \"Unique identifier of the runner.\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"runners\"\n                ]\n              },\n              \"example\": {\n                \"runners\": [\n                  9,\n                  2\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\": {\n      \"put\": {\n        \"summary\": \"Add a self-hosted runner to a group for an organization\",\n        \"description\": \"Adds a self-hosted runner to a runner group configured in an organization.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/add-self-hosted-runner-to-group-for-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove a self-hosted runner from a group for an organization\",\n        \"description\": \"Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"operationId\": \"actions/remove-self-hosted-runner-from-group-for-org\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-group-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runner-groups\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runners\": {\n      \"get\": {\n        \"summary\": \"List self-hosted runners for an organization\",\n        \"description\": \"Lists all self-hosted runners configured in an organization.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-self-hosted-runners-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"runners\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"runners\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/runner\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runners/downloads\": {\n      \"get\": {\n        \"summary\": \"List runner applications for an organization\",\n        \"description\": \"Lists binaries for the runner application that you can download and run.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-runner-applications-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-runner-applications-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/runner-application\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-application-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runners/registration-token\": {\n      \"post\": {\n        \"summary\": \"Create a registration token for an organization\",\n        \"description\": \"Returns a token that you can pass to the `config` script. The token expires after one hour.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\\n\\n#### Example using registration token\\n\\nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\\n\\n```\\n./config.sh --url https://github.com/octo-org --token TOKEN\\n```\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/create-registration-token-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-registration-token-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authentication-token\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authentication-token\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runners/remove-token\": {\n      \"post\": {\n        \"summary\": \"Create a remove token for an organization\",\n        \"description\": \"Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\\n\\n#### Example using remove token\\n\\nTo remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this\\nendpoint.\\n\\n```\\n./config.sh remove --token TOKEN\\n```\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/create-remove-token-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-remove-token-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authentication-token\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authentication-token-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/runners/{runner_id}\": {\n      \"get\": {\n        \"summary\": \"Get a self-hosted runner for an organization\",\n        \"description\": \"Gets a specific self-hosted runner configured in an organization.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-self-hosted-runner-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a self-hosted runner from an organization\",\n        \"description\": \"Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\\n\\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/delete-self-hosted-runner-from-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-self-hosted-runner-from-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/secrets\": {\n      \"get\": {\n        \"summary\": \"List organization secrets\",\n        \"description\": \"Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-org-secrets\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-organization-secrets\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"secrets\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"secrets\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/organization-actions-secret\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-actions-secret-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/secrets/public-key\": {\n      \"get\": {\n        \"summary\": \"Get an organization public key\",\n        \"description\": \"Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-org-public-key\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-an-organization-public-key\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/actions-public-key\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/actions-public-key\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/secrets/{secret_name}\": {\n      \"get\": {\n        \"summary\": \"Get an organization secret\",\n        \"description\": \"Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-org-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-an-organization-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/organization-actions-secret\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-actions-secret\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Create or update an organization secret\",\n        \"description\": \"Creates or updates an organization secret with an encrypted value. Encrypt your secret using\\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\\ntoken with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to\\nuse this endpoint.\\n\\n#### Example encrypting a secret using Node.js\\n\\nEncrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\\n\\n```\\nconst sodium = require('tweetsodium');\\n\\nconst key = \\\"base64-encoded-public-key\\\";\\nconst value = \\\"plain-text-secret\\\";\\n\\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\\nconst messageBytes = Buffer.from(value);\\nconst keyBytes = Buffer.from(key, 'base64');\\n\\n// Encrypt using LibSodium.\\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\\n\\n// Base64 the encrypted secret\\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\\n\\nconsole.log(encrypted);\\n```\\n\\n\\n#### Example encrypting a secret using Python\\n\\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\\n\\n```\\nfrom base64 import b64encode\\nfrom nacl import encoding, public\\n\\ndef encrypt(public_key: str, secret_value: str) -> str:\\n  \\\"\\\"\\\"Encrypt a Unicode string using the public key.\\\"\\\"\\\"\\n  public_key = public.PublicKey(public_key.encode(\\\"utf-8\\\"), encoding.Base64Encoder())\\n  sealed_box = public.SealedBox(public_key)\\n  encrypted = sealed_box.encrypt(secret_value.encode(\\\"utf-8\\\"))\\n  return b64encode(encrypted).decode(\\\"utf-8\\\")\\n```\\n\\n#### Example encrypting a secret using C#\\n\\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\\n\\n```\\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\\\"mySecret\\\");\\nvar publicKey = Convert.FromBase64String(\\\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\\\");\\n\\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\\n\\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\\n```\\n\\n#### Example encrypting a secret using Ruby\\n\\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\\n\\n```ruby\\nrequire \\\"rbnacl\\\"\\nrequire \\\"base64\\\"\\n\\nkey = Base64.decode64(\\\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\\\")\\npublic_key = RbNaCl::PublicKey.new(key)\\n\\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\\nencrypted_secret = box.encrypt(\\\"my_secret\\\")\\n\\n# Print the base64 encoded secret\\nputs Base64.strict_encode64(encrypted_secret)\\n```\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/create-or-update-org-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"encrypted_value\": {\n                    \"type\": \"string\",\n                    \"description\": \"Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-an-organization-public-key) endpoint.\",\n                    \"pattern\": \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$\"\n                  },\n                  \"key_id\": {\n                    \"type\": \"string\",\n                    \"description\": \"ID of the key you used to encrypt the secret.\"\n                  },\n                  \"visibility\": {\n                    \"type\": \"string\",\n                    \"description\": \"Configures the access that repositories have to the organization secret. Can be one of:  \\n\\\\- `all` - All repositories in an organization can access the secret.  \\n\\\\- `private` - Private repositories in an organization can access the secret.  \\n\\\\- `selected` - Only specific repositories can access the secret.\",\n                    \"enum\": [\n                      \"all\",\n                      \"private\",\n                      \"selected\"\n                    ]\n                  },\n                  \"selected_repository_ids\": {\n                    \"type\": \"array\",\n                    \"description\": \"An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"visibility\"\n                ]\n              },\n              \"example\": {\n                \"encrypted_value\": \"c2VjcmV0\",\n                \"key_id\": \"012345678912345678\",\n                \"visibility\": \"selected\",\n                \"selected_repository_ids\": [\n                  \"1296269\",\n                  \"1296280\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response when creating a secret\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/empty-object\"\n                }\n              }\n            }\n          },\n          \"204\": {\n            \"description\": \"Response when updating a secret\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete an organization secret\",\n        \"description\": \"Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/delete-org-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-an-organization-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/secrets/{secret_name}/repositories\": {\n      \"get\": {\n        \"summary\": \"List selected repositories for an organization secret\",\n        \"description\": \"Lists all repositories that have been selected when the `visibility` for repository access to a secret is set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-selected-repos-for-org-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-selected-repositories-for-an-organization-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"repositories\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"repositories\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/minimal-repository\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/public-repository-paginated\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set selected repositories for an organization secret\",\n        \"description\": \"Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/set-selected-repos-for-org-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-for-an-organization-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"selected_repository_ids\": {\n                    \"type\": \"array\",\n                    \"description\": \"An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints.\",\n                    \"items\": {\n                      \"type\": \"integer\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"selected_repository_ids\"\n                ]\n              },\n              \"example\": {\n                \"selected_repository_ids\": [\n                  64780797\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      }\n    },\n    \"/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\": {\n      \"put\": {\n        \"summary\": \"Add selected repository to an organization secret\",\n        \"description\": \"Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/add-selected-repo-to-org-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-selected-repository-to-an-organization-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          },\n          {\n            \"name\": \"repository_id\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"No Content when repository was added to the selected list\"\n          },\n          \"409\": {\n            \"description\": \"Conflict when visibility type is not set to selected\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove selected repository from an organization secret\",\n        \"description\": \"Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/remove-selected-repo-from-org-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-selected-repository-from-an-organization-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          },\n          {\n            \"name\": \"repository_id\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response when repository was removed from the selected list\"\n          },\n          \"409\": {\n            \"description\": \"Conflict when visibility type not set to selected\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      }\n    },\n    \"/orgs/{org}/events\": {\n      \"get\": {\n        \"summary\": \"List public organization events\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-public-org-events\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-organization-events\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/orgs/{org}/hooks\": {\n      \"get\": {\n        \"summary\": \"List organization webhooks\",\n        \"description\": \"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list-webhooks\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organization-webhooks\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/org-hook\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-hook-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create an organization webhook\",\n        \"description\": \"Here's how you can create a hook that posts payloads in JSON format:\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/create-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#create-an-organization-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"Must be passed as \\\"web\\\".\"\n                  },\n                  \"config\": {\n                    \"type\": \"object\",\n                    \"description\": \"Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#create-hook-config-params).\",\n                    \"properties\": {\n                      \"url\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-url\"\n                      },\n                      \"content_type\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                      },\n                      \"secret\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                      },\n                      \"insecure_ssl\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                      },\n                      \"username\": {\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"\\\"kdaigle\\\"\"\n                        ]\n                      },\n                      \"password\": {\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"\\\"password\\\"\"\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"url\"\n                    ]\n                  },\n                  \"events\": {\n                    \"type\": \"array\",\n                    \"description\": \"Determines what [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads) the hook is triggered for.\",\n                    \"default\": [\n                      \"push\"\n                    ],\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"active\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.\",\n                    \"default\": true\n                  }\n                },\n                \"required\": [\n                  \"name\",\n                  \"config\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"web\",\n                \"active\": true,\n                \"events\": [\n                  \"push\",\n                  \"pull_request\"\n                ],\n                \"config\": {\n                  \"url\": \"http://example.com/webhook\",\n                  \"content_type\": \"json\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-hook\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/orgs/octocat/hooks/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/orgs/{org}/hooks/{hook_id}\": {\n      \"get\": {\n        \"summary\": \"Get an organization webhook\",\n        \"description\": \"Returns a webhook configured in an organization. To get only the webhook `config` properties, see \\\"[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization).\\\"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/get-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-an-organization-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-hook\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update an organization webhook\",\n        \"description\": \"Updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use \\\"[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization).\\\"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/update-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#update-an-organization-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"config\": {\n                    \"type\": \"object\",\n                    \"description\": \"Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#update-hook-config-params).\",\n                    \"properties\": {\n                      \"url\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-url\"\n                      },\n                      \"content_type\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                      },\n                      \"secret\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                      },\n                      \"insecure_ssl\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                      }\n                    },\n                    \"required\": [\n                      \"url\"\n                    ]\n                  },\n                  \"events\": {\n                    \"type\": \"array\",\n                    \"description\": \"Determines what [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads) the hook is triggered for.\",\n                    \"default\": [\n                      \"push\"\n                    ],\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"active\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.\",\n                    \"default\": true\n                  },\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"\\\"web\\\"\"\n                    ]\n                  }\n                }\n              },\n              \"example\": {\n                \"active\": true,\n                \"events\": [\n                  \"pull_request\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-hook-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete an organization webhook\",\n        \"description\": \"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/delete-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#delete-an-organization-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/orgs/{org}/hooks/{hook_id}/config\": {\n      \"get\": {\n        \"summary\": \"Get a webhook configuration for an organization\",\n        \"description\": \"Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use \\\"[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook).\\\"\\n\\nAccess tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/get-webhook-config-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-a-webhook-configuration-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/webhook-config\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/webhook-config\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a webhook configuration for an organization\",\n        \"description\": \"Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use \\\"[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook).\\\"\\n\\nAccess tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/update-webhook-config-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#update-a-webhook-configuration-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"url\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-url\"\n                  },\n                  \"content_type\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                  },\n                  \"secret\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                  },\n                  \"insecure_ssl\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                  }\n                },\n                \"example\": {\n                  \"content_type\": \"json\",\n                  \"insecure_ssl\": \"0\",\n                  \"secret\": \"********\",\n                  \"url\": \"https://example.com/webhook\"\n                },\n                \"additionalProperties\": false\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/webhook-config\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/webhook-config\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/orgs/{org}/hooks/{hook_id}/pings\": {\n      \"post\": {\n        \"summary\": \"Ping an organization webhook\",\n        \"description\": \"This will trigger a [ping event](https://docs.github.com/enterprise-server@3.0/webhooks/#ping-event) to be sent to the hook.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/ping-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#ping-an-organization-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/orgs/{org}/installation\": {\n      \"get\": {\n        \"summary\": \"Get an organization installation for the authenticated app\",\n        \"description\": \"Enables an authenticated GitHub App to find the organization's installation information.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/get-org-installation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-an-organization-installation-for-the-authenticated-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/installation\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/installation\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/orgs/{org}/installations\": {\n      \"get\": {\n        \"summary\": \"List app installations for an organization\",\n        \"description\": \"Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with `admin:read` scope to use this endpoint.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list-app-installations\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-app-installations-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"installations\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"installations\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/installation\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/installation-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/orgs/{org}/issues\": {\n      \"get\": {\n        \"summary\": \"List organization issues assigned to the authenticated user\",\n        \"description\": \"List issues in an organization assigned to the authenticated user.\\n\\n**Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\\nreason, \\\"Issues\\\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \\\"Issues\\\" endpoints will be an _issue id_. To find out the pull\\nrequest id, use the \\\"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\\\" endpoint.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-organization-issues-assigned-to-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"name\": \"filter\",\n            \"description\": \"Indicates which sorts of issues to return. Can be one of:  \\n\\\\* `assigned`: Issues assigned to you  \\n\\\\* `created`: Issues created by you  \\n\\\\* `mentioned`: Issues mentioning you  \\n\\\\* `subscribed`: Issues you're subscribed to updates for  \\n\\\\* `all` or `repos`: All issues the authenticated user can see, regardless of participation or creation\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"assigned\",\n                \"created\",\n                \"mentioned\",\n                \"subscribed\",\n                \"repos\",\n                \"all\"\n              ],\n              \"default\": \"assigned\"\n            }\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/labels\"\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"What to sort results by. Can be either `created`, `updated`, `comments`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"comments\"\n              ],\n              \"default\": \"created\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/issue\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-with-repo-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"issues\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"machine-man\",\n              \"note\": \"If an issue event is created via a GitHub App, the response will include the `performed_via_github_app` object with\\tinformation about the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo receive the `performed_via_github_app` object in the response, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/members\": {\n      \"get\": {\n        \"summary\": \"List organization members\",\n        \"description\": \"List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list-members\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organization-members\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"name\": \"filter\",\n            \"description\": \"Filter members returned in the list. Can be one of:  \\n\\\\* `2fa_disabled` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners.  \\n\\\\* `all` - All members the authenticated user can see.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"2fa_disabled\",\n                \"all\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"name\": \"role\",\n            \"description\": \"Filter members returned by their role. Can be one of:  \\n\\\\* `all` - All members of the organization, regardless of role.  \\n\\\\* `admin` - Organization owners.  \\n\\\\* `member` - Non-owner organization members.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"all\",\n                \"admin\",\n                \"member\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"302\": {\n            \"description\": \"Response if requester is not an organization member\",\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/orgs/github/public_members\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/orgs/{org}/members/{username}\": {\n      \"get\": {\n        \"summary\": \"Check organization membership for a user\",\n        \"description\": \"Check if a user is, publicly or privately, a member of the organization.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/check-membership-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#check-organization-membership-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response if requester is an organization member and user is a member\"\n          },\n          \"302\": {\n            \"description\": \"Response if requester is not an organization member\",\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/orgs/github/public_members/pezra\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"Not Found if requester is an organization member and user is not a member\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove an organization member\",\n        \"description\": \"Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/remove-member\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-an-organization-member\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/orgs/{org}/memberships/{username}\": {\n      \"get\": {\n        \"summary\": \"Get organization membership for a user\",\n        \"description\": \"In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/get-membership-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-organization-membership-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-membership\"\n                },\n                \"examples\": {\n                  \"response-if-user-has-an-active-admin-membership-with-organization\": {\n                    \"$ref\": \"#/components/examples/org-membership-response-if-user-has-an-active-admin-membership-with-organization\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set organization membership for a user\",\n        \"description\": \"Only authenticated organization owners can add a member to the organization or update the member's role.\\n\\n*   If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-organization-membership-for-a-user) will be `pending` until they accept the invitation.\\n    \\n*   Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.\\n\\n**Rate limits**\\n\\nTo prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/set-membership-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#set-organization-membership-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"role\": {\n                    \"type\": \"string\",\n                    \"description\": \"The role to give the user in the organization. Can be one of:  \\n\\\\* `admin` - The user will become an owner of the organization.  \\n\\\\* `member` - The user will become a non-owner member of the organization.\",\n                    \"enum\": [\n                      \"admin\",\n                      \"member\"\n                    ],\n                    \"default\": \"member\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-membership\"\n                },\n                \"examples\": {\n                  \"response-if-user-already-had-membership-with-organization\": {\n                    \"$ref\": \"#/components/examples/org-membership-response-if-user-has-an-active-admin-membership-with-organization\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove organization membership for a user\",\n        \"description\": \"In order to remove a user's membership with an organization, the authenticated user must be an organization owner.\\n\\nIf the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/remove-membership-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-organization-membership-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/orgs/{org}/outside_collaborators\": {\n      \"get\": {\n        \"summary\": \"List outside collaborators for an organization\",\n        \"description\": \"List all users who are outside collaborators of an organization.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list-outside-collaborators\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-outside-collaborators-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"name\": \"filter\",\n            \"description\": \"Filter the list of outside collaborators. Can be one of:  \\n\\\\* `2fa_disabled`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled.  \\n\\\\* `all`: All outside collaborators.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"2fa_disabled\",\n                \"all\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"outside-collaborators\"\n        }\n      }\n    },\n    \"/orgs/{org}/outside_collaborators/{username}\": {\n      \"put\": {\n        \"summary\": \"Convert an organization member to outside collaborator\",\n        \"description\": \"When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see \\\"[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)\\\".\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/convert-member-to-outside-collaborator\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#convert-an-organization-member-to-outside-collaborator\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"202\": {\n            \"description\": \"User is getting converted asynchronously\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                  },\n                  \"additionalProperties\": false\n                }\n              }\n            }\n          },\n          \"204\": {\n            \"description\": \"User was converted\"\n          },\n          \"403\": {\n            \"description\": \"Forbidden if user is the last owner of the organization or not a member of the organization\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"outside-collaborators\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove outside collaborator from an organization\",\n        \"description\": \"Removing a user from this list will remove them from all the organization's repositories.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/remove-outside-collaborator\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-outside-collaborator-from-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"422\": {\n            \"description\": \"Unprocessable Entity if user is a member of the organization\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"response-if-user-is-a-member-of-the-organization\": {\n                    \"value\": {\n                      \"message\": \"You cannot specify an organization member to remove as an outside collaborator.\",\n                      \"documentation_url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-outside-collaborator\"\n                    }\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"outside-collaborators\"\n        }\n      }\n    },\n    \"/orgs/{org}/pre-receive-hooks\": {\n      \"get\": {\n        \"summary\": \"List pre-receive hooks for an organization\",\n        \"description\": \"List all pre-receive hooks that are enabled or testing for this organization as well as any disabled hooks that can be configured at the organization level. Globally disabled pre-receive hooks that do not allow downstream configuration are not listed.\",\n        \"operationId\": \"enterprise-admin/list-pre-receive-hooks-for-org\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-pre-receive-hooks-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"The sort order for the response collection.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"name\"\n              ],\n              \"default\": \"created\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/org-pre-receive-hook\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-pre-receive-hook-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"org-pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}\": {\n      \"get\": {\n        \"summary\": \"Get a pre-receive hook for an organization\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-pre-receive-hook-for-org\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-pre-receive-hook-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-pre-receive-hook\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"org-pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update pre-receive hook enforcement for an organization\",\n        \"description\": \"For pre-receive hooks which are allowed to be configured at the org level, you can set `enforcement` and `allow_downstream_configuration`\",\n        \"operationId\": \"enterprise-admin/update-pre-receive-hook-enforcement-for-org\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-pre-receive-hook-enforcement-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-pre-receive-hook-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enforcement\": {\n                    \"description\": \"The state of enforcement for the hook on this repository.\",\n                    \"type\": \"string\"\n                  },\n                  \"allow_downstream_configuration\": {\n                    \"description\": \"Whether repositories can override enforcement.\",\n                    \"type\": \"boolean\"\n                  }\n                }\n              },\n              \"example\": {\n                \"enforcement\": \"enabled\",\n                \"allow_downstream_configuration\": false\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"org-pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove pre-receive hook enforcement for an organization\",\n        \"description\": \"Removes any overrides for this hook at the org level for this org.\",\n        \"operationId\": \"enterprise-admin/remove-pre-receive-hook-enforcement-for-org\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#remove-pre-receive-hook-enforcement-for-an-organization\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-pre-receive-hook\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"org-pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/projects\": {\n      \"get\": {\n        \"summary\": \"List organization projects\",\n        \"description\": \"Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/list-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-organization-projects\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/project\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create an organization project\",\n        \"description\": \"Creates an organization project board. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/create-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-an-organization-project\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the project.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The description of the project.\"\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"Organization Roadmap\",\n                \"body\": \"High-level roadmap for the upcoming year.\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/public_members\": {\n      \"get\": {\n        \"summary\": \"List public organization members\",\n        \"description\": \"Members of an organization can choose to have their membership publicized or not.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list-public-members\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-public-organization-members\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/orgs/{org}/public_members/{username}\": {\n      \"get\": {\n        \"summary\": \"Check public organization membership for a user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/check-public-membership-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#check-public-organization-membership-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response if user is a public member\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if user is not a public member\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set public organization membership for the authenticated user\",\n        \"description\": \"The user can publicize their own membership. (A user cannot publicize the membership for another user.)\\n\\nNote that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/set-public-membership-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#set-public-organization-membership-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove public organization membership for the authenticated user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/remove-public-membership-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-public-organization-membership-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/orgs/{org}/repos\": {\n      \"get\": {\n        \"summary\": \"List organization repositories\",\n        \"description\": \"Lists repositories for the specified organization.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-for-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-organization-repositories\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"name\": \"type\",\n            \"description\": \"Specifies the types of repositories you want returned. Can be one of `all`, `public`, `private`, `forks`, `sources`, `member`, `internal`. Note: For GitHub AE, can be one of `all`, `private`, `forks`, `sources`, `member`, `internal`. Default: `all`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `type` can also be `internal`. However, the `internal` value is not yet supported when a GitHub App calls this API with an installation access token.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"all\",\n                \"public\",\n                \"private\",\n                \"forks\",\n                \"sources\",\n                \"member\",\n                \"internal\"\n              ]\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Can be one of `created`, `updated`, `pushed`, `full_name`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"pushed\",\n                \"full_name\"\n              ],\n              \"default\": \"created\"\n            }\n          },\n          {\n            \"name\": \"direction\",\n            \"description\": \"Can be one of `asc` or `desc`. Default: when using `full_name`: `asc`, otherwise `desc`\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"asc\",\n                \"desc\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/minimal-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"nebula\",\n              \"note\": \"You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\\n\\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.nebula-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"baptiste\",\n              \"note\": \"The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.baptiste-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create an organization repository\",\n        \"description\": \"Creates a new repository in the specified organization. The authenticated user must be a member of the organization.\\n\\n**OAuth scope requirements**\\n\\nWhen using [OAuth](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\\n\\n*   `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\\n*   `repo` scope to create a private repository\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-an-organization-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the repository.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A short description of the repository.\"\n                  },\n                  \"homepage\": {\n                    \"type\": \"string\",\n                    \"description\": \"A URL with more information about the repository.\"\n                  },\n                  \"private\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Whether the repository is private.\",\n                    \"default\": false\n                  },\n                  \"visibility\": {\n                    \"type\": \"string\",\n                    \"description\": \"Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. Note: For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise. For more information, see \\\"[Creating an internal repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)\\\" in the GitHub Help documentation.  \\nThe `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header.\",\n                    \"enum\": [\n                      \"public\",\n                      \"private\",\n                      \"internal\"\n                    ]\n                  },\n                  \"has_issues\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to enable issues for this repository or `false` to disable them.\",\n                    \"default\": true\n                  },\n                  \"has_projects\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error.\",\n                    \"default\": true\n                  },\n                  \"has_wiki\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to enable the wiki for this repository or `false` to disable it.\",\n                    \"default\": true\n                  },\n                  \"is_template\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to make this repo available as a template repository or `false` to prevent it.\",\n                    \"default\": false\n                  },\n                  \"team_id\": {\n                    \"type\": \"integer\",\n                    \"description\": \"The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization.\"\n                  },\n                  \"auto_init\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Pass `true` to create an initial commit with empty README.\",\n                    \"default\": false\n                  },\n                  \"gitignore_template\": {\n                    \"type\": \"string\",\n                    \"description\": \"Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, \\\"Haskell\\\".\"\n                  },\n                  \"license_template\": {\n                    \"type\": \"string\",\n                    \"description\": \"Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, \\\"mit\\\" or \\\"mpl-2.0\\\".\"\n                  },\n                  \"allow_squash_merge\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.\",\n                    \"default\": true\n                  },\n                  \"allow_merge_commit\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.\",\n                    \"default\": true\n                  },\n                  \"allow_rebase_merge\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.\",\n                    \"default\": true\n                  },\n                  \"delete_branch_on_merge\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion.\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"Hello-World\",\n                \"description\": \"This is your first repository\",\n                \"homepage\": \"https://github.com\",\n                \"private\": false,\n                \"has_issues\": true,\n                \"has_projects\": true,\n                \"has_wiki\": true\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"nebula\",\n              \"note\": \"You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\\n\\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.nebula-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"baptiste\",\n              \"note\": \"The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.baptiste-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/teams\": {\n      \"get\": {\n        \"summary\": \"List teams\",\n        \"description\": \"Lists all teams in an organization that are visible to the authenticated user.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-teams\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a team\",\n        \"description\": \"To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see \\\"[Setting team creation permissions](https://docs.github.com/en/articles/setting-team-creation-permissions-in-your-organization).\\\"\\n\\nWhen you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see \\\"[About teams](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)\\\".\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/create\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-team\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the team.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"The description of the team.\"\n                  },\n                  \"maintainers\": {\n                    \"type\": \"array\",\n                    \"description\": \"List GitHub IDs for organization members who will become team maintainers.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"repo_names\": {\n                    \"type\": \"array\",\n                    \"description\": \"The full name (e.g., \\\"organization-name/repository-name\\\") of repositories to add the team to.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"privacy\": {\n                    \"type\": \"string\",\n                    \"description\": \"The level of privacy this team should have. The options are:  \\n**For a non-nested team:**  \\n\\\\* `secret` - only visible to organization owners and members of this team.  \\n\\\\* `closed` - visible to all members of this organization.  \\nDefault: `secret`  \\n**For a parent or child team:**  \\n\\\\* `closed` - visible to all members of this organization.  \\nDefault for child team: `closed`\",\n                    \"enum\": [\n                      \"secret\",\n                      \"closed\"\n                    ]\n                  },\n                  \"permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of:  \\n\\\\* `pull` - team members can pull, but not push to or administer newly-added repositories.  \\n\\\\* `push` - team members can pull and push, but not administer newly-added repositories.\",\n                    \"enum\": [\n                      \"pull\",\n                      \"push\"\n                    ],\n                    \"default\": \"pull\"\n                  },\n                  \"parent_team_id\": {\n                    \"type\": \"integer\",\n                    \"description\": \"The ID of a team to set as the parent team.\"\n                  },\n                  \"ldap_dn\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the \\\"[Update LDAP mapping for a team](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-ldap-mapping-for-a-team)\\\" endpoint to change the LDAP DN. For more information, see \\\"[Using LDAP](https://docs.github.com/enterprise-server@3.0/admin/identity-and-access-management/authenticating-users-for-your-github-enterprise-server-instance/using-ldap#enabling-ldap-sync).\\\"\"\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"Justice League\",\n                \"description\": \"A great team\",\n                \"permission\": \"push\",\n                \"privacy\": \"closed\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-full\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-full\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}\": {\n      \"get\": {\n        \"summary\": \"Get a team by name\",\n        \"description\": \"Gets a team using the team's `slug`. GitHub Enterprise Server generates the `slug` from the team `name`.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-by-name\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-team-by-name\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-full\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-full\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a team\",\n        \"description\": \"To edit a team, the authenticated user must either be an organization owner or a team maintainer.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/update-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-team\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the team.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"The description of the team.\"\n                  },\n                  \"privacy\": {\n                    \"type\": \"string\",\n                    \"description\": \"The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. When a team is nested, the `privacy` for parent teams cannot be `secret`. The options are:  \\n**For a non-nested team:**  \\n\\\\* `secret` - only visible to organization owners and members of this team.  \\n\\\\* `closed` - visible to all members of this organization.  \\n**For a parent or child team:**  \\n\\\\* `closed` - visible to all members of this organization.\",\n                    \"enum\": [\n                      \"secret\",\n                      \"closed\"\n                    ]\n                  },\n                  \"permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of:  \\n\\\\* `pull` - team members can pull, but not push to or administer newly-added repositories.  \\n\\\\* `push` - team members can pull and push, but not administer newly-added repositories.  \\n\\\\* `admin` - team members can pull, push and administer newly-added repositories.\",\n                    \"enum\": [\n                      \"pull\",\n                      \"push\",\n                      \"admin\"\n                    ],\n                    \"default\": \"pull\"\n                  },\n                  \"parent_team_id\": {\n                    \"type\": [\n                      \"integer\",\n                      \"null\"\n                    ],\n                    \"description\": \"The ID of a team to set as the parent team.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"name\": \"new team name\",\n                \"description\": \"new team description\",\n                \"privacy\": \"closed\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-full\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-full\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a team\",\n        \"description\": \"To delete a team, the authenticated user must be an organization owner or team maintainer.\\n\\nIf you are an organization owner, deleting a parent team will delete all of its child teams as well.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/delete-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-team\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/discussions\": {\n      \"get\": {\n        \"summary\": \"List discussions\",\n        \"description\": \"List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-discussions-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"name\": \"pinned\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"description\": \"Pinned discussions only filter\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team-discussion\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a discussion\",\n        \"description\": \"Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/create-discussion-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion post's title.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion post's body text.\"\n                  },\n                  \"private\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post.\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"title\",\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"title\": \"Our first team post\",\n                \"body\": \"Hi! This is an area for us to collaborate as a team.\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\": {\n      \"get\": {\n        \"summary\": \"Get a discussion\",\n        \"description\": \"Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-discussion-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a discussion\",\n        \"description\": \"Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/update-discussion-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion post's title.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion post's body text.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"title\": \"Welcome to our first team post\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a discussion\",\n        \"description\": \"Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/delete-discussion-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\"\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\": {\n      \"get\": {\n        \"summary\": \"List discussion comments\",\n        \"description\": \"List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-discussion-comments-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussion-comments\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team-discussion-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a discussion comment\",\n        \"description\": \"Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/create-discussion-comment-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion comment's body text.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Do you like apples?\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-comment\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\": {\n      \"get\": {\n        \"summary\": \"Get a discussion comment\",\n        \"description\": \"Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-discussion-comment-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-comment\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a discussion comment\",\n        \"description\": \"Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/update-discussion-comment-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion comment's body text.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Do you like pineapples?\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-comment-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a discussion comment\",\n        \"description\": \"Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/delete-discussion-comment-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\"\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\": {\n      \"get\": {\n        \"summary\": \"List reactions for a team discussion comment\",\n        \"description\": \"List the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/list-for-team-discussion-comment-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-team-discussion-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          },\n          {\n            \"name\": \"content\",\n            \"description\": \"Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"+1\",\n                \"-1\",\n                \"laugh\",\n                \"confused\",\n                \"heart\",\n                \"hooray\",\n                \"rocket\",\n                \"eyes\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/reaction\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create reaction for a team discussion comment\",\n        \"description\": \"Create a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/create-for-team-discussion-comment-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-team-discussion-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the team discussion comment.\",\n                    \"enum\": [\n                      \"+1\",\n                      \"-1\",\n                      \"laugh\",\n                      \"confused\",\n                      \"heart\",\n                      \"hooray\",\n                      \"rocket\",\n                      \"eyes\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"heart\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\": {\n      \"delete\": {\n        \"summary\": \"Delete team discussion comment reaction\",\n        \"description\": \"**Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.\\n\\nDelete a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/delete-for-team-discussion-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-team-discussion-comment-reaction\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/reaction-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\": {\n      \"get\": {\n        \"summary\": \"List reactions for a team discussion\",\n        \"description\": \"List the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/list-for-team-discussion-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-team-discussion\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"name\": \"content\",\n            \"description\": \"Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"+1\",\n                \"-1\",\n                \"laugh\",\n                \"confused\",\n                \"heart\",\n                \"hooray\",\n                \"rocket\",\n                \"eyes\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/reaction\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create reaction for a team discussion\",\n        \"description\": \"Create a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/create-for-team-discussion-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-team-discussion\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the team discussion.\",\n                    \"enum\": [\n                      \"+1\",\n                      \"-1\",\n                      \"laugh\",\n                      \"confused\",\n                      \"heart\",\n                      \"hooray\",\n                      \"rocket\",\n                      \"eyes\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"heart\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\": {\n      \"delete\": {\n        \"summary\": \"Delete team discussion reaction\",\n        \"description\": \"**Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.\\n\\nDelete a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/delete-for-team-discussion\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-team-discussion-reaction\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/reaction-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/members\": {\n      \"get\": {\n        \"summary\": \"List team members\",\n        \"description\": \"Team members will include the members of child teams.\\n\\nTo list members in a team, the team must be visible to the authenticated user.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-members-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-members\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"name\": \"role\",\n            \"description\": \"Filters members returned by their role in the team. Can be one of:  \\n\\\\* `member` - normal members of the team.  \\n\\\\* `maintainer` - team maintainers.  \\n\\\\* `all` - all members of the team.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"member\",\n                \"maintainer\",\n                \"all\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/memberships/{username}\": {\n      \"get\": {\n        \"summary\": \"Get team membership for a user\",\n        \"description\": \"Team members will include the members of child teams.\\n\\nTo get a user's membership with a team, the team must be visible to the authenticated user.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.\\n\\n**Note:**\\nThe response contains the `state` of the membership and the member's `role`.\\n\\nThe `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see see [Create a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-team).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-membership-for-user-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-membership-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-membership\"\n                },\n                \"examples\": {\n                  \"response-if-user-is-a-team-maintainer\": {\n                    \"$ref\": \"#/components/examples/team-membership-response-if-user-is-a-team-maintainer\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"if user has no team membership\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Add or update team membership for a user\",\n        \"description\": \"Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nAdds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.\\n\\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \\\"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\\\"\\n\\nAn organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the \\\"pending\\\" state until the person accepts the invitation, at which point the membership will transition to the \\\"active\\\" state and the user will be added as a member of the team.\\n\\nIf the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/add-or-update-membership-for-user-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-membership-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"role\": {\n                    \"type\": \"string\",\n                    \"description\": \"The role that this user should have in the team. Can be one of:  \\n\\\\* `member` - a normal member of the team.  \\n\\\\* `maintainer` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description.\",\n                    \"enum\": [\n                      \"member\",\n                      \"maintainer\"\n                    ],\n                    \"default\": \"member\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-membership\"\n                },\n                \"examples\": {\n                  \"response-if-users-membership-with-team-is-now-pending\": {\n                    \"$ref\": \"#/components/examples/team-membership-response-if-users-membership-with-team-is-now-pending\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"description\": \"Forbidden if team synchronization is set up\"\n          },\n          \"422\": {\n            \"description\": \"Unprocessable Entity if you attempt to add an organization to a team\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove team membership for a user\",\n        \"description\": \"Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nTo remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.\\n\\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \\\"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\\\"\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/remove-membership-for-user-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-membership-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"description\": \"Forbidden if team synchronization is set up\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/projects\": {\n      \"get\": {\n        \"summary\": \"List team projects\",\n        \"description\": \"Lists the organization projects for a team.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-projects-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-projects\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team-project\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-project-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/projects/{project_id}\": {\n      \"get\": {\n        \"summary\": \"Check team permissions for a project\",\n        \"description\": \"Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/check-permissions-for-project-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#check-team-permissions-for-a-project\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-project\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-project\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"Not Found if project is not managed by this team\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"put\": {\n        \"summary\": \"Add or update team project permissions\",\n        \"description\": \"Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/add-or-update-project-permissions-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-project-permissions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"The permission to grant to the team for this project. Can be one of:  \\n\\\\* `read` - team members can read, but not write to or administer this project.  \\n\\\\* `write` - team members can read and write, but not administer this project.  \\n\\\\* `admin` - team members can read, write and administer this project.  \\nDefault: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n                    \"enum\": [\n                      \"read\",\n                      \"write\",\n                      \"admin\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"description\": \"Forbidden if the project is not owned by the organization\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"response-if-the-project-is-not-owned-by-the-organization\": {\n                    \"value\": {\n                      \"message\": \"Must have admin rights to Repository.\",\n                      \"documentation_url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-project-permissions\"\n                    }\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove a project from a team\",\n        \"description\": \"Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/remove-project-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-a-project-from-a-team\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/repos\": {\n      \"get\": {\n        \"summary\": \"List team repositories\",\n        \"description\": \"Lists a team's repositories visible to the authenticated user.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-repos-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-repositories\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/minimal-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\": {\n      \"get\": {\n        \"summary\": \"Check team permissions for a repository\",\n        \"description\": \"Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.\\n\\nYou can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header.\\n\\nIf a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/check-permissions-for-repo-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#check-team-permissions-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Alternative response with repository permissions\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-repository\"\n                },\n                \"examples\": {\n                  \"alternative-response-with-repository-permissions\": {\n                    \"$ref\": \"#/components/examples/team-repository-alternative-response-with-repository-permissions\"\n                  }\n                }\n              }\n            }\n          },\n          \"204\": {\n            \"description\": \"Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header.\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if team does not have permission for the repository\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      },\n      \"put\": {\n        \"summary\": \"Add or update team repository permissions\",\n        \"description\": \"To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.\\n\\nFor more information about the permission levels, see \\\"[Repository permission levels for an organization](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)\\\".\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/add-or-update-repo-permissions-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#add-or-update-team-repository-permissions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"The permission to grant the team on this repository. Can be one of:  \\n\\\\* `pull` - team members can pull, but not push to or administer this repository.  \\n\\\\* `push` - team members can pull and push, but not administer this repository.  \\n\\\\* `admin` - team members can pull, push and administer this repository.  \\n\\\\* `maintain` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations.  \\n\\\\* `triage` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations.  \\n  \\nIf no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository.\",\n                    \"enum\": [\n                      \"pull\",\n                      \"push\",\n                      \"admin\",\n                      \"maintain\",\n                      \"triage\"\n                    ],\n                    \"default\": \"push\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove a repository from a team\",\n        \"description\": \"If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/remove-repo-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#remove-a-repository-from-a-team\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/orgs/{org}/teams/{team_slug}/teams\": {\n      \"get\": {\n        \"summary\": \"List child teams\",\n        \"description\": \"Lists the child teams of the team specified by `{team_slug}`.\\n\\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-child-in-org\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-child-teams\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/team-slug\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"if child teams exist\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team\"\n                  }\n                },\n                \"examples\": {\n                  \"response-if-child-teams-exist\": {\n                    \"$ref\": \"#/components/examples/team-items-response-if-child-teams-exist\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/projects/columns/cards/{card_id}\": {\n      \"get\": {\n        \"summary\": \"Get a project card\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/get-card\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#get-a-project-card\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/card-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project-card\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-card\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"cards\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update an existing project card\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/update-card\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#update-a-project-card\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/card-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"note\": {\n                    \"description\": \"The project card's note\",\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"examples\": [\n                      \"Update all gems\"\n                    ]\n                  },\n                  \"archived\": {\n                    \"description\": \"Whether or not the card is archived\",\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      false\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project-card\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-card\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"cards\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a project card\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/delete-card\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#delete-a-project-card\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/card-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"description\": \"Forbidden\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"string\"\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"cards\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/columns/cards/{card_id}/moves\": {\n      \"post\": {\n        \"summary\": \"Move a project card\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/move-card\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#move-a-project-card\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/card-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"position\": {\n                    \"description\": \"The position of the card in a column. Can be one of: `top`, `bottom`, or `after:<card_id>` to place after the specified card.\",\n                    \"type\": \"string\",\n                    \"pattern\": \"^(?:top|bottom|after:\\\\d+)$\",\n                    \"examples\": [\n                      \"bottom\"\n                    ]\n                  },\n                  \"column_id\": {\n                    \"description\": \"The unique identifier of the column the card should be moved to\",\n                    \"type\": \"integer\",\n                    \"examples\": [\n                      42\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"position\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                  },\n                  \"additionalProperties\": false\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"description\": \"Forbidden\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                          \"code\": {\n                            \"type\": \"string\"\n                          },\n                          \"message\": {\n                            \"type\": \"string\"\n                          },\n                          \"resource\": {\n                            \"type\": \"string\"\n                          },\n                          \"field\": {\n                            \"type\": \"string\"\n                          }\n                        }\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"503\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"code\": {\n                      \"type\": \"string\"\n                    },\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                          \"code\": {\n                            \"type\": \"string\"\n                          },\n                          \"message\": {\n                            \"type\": \"string\"\n                          }\n                        }\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"cards\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/columns/{column_id}\": {\n      \"get\": {\n        \"summary\": \"Get a project column\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/get-column\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#get-a-project-column\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/column-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project-column\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-column\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"columns\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update an existing project column\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/update-column\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#update-a-project-column\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/column-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"Name of the project column\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Remaining tasks\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project-column\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-column\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"columns\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a project column\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/delete-column\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#delete-a-project-column\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/column-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"columns\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/columns/{column_id}/cards\": {\n      \"get\": {\n        \"summary\": \"List project cards\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/list-cards\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-project-cards\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/column-id\"\n          },\n          {\n            \"name\": \"archived_state\",\n            \"description\": \"Filters the project cards that are returned by the card's state. Can be one of `all`,`archived`, or `not_archived`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"all\",\n                \"archived\",\n                \"not_archived\"\n              ],\n              \"default\": \"not_archived\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/project-card\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-card-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"cards\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a project card\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/create-card\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-a-project-card\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/column-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"note\": {\n                        \"description\": \"The project card's note\",\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ],\n                        \"examples\": [\n                          \"Update all gems\"\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"note\"\n                    ]\n                  },\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"content_id\": {\n                        \"description\": \"The unique identifier of the content associated with the card\",\n                        \"type\": \"integer\",\n                        \"examples\": [\n                          42\n                        ]\n                      },\n                      \"content_type\": {\n                        \"description\": \"The piece of content associated with the card\",\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"PullRequest\"\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"content_id\",\n                      \"content_type\"\n                    ]\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project-card\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-card\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"422\": {\n            \"description\": \"Validation failed\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"oneOf\": [\n                    {\n                      \"$ref\": \"#/components/schemas/validation-error\"\n                    },\n                    {\n                      \"$ref\": \"#/components/schemas/validation-error-simple\"\n                    }\n                  ]\n                }\n              }\n            }\n          },\n          \"503\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"code\": {\n                      \"type\": \"string\"\n                    },\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                          \"code\": {\n                            \"type\": \"string\"\n                          },\n                          \"message\": {\n                            \"type\": \"string\"\n                          }\n                        }\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"cards\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/columns/{column_id}/moves\": {\n      \"post\": {\n        \"summary\": \"Move a project column\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/move-column\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#move-a-project-column\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/column-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"position\": {\n                    \"description\": \"The position of the column in a project. Can be one of: `first`, `last`, or `after:<column_id>` to place after the specified column.\",\n                    \"type\": \"string\",\n                    \"pattern\": \"^(?:first|last|after:\\\\d+)$\",\n                    \"examples\": [\n                      \"last\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"position\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                  },\n                  \"additionalProperties\": false\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"columns\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/{project_id}\": {\n      \"get\": {\n        \"summary\": \"Get a project\",\n        \"description\": \"Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#get-a-project\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-3\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a project\",\n        \"description\": \"Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.\",\n        \"operationId\": \"projects/update\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#update-a-project\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"Name of the project\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Week One Sprint\"\n                    ]\n                  },\n                  \"body\": {\n                    \"description\": \"Body of the project\",\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"examples\": [\n                      \"This project represents the sprint of the first week in January\"\n                    ]\n                  },\n                  \"state\": {\n                    \"description\": \"State of the project; either 'open' or 'closed'\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"open\"\n                    ]\n                  },\n                  \"organization_permission\": {\n                    \"description\": \"The baseline permission that all organization members have on this project\",\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"read\",\n                      \"write\",\n                      \"admin\",\n                      \"none\"\n                    ]\n                  },\n                  \"private\": {\n                    \"description\": \"Whether or not this project can be seen by everyone.\",\n                    \"type\": \"boolean\"\n                  }\n                },\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-3\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"Not Found if the authenticated user does not have access to the project\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"description\": \"Forbidden\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"string\"\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a project\",\n        \"description\": \"Deletes a project board. Returns a `404 Not Found` status if projects are disabled.\",\n        \"operationId\": \"projects/delete\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#delete-a-project\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Delete Success\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"description\": \"Forbidden\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"errors\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"string\"\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/{project_id}/collaborators\": {\n      \"get\": {\n        \"summary\": \"List project collaborators\",\n        \"description\": \"Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/list-collaborators\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-project-collaborators\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          },\n          {\n            \"name\": \"affiliation\",\n            \"description\": \"Filters the collaborators by their affiliation. Can be one of:  \\n\\\\* `outside`: Outside collaborators of a project that are not a member of the project's organization.  \\n\\\\* `direct`: Collaborators with permissions to a project, regardless of organization membership status.  \\n\\\\* `all`: All collaborators the authenticated user can see.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"outside\",\n                \"direct\",\n                \"all\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"collaborators\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/{project_id}/collaborators/{username}\": {\n      \"put\": {\n        \"summary\": \"Add project collaborator\",\n        \"description\": \"Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/add-collaborator\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#add-project-collaborator\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"permission\": {\n                    \"description\": \"The permission to grant the collaborator.\",\n                    \"enum\": [\n                      \"read\",\n                      \"write\",\n                      \"admin\"\n                    ],\n                    \"default\": \"write\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"write\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"collaborators\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove user as a collaborator\",\n        \"description\": \"Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/remove-collaborator\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#remove-project-collaborator\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"collaborators\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/{project_id}/collaborators/{username}/permission\": {\n      \"get\": {\n        \"summary\": \"Get project permission for a user\",\n        \"description\": \"Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/get-permission-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#get-project-permission-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project-collaborator-permission\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-collaborator-permission\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"collaborators\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/projects/{project_id}/columns\": {\n      \"get\": {\n        \"summary\": \"List project columns\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/list-columns\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-project-columns\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/project-column\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-column-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"columns\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a project column\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/create-column\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-a-project-column\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"Name of the project column\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Remaining tasks\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project-column\"\n                },\n                \"example\": {\n                  \"url\": \"https://api.github.com/projects/columns/367\",\n                  \"project_url\": \"https://api.github.com/projects/120\",\n                  \"cards_url\": \"https://api.github.com/projects/columns/367/cards\",\n                  \"id\": 367,\n                  \"node_id\": \"MDEzOlByb2plY3RDb2x1bW4zNjc=\",\n                  \"name\": \"To Do\",\n                  \"created_at\": \"2016-09-05T14:18:44Z\",\n                  \"updated_at\": \"2016-09-05T14:22:28Z\"\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"subcategory\": \"columns\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/rate_limit\": {\n      \"get\": {\n        \"summary\": \"Get rate limit status for the authenticated user\",\n        \"description\": \"**Note:** Accessing this endpoint does not count against your REST API rate limit.\\n\\n**Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object.\",\n        \"tags\": [\n          \"rate-limit\"\n        ],\n        \"operationId\": \"rate-limit/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/rate-limit#get-rate-limit-status-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/rate-limit-overview\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/rate-limit-overview\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"X-RateLimit-Limit\": {\n                \"$ref\": \"#/components/headers/x-rate-limit-limit\"\n              },\n              \"X-RateLimit-Remaining\": {\n                \"$ref\": \"#/components/headers/x-rate-limit-remaining\"\n              },\n              \"X-RateLimit-Reset\": {\n                \"$ref\": \"#/components/headers/x-rate-limit-reset\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"rate-limit\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/reactions/{reaction_id}\": {\n      \"delete\": {\n        \"summary\": \"Delete a reaction (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/).\\n\\nOAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/delete-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#delete-a-reaction-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/reaction-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-21\",\n          \"deprecationDate\": \"2020-02-26\",\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/repos/{owner}/{repo}\": {\n      \"get\": {\n        \"summary\": \"Get a repository\",\n        \"description\": \"When you pass the `scarlet-witch-preview` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file.\\n\\nThe `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/full-repository\"\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/full-repository-default-response\"\n                  },\n                  \"response-with-scarlet-witch-preview-media-type\": {\n                    \"$ref\": \"#/components/examples/full-repository-response-with-scarlet-witch-preview-media-type\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"301\": {\n            \"$ref\": \"#/components/responses/moved_permanently\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"nebula\",\n              \"note\": \"You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\\n\\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.nebula-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"scarlet-witch\",\n              \"note\": \"The Codes of Conduct API is currently available for developers to preview.\\n\\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.scarlet-witch-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a repository\",\n        \"description\": \"**Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#replace-all-repository-topics) endpoint.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos/#update-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the repository.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A short description of the repository.\"\n                  },\n                  \"homepage\": {\n                    \"type\": \"string\",\n                    \"description\": \"A URL with more information about the repository.\"\n                  },\n                  \"private\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to make the repository private or `false` to make it public. Default: `false`.  \\n**Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private.\",\n                    \"default\": false\n                  },\n                  \"visibility\": {\n                    \"type\": \"string\",\n                    \"description\": \"Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`.\\\"\",\n                    \"enum\": [\n                      \"public\",\n                      \"private\",\n                      \"internal\"\n                    ]\n                  },\n                  \"has_issues\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to enable issues for this repository or `false` to disable them.\",\n                    \"default\": true\n                  },\n                  \"has_projects\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error.\",\n                    \"default\": true\n                  },\n                  \"has_wiki\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to enable the wiki for this repository or `false` to disable it.\",\n                    \"default\": true\n                  },\n                  \"is_template\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to make this repo available as a template repository or `false` to prevent it.\",\n                    \"default\": false\n                  },\n                  \"default_branch\": {\n                    \"type\": \"string\",\n                    \"description\": \"Updates the default branch for this repository.\"\n                  },\n                  \"allow_squash_merge\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.\",\n                    \"default\": true\n                  },\n                  \"allow_merge_commit\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.\",\n                    \"default\": true\n                  },\n                  \"allow_rebase_merge\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.\",\n                    \"default\": true\n                  },\n                  \"delete_branch_on_merge\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion.\",\n                    \"default\": false\n                  },\n                  \"archived\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"`true` to archive this repository. **Note**: You cannot unarchive repositories through the API.\",\n                    \"default\": false\n                  },\n                  \"allow_forking\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to allow private forks, or `false` to prevent private forks.\",\n                    \"default\": false\n                  }\n                }\n              },\n              \"example\": {\n                \"name\": \"Hello-World\",\n                \"description\": \"This is your first repository\",\n                \"homepage\": \"https://github.com\",\n                \"private\": true,\n                \"has_issues\": true,\n                \"has_projects\": true,\n                \"has_wiki\": true\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/full-repository\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/full-repository\"\n                  }\n                }\n              }\n            }\n          },\n          \"307\": {\n            \"$ref\": \"#/components/responses/temporary_redirect\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"nebula\",\n              \"note\": \"You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\\n\\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.nebula-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"baptiste\",\n              \"note\": \"The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.baptiste-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a repository\",\n        \"description\": \"Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.\\n\\nIf an organization owner has configured the organization to prevent members from deleting organization-owned\\nrepositories, you will get a `403 Forbidden` response.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"description\": \"If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response:\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"example\": {\n                  \"message\": \"Organization members cannot delete repositories.\",\n                  \"documentation_url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-repository\"\n                }\n              }\n            }\n          },\n          \"307\": {\n            \"$ref\": \"#/components/responses/temporary_redirect\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/artifacts\": {\n      \"get\": {\n        \"summary\": \"List artifacts for a repository\",\n        \"description\": \"Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-artifacts-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-artifacts-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"artifacts\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"artifacts\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/artifact\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/artifact-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"artifacts\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/artifacts/{artifact_id}\": {\n      \"get\": {\n        \"summary\": \"Get an artifact\",\n        \"description\": \"Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-artifact\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-an-artifact\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/artifact-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/artifact\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/artifact\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"artifacts\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete an artifact\",\n        \"description\": \"Deletes an artifact for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/delete-artifact\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-an-artifact\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/artifact-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"artifacts\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\": {\n      \"get\": {\n        \"summary\": \"Download an artifact\",\n        \"description\": \"Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in\\nthe response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to\\nthe repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.\\nGitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/download-artifact\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#download-an-artifact\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/artifact-id\"\n          },\n          {\n            \"name\": \"archive_format\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"302\": {\n            \"description\": \"Response\",\n            \"headers\": {\n              \"Location\": {\n                \"$ref\": \"#/components/headers/location\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"artifacts\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/jobs/{job_id}\": {\n      \"get\": {\n        \"summary\": \"Get a job for a workflow run\",\n        \"description\": \"Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-job-for-workflow-run\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-job-for-a-workflow-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/job-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/job\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/job\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-jobs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/jobs/{job_id}/logs\": {\n      \"get\": {\n        \"summary\": \"Download job logs for a workflow run\",\n        \"description\": \"Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look\\nfor `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can\\nuse this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must\\nhave the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/download-job-logs-for-workflow-run\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#download-job-logs-for-a-workflow-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/job-id\"\n          }\n        ],\n        \"responses\": {\n          \"302\": {\n            \"description\": \"Response\",\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://pipelines.actions.githubusercontent.com/ab1f3cCFPB34Nd6imvFxpGZH5hNlDp2wijMwl2gDoO0bcrrlJj/_apis/pipelines/1/jobs/19/signedlogcontent?urlExpires=2020-01-22T22%3A44%3A54.1389777Z&urlSigningMethod=HMACV1&urlSignature=2TUDfIg4fm36OJmfPy6km5QD5DLCOkBVzvhWZM8B%2BUY%3D\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-jobs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/permissions\": {\n      \"get\": {\n        \"summary\": \"Get GitHub Actions permissions for a repository\",\n        \"description\": \"Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.\\n\\nYou must authenticate using an access token with the `repo` scope to use this\\nendpoint. GitHub Apps must have the `administration` repository permission to use this API.\",\n        \"operationId\": \"actions/get-github-actions-permissions-repository\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-github-actions-permissions-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/actions-repository-permissions\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/actions-repository-permissions\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set GitHub Actions permissions for a repository\",\n        \"description\": \"Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository.\\n\\nIf the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository.\\n\\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.\",\n        \"operationId\": \"actions/set-github-actions-permissions-repository\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-github-actions-permissions-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"$ref\": \"#/components/schemas/actions-enabled\"\n                  },\n                  \"allowed_actions\": {\n                    \"$ref\": \"#/components/schemas/allowed-actions\"\n                  }\n                },\n                \"required\": [\n                  \"enabled\"\n                ]\n              },\n              \"example\": {\n                \"enabled\": true,\n                \"allowed_actions\": \"selected\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/permissions/selected-actions\": {\n      \"get\": {\n        \"summary\": \"Get allowed actions for a repository\",\n        \"description\": \"Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository).\\\"\\n\\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.\",\n        \"operationId\": \"actions/get-allowed-actions-repository\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-allowed-actions-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/selected-actions\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/selected-actions\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set allowed actions for a repository\",\n        \"description\": \"Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see \\\"[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository).\\\"\\n\\nIf the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings.\\n\\nTo use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories.\\n\\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.\",\n        \"operationId\": \"actions/set-allowed-actions-repository\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-allowed-actions-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/selected-actions\"\n              },\n              \"examples\": {\n                \"selected_actions\": {\n                  \"$ref\": \"#/components/examples/selected-actions\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"actions\",\n          \"subcategory\": \"permissions\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runners\": {\n      \"get\": {\n        \"summary\": \"List self-hosted runners for a repository\",\n        \"description\": \"Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-self-hosted-runners-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"runners\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"runners\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/runner\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runners/downloads\": {\n      \"get\": {\n        \"summary\": \"List runner applications for a repository\",\n        \"description\": \"Lists binaries for the runner application that you can download and run.\\n\\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-runner-applications-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-runner-applications-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/runner-application\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner-application-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runners/registration-token\": {\n      \"post\": {\n        \"summary\": \"Create a registration token for a repository\",\n        \"description\": \"Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate\\nusing an access token with the `repo` scope to use this endpoint.\\n\\n#### Example using registration token\\n \\nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\\n\\n```\\n./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN\\n```\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/create-registration-token-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-registration-token-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authentication-token\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authentication-token\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runners/remove-token\": {\n      \"post\": {\n        \"summary\": \"Create a remove token for a repository\",\n        \"description\": \"Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.\\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\\n\\n#### Example using remove token\\n \\nTo remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.\\n\\n```\\n./config.sh remove --token TOKEN\\n```\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/create-remove-token-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-remove-token-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/authentication-token\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/authentication-token-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runners/{runner_id}\": {\n      \"get\": {\n        \"summary\": \"Get a self-hosted runner for a repository\",\n        \"description\": \"Gets a specific self-hosted runner configured in a repository.\\n\\nYou must authenticate using an access token with the `repo` scope to use this\\nendpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-self-hosted-runner-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/runner\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/runner\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a self-hosted runner from a repository\",\n        \"description\": \"Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\\n\\nYou must authenticate using an access token with the `repo`\\nscope to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/delete-self-hosted-runner-from-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/runner-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"self-hosted-runners\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runs\": {\n      \"get\": {\n        \"summary\": \"List workflow runs for a repository\",\n        \"description\": \"Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#parameters).\\n\\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-workflow-runs-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-workflow-runs-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/actor\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-run-branch\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/event\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-run-status\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/created\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/exclude-pull-requests\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"workflow_runs\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"workflow_runs\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/workflow-run\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/workflow-run-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runs/{run_id}\": {\n      \"get\": {\n        \"summary\": \"Get a workflow run\",\n        \"description\": \"Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-workflow-run\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-workflow-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/run-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/exclude-pull-requests\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/workflow-run\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/workflow-run\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-runs\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a workflow run\",\n        \"description\": \"Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is\\nprivate you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use\\nthis endpoint.\",\n        \"operationId\": \"actions/delete-workflow-run\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-workflow-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/run-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\": {\n      \"get\": {\n        \"summary\": \"List workflow run artifacts\",\n        \"description\": \"Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-workflow-run-artifacts\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-workflow-run-artifacts\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/run-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"artifacts\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"artifacts\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/artifact\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/artifact-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"artifacts\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runs/{run_id}/cancel\": {\n      \"post\": {\n        \"summary\": \"Cancel a workflow run\",\n        \"description\": \"Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/cancel-workflow-run\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#cancel-a-workflow-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/run-id\"\n          }\n        ],\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                  },\n                  \"additionalProperties\": false\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runs/{run_id}/jobs\": {\n      \"get\": {\n        \"summary\": \"List jobs for a workflow run\",\n        \"description\": \"Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#parameters).\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-jobs-for-workflow-run\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-jobs-for-a-workflow-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/run-id\"\n          },\n          {\n            \"name\": \"filter\",\n            \"description\": \"Filters jobs by their `completed_at` timestamp. Can be one of:  \\n\\\\* `latest`: Returns jobs from the most recent execution of the workflow run.  \\n\\\\* `all`: Returns all jobs for a workflow run, including from old executions of the workflow run.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"latest\",\n                \"all\"\n              ],\n              \"default\": \"latest\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"jobs\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"jobs\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/job\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/job-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-jobs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runs/{run_id}/logs\": {\n      \"get\": {\n        \"summary\": \"Download workflow run logs\",\n        \"description\": \"Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for\\n`Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use\\nthis endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have\\nthe `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/download-workflow-run-logs\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#download-workflow-run-logs\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/run-id\"\n          }\n        ],\n        \"responses\": {\n          \"302\": {\n            \"description\": \"Response\",\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://pipelines.actions.githubusercontent.com/ab1f3cCFPB34Nd6imvFxpGZH5hNlDp2wijMwl2gDoO0bcrrlJj/_apis/pipelines/1/runs/19/signedlogcontent?urlExpires=2020-01-22T22%3A44%3A54.1389777Z&urlSigningMethod=HMACV1&urlSignature=2TUDfIg4fm36OJmfPy6km5QD5DLCOkBVzvhWZM8B%2BUY%3D\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-runs\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete workflow run logs\",\n        \"description\": \"Deletes all logs for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/delete-workflow-run-logs\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-workflow-run-logs\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/run-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"500\": {\n            \"$ref\": \"#/components/responses/internal_error\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun\": {\n      \"post\": {\n        \"summary\": \"Re-run a workflow\",\n        \"description\": \"Re-runs your workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/re-run-workflow\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#re-run-a-workflow\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/run-id\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                  },\n                  \"additionalProperties\": false\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"deprecationDate\": \"2021-09-14\",\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-runs\"\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/secrets\": {\n      \"get\": {\n        \"summary\": \"List repository secrets\",\n        \"description\": \"Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-repo-secrets\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-repository-secrets\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"secrets\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"secrets\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/actions-secret\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/actions-secret-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/secrets/public-key\": {\n      \"get\": {\n        \"summary\": \"Get a repository public key\",\n        \"description\": \"Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-repo-public-key\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-repository-public-key\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/actions-public-key\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/actions-public-key\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/secrets/{secret_name}\": {\n      \"get\": {\n        \"summary\": \"Get a repository secret\",\n        \"description\": \"Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-repo-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-repository-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/actions-secret\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/actions-secret\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Create or update a repository secret\",\n        \"description\": \"Creates or updates a repository secret with an encrypted value. Encrypt your secret using\\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\\ntoken with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use\\nthis endpoint.\\n\\n#### Example encrypting a secret using Node.js\\n\\nEncrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\\n\\n```\\nconst sodium = require('tweetsodium');\\n\\nconst key = \\\"base64-encoded-public-key\\\";\\nconst value = \\\"plain-text-secret\\\";\\n\\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\\nconst messageBytes = Buffer.from(value);\\nconst keyBytes = Buffer.from(key, 'base64');\\n\\n// Encrypt using LibSodium.\\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\\n\\n// Base64 the encrypted secret\\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\\n\\nconsole.log(encrypted);\\n```\\n\\n\\n#### Example encrypting a secret using Python\\n\\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\\n\\n```\\nfrom base64 import b64encode\\nfrom nacl import encoding, public\\n\\ndef encrypt(public_key: str, secret_value: str) -> str:\\n  \\\"\\\"\\\"Encrypt a Unicode string using the public key.\\\"\\\"\\\"\\n  public_key = public.PublicKey(public_key.encode(\\\"utf-8\\\"), encoding.Base64Encoder())\\n  sealed_box = public.SealedBox(public_key)\\n  encrypted = sealed_box.encrypt(secret_value.encode(\\\"utf-8\\\"))\\n  return b64encode(encrypted).decode(\\\"utf-8\\\")\\n```\\n\\n#### Example encrypting a secret using C#\\n\\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\\n\\n```\\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\\\"mySecret\\\");\\nvar publicKey = Convert.FromBase64String(\\\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\\\");\\n\\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\\n\\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\\n```\\n\\n#### Example encrypting a secret using Ruby\\n\\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\\n\\n```ruby\\nrequire \\\"rbnacl\\\"\\nrequire \\\"base64\\\"\\n\\nkey = Base64.decode64(\\\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\\\")\\npublic_key = RbNaCl::PublicKey.new(key)\\n\\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\\nencrypted_secret = box.encrypt(\\\"my_secret\\\")\\n\\n# Print the base64 encoded secret\\nputs Base64.strict_encode64(encrypted_secret)\\n```\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/create-or-update-repo-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-a-repository-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"encrypted_value\": {\n                    \"type\": \"string\",\n                    \"description\": \"Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-repository-public-key) endpoint.\",\n                    \"pattern\": \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$\"\n                  },\n                  \"key_id\": {\n                    \"type\": \"string\",\n                    \"description\": \"ID of the key you used to encrypt the secret.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"encrypted_value\": \"c2VjcmV0\",\n                \"key_id\": \"012345678912345678\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response when creating a secret\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                  },\n                  \"additionalProperties\": false\n                }\n              }\n            }\n          },\n          \"204\": {\n            \"description\": \"Response when updating a secret\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a repository secret\",\n        \"description\": \"Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/delete-repo-secret\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-repository-secret\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/secret-name\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"secrets\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/workflows\": {\n      \"get\": {\n        \"summary\": \"List repository workflows\",\n        \"description\": \"Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-repo-workflows\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-repository-workflows\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"workflows\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"workflows\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/workflow\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/workflow-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflows\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}\": {\n      \"get\": {\n        \"summary\": \"Get a workflow\",\n        \"description\": \"Gets a specific workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/get-workflow\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-workflow\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/workflow\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/workflow\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflows\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\": {\n      \"put\": {\n        \"summary\": \"Disable a workflow\",\n        \"description\": \"Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\\n\\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/disable-workflow\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#disable-a-workflow\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflows\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\": {\n      \"post\": {\n        \"summary\": \"Create a workflow dispatch event\",\n        \"description\": \"You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\\n\\nYou must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see \\\"[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch).\\\"\\n\\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see \\\"[Creating a personal access token for the command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line).\\\"\",\n        \"operationId\": \"actions/create-workflow-dispatch\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-workflow-dispatch-event\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"ref\": {\n                    \"type\": \"string\",\n                    \"description\": \"The git reference for the workflow. The reference can be a branch or tag name.\"\n                  },\n                  \"inputs\": {\n                    \"type\": \"object\",\n                    \"description\": \"Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted.\",\n                    \"additionalProperties\": {\n                      \"type\": \"string\"\n                    },\n                    \"maxProperties\": 10\n                  }\n                },\n                \"required\": [\n                  \"ref\"\n                ]\n              },\n              \"example\": {\n                \"ref\": \"topic-branch\",\n                \"inputs\": {\n                  \"name\": \"Mona the Octocat\",\n                  \"home\": \"San Francisco, CA\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflows\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\": {\n      \"put\": {\n        \"summary\": \"Enable a workflow\",\n        \"description\": \"Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\\n\\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/enable-workflow\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#enable-a-workflow\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflows\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\": {\n      \"get\": {\n        \"summary\": \"List workflow runs\",\n        \"description\": \"List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#parameters).\\n\\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.\",\n        \"tags\": [\n          \"actions\"\n        ],\n        \"operationId\": \"actions/list-workflow-runs\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-workflow-runs\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/actor\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-run-branch\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/event\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/workflow-run-status\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/created\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/exclude-pull-requests\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"workflow_runs\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"workflow_runs\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/workflow-run\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/workflow-run-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"actions\",\n          \"subcategory\": \"workflow-runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/assignees\": {\n      \"get\": {\n        \"summary\": \"List assignees\",\n        \"description\": \"Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-assignees\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-assignees\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"assignees\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/assignees/{assignee}\": {\n      \"get\": {\n        \"summary\": \"Check if a user can be assigned\",\n        \"description\": \"Checks if a user has permission to be assigned to an issue in this repository.\\n\\nIf the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.\\n\\nOtherwise a `404` status code is returned.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/check-user-can-be-assigned\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#check-if-a-user-can-be-assigned\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"assignee\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.\"\n          },\n          \"404\": {\n            \"description\": \"Otherwise a `404` status code is returned.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/basic-error\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"assignees\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches\": {\n      \"get\": {\n        \"summary\": \"List branches\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-branches\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-branches\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"protected\",\n            \"description\": \"Setting to `true` returns only protected branches. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"boolean\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/short-branch\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/short-branch-with-protection-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}\": {\n      \"get\": {\n        \"summary\": \"Get a branch\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-branch\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-branch\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/branch-with-protection\"\n                }\n              }\n            }\n          },\n          \"301\": {\n            \"$ref\": \"#/components/responses/moved_permanently\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection\": {\n      \"get\": {\n        \"summary\": \"Get branch protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-branch-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-branch-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/branch-protection\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/branch-protection\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"luke-cage\",\n              \"note\": \"The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.luke-cage-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"put\": {\n        \"summary\": \"Update branch protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nProtecting a branch requires admin or owner permissions to the repository.\\n\\n**Note**: Passing new arrays of `users` and `teams` replaces their previous values.\\n\\n**Note**: The list of users, apps, and teams in total is limited to 100 items.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-branch-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-branch-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"required_status_checks\": {\n                    \"type\": [\n                      \"object\",\n                      \"null\"\n                    ],\n                    \"description\": \"Require status checks to pass before merging. Set to `null` to disable.\",\n                    \"properties\": {\n                      \"strict\": {\n                        \"type\": \"boolean\",\n                        \"description\": \"Require branches to be up to date before merging.\"\n                      },\n                      \"contexts\": {\n                        \"type\": \"array\",\n                        \"deprecated\": true,\n                        \"description\": \"**Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.\\n\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"checks\": {\n                        \"type\": \"array\",\n                        \"description\": \"The list of status checks to require in order to merge into this branch.\",\n                        \"items\": {\n                          \"type\": \"object\",\n                          \"required\": [\n                            \"context\"\n                          ],\n                          \"properties\": {\n                            \"context\": {\n                              \"type\": \"string\",\n                              \"description\": \"The name of the required check\"\n                            },\n                            \"app_id\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status.\"\n                            }\n                          }\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"strict\",\n                      \"contexts\"\n                    ]\n                  },\n                  \"enforce_admins\": {\n                    \"type\": [\n                      \"boolean\",\n                      \"null\"\n                    ],\n                    \"description\": \"Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable.\"\n                  },\n                  \"required_pull_request_reviews\": {\n                    \"type\": [\n                      \"object\",\n                      \"null\"\n                    ],\n                    \"description\": \"Require at least one approving review on a pull request, before merging. Set to `null` to disable.\",\n                    \"properties\": {\n                      \"dismissal_restrictions\": {\n                        \"type\": \"object\",\n                        \"description\": \"Specify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories.\",\n                        \"properties\": {\n                          \"users\": {\n                            \"type\": \"array\",\n                            \"description\": \"The list of user `login`s with dismissal access\",\n                            \"items\": {\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"teams\": {\n                            \"type\": \"array\",\n                            \"description\": \"The list of team `slug`s with dismissal access\",\n                            \"items\": {\n                              \"type\": \"string\"\n                            }\n                          }\n                        }\n                      },\n                      \"dismiss_stale_reviews\": {\n                        \"type\": \"boolean\",\n                        \"description\": \"Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit.\"\n                      },\n                      \"require_code_owner_reviews\": {\n                        \"type\": \"boolean\",\n                        \"description\": \"Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) review them.\"\n                      },\n                      \"required_approving_review_count\": {\n                        \"type\": \"integer\",\n                        \"description\": \"Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6.\"\n                      }\n                    }\n                  },\n                  \"restrictions\": {\n                    \"type\": [\n                      \"object\",\n                      \"null\"\n                    ],\n                    \"description\": \"Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable.\",\n                    \"properties\": {\n                      \"users\": {\n                        \"type\": \"array\",\n                        \"description\": \"The list of user `login`s with push access\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"teams\": {\n                        \"type\": \"array\",\n                        \"description\": \"The list of team `slug`s with push access\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"apps\": {\n                        \"type\": \"array\",\n                        \"description\": \"The list of app `slug`s with push access\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"users\",\n                      \"teams\"\n                    ]\n                  },\n                  \"required_linear_history\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see \\\"[Requiring a linear commit history](https://docs.github.com/github/administering-a-repository/requiring-a-linear-commit-history)\\\" in the GitHub Help documentation.\"\n                  },\n                  \"allow_force_pushes\": {\n                    \"type\": [\n                      \"boolean\",\n                      \"null\"\n                    ],\n                    \"description\": \"Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see \\\"[Enabling force pushes to a protected branch](https://docs.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)\\\" in the GitHub Help documentation.\\\"\"\n                  },\n                  \"allow_deletions\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see \\\"[Enabling force pushes to a protected branch](https://docs.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)\\\" in the GitHub Help documentation.\"\n                  },\n                  \"required_conversation_resolution\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`.\"\n                  },\n                  \"contexts\": {\n                    \"type\": \"array\",\n                    \"description\": \"The list of status checks to require in order to merge into this branch.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"required_status_checks\",\n                  \"enforce_admins\",\n                  \"required_pull_request_reviews\",\n                  \"restrictions\"\n                ]\n              },\n              \"example\": {\n                \"required_status_checks\": {\n                  \"strict\": true,\n                  \"contexts\": [\n                    \"continuous-integration/travis-ci\"\n                  ]\n                },\n                \"enforce_admins\": true,\n                \"required_pull_request_reviews\": {\n                  \"dismissal_restrictions\": {\n                    \"users\": [\n                      \"octocat\"\n                    ],\n                    \"teams\": [\n                      \"justice-league\"\n                    ]\n                  },\n                  \"dismiss_stale_reviews\": true,\n                  \"require_code_owner_reviews\": true,\n                  \"required_approving_review_count\": 2,\n                  \"bypass_pull_request_allowances\": {\n                    \"users\": [\n                      \"octocat\"\n                    ],\n                    \"teams\": [\n                      \"justice-league\"\n                    ]\n                  }\n                },\n                \"restrictions\": {\n                  \"users\": [\n                    \"octocat\"\n                  ],\n                  \"teams\": [\n                    \"justice-league\"\n                  ],\n                  \"apps\": [\n                    \"super-ci\"\n                  ]\n                },\n                \"required_linear_history\": true,\n                \"allow_force_pushes\": true,\n                \"allow_deletions\": true,\n                \"required_conversation_resolution\": true\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/protected-branch\"\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"luke-cage\",\n              \"note\": \"The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.luke-cage-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete branch protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-branch-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-branch-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\": {\n      \"get\": {\n        \"summary\": \"Get admin branch protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-admin-branch-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-admin-branch-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/protected-branch-admin-enforced-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Set admin branch protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nAdding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/set-admin-branch-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-admin-branch-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/protected-branch-admin-enforced-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete admin branch protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nRemoving admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-admin-branch-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-admin-branch-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\": {\n      \"get\": {\n        \"summary\": \"Get pull request review protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-pull-request-review-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-pull-request-review-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/protected-branch-pull-request-review\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/protected-branch-pull-request-review\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"luke-cage\",\n              \"note\": \"The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.luke-cage-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update pull request review protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nUpdating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.\\n\\n**Note**: Passing new arrays of `users` and `teams` replaces their previous values.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-pull-request-review-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-pull-request-review-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"dismissal_restrictions\": {\n                    \"type\": \"object\",\n                    \"description\": \"Specify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories.\",\n                    \"properties\": {\n                      \"users\": {\n                        \"type\": \"array\",\n                        \"description\": \"The list of user `login`s with dismissal access\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"teams\": {\n                        \"type\": \"array\",\n                        \"description\": \"The list of team `slug`s with dismissal access\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    }\n                  },\n                  \"dismiss_stale_reviews\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit.\"\n                  },\n                  \"require_code_owner_reviews\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) have reviewed.\"\n                  },\n                  \"required_approving_review_count\": {\n                    \"type\": \"integer\",\n                    \"description\": \"Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"dismissal_restrictions\": {\n                  \"users\": [\n                    \"octocat\"\n                  ],\n                  \"teams\": [\n                    \"justice-league\"\n                  ]\n                },\n                \"bypass_pull_request_allowances\": {\n                  \"users\": [\n                    \"octocat\"\n                  ],\n                  \"teams\": [\n                    \"justice-league\"\n                  ]\n                },\n                \"dismiss_stale_reviews\": true,\n                \"require_code_owner_reviews\": true,\n                \"required_approving_review_count\": 2\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/protected-branch-pull-request-review\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/protected-branch-pull-request-review\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"luke-cage\",\n              \"note\": \"The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.luke-cage-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete pull request review protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-pull-request-review-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-pull-request-review-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\": {\n      \"get\": {\n        \"summary\": \"Get commit signature protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.\\n\\n**Note**: You must enable branch protection to require signed commits.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-commit-signature-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-commit-signature-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/protected-branch-admin-enforced\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"zzzax\",\n              \"note\": \"Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.zzzax-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create commit signature protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-commit-signature-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-commit-signature-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/protected-branch-admin-enforced\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"zzzax\",\n              \"note\": \"Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.zzzax-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete commit signature protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-commit-signature-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-commit-signature-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"zzzax\",\n              \"note\": \"Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.zzzax-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\": {\n      \"get\": {\n        \"summary\": \"Get status checks protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-status-checks-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-status-checks-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/status-check-policy\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/status-check-policy\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update status check protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nUpdating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-status-check-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-status-check-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"strict\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Require branches to be up to date before merging.\"\n                  },\n                  \"contexts\": {\n                    \"type\": \"array\",\n                    \"deprecated\": true,\n                    \"description\": \"The list of status checks to require in order to merge into this branch\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              },\n              \"example\": {\n                \"strict\": true,\n                \"contexts\": [\n                  \"continuous-integration/travis-ci\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/status-check-policy\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/status-check-policy\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove status check protection\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/remove-status-check-protection\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-status-check-protection\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\": {\n      \"get\": {\n        \"summary\": \"Get all status check contexts\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-all-status-check-contexts\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-all-status-check-contexts\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"example\": [\n                  \"continuous-integration/travis-ci\"\n                ]\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Add status check contexts\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/add-status-check-contexts\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-status-check-contexts\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"contexts\": {\n                        \"type\": \"array\",\n                        \"description\": \"contexts parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"contexts\"\n                    ],\n                    \"example\": {\n                      \"contexts\": [\n                        \"contexts\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"description\": \"contexts parameter\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"example\": [\n                  \"continuous-integration/travis-ci\",\n                  \"continuous-integration/jenkins\"\n                ]\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"contexts\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set status check contexts\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/set-status-check-contexts\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-status-check-contexts\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"contexts\": {\n                        \"type\": \"array\",\n                        \"description\": \"contexts parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"contexts\"\n                    ],\n                    \"example\": {\n                      \"contexts\": [\n                        \"contexts\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"description\": \"contexts parameter\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"example\": [\n                  \"continuous-integration/travis-ci\"\n                ]\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"contexts\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove status check contexts\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/remove-status-check-contexts\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-status-check-contexts\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"contexts\": {\n                        \"type\": \"array\",\n                        \"description\": \"contexts parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"contexts\"\n                    ],\n                    \"example\": {\n                      \"contexts\": [\n                        \"contexts\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"description\": \"contexts parameter\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"example\": [\n                  \"continuous-integration/travis-ci\"\n                ]\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"contexts\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions\": {\n      \"get\": {\n        \"summary\": \"Get access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nLists who has access to this protected branch.\\n\\n**Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/branch-restriction-policy\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/branch-restriction-policy\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nDisables the ability to restrict who can push to this branch.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\": {\n      \"get\": {\n        \"summary\": \"Get apps with access to the protected branch\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nLists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-apps-with-access-to-protected-branch\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-apps-with-access-to-the-protected-branch\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/integration\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/integration-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Add app access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nGrants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\\n\\n| Type    | Description                                                                                                                                                |\\n| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\\n| `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/add-app-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-app-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"apps\": {\n                        \"type\": \"array\",\n                        \"description\": \"apps parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"apps\"\n                    ],\n                    \"example\": {\n                      \"apps\": [\n                        \"my-app\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/integration\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/integration-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"apps\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set app access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nReplaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\\n\\n| Type    | Description                                                                                                                                                |\\n| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\\n| `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/set-app-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-app-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"apps\": {\n                        \"type\": \"array\",\n                        \"description\": \"apps parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"apps\"\n                    ],\n                    \"example\": {\n                      \"apps\": [\n                        \"my-app\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/integration\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/integration-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"apps\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove app access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nRemoves the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\\n\\n| Type    | Description                                                                                                                                                |\\n| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\\n| `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/remove-app-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-app-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"apps\": {\n                        \"type\": \"array\",\n                        \"description\": \"apps parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"apps\"\n                    ],\n                    \"example\": {\n                      \"apps\": [\n                        \"my-app\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/integration\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/integration-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"apps\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\": {\n      \"get\": {\n        \"summary\": \"Get teams with access to the protected branch\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nLists the teams who have push access to this branch. The list includes child teams.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-teams-with-access-to-protected-branch\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-teams-with-access-to-the-protected-branch\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Add team access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nGrants the specified teams push access for this branch. You can also give push access to child teams.\\n\\n| Type    | Description                                                                                                                                |\\n| ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\\n| `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/add-team-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-team-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"teams\": {\n                        \"type\": \"array\",\n                        \"description\": \"teams parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"teams\"\n                    ],\n                    \"example\": {\n                      \"teams\": [\n                        \"my-team\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"description\": \"teams parameter\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"teams\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set team access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nReplaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.\\n\\n| Type    | Description                                                                                                                                |\\n| ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\\n| `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/set-team-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-team-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"teams\": {\n                        \"type\": \"array\",\n                        \"description\": \"teams parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"teams\"\n                    ],\n                    \"example\": {\n                      \"teams\": [\n                        \"my-team\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"description\": \"teams parameter\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"teams\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove team access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nRemoves the ability of a team to push to this branch. You can also remove push access for child teams.\\n\\n| Type    | Description                                                                                                                                         |\\n| ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |\\n| `array` | Teams that should no longer have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/remove-team-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-team-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"teams\": {\n                        \"type\": \"array\",\n                        \"description\": \"teams parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"teams\"\n                    ],\n                    \"example\": {\n                      \"teams\": [\n                        \"my-team\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"description\": \"teams parameter\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"teams\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\": {\n      \"get\": {\n        \"summary\": \"Get users with access to the protected branch\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nLists the people who have push access to this branch.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-users-with-access-to-protected-branch\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-users-with-access-to-the-protected-branch\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Add user access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nGrants the specified people push access for this branch.\\n\\n| Type    | Description                                                                                                                   |\\n| ------- | ----------------------------------------------------------------------------------------------------------------------------- |\\n| `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/add-user-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-user-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"users\": {\n                        \"type\": \"array\",\n                        \"description\": \"users parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"users\"\n                    ],\n                    \"example\": {\n                      \"users\": [\n                        \"mona\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"users\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set user access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nReplaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.\\n\\n| Type    | Description                                                                                                                   |\\n| ------- | ----------------------------------------------------------------------------------------------------------------------------- |\\n| `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/set-user-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-user-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"users\": {\n                        \"type\": \"array\",\n                        \"description\": \"users parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"users\"\n                    ],\n                    \"example\": {\n                      \"users\": [\n                        \"mona\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"users\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove user access restrictions\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nRemoves the ability of a user to push to this branch.\\n\\n| Type    | Description                                                                                                                                   |\\n| ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\\n| `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/remove-user-access-restrictions\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-user-access-restrictions\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/branch\"\n          }\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"users\": {\n                        \"type\": \"array\",\n                        \"description\": \"users parameter\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"users\"\n                    ],\n                    \"example\": {\n                      \"users\": [\n                        \"mona\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"requestBodyParameterName\": \"users\",\n          \"category\": \"repos\",\n          \"subcategory\": \"branches\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/check-runs\": {\n      \"post\": {\n        \"summary\": \"Create a check run\",\n        \"description\": \"**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\\n\\nCreates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs.\\n\\nIn a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/create\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#create-a-check-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the check. For example, \\\"code-coverage\\\".\"\n                  },\n                  \"head_sha\": {\n                    \"type\": \"string\",\n                    \"description\": \"The SHA of the commit.\"\n                  },\n                  \"details_url\": {\n                    \"type\": \"string\",\n                    \"description\": \"The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used.\"\n                  },\n                  \"external_id\": {\n                    \"type\": \"string\",\n                    \"description\": \"A reference for the run on the integrator's system.\"\n                  },\n                  \"status\": {\n                    \"type\": \"string\",\n                    \"description\": \"The current status. Can be one of `queued`, `in_progress`, or `completed`.\",\n                    \"enum\": [\n                      \"queued\",\n                      \"in_progress\",\n                      \"completed\"\n                    ],\n                    \"default\": \"queued\"\n                  },\n                  \"started_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\",\n                    \"description\": \"The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                  },\n                  \"conclusion\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `action_required`, `cancelled`, `failure`, `neutral`, `success`, `skipped`, `stale`, or `timed_out`. When the conclusion is `action_required`, additional details should be provided on the site specified by `details_url`.  \\n**Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.\",\n                    \"enum\": [\n                      \"action_required\",\n                      \"cancelled\",\n                      \"failure\",\n                      \"neutral\",\n                      \"success\",\n                      \"skipped\",\n                      \"stale\",\n                      \"timed_out\"\n                    ]\n                  },\n                  \"completed_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\",\n                    \"description\": \"The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                  },\n                  \"output\": {\n                    \"type\": \"object\",\n                    \"description\": \"Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#output-object) description.\",\n                    \"properties\": {\n                      \"title\": {\n                        \"type\": \"string\",\n                        \"description\": \"The title of the check run.\"\n                      },\n                      \"summary\": {\n                        \"type\": \"string\",\n                        \"maxLength\": 65535,\n                        \"description\": \"The summary of the check run. This parameter supports Markdown.\"\n                      },\n                      \"text\": {\n                        \"type\": \"string\",\n                        \"maxLength\": 65535,\n                        \"description\": \"The details of the check run. This parameter supports Markdown.\"\n                      },\n                      \"annotations\": {\n                        \"type\": \"array\",\n                        \"description\": \"Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the **Checks** and **Files changed** tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see \\\"[About status checks](https://docs.github.com/articles/about-status-checks#checks)\\\". See the [`annotations` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#annotations-object) description for details about how to use this parameter.\",\n                        \"maxItems\": 50,\n                        \"items\": {\n                          \"type\": \"object\",\n                          \"properties\": {\n                            \"path\": {\n                              \"type\": \"string\",\n                              \"description\": \"The path of the file to add an annotation to. For example, `assets/css/main.css`.\"\n                            },\n                            \"start_line\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The start line of the annotation.\"\n                            },\n                            \"end_line\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The end line of the annotation.\"\n                            },\n                            \"start_column\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The start column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values.\"\n                            },\n                            \"end_column\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The end column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values.\"\n                            },\n                            \"annotation_level\": {\n                              \"type\": \"string\",\n                              \"description\": \"The level of the annotation. Can be one of `notice`, `warning`, or `failure`.\",\n                              \"enum\": [\n                                \"notice\",\n                                \"warning\",\n                                \"failure\"\n                              ]\n                            },\n                            \"message\": {\n                              \"type\": \"string\",\n                              \"description\": \"A short description of the feedback for these lines of code. The maximum size is 64 KB.\"\n                            },\n                            \"title\": {\n                              \"type\": \"string\",\n                              \"description\": \"The title that represents the annotation. The maximum size is 255 characters.\"\n                            },\n                            \"raw_details\": {\n                              \"type\": \"string\",\n                              \"description\": \"Details about this annotation. The maximum size is 64 KB.\"\n                            }\n                          },\n                          \"required\": [\n                            \"path\",\n                            \"start_line\",\n                            \"end_line\",\n                            \"annotation_level\",\n                            \"message\"\n                          ]\n                        }\n                      },\n                      \"images\": {\n                        \"type\": \"array\",\n                        \"description\": \"Adds images to the output displayed in the GitHub pull request UI. See the [`images` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#images-object) description for details.\",\n                        \"items\": {\n                          \"type\": \"object\",\n                          \"properties\": {\n                            \"alt\": {\n                              \"type\": \"string\",\n                              \"description\": \"The alternative text for the image.\"\n                            },\n                            \"image_url\": {\n                              \"type\": \"string\",\n                              \"description\": \"The full URL of the image.\"\n                            },\n                            \"caption\": {\n                              \"type\": \"string\",\n                              \"description\": \"A short image description.\"\n                            }\n                          },\n                          \"required\": [\n                            \"alt\",\n                            \"image_url\"\n                          ]\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"title\",\n                      \"summary\"\n                    ]\n                  },\n                  \"actions\": {\n                    \"type\": \"array\",\n                    \"description\": \"Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [`check_run.requested_action` webhook](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#check_run) to your app. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see \\\"[Check runs and requested actions](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#check-runs-and-requested-actions).\\\"\",\n                    \"maxItems\": 3,\n                    \"items\": {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"label\": {\n                          \"type\": \"string\",\n                          \"maxLength\": 20,\n                          \"description\": \"The text to be displayed on a button in the web UI. The maximum size is 20 characters.\"\n                        },\n                        \"description\": {\n                          \"type\": \"string\",\n                          \"maxLength\": 40,\n                          \"description\": \"A short explanation of what this action would do. The maximum size is 40 characters.\"\n                        },\n                        \"identifier\": {\n                          \"type\": \"string\",\n                          \"maxLength\": 20,\n                          \"description\": \"A reference for the action on the integrator's system. The maximum size is 20 characters.\"\n                        }\n                      },\n                      \"required\": [\n                        \"label\",\n                        \"description\",\n                        \"identifier\"\n                      ]\n                    }\n                  }\n                },\n                \"required\": [\n                  \"name\",\n                  \"head_sha\"\n                ],\n                \"oneOf\": [\n                  {\n                    \"properties\": {\n                      \"status\": {\n                        \"enum\": [\n                          \"completed\"\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"status\",\n                      \"conclusion\"\n                    ],\n                    \"additionalProperties\": true\n                  },\n                  {\n                    \"properties\": {\n                      \"status\": {\n                        \"enum\": [\n                          \"queued\",\n                          \"in_progress\"\n                        ]\n                      }\n                    },\n                    \"additionalProperties\": true\n                  }\n                ]\n              },\n              \"examples\": {\n                \"example-of-in-progress-conclusion\": {\n                  \"summary\": \"Response for in_progress conclusion\",\n                  \"value\": {\n                    \"name\": \"mighty_readme\",\n                    \"head_sha\": \"ce587453ced02b1526dfb4cb910479d431683101\",\n                    \"status\": \"in_progress\",\n                    \"external_id\": \"42\",\n                    \"started_at\": \"2018-05-04T01:14:52Z\",\n                    \"output\": {\n                      \"title\": \"Mighty Readme report\",\n                      \"summary\": \"\",\n                      \"text\": \"\"\n                    }\n                  }\n                },\n                \"example-of-completed-conclusion\": {\n                  \"summary\": \"Response for completed conclusion\",\n                  \"value\": {\n                    \"name\": \"mighty_readme\",\n                    \"head_sha\": \"ce587453ced02b1526dfb4cb910479d431683101\",\n                    \"status\": \"completed\",\n                    \"started_at\": \"2017-11-30T19:39:10Z\",\n                    \"conclusion\": \"success\",\n                    \"completed_at\": \"2017-11-30T19:49:10Z\",\n                    \"output\": {\n                      \"title\": \"Mighty Readme report\",\n                      \"summary\": \"There are 0 failures, 2 warnings, and 1 notices.\",\n                      \"text\": \"You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.\",\n                      \"annotations\": [\n                        {\n                          \"path\": \"README.md\",\n                          \"annotation_level\": \"warning\",\n                          \"title\": \"Spell Checker\",\n                          \"message\": \"Check your spelling for 'banaas'.\",\n                          \"raw_details\": \"Do you mean 'bananas' or 'banana'?\",\n                          \"start_line\": 2,\n                          \"end_line\": 2\n                        },\n                        {\n                          \"path\": \"README.md\",\n                          \"annotation_level\": \"warning\",\n                          \"title\": \"Spell Checker\",\n                          \"message\": \"Check your spelling for 'aples'\",\n                          \"raw_details\": \"Do you mean 'apples' or 'Naples'\",\n                          \"start_line\": 4,\n                          \"end_line\": 4\n                        }\n                      ],\n                      \"images\": [\n                        {\n                          \"alt\": \"Super bananas\",\n                          \"image_url\": \"http://example.com/images/42\"\n                        }\n                      ]\n                    },\n                    \"actions\": [\n                      {\n                        \"label\": \"Fix\",\n                        \"identifier\": \"fix_errors\",\n                        \"description\": \"Allow us to fix these errors for you\"\n                      }\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/check-run\"\n                },\n                \"examples\": {\n                  \"example-of-completed-conclusion\": {\n                    \"$ref\": \"#/components/examples/check-run-example-of-completed-conclusion\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/check-runs/{check_run_id}\": {\n      \"get\": {\n        \"summary\": \"Get a check run\",\n        \"description\": \"**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\\n\\nGets a single check run using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#get-a-check-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-run-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/check-run\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-run\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"runs\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a check run\",\n        \"description\": \"**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\\n\\nUpdates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/update\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-a-check-run\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-run-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the check. For example, \\\"code-coverage\\\".\"\n                  },\n                  \"details_url\": {\n                    \"type\": \"string\",\n                    \"description\": \"The URL of the integrator's site that has the full details of the check.\"\n                  },\n                  \"external_id\": {\n                    \"type\": \"string\",\n                    \"description\": \"A reference for the run on the integrator's system.\"\n                  },\n                  \"started_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\",\n                    \"description\": \"This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                  },\n                  \"status\": {\n                    \"type\": \"string\",\n                    \"description\": \"The current status. Can be one of `queued`, `in_progress`, or `completed`.\",\n                    \"enum\": [\n                      \"queued\",\n                      \"in_progress\",\n                      \"completed\"\n                    ]\n                  },\n                  \"conclusion\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `action_required`, `cancelled`, `failure`, `neutral`, `success`, `skipped`, `stale`, or `timed_out`.  \\n**Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.\",\n                    \"enum\": [\n                      \"action_required\",\n                      \"cancelled\",\n                      \"failure\",\n                      \"neutral\",\n                      \"success\",\n                      \"skipped\",\n                      \"stale\",\n                      \"timed_out\"\n                    ]\n                  },\n                  \"completed_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\",\n                    \"description\": \"The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                  },\n                  \"output\": {\n                    \"type\": \"object\",\n                    \"description\": \"Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#output-object-1) description.\",\n                    \"properties\": {\n                      \"title\": {\n                        \"type\": \"string\",\n                        \"description\": \"**Required**.\"\n                      },\n                      \"summary\": {\n                        \"type\": \"string\",\n                        \"description\": \"Can contain Markdown.\",\n                        \"maxLength\": 65535\n                      },\n                      \"text\": {\n                        \"type\": \"string\",\n                        \"description\": \"Can contain Markdown.\",\n                        \"maxLength\": 65535\n                      },\n                      \"annotations\": {\n                        \"type\": \"array\",\n                        \"description\": \"Adds information from your analysis to specific lines of code. Annotations are visible in GitHub's pull request UI. Annotations are visible in GitHub's pull request UI. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see \\\"[About status checks](https://docs.github.com/articles/about-status-checks#checks)\\\". See the [`annotations` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#annotations-object-1) description for details.\",\n                        \"maxItems\": 50,\n                        \"items\": {\n                          \"type\": \"object\",\n                          \"properties\": {\n                            \"path\": {\n                              \"type\": \"string\",\n                              \"description\": \"The path of the file to add an annotation to. For example, `assets/css/main.css`.\"\n                            },\n                            \"start_line\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The start line of the annotation.\"\n                            },\n                            \"end_line\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The end line of the annotation.\"\n                            },\n                            \"start_column\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The start column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values.\"\n                            },\n                            \"end_column\": {\n                              \"type\": \"integer\",\n                              \"description\": \"The end column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values.\"\n                            },\n                            \"annotation_level\": {\n                              \"type\": \"string\",\n                              \"description\": \"The level of the annotation. Can be one of `notice`, `warning`, or `failure`.\",\n                              \"enum\": [\n                                \"notice\",\n                                \"warning\",\n                                \"failure\"\n                              ]\n                            },\n                            \"message\": {\n                              \"type\": \"string\",\n                              \"description\": \"A short description of the feedback for these lines of code. The maximum size is 64 KB.\"\n                            },\n                            \"title\": {\n                              \"type\": \"string\",\n                              \"description\": \"The title that represents the annotation. The maximum size is 255 characters.\"\n                            },\n                            \"raw_details\": {\n                              \"type\": \"string\",\n                              \"description\": \"Details about this annotation. The maximum size is 64 KB.\"\n                            }\n                          },\n                          \"required\": [\n                            \"path\",\n                            \"start_line\",\n                            \"end_line\",\n                            \"annotation_level\",\n                            \"message\"\n                          ]\n                        }\n                      },\n                      \"images\": {\n                        \"type\": \"array\",\n                        \"description\": \"Adds images to the output displayed in the GitHub pull request UI. See the [`images` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#annotations-object-1) description for details.\",\n                        \"items\": {\n                          \"type\": \"object\",\n                          \"properties\": {\n                            \"alt\": {\n                              \"type\": \"string\",\n                              \"description\": \"The alternative text for the image.\"\n                            },\n                            \"image_url\": {\n                              \"type\": \"string\",\n                              \"description\": \"The full URL of the image.\"\n                            },\n                            \"caption\": {\n                              \"type\": \"string\",\n                              \"description\": \"A short image description.\"\n                            }\n                          },\n                          \"required\": [\n                            \"alt\",\n                            \"image_url\"\n                          ]\n                        }\n                      }\n                    },\n                    \"required\": [\n                      \"summary\"\n                    ]\n                  },\n                  \"actions\": {\n                    \"type\": \"array\",\n                    \"description\": \"Possible further actions the integrator can perform, which a user may trigger. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see \\\"[Check runs and requested actions](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#check-runs-and-requested-actions).\\\"\",\n                    \"maxItems\": 3,\n                    \"items\": {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"label\": {\n                          \"type\": \"string\",\n                          \"maxLength\": 20,\n                          \"description\": \"The text to be displayed on a button in the web UI. The maximum size is 20 characters.\"\n                        },\n                        \"description\": {\n                          \"type\": \"string\",\n                          \"maxLength\": 40,\n                          \"description\": \"A short explanation of what this action would do. The maximum size is 40 characters.\"\n                        },\n                        \"identifier\": {\n                          \"type\": \"string\",\n                          \"maxLength\": 20,\n                          \"description\": \"A reference for the action on the integrator's system. The maximum size is 20 characters.\"\n                        }\n                      },\n                      \"required\": [\n                        \"label\",\n                        \"description\",\n                        \"identifier\"\n                      ]\n                    }\n                  }\n                },\n                \"anyOf\": [\n                  {\n                    \"properties\": {\n                      \"status\": {\n                        \"enum\": [\n                          \"completed\"\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"conclusion\"\n                    ],\n                    \"additionalProperties\": true\n                  },\n                  {\n                    \"properties\": {\n                      \"status\": {\n                        \"enum\": [\n                          \"queued\",\n                          \"in_progress\"\n                        ]\n                      }\n                    },\n                    \"additionalProperties\": true\n                  }\n                ]\n              },\n              \"example\": {\n                \"name\": \"mighty_readme\",\n                \"started_at\": \"2018-05-04T01:14:52Z\",\n                \"status\": \"completed\",\n                \"conclusion\": \"success\",\n                \"completed_at\": \"2018-05-04T01:14:52Z\",\n                \"output\": {\n                  \"title\": \"Mighty Readme report\",\n                  \"summary\": \"There are 0 failures, 2 warnings, and 1 notices.\",\n                  \"text\": \"You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.\",\n                  \"annotations\": [\n                    {\n                      \"path\": \"README.md\",\n                      \"annotation_level\": \"warning\",\n                      \"title\": \"Spell Checker\",\n                      \"message\": \"Check your spelling for 'banaas'.\",\n                      \"raw_details\": \"Do you mean 'bananas' or 'banana'?\",\n                      \"start_line\": 2,\n                      \"end_line\": 2\n                    },\n                    {\n                      \"path\": \"README.md\",\n                      \"annotation_level\": \"warning\",\n                      \"title\": \"Spell Checker\",\n                      \"message\": \"Check your spelling for 'aples'\",\n                      \"raw_details\": \"Do you mean 'apples' or 'Naples'\",\n                      \"start_line\": 4,\n                      \"end_line\": 4\n                    }\n                  ],\n                  \"images\": [\n                    {\n                      \"alt\": \"Super bananas\",\n                      \"image_url\": \"http://example.com/images/42\"\n                    }\n                  ]\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/check-run\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-run\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\": {\n      \"get\": {\n        \"summary\": \"List check run annotations\",\n        \"description\": \"Lists annotations for a check run using the annotation `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the `repo` scope to get annotations for a check run in a private repository.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/list-annotations\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#list-check-run-annotations\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-run-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/check-annotation\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-annotation-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/check-suites\": {\n      \"post\": {\n        \"summary\": \"Create a check suite\",\n        \"description\": \"**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\\n\\nBy default, check suites are automatically created when you create a [check run](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using \\\"[Update repository preferences for check suites](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-repository-preferences-for-check-suites)\\\". Your GitHub App must have the `checks:write` permission to create check suites.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/create-suite\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#create-a-check-suite\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"head_sha\": {\n                    \"type\": \"string\",\n                    \"description\": \"The sha of the head commit.\"\n                  }\n                },\n                \"required\": [\n                  \"head_sha\"\n                ]\n              },\n              \"example\": {\n                \"head_sha\": \"d6fde92930d4715a2b49857d24b940956b26d2d3\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"when the suite already existed\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/check-suite\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-suite\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Response when the suite was created\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/check-suite\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-suite\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"suites\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/check-suites/preferences\": {\n      \"patch\": {\n        \"summary\": \"Update repository preferences for check suites\",\n        \"description\": \"Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/set-suites-preferences\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-repository-preferences-for-check-suites\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"auto_trigger_checks\": {\n                    \"type\": \"array\",\n                    \"description\": \"Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [`auto_trigger_checks` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#auto_trigger_checks-object) description for details.\",\n                    \"items\": {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"app_id\": {\n                          \"type\": \"integer\",\n                          \"description\": \"The `id` of the GitHub App.\"\n                        },\n                        \"setting\": {\n                          \"type\": \"boolean\",\n                          \"description\": \"Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them.\",\n                          \"default\": true\n                        }\n                      },\n                      \"required\": [\n                        \"app_id\",\n                        \"setting\"\n                      ]\n                    }\n                  }\n                }\n              },\n              \"example\": {\n                \"auto_trigger_checks\": [\n                  {\n                    \"app_id\": 4,\n                    \"setting\": false\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/check-suite-preference\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-suite-preference\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"suites\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/check-suites/{check_suite_id}\": {\n      \"get\": {\n        \"summary\": \"Get a check suite\",\n        \"description\": \"**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\\n\\nGets a single check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/get-suite\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#get-a-check-suite\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-suite-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/check-suite\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-suite\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"suites\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\": {\n      \"get\": {\n        \"summary\": \"List check runs in a check suite\",\n        \"description\": \"**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\\n\\nLists check runs for a check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/list-for-suite\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#list-check-runs-in-a-check-suite\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-suite-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-name\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/status\"\n          },\n          {\n            \"name\": \"filter\",\n            \"description\": \"Filters check runs by their `completed_at` timestamp. Can be one of `latest` (returning the most recent check runs) or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"latest\",\n                \"all\"\n              ],\n              \"default\": \"latest\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"check_runs\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"check_runs\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/check-run\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-run-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\": {\n      \"post\": {\n        \"summary\": \"Rerequest a check suite\",\n        \"description\": \"Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.\\n\\nTo rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/rerequest-suite\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#rerequest-a-check-suite\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-suite-id\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                  },\n                  \"additionalProperties\": false\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"suites\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/code-scanning/alerts\": {\n      \"get\": {\n        \"summary\": \"List code scanning alerts for a repository\",\n        \"description\": \"Lists all open code scanning alerts for the default branch (usually `main`\\nor `master`). You must use an access token with the `security_events` scope to use\\nthis endpoint. GitHub Apps must have the `security_events` read permission to use\\nthis endpoint.\\n\\nThe response includes a `most_recent_instance` object.\\nThis provides details of the most recent instance of this alert\\nfor the default branch or for the specified Git reference\\n(if you used `ref` in the request).\",\n        \"tags\": [\n          \"code-scanning\"\n        ],\n        \"operationId\": \"code-scanning/list-alerts-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/tool-name\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/tool-guid\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/git-ref\"\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Set to `open`, `fixed`, or `dismissed` to list code scanning alerts in a specific state.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/code-scanning-alert-state\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/code-scanning-alert-items\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-scanning-alert-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/code_scanning_forbidden_read\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"code-scanning\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\": {\n      \"get\": {\n        \"summary\": \"Get a code scanning alert\",\n        \"description\": \"Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.\\n\\n**Deprecation notice**:\\nThe instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by `instances_url`.\",\n        \"tags\": [\n          \"code-scanning\"\n        ],\n        \"operationId\": \"code-scanning/get-alert\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#get-a-code-scanning-alert\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/alert-number\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/code-scanning-alert\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-scanning-alert\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/code_scanning_forbidden_read\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"code-scanning\",\n          \"subcategory\": null\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a code scanning alert\",\n        \"description\": \"Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.\",\n        \"operationId\": \"code-scanning/update-alert\",\n        \"tags\": [\n          \"code-scanning\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#update-a-code-scanning-alert\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/alert-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"state\": {\n                    \"$ref\": \"#/components/schemas/code-scanning-alert-set-state\"\n                  },\n                  \"dismissed_reason\": {\n                    \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-reason\"\n                  }\n                },\n                \"required\": [\n                  \"state\"\n                ]\n              },\n              \"example\": {\n                \"state\": \"dismissed\",\n                \"dismissed_reason\": \"false positive\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/code-scanning-alert\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-scanning-alert-dismissed\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/code_scanning_forbidden_write\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"code-scanning\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/code-scanning/analyses\": {\n      \"get\": {\n        \"summary\": \"List code scanning analyses for a repository\",\n        \"description\": \"Lists the details of all code scanning analyses for a repository,\\nstarting with the most recent.\\nThe response is paginated and you can use the `page` and `per_page` parameters\\nto list the analyses you're interested in.\\nBy default 30 analyses are listed per page.\\n\\nThe `rules_count` field in the response give the number of rules\\nthat were run in the analysis.\\nFor very old analyses this data is not available,\\nand `0` is returned in this field.\\n\\nYou must use an access token with the `security_events` scope to use this endpoint.\\nGitHub Apps must have the `security_events` read permission to use this endpoint.\\n\\n**Deprecation notice**:\\nThe `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.\",\n        \"operationId\": \"code-scanning/list-recent-analyses\",\n        \"tags\": [\n          \"code-scanning\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/tool-name\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/tool-guid\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"name\": \"ref\",\n            \"in\": \"query\",\n            \"description\": \"The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/<branch name>` or simply `<branch name>`. To reference a pull request use `refs/pull/<number>/merge`.\",\n            \"required\": false,\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/code-scanning-ref\"\n            }\n          },\n          {\n            \"name\": \"sarif_id\",\n            \"in\": \"query\",\n            \"description\": \"Filter analyses belonging to the same SARIF upload.\",\n            \"required\": false,\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/code-scanning-analysis-sarif-id\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/code-scanning-analysis\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-scanning-analysis-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/code_scanning_forbidden_read\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"code-scanning\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/code-scanning/sarifs\": {\n      \"post\": {\n        \"summary\": \"Upload an analysis as SARIF data\",\n        \"description\": \"Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.\\n\\nThere are two places where you can upload code scanning results.\\n - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see \\\"[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests).\\\"\\n - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see \\\"[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository).\\\"\\n\\nYou must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:\\n\\n```\\ngzip -c analysis-data.sarif | base64 -w0\\n```\\n\\nSARIF upload supports a maximum of 1000 results per analysis run. Any results over this limit are ignored. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.\\n\\nThe `202 Accepted`, response includes an `id` value.\\nYou can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.\\nFor more information, see \\\"[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload).\\\"\",\n        \"operationId\": \"code-scanning/upload-sarif\",\n        \"tags\": [\n          \"code-scanning\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#upload-a-sarif-file\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"commit_sha\": {\n                    \"$ref\": \"#/components/schemas/code-scanning-analysis-commit-sha\"\n                  },\n                  \"ref\": {\n                    \"$ref\": \"#/components/schemas/code-scanning-ref\"\n                  },\n                  \"sarif\": {\n                    \"$ref\": \"#/components/schemas/code-scanning-analysis-sarif-file\"\n                  },\n                  \"checkout_uri\": {\n                    \"description\": \"The base directory used in the analysis, as it appears in the SARIF file.\\nThis property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository.\",\n                    \"type\": \"string\",\n                    \"format\": \"uri\",\n                    \"examples\": [\n                      \"file:///github/workspace/\"\n                    ]\n                  },\n                  \"started_at\": {\n                    \"description\": \"The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\",\n                    \"format\": \"date-time\",\n                    \"type\": \"string\"\n                  },\n                  \"tool_name\": {\n                    \"description\": \"The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to \\\"API\\\". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`.\",\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"commit_sha\",\n                  \"ref\",\n                  \"sarif\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/code-scanning-sarifs-receipt\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-scanning-sarif-upload\"\n                  }\n                }\n              }\n            }\n          },\n          \"400\": {\n            \"description\": \"Bad Request if the sarif field is invalid\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/code_scanning_forbidden_write\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"413\": {\n            \"description\": \"Payload Too Large if the sarif field is too large\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          }\n        },\n        \"x-github\": {\n          \"enabledForGitHubApps\": true,\n          \"githubCloudOnly\": false,\n          \"category\": \"code-scanning\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/collaborators\": {\n      \"get\": {\n        \"summary\": \"List repository collaborators\",\n        \"description\": \"For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.\\n\\nTeam members will include the members of child teams.\\n\\nYou must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this\\nendpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this\\nendpoint.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-collaborators\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-collaborators\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"affiliation\",\n            \"description\": \"Filter collaborators returned by their affiliation. Can be one of:  \\n\\\\* `outside`: All outside collaborators of an organization-owned repository.  \\n\\\\* `direct`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status.  \\n\\\\* `all`: All collaborators the authenticated user can see.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"outside\",\n                \"direct\",\n                \"all\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/collaborator\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/collaborator-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"collaborators\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/collaborators/{username}\": {\n      \"get\": {\n        \"summary\": \"Check if a user is a repository collaborator\",\n        \"description\": \"For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.\\n\\nTeam members will include the members of child teams.\\n\\nYou must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this\\nendpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this\\nendpoint.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/check-collaborator\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#check-if-a-user-is-a-repository-collaborator\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response if user is a collaborator\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if user is not a collaborator\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"collaborators\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Add a repository collaborator\",\n        \"description\": \"This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\\n\\nFor more information on permission levels, see \\\"[Repository permission levels for an organization](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)\\\". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:\\n\\n```\\nCannot assign {member} permission of {role name}\\n```\\n\\nNote that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\\n\\nThe invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#invitations).\\n\\n**Rate limits**\\n\\nYou are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/add-collaborator\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-a-repository-collaborator\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of:  \\n\\\\* `pull` - can pull, but not push to or administer this repository.  \\n\\\\* `push` - can pull and push, but not administer this repository.  \\n\\\\* `admin` - can pull, push and administer this repository.  \\n\\\\* `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.  \\n\\\\* `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access.\",\n                    \"enum\": [\n                      \"pull\",\n                      \"push\",\n                      \"admin\",\n                      \"maintain\",\n                      \"triage\"\n                    ],\n                    \"default\": \"push\"\n                  },\n                  \"permissions\": {\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"\\\"push\\\"\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response when a new invitation is created\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository-invitation\"\n                },\n                \"examples\": {\n                  \"response-when-a-new-invitation-is-created\": {\n                    \"$ref\": \"#/components/examples/repository-invitation-response-when-a-new-invitation-is-created\"\n                  }\n                }\n              }\n            }\n          },\n          \"204\": {\n            \"description\": \"Response when person is already a collaborator\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"collaborators\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove a repository collaborator\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/remove-collaborator\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-a-repository-collaborator\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"collaborators\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/collaborators/{username}/permission\": {\n      \"get\": {\n        \"summary\": \"Get repository permissions for a user\",\n        \"description\": \"Checks the repository permission of a collaborator. The possible repository permissions are `admin`, `write`, `read`, and `none`.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-collaborator-permission-level\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-repository-permissions-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"if user has admin permissions\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository-collaborator-permission\"\n                },\n                \"examples\": {\n                  \"response-if-user-has-admin-permissions\": {\n                    \"$ref\": \"#/components/examples/repository-collaborator-permission-response-if-user-has-admin-permissions\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"collaborators\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/comments\": {\n      \"get\": {\n        \"summary\": \"List commit comments for a repository\",\n        \"description\": \"Commit Comments use [these custom media types](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/).\\n\\nComments are ordered by ascending ID.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-commit-comments-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commit-comments-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/commit-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/comments/{comment_id}\": {\n      \"get\": {\n        \"summary\": \"Get a commit comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-commit-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-commit-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/commit-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-comment\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a commit comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-commit-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-commit-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The contents of the comment\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Nice change\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/commit-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-comment-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"comments\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a commit comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-commit-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-commit-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"comments\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/comments/{comment_id}/reactions\": {\n      \"get\": {\n        \"summary\": \"List reactions for a commit comment\",\n        \"description\": \"List the reactions to a [commit comment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#comments).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/list-for-commit-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-commit-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          },\n          {\n            \"name\": \"content\",\n            \"description\": \"Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"+1\",\n                \"-1\",\n                \"laugh\",\n                \"confused\",\n                \"heart\",\n                \"hooray\",\n                \"rocket\",\n                \"eyes\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/reaction\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create reaction for a commit comment\",\n        \"description\": \"Create a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#comments). A response with an HTTP `200` status means that you already added the reaction type to this commit comment.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/create-for-commit-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-commit-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the commit comment.\",\n                    \"enum\": [\n                      \"+1\",\n                      \"-1\",\n                      \"laugh\",\n                      \"confused\",\n                      \"heart\",\n                      \"hooray\",\n                      \"rocket\",\n                      \"eyes\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"heart\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Reaction exists\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Reaction created\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\": {\n      \"delete\": {\n        \"summary\": \"Delete a commit comment reaction\",\n        \"description\": \"**Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.\\n\\nDelete a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#comments).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/delete-for-commit-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-a-commit-comment-reaction\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/reaction-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits\": {\n      \"get\": {\n        \"summary\": \"List commits\",\n        \"description\": \"**Signature verification object**\\n\\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\\n\\n| Name | Type | Description |\\n| ---- | ---- | ----------- |\\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\\n| `signature` | `string` | The signature that was extracted from the commit. |\\n| `payload` | `string` | The value that was signed. |\\n\\nThese are the possible values for `reason` in the `verification` object:\\n\\n| Value | Description |\\n| ----- | ----------- |\\n| `expired_key` | The key that made the signature is expired. |\\n| `not_signing_key` | The \\\"signing\\\" flag is not among the usage flags in the GPG key that made the signature. |\\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\\n| `unsigned` | The object does not include a signature. |\\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\\n| `no_user` | No user was associated with the `committer` email address in the commit. |\\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\\n| `malformed_signature` | There was an error parsing the signature. |\\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-commits\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commits\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"sha\",\n            \"description\": \"SHA or branch to start listing commits from. Default: the repository’s default branch (usually `master`).\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"path\",\n            \"description\": \"Only commits containing this file path will be returned.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"author\",\n            \"description\": \"GitHub login or email address by which to filter by commit author.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"name\": \"until\",\n            \"description\": \"Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"format\": \"date-time\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/commit\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"500\": {\n            \"$ref\": \"#/components/responses/internal_error\"\n          },\n          \"400\": {\n            \"$ref\": \"#/components/responses/bad_request\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"409\": {\n            \"$ref\": \"#/components/responses/conflict\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"commits\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\": {\n      \"get\": {\n        \"summary\": \"List branches for HEAD commit\",\n        \"description\": \"Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nReturns all branches where the given commit SHA is the HEAD, or latest commit for the branch.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-branches-for-head-commit\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-branches-for-head-commit\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/commit-sha\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/branch-short\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/branch-short-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"commits\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"groot\",\n              \"note\": \"Listing branches or pull requests for a commit in the Commits API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/) for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.groot-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits/{commit_sha}/comments\": {\n      \"get\": {\n        \"summary\": \"List commit comments\",\n        \"description\": \"Use the `:commit_sha` to specify the commit that will have its comments listed.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-comments-for-commit\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commit-comments\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/commit-sha\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/commit-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a commit comment\",\n        \"description\": \"Create a comment for a commit using its `:commit_sha`.\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-commit-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-commit-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/commit-sha\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The contents of the comment.\"\n                  },\n                  \"path\": {\n                    \"type\": \"string\",\n                    \"description\": \"Relative path of the file to comment on.\"\n                  },\n                  \"position\": {\n                    \"type\": \"integer\",\n                    \"description\": \"Line index in the diff to comment on.\"\n                  },\n                  \"line\": {\n                    \"type\": \"integer\",\n                    \"description\": \"**Deprecated**. Use **position** parameter instead. Line number in the file to comment on.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Great stuff\",\n                \"path\": \"file1.txt\",\n                \"position\": 4,\n                \"line\": 1\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/commit-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-comment\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/comments/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"comments\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits/{commit_sha}/pulls\": {\n      \"get\": {\n        \"summary\": \"List pull requests associated with a commit\",\n        \"description\": \"Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results may include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests) endpoint.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-pull-requests-associated-with-commit\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-pull-requests-associated-with-a-commit\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/commit-sha\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/pull-request-simple\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-simple-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"commits\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"groot\",\n              \"note\": \"Listing branches or pull requests for a commit in the Commits API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/) for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.groot-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits/{ref}\": {\n      \"get\": {\n        \"summary\": \"Get a commit\",\n        \"description\": \"Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.\\n\\n**Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.\\n\\nYou can pass the appropriate [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to  fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property.\\n\\nTo return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.\\n\\n**Signature verification object**\\n\\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\\n\\n| Name | Type | Description |\\n| ---- | ---- | ----------- |\\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\\n| `signature` | `string` | The signature that was extracted from the commit. |\\n| `payload` | `string` | The value that was signed. |\\n\\nThese are the possible values for `reason` in the `verification` object:\\n\\n| Value | Description |\\n| ----- | ----------- |\\n| `expired_key` | The key that made the signature is expired. |\\n| `not_signing_key` | The \\\"signing\\\" flag is not among the usage flags in the GPG key that made the signature. |\\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\\n| `unsigned` | The object does not include a signature. |\\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\\n| `no_user` | No user was associated with the `committer` email address in the commit. |\\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\\n| `malformed_signature` | There was an error parsing the signature. |\\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-commit\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-commit\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/commit\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"500\": {\n            \"$ref\": \"#/components/responses/internal_error\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"commits\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits/{ref}/check-runs\": {\n      \"get\": {\n        \"summary\": \"List check runs for a Git reference\",\n        \"description\": \"**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\\n\\nLists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/list-for-ref\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#list-check-runs-for-a-git-reference\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-name\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/status\"\n          },\n          {\n            \"name\": \"filter\",\n            \"description\": \"Filters check runs by their `completed_at` timestamp. Can be one of `latest` (returning the most recent check runs) or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"latest\",\n                \"all\"\n              ],\n              \"default\": \"latest\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"name\": \"app_id\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"check_runs\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"check_runs\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/check-run\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-run-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"runs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits/{ref}/check-suites\": {\n      \"get\": {\n        \"summary\": \"List check suites for a Git reference\",\n        \"description\": \"**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\\n\\nLists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository.\",\n        \"tags\": [\n          \"checks\"\n        ],\n        \"operationId\": \"checks/list-suites-for-ref\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/checks#list-check-suites-for-a-git-reference\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          },\n          {\n            \"name\": \"app_id\",\n            \"description\": \"Filters check suites by GitHub App `id`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"integer\"\n            },\n            \"example\": 1\n          },\n          {\n            \"$ref\": \"#/components/parameters/check-name\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"check_suites\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"check_suites\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/check-suite\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/check-suite-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"checks\",\n          \"subcategory\": \"suites\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits/{ref}/status\": {\n      \"get\": {\n        \"summary\": \"Get the combined status for a specific reference\",\n        \"description\": \"Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.\\n\\n\\nAdditionally, a combined `state` is returned. The `state` is one of:\\n\\n*   **failure** if any of the contexts report as `error` or `failure`\\n*   **pending** if there are no statuses or a context is `pending`\\n*   **success** if the latest status for all contexts is `success`\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-combined-status-for-ref\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-combined-status-for-a-specific-reference\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/combined-commit-status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/combined-commit-status\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"statuses\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/commits/{ref}/statuses\": {\n      \"get\": {\n        \"summary\": \"List commit statuses for a reference\",\n        \"description\": \"Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.\\n\\nThis resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-commit-statuses-for-ref\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commit-statuses-for-a-reference\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/status\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/status-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"301\": {\n            \"$ref\": \"#/components/responses/moved_permanently\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"statuses\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/compare/{basehead}\": {\n      \"get\": {\n        \"summary\": \"Compare two commits\",\n        \"description\": \"The `basehead` param is comprised of two parts: `base` and `head`. Both must be branch names in `repo`. To compare branches across other repositories in the same network as `repo`, use the format `<USERNAME>:branch`.\\n\\nThe response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.\\n\\nThe response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.\\n\\n**Working with large comparisons**\\n\\nThe response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commits) to enumerate all commits in the range.\\n\\nFor comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long\\nto generate. You can typically resolve this error by using a smaller commit range.\\n\\n**Signature verification object**\\n\\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\\n\\n| Name | Type | Description |\\n| ---- | ---- | ----------- |\\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\\n| `signature` | `string` | The signature that was extracted from the commit. |\\n| `payload` | `string` | The value that was signed. |\\n\\nThese are the possible values for `reason` in the `verification` object:\\n\\n| Value | Description |\\n| ----- | ----------- |\\n| `expired_key` | The key that made the signature is expired. |\\n| `not_signing_key` | The \\\"signing\\\" flag is not among the usage flags in the GPG key that made the signature. |\\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\\n| `unsigned` | The object does not include a signature. |\\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\\n| `no_user` | No user was associated with the `committer` email address in the commit. |\\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\\n| `malformed_signature` | There was an error parsing the signature. |\\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/compare-commits\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#compare-two-commits\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"basehead\",\n            \"description\": \"The base branch and head branch to compare. This parameter expects the format `{base}...{head}`.\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/commit-comparison\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-comparison\"\n                  }\n                }\n              }\n            }\n          },\n          \"500\": {\n            \"$ref\": \"#/components/responses/internal_error\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"commits\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\": {\n      \"post\": {\n        \"summary\": \"Create a content attachment\",\n        \"description\": \"Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#content_reference) to create an attachment.\\n\\nThe app must create a content attachment within six hours of the content reference URL being posted. See \\\"[Using content attachments](https://docs.github.com/enterprise-server@3.0/apps/using-content-attachments/)\\\" for details about content attachments.\\n\\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/create-content-attachment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-content-attachment\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"owner\",\n            \"description\": \"The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"repo\",\n            \"description\": \"The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"content_reference_id\",\n            \"description\": \"The `id` of the `content_reference` event.\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"title\": {\n                    \"description\": \"The title of the attachment\",\n                    \"type\": \"string\",\n                    \"maxLength\": 1024,\n                    \"examples\": [\n                      \"Title of the attachment\"\n                    ]\n                  },\n                  \"body\": {\n                    \"description\": \"The body of the attachment\",\n                    \"type\": \"string\",\n                    \"maxLength\": 262144,\n                    \"examples\": [\n                      \"Body of the attachment\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"title\",\n                  \"body\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/content-reference-attachment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/content-reference-attachment\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"corsair\",\n              \"note\": \"To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.corsair-preview+json\\n```\"\n            }\n          ],\n          \"category\": \"apps\",\n          \"subcategory\": \"installations\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/contents/{path}\": {\n      \"get\": {\n        \"summary\": \"Get repository content\",\n        \"description\": \"Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit\\n`:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. \\n\\nFiles and symlinks support [a custom media type](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types) for\\nretrieving the raw content or rendered HTML (when supported). All content types support [a custom media\\ntype](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent\\nobject format.\\n\\n**Note**:\\n*   To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/enterprise-server@3.0/rest/reference/git#trees).\\n*   This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees\\nAPI](https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-tree).\\n*   This API supports files up to 1 megabyte in size.\\n\\n#### If the content is a directory\\nThe response will be an array of objects, one object for each item in the directory.\\nWhen listing the contents of a directory, submodules have their \\\"type\\\" specified as \\\"file\\\". Logically, the value\\n_should_ be \\\"submodule\\\". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW).\\nIn the next major version of the API, the type will be returned as \\\"submodule\\\".\\n\\n#### If the content is a symlink \\nIf the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the\\nAPI responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object \\ndescribing the symlink itself.\\n\\n#### If the content is a submodule\\nThe `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific\\ncommit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out\\nthe submodule at that specific commit.\\n\\nIf the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links[\\\"git\\\"]`) and the\\ngithub.com URLs (`html_url` and `_links[\\\"html\\\"]`) will have null values.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-content\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-repository-content\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"path\",\n            \"description\": \"path parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/vnd.github.v3.object\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/content-tree\"\n                }\n              },\n              \"application/json\": {\n                \"schema\": {\n                  \"oneOf\": [\n                    {\n                      \"$ref\": \"#/components/schemas/content-directory\"\n                    },\n                    {\n                      \"$ref\": \"#/components/schemas/content-file\"\n                    },\n                    {\n                      \"$ref\": \"#/components/schemas/content-symlink\"\n                    },\n                    {\n                      \"$ref\": \"#/components/schemas/content-submodule\"\n                    }\n                  ]\n                },\n                \"examples\": {\n                  \"response-if-content-is-a-file\": {\n                    \"$ref\": \"#/components/examples/content-file-response-if-content-is-a-file\"\n                  },\n                  \"response-if-content-is-a-directory\": {\n                    \"$ref\": \"#/components/examples/content-file-response-if-content-is-a-directory\"\n                  },\n                  \"response-if-content-is-a-symlink\": {\n                    \"$ref\": \"#/components/examples/content-file-response-if-content-is-a-symlink\"\n                  },\n                  \"response-if-content-is-a-submodule\": {\n                    \"$ref\": \"#/components/examples/content-file-response-if-content-is-a-submodule\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"302\": {\n            \"$ref\": \"#/components/responses/found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"contents\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Create or update file contents\",\n        \"description\": \"Creates a new file or replaces an existing file in a repository.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-or-update-file-contents\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-or-update-file-contents\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"path\",\n            \"description\": \"path parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"message\": {\n                    \"type\": \"string\",\n                    \"description\": \"The commit message.\"\n                  },\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The new file content, using Base64 encoding.\"\n                  },\n                  \"sha\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Required if you are updating a file**. The blob SHA of the file being replaced.\"\n                  },\n                  \"branch\": {\n                    \"type\": \"string\",\n                    \"description\": \"The branch name. Default: the repository’s default branch (usually `master`)\"\n                  },\n                  \"committer\": {\n                    \"type\": \"object\",\n                    \"description\": \"The person that committed the file. Default: the authenticated user.\",\n                    \"properties\": {\n                      \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted.\"\n                      },\n                      \"email\": {\n                        \"type\": \"string\",\n                        \"description\": \"The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted.\"\n                      },\n                      \"date\": {\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"\\\"2013-01-05T13:13:22+05:00\\\"\"\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"name\",\n                      \"email\"\n                    ]\n                  },\n                  \"author\": {\n                    \"type\": \"object\",\n                    \"description\": \"The author of the file. Default: The `committer` or the authenticated user if you omit `committer`.\",\n                    \"properties\": {\n                      \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted.\"\n                      },\n                      \"email\": {\n                        \"type\": \"string\",\n                        \"description\": \"The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted.\"\n                      },\n                      \"date\": {\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"\\\"2013-01-15T17:13:22+05:00\\\"\"\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"name\",\n                      \"email\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"message\",\n                  \"content\"\n                ]\n              },\n              \"examples\": {\n                \"example-for-creating-a-file\": {\n                  \"summary\": \"Example for creating a file\",\n                  \"value\": {\n                    \"message\": \"my commit message\",\n                    \"committer\": {\n                      \"name\": \"Monalisa Octocat\",\n                      \"email\": \"octocat@github.com\"\n                    },\n                    \"content\": \"bXkgbmV3IGZpbGUgY29udGVudHM=\"\n                  }\n                },\n                \"example-for-updating-a-file\": {\n                  \"summary\": \"Example for updating a file\",\n                  \"value\": {\n                    \"message\": \"a new commit message\",\n                    \"committer\": {\n                      \"name\": \"Monalisa Octocat\",\n                      \"email\": \"octocat@github.com\"\n                    },\n                    \"content\": \"bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz\",\n                    \"sha\": \"95b966ae1c166bd92f8ae7d1c313e738c731dfc3\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/file-commit\"\n                },\n                \"examples\": {\n                  \"example-for-updating-a-file\": {\n                    \"$ref\": \"#/components/examples/file-commit-example-for-updating-a-file\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/file-commit\"\n                },\n                \"examples\": {\n                  \"example-for-creating-a-file\": {\n                    \"$ref\": \"#/components/examples/file-commit-example-for-creating-a-file\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"409\": {\n            \"$ref\": \"#/components/responses/conflict\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"contents\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a file\",\n        \"description\": \"Deletes a file in a repository.\\n\\nYou can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.\\n\\nThe `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.\\n\\nYou must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-file\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-file\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"path\",\n            \"description\": \"path parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"message\": {\n                    \"type\": \"string\",\n                    \"description\": \"The commit message.\"\n                  },\n                  \"sha\": {\n                    \"type\": \"string\",\n                    \"description\": \"The blob SHA of the file being replaced.\"\n                  },\n                  \"branch\": {\n                    \"type\": \"string\",\n                    \"description\": \"The branch name. Default: the repository’s default branch (usually `master`)\"\n                  },\n                  \"committer\": {\n                    \"type\": \"object\",\n                    \"description\": \"object containing information about the committer.\",\n                    \"properties\": {\n                      \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"The name of the author (or committer) of the commit\"\n                      },\n                      \"email\": {\n                        \"type\": \"string\",\n                        \"description\": \"The email of the author (or committer) of the commit\"\n                      }\n                    }\n                  },\n                  \"author\": {\n                    \"type\": \"object\",\n                    \"description\": \"object containing information about the author.\",\n                    \"properties\": {\n                      \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"The name of the author (or committer) of the commit\"\n                      },\n                      \"email\": {\n                        \"type\": \"string\",\n                        \"description\": \"The email of the author (or committer) of the commit\"\n                      }\n                    }\n                  }\n                },\n                \"required\": [\n                  \"message\",\n                  \"sha\"\n                ]\n              },\n              \"example\": {\n                \"message\": \"my commit message\",\n                \"committer\": {\n                  \"name\": \"Monalisa Octocat\",\n                  \"email\": \"octocat@github.com\"\n                },\n                \"sha\": \"329688480d39049927147c162b9d2deaf885005f\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/file-commit\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/file-commit\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"409\": {\n            \"$ref\": \"#/components/responses/conflict\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"contents\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/contributors\": {\n      \"get\": {\n        \"summary\": \"List repository contributors\",\n        \"description\": \"Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance.\\n\\nGitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-contributors\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-contributors\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"anon\",\n            \"description\": \"Set to `1` or `true` to include anonymous contributors in results.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"if repository contains content\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/contributor\"\n                  }\n                },\n                \"examples\": {\n                  \"response-if-repository-contains-content\": {\n                    \"$ref\": \"#/components/examples/contributor-items-response-if-repository-contains-content\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"204\": {\n            \"description\": \"Response if repository is empty\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/deployments\": {\n      \"get\": {\n        \"summary\": \"List deployments\",\n        \"description\": \"Simple filtering of deployments is available via query parameters:\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-deployments\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-deployments\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"sha\",\n            \"description\": \"The SHA recorded at creation time.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"none\"\n            }\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"The name of the ref. This can be a branch, tag, or SHA.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"none\"\n            }\n          },\n          {\n            \"name\": \"task\",\n            \"description\": \"The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"none\"\n            }\n          },\n          {\n            \"name\": \"environment\",\n            \"description\": \"The name of the environment that was deployed to (e.g., `staging` or `production`).\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": [\n                \"string\",\n                \"null\"\n              ],\n              \"default\": \"none\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/deployment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/deployment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"deployments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"ant-man\",\n              \"note\": \"The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\\n\\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.ant-man-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a deployment\",\n        \"description\": \"Deployments offer a few configurable parameters with certain defaults.\\n\\nThe `ref` parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\\nbefore we merge a pull request.\\n\\nThe `environment` parameter allows deployments to be issued to different runtime environments. Teams often have\\nmultiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter\\nmakes it easier to track which environments have requested deployments. The default environment is `production`.\\n\\nThe `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If\\nthe ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\\nreturn a failure response.\\n\\nBy default, [commit statuses](https://docs.github.com/enterprise-server@3.0/rest/reference/commits#commit-statuses) for every submitted context must be in a `success`\\nstate. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to\\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\\nnot require any contexts or create any commit statuses, the deployment will always succeed.\\n\\nThe `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text\\nfield that will be passed on when a deployment event is dispatched.\\n\\nThe `task` parameter is used by the deployment system to allow different execution paths. In the web world this might\\nbe `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an\\napplication with debugging enabled.\\n\\nUsers with `repo` or `repo_deployment` scopes can create a deployment for a given ref.\\n\\n#### Merged branch response\\nYou will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\\na deployment. This auto-merge happens when:\\n*   Auto-merge option is enabled in the repository\\n*   Topic branch does not include the latest changes on the base branch, which is `master` in the response example\\n*   There are no merge conflicts\\n\\nIf there are no new commits in the base branch, a new request to create a deployment should give a successful\\nresponse.\\n\\n#### Merge conflict response\\nThis error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't\\nbe merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts.\\n\\n#### Failed commit status checks\\nThis error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success`\\nstatus for the commit to be deployed, but one or more of the required contexts do not have a state of `success`.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-deployment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-deployment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"ref\": {\n                    \"type\": \"string\",\n                    \"description\": \"The ref to deploy. This can be a branch, tag, or SHA.\"\n                  },\n                  \"task\": {\n                    \"type\": \"string\",\n                    \"description\": \"Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).\",\n                    \"default\": \"deploy\"\n                  },\n                  \"auto_merge\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch.\",\n                    \"default\": true\n                  },\n                  \"required_contexts\": {\n                    \"type\": \"array\",\n                    \"description\": \"The [status](https://docs.github.com/enterprise-server@3.0/rest/reference/commits#commit-statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"payload\": {\n                    \"oneOf\": [\n                      {\n                        \"type\": \"object\",\n                        \"additionalProperties\": true\n                      },\n                      {\n                        \"type\": \"string\",\n                        \"description\": \"JSON payload with extra information about the deployment.\",\n                        \"default\": \"\"\n                      }\n                    ]\n                  },\n                  \"environment\": {\n                    \"type\": \"string\",\n                    \"description\": \"Name for the target deployment environment (e.g., `production`, `staging`, `qa`).\",\n                    \"default\": \"production\"\n                  },\n                  \"description\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"description\": \"Short description of the deployment.\",\n                    \"default\": \"\"\n                  },\n                  \"transient_environment\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`  \\n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments) custom media type.\",\n                    \"default\": false\n                  },\n                  \"production_environment\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.  \\n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments) custom media type.\"\n                  }\n                },\n                \"required\": [\n                  \"ref\"\n                ]\n              },\n              \"examples\": {\n                \"simple-example\": {\n                  \"summary\": \"Simple example\",\n                  \"value\": {\n                    \"ref\": \"topic-branch\",\n                    \"payload\": \"{ \\\"deploy\\\": \\\"migrate\\\" }\",\n                    \"description\": \"Deploy request from hubot\"\n                  }\n                },\n                \"advanced-example\": {\n                  \"summary\": \"Advanced example\",\n                  \"value\": {\n                    \"ref\": \"topic-branch\",\n                    \"auto_merge\": false,\n                    \"payload\": \"{ \\\"deploy\\\": \\\"migrate\\\" }\",\n                    \"description\": \"Deploy request from hubot\",\n                    \"required_contexts\": [\n                      \"ci/janky\",\n                      \"security/brakeman\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/deployment\"\n                },\n                \"examples\": {\n                  \"simple-example\": {\n                    \"$ref\": \"#/components/examples/deployment-simple-example\"\n                  }\n                }\n              }\n            }\n          },\n          \"202\": {\n            \"description\": \"Merged branch response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"merged-branch-response\": {\n                    \"value\": {\n                      \"message\": \"Auto-merged master into topic-branch on deployment.\"\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"409\": {\n            \"description\": \"Conflict when there is a merge conflict or the commit's status checks failed\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"deployments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"ant-man\",\n              \"note\": \"The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\\n\\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.ant-man-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/deployments/{deployment_id}\": {\n      \"get\": {\n        \"summary\": \"Get a deployment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-deployment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-deployment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/deployment-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/deployment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/deployment\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"deployments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"flash\",\n              \"note\": \"New features in the Deployments API on GitHub are currently available during a public beta. Please see the [blog post](https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/) for full details.\\n\\nTo access the new `environment` parameter, the two new values for the `state` parameter (`in_progress` and `queued`), and use `auto_inactive` on production deployments during the public beta period, you must provide the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.flash-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"ant-man\",\n              \"note\": \"The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\\n\\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.ant-man-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a deployment\",\n        \"description\": \"If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with `repo` or `repo_deployment` scopes can delete a deployment.\\n\\nTo set a deployment as inactive, you must:\\n\\n*   Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.\\n*   Mark the active deployment as inactive by adding any non-successful deployment status.\\n\\nFor more information, see \\\"[Create a deployment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/#create-a-deployment)\\\" and \\\"[Create a deployment status](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-deployment-status).\\\"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-deployment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-deployment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/deployment-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"deployments\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses\": {\n      \"get\": {\n        \"summary\": \"List deployment statuses\",\n        \"description\": \"Users with pull access can view deployment statuses for a deployment:\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-deployment-statuses\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-deployment-statuses\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/deployment-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/deployment-status\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/deployment-status-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"deployments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"flash\",\n              \"note\": \"New features in the Deployments API on GitHub are currently available during a public beta. Please see the [blog post](https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/) for full details.\\n\\nTo access the new `environment` parameter, the two new values for the `state` parameter (`in_progress` and `queued`), and use `auto_inactive` on production deployments during the public beta period, you must provide the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.flash-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"ant-man\",\n              \"note\": \"The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\\n\\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.ant-man-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a deployment status\",\n        \"description\": \"Users with `push` access can create deployment statuses for a given deployment.\\n\\nGitHub Apps require `read & write` access to \\\"Deployments\\\" and `read-only` access to \\\"Repo contents\\\" (for private repos). OAuth Apps require the `repo_deployment` scope.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-deployment-status\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-deployment-status\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/deployment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"state\": {\n                    \"type\": \"string\",\n                    \"description\": \"The state of the status. Can be one of `error`, `failure`, `inactive`, `in_progress`, `queued`, `pending`, or `success`. **Note:** To use the `inactive` state, you must provide the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments) custom media type. When you set a transient deployment to `inactive`, the deployment will be shown as `destroyed` in GitHub.\",\n                    \"enum\": [\n                      \"error\",\n                      \"failure\",\n                      \"inactive\",\n                      \"in_progress\",\n                      \"queued\",\n                      \"pending\",\n                      \"success\"\n                    ]\n                  },\n                  \"target_url\": {\n                    \"type\": \"string\",\n                    \"description\": \"The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the `log_url` parameter, which replaces `target_url`.\",\n                    \"default\": \"\"\n                  },\n                  \"log_url\": {\n                    \"type\": \"string\",\n                    \"description\": \"The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `\\\"\\\"`  \\n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments) custom media type.\",\n                    \"default\": \"\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A short description of the status. The maximum description length is 140 characters.\",\n                    \"default\": \"\"\n                  },\n                  \"environment\": {\n                    \"type\": \"string\",\n                    \"description\": \"Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`.\",\n                    \"enum\": [\n                      \"production\",\n                      \"staging\",\n                      \"qa\"\n                    ]\n                  },\n                  \"environment_url\": {\n                    \"type\": \"string\",\n                    \"description\": \"Sets the URL for accessing your environment. Default: `\\\"\\\"`  \\n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments) custom media type.\",\n                    \"default\": \"\"\n                  },\n                  \"auto_inactive\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` \\n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments) custom media type.\"\n                  }\n                },\n                \"required\": [\n                  \"state\"\n                ]\n              },\n              \"example\": {\n                \"environment\": \"production\",\n                \"state\": \"success\",\n                \"log_url\": \"https://example.com/deployment/42/output\",\n                \"description\": \"Deployment finished successfully.\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/deployment-status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/deployment-status\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/example/deployments/42/statuses/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"deployments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"flash\",\n              \"note\": \"New features in the Deployments API on GitHub are currently available during a public beta. Please see the [blog post](https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/) for full details.\\n\\nTo access the new `environment` parameter, the two new values for the `state` parameter (`in_progress` and `queued`), and use `auto_inactive` on production deployments during the public beta period, you must provide the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.flash-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"ant-man\",\n              \"note\": \"The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\\n\\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.ant-man-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\": {\n      \"get\": {\n        \"summary\": \"Get a deployment status\",\n        \"description\": \"Users with pull access can view a deployment status for a deployment:\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-deployment-status\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-deployment-status\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/deployment-id\"\n          },\n          {\n            \"name\": \"status_id\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/deployment-status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/deployment-status\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"deployments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"flash\",\n              \"note\": \"New features in the Deployments API on GitHub are currently available during a public beta. Please see the [blog post](https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/) for full details.\\n\\nTo access the new `environment` parameter, the two new values for the `state` parameter (`in_progress` and `queued`), and use `auto_inactive` on production deployments during the public beta period, you must provide the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.flash-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"ant-man\",\n              \"note\": \"The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\\n\\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.ant-man-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/dispatches\": {\n      \"post\": {\n        \"summary\": \"Create a repository dispatch event\",\n        \"description\": \"You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub Enterprise Server to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see \\\"[RepositoryDispatchEvent](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#repository_dispatch).\\\"\\n\\nThe `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow.\\n\\nThis endpoint requires write access to the repository by providing either:\\n\\n  - Personal access tokens with `repo` scope. For more information, see \\\"[Creating a personal access token for the command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line)\\\" in the GitHub Help documentation.\\n  - GitHub Apps with both `metadata:read` and `contents:read&write` permissions.\\n\\nThis input example shows how you can use the `client_payload` as a test to debug your workflow.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-dispatch-event\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-dispatch-event\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"required\": [\n                  \"event_type\"\n                ],\n                \"properties\": {\n                  \"event_type\": {\n                    \"type\": \"string\",\n                    \"description\": \"A custom webhook event name.\",\n                    \"minLength\": 1,\n                    \"maxLength\": 100\n                  },\n                  \"client_payload\": {\n                    \"type\": \"object\",\n                    \"description\": \"JSON payload with extra information about the webhook event that your action or worklow may use.\",\n                    \"additionalProperties\": true,\n                    \"maxProperties\": 10\n                  }\n                }\n              },\n              \"example\": {\n                \"event_type\": \"on-demand-test\",\n                \"client_payload\": {\n                  \"unit\": false,\n                  \"integration\": true\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/events\": {\n      \"get\": {\n        \"summary\": \"List repository events\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-repo-events\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repository-events\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/forks\": {\n      \"get\": {\n        \"summary\": \"List forks\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-forks\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-forks\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"The sort order. Can be either `newest`, `oldest`, or `stargazers`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"newest\",\n                \"oldest\",\n                \"stargazers\",\n                \"watchers\"\n              ],\n              \"default\": \"newest\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/minimal-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository-items-2\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"400\": {\n            \"$ref\": \"#/components/responses/bad_request\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"forks\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a fork\",\n        \"description\": \"Create a fork for the authenticated user.\\n\\n**Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-fork\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-fork\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"organization\": {\n                    \"type\": \"string\",\n                    \"description\": \"Optional parameter to specify the organization name if forking into an organization.\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/full-repository\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/full-repository\"\n                  }\n                }\n              }\n            }\n          },\n          \"400\": {\n            \"$ref\": \"#/components/responses/bad_request\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"forks\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/blobs\": {\n      \"post\": {\n        \"summary\": \"Create a blob\",\n        \"description\": \"\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/create-blob\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-blob\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The new blob's content.\"\n                  },\n                  \"encoding\": {\n                    \"type\": \"string\",\n                    \"description\": \"The encoding used for `content`. Currently, `\\\"utf-8\\\"` and `\\\"base64\\\"` are supported.\",\n                    \"default\": \"utf-8\"\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"Content of the blob\",\n                \"encoding\": \"utf-8\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/short-blob\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/short-blob\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/example/git/blobs/3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"409\": {\n            \"$ref\": \"#/components/responses/conflict\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"blobs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/blobs/{file_sha}\": {\n      \"get\": {\n        \"summary\": \"Get a blob\",\n        \"description\": \"The `content` in the response will always be Base64 encoded.\\n\\n_Note_: This API supports blobs up to 100 megabytes in size.\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/get-blob\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-blob\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"file_sha\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/blob\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/blob\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"blobs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/commits\": {\n      \"post\": {\n        \"summary\": \"Create a commit\",\n        \"description\": \"Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects).\\n\\n**Signature verification object**\\n\\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\\n\\n| Name | Type | Description |\\n| ---- | ---- | ----------- |\\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\\n| `signature` | `string` | The signature that was extracted from the commit. |\\n| `payload` | `string` | The value that was signed. |\\n\\nThese are the possible values for `reason` in the `verification` object:\\n\\n| Value | Description |\\n| ----- | ----------- |\\n| `expired_key` | The key that made the signature is expired. |\\n| `not_signing_key` | The \\\"signing\\\" flag is not among the usage flags in the GPG key that made the signature. |\\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\\n| `unsigned` | The object does not include a signature. |\\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\\n| `no_user` | No user was associated with the `committer` email address in the commit. |\\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\\n| `malformed_signature` | There was an error parsing the signature. |\\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/create-commit\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-commit\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"message\": {\n                    \"type\": \"string\",\n                    \"description\": \"The commit message\"\n                  },\n                  \"tree\": {\n                    \"type\": \"string\",\n                    \"description\": \"The SHA of the tree object this commit points to\"\n                  },\n                  \"parents\": {\n                    \"type\": \"array\",\n                    \"description\": \"The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"author\": {\n                    \"type\": \"object\",\n                    \"description\": \"Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details.\",\n                    \"properties\": {\n                      \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"The name of the author (or committer) of the commit\"\n                      },\n                      \"email\": {\n                        \"type\": \"string\",\n                        \"description\": \"The email of the author (or committer) of the commit\"\n                      },\n                      \"date\": {\n                        \"type\": \"string\",\n                        \"format\": \"date-time\",\n                        \"description\": \"Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                      }\n                    },\n                    \"required\": [\n                      \"name\",\n                      \"email\"\n                    ]\n                  },\n                  \"committer\": {\n                    \"type\": \"object\",\n                    \"description\": \"Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details.\",\n                    \"properties\": {\n                      \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"The name of the author (or committer) of the commit\"\n                      },\n                      \"email\": {\n                        \"type\": \"string\",\n                        \"description\": \"The email of the author (or committer) of the commit\"\n                      },\n                      \"date\": {\n                        \"type\": \"string\",\n                        \"format\": \"date-time\",\n                        \"description\": \"Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                      }\n                    }\n                  },\n                  \"signature\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits.\"\n                  }\n                },\n                \"required\": [\n                  \"message\",\n                  \"tree\"\n                ]\n              },\n              \"example\": {\n                \"message\": \"my commit message\",\n                \"author\": {\n                  \"name\": \"Mona Octocat\",\n                  \"email\": \"octocat@github.com\",\n                  \"date\": \"2008-07-09T16:13:30+12:00\"\n                },\n                \"parents\": [\n                  \"7d1b31e74ee336d15cbd21741bc88a537ed063a0\"\n                ],\n                \"tree\": \"827efc6d56897b048c772eb4087f854f46256132\",\n                \"signature\": \"-----BEGIN PGP SIGNATURE-----\\n\\niQIzBAABAQAdFiEESn/54jMNIrGSE6Tp6cQjvhfv7nAFAlnT71cACgkQ6cQjvhfv\\n7nCWwA//XVqBKWO0zF+bZl6pggvky3Oc2j1pNFuRWZ29LXpNuD5WUGXGG209B0hI\\nDkmcGk19ZKUTnEUJV2Xd0R7AW01S/YSub7OYcgBkI7qUE13FVHN5ln1KvH2all2n\\n2+JCV1HcJLEoTjqIFZSSu/sMdhkLQ9/NsmMAzpf/iIM0nQOyU4YRex9eD1bYj6nA\\nOQPIDdAuaTQj1gFPHYLzM4zJnCqGdRlg0sOM/zC5apBNzIwlgREatOYQSCfCKV7k\\nnrU34X8b9BzQaUx48Qa+Dmfn5KQ8dl27RNeWAqlkuWyv3pUauH9UeYW+KyuJeMkU\\n+NyHgAsWFaCFl23kCHThbLStMZOYEnGagrd0hnm1TPS4GJkV4wfYMwnI4KuSlHKB\\njHl3Js9vNzEUQipQJbgCgTiWvRJoK3ENwBTMVkKHaqT4x9U4Jk/XZB6Q8MA09ezJ\\n3QgiTjTAGcum9E9QiJqMYdWQPWkaBIRRz5cET6HPB48YNXAAUsfmuYsGrnVLYbG+\\nUpC6I97VybYHTy2O9XSGoaLeMI9CsFn38ycAxxbWagk5mhclNTP5mezIq6wKSwmr\\nX11FW3n1J23fWZn5HJMBsRnUCgzqzX3871IqLYHqRJ/bpZ4h20RhTyPj5c/z7QXp\\neSakNQMfbbMcljkha+ZMuVQX1K9aRlVqbmv3ZMWh+OijLYVU2bc=\\n=5Io4\\n-----END PGP SIGNATURE-----\\n\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-commit\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-commit\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"commits\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/commits/{commit_sha}\": {\n      \"get\": {\n        \"summary\": \"Get a commit\",\n        \"description\": \"Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects).\\n\\n**Signature verification object**\\n\\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\\n\\n| Name | Type | Description |\\n| ---- | ---- | ----------- |\\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\\n| `signature` | `string` | The signature that was extracted from the commit. |\\n| `payload` | `string` | The value that was signed. |\\n\\nThese are the possible values for `reason` in the `verification` object:\\n\\n| Value | Description |\\n| ----- | ----------- |\\n| `expired_key` | The key that made the signature is expired. |\\n| `not_signing_key` | The \\\"signing\\\" flag is not among the usage flags in the GPG key that made the signature. |\\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\\n| `unsigned` | The object does not include a signature. |\\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\\n| `no_user` | No user was associated with the `committer` email address in the commit. |\\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\\n| `malformed_signature` | There was an error parsing the signature. |\\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/get-commit\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-commit\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/commit-sha\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-commit\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-commit-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"commits\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/matching-refs/{ref}\": {\n      \"get\": {\n        \"summary\": \"List matching references\",\n        \"description\": \"Returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/<branch name>` for branches and `tags/<tag name>` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array.\\n\\nWhen you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`.\\n\\n**Note:** You need to explicitly [request a pull request](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see \\\"[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.0/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)\\\".\\n\\nIf you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`.\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/list-matching-refs\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#list-matching-references\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/git-ref\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-ref-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"refs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/ref/{ref}\": {\n      \"get\": {\n        \"summary\": \"Get a reference\",\n        \"description\": \"Returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/<branch name>` for branches and `tags/<tag name>` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned.\\n\\n**Note:** You need to explicitly [request a pull request](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see \\\"[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.0/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)\\\".\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/get-ref\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-reference\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-ref\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-ref\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"refs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/refs\": {\n      \"post\": {\n        \"summary\": \"Create a reference\",\n        \"description\": \"Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/create-ref\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-reference\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"ref\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected.\"\n                  },\n                  \"sha\": {\n                    \"type\": \"string\",\n                    \"description\": \"The SHA1 value for this reference.\"\n                  },\n                  \"key\": {\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"\\\"refs/heads/newbranch\\\"\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"ref\",\n                  \"sha\"\n                ]\n              },\n              \"example\": {\n                \"ref\": \"refs/heads/featureA\",\n                \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-ref\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-ref\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/git/refs/heads/featureA\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"refs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/refs/{ref}\": {\n      \"patch\": {\n        \"summary\": \"Update a reference\",\n        \"description\": \"\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/update-ref\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#update-a-reference\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"sha\": {\n                    \"type\": \"string\",\n                    \"description\": \"The SHA1 value to set this reference to\"\n                  },\n                  \"force\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work.\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"sha\"\n                ]\n              },\n              \"example\": {\n                \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n                \"force\": true\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-ref\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-ref\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"refs\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a reference\",\n        \"description\": \"\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/delete-ref\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#delete-a-reference\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"ref parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"refs\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/tags\": {\n      \"post\": {\n        \"summary\": \"Create a tag object\",\n        \"description\": \"Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary.\\n\\n**Signature verification object**\\n\\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\\n\\n| Name | Type | Description |\\n| ---- | ---- | ----------- |\\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\\n| `signature` | `string` | The signature that was extracted from the commit. |\\n| `payload` | `string` | The value that was signed. |\\n\\nThese are the possible values for `reason` in the `verification` object:\\n\\n| Value | Description |\\n| ----- | ----------- |\\n| `expired_key` | The key that made the signature is expired. |\\n| `not_signing_key` | The \\\"signing\\\" flag is not among the usage flags in the GPG key that made the signature. |\\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\\n| `unsigned` | The object does not include a signature. |\\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\\n| `no_user` | No user was associated with the `committer` email address in the commit. |\\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\\n| `malformed_signature` | There was an error parsing the signature. |\\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/create-tag\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-tag-object\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"tag\": {\n                    \"type\": \"string\",\n                    \"description\": \"The tag's name. This is typically a version (e.g., \\\"v0.0.1\\\").\"\n                  },\n                  \"message\": {\n                    \"type\": \"string\",\n                    \"description\": \"The tag message.\"\n                  },\n                  \"object\": {\n                    \"type\": \"string\",\n                    \"description\": \"The SHA of the git object this is tagging.\"\n                  },\n                  \"type\": {\n                    \"type\": \"string\",\n                    \"description\": \"The type of the object we're tagging. Normally this is a `commit` but it can also be a `tree` or a `blob`.\",\n                    \"enum\": [\n                      \"commit\",\n                      \"tree\",\n                      \"blob\"\n                    ]\n                  },\n                  \"tagger\": {\n                    \"type\": \"object\",\n                    \"description\": \"An object with information about the individual creating the tag.\",\n                    \"properties\": {\n                      \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"The name of the author of the tag\"\n                      },\n                      \"email\": {\n                        \"type\": \"string\",\n                        \"description\": \"The email of the author of the tag\"\n                      },\n                      \"date\": {\n                        \"type\": \"string\",\n                        \"format\": \"date-time\",\n                        \"description\": \"When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                      }\n                    },\n                    \"required\": [\n                      \"name\",\n                      \"email\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"tag\",\n                  \"message\",\n                  \"object\",\n                  \"type\"\n                ]\n              },\n              \"example\": {\n                \"tag\": \"v0.0.1\",\n                \"message\": \"initial version\",\n                \"object\": \"c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c\",\n                \"type\": \"commit\",\n                \"tagger\": {\n                  \"name\": \"Monalisa Octocat\",\n                  \"email\": \"octocat@github.com\",\n                  \"date\": \"2011-06-17T14:53:35-07:00\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-tag\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-tag\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"tags\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/tags/{tag_sha}\": {\n      \"get\": {\n        \"summary\": \"Get a tag\",\n        \"description\": \"**Signature verification object**\\n\\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\\n\\n| Name | Type | Description |\\n| ---- | ---- | ----------- |\\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\\n| `signature` | `string` | The signature that was extracted from the commit. |\\n| `payload` | `string` | The value that was signed. |\\n\\nThese are the possible values for `reason` in the `verification` object:\\n\\n| Value | Description |\\n| ----- | ----------- |\\n| `expired_key` | The key that made the signature is expired. |\\n| `not_signing_key` | The \\\"signing\\\" flag is not among the usage flags in the GPG key that made the signature. |\\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\\n| `unsigned` | The object does not include a signature. |\\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\\n| `no_user` | No user was associated with the `committer` email address in the commit. |\\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\\n| `malformed_signature` | There was an error parsing the signature. |\\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/get-tag\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-tag\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"tag_sha\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-tag\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-tag\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"tags\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/trees\": {\n      \"post\": {\n        \"summary\": \"Create a tree\",\n        \"description\": \"The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.\\n\\nIf you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see \\\"[Create a commit](https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-commit)\\\" and \\\"[Update a reference](https://docs.github.com/enterprise-server@3.0/rest/reference/git#update-a-reference).\\\"\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/create-tree\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-tree\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"tree\": {\n                    \"type\": \"array\",\n                    \"description\": \"Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure.\",\n                    \"items\": {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"path\": {\n                          \"type\": \"string\",\n                          \"description\": \"The file referenced in the tree.\"\n                        },\n                        \"mode\": {\n                          \"type\": \"string\",\n                          \"description\": \"The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink.\",\n                          \"enum\": [\n                            \"100644\",\n                            \"100755\",\n                            \"040000\",\n                            \"160000\",\n                            \"120000\"\n                          ]\n                        },\n                        \"type\": {\n                          \"type\": \"string\",\n                          \"description\": \"Either `blob`, `tree`, or `commit`.\",\n                          \"enum\": [\n                            \"blob\",\n                            \"tree\",\n                            \"commit\"\n                          ]\n                        },\n                        \"sha\": {\n                          \"type\": [\n                            \"string\",\n                            \"null\"\n                          ],\n                          \"description\": \"The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted.  \\n  \\n**Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error.\"\n                        },\n                        \"content\": {\n                          \"type\": \"string\",\n                          \"description\": \"The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`.  \\n  \\n**Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error.\"\n                        }\n                      }\n                    }\n                  },\n                  \"base_tree\": {\n                    \"type\": \"string\",\n                    \"description\": \"The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.\\nIf not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit.\\n\"\n                  }\n                },\n                \"required\": [\n                  \"tree\"\n                ]\n              },\n              \"example\": {\n                \"base_tree\": \"9fb037999f264ba9a7fc6274d15fa3ae2ab98312\",\n                \"tree\": [\n                  {\n                    \"path\": \"file.rb\",\n                    \"mode\": \"100644\",\n                    \"type\": \"blob\",\n                    \"sha\": \"44b4fc6d56897b048c772eb4087f854f46256132\"\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-tree\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/git-tree\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/trees/cd8274d15fa3ae2ab983129fb037999f264ba9a7\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"trees\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/git/trees/{tree_sha}\": {\n      \"get\": {\n        \"summary\": \"Get a tree\",\n        \"description\": \"Returns a single tree using the SHA1 value for that tree.\\n\\nIf `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.\",\n        \"tags\": [\n          \"git\"\n        ],\n        \"operationId\": \"git/get-tree\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-tree\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"tree_sha\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          },\n          {\n            \"name\": \"recursive\",\n            \"description\": \"Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in `:tree_sha`. For example, setting `recursive` to any of the following will enable returning objects or subtrees: `0`, `1`, `\\\"true\\\"`, and `\\\"false\\\"`. Omit this parameter to prevent recursively returning objects or subtrees.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/git-tree\"\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/git-tree-default-response\"\n                  },\n                  \"response-recursively-retrieving-a-tree\": {\n                    \"$ref\": \"#/components/examples/git-tree-response-recursively-retrieving-a-tree\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"git\",\n          \"subcategory\": \"trees\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/hooks\": {\n      \"get\": {\n        \"summary\": \"List repository webhooks\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-webhooks\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-webhooks\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/hook\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/hook-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a repository webhook\",\n        \"description\": \"Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can\\nshare the same `config` as long as those webhooks do not have any `events` that overlap.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`.\"\n                  },\n                  \"config\": {\n                    \"type\": \"object\",\n                    \"description\": \"Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-hook-config-params).\",\n                    \"properties\": {\n                      \"url\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-url\"\n                      },\n                      \"content_type\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                      },\n                      \"secret\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                      },\n                      \"insecure_ssl\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                      },\n                      \"token\": {\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"\\\"abc\\\"\"\n                        ]\n                      },\n                      \"digest\": {\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"\\\"sha256\\\"\"\n                        ]\n                      }\n                    }\n                  },\n                  \"events\": {\n                    \"type\": \"array\",\n                    \"description\": \"Determines what [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads) the hook is triggered for.\",\n                    \"default\": [\n                      \"push\"\n                    ],\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"active\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.\",\n                    \"default\": true\n                  }\n                },\n                \"additionalProperties\": false\n              },\n              \"example\": {\n                \"name\": \"web\",\n                \"active\": true,\n                \"events\": [\n                  \"push\",\n                  \"pull_request\"\n                ],\n                \"config\": {\n                  \"url\": \"https://example.com/webhook\",\n                  \"content_type\": \"json\",\n                  \"insecure_ssl\": \"0\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/hook\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/hooks/12345678\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/hooks/{hook_id}\": {\n      \"get\": {\n        \"summary\": \"Get a repository webhook\",\n        \"description\": \"Returns a webhook configured in a repository. To get only the webhook `config` properties, see \\\"[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository).\\\"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/hook\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a repository webhook\",\n        \"description\": \"Updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use \\\"[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository).\\\"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-repository-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"config\": {\n                    \"type\": \"object\",\n                    \"description\": \"Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-hook-config-params).\",\n                    \"properties\": {\n                      \"url\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-url\"\n                      },\n                      \"content_type\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                      },\n                      \"secret\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                      },\n                      \"insecure_ssl\": {\n                        \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                      },\n                      \"address\": {\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"\\\"bar@example.com\\\"\"\n                        ]\n                      },\n                      \"room\": {\n                        \"type\": \"string\",\n                        \"examples\": [\n                          \"\\\"The Serious Room\\\"\"\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"url\"\n                    ]\n                  },\n                  \"events\": {\n                    \"type\": \"array\",\n                    \"description\": \"Determines what [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events.\",\n                    \"default\": [\n                      \"push\"\n                    ],\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"add_events\": {\n                    \"type\": \"array\",\n                    \"description\": \"Determines a list of events to be added to the list of events that the Hook triggers for.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"remove_events\": {\n                    \"type\": \"array\",\n                    \"description\": \"Determines a list of events to be removed from the list of events that the Hook triggers for.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"active\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.\",\n                    \"default\": true\n                  }\n                }\n              },\n              \"example\": {\n                \"active\": true,\n                \"add_events\": [\n                  \"pull_request\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/hook\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a repository webhook\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-repository-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/hooks/{hook_id}/config\": {\n      \"get\": {\n        \"summary\": \"Get a webhook configuration for a repository\",\n        \"description\": \"Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use \\\"[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook).\\\"\\n\\nAccess tokens must have the `read:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:read` permission.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-webhook-config-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-webhook-configuration-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/webhook-config\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/webhook-config\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a webhook configuration for a repository\",\n        \"description\": \"Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use \\\"[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook).\\\"\\n\\nAccess tokens must have the `write:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:write` permission.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-webhook-config-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-webhook-configuration-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"additionalProperties\": false,\n                \"properties\": {\n                  \"url\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-url\"\n                  },\n                  \"content_type\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                  },\n                  \"secret\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                  },\n                  \"insecure_ssl\": {\n                    \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                  }\n                },\n                \"example\": {\n                  \"content_type\": \"json\",\n                  \"insecure_ssl\": \"0\",\n                  \"secret\": \"********\",\n                  \"url\": \"https://example.com/webhook\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/webhook-config\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/webhook-config\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/hooks/{hook_id}/pings\": {\n      \"post\": {\n        \"summary\": \"Ping a repository webhook\",\n        \"description\": \"This will trigger a [ping event](https://docs.github.com/enterprise-server@3.0/webhooks/#ping-event) to be sent to the hook.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/ping-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#ping-a-repository-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/hooks/{hook_id}/tests\": {\n      \"post\": {\n        \"summary\": \"Test the push repository webhook\",\n        \"description\": \"This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.\\n\\n**Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test`\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/test-push-webhook\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#test-the-push-repository-webhook\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"webhooks\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/installation\": {\n      \"get\": {\n        \"summary\": \"Get a repository installation for the authenticated app\",\n        \"description\": \"Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/get-repo-installation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-a-repository-installation-for-the-authenticated-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/installation\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/installation\"\n                  }\n                }\n              }\n            }\n          },\n          \"301\": {\n            \"$ref\": \"#/components/responses/moved_permanently\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/invitations\": {\n      \"get\": {\n        \"summary\": \"List repository invitations\",\n        \"description\": \"When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-invitations\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-invitations\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/repository-invitation\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-invitation-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"invitations\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/invitations/{invitation_id}\": {\n      \"patch\": {\n        \"summary\": \"Update a repository invitation\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-invitation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-repository-invitation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/invitation-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"permissions\": {\n                    \"type\": \"string\",\n                    \"description\": \"The permissions that the associated user will have on the repository. Valid values are `read`, `write`, `maintain`, `triage`, and `admin`.\",\n                    \"enum\": [\n                      \"read\",\n                      \"write\",\n                      \"maintain\",\n                      \"triage\",\n                      \"admin\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository-invitation\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-invitation\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"invitations\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a repository invitation\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-invitation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-repository-invitation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/invitation-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"invitations\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues\": {\n      \"get\": {\n        \"summary\": \"List repository issues\",\n        \"description\": \"List issues in a repository.\\n\\n**Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\\nreason, \\\"Issues\\\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \\\"Issues\\\" endpoints will be an _issue id_. To find out the pull\\nrequest id, use the \\\"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\\\" endpoint.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-repository-issues\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"milestone\",\n            \"description\": \"If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"name\": \"assignee\",\n            \"description\": \"Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"creator\",\n            \"description\": \"The user that created the issue.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"mentioned\",\n            \"description\": \"A user that's mentioned in the issue.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/labels\"\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"What to sort results by. Can be either `created`, `updated`, `comments`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"comments\"\n              ],\n              \"default\": \"created\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/issue\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"301\": {\n            \"$ref\": \"#/components/responses/moved_permanently\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"machine-man\",\n              \"note\": \"If an issue event is created via a GitHub App, the response will include the `performed_via_github_app` object with\\tinformation about the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo receive the `performed_via_github_app` object in the response, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create an issue\",\n        \"description\": \"Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status.\\n\\nThis endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/create\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"oneOf\": [\n                      {\n                        \"type\": \"string\"\n                      },\n                      {\n                        \"type\": \"integer\"\n                      }\n                    ],\n                    \"description\": \"The title of the issue.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The contents of the issue.\"\n                  },\n                  \"assignee\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"description\": \"Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_\"\n                  },\n                  \"milestone\": {\n                    \"oneOf\": [\n                      {\n                        \"type\": \"string\"\n                      },\n                      {\n                        \"type\": \"integer\",\n                        \"description\": \"The `number` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._\"\n                      }\n                    ],\n                    \"type\": [\n                      \"null\",\n                      \"string\",\n                      \"integer\"\n                    ]\n                  },\n                  \"labels\": {\n                    \"type\": \"array\",\n                    \"description\": \"Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._\",\n                    \"items\": {\n                      \"oneOf\": [\n                        {\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"properties\": {\n                            \"id\": {\n                              \"type\": \"integer\"\n                            },\n                            \"name\": {\n                              \"type\": \"string\"\n                            },\n                            \"description\": {\n                              \"type\": [\n                                \"string\",\n                                \"null\"\n                              ]\n                            },\n                            \"color\": {\n                              \"type\": [\n                                \"string\",\n                                \"null\"\n                              ]\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  },\n                  \"assignees\": {\n                    \"type\": \"array\",\n                    \"description\": \"Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"title\"\n                ]\n              },\n              \"example\": {\n                \"title\": \"Found a bug\",\n                \"body\": \"I'm having a problem with this.\",\n                \"assignees\": [\n                  \"octocat\"\n                ],\n                \"milestone\": 1,\n                \"labels\": [\n                  \"bug\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/comments\": {\n      \"get\": {\n        \"summary\": \"List issue comments for a repository\",\n        \"description\": \"By default, Issue Comments are ordered by ascending ID.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-comments-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issue-comments-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/sort\"\n          },\n          {\n            \"name\": \"direction\",\n            \"description\": \"Either `asc` or `desc`. Ignored without the `sort` parameter.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"asc\",\n                \"desc\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/issue-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/comments/{comment_id}\": {\n      \"get\": {\n        \"summary\": \"Get an issue comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/get-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-an-issue-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-comment\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"machine-man\",\n              \"note\": \"If an issue event is created via a GitHub App, the response will include the `performed_via_github_app` object with\\tinformation about the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo receive the `performed_via_github_app` object in the response, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update an issue comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/update-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#update-an-issue-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The contents of the comment.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Me too\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-comment\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"comments\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete an issue comment\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/delete-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#delete-an-issue-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"comments\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\": {\n      \"get\": {\n        \"summary\": \"List reactions for an issue comment\",\n        \"description\": \"List the reactions to an [issue comment](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#comments).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/list-for-issue-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-an-issue-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          },\n          {\n            \"name\": \"content\",\n            \"description\": \"Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"+1\",\n                \"-1\",\n                \"laugh\",\n                \"confused\",\n                \"heart\",\n                \"hooray\",\n                \"rocket\",\n                \"eyes\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/reaction\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create reaction for an issue comment\",\n        \"description\": \"Create a reaction to an [issue comment](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#comments). A response with an HTTP `200` status means that you already added the reaction type to this issue comment.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/create-for-issue-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-an-issue-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the issue comment.\",\n                    \"enum\": [\n                      \"+1\",\n                      \"-1\",\n                      \"laugh\",\n                      \"confused\",\n                      \"heart\",\n                      \"hooray\",\n                      \"rocket\",\n                      \"eyes\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"heart\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Reaction exists\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Reaction created\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\": {\n      \"delete\": {\n        \"summary\": \"Delete an issue comment reaction\",\n        \"description\": \"**Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.\\n\\nDelete a reaction to an [issue comment](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#comments).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/delete-for-issue-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-an-issue-comment-reaction\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/reaction-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/events\": {\n      \"get\": {\n        \"summary\": \"List issue events for a repository\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-events-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issue-events-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/issue-event\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-event-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"events\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"starfox\",\n              \"note\": \"Project card details are now shown in REST API v3 responses for project-related issue and timeline events. This feature is now available for developers to preview. For details, see the [blog post](https://developer.github.com/changes/2018-09-05-project-card-events).\\n\\nTo receive the `project_card` attribute, project boards must be [enabled](https://docs.github.com/articles/disabling-project-boards-in-a-repository) for a repository, and you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.starfox-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/events/{event_id}\": {\n      \"get\": {\n        \"summary\": \"Get an issue event\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/get-event\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-an-issue-event\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"event_id\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue-event\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-event\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"events\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"starfox\",\n              \"note\": \"Project card details are now shown in REST API v3 responses for project-related issue and timeline events. This feature is now available for developers to preview. For details, see the [blog post](https://developer.github.com/changes/2018-09-05-project-card-events).\\n\\nTo receive the `project_card` attribute, project boards must be [enabled](https://docs.github.com/articles/disabling-project-boards-in-a-repository) for a repository, and you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.starfox-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}\": {\n      \"get\": {\n        \"summary\": \"Get an issue\",\n        \"description\": \"The API returns a [`301 Moved Permanently` status](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was\\n[transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If\\nthe issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API\\nreturns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read\\naccess, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe\\nto the [`issues`](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#issues) webhook.\\n\\n**Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\\nreason, \\\"Issues\\\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \\\"Issues\\\" endpoints will be an _issue id_. To find out the pull\\nrequest id, use the \\\"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\\\" endpoint.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue\"\n                  }\n                }\n              }\n            }\n          },\n          \"301\": {\n            \"$ref\": \"#/components/responses/moved_permanently\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update an issue\",\n        \"description\": \"Issue owners and users with push access can edit an issue.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/update\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues/#update-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"oneOf\": [\n                      {\n                        \"type\": \"string\"\n                      },\n                      {\n                        \"type\": \"integer\"\n                      }\n                    ],\n                    \"description\": \"The title of the issue.\",\n                    \"type\": [\n                      \"null\",\n                      \"string\",\n                      \"integer\"\n                    ]\n                  },\n                  \"body\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"description\": \"The contents of the issue.\"\n                  },\n                  \"assignee\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"description\": \"Login for the user that this issue should be assigned to. **This field is deprecated.**\"\n                  },\n                  \"state\": {\n                    \"type\": \"string\",\n                    \"description\": \"State of the issue. Either `open` or `closed`.\",\n                    \"enum\": [\n                      \"open\",\n                      \"closed\"\n                    ]\n                  },\n                  \"milestone\": {\n                    \"oneOf\": [\n                      {\n                        \"type\": \"string\"\n                      },\n                      {\n                        \"type\": \"integer\",\n                        \"description\": \"The `number` of the milestone to associate this issue with or `null` to remove current. _NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise._\"\n                      }\n                    ],\n                    \"type\": [\n                      \"null\",\n                      \"string\",\n                      \"integer\"\n                    ]\n                  },\n                  \"labels\": {\n                    \"type\": \"array\",\n                    \"description\": \"Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (`[]`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._\",\n                    \"items\": {\n                      \"oneOf\": [\n                        {\n                          \"type\": \"string\"\n                        },\n                        {\n                          \"type\": \"object\",\n                          \"properties\": {\n                            \"id\": {\n                              \"type\": \"integer\"\n                            },\n                            \"name\": {\n                              \"type\": \"string\"\n                            },\n                            \"description\": {\n                              \"type\": [\n                                \"string\",\n                                \"null\"\n                              ]\n                            },\n                            \"color\": {\n                              \"type\": [\n                                \"string\",\n                                \"null\"\n                              ]\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  },\n                  \"assignees\": {\n                    \"type\": \"array\",\n                    \"description\": \"Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. Send an empty array (`[]`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              },\n              \"example\": {\n                \"title\": \"Found a bug\",\n                \"body\": \"I'm having a problem with this.\",\n                \"assignees\": [\n                  \"octocat\"\n                ],\n                \"milestone\": 1,\n                \"state\": \"open\",\n                \"labels\": [\n                  \"bug\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"301\": {\n            \"$ref\": \"#/components/responses/moved_permanently\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/assignees\": {\n      \"post\": {\n        \"summary\": \"Add assignees to an issue\",\n        \"description\": \"Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/add-assignees\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#add-assignees-to-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"assignees\": {\n                    \"type\": \"array\",\n                    \"description\": \"Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              },\n              \"example\": {\n                \"assignees\": [\n                  \"hubot\",\n                  \"other_user\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"assignees\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove assignees from an issue\",\n        \"description\": \"Removes one or more assignees from an issue.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/remove-assignees\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#remove-assignees-from-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"assignees\": {\n                    \"type\": \"array\",\n                    \"description\": \"Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              },\n              \"example\": {\n                \"assignees\": [\n                  \"hubot\",\n                  \"other_user\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"assignees\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/comments\": {\n      \"get\": {\n        \"summary\": \"List issue comments\",\n        \"description\": \"Issue Comments are ordered by ascending ID.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-comments\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issue-comments\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/issue-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create an issue comment\",\n        \"description\": \"This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/create-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-an-issue-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The contents of the comment.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Me too\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/issue-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-comment\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"comments\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/events\": {\n      \"get\": {\n        \"summary\": \"List issue events\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-events\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issue-events\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/issue-event-for-issue\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-event-for-issue-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"events\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"starfox\",\n              \"note\": \"Project card details are now shown in REST API v3 responses for project-related issue and timeline events. This feature is now available for developers to preview. For details, see the [blog post](https://developer.github.com/changes/2018-09-05-project-card-events).\\n\\nTo receive the `project_card` attribute, project boards must be [enabled](https://docs.github.com/articles/disabling-project-boards-in-a-repository) for a repository, and you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.starfox-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/labels\": {\n      \"get\": {\n        \"summary\": \"List labels for an issue\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-labels-on-issue\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-labels-for-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/label\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Add labels to an issue\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/add-labels\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#add-labels-to-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"labels\": {\n                        \"type\": \"array\",\n                        \"minItems\": 1,\n                        \"description\": \"The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see \\\"[Set labels for an issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#set-labels-for-an-issue).\\\"\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"minItems\": 1,\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"labels\": {\n                        \"type\": \"array\",\n                        \"minItems\": 1,\n                        \"items\": {\n                          \"type\": \"object\",\n                          \"properties\": {\n                            \"name\": {\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"required\": [\n                            \"name\"\n                          ]\n                        }\n                      }\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"minItems\": 1,\n                    \"items\": {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"name\": {\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"required\": [\n                        \"name\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"string\"\n                  }\n                ]\n              },\n              \"example\": {\n                \"labels\": [\n                  \"bug\",\n                  \"enhancement\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/label\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set labels for an issue\",\n        \"description\": \"Removes any previous labels and sets the new labels for an issue.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/set-labels\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#set-labels-for-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"labels\": {\n                        \"type\": \"array\",\n                        \"minItems\": 1,\n                        \"description\": \"The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see \\\"[Add labels to an issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#add-labels-to-an-issue).\\\"\",\n                        \"items\": {\n                          \"type\": \"string\"\n                        }\n                      }\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"minItems\": 1,\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"labels\": {\n                        \"type\": \"array\",\n                        \"minItems\": 1,\n                        \"items\": {\n                          \"type\": \"object\",\n                          \"properties\": {\n                            \"name\": {\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"required\": [\n                            \"name\"\n                          ]\n                        }\n                      }\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"minItems\": 1,\n                    \"items\": {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"name\": {\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"required\": [\n                        \"name\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"string\"\n                  }\n                ]\n              },\n              \"example\": {\n                \"labels\": [\n                  \"bug\",\n                  \"enhancement\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/label\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove all labels from an issue\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/remove-all-labels\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#remove-all-labels-from-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\": {\n      \"delete\": {\n        \"summary\": \"Remove a label from an issue\",\n        \"description\": \"Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/remove-label\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#remove-a-label-from-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          },\n          {\n            \"name\": \"name\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/label\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label-items-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/lock\": {\n      \"put\": {\n        \"summary\": \"Lock an issue\",\n        \"description\": \"Users with push access can lock an issue or pull request's conversation.\\n\\nNote that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/lock\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#lock-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"lock_reason\": {\n                    \"type\": \"string\",\n                    \"description\": \"The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons:  \\n\\\\* `off-topic`  \\n\\\\* `too heated`  \\n\\\\* `resolved`  \\n\\\\* `spam`\",\n                    \"enum\": [\n                      \"off-topic\",\n                      \"too heated\",\n                      \"resolved\",\n                      \"spam\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": null\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Unlock an issue\",\n        \"description\": \"Users with push access can unlock an issue's conversation.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/unlock\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#unlock-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/reactions\": {\n      \"get\": {\n        \"summary\": \"List reactions for an issue\",\n        \"description\": \"List the reactions to an [issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/list-for-issue\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          },\n          {\n            \"name\": \"content\",\n            \"description\": \"Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"+1\",\n                \"-1\",\n                \"laugh\",\n                \"confused\",\n                \"heart\",\n                \"hooray\",\n                \"rocket\",\n                \"eyes\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/reaction\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create reaction for an issue\",\n        \"description\": \"Create a reaction to an [issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues/). A response with an HTTP `200` status means that you already added the reaction type to this issue.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/create-for-issue\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the issue.\",\n                    \"enum\": [\n                      \"+1\",\n                      \"-1\",\n                      \"laugh\",\n                      \"confused\",\n                      \"heart\",\n                      \"hooray\",\n                      \"rocket\",\n                      \"eyes\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"heart\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\": {\n      \"delete\": {\n        \"summary\": \"Delete an issue reaction\",\n        \"description\": \"**Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.\\n\\nDelete a reaction to an [issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues/).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/delete-for-issue\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-an-issue-reaction\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/reaction-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/issues/{issue_number}/timeline\": {\n      \"get\": {\n        \"summary\": \"List timeline events for an issue\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-events-for-timeline\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-timeline-events-for-an-issue\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/issue-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/timeline-issue-events\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"timeline\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"mockingbird\",\n              \"note\": \"The API to get issue timeline events is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-23-timeline-preview-api/) for full details. To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.mockingbird-preview\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"starfox\",\n              \"note\": \"Project card details are now shown in REST API v3 responses for project-related issue and timeline events. This feature is now available for developers to preview. For details, see the [blog post](https://developer.github.com/changes/2018-09-05-project-card-events).\\n\\nTo receive the `project_card` attribute, project boards must be [enabled](https://docs.github.com/articles/disabling-project-boards-in-a-repository) for a repository, and you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.starfox-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/keys\": {\n      \"get\": {\n        \"summary\": \"List deploy keys\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-deploy-keys\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-deploy-keys\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/deploy-key\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/deploy-key-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"keys\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a deploy key\",\n        \"description\": \"You can create a read-only deploy key.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-deploy-key\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-deploy-key\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"A name for the key.\"\n                  },\n                  \"key\": {\n                    \"type\": \"string\",\n                    \"description\": \"The contents of the key.\"\n                  },\n                  \"read_only\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.  \\n  \\nDeploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \\\"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\\\" and \\\"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\\\"\"\n                  }\n                },\n                \"required\": [\n                  \"key\"\n                ]\n              },\n              \"example\": {\n                \"title\": \"octocat@octomac\",\n                \"key\": \"ssh-rsa AAA...\",\n                \"read_only\": true\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/deploy-key\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/deploy-key\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"keys\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/keys/{key_id}\": {\n      \"get\": {\n        \"summary\": \"Get a deploy key\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-deploy-key\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-deploy-key\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/key-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/deploy-key\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/deploy-key\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"keys\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a deploy key\",\n        \"description\": \"Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-deploy-key\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-deploy-key\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/key-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"keys\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/labels\": {\n      \"get\": {\n        \"summary\": \"List labels for a repository\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-labels-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-labels-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/label\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a label\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/create-label\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-a-label\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png \\\":strawberry:\\\"). For a full list of available emoji and codes, see \\\"[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet).\\\"\"\n                  },\n                  \"color\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A short description of the label. Must be 100 characters or fewer.\"\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"bug\",\n                \"description\": \"Something isn't working\",\n                \"color\": \"f29513\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/label\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/labels/{name}\": {\n      \"get\": {\n        \"summary\": \"Get a label\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/get-label\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-a-label\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"name\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/label\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a label\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/update-label\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#update-a-label\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"name\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"new_name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png \\\":strawberry:\\\"). For a full list of available emoji and codes, see \\\"[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet).\\\"\"\n                  },\n                  \"color\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A short description of the label. Must be 100 characters or fewer.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"new_name\": \"bug :bug:\",\n                \"description\": \"Small bug fix required\",\n                \"color\": \"b01f26\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/label\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a label\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/delete-label\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#delete-a-label\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"name\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/languages\": {\n      \"get\": {\n        \"summary\": \"List repository languages\",\n        \"description\": \"Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-languages\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-languages\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/language\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/language\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/license\": {\n      \"get\": {\n        \"summary\": \"Get the license for a repository\",\n        \"description\": \"This method returns the contents of the repository's license file, if one is detected.\\n\\nSimilar to [Get repository content](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) for retrieving the raw license content or rendered license HTML.\",\n        \"tags\": [\n          \"licenses\"\n        ],\n        \"operationId\": \"licenses/get-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/licenses/#get-the-license-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/license-content\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/license-content\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"licenses\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/merges\": {\n      \"post\": {\n        \"summary\": \"Merge a branch\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/merge\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#merge-a-branch\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"base\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the base branch that the head will be merged into.\"\n                  },\n                  \"head\": {\n                    \"type\": \"string\",\n                    \"description\": \"The head to merge. This can be a branch name or a commit SHA1.\"\n                  },\n                  \"commit_message\": {\n                    \"type\": \"string\",\n                    \"description\": \"Commit message to use for the merge commit. If omitted, a default message will be used.\"\n                  }\n                },\n                \"required\": [\n                  \"base\",\n                  \"head\"\n                ]\n              },\n              \"example\": {\n                \"base\": \"master\",\n                \"head\": \"cool_feature\",\n                \"commit_message\": \"Shipped cool_feature!\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Successful Response (The resulting merge commit)\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/commit\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit\"\n                  }\n                }\n              }\n            }\n          },\n          \"204\": {\n            \"description\": \"Response when already merged\"\n          },\n          \"404\": {\n            \"description\": \"Not Found when the base or head does not exist\"\n          },\n          \"409\": {\n            \"description\": \"Conflict when there is a merge conflict\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"merging\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/milestones\": {\n      \"get\": {\n        \"summary\": \"List milestones\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-milestones\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-milestones\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"The state of the milestone. Either `open`, `closed`, or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"What to sort results by. Either `due_on` or `completeness`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"due_on\",\n                \"completeness\"\n              ],\n              \"default\": \"due_on\"\n            }\n          },\n          {\n            \"name\": \"direction\",\n            \"description\": \"The direction of the sort. Either `asc` or `desc`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"asc\",\n                \"desc\"\n              ],\n              \"default\": \"asc\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/milestone\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/milestone-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"milestones\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a milestone\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/create-milestone\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-a-milestone\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"The title of the milestone.\"\n                  },\n                  \"state\": {\n                    \"type\": \"string\",\n                    \"description\": \"The state of the milestone. Either `open` or `closed`.\",\n                    \"enum\": [\n                      \"open\",\n                      \"closed\"\n                    ],\n                    \"default\": \"open\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A description of the milestone.\"\n                  },\n                  \"due_on\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\",\n                    \"description\": \"The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                  }\n                },\n                \"required\": [\n                  \"title\"\n                ]\n              },\n              \"example\": {\n                \"title\": \"v1.0\",\n                \"state\": \"open\",\n                \"description\": \"Tracking milestone for version 1.0\",\n                \"due_on\": \"2012-10-09T23:39:01Z\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/milestone\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/milestone\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"milestones\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/milestones/{milestone_number}\": {\n      \"get\": {\n        \"summary\": \"Get a milestone\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/get-milestone\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-a-milestone\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/milestone-number\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/milestone\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/milestone\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"milestones\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a milestone\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/update-milestone\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#update-a-milestone\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/milestone-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"The title of the milestone.\"\n                  },\n                  \"state\": {\n                    \"type\": \"string\",\n                    \"description\": \"The state of the milestone. Either `open` or `closed`.\",\n                    \"enum\": [\n                      \"open\",\n                      \"closed\"\n                    ],\n                    \"default\": \"open\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A description of the milestone.\"\n                  },\n                  \"due_on\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\",\n                    \"description\": \"The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"title\": \"v1.0\",\n                \"state\": \"open\",\n                \"description\": \"Tracking milestone for version 1.0\",\n                \"due_on\": \"2012-10-09T23:39:01Z\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/milestone\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/milestone\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"milestones\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a milestone\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/delete-milestone\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#delete-a-milestone\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/milestone-number\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"milestones\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/milestones/{milestone_number}/labels\": {\n      \"get\": {\n        \"summary\": \"List labels for issues in a milestone\",\n        \"description\": \"\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-labels-for-milestone\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-labels-for-issues-in-a-milestone\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/milestone-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/label\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"issues\",\n          \"subcategory\": \"labels\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/notifications\": {\n      \"get\": {\n        \"summary\": \"List repository notifications for the authenticated user\",\n        \"description\": \"List all notifications for the current user.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-repo-notifications-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repository-notifications-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/all\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/participating\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/before\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/thread\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/thread-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Mark repository notifications as read\",\n        \"description\": \"Marks all notifications in a repository as \\\"read\\\" removes them from the [default view on GitHub Enterprise Server](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub Enterprise Server will run an asynchronous process to mark notifications as \\\"read.\\\" To check whether any \\\"unread\\\" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/mark-repo-notifications-as-read\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#mark-repository-notifications-as-read\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"last_read_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\",\n                    \"description\": \"Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp.\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"205\": {\n            \"description\": \"Reset Content\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"notifications\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pages\": {\n      \"get\": {\n        \"summary\": \"Get a GitHub Enterprise Server Pages site\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-pages\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-github-pages-site\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/page\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/page\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"pages\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a GitHub Enterprise Server Pages site\",\n        \"description\": \"Configures a GitHub Enterprise Server Pages site. For more information, see \\\"[About GitHub Pages](/github/working-with-github-pages/about-github-pages).\\\"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-pages-site\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-github-pages-site\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"description\": \"The source branch and directory used to publish your Pages site.\",\n                \"properties\": {\n                  \"source\": {\n                    \"type\": \"object\",\n                    \"description\": \"The source branch and directory used to publish your Pages site.\",\n                    \"properties\": {\n                      \"branch\": {\n                        \"type\": \"string\",\n                        \"description\": \"The repository branch used to publish your site's source files.\"\n                      },\n                      \"path\": {\n                        \"type\": \"string\",\n                        \"description\": \"The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/`\",\n                        \"enum\": [\n                          \"/\",\n                          \"/docs\"\n                        ],\n                        \"default\": \"/\"\n                      }\n                    },\n                    \"required\": [\n                      \"branch\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"source\"\n                ]\n              },\n              \"example\": {\n                \"source\": {\n                  \"branch\": \"main\",\n                  \"path\": \"/docs\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/page\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/page\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"409\": {\n            \"$ref\": \"#/components/responses/conflict\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"pages\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"switcheroo\",\n              \"note\": \"Enabling and disabling Pages in the Pages API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-03-14-enabling-disabling-pages/) preview for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.switcheroo-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"put\": {\n        \"summary\": \"Update information about a GitHub Enterprise Server Pages site\",\n        \"description\": \"Updates information for a GitHub Enterprise Server Pages site. For more information, see \\\"[About GitHub Pages](/github/working-with-github-pages/about-github-pages).\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-information-about-pages-site\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-information-about-a-github-pages-site\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"cname\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"description\": \"Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see \\\"[Using a custom domain with GitHub Pages](https://docs.github.com/articles/using-a-custom-domain-with-github-pages/).\\\"\"\n                  },\n                  \"https_enforced\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Specify whether HTTPS should be enforced for the repository.\"\n                  },\n                  \"public\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Configures access controls for the GitHub Pages site. If public is set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. This includes anyone in your Enterprise if the repository is set to `internal` visibility. This feature is only available to repositories in an organization on an Enterprise plan.\"\n                  },\n                  \"source\": {\n                    \"anyOf\": [\n                      {\n                        \"type\": \"string\",\n                        \"description\": \"Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory `/docs`. Possible values are `\\\"gh-pages\\\"`, `\\\"master\\\"`, and `\\\"master /docs\\\"`.\",\n                        \"enum\": [\n                          \"gh-pages\",\n                          \"master\",\n                          \"master /docs\"\n                        ]\n                      },\n                      {\n                        \"type\": \"object\",\n                        \"description\": \"Update the source for the repository. Must include the branch name and path.\",\n                        \"properties\": {\n                          \"branch\": {\n                            \"type\": \"string\",\n                            \"description\": \"The repository branch used to publish your site's source files.\"\n                          },\n                          \"path\": {\n                            \"type\": \"string\",\n                            \"description\": \"The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`.\",\n                            \"enum\": [\n                              \"/\",\n                              \"/docs\"\n                            ]\n                          }\n                        },\n                        \"required\": [\n                          \"branch\",\n                          \"path\"\n                        ]\n                      }\n                    ]\n                  }\n                },\n                \"anyOf\": [\n                  {\n                    \"required\": [\n                      \"source\"\n                    ]\n                  },\n                  {\n                    \"required\": [\n                      \"cname\"\n                    ]\n                  },\n                  {\n                    \"required\": [\n                      \"public\"\n                    ]\n                  },\n                  {\n                    \"required\": [\n                      \"https_enforced\"\n                    ]\n                  }\n                ]\n              },\n              \"example\": {\n                \"cname\": \"octocatblog.com\",\n                \"source\": {\n                  \"branch\": \"main\",\n                  \"path\": \"/\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"400\": {\n            \"$ref\": \"#/components/responses/bad_request\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"pages\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a GitHub Enterprise Server Pages site\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-pages-site\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-github-pages-site\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"pages\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"switcheroo\",\n              \"note\": \"Enabling and disabling Pages in the Pages API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-03-14-enabling-disabling-pages/) preview for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.switcheroo-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pages/builds\": {\n      \"get\": {\n        \"summary\": \"List GitHub Enterprise Server Pages builds\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-pages-builds\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-github-pages-builds\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/page-build\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/page-build-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"pages\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Request a GitHub Enterprise Server Pages build\",\n        \"description\": \"You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.\\n\\nBuild requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/request-pages-build\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#request-a-github-pages-build\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/page-build-status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/page-build-status\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"pages\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pages/builds/latest\": {\n      \"get\": {\n        \"summary\": \"Get latest Pages build\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-latest-pages-build\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-latest-pages-build\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/page-build\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/page-build\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"pages\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pages/builds/{build_id}\": {\n      \"get\": {\n        \"summary\": \"Get GitHub Enterprise Server Pages build\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-pages-build\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-github-pages-build\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"build_id\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/page-build\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/page-build\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"pages\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pre-receive-hooks\": {\n      \"get\": {\n        \"summary\": \"List pre-receive hooks for a repository\",\n        \"description\": \"List all pre-receive hooks that are enabled or testing for this repository as well as any disabled hooks that are allowed to be enabled at the repository level. Pre-receive hooks that are disabled at a higher level and are not configurable will not be listed.\",\n        \"operationId\": \"enterprise-admin/list-pre-receive-hooks-for-repo\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-pre-receive-hooks-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"name\": \"sort\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"name\"\n              ],\n              \"default\": \"created\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/repository-pre-receive-hook\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-pre-receive-hook-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"repo-pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}\": {\n      \"get\": {\n        \"summary\": \"Get a pre-receive hook for a repository\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-pre-receive-hook-for-repo\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-pre-receive-hook-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository-pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-pre-receive-hook\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"repo-pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update pre-receive hook enforcement for a repository\",\n        \"description\": \"For pre-receive hooks which are allowed to be configured at the repo level, you can set `enforcement`\",\n        \"operationId\": \"enterprise-admin/update-pre-receive-hook-enforcement-for-repo\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-pre-receive-hook-enforcement-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository-pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-pre-receive-hook-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enforcement\": {\n                    \"description\": \"The state of enforcement for the hook on this repository.\",\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"enabled\",\n                      \"disabled\",\n                      \"testing\"\n                    ]\n                  }\n                }\n              },\n              \"example\": {\n                \"enforcement\": \"enabled\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"repo-pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove pre-receive hook enforcement for a repository\",\n        \"description\": \"Deletes any overridden enforcement on this repository for the specified hook.\\n\\nResponds with effective values inherited from owner and/or global level.\",\n        \"operationId\": \"enterprise-admin/remove-pre-receive-hook-enforcement-for-repo\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#remove-pre-receive-hook-enforcement-for-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Responds with effective values inherited from owner and/or global level.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository-pre-receive-hook\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-pre-receive-hook\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"repo-pre-receive-hooks\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"eye-scream\",\n              \"note\": \"APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\\n\\nTo access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.eye-scream-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/projects\": {\n      \"get\": {\n        \"summary\": \"List repository projects\",\n        \"description\": \"Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/list-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-repository-projects\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/project\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-items-2\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a repository project\",\n        \"description\": \"Creates a repository project board. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/create-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-a-repository-project\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the project.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The description of the project.\"\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"Projects Documentation\",\n                \"body\": \"Developer documentation project for the developer site.\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-3\"\n                  }\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"410\": {\n            \"$ref\": \"#/components/responses/gone\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls\": {\n      \"get\": {\n        \"summary\": \"List pull requests\",\n        \"description\": \"Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/list\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Either `open`, `closed`, or `all` to filter by state.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"name\": \"head\",\n            \"description\": \"Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"base\",\n            \"description\": \"Filter pulls by base branch name. Example: `gh-pages`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"What to sort results by. Can be either `created`, `updated`, `popularity` (comment count) or `long-running` (age, filtering by pulls updated in the last month).\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"popularity\",\n                \"long-running\"\n              ],\n              \"default\": \"created\"\n            }\n          },\n          {\n            \"name\": \"direction\",\n            \"description\": \"The direction of the sort. Can be either `asc` or `desc`. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"asc\",\n                \"desc\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/pull-request-simple\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-simple-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": null\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a pull request\",\n        \"description\": \"Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nTo open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.\\n\\nYou can create a new pull request.\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/create\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"The title of the new pull request.\"\n                  },\n                  \"head\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`.\"\n                  },\n                  \"base\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The contents of the pull request.\"\n                  },\n                  \"maintainer_can_modify\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request.\"\n                  },\n                  \"draft\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Indicates whether the pull request is a draft. See \\\"[Draft Pull Requests](https://docs.github.com/en/articles/about-pull-requests#draft-pull-requests)\\\" in the GitHub Help documentation to learn more.\"\n                  },\n                  \"issue\": {\n                    \"type\": \"integer\",\n                    \"examples\": [\n                      1\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"head\",\n                  \"base\"\n                ]\n              },\n              \"example\": {\n                \"title\": \"Amazing new feature\",\n                \"body\": \"Please pull these awesome changes in!\",\n                \"head\": \"octocat:new-feature\",\n                \"base\": \"master\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/comments\": {\n      \"get\": {\n        \"summary\": \"List review comments in a repository\",\n        \"description\": \"Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/list-review-comments-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-review-comments-in-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"sort\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"created_at\"\n              ]\n            }\n          },\n          {\n            \"name\": \"direction\",\n            \"description\": \"Can be either `asc` or `desc`. Ignored without `sort` parameter.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"asc\",\n                \"desc\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"comfort-fade\",\n              \"note\": \"Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\\n\\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.comfort-fade-preview+json\\n```\\n\\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\\n\\nIf you use the `comfort-fade` preview header, your response will show:\\n\\n*   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\\n*   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\\n\\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\\n\\n*   For multi-line comments, the last line of the comment range for the `position` attribute.\\n*   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/comments/{comment_id}\": {\n      \"get\": {\n        \"summary\": \"Get a review comment for a pull request\",\n        \"description\": \"Provides details for a review comment.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/get-review-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-review-comment-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-comment-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"comfort-fade\",\n              \"note\": \"Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\\n\\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.comfort-fade-preview+json\\n```\\n\\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\\n\\nIf you use the `comfort-fade` preview header, your response will show:\\n\\n*   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\\n*   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\\n\\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\\n\\n*   For multi-line comments, the last line of the comment range for the `position` attribute.\\n*   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\"\n            }\n          ]\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a review comment for a pull request\",\n        \"description\": \"Enables you to edit a review comment.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/update-review-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#update-a-review-comment-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The text of the reply to the review comment.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"I like this too!\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-comment-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"comfort-fade\",\n              \"note\": \"Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\\n\\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.comfort-fade-preview+json\\n```\\n\\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\\n\\nIf you use the `comfort-fade` preview header, your response will show:\\n\\n*   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\\n*   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\\n\\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\\n\\n*   For multi-line comments, the last line of the comment range for the `position` attribute.\\n*   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\"\n            }\n          ]\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a review comment for a pull request\",\n        \"description\": \"Deletes a review comment.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/delete-review-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#delete-a-review-comment-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"comments\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\": {\n      \"get\": {\n        \"summary\": \"List reactions for a pull request review comment\",\n        \"description\": \"List the reactions to a [pull request review comment](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#review-comments).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/list-for-pull-request-review-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-pull-request-review-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          },\n          {\n            \"name\": \"content\",\n            \"description\": \"Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"+1\",\n                \"-1\",\n                \"laugh\",\n                \"confused\",\n                \"heart\",\n                \"hooray\",\n                \"rocket\",\n                \"eyes\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/reaction\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create reaction for a pull request review comment\",\n        \"description\": \"Create a reaction to a [pull request review comment](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#comments). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/create-for-pull-request-review-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-pull-request-review-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the pull request review comment.\",\n                    \"enum\": [\n                      \"+1\",\n                      \"-1\",\n                      \"laugh\",\n                      \"confused\",\n                      \"heart\",\n                      \"hooray\",\n                      \"rocket\",\n                      \"eyes\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"heart\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Reaction exists\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Reaction created\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\": {\n      \"delete\": {\n        \"summary\": \"Delete a pull request comment reaction\",\n        \"description\": \"**Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`\\n\\nDelete a reaction to a [pull request review comment](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#review-comments).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/delete-for-pull-request-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-a-pull-request-comment-reaction\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/reaction-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}\": {\n      \"get\": {\n        \"summary\": \"Get a pull request\",\n        \"description\": \"Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nLists details of a pull request by providing its number.\\n\\nWhen you get, [create](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#update-a-pull-request) a pull request, GitHub Enterprise Server creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see \\\"[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.0/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)\\\".\\n\\nThe value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub Enterprise Server has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit.\\n\\nThe value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:\\n\\n*   If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit.\\n*   If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch.\\n*   If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.\\n\\nPass the appropriate [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/get\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Pass the appropriate [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"500\": {\n            \"$ref\": \"#/components/responses/internal_error\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": null\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a pull request\",\n        \"description\": \"Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nTo open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/update\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls/#update-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"The title of the pull request.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The contents of the pull request.\"\n                  },\n                  \"state\": {\n                    \"type\": \"string\",\n                    \"description\": \"State of this Pull Request. Either `open` or `closed`.\",\n                    \"enum\": [\n                      \"open\",\n                      \"closed\"\n                    ]\n                  },\n                  \"base\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository.\"\n                  },\n                  \"maintainer_can_modify\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"title\": \"new title\",\n                \"body\": \"updated body\",\n                \"state\": \"open\",\n                \"base\": \"master\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/comments\": {\n      \"get\": {\n        \"summary\": \"List review comments on a pull request\",\n        \"description\": \"Lists all review comments for a pull request. By default, review comments are in ascending order by ID.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/list-review-comments\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-review-comments-on-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/sort\"\n          },\n          {\n            \"name\": \"direction\",\n            \"description\": \"Can be either `asc` or `desc`. Ignored without `sort` parameter.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"asc\",\n                \"desc\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"comfort-fade\",\n              \"note\": \"Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\\n\\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.comfort-fade-preview+json\\n```\\n\\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\\n\\nIf you use the `comfort-fade` preview header, your response will show:\\n\\n*   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\\n*   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\\n\\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\\n\\n*   For multi-line comments, the last line of the comment range for the `position` attribute.\\n*   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\"\n            }\n          ]\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a review comment for a pull request\",\n        \"description\": \"\\nCreates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see \\\"[Create an issue comment](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-an-issue-comment).\\\" We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff.\\n\\nYou can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices).\\n\\n**Note:** The position value equals the number of lines down from the first \\\"@@\\\" hunk header in the file you want to add a comment. The line just below the \\\"@@\\\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/create-review-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-review-comment-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The text of the review comment.\"\n                  },\n                  \"commit_id\": {\n                    \"type\": \"string\",\n                    \"description\": \"The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`.\"\n                  },\n                  \"path\": {\n                    \"type\": \"string\",\n                    \"description\": \"The relative path to the file that necessitates a comment.\"\n                  },\n                  \"position\": {\n                    \"type\": \"integer\",\n                    \"description\": \"**Required without `comfort-fade` preview**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note above.\"\n                  },\n                  \"side\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Required with `comfort-fade` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see \\\"[Diff view options](https://docs.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)\\\" in the GitHub Help documentation.\",\n                    \"enum\": [\n                      \"LEFT\",\n                      \"RIGHT\"\n                    ]\n                  },\n                  \"line\": {\n                    \"type\": \"integer\",\n                    \"description\": \"**Required with `comfort-fade` preview**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to.\"\n                  },\n                  \"start_line\": {\n                    \"type\": \"integer\",\n                    \"description\": \"**Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see \\\"[Commenting on a pull request](https://docs.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)\\\" in the GitHub Help documentation.\"\n                  },\n                  \"start_side\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see \\\"[Commenting on a pull request](https://docs.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)\\\" in the GitHub Help documentation. See `side` in this table for additional context.\",\n                    \"enum\": [\n                      \"LEFT\",\n                      \"RIGHT\",\n                      \"side\"\n                    ]\n                  },\n                  \"in_reply_to\": {\n                    \"type\": \"integer\",\n                    \"description\": \"The ID of the review comment to reply to. To find the ID of a review comment with [\\\"List review comments on a pull request\\\"](#list-review-comments-on-a-pull-request). When specified, all parameters other than `body` in the request body are ignored.\",\n                    \"examples\": [\n                      2\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"examples\": {\n                \"example-for-a-single-line-comment\": {\n                  \"summary\": \"Example for a single-line comment\",\n                  \"value\": {\n                    \"body\": \"Let's add this deleted line back.\",\n                    \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                    \"path\": \"file1.txt\",\n                    \"line\": 5,\n                    \"side\": \"LEFT\"\n                  }\n                },\n                \"example-for-a-multi-line-comment\": {\n                  \"summary\": \"Example for a multi-line comment\",\n                  \"value\": {\n                    \"body\": \"Great stuff!\",\n                    \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                    \"path\": \"file1.txt\",\n                    \"start_line\": 1,\n                    \"start_side\": \"RIGHT\",\n                    \"line\": 2,\n                    \"side\": \"RIGHT\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n                },\n                \"examples\": {\n                  \"example-for-a-multi-line-comment\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-comment-example-for-a-multi-line-comment\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"comfort-fade\",\n              \"note\": \"Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\\n\\nTo create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.comfort-fade-preview+json\\n```\\n\\nTo show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\\n\\nIf you use the `comfort-fade` preview header, your response will show:\\n\\n*   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\\n*   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\\n\\nIf you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\\n\\n*   For multi-line comments, the last line of the comment range for the `position` attribute.\\n*   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\": {\n      \"post\": {\n        \"summary\": \"Create a reply for a review comment\",\n        \"description\": \"Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/create-reply-for-review-comment\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-reply-for-a-review-comment\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The text of the review comment.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Great stuff!\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-comment\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"pulls\",\n          \"subcategory\": \"comments\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/commits\": {\n      \"get\": {\n        \"summary\": \"List commits on a pull request\",\n        \"description\": \"Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commits) endpoint.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/list-commits\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-commits-on-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/commit\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/files\": {\n      \"get\": {\n        \"summary\": \"List pull requests files\",\n        \"description\": \"**Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/list-files\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests-files\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/diff-entry\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/diff-entry-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"500\": {\n            \"$ref\": \"#/components/responses/internal_error\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/merge\": {\n      \"get\": {\n        \"summary\": \"Check if a pull request has been merged\",\n        \"description\": \"\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/check-if-merged\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#check-if-a-pull-request-has-been-merged\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response if pull request has been merged\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if pull request has not been merged\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": null\n        }\n      },\n      \"put\": {\n        \"summary\": \"Merge a pull request\",\n        \"description\": \"This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/merge\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#merge-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"commit_title\": {\n                    \"type\": \"string\",\n                    \"description\": \"Title for the automatic commit message.\"\n                  },\n                  \"commit_message\": {\n                    \"type\": \"string\",\n                    \"description\": \"Extra detail to append to automatic commit message.\"\n                  },\n                  \"sha\": {\n                    \"type\": \"string\",\n                    \"description\": \"SHA that pull request head must match to allow merge.\"\n                  },\n                  \"merge_method\": {\n                    \"type\": \"string\",\n                    \"description\": \"Merge method to use. Possible values are `merge`, `squash` or `rebase`. Default is `merge`.\",\n                    \"enum\": [\n                      \"merge\",\n                      \"squash\",\n                      \"rebase\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"if merge was successful\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-merge-result\"\n                },\n                \"examples\": {\n                  \"response-if-merge-was-successful\": {\n                    \"$ref\": \"#/components/examples/pull-request-merge-result-response-if-merge-was-successful\"\n                  }\n                }\n              }\n            }\n          },\n          \"405\": {\n            \"description\": \"Method Not Allowed if merge cannot be performed\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"response-if-merge-cannot-be-performed\": {\n                    \"value\": {\n                      \"message\": \"Pull Request is not mergeable\"\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"409\": {\n            \"description\": \"Conflict if sha was provided and pull request head did not match\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"response-if-sha-was-provided-and-pull-request-head-did-not-match\": {\n                    \"value\": {\n                      \"message\": \"Head branch was modified. Review and try the merge again.\"\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\": {\n      \"get\": {\n        \"summary\": \"List requested reviewers for a pull request\",\n        \"description\": \"\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/list-requested-reviewers\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-requested-reviewers-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review-request\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-pull-request-review-request\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"review-requests\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Request reviewers for a pull request\",\n        \"description\": \"This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/request-reviewers\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#request-reviewers-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"reviewers\": {\n                    \"type\": \"array\",\n                    \"description\": \"An array of user `login`s that will be requested.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"team_reviewers\": {\n                    \"type\": \"array\",\n                    \"description\": \"An array of team `slug`s that will be requested.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"anyOf\": [\n                  {\n                    \"required\": [\n                      \"reviewers\"\n                    ]\n                  },\n                  {\n                    \"required\": [\n                      \"team_reviewers\"\n                    ]\n                  }\n                ]\n              },\n              \"example\": {\n                \"reviewers\": [\n                  \"octocat\",\n                  \"hubot\",\n                  \"other_user\"\n                ],\n                \"team_reviewers\": [\n                  \"justice-league\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-simple\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-request\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"description\": \"Unprocessable Entity if user is not a collaborator\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"review-requests\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove requested reviewers from a pull request\",\n        \"description\": \"\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/remove-requested-reviewers\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#remove-requested-reviewers-from-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"reviewers\": {\n                    \"type\": \"array\",\n                    \"description\": \"An array of user `login`s that will be removed.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"team_reviewers\": {\n                    \"type\": \"array\",\n                    \"description\": \"An array of team `slug`s that will be removed.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"reviewers\"\n                ]\n              },\n              \"example\": {\n                \"reviewers\": [\n                  \"octocat\",\n                  \"hubot\",\n                  \"other_user\"\n                ],\n                \"team_reviewers\": [\n                  \"justice-league\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-simple\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"review-requests\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews\": {\n      \"get\": {\n        \"summary\": \"List reviews for a pull request\",\n        \"description\": \"The list of reviews returns in chronological order.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/list-reviews\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-reviews-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The list of reviews returns in chronological order.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/pull-request-review\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"reviews\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a review for a pull request\",\n        \"description\": \"This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\\n\\nPull request reviews created in the `PENDING` state do not include the `submitted_at` property in the response.\\n\\n**Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the `application/vnd.github.v3.diff` [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the `Accept` header of a call to the [single pull request](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-pull-request) endpoint.\\n\\nThe `position` value equals the number of lines down from the first \\\"@@\\\" hunk header in the file you want to add a comment. The line just below the \\\"@@\\\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/create-review\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-review-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"commit_id\": {\n                    \"type\": \"string\",\n                    \"description\": \"The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review.\"\n                  },\n                  \"event\": {\n                    \"type\": \"string\",\n                    \"description\": \"The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready.\",\n                    \"enum\": [\n                      \"APPROVE\",\n                      \"REQUEST_CHANGES\",\n                      \"COMMENT\"\n                    ]\n                  },\n                  \"comments\": {\n                    \"type\": \"array\",\n                    \"description\": \"Use the following table to specify the location, destination, and contents of the draft review comment.\",\n                    \"items\": {\n                      \"type\": \"object\",\n                      \"properties\": {\n                        \"path\": {\n                          \"type\": \"string\",\n                          \"description\": \"The relative path to the file that necessitates a review comment.\"\n                        },\n                        \"position\": {\n                          \"type\": \"integer\",\n                          \"description\": \"The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note below.\"\n                        },\n                        \"body\": {\n                          \"type\": \"string\",\n                          \"description\": \"Text of the review comment.\"\n                        },\n                        \"line\": {\n                          \"type\": \"integer\",\n                          \"examples\": [\n                            28\n                          ]\n                        },\n                        \"side\": {\n                          \"type\": \"string\",\n                          \"examples\": [\n                            \"RIGHT\"\n                          ]\n                        },\n                        \"start_line\": {\n                          \"type\": \"integer\",\n                          \"examples\": [\n                            26\n                          ]\n                        },\n                        \"start_side\": {\n                          \"type\": \"string\",\n                          \"examples\": [\n                            \"LEFT\"\n                          ]\n                        }\n                      },\n                      \"required\": [\n                        \"path\",\n                        \"body\"\n                      ]\n                    }\n                  }\n                }\n              },\n              \"example\": {\n                \"commit_id\": \"ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\",\n                \"body\": \"This is close to perfect! Please address the suggested inline change.\",\n                \"event\": \"REQUEST_CHANGES\",\n                \"comments\": [\n                  {\n                    \"path\": \"file.md\",\n                    \"position\": 6,\n                    \"body\": \"Please add more information here, and fix this typo.\"\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"reviews\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\": {\n      \"get\": {\n        \"summary\": \"Get a review for a pull request\",\n        \"description\": \"\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/get-review\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-review-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/review-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-4\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"reviews\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Update a review for a pull request\",\n        \"description\": \"Update the review summary comment with new text.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/update-review\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#update-a-review-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/review-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The body text of the pull request review.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"This is close to perfect! Please address the suggested inline change. And add more about this.\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-5\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"reviews\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a pending review for a pull request\",\n        \"description\": \"\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/delete-pending-review\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#delete-a-pending-review-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/review-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"reviews\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\": {\n      \"get\": {\n        \"summary\": \"List comments for a pull request review\",\n        \"description\": \"List comments for a specific pull request review.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/list-comments-for-review\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-comments-for-a-pull-request-review\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/review-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/review-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/review-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"reviews\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\": {\n      \"put\": {\n        \"summary\": \"Dismiss a review for a pull request\",\n        \"description\": \"**Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/dismiss-review\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#dismiss-a-review-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/review-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"message\": {\n                    \"type\": \"string\",\n                    \"description\": \"The message for the pull request review dismissal\"\n                  },\n                  \"event\": {\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"\\\"APPROVE\\\"\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"message\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-3\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"reviews\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\": {\n      \"post\": {\n        \"summary\": \"Submit a review for a pull request\",\n        \"description\": \"\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/submit-review\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#submit-a-review-for-a-pull-request\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/review-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The body text of the pull request review\"\n                  },\n                  \"event\": {\n                    \"type\": \"string\",\n                    \"description\": \"The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to `PENDING`, which means you will need to re-submit the pull request review using a review action.\",\n                    \"enum\": [\n                      \"APPROVE\",\n                      \"REQUEST_CHANGES\",\n                      \"COMMENT\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"event\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/pull-request-review\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/pull-request-review-4\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"pulls\",\n          \"subcategory\": \"reviews\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/pulls/{pull_number}/update-branch\": {\n      \"put\": {\n        \"summary\": \"Update a pull request branch\",\n        \"description\": \"Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.\",\n        \"tags\": [\n          \"pulls\"\n        ],\n        \"operationId\": \"pulls/update-branch\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#update-a-pull-request-branch\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/pull-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"expected_head_sha\": {\n                    \"type\": \"string\",\n                    \"description\": \"The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the \\\"[List commits](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commits)\\\" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"expected_head_sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"example\": {\n                  \"message\": \"Updating pull request branch.\",\n                  \"url\": \"https://github.com/repos/octocat/Hello-World/pulls/53\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"pulls\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"lydian\",\n              \"note\": \"Updating the pull request branch with latest upstream changes is currently available for developers to preview. To access this new endpoint during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.lydian-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/readme\": {\n      \"get\": {\n        \"summary\": \"Get a repository README\",\n        \"description\": \"Gets the preferred README for a repository.\\n\\nREADMEs support [custom media types](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-readme\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository-readme\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/content-file\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/content-file\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"contents\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/readme/{dir}\": {\n      \"get\": {\n        \"summary\": \"Get a repository README for a directory\",\n        \"description\": \"Gets the README from a repository directory.\\n\\nREADMEs support [custom media types](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-readme-in-directory\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository-directory-readme\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"dir\",\n            \"description\": \"The alternate path to look for a README file\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          },\n          {\n            \"name\": \"ref\",\n            \"description\": \"The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/content-file\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/content-file\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"contents\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/releases\": {\n      \"get\": {\n        \"summary\": \"List releases\",\n        \"description\": \"This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-tags).\\n\\nInformation about published releases are available to everyone. Only users with push access will receive listings for draft releases.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-releases\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-releases\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/release\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a release\",\n        \"description\": \"Users with push access to the repository can create a release.\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-release\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-release\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"tag_name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the tag.\"\n                  },\n                  \"target_commitish\": {\n                    \"type\": \"string\",\n                    \"description\": \"Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually `master`).\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the release.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"Text describing the contents of the tag.\"\n                  },\n                  \"draft\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"`true` to create a draft (unpublished) release, `false` to create a published one.\",\n                    \"default\": false\n                  },\n                  \"prerelease\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"`true` to identify the release as a prerelease. `false` to identify the release as a full release.\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"tag_name\"\n                ]\n              },\n              \"example\": {\n                \"tag_name\": \"v1.0.0\",\n                \"target_commitish\": \"master\",\n                \"name\": \"v1.0.0\",\n                \"body\": \"Description of the release\",\n                \"draft\": false,\n                \"prerelease\": false\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/release\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/releases/1\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/releases/assets/{asset_id}\": {\n      \"get\": {\n        \"summary\": \"Get a release asset\",\n        \"description\": \"To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-release-asset\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-release-asset\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/asset-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/release-asset\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release-asset\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          },\n          \"302\": {\n            \"$ref\": \"#/components/responses/found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a release asset\",\n        \"description\": \"Users with push access to the repository can edit a release asset.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-release-asset\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-release-asset\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/asset-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The file name of the asset.\"\n                  },\n                  \"label\": {\n                    \"type\": \"string\",\n                    \"description\": \"An alternate short description of the asset. Used in place of the filename.\"\n                  },\n                  \"state\": {\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"\\\"uploaded\\\"\"\n                    ]\n                  }\n                }\n              },\n              \"example\": {\n                \"name\": \"foo-1.0.0-osx.zip\",\n                \"label\": \"Mac binary\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/release-asset\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release-asset\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a release asset\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-release-asset\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-release-asset\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/asset-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/releases/latest\": {\n      \"get\": {\n        \"summary\": \"Get the latest release\",\n        \"description\": \"View the latest published full release for the repository.\\n\\nThe latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-latest-release\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-latest-release\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/release\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/releases/tags/{tag}\": {\n      \"get\": {\n        \"summary\": \"Get a release by tag name\",\n        \"description\": \"Get a published release with the specified tag.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-release-by-tag\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-release-by-tag-name\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"tag\",\n            \"description\": \"tag parameter\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/release\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/releases/{release_id}\": {\n      \"get\": {\n        \"summary\": \"Get a release\",\n        \"description\": \"**Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#hypermedia).\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-release\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-release\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/release-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"**Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#hypermedia).\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/release\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update a release\",\n        \"description\": \"Users with push access to the repository can edit a release.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/update-release\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-release\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/release-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"tag_name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the tag.\"\n                  },\n                  \"target_commitish\": {\n                    \"type\": \"string\",\n                    \"description\": \"Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually `master`).\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the release.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"Text describing the contents of the tag.\"\n                  },\n                  \"draft\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"`true` makes the release a draft, and `false` publishes the release.\"\n                  },\n                  \"prerelease\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"`true` to identify the release as a prerelease, `false` to identify the release as a full release.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"tag_name\": \"v1.0.0\",\n                \"target_commitish\": \"master\",\n                \"name\": \"v1.0.0\",\n                \"body\": \"Description of the release\",\n                \"draft\": false,\n                \"prerelease\": false\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/release\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a release\",\n        \"description\": \"Users with push access to the repository can delete a release.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/delete-release\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-release\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/release-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/releases/{release_id}/assets\": {\n      \"get\": {\n        \"summary\": \"List release assets\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-release-assets\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-release-assets\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/release-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/release-asset\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/release-asset-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Upload a release asset\",\n        \"description\": \"This endpoint makes use of [a Hypermedia relation](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in\\nthe response of the [Create a release endpoint](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-release) to upload a release asset.\\n\\nYou need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.\\n\\nMost libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: \\n\\n`application/zip`\\n\\nGitHub Enterprise Server expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,\\nyou'll still need to pass your authentication to be able to upload an asset.\\n\\nWhen an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.\\n\\n**Notes:**\\n*   GitHub Enterprise Server renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The \\\"[List assets for a release](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-assets-for-a-release)\\\"\\nendpoint lists the renamed filenames. For more information and help, contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).\\n*   If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/upload-release-asset\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#upload-a-release-asset\"\n        },\n        \"servers\": [\n          {\n            \"url\": \"{origin}\",\n            \"variables\": {\n              \"origin\": {\n                \"default\": \"https://uploads.github.com\",\n                \"description\": \"The URL origin (protocol + host name + port) is included in `upload_url` returned in the response of the \\\"Create a release\\\" endpoint\"\n              }\n            }\n          }\n        ],\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/release-id\"\n          },\n          {\n            \"name\": \"name\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"label\",\n            \"in\": \"query\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"*/*\": {\n              \"schema\": {\n                \"type\": \"string\",\n                \"description\": \"The raw file data\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response for successful upload\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/release-asset\"\n                },\n                \"examples\": {\n                  \"response-for-successful-upload\": {\n                    \"$ref\": \"#/components/examples/release-asset-response-for-successful-upload\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"description\": \"Response if you upload an asset with the same filename as another uploaded asset\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"releases\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/stargazers\": {\n      \"get\": {\n        \"summary\": \"List stargazers\",\n        \"description\": \"Lists the people that have starred the repository.\\n\\nYou can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `Accept` header:\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-stargazers-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-stargazers\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"anyOf\": [\n                    {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/simple-user\"\n                      }\n                    },\n                    {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/stargazer\"\n                      }\n                    }\n                  ]\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/simple-user-items-default-response\"\n                  },\n                  \"alternative-response-with-star-creation-timestamps\": {\n                    \"$ref\": \"#/components/examples/stargazer-items-alternative-response-with-star-creation-timestamps\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"starring\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/stats/code_frequency\": {\n      \"get\": {\n        \"summary\": \"Get the weekly commit activity\",\n        \"description\": \"Returns a weekly aggregate of the number of additions and deletions pushed to a repository.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-code-frequency-stats\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-weekly-commit-activity\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Returns a weekly aggregate of the number of additions and deletions pushed to a repository.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/code-frequency-stat\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-frequency-stat-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"202\": {\n            \"$ref\": \"#/components/responses/accepted\"\n          },\n          \"204\": {\n            \"$ref\": \"#/components/responses/no_content\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"statistics\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/stats/commit_activity\": {\n      \"get\": {\n        \"summary\": \"Get the last year of commit activity\",\n        \"description\": \"Returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-commit-activity-stats\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-last-year-of-commit-activity\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/commit-activity\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-activity-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"202\": {\n            \"$ref\": \"#/components/responses/accepted\"\n          },\n          \"204\": {\n            \"$ref\": \"#/components/responses/no_content\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"statistics\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/stats/contributors\": {\n      \"get\": {\n        \"summary\": \"Get all contributor commit activity\",\n        \"description\": \"\\nReturns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information:\\n\\n*   `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time).\\n*   `a` - Number of additions\\n*   `d` - Number of deletions\\n*   `c` - Number of commits\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-contributors-stats\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-all-contributor-commit-activity\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"*   `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time).\\n*   `a` - Number of additions\\n*   `d` - Number of deletions\\n*   `c` - Number of commits\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/contributor-activity\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/contributor-activity-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"202\": {\n            \"$ref\": \"#/components/responses/accepted\"\n          },\n          \"204\": {\n            \"$ref\": \"#/components/responses/no_content\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"statistics\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/stats/participation\": {\n      \"get\": {\n        \"summary\": \"Get the weekly commit count\",\n        \"description\": \"Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.\\n\\nThe array order is oldest week (index 0) to most recent week.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-participation-stats\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-weekly-commit-count\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The array order is oldest week (index 0) to most recent week.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/participation-stats\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/participation-stats\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"statistics\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/stats/punch_card\": {\n      \"get\": {\n        \"summary\": \"Get the hourly commit count for each day\",\n        \"description\": \"Each array contains the day number, hour number, and number of commits:\\n\\n*   `0-6`: Sunday - Saturday\\n*   `0-23`: Hour of day\\n*   Number of commits\\n\\nFor example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-punch-card-stats\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-hourly-commit-count-for-each-day\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/code-frequency-stat\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-frequency-stat-items-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"204\": {\n            \"$ref\": \"#/components/responses/no_content\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"statistics\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/statuses/{sha}\": {\n      \"post\": {\n        \"summary\": \"Create a commit status\",\n        \"description\": \"Users with push access in a repository can create commit statuses for a given SHA.\\n\\nNote: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-commit-status\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-commit-status\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"sha\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            },\n            \"x-multi-segment\": true\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"state\": {\n                    \"type\": \"string\",\n                    \"description\": \"The state of the status. Can be one of `error`, `failure`, `pending`, or `success`.\",\n                    \"enum\": [\n                      \"error\",\n                      \"failure\",\n                      \"pending\",\n                      \"success\"\n                    ]\n                  },\n                  \"target_url\": {\n                    \"type\": \"string\",\n                    \"description\": \"The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status.  \\nFor example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA:  \\n`http://ci.example.com/user/repo/build/sha`\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A short description of the status.\"\n                  },\n                  \"context\": {\n                    \"type\": \"string\",\n                    \"description\": \"A string label to differentiate this status from the status of other systems. This field is case-insensitive.\",\n                    \"default\": \"default\"\n                  }\n                },\n                \"required\": [\n                  \"state\"\n                ]\n              },\n              \"example\": {\n                \"state\": \"success\",\n                \"target_url\": \"https://example.com/build/status\",\n                \"description\": \"The build succeeded!\",\n                \"context\": \"continuous-integration/jenkins\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/status\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"statuses\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/subscribers\": {\n      \"get\": {\n        \"summary\": \"List watchers\",\n        \"description\": \"Lists the people watching the specified repository.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-watchers-for-repo\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-watchers\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"watching\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/subscription\": {\n      \"get\": {\n        \"summary\": \"Get a repository subscription\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/get-repo-subscription\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-a-repository-subscription\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"if you subscribe to the repository\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository-subscription\"\n                },\n                \"examples\": {\n                  \"response-if-you-subscribe-to-the-repository\": {\n                    \"$ref\": \"#/components/examples/repository-subscription-response-if-you-subscribe-to-the-repository\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"Not Found if you don't subscribe to the repository\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"watching\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set a repository subscription\",\n        \"description\": \"If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-repository-subscription) completely.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/set-repo-subscription\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#set-a-repository-subscription\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"subscribed\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Determines if notifications should be received from this repository.\"\n                  },\n                  \"ignored\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Determines if all notifications should be blocked from this repository.\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository-subscription\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-subscription\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"watching\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a repository subscription\",\n        \"description\": \"This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#set-a-repository-subscription).\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/delete-repo-subscription\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-repository-subscription\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"watching\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/tags\": {\n      \"get\": {\n        \"summary\": \"List repository tags\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-tags\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-tags\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/tag\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/tag-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/tarball/{ref}\": {\n      \"get\": {\n        \"summary\": \"Download a repository archive (tar)\",\n        \"description\": \"Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually\\n`master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use\\nthe `Location` header to make a second `GET` request.\\n**Note**: For private repositories, these links are temporary and expire after five minutes.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#download-a-repository-archive\"\n        },\n        \"operationId\": \"repos/download-tarball-archive\",\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"302\": {\n            \"description\": \"Response\",\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://codeload.github.com/me/myprivate/legacy.zip/master?login=me&token=thistokenexpires\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"contents\"\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/teams\": {\n      \"get\": {\n        \"summary\": \"List repository teams\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-teams\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-teams\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/topics\": {\n      \"get\": {\n        \"summary\": \"Get all repository topics\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/get-all-topics\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-all-repository-topics\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/topic\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/topic\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"mercy\",\n              \"note\": \"The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.mercy-preview+json\\n```\"\n            }\n          ]\n        }\n      },\n      \"put\": {\n        \"summary\": \"Replace all repository topics\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/replace-all-topics\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#replace-all-repository-topics\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"names\": {\n                    \"type\": \"array\",\n                    \"description\": \"An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters.\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"names\"\n                ]\n              },\n              \"example\": {\n                \"names\": [\n                  \"octocat\",\n                  \"atom\",\n                  \"electron\",\n                  \"api\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/topic\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/topic\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"mercy\",\n              \"note\": \"The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.mercy-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/transfer\": {\n      \"post\": {\n        \"summary\": \"Transfer a repository\",\n        \"description\": \"A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/).\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/transfer\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#transfer-a-repository\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"new_owner\": {\n                    \"type\": \"string\",\n                    \"description\": \"The username or organization name the repository will be transferred to.\"\n                  },\n                  \"team_ids\": {\n                    \"type\": \"array\",\n                    \"description\": \"ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories.\",\n                    \"items\": {\n                      \"type\": \"integer\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"new_owner\"\n                ]\n              },\n              \"example\": {\n                \"new_owner\": \"github\",\n                \"team_ids\": [\n                  12,\n                  345\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/repos/{owner}/{repo}/zipball/{ref}\": {\n      \"get\": {\n        \"summary\": \"Download a repository archive (zip)\",\n        \"description\": \"Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually\\n`master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use\\nthe `Location` header to make a second `GET` request.\\n**Note**: For private repositories, these links are temporary and expire after five minutes.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#download-a-repository-archive\"\n        },\n        \"operationId\": \"repos/download-zipball-archive\",\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          },\n          {\n            \"name\": \"ref\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"302\": {\n            \"description\": \"Response\",\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://codeload.github.com/me/myprivate/legacy.zip/master?login=me&token=thistokenexpires\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": \"contents\"\n        }\n      }\n    },\n    \"/repos/{template_owner}/{template_repo}/generate\": {\n      \"post\": {\n        \"summary\": \"Create a repository using a template\",\n        \"description\": \"Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.\\n\\n**OAuth scope requirements**\\n\\nWhen using [OAuth](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\\n\\n*   `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\\n*   `repo` scope to create a private repository\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-using-template\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"template_owner\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"template_repo\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"owner\": {\n                    \"type\": \"string\",\n                    \"description\": \"The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization.\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the new repository.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"A short description of the new repository.\"\n                  },\n                  \"include_all_branches\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`.\",\n                    \"default\": false\n                  },\n                  \"private\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Either `true` to create a new private repository or `false` to create a new public one.\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"owner\": \"octocat\",\n                \"name\": \"Hello-World\",\n                \"description\": \"This is your first repository\",\n                \"include_all_branches\": false,\n                \"private\": false\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-3\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"baptiste\",\n              \"note\": \"Creating and using repository templates is currently available for developers to preview. To access this new endpoint during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.baptiste-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/repositories\": {\n      \"get\": {\n        \"summary\": \"List public repositories\",\n        \"description\": \"Lists all public repositories in the order that they were created.\\n\\nNote:\\n- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.\\n- Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-public\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-public-repositories\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/since-repo\"\n          },\n          {\n            \"name\": \"visibility\",\n            \"description\": \"Specifies the types of repositories to return. Can be one of `all` or `public`. Default: `public`. Note: For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"public\",\n              \"enum\": [\n                \"all\",\n                \"public\"\n              ],\n              \"examples\": [\n                \"all\"\n              ]\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/minimal-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/public-repository-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"example\": \"<https://api.github.com/repositories?since=364>; rel=\\\"next\\\"\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/search/code\": {\n      \"get\": {\n        \"summary\": \"Search code\",\n        \"description\": \"Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\\n\\nWhen searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\\n\\nFor example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:\\n\\n`q=addClass+in:file+language:js+repo:jquery/jquery`\\n\\nThis query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.\\n\\n#### Considerations for code search\\n\\nDue to the complexity of searching code, there are a few restrictions on how searches are performed:\\n\\n*   Only the _default branch_ is considered. In most cases, this will be the `master` branch.\\n*   Only files smaller than 384 KB are searchable.\\n*   You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing\\nlanguage:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is.\",\n        \"tags\": [\n          \"search\"\n        ],\n        \"operationId\": \"search/code\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-code\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"q\",\n            \"description\": \"The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query). See \\\"[Searching code](https://docs.github.com/articles/searching-code/)\\\" for a detailed list of qualifiers.\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub Enterprise Server search infrastructure. Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"indexed\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/order\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"incomplete_results\",\n                    \"items\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"incomplete_results\": {\n                      \"type\": \"boolean\"\n                    },\n                    \"items\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/code-search-result-item\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/code-search-result-item-paginated\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"search\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/search/commits\": {\n      \"get\": {\n        \"summary\": \"Search commits\",\n        \"description\": \"Find commits via various criteria on the default branch (usually `master`). This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\\n\\nWhen searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match\\nmetadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\\n\\nFor example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:\\n\\n`q=repo:octocat/Spoon-Knife+css`\",\n        \"tags\": [\n          \"search\"\n        ],\n        \"operationId\": \"search/commits\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-commits\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"q\",\n            \"description\": \"The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query). See \\\"[Searching commits](https://docs.github.com/articles/searching-commits/)\\\" for a detailed list of qualifiers.\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"author-date\",\n                \"committer-date\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/order\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"incomplete_results\",\n                    \"items\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"incomplete_results\": {\n                      \"type\": \"boolean\"\n                    },\n                    \"items\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/commit-search-result-item\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/commit-search-result-item-paginated\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"search\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"cloak\",\n              \"note\": \"The Commit Search API is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2017-01-05-commit-search-api/) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.cloak-preview\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/search/issues\": {\n      \"get\": {\n        \"summary\": \"Search issues and pull requests\",\n        \"description\": \"Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\\n\\nWhen searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted\\nsearch results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\\n\\nFor example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.\\n\\n`q=windows+label:bug+language:python+state:open&sort=created&order=asc`\\n\\nThis query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.\\n\\n**Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see \\\"[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests).\\\"\",\n        \"tags\": [\n          \"search\"\n        ],\n        \"operationId\": \"search/issues-and-pull-requests\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-issues-and-pull-requests\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"q\",\n            \"description\": \"The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query). See \\\"[Searching issues and pull requests](https://docs.github.com/articles/searching-issues-and-pull-requests/)\\\" for a detailed list of qualifiers.\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"comments\",\n                \"reactions\",\n                \"reactions-+1\",\n                \"reactions--1\",\n                \"reactions-smile\",\n                \"reactions-thinking_face\",\n                \"reactions-heart\",\n                \"reactions-tada\",\n                \"interactions\",\n                \"created\",\n                \"updated\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/order\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"incomplete_results\",\n                    \"items\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"incomplete_results\": {\n                      \"type\": \"boolean\"\n                    },\n                    \"items\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/issue-search-result-item\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-search-result-item-paginated\"\n                  }\n                }\n              }\n            }\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"search\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/search/labels\": {\n      \"get\": {\n        \"summary\": \"Search labels\",\n        \"description\": \"Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\\n\\nWhen searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\\n\\nFor example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:\\n\\n`q=bug+defect+enhancement&repository_id=64778136`\\n\\nThe labels that best match the query appear first in the search results.\",\n        \"tags\": [\n          \"search\"\n        ],\n        \"operationId\": \"search/labels\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-labels\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"repository_id\",\n            \"description\": \"The id of the repository.\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          },\n          {\n            \"name\": \"q\",\n            \"description\": \"The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/order\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"incomplete_results\",\n                    \"items\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"incomplete_results\": {\n                      \"type\": \"boolean\"\n                    },\n                    \"items\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/label-search-result-item\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/label-search-result-item-paginated\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"search\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/search/repositories\": {\n      \"get\": {\n        \"summary\": \"Search repositories\",\n        \"description\": \"Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\\n\\nWhen searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\\n\\nFor example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:\\n\\n`q=tetris+language:assembly&sort=stars&order=desc`\\n\\nThis query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results.\\n\\nWhen you include the `mercy` preview header, you can also search for multiple topics by adding more `topic:` instances. For example, your query might look like this:\\n\\n`q=topic:ruby+topic:rails`\",\n        \"tags\": [\n          \"search\"\n        ],\n        \"operationId\": \"search/repos\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-repositories\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"q\",\n            \"description\": \"The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query). See \\\"[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)\\\" for a detailed list of qualifiers.\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"stars\",\n                \"forks\",\n                \"help-wanted-issues\",\n                \"updated\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/order\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"incomplete_results\",\n                    \"items\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"incomplete_results\": {\n                      \"type\": \"boolean\"\n                    },\n                    \"items\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/repo-search-result-item\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repo-search-result-item-paginated\"\n                  }\n                }\n              }\n            }\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"search\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"mercy\",\n              \"note\": \"The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.mercy-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/search/topics\": {\n      \"get\": {\n        \"summary\": \"Search topics\",\n        \"description\": \"Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination). See \\\"[Searching topics](https://docs.github.com/articles/searching-topics/)\\\" for a detailed list of qualifiers.\\n\\nWhen searching for topics, you can get text match metadata for the topic's **short\\\\_description**, **description**, **name**, or **display\\\\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\\n\\nFor example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:\\n\\n`q=ruby+is:featured`\\n\\nThis query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results.\",\n        \"tags\": [\n          \"search\"\n        ],\n        \"operationId\": \"search/topics\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-topics\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"q\",\n            \"description\": \"The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"incomplete_results\",\n                    \"items\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"incomplete_results\": {\n                      \"type\": \"boolean\"\n                    },\n                    \"items\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/topic-search-result-item\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/topic-search-result-item-paginated\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"search\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"mercy\",\n              \"note\": \"The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.mercy-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/search/users\": {\n      \"get\": {\n        \"summary\": \"Search users\",\n        \"description\": \"Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\\n\\nWhen searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\\n\\nFor example, if you're looking for a list of popular users, you might try this query:\\n\\n`q=tom+repos:%3E42+followers:%3E1000`\\n\\nThis query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.\",\n        \"tags\": [\n          \"search\"\n        ],\n        \"operationId\": \"search/users\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-users\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"q\",\n            \"description\": \"The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query). See \\\"[Searching users](https://docs.github.com/articles/searching-users/)\\\" for a detailed list of qualifiers.\",\n            \"in\": \"query\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub Enterprise Server. Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"followers\",\n                \"repositories\",\n                \"joined\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/order\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"incomplete_results\",\n                    \"items\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"incomplete_results\": {\n                      \"type\": \"boolean\"\n                    },\n                    \"items\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/user-search-result-item\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/user-search-result-item-paginated\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"503\": {\n            \"$ref\": \"#/components/responses/service_unavailable\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"search\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/setup/api/configcheck\": {\n      \"get\": {\n        \"summary\": \"Get the configuration status\",\n        \"description\": \"This endpoint allows you to check the status of the most recent configuration process:\\n\\nNote that you may need to wait several seconds after you start a process before you can check its status.\\n\\nThe different statuses are:\\n\\n| Status        | Description                       |\\n| ------------- | --------------------------------- |\\n| `PENDING`     | The job has not started yet       |\\n| `CONFIGURING` | The job is running                |\\n| `DONE`        | The job has finished correctly    |\\n| `FAILED`      | The job has finished unexpectedly |\",\n        \"operationId\": \"enterprise-admin/get-configuration-status\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-the-configuration-status\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/configuration-status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/configuration-status\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      }\n    },\n    \"/setup/api/configure\": {\n      \"post\": {\n        \"summary\": \"Start a configuration process\",\n        \"description\": \"This endpoint allows you to start a configuration process at any time for your updated settings to take effect:\",\n        \"operationId\": \"enterprise-admin/start-configuration-process\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#start-a-configuration-process\"\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      }\n    },\n    \"/setup/api/maintenance\": {\n      \"get\": {\n        \"summary\": \"Get the maintenance status\",\n        \"description\": \"Check your installation's maintenance status:\",\n        \"operationId\": \"enterprise-admin/get-maintenance-status\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-the-maintenance-status\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/maintenance-status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/maintenance-status\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Enable or disable maintenance mode\",\n        \"description\": \"**Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\",\n        \"operationId\": \"enterprise-admin/enable-or-disable-maintenance-mode\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#enable-or-disable-maintenance-mode\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/maintenance-status\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/maintenance-status\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/x-www-form-urlencoded\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"maintenance\": {\n                    \"type\": \"string\",\n                    \"description\": \"A JSON string with the attributes `enabled` and `when`.\\n\\nThe possible values for `enabled` are `true` and `false`. When it's `false`, the attribute `when` is ignored and the maintenance mode is turned off. `when` defines the time period when the maintenance was enabled.\\n\\nThe possible values for `when` are `now` or any date parseable by [mojombo/chronic](https://github.com/mojombo/chronic).\"\n                  }\n                },\n                \"required\": [\n                  \"maintenance\"\n                ]\n              },\n              \"example\": {\n                \"maintenance\": \"{\\\"enabled\\\":true, \\\"when\\\":\\\"now\\\"}\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      }\n    },\n    \"/setup/api/settings\": {\n      \"get\": {\n        \"summary\": \"Get settings\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-settings\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-settings\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/enterprise-settings\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/enterprise-settings\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Set settings\",\n        \"description\": \"For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-settings).\\n\\n**Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\",\n        \"operationId\": \"enterprise-admin/set-settings\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#set-settings\"\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/x-www-form-urlencoded\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"settings\": {\n                    \"type\": \"string\",\n                    \"description\": \"A JSON string with the new settings. Note that you only need to pass the specific settings you want to modify. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-settings).\"\n                  }\n                },\n                \"required\": [\n                  \"settings\"\n                ]\n              },\n              \"example\": {\n                \"settings\": \"{ \\\"enterprise\\\": { \\\"public_pages\\\": true }}\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      }\n    },\n    \"/setup/api/settings/authorized-keys\": {\n      \"get\": {\n        \"summary\": \"Get all authorized SSH keys\",\n        \"description\": \"\",\n        \"operationId\": \"enterprise-admin/get-all-authorized-ssh-keys\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-all-authorized-ssh-keys\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/ssh-key\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/ssh-key-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Add an authorized SSH key\",\n        \"description\": \"**Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\",\n        \"operationId\": \"enterprise-admin/add-authorized-ssh-key\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#add-an-authorized-ssh-key\"\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/ssh-key\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/ssh-key-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/x-www-form-urlencoded\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"authorized_key\": {\n                    \"type\": \"string\",\n                    \"description\": \"The public SSH key.\"\n                  }\n                },\n                \"required\": [\n                  \"authorized_key\"\n                ]\n              },\n              \"example\": {\n                \"authorized_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCssTL/Vtu/ODLTj0VtZoRAbvf7uiv5997GyDq0MoAZUjb5jmA5wYe2/wF6sFuhiZTnZoF1ZtCHunPp0hM/GHrn6VySBhNncx14YO8FPt1CIhEeRMSEjUK9cY3xAbS365oXY8vnUHJsS9+1tr/2bx/+4NJfcUt/Ezf1OR/0LStQXw==\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove an authorized SSH key\",\n        \"description\": \"**Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\",\n        \"operationId\": \"enterprise-admin/remove-authorized-ssh-key\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#remove-an-authorized-ssh-key\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/ssh-key\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/ssh-key-items\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/x-www-form-urlencoded\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"authorized_key\": {\n                    \"type\": \"string\",\n                    \"description\": \"The public SSH key.\"\n                  }\n                },\n                \"required\": [\n                  \"authorized_key\"\n                ]\n              },\n              \"example\": {\n                \"authorized_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCssTL/Vtu/ODLTj0VtZoRAbvf7uiv5997GyDq0MoAZUjb5jmA5wYe2/wF6sFuhiZTnZoF1ZtCHunPp0hM/GHrn6VySBhNncx14YO8FPt1CIhEeRMSEjUK9cY3xAbS365oXY8vnUHJsS9+1tr/2bx/+4NJfcUt/Ezf1OR/0LStQXw==\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      }\n    },\n    \"/setup/api/start\": {\n      \"post\": {\n        \"summary\": \"Create a GitHub license\",\n        \"description\": \"When you boot a GitHub instance for the first time, you can use the following endpoint to upload a license.\\n\\nNote that you need to `POST` to [`/setup/api/configure`](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#start-a-configuration-process) to start the actual configuration process.\\n\\nWhen using this endpoint, your GitHub instance must have a password set. This can be accomplished two ways:\\n\\n1.  If you're working directly with the API before accessing the web interface, you must pass in the password parameter to set your password.\\n2.  If you set up your instance via the web interface before accessing the API, your calls to this endpoint do not need the password parameter.\\n\\n**Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\",\n        \"operationId\": \"enterprise-admin/create-enterprise-server-license\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-github-enterprise-server-license\"\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/x-www-form-urlencoded\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"license\": {\n                    \"type\": \"string\",\n                    \"description\": \"The content of your _.ghl_ license file.\"\n                  },\n                  \"password\": {\n                    \"type\": \"string\",\n                    \"description\": \"You **must** provide a password _only if_ you are uploading your license for the first time. If you previously set a password through the web interface, you don't need this parameter.\"\n                  },\n                  \"settings\": {\n                    \"type\": \"string\",\n                    \"description\": \"An optional JSON string containing the installation settings. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-settings).\"\n                  }\n                },\n                \"required\": [\n                  \"license\"\n                ]\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      }\n    },\n    \"/setup/api/upgrade\": {\n      \"post\": {\n        \"summary\": \"Upgrade a license\",\n        \"description\": \"This API upgrades your license and also triggers the configuration process.\\n\\n**Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\",\n        \"operationId\": \"enterprise-admin/upgrade-license\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#upgrade-a-license\"\n        },\n        \"responses\": {\n          \"202\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"content\": {\n            \"application/x-www-form-urlencoded\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"license\": {\n                    \"type\": \"string\",\n                    \"description\": \"The content of your new _.ghl_ license file.\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"management-console\"\n        }\n      }\n    },\n    \"/teams/{team_id}\": {\n      \"get\": {\n        \"summary\": \"Get a team (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-team-by-name) endpoint.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#get-a-team-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-full\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-full\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      },\n      \"patch\": {\n        \"summary\": \"Update a team (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-team) endpoint.\\n\\nTo edit a team, the authenticated user must either be an organization owner or a team maintainer.\\n\\n**Note:** With nested teams, the `privacy` for parent teams cannot be `secret`.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/update-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#update-a-team-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\",\n                    \"description\": \"The name of the team.\"\n                  },\n                  \"description\": {\n                    \"type\": \"string\",\n                    \"description\": \"The description of the team.\"\n                  },\n                  \"privacy\": {\n                    \"type\": \"string\",\n                    \"description\": \"The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are:  \\n**For a non-nested team:**  \\n\\\\* `secret` - only visible to organization owners and members of this team.  \\n\\\\* `closed` - visible to all members of this organization.  \\n**For a parent or child team:**  \\n\\\\* `closed` - visible to all members of this organization.\",\n                    \"enum\": [\n                      \"secret\",\n                      \"closed\"\n                    ]\n                  },\n                  \"permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"**Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of:  \\n\\\\* `pull` - team members can pull, but not push to or administer newly-added repositories.  \\n\\\\* `push` - team members can pull and push, but not administer newly-added repositories.  \\n\\\\* `admin` - team members can pull, push and administer newly-added repositories.\",\n                    \"enum\": [\n                      \"pull\",\n                      \"push\",\n                      \"admin\"\n                    ],\n                    \"default\": \"pull\"\n                  },\n                  \"parent_team_id\": {\n                    \"type\": [\n                      \"integer\",\n                      \"null\"\n                    ],\n                    \"description\": \"The ID of a team to set as the parent team.\"\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              },\n              \"example\": {\n                \"name\": \"new team name\",\n                \"description\": \"new team description\",\n                \"privacy\": \"closed\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-full\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-full\"\n                  }\n                }\n              }\n            }\n          },\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-full\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-full\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Delete a team (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-team) endpoint.\\n\\nTo delete a team, the authenticated user must be an organization owner or team maintainer.\\n\\nIf you are an organization owner, deleting a parent team will delete all of its child teams as well.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/delete-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#delete-a-team-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/discussions\": {\n      \"get\": {\n        \"summary\": \"List discussions (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussions) endpoint.\\n\\nList all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-discussions-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussions-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team-discussion\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"post\": {\n        \"summary\": \"Create a discussion (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion) endpoint.\\n\\nCreates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/create-discussion-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion post's title.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion post's body text.\"\n                  },\n                  \"private\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post.\",\n                    \"default\": false\n                  }\n                },\n                \"required\": [\n                  \"title\",\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"title\": \"Our first team post\",\n                \"body\": \"Hi! This is an area for us to collaborate as a team.\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/discussions/{discussion_number}\": {\n      \"get\": {\n        \"summary\": \"Get a discussion (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion) endpoint.\\n\\nGet a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-discussion-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"patch\": {\n        \"summary\": \"Update a discussion (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion) endpoint.\\n\\nEdits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/update-discussion-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"title\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion post's title.\"\n                  },\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion post's body text.\"\n                  }\n                }\n              },\n              \"example\": {\n                \"title\": \"Welcome to our first team post\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Delete a discussion (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion) endpoint.\\n\\nDelete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/delete-discussion-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussions\"\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/discussions/{discussion_number}/comments\": {\n      \"get\": {\n        \"summary\": \"List discussion comments (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussion-comments) endpoint.\\n\\nList all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-discussion-comments-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussion-comments-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team-discussion-comment\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-comment-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"post\": {\n        \"summary\": \"Create a discussion comment (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-comment) endpoint.\\n\\nCreates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\\n\\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \\\"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\\\" and \\\"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\\\" for details.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/create-discussion-comment-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-comment-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion comment's body text.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Do you like apples?\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-comment\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"triggersNotification\": true,\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}\": {\n      \"get\": {\n        \"summary\": \"Get a discussion comment (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion-comment) endpoint.\\n\\nGet a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-discussion-comment-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion-comment-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-comment\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"patch\": {\n        \"summary\": \"Update a discussion comment (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion-comment) endpoint.\\n\\nEdits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/update-discussion-comment-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion-comment-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"body\": {\n                    \"type\": \"string\",\n                    \"description\": \"The discussion comment's body text.\"\n                  }\n                },\n                \"required\": [\n                  \"body\"\n                ]\n              },\n              \"example\": {\n                \"body\": \"Do you like pineapples?\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-discussion-comment\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-discussion-comment-2\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Delete a discussion comment (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion-comment) endpoint.\\n\\nDeletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/delete-discussion-comment-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion-comment-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"discussion-comments\"\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\": {\n      \"get\": {\n        \"summary\": \"List reactions for a team discussion comment (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint.\\n\\nList the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/list-for-team-discussion-comment-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#list-reactions-for-a-team-discussion-comment-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          },\n          {\n            \"name\": \"content\",\n            \"description\": \"Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"+1\",\n                \"-1\",\n                \"laugh\",\n                \"confused\",\n                \"heart\",\n                \"hooray\",\n                \"rocket\",\n                \"eyes\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/reaction\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-21\",\n          \"deprecationDate\": \"2020-02-26\",\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"post\": {\n        \"summary\": \"Create reaction for a team discussion comment (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new \\\"[Create reaction for a team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)\\\" endpoint.\\n\\nCreate a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/create-for-team-discussion-comment-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#create-reaction-for-a-team-discussion-comment-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/comment-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the team discussion comment.\",\n                    \"enum\": [\n                      \"+1\",\n                      \"-1\",\n                      \"laugh\",\n                      \"confused\",\n                      \"heart\",\n                      \"hooray\",\n                      \"rocket\",\n                      \"eyes\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"heart\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-21\",\n          \"deprecationDate\": \"2020-02-26\",\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/discussions/{discussion_number}/reactions\": {\n      \"get\": {\n        \"summary\": \"List reactions for a team discussion (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint.\\n\\nList the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/list-for-team-discussion-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#list-reactions-for-a-team-discussion-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          },\n          {\n            \"name\": \"content\",\n            \"description\": \"Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"+1\",\n                \"-1\",\n                \"laugh\",\n                \"confused\",\n                \"heart\",\n                \"hooray\",\n                \"rocket\",\n                \"eyes\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/reaction\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-21\",\n          \"deprecationDate\": \"2020-02-26\",\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"post\": {\n        \"summary\": \"Create reaction for a team discussion (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint.\\n\\nCreate a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion.\",\n        \"tags\": [\n          \"reactions\"\n        ],\n        \"operationId\": \"reactions/create-for-team-discussion-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#create-reaction-for-a-team-discussion-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/discussion-number\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"content\": {\n                    \"type\": \"string\",\n                    \"description\": \"The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types) to add to the team discussion.\",\n                    \"enum\": [\n                      \"+1\",\n                      \"-1\",\n                      \"laugh\",\n                      \"confused\",\n                      \"heart\",\n                      \"hooray\",\n                      \"rocket\",\n                      \"eyes\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"content\"\n                ]\n              },\n              \"example\": {\n                \"content\": \"heart\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/reaction\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/reaction\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"removalDate\": \"2021-02-21\",\n          \"deprecationDate\": \"2020-02-26\",\n          \"category\": \"reactions\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/members\": {\n      \"get\": {\n        \"summary\": \"List team members (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-members) endpoint.\\n\\nTeam members will include the members of child teams.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-members-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-members-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"name\": \"role\",\n            \"description\": \"Filters members returned by their role in the team. Can be one of:  \\n\\\\* `member` - normal members of the team.  \\n\\\\* `maintainer` - team maintainers.  \\n\\\\* `all` - all members of the team.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"member\",\n                \"maintainer\",\n                \"all\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/members/{username}\": {\n      \"get\": {\n        \"summary\": \"Get team member (Legacy)\",\n        \"description\": \"The \\\"Get team member\\\" endpoint (described below) is deprecated.\\n\\nWe recommend using the [Get team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.\\n\\nTo list members in a team, the team must be visible to the authenticated user.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-member-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-member-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"if user is a member\"\n          },\n          \"404\": {\n            \"description\": \"if user is not a member\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        },\n        \"deprecated\": true\n      },\n      \"put\": {\n        \"summary\": \"Add team member (Legacy)\",\n        \"description\": \"The \\\"Add team member\\\" endpoint (described below) is deprecated.\\n\\nWe recommend using the [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.\\n\\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nTo add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.\\n\\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \\\"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\\\"\\n\\nNote that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/add-member-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-team-member-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if team synchronization is set up\"\n          },\n          \"422\": {\n            \"description\": \"Unprocessable Entity if you attempt to add an organization to a team or you attempt to add a user to a team when they are not a member of at least one other team in the same organization\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Remove team member (Legacy)\",\n        \"description\": \"The \\\"Remove team member\\\" endpoint (described below) is deprecated.\\n\\nWe recommend using the [Remove team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.\\n\\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nTo remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.\\n\\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \\\"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\\\"\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/remove-member-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-member-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if team synchronization is setup\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/memberships/{username}\": {\n      \"get\": {\n        \"summary\": \"Get team membership for a user (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-membership-for-a-user) endpoint.\\n\\nTeam members will include the members of child teams.\\n\\nTo get a user's membership with a team, the team must be visible to the authenticated user.\\n\\n**Note:**\\nThe response contains the `state` of the membership and the member's `role`.\\n\\nThe `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-team).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/get-membership-for-user-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-membership-for-a-user-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-membership\"\n                },\n                \"examples\": {\n                  \"response-if-user-is-a-team-maintainer\": {\n                    \"$ref\": \"#/components/examples/team-membership-response-if-user-is-a-team-maintainer\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        },\n        \"deprecated\": true\n      },\n      \"put\": {\n        \"summary\": \"Add or update team membership for a user (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint.\\n\\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nIf the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.\\n\\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \\\"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\\\"\\n\\nIf the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the \\\"pending\\\" state until the user accepts the invitation, at which point the membership will transition to the \\\"active\\\" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.\\n\\nIf the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/add-or-update-membership-for-user-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-membership-for-a-user-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"role\": {\n                    \"type\": \"string\",\n                    \"description\": \"The role that this user should have in the team. Can be one of:  \\n\\\\* `member` - a normal member of the team.  \\n\\\\* `maintainer` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description.\",\n                    \"enum\": [\n                      \"member\",\n                      \"maintainer\"\n                    ],\n                    \"default\": \"member\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-membership\"\n                },\n                \"examples\": {\n                  \"response-if-users-membership-with-team-is-now-pending\": {\n                    \"$ref\": \"#/components/examples/team-membership-response-if-users-membership-with-team-is-now-pending\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"description\": \"Forbidden if team synchronization is set up\"\n          },\n          \"422\": {\n            \"description\": \"Unprocessable Entity if you attempt to add an organization to a team\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Remove team membership for a user (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-membership-for-a-user) endpoint.\\n\\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\\n\\nTo remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.\\n\\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \\\"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\\\"\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/remove-membership-for-user-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-membership-for-a-user-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"description\": \"if team synchronization is set up\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": \"members\"\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/projects\": {\n      \"get\": {\n        \"summary\": \"List team projects (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-projects) endpoint.\\n\\nLists the organization projects for a team.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-projects-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#list-team-projects-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team-project\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-project-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/projects/{project_id}\": {\n      \"get\": {\n        \"summary\": \"Check team permissions for a project (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#check-team-permissions-for-a-project) endpoint.\\n\\nChecks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/check-permissions-for-project-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#check-team-permissions-for-a-project-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-project\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-project\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"Not Found if project is not managed by this team\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"put\": {\n        \"summary\": \"Add or update team project permissions (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-project-permissions) endpoint.\\n\\nAdds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/add-or-update-project-permissions-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#add-or-update-team-project-permissions-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"The permission to grant to the team for this project. Can be one of:  \\n\\\\* `read` - team members can read, but not write to or administer this project.  \\n\\\\* `write` - team members can read and write, but not administer this project.  \\n\\\\* `admin` - team members can read, write and administer this project.  \\nDefault: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n                    \"enum\": [\n                      \"read\",\n                      \"write\",\n                      \"admin\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"description\": \"Forbidden if the project is not owned by the organization\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"message\": {\n                      \"type\": \"string\"\n                    },\n                    \"documentation_url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"response-if-the-project-is-not-owned-by-the-organization\": {\n                    \"value\": {\n                      \"message\": \"Must have admin rights to Repository.\",\n                      \"documentation_url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-project-permissions\"\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Remove a project from a team (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-a-project-from-a-team) endpoint.\\n\\nRemoves an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/remove-project-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#remove-a-project-from-a-team-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/project-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/repos\": {\n      \"get\": {\n        \"summary\": \"List team repositories (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-repositories) endpoint.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-repos-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#list-team-repositories-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/minimal-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/repos/{owner}/{repo}\": {\n      \"get\": {\n        \"summary\": \"Check team permissions for a repository (Legacy)\",\n        \"description\": \"**Note**: Repositories inherited through a parent team will also be checked.\\n\\n**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#check-team-permissions-for-a-repository) endpoint.\\n\\nYou can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `Accept` header:\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/check-permissions-for-repo-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#check-team-permissions-for-a-repository-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Alternative response with extra repository information\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/team-repository\"\n                },\n                \"examples\": {\n                  \"alternative-response-with-extra-repository-information\": {\n                    \"$ref\": \"#/components/examples/team-repository-alternative-response-with-extra-repository-information\"\n                  }\n                }\n              }\n            }\n          },\n          \"204\": {\n            \"description\": \"Response if repository is managed by this team\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if repository is not managed by this team\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      },\n      \"put\": {\n        \"summary\": \"Add or update team repository permissions (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new \\\"[Add or update team repository permissions](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-repository-permissions)\\\" endpoint.\\n\\nTo add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization.\\n\\nNote that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/add-or-update-repo-permissions-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#add-or-update-team-repository-permissions-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"permission\": {\n                    \"type\": \"string\",\n                    \"description\": \"The permission to grant the team on this repository. Can be one of:  \\n\\\\* `pull` - team members can pull, but not push to or administer this repository.  \\n\\\\* `push` - team members can pull and push, but not administer this repository.  \\n\\\\* `admin` - team members can pull, push and administer this repository.  \\n  \\nIf no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository.\",\n                    \"enum\": [\n                      \"pull\",\n                      \"push\",\n                      \"admin\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      },\n      \"delete\": {\n        \"summary\": \"Remove a repository from a team (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-a-repository-from-a-team) endpoint.\\n\\nIf the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/remove-repo-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#remove-a-repository-from-a-team-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/teams/{team_id}/teams\": {\n      \"get\": {\n        \"summary\": \"List child teams (Legacy)\",\n        \"description\": \"**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-child-teams) endpoint.\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-child-legacy\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#list-child-teams-legacy\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/team-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"if child teams exist\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team\"\n                  }\n                },\n                \"examples\": {\n                  \"response-if-child-teams-exist\": {\n                    \"$ref\": \"#/components/examples/team-items-response-if-child-teams-exist\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"removalDate\": \"2021-02-01\",\n          \"deprecationDate\": \"2020-01-21\",\n          \"category\": \"teams\",\n          \"subcategory\": null\n        },\n        \"deprecated\": true\n      }\n    },\n    \"/user\": {\n      \"get\": {\n        \"summary\": \"Get the authenticated user\",\n        \"description\": \"If the authenticated user is authenticated through basic authentication or OAuth with the `user` scope, then the response lists public and private profile information.\\n\\nIf the authenticated user is authenticated through OAuth without the `user` scope, then the response lists only public profile information.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/get-authenticated\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-the-authenticated-user\"\n        },\n        \"parameters\": [\n\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"oneOf\": [\n                    {\n                      \"$ref\": \"#/components/schemas/private-user\"\n                    },\n                    {\n                      \"$ref\": \"#/components/schemas/public-user\"\n                    }\n                  ]\n                },\n                \"examples\": {\n                  \"response-with-public-and-private-profile-information\": {\n                    \"$ref\": \"#/components/examples/private-user-response-with-public-and-private-profile-information\"\n                  },\n                  \"response-with-public-profile-information\": {\n                    \"$ref\": \"#/components/examples/private-user-response-with-public-profile-information\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": null\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update the authenticated user\",\n        \"description\": \"**Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/update-authenticated\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users/#update-the-authenticated-user\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"The new name of the user.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Omar Jahandar\"\n                    ]\n                  },\n                  \"email\": {\n                    \"description\": \"The publicly visible email address of the user.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"omar@example.com\"\n                    ]\n                  },\n                  \"blog\": {\n                    \"description\": \"The new blog URL of the user.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"blog.example.com\"\n                    ]\n                  },\n                  \"twitter_username\": {\n                    \"description\": \"The new Twitter username of the user.\",\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"examples\": [\n                      \"therealomarj\"\n                    ]\n                  },\n                  \"company\": {\n                    \"description\": \"The new company of the user.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Acme corporation\"\n                    ]\n                  },\n                  \"location\": {\n                    \"description\": \"The new location of the user.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Berlin, Germany\"\n                    ]\n                  },\n                  \"hireable\": {\n                    \"description\": \"The new hiring availability of the user.\",\n                    \"type\": \"boolean\"\n                  },\n                  \"bio\": {\n                    \"description\": \"The new short biography of the user.\",\n                    \"type\": \"string\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/private-user\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/private-user\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/user/emails\": {\n      \"get\": {\n        \"summary\": \"List email addresses for the authenticated user\",\n        \"description\": \"Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the `user:email` scope.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-emails-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-email-addresses-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/email\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/email-items-2\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"emails\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Add an email address for the authenticated user\",\n        \"description\": \"This endpoint is accessible with the `user` scope.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/add-email-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#add-an-email-address-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": false,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"emails\": {\n                        \"description\": \"Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key.\",\n                        \"type\": \"array\",\n                        \"items\": {\n                          \"type\": \"string\",\n                          \"minItems\": 1,\n                          \"examples\": [\n                            \"username@example.com\"\n                          ]\n                        },\n                        \"examples\": [\n\n                        ]\n                      }\n                    },\n                    \"required\": [\n                      \"emails\"\n                    ],\n                    \"example\": {\n                      \"emails\": [\n                        \"octocat@github.com\",\n                        \"mona@github.com\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\",\n                      \"minItems\": 1,\n                      \"examples\": [\n                        \"username@example.com\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"string\"\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/email\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/email-items\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"emails\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete an email address for the authenticated user\",\n        \"description\": \"This endpoint is accessible with the `user` scope.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/delete-email-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#delete-an-email-address-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\",\n                    \"description\": \"Deletes one or more email addresses from your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key.\",\n                    \"properties\": {\n                      \"emails\": {\n                        \"description\": \"Email addresses associated with the GitHub user account.\",\n                        \"type\": \"array\",\n                        \"items\": {\n                          \"type\": \"string\",\n                          \"minItems\": 1,\n                          \"examples\": [\n                            \"username@example.com\"\n                          ]\n                        }\n                      }\n                    },\n                    \"example\": {\n                      \"emails\": [\n                        \"octocat@github.com\",\n                        \"mona@github.com\"\n                      ]\n                    },\n                    \"required\": [\n                      \"emails\"\n                    ]\n                  },\n                  {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\",\n                      \"minItems\": 1,\n                      \"examples\": [\n                        \"username@example.com\"\n                      ]\n                    }\n                  },\n                  {\n                    \"type\": \"string\"\n                  }\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"emails\"\n        }\n      }\n    },\n    \"/user/followers\": {\n      \"get\": {\n        \"summary\": \"List followers of the authenticated user\",\n        \"description\": \"Lists the people following the authenticated user.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-followers-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-followers-of-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"followers\"\n        }\n      }\n    },\n    \"/user/following\": {\n      \"get\": {\n        \"summary\": \"List the people the authenticated user follows\",\n        \"description\": \"Lists the people who the authenticated user follows.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-followed-by-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-the-people-the-authenticated-user-follows\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"followers\"\n        }\n      }\n    },\n    \"/user/following/{username}\": {\n      \"get\": {\n        \"summary\": \"Check if a person is followed by the authenticated user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/check-person-is-followed-by-authenticated\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#check-if-a-person-is-followed-by-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"if the person is followed by the authenticated user\"\n          },\n          \"404\": {\n            \"description\": \"if the person is not followed by the authenticated user\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/basic-error\"\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"followers\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Follow a user\",\n        \"description\": \"Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\\n\\nFollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/follow\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#follow-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"followers\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Unfollow a user\",\n        \"description\": \"Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/unfollow\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#unfollow-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"followers\"\n        }\n      }\n    },\n    \"/user/gpg_keys\": {\n      \"get\": {\n        \"summary\": \"List GPG keys for the authenticated user\",\n        \"description\": \"Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-gpg-keys-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-gpg-keys-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/gpg-key\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gpg-key-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"gpg-keys\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a GPG key for the authenticated user\",\n        \"description\": \"Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"operationId\": \"users/create-gpg-key-for-authenticated-user\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#create-a-gpg-key-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"armored_public_key\": {\n                    \"description\": \"A GPG key in ASCII-armored format.\",\n                    \"type\": \"string\"\n                  }\n                },\n                \"type\": \"object\",\n                \"required\": [\n                  \"armored_public_key\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gpg-key\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gpg-key\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"gpg-keys\"\n        }\n      }\n    },\n    \"/user/gpg_keys/{gpg_key_id}\": {\n      \"get\": {\n        \"summary\": \"Get a GPG key for the authenticated user\",\n        \"description\": \"View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/get-gpg-key-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-a-gpg-key-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gpg-key-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/gpg-key\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gpg-key\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"gpg-keys\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a GPG key for the authenticated user\",\n        \"description\": \"Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:gpg_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/delete-gpg-key-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#delete-a-gpg-key-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/gpg-key-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"gpg-keys\"\n        }\n      }\n    },\n    \"/user/installations\": {\n      \"get\": {\n        \"summary\": \"List app installations accessible to the user access token\",\n        \"description\": \"Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.\\n\\nYou must use a [user-to-server OAuth access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint.\\n\\nThe authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.\\n\\nYou can find the permissions for the installation under the `permissions` key.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/list-installations-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-app-installations-accessible-to-the-user-access-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"You can find the permissions for the installation under the `permissions` key.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"installations\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"installations\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/installation\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/base-installation-for-auth-user-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"installations\"\n        }\n      }\n    },\n    \"/user/installations/{installation_id}/repositories\": {\n      \"get\": {\n        \"summary\": \"List repositories accessible to the user access token\",\n        \"description\": \"List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.\\n\\nThe authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.\\n\\nYou must use a [user-to-server OAuth access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint.\\n\\nThe access the user has to each repository is included in the hash under the `permissions` key.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/list-installation-repos-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-repositories-accessible-to-the-user-access-token\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/installation-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The access the user has to each repository is included in the hash under the `permissions` key.\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                    \"total_count\",\n                    \"repositories\"\n                  ],\n                  \"properties\": {\n                    \"total_count\": {\n                      \"type\": \"integer\"\n                    },\n                    \"repository_selection\": {\n                      \"type\": \"string\"\n                    },\n                    \"repositories\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/repository\"\n                      }\n                    }\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-paginated\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"installations\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"mercy\",\n              \"note\": \"The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.mercy-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/user/installations/{installation_id}/repositories/{repository_id}\": {\n      \"put\": {\n        \"summary\": \"Add a repository to an app installation\",\n        \"description\": \"Add a single repository to an installation. The authenticated user must have admin access to the repository.\\n\\nYou must use a personal access token (which you can create via the [command line](https://docs.github.com/enterprise-server@3.0/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/add-repo-to-installation-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#add-a-repository-to-an-app-installation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/installation-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repository-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"installations\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Remove a repository from an app installation\",\n        \"description\": \"Remove a single repository from an installation. The authenticated user must have admin access to the repository.\\n\\nYou must use a personal access token (which you can create via the [command line](https://docs.github.com/enterprise-server@3.0/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/remove-repo-from-installation-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#remove-a-repository-from-an-app-installation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/installation-id\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repository-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": \"installations\"\n        }\n      }\n    },\n    \"/user/issues\": {\n      \"get\": {\n        \"summary\": \"List user account issues assigned to the authenticated user\",\n        \"description\": \"List issues across owned and member repositories assigned to the authenticated user.\\n\\n**Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\\nreason, \\\"Issues\\\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \\\"Issues\\\" endpoints will be an _issue id_. To find out the pull\\nrequest id, use the \\\"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\\\" endpoint.\",\n        \"tags\": [\n          \"issues\"\n        ],\n        \"operationId\": \"issues/list-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-user-account-issues-assigned-to-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"filter\",\n            \"description\": \"Indicates which sorts of issues to return. Can be one of:  \\n\\\\* `assigned`: Issues assigned to you  \\n\\\\* `created`: Issues created by you  \\n\\\\* `mentioned`: Issues mentioning you  \\n\\\\* `subscribed`: Issues you're subscribed to updates for  \\n\\\\* `all` or `repos`: All issues the authenticated user can see, regardless of participation or creation\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"assigned\",\n                \"created\",\n                \"mentioned\",\n                \"subscribed\",\n                \"repos\",\n                \"all\"\n              ],\n              \"default\": \"assigned\"\n            }\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/labels\"\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"What to sort results by. Can be either `created`, `updated`, `comments`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"comments\"\n              ],\n              \"default\": \"created\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/issue\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/issue-with-repo-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"issues\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"machine-man\",\n              \"note\": \"If an issue event is created via a GitHub App, the response will include the `performed_via_github_app` object with\\tinformation about the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo receive the `performed_via_github_app` object in the response, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"squirrel-girl\",\n              \"note\": \"An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\\n\\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.squirrel-girl-preview\\n```\\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\"\n            }\n          ]\n        }\n      }\n    },\n    \"/user/keys\": {\n      \"get\": {\n        \"summary\": \"List public SSH keys for the authenticated user\",\n        \"description\": \"Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-public-ssh-keys-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-public-ssh-keys-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/key\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/key-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"keys\"\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a public SSH key for the authenticated user\",\n        \"description\": \"Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"operationId\": \"users/create-public-ssh-key-for-authenticated-user\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#create-a-public-ssh-key-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"title\": {\n                    \"description\": \"A descriptive name for the new key.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Personal MacBook Air\"\n                    ]\n                  },\n                  \"key\": {\n                    \"description\": \"The public SSH key to add to your GitHub account.\",\n                    \"type\": \"string\",\n                    \"pattern\": \"^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) \"\n                  }\n                },\n                \"required\": [\n                  \"key\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/key\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/key\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"keys\"\n        }\n      }\n    },\n    \"/user/keys/{key_id}\": {\n      \"get\": {\n        \"summary\": \"Get a public SSH key for the authenticated user\",\n        \"description\": \"View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/get-public-ssh-key-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-a-public-ssh-key-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/key-id\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/key\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/key\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"keys\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Delete a public SSH key for the authenticated user\",\n        \"description\": \"Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:public_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/delete-public-ssh-key-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#delete-a-public-ssh-key-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/key-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"keys\"\n        }\n      }\n    },\n    \"/user/memberships/orgs\": {\n      \"get\": {\n        \"summary\": \"List organization memberships for the authenticated user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list-memberships-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organization-memberships-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"state\",\n            \"description\": \"Indicates the state of the memberships to return. Can be either `active` or `pending`. If not specified, the API returns both active and pending memberships.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"active\",\n                \"pending\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/org-membership\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-membership-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/user/memberships/orgs/{org}\": {\n      \"get\": {\n        \"summary\": \"Get an organization membership for the authenticated user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/get-membership-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-an-organization-membership-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-membership\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-membership\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      },\n      \"patch\": {\n        \"summary\": \"Update an organization membership for the authenticated user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/update-membership-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#update-an-organization-membership-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"state\": {\n                    \"type\": \"string\",\n                    \"description\": \"The state that the membership should be in. Only `\\\"active\\\"` will be accepted.\",\n                    \"enum\": [\n                      \"active\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"state\"\n                ]\n              },\n              \"example\": {\n                \"state\": \"active\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/org-membership\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/org-membership-2\"\n                  }\n                }\n              }\n            }\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"orgs\",\n          \"subcategory\": \"members\"\n        }\n      }\n    },\n    \"/user/orgs\": {\n      \"get\": {\n        \"summary\": \"List organizations for the authenticated user\",\n        \"description\": \"List organizations for the authenticated user.\\n\\n**OAuth scope requirements**\\n\\nThis only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope. OAuth requests with insufficient scope receive a `403 Forbidden` response.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organizations-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/organization-simple\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-simple-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"orgs\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/user/projects\": {\n      \"post\": {\n        \"summary\": \"Create a user project\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/create-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-a-user-project\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"Name of the project\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Week One Sprint\"\n                    ]\n                  },\n                  \"body\": {\n                    \"description\": \"Body of the project\",\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"examples\": [\n                      \"This project represents the sprint of the first week in January\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/project\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project\"\n                  }\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"415\": {\n            \"$ref\": \"#/components/responses/preview_header_missing\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed_simple\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/user/public_emails\": {\n      \"get\": {\n        \"summary\": \"List public email addresses for the authenticated user\",\n        \"description\": \"Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/enterprise-server@3.0/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-public-emails-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-public-email-addresses-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/email\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/email-items-2\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": \"emails\"\n        }\n      }\n    },\n    \"/user/repos\": {\n      \"get\": {\n        \"summary\": \"List repositories for the authenticated user\",\n        \"description\": \"Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.\\n\\nThe authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repositories-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"name\": \"visibility\",\n            \"description\": \"Can be one of `all`, `public`, or `private`. Note: For GitHub AE, can be one of `all`, `internal`, or `private`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"all\",\n                \"public\",\n                \"private\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"name\": \"affiliation\",\n            \"description\": \"Comma-separated list of values. Can include:  \\n\\\\* `owner`: Repositories that are owned by the authenticated user.  \\n\\\\* `collaborator`: Repositories that the user has been added to as a collaborator.  \\n\\\\* `organization_member`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"default\": \"owner,collaborator,organization_member\"\n            }\n          },\n          {\n            \"name\": \"type\",\n            \"description\": \"Can be one of `all`, `owner`, `public`, `private`, `member`. Note: For GitHub AE, can be one of `all`, `owner`, `internal`, `private`, `member`. Default: `all`  \\n  \\nWill cause a `422` error if used in the same request as **visibility** or **affiliation**. Will cause a `422` error if used in the same request as **visibility** or **affiliation**.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"all\",\n                \"owner\",\n                \"public\",\n                \"private\",\n                \"member\"\n              ],\n              \"default\": \"all\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Can be one of `created`, `updated`, `pushed`, `full_name`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"pushed\",\n                \"full_name\"\n              ],\n              \"default\": \"full_name\"\n            }\n          },\n          {\n            \"name\": \"direction\",\n            \"description\": \"Can be one of `asc` or `desc`. Default: `asc` when using `full_name`, otherwise `desc`\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"asc\",\n                \"desc\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/before\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-items-default-response\"\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"repos\",\n          \"subcategory\": null\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a repository for the authenticated user\",\n        \"description\": \"Creates a new repository for the authenticated user.\\n\\n**OAuth scope requirements**\\n\\nWhen using [OAuth](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\\n\\n*   `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\\n*   `repo` scope to create a private repository.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/create-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"properties\": {\n                  \"name\": {\n                    \"description\": \"The name of the repository.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Team Environment\"\n                    ]\n                  },\n                  \"description\": {\n                    \"description\": \"A short description of the repository.\",\n                    \"type\": \"string\"\n                  },\n                  \"homepage\": {\n                    \"description\": \"A URL with more information about the repository.\",\n                    \"type\": \"string\"\n                  },\n                  \"private\": {\n                    \"description\": \"Whether the repository is private.\",\n                    \"default\": false,\n                    \"type\": \"boolean\"\n                  },\n                  \"has_issues\": {\n                    \"description\": \"Whether issues are enabled.\",\n                    \"default\": true,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      true\n                    ]\n                  },\n                  \"has_projects\": {\n                    \"description\": \"Whether projects are enabled.\",\n                    \"default\": true,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      true\n                    ]\n                  },\n                  \"has_wiki\": {\n                    \"description\": \"Whether the wiki is enabled.\",\n                    \"default\": true,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      true\n                    ]\n                  },\n                  \"team_id\": {\n                    \"description\": \"The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization.\",\n                    \"type\": \"integer\"\n                  },\n                  \"auto_init\": {\n                    \"description\": \"Whether the repository is initialized with a minimal README.\",\n                    \"default\": false,\n                    \"type\": \"boolean\"\n                  },\n                  \"gitignore_template\": {\n                    \"description\": \"The desired language or platform to apply to the .gitignore.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"Haskell\"\n                    ]\n                  },\n                  \"license_template\": {\n                    \"description\": \"The license keyword of the open source license for this repository.\",\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"mit\"\n                    ]\n                  },\n                  \"allow_squash_merge\": {\n                    \"description\": \"Whether to allow squash merges for pull requests.\",\n                    \"default\": true,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      true\n                    ]\n                  },\n                  \"allow_merge_commit\": {\n                    \"description\": \"Whether to allow merge commits for pull requests.\",\n                    \"default\": true,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      true\n                    ]\n                  },\n                  \"allow_rebase_merge\": {\n                    \"description\": \"Whether to allow rebase merges for pull requests.\",\n                    \"default\": true,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      true\n                    ]\n                  },\n                  \"delete_branch_on_merge\": {\n                    \"description\": \"Whether to delete head branches when pull requests are merged\",\n                    \"default\": false,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      false\n                    ]\n                  },\n                  \"has_downloads\": {\n                    \"description\": \"Whether downloads are enabled.\",\n                    \"default\": true,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      true\n                    ]\n                  },\n                  \"is_template\": {\n                    \"description\": \"Whether this repository acts as a template that can be used to generate new repositories.\",\n                    \"default\": false,\n                    \"type\": \"boolean\",\n                    \"examples\": [\n                      true\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ],\n                \"type\": \"object\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/repository\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Location\": {\n                \"example\": \"https://api.github.com/repos/octocat/Hello-World\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          },\n          \"400\": {\n            \"$ref\": \"#/components/responses/bad_request\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"nebula\",\n              \"note\": \"You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\\n\\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.nebula-preview+json\\n```\"\n            },\n            {\n              \"required\": false,\n              \"name\": \"baptiste\",\n              \"note\": \"The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n\\n```shell\\napplication/vnd.github.baptiste-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/user/repository_invitations\": {\n      \"get\": {\n        \"summary\": \"List repository invitations for the authenticated user\",\n        \"description\": \"When authenticating as a user, this endpoint will list all currently open repository invitations for that user.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-invitations-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-invitations-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/repository-invitation\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/repository-invitation-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"repos\",\n          \"subcategory\": \"invitations\"\n        }\n      }\n    },\n    \"/user/repository_invitations/{invitation_id}\": {\n      \"patch\": {\n        \"summary\": \"Accept a repository invitation\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/accept-invitation-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#accept-a-repository-invitation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/invitation-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"409\": {\n            \"$ref\": \"#/components/responses/conflict\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"repos\",\n          \"subcategory\": \"invitations\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Decline a repository invitation\",\n        \"description\": \"\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/decline-invitation-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#decline-a-repository-invitation\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/invitation-id\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"409\": {\n            \"$ref\": \"#/components/responses/conflict\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"repos\",\n          \"subcategory\": \"invitations\"\n        }\n      }\n    },\n    \"/user/starred\": {\n      \"get\": {\n        \"summary\": \"List repositories starred by the authenticated user\",\n        \"description\": \"Lists repositories the authenticated user has starred.\\n\\nYou can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `Accept` header:\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-repos-starred-by-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repositories-starred-by-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/sort\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/repository-items-default-response\"\n                  }\n                }\n              },\n              \"application/vnd.github.v3.star+json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/starred-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"alternative-response-with-star-creation-timestamps\": {\n                    \"$ref\": \"#/components/examples/starred-repository-items-alternative-response-with-star-creation-timestamps\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"starring\"\n        }\n      }\n    },\n    \"/user/starred/{owner}/{repo}\": {\n      \"get\": {\n        \"summary\": \"Check if a repository is starred by the authenticated user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/check-repo-is-starred-by-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#check-if-a-repository-is-starred-by-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response if this repository is starred by you\"\n          },\n          \"404\": {\n            \"description\": \"Not Found if this repository is not starred by you\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/basic-error\"\n                }\n              }\n            }\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"starring\"\n        }\n      },\n      \"put\": {\n        \"summary\": \"Star a repository for the authenticated user\",\n        \"description\": \"Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/star-repo-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#star-a-repository-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"starring\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Unstar a repository for the authenticated user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/unstar-repo-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#unstar-a-repository-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/owner\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/repo\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"starring\"\n        }\n      }\n    },\n    \"/user/subscriptions\": {\n      \"get\": {\n        \"summary\": \"List repositories watched by the authenticated user\",\n        \"description\": \"Lists repositories the authenticated user is watching.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-watched-repos-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repositories-watched-by-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/minimal-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          },\n          \"401\": {\n            \"$ref\": \"#/components/responses/requires_authentication\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"watching\"\n        }\n      }\n    },\n    \"/user/teams\": {\n      \"get\": {\n        \"summary\": \"List teams for the authenticated user\",\n        \"description\": \"List all of the teams across all of the organizations to which the authenticated user belongs. This method requires `user`, `repo`, or `read:org` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/).\",\n        \"tags\": [\n          \"teams\"\n        ],\n        \"operationId\": \"teams/list-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-teams-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/team-full\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/team-full-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"403\": {\n            \"$ref\": \"#/components/responses/forbidden\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"teams\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/users\": {\n      \"get\": {\n        \"summary\": \"List users\",\n        \"description\": \"Lists all users, in the order that they signed up on GitHub Enterprise Server. This list includes personal user accounts and organization accounts.\\n\\nNote: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-users\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/since-user\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"example\": \"<https://api.github.com/users?since=135>; rel=\\\"next\\\"\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"304\": {\n            \"$ref\": \"#/components/responses/not_modified\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"users\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/users/{username}\": {\n      \"get\": {\n        \"summary\": \"Get a user\",\n        \"description\": \"Provides publicly available information about someone with a GitHub account.\\n\\nGitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub Enterprise Server plan. The GitHub App must be authenticated as a user. See \\\"[Identifying and authorizing users for GitHub Apps](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)\\\" for details about authentication. For an example response, see 'Response with GitHub Enterprise Server plan information' below\\\"\\n\\nThe `email` key in the following response is the publicly visible email address from your GitHub Enterprise Server [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub Enterprise Server. For more information, see [Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#authentication).\\n\\nThe Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see \\\"[Emails API](https://docs.github.com/enterprise-server@3.0/rest/reference/users#emails)\\\".\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/get-by-username\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"oneOf\": [\n                    {\n                      \"$ref\": \"#/components/schemas/private-user\"\n                    },\n                    {\n                      \"$ref\": \"#/components/schemas/public-user\"\n                    }\n                  ]\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/public-user-default-response\"\n                  },\n                  \"response-with-git-hub-plan-information\": {\n                    \"$ref\": \"#/components/examples/public-user-response-with-git-hub-plan-information\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"users\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/users/{username}/events\": {\n      \"get\": {\n        \"summary\": \"List events for the authenticated user\",\n        \"description\": \"If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-events-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-events-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/users/{username}/events/orgs/{org}\": {\n      \"get\": {\n        \"summary\": \"List organization events for the authenticated user\",\n        \"description\": \"This is the user's organization dashboard. You must be authenticated as the user to view this.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-org-events-for-authenticated-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-organization-events-for-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/org\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/users/{username}/events/public\": {\n      \"get\": {\n        \"summary\": \"List public events for a user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-public-events-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-events-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/users/{username}/followers\": {\n      \"get\": {\n        \"summary\": \"List followers of a user\",\n        \"description\": \"Lists the people following the specified user.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-followers-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-followers-of-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"users\",\n          \"subcategory\": \"followers\"\n        }\n      }\n    },\n    \"/users/{username}/following\": {\n      \"get\": {\n        \"summary\": \"List the people a user follows\",\n        \"description\": \"Lists the people who the specified user follows.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-following-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-the-people-a-user-follows\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/simple-user-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"users\",\n          \"subcategory\": \"followers\"\n        }\n      }\n    },\n    \"/users/{username}/following/{target_user}\": {\n      \"get\": {\n        \"summary\": \"Check if a user follows another user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/check-following-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#check-if-a-user-follows-another-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"name\": \"target_user\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"if the user follows the target user\"\n          },\n          \"404\": {\n            \"description\": \"if the user does not follow the target user\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"users\",\n          \"subcategory\": \"followers\"\n        }\n      }\n    },\n    \"/users/{username}/gists\": {\n      \"get\": {\n        \"summary\": \"List gists for a user\",\n        \"description\": \"Lists public gists for the specified user:\",\n        \"tags\": [\n          \"gists\"\n        ],\n        \"operationId\": \"gists/list-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gists-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/since\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/base-gist\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/base-gist-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"gists\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/users/{username}/gpg_keys\": {\n      \"get\": {\n        \"summary\": \"List GPG keys for a user\",\n        \"description\": \"Lists the GPG keys for a user. This information is accessible by anyone.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-gpg-keys-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-gpg-keys-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/gpg-key\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/gpg-key-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"users\",\n          \"subcategory\": \"gpg-keys\"\n        }\n      }\n    },\n    \"/users/{username}/hovercard\": {\n      \"get\": {\n        \"summary\": \"Get contextual information for a user\",\n        \"description\": \"Provides hovercard information when authenticated through basic auth or OAuth with the `repo` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.\\n\\nThe `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository via cURL, it would look like this:\\n\\n```shell\\n curl -u username:token\\n  https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192\\n```\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/get-context-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-contextual-information-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"name\": \"subject_type\",\n            \"description\": \"Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"organization\",\n                \"repository\",\n                \"issue\",\n                \"pull_request\"\n              ]\n            }\n          },\n          {\n            \"name\": \"subject_id\",\n            \"description\": \"Uses the ID for the `subject_type` you specified. **Required** when using `subject_type`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/hovercard\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/hovercard\"\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"$ref\": \"#/components/responses/not_found\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"users\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/users/{username}/installation\": {\n      \"get\": {\n        \"summary\": \"Get a user installation for the authenticated app\",\n        \"description\": \"Enables an authenticated GitHub App to find the user’s installation information.\\n\\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\",\n        \"tags\": [\n          \"apps\"\n        ],\n        \"operationId\": \"apps/get-user-installation\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-a-user-installation-for-the-authenticated-app\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/installation\"\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/installation\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"apps\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/users/{username}/keys\": {\n      \"get\": {\n        \"summary\": \"List public keys for a user\",\n        \"description\": \"Lists the _verified_ public SSH keys for a user. This is accessible by anyone.\",\n        \"tags\": [\n          \"users\"\n        ],\n        \"operationId\": \"users/list-public-keys-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-public-keys-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/key-simple\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/key-simple-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"users\",\n          \"subcategory\": \"keys\"\n        }\n      }\n    },\n    \"/users/{username}/orgs\": {\n      \"get\": {\n        \"summary\": \"List organizations for a user\",\n        \"description\": \"List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.\\n\\nThis method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead.\",\n        \"tags\": [\n          \"orgs\"\n        ],\n        \"operationId\": \"orgs/list-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organizations-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/organization-simple\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/organization-simple-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"orgs\",\n          \"subcategory\": null\n        }\n      }\n    },\n    \"/users/{username}/projects\": {\n      \"get\": {\n        \"summary\": \"List user projects\",\n        \"description\": \"\",\n        \"tags\": [\n          \"projects\"\n        ],\n        \"operationId\": \"projects/list-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-user-projects\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"name\": \"state\",\n            \"description\": \"Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"open\",\n                \"closed\",\n                \"all\"\n              ],\n              \"default\": \"open\"\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/project\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/project-items-3\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/validation_failed\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"projects\",\n          \"previews\": [\n            {\n              \"required\": true,\n              \"name\": \"inertia\",\n              \"note\": \"The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.inertia-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/users/{username}/received_events\": {\n      \"get\": {\n        \"summary\": \"List events received by the authenticated user\",\n        \"description\": \"These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-received-events-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-events-received-by-the-authenticated-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/users/{username}/received_events/public\": {\n      \"get\": {\n        \"summary\": \"List public events received by a user\",\n        \"description\": \"\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-received-public-events-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-events-received-by-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/event\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"events\"\n        }\n      }\n    },\n    \"/users/{username}/repos\": {\n      \"get\": {\n        \"summary\": \"List repositories for a user\",\n        \"description\": \"Lists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user.\",\n        \"tags\": [\n          \"repos\"\n        ],\n        \"operationId\": \"repos/list-for-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repositories-for-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"name\": \"type\",\n            \"description\": \"Can be one of `all`, `owner`, `member`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"all\",\n                \"owner\",\n                \"member\"\n              ],\n              \"default\": \"owner\"\n            }\n          },\n          {\n            \"name\": \"sort\",\n            \"description\": \"Can be one of `created`, `updated`, `pushed`, `full_name`.\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"created\",\n                \"updated\",\n                \"pushed\",\n                \"full_name\"\n              ],\n              \"default\": \"full_name\"\n            }\n          },\n          {\n            \"name\": \"direction\",\n            \"description\": \"Can be one of `asc` or `desc`. Default: `asc` when using `full_name`, otherwise `desc`\",\n            \"in\": \"query\",\n            \"required\": false,\n            \"schema\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"asc\",\n                \"desc\"\n              ]\n            }\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/minimal-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"repos\",\n          \"previews\": [\n            {\n              \"required\": false,\n              \"name\": \"nebula\",\n              \"note\": \"You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\\n\\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\\n```shell\\napplication/vnd.github.nebula-preview+json\\n```\"\n            }\n          ]\n        }\n      }\n    },\n    \"/users/{username}/site_admin\": {\n      \"put\": {\n        \"summary\": \"Promote a user to be a site administrator\",\n        \"description\": \"Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n        \"operationId\": \"enterprise-admin/promote-user-to-be-site-administrator\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#promote-a-user-to-be-a-site-administrator\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Demote a site administrator\",\n        \"description\": \"You can demote any user account except your own.\",\n        \"operationId\": \"enterprise-admin/demote-site-administrator\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#demote-a-site-administrator\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/users/{username}/starred\": {\n      \"get\": {\n        \"summary\": \"List repositories starred by a user\",\n        \"description\": \"Lists repositories a user has starred.\\n\\nYou can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `Accept` header:\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-repos-starred-by-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repositories-starred-by-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/sort\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/direction\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"anyOf\": [\n                    {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/starred-repository\"\n                      }\n                    },\n                    {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/repository\"\n                      }\n                    }\n                  ]\n                },\n                \"examples\": {\n                  \"default-response\": {\n                    \"$ref\": \"#/components/examples/repository-items-default-response\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"starring\"\n        }\n      }\n    },\n    \"/users/{username}/subscriptions\": {\n      \"get\": {\n        \"summary\": \"List repositories watched by a user\",\n        \"description\": \"Lists repositories a user is watching.\",\n        \"tags\": [\n          \"activity\"\n        ],\n        \"operationId\": \"activity/list-repos-watched-by-user\",\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repositories-watched-by-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/per-page\"\n          },\n          {\n            \"$ref\": \"#/components/parameters/page\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/minimal-repository\"\n                  }\n                },\n                \"examples\": {\n                  \"default\": {\n                    \"$ref\": \"#/components/examples/minimal-repository-items\"\n                  }\n                }\n              }\n            },\n            \"headers\": {\n              \"Link\": {\n                \"$ref\": \"#/components/headers/link\"\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"activity\",\n          \"subcategory\": \"watching\"\n        }\n      }\n    },\n    \"/users/{username}/suspended\": {\n      \"put\": {\n        \"summary\": \"Suspend a user\",\n        \"description\": \"If your GitHub instance uses [LDAP Sync with Active Directory LDAP servers](https://docs.github.com/enterprise/admin/guides/user-management/using-ldap), Active Directory LDAP-authenticated users cannot be suspended through this API. If you attempt to suspend an Active Directory LDAP-authenticated user through this API, it will return a `403` response.\\n\\nYou can suspend any user account except your own.\\n\\nNote that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\",\n        \"operationId\": \"enterprise-admin/suspend-user\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#suspend-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"reason\": {\n                    \"type\": \"string\",\n                    \"description\": \"The reason the user is being suspended. This message will be logged in the [audit log](https://docs.github.com/enterprise/admin/articles/audit-logging/). If you don't provide a `reason`, it will default to \\\"Suspended via API by _SITE\\\\_ADMINISTRATOR_\\\", where _SITE\\\\_ADMINISTRATOR_ is the person who performed the action.\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      },\n      \"delete\": {\n        \"summary\": \"Unsuspend a user\",\n        \"description\": \"If your GitHub instance uses [LDAP Sync with Active Directory LDAP servers](https://docs.github.com/enterprise/admin/guides/user-management/using-ldap), this API is disabled and will return a `403` response. Active Directory LDAP-authenticated users cannot be unsuspended using the API.\",\n        \"operationId\": \"enterprise-admin/unsuspend-user\",\n        \"tags\": [\n          \"enterprise-admin\"\n        ],\n        \"externalDocs\": {\n          \"description\": \"API method documentation\",\n          \"url\": \"https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#unsuspend-a-user\"\n        },\n        \"parameters\": [\n          {\n            \"$ref\": \"#/components/parameters/username\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"Response\"\n          }\n        },\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"reason\": {\n                    \"type\": \"string\",\n                    \"description\": \"The reason the user is being unsuspended. This message will be logged in the [audit log](https://docs.github.com/enterprise/admin/articles/audit-logging/). If you don't provide a `reason`, it will default to \\\"Unsuspended via API by _SITE\\\\_ADMINISTRATOR_\\\", where _SITE\\\\_ADMINISTRATOR_ is the person who performed the action.\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": false,\n          \"category\": \"enterprise-admin\",\n          \"subcategory\": \"users\"\n        }\n      }\n    },\n    \"/zen\": {\n      \"get\": {\n        \"summary\": \"Get the Zen of GitHub\",\n        \"description\": \"Get a random sentence from the Zen of GitHub\",\n        \"tags\": [\n          \"meta\"\n        ],\n        \"operationId\": \"meta/get-zen\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Response\",\n            \"content\": {\n              \"text/plain\": {\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"x-github\": {\n          \"githubCloudOnly\": false,\n          \"enabledForGitHubApps\": true,\n          \"category\": \"meta\"\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"parameters\": {\n      \"per-page\": {\n        \"name\": \"per_page\",\n        \"description\": \"Results per page (max 100)\",\n        \"in\": \"query\",\n        \"schema\": {\n          \"type\": \"integer\",\n          \"default\": 30\n        }\n      },\n      \"page\": {\n        \"name\": \"page\",\n        \"description\": \"Page number of the results to fetch.\",\n        \"in\": \"query\",\n        \"schema\": {\n          \"type\": \"integer\",\n          \"default\": 1\n        }\n      },\n      \"hook-id\": {\n        \"name\": \"hook_id\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"direction\": {\n        \"name\": \"direction\",\n        \"description\": \"One of `asc` (ascending) or `desc` (descending).\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"asc\",\n            \"desc\"\n          ],\n          \"default\": \"desc\"\n        }\n      },\n      \"key-ids\": {\n        \"name\": \"key_ids\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"team-id\": {\n        \"name\": \"team_id\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"username\": {\n        \"name\": \"username\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"org\": {\n        \"name\": \"org\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"pre-receive-environment-id\": {\n        \"name\": \"pre_receive_environment_id\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"pre-receive-hook-id\": {\n        \"name\": \"pre_receive_hook_id\",\n        \"description\": \"pre_receive_hook_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"token-id\": {\n        \"name\": \"token_id\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"since\": {\n        \"name\": \"since\",\n        \"description\": \"Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\",\n          \"format\": \"date-time\"\n        }\n      },\n      \"installation-id\": {\n        \"name\": \"installation_id\",\n        \"description\": \"installation_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"grant-id\": {\n        \"name\": \"grant_id\",\n        \"description\": \"grant_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"client-id\": {\n        \"name\": \"client_id\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"description\": \"The client ID of your GitHub app.\",\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"access-token\": {\n        \"name\": \"access_token\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"app-slug\": {\n        \"name\": \"app_slug\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"authorization-id\": {\n        \"name\": \"authorization_id\",\n        \"description\": \"authorization_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"enterprise\": {\n        \"name\": \"enterprise\",\n        \"description\": \"The slug version of the enterprise name. You can also substitute this value with the enterprise id.\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"org-id\": {\n        \"name\": \"org_id\",\n        \"description\": \"Unique identifier of an organization.\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"runner-group-id\": {\n        \"name\": \"runner_group_id\",\n        \"description\": \"Unique identifier of the self-hosted runner group.\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"runner-id\": {\n        \"name\": \"runner_id\",\n        \"description\": \"Unique identifier of the self-hosted runner.\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"gist-id\": {\n        \"name\": \"gist_id\",\n        \"description\": \"gist_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"comment-id\": {\n        \"name\": \"comment_id\",\n        \"description\": \"comment_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"labels\": {\n        \"name\": \"labels\",\n        \"description\": \"A list of comma separated label names. Example: `bug,ui,@high`\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"owner\": {\n        \"name\": \"owner\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"repo\": {\n        \"name\": \"repo\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"all\": {\n        \"name\": \"all\",\n        \"description\": \"If `true`, show notifications marked as read.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"boolean\",\n          \"default\": false\n        }\n      },\n      \"participating\": {\n        \"name\": \"participating\",\n        \"description\": \"If `true`, only shows notifications in which the user is directly participating or mentioned.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"boolean\",\n          \"default\": false\n        }\n      },\n      \"before\": {\n        \"name\": \"before\",\n        \"description\": \"Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\",\n          \"format\": \"date-time\"\n        }\n      },\n      \"thread-id\": {\n        \"name\": \"thread_id\",\n        \"description\": \"thread_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"since-org\": {\n        \"name\": \"since\",\n        \"description\": \"An organization ID. Only return organizations with an ID greater than this ID.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"repository-id\": {\n        \"name\": \"repository_id\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"secret-name\": {\n        \"name\": \"secret_name\",\n        \"description\": \"secret_name parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"team-slug\": {\n        \"name\": \"team_slug\",\n        \"description\": \"team_slug parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"discussion-number\": {\n        \"name\": \"discussion_number\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"comment-number\": {\n        \"name\": \"comment_number\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"reaction-id\": {\n        \"name\": \"reaction_id\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"project-id\": {\n        \"name\": \"project_id\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"card-id\": {\n        \"name\": \"card_id\",\n        \"description\": \"card_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"column-id\": {\n        \"name\": \"column_id\",\n        \"description\": \"column_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"artifact-id\": {\n        \"name\": \"artifact_id\",\n        \"description\": \"artifact_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"job-id\": {\n        \"name\": \"job_id\",\n        \"description\": \"job_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"actor\": {\n        \"name\": \"actor\",\n        \"description\": \"Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"workflow-run-branch\": {\n        \"name\": \"branch\",\n        \"description\": \"Returns workflow runs associated with a branch. Use the name of the branch of the `push`.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"event\": {\n        \"name\": \"event\",\n        \"description\": \"Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see \\\"[Events that trigger workflows](https://docs.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows).\\\"\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"workflow-run-status\": {\n        \"name\": \"status\",\n        \"description\": \"Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see \\\"[Create a check run](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#create-a-check-run).\\\"\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"completed\",\n            \"action_required\",\n            \"cancelled\",\n            \"failure\",\n            \"neutral\",\n            \"skipped\",\n            \"stale\",\n            \"success\",\n            \"timed_out\",\n            \"in_progress\",\n            \"queued\",\n            \"requested\",\n            \"waiting\"\n          ]\n        }\n      },\n      \"created\": {\n        \"name\": \"created\",\n        \"description\": \"Returns workflow runs created within the given date-time range. For more information on the syntax, see \\\"[Understanding the search syntax](https://docs.github.com/enterprise-server@3.0/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates).\\\"\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\",\n          \"format\": \"date-time\"\n        }\n      },\n      \"exclude-pull-requests\": {\n        \"name\": \"exclude_pull_requests\",\n        \"description\": \"If `true` pull requests are omitted from the response (empty array).\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"boolean\",\n          \"default\": false\n        }\n      },\n      \"run-id\": {\n        \"name\": \"run_id\",\n        \"description\": \"The id of the workflow run.\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"workflow-id\": {\n        \"name\": \"workflow_id\",\n        \"in\": \"path\",\n        \"description\": \"The ID of the workflow. You can also pass the workflow file name as a string.\",\n        \"required\": true,\n        \"schema\": {\n          \"oneOf\": [\n            {\n              \"type\": \"integer\"\n            },\n            {\n              \"type\": \"string\"\n            }\n          ]\n        }\n      },\n      \"branch\": {\n        \"name\": \"branch\",\n        \"description\": \"The name of the branch.\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        },\n        \"x-multi-segment\": true\n      },\n      \"check-run-id\": {\n        \"name\": \"check_run_id\",\n        \"description\": \"check_run_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"check-suite-id\": {\n        \"name\": \"check_suite_id\",\n        \"description\": \"check_suite_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"check-name\": {\n        \"name\": \"check_name\",\n        \"description\": \"Returns check runs with the specified `name`.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"status\": {\n        \"name\": \"status\",\n        \"description\": \"Returns check runs with the specified `status`. Can be one of `queued`, `in_progress`, or `completed`.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"queued\",\n            \"in_progress\",\n            \"completed\"\n          ]\n        }\n      },\n      \"tool-name\": {\n        \"name\": \"tool_name\",\n        \"description\": \"The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-name\"\n        }\n      },\n      \"tool-guid\": {\n        \"name\": \"tool_guid\",\n        \"description\": \"The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-guid\"\n        }\n      },\n      \"git-ref\": {\n        \"name\": \"ref\",\n        \"description\": \"The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/<branch name>` or simply `<branch name>`. To reference a pull request use `refs/pull/<number>/merge`.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"$ref\": \"#/components/schemas/code-scanning-ref\"\n        }\n      },\n      \"alert-number\": {\n        \"name\": \"alert_number\",\n        \"in\": \"path\",\n        \"description\": \"The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation.\",\n        \"required\": true,\n        \"schema\": {\n          \"$ref\": \"#/components/schemas/alert-number\"\n        }\n      },\n      \"commit-sha\": {\n        \"name\": \"commit_sha\",\n        \"description\": \"commit_sha parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"string\"\n        },\n        \"x-multi-segment\": true\n      },\n      \"deployment-id\": {\n        \"name\": \"deployment_id\",\n        \"description\": \"deployment_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"invitation-id\": {\n        \"name\": \"invitation_id\",\n        \"description\": \"invitation_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"sort\": {\n        \"name\": \"sort\",\n        \"description\": \"One of `created` (when the repository was starred) or `updated` (when it was last pushed to).\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"created\",\n            \"updated\"\n          ],\n          \"default\": \"created\"\n        }\n      },\n      \"issue-number\": {\n        \"name\": \"issue_number\",\n        \"description\": \"issue_number parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"key-id\": {\n        \"name\": \"key_id\",\n        \"description\": \"key_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"milestone-number\": {\n        \"name\": \"milestone_number\",\n        \"description\": \"milestone_number parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"pull-number\": {\n        \"name\": \"pull_number\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"review-id\": {\n        \"name\": \"review_id\",\n        \"description\": \"review_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"asset-id\": {\n        \"name\": \"asset_id\",\n        \"description\": \"asset_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"release-id\": {\n        \"name\": \"release_id\",\n        \"description\": \"release_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"since-repo\": {\n        \"name\": \"since\",\n        \"description\": \"A repository ID. Only return repositories with an ID greater than this ID.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"order\": {\n        \"name\": \"order\",\n        \"description\": \"Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"desc\",\n            \"asc\"\n          ],\n          \"default\": \"desc\"\n        }\n      },\n      \"gpg-key-id\": {\n        \"name\": \"gpg_key_id\",\n        \"description\": \"gpg_key_id parameter\",\n        \"in\": \"path\",\n        \"required\": true,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"since-user\": {\n        \"name\": \"since\",\n        \"description\": \"A user ID. Only return users with an ID greater than this ID.\",\n        \"in\": \"query\",\n        \"required\": false,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      }\n    },\n    \"schemas\": {\n      \"global-hook\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"active\": {\n            \"type\": \"boolean\"\n          },\n          \"events\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"config\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"content_type\": {\n                \"type\": \"string\"\n              },\n              \"insecure_ssl\": {\n                \"type\": \"string\"\n              },\n              \"secret\": {\n                \"type\": \"string\"\n              }\n            }\n          },\n          \"updated_at\": {\n            \"type\": \"string\"\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"ping_url\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"global-hook-2\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"active\": {\n            \"type\": \"boolean\"\n          },\n          \"events\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"config\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"content_type\": {\n                \"type\": \"string\"\n              },\n              \"insecure_ssl\": {\n                \"type\": \"string\"\n              }\n            }\n          },\n          \"updated_at\": {\n            \"type\": \"string\"\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"ping_url\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"public-key-full\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"key\": {\n            \"type\": \"string\"\n          },\n          \"user_id\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ]\n          },\n          \"repository_id\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"title\": {\n            \"type\": \"string\"\n          },\n          \"read_only\": {\n            \"type\": \"boolean\"\n          },\n          \"verified\": {\n            \"type\": \"boolean\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"last_used\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"key\",\n          \"url\",\n          \"title\",\n          \"verified\",\n          \"created_at\",\n          \"read_only\",\n          \"last_used\",\n          \"user_id\",\n          \"repository_id\"\n        ]\n      },\n      \"ldap-mapping-team\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"ldap_dn\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"html_url\": {\n            \"type\": \"string\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"slug\": {\n            \"type\": \"string\"\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"privacy\": {\n            \"type\": \"string\"\n          },\n          \"permission\": {\n            \"type\": \"string\"\n          },\n          \"members_url\": {\n            \"type\": \"string\"\n          },\n          \"repositories_url\": {\n            \"type\": \"string\"\n          },\n          \"parent\": {\n            \"type\": [\n              \"null\"\n            ]\n          }\n        }\n      },\n      \"ldap-mapping-user\": {\n        \"title\": \"Ldap Private User\",\n        \"description\": \"Ldap Private User\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"ldap_dn\": {\n            \"type\": \"string\"\n          },\n          \"login\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"octocat\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDQ6VXNlcjE=\"\n            ]\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/images/error/octocat_happy.gif\"\n            ]\n          },\n          \"gravatar_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"41d064eb2195891e12d0413f63227ea7\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat\"\n            ]\n          },\n          \"followers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/followers\"\n            ]\n          },\n          \"following_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/following{/other_user}\"\n            ]\n          },\n          \"gists_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/gists{/gist_id}\"\n            ]\n          },\n          \"starred_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/starred{/owner}{/repo}\"\n            ]\n          },\n          \"subscriptions_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/subscriptions\"\n            ]\n          },\n          \"organizations_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/orgs\"\n            ]\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/repos\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/events{/privacy}\"\n            ]\n          },\n          \"received_events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/received_events\"\n            ]\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"User\"\n            ]\n          },\n          \"site_admin\": {\n            \"type\": \"boolean\"\n          },\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"monalisa octocat\"\n            ]\n          },\n          \"company\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"GitHub\"\n            ]\n          },\n          \"blog\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"https://github.com/blog\"\n            ]\n          },\n          \"location\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"San Francisco\"\n            ]\n          },\n          \"email\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"email\",\n            \"examples\": [\n              \"octocat@github.com\"\n            ]\n          },\n          \"hireable\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ]\n          },\n          \"bio\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"There once was...\"\n            ]\n          },\n          \"twitter_username\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"monalisa\"\n            ]\n          },\n          \"public_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"public_gists\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"followers\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              20\n            ]\n          },\n          \"following\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2008-01-14T04:33:35Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2008-01-14T04:33:35Z\"\n            ]\n          },\n          \"private_gists\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              81\n            ]\n          },\n          \"total_private_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              100\n            ]\n          },\n          \"owned_private_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              100\n            ]\n          },\n          \"disk_usage\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              10000\n            ]\n          },\n          \"collaborators\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              8\n            ]\n          },\n          \"two_factor_authentication\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"plan\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"collaborators\": {\n                \"type\": \"integer\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"space\": {\n                \"type\": \"integer\"\n              },\n              \"private_repos\": {\n                \"type\": \"integer\"\n              }\n            },\n            \"required\": [\n              \"collaborators\",\n              \"name\",\n              \"space\",\n              \"private_repos\"\n            ]\n          },\n          \"suspended_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"business_plus\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"avatar_url\",\n          \"events_url\",\n          \"followers_url\",\n          \"following_url\",\n          \"gists_url\",\n          \"gravatar_id\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"login\",\n          \"organizations_url\",\n          \"received_events_url\",\n          \"repos_url\",\n          \"site_admin\",\n          \"starred_url\",\n          \"subscriptions_url\",\n          \"type\",\n          \"url\",\n          \"bio\",\n          \"blog\",\n          \"company\",\n          \"email\",\n          \"followers\",\n          \"following\",\n          \"hireable\",\n          \"location\",\n          \"name\",\n          \"public_gists\",\n          \"public_repos\",\n          \"created_at\",\n          \"updated_at\",\n          \"collaborators\",\n          \"disk_usage\",\n          \"owned_private_repos\",\n          \"private_gists\",\n          \"total_private_repos\",\n          \"two_factor_authentication\"\n        ]\n      },\n      \"organization-simple\": {\n        \"title\": \"Organization Simple\",\n        \"description\": \"Organization Simple\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"login\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"github\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEyOk9yZ2FuaXphdGlvbjE=\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github\"\n            ]\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/repos\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/events\"\n            ]\n          },\n          \"hooks_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/hooks\"\n            ]\n          },\n          \"issues_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/issues\"\n            ]\n          },\n          \"members_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/members{/member}\"\n            ]\n          },\n          \"public_members_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/public_members{/member}\"\n            ]\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/images/error/octocat_happy.gif\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"A great organization\"\n            ]\n          }\n        },\n        \"required\": [\n          \"login\",\n          \"url\",\n          \"id\",\n          \"node_id\",\n          \"repos_url\",\n          \"events_url\",\n          \"hooks_url\",\n          \"issues_url\",\n          \"members_url\",\n          \"public_members_url\",\n          \"avatar_url\",\n          \"description\"\n        ]\n      },\n      \"pre-receive-environment\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"image_url\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"html_url\": {\n            \"type\": \"string\"\n          },\n          \"default_environment\": {\n            \"type\": \"boolean\"\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"hooks_count\": {\n            \"type\": \"integer\"\n          },\n          \"download\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"state\": {\n                \"type\": \"string\"\n              },\n              \"downloaded_at\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"message\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              }\n            }\n          }\n        }\n      },\n      \"pre-receive-environment-download-status\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"state\": {\n            \"type\": \"string\"\n          },\n          \"downloaded_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"message\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          }\n        }\n      },\n      \"pre-receive-hook\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"enforcement\": {\n            \"type\": \"string\"\n          },\n          \"script\": {\n            \"type\": \"string\"\n          },\n          \"script_repository\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              },\n              \"full_name\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"html_url\": {\n                \"type\": \"string\"\n              }\n            }\n          },\n          \"environment\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"image_url\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"html_url\": {\n                \"type\": \"string\"\n              },\n              \"default_environment\": {\n                \"type\": \"boolean\"\n              },\n              \"created_at\": {\n                \"type\": \"string\"\n              },\n              \"hooks_count\": {\n                \"type\": \"integer\"\n              },\n              \"download\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"url\": {\n                    \"type\": \"string\"\n                  },\n                  \"state\": {\n                    \"type\": \"string\"\n                  },\n                  \"downloaded_at\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"message\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  }\n                }\n              }\n            }\n          },\n          \"allow_downstream_configuration\": {\n            \"type\": \"boolean\"\n          }\n        }\n      },\n      \"simple-user\": {\n        \"title\": \"Simple User\",\n        \"description\": \"Simple User\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"email\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"login\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"octocat\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDQ6VXNlcjE=\"\n            ]\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/images/error/octocat_happy.gif\"\n            ]\n          },\n          \"gravatar_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"41d064eb2195891e12d0413f63227ea7\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat\"\n            ]\n          },\n          \"followers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/followers\"\n            ]\n          },\n          \"following_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/following{/other_user}\"\n            ]\n          },\n          \"gists_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/gists{/gist_id}\"\n            ]\n          },\n          \"starred_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/starred{/owner}{/repo}\"\n            ]\n          },\n          \"subscriptions_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/subscriptions\"\n            ]\n          },\n          \"organizations_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/orgs\"\n            ]\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/repos\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/events{/privacy}\"\n            ]\n          },\n          \"received_events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/received_events\"\n            ]\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"User\"\n            ]\n          },\n          \"site_admin\": {\n            \"type\": \"boolean\"\n          },\n          \"starred_at\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"2020-07-09T00:17:55Z\\\"\"\n            ]\n          }\n        },\n        \"required\": [\n          \"avatar_url\",\n          \"events_url\",\n          \"followers_url\",\n          \"following_url\",\n          \"gists_url\",\n          \"gravatar_id\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"login\",\n          \"organizations_url\",\n          \"received_events_url\",\n          \"repos_url\",\n          \"site_admin\",\n          \"starred_url\",\n          \"subscriptions_url\",\n          \"type\",\n          \"url\"\n        ]\n      },\n      \"app-permissions\": {\n        \"title\": \"App Permissions\",\n        \"type\": \"object\",\n        \"description\": \"The permissions granted to the user-to-server access token.\",\n        \"properties\": {\n          \"actions\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"administration\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"checks\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for checks on code. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"contents\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"deployments\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for deployments and deployment statuses. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"environments\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for managing repository environments. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"issues\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"metadata\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"packages\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"pages\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"pull_requests\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"repository_hooks\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"repository_projects\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: `read`, `write`, or `admin`.\",\n            \"enum\": [\n              \"read\",\n              \"write\",\n              \"admin\"\n            ]\n          },\n          \"secret_scanning_alerts\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"secrets\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage repository secrets. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"security_events\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"single_file\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage just a single file. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"statuses\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for commit statuses. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"vulnerability_alerts\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage Dependabot alerts. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"workflows\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: `write`.\",\n            \"enum\": [\n              \"write\"\n            ]\n          },\n          \"members\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for organization teams and members. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"organization_administration\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage access to an organization. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"organization_hooks\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"organization_plan\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for viewing an organization's plan. Can be one of: `read`.\",\n            \"enum\": [\n              \"read\"\n            ]\n          },\n          \"organization_projects\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage organization projects and projects beta (where available). Can be one of: `read`, `write`, or `admin`.\",\n            \"enum\": [\n              \"read\",\n              \"write\",\n              \"admin\"\n            ]\n          },\n          \"organization_packages\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for organization packages published to GitHub Packages. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"organization_secrets\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage organization secrets. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"organization_self_hosted_runners\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"organization_user_blocking\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"team_discussions\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token to manage team discussions and related comments. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          },\n          \"content_references\": {\n            \"type\": \"string\",\n            \"description\": \"The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: `read` or `write`.\",\n            \"enum\": [\n              \"read\",\n              \"write\"\n            ]\n          }\n        },\n        \"example\": {\n          \"contents\": \"read\",\n          \"issues\": \"read\",\n          \"deployments\": \"write\",\n          \"single_file\": \"read\"\n        }\n      },\n      \"scoped-installation\": {\n        \"title\": \"Scoped Installation\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"permissions\": {\n            \"$ref\": \"#/components/schemas/app-permissions\"\n          },\n          \"repository_selection\": {\n            \"description\": \"Describe whether all repositories have been selected or there's a selection involved\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"all\",\n              \"selected\"\n            ]\n          },\n          \"single_file_name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"config.yaml\"\n            ]\n          },\n          \"has_multiple_single_files\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"single_file_paths\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"config.yml\",\n              \".github/issue_TEMPLATE.md\"\n            ]\n          },\n          \"repositories_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/repos\"\n            ]\n          },\n          \"account\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          }\n        },\n        \"required\": [\n          \"permissions\",\n          \"repository_selection\",\n          \"single_file_name\",\n          \"repositories_url\",\n          \"account\"\n        ]\n      },\n      \"authorization\": {\n        \"title\": \"Authorization\",\n        \"description\": \"The authorization for an OAuth app, GitHub App, or a Personal Access Token.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"scopes\": {\n            \"description\": \"A list of scopes that this authorization is in.\",\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"token\": {\n            \"type\": \"string\"\n          },\n          \"token_last_eight\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"hashed_token\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"app\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"client_id\": {\n                \"type\": \"string\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"client_id\",\n              \"name\",\n              \"url\"\n            ]\n          },\n          \"note\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"note_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"fingerprint\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"installation\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/scoped-installation\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"app\",\n          \"id\",\n          \"note\",\n          \"note_url\",\n          \"scopes\",\n          \"token\",\n          \"hashed_token\",\n          \"token_last_eight\",\n          \"fingerprint\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\",\n          \"expires_at\"\n        ]\n      },\n      \"integration\": {\n        \"title\": \"GitHub app\",\n        \"description\": \"GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"Unique identifier of the GitHub app\",\n            \"type\": \"integer\",\n            \"examples\": [\n              37\n            ]\n          },\n          \"slug\": {\n            \"description\": \"The slug name of the GitHub app\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"probot-owners\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDExOkludGVncmF0aW9uMQ==\"\n            ]\n          },\n          \"owner\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the GitHub app\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Probot Owners\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"The description of the app.\"\n            ]\n          },\n          \"external_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://example.com\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/apps/super-ci\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2017-07-08T16:18:44-04:00\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2017-07-08T16:18:44-04:00\"\n            ]\n          },\n          \"permissions\": {\n            \"description\": \"The set of permissions for the GitHub app\",\n            \"type\": \"object\",\n            \"properties\": {\n              \"issues\": {\n                \"type\": \"string\"\n              },\n              \"checks\": {\n                \"type\": \"string\"\n              },\n              \"metadata\": {\n                \"type\": \"string\"\n              },\n              \"contents\": {\n                \"type\": \"string\"\n              },\n              \"deployments\": {\n                \"type\": \"string\"\n              }\n            },\n            \"additionalProperties\": {\n              \"type\": \"string\"\n            },\n            \"example\": {\n              \"issues\": \"read\",\n              \"deployments\": \"write\"\n            }\n          },\n          \"events\": {\n            \"description\": \"The list of events for the GitHub app\",\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"label\",\n              \"deployment\"\n            ]\n          },\n          \"installations_count\": {\n            \"description\": \"The number of installations associated with the GitHub app\",\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"client_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"Iv1.25b5d1e65ffc4022\\\"\"\n            ]\n          },\n          \"client_secret\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"1d4b2097ac622ba702d19de498f005747a8b21d3\\\"\"\n            ]\n          },\n          \"webhook_secret\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"\\\"6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b\\\"\"\n            ]\n          },\n          \"pem\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"-----BEGIN RSA PRIVATE KEY-----\\\\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\\\\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\\\\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\\\\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\\\\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\\\\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\\\\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\\\\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\\\\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\\\\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\\\\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\\\\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\\\\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\\\\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\\\\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\\\\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\\\\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\\\\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\\\\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\\\\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\\\\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\\\\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\\\\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\\\\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\\\\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\\\\n-----END RSA PRIVATE KEY-----\\\\n\\\"\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"owner\",\n          \"name\",\n          \"description\",\n          \"external_url\",\n          \"html_url\",\n          \"created_at\",\n          \"updated_at\",\n          \"permissions\",\n          \"events\"\n        ]\n      },\n      \"basic-error\": {\n        \"title\": \"Basic Error\",\n        \"description\": \"Basic Error\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"message\": {\n            \"type\": \"string\"\n          },\n          \"documentation_url\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"status\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"validation-error-simple\": {\n        \"title\": \"Validation Error Simple\",\n        \"description\": \"Validation Error Simple\",\n        \"type\": \"object\",\n        \"required\": [\n          \"message\",\n          \"documentation_url\"\n        ],\n        \"properties\": {\n          \"message\": {\n            \"type\": \"string\"\n          },\n          \"documentation_url\": {\n            \"type\": \"string\"\n          },\n          \"errors\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          }\n        }\n      },\n      \"webhook-config-url\": {\n        \"type\": \"string\",\n        \"description\": \"The URL to which the payloads will be delivered.\",\n        \"format\": \"uri\",\n        \"examples\": [\n          \"https://example.com/webhook\"\n        ]\n      },\n      \"webhook-config-content-type\": {\n        \"type\": \"string\",\n        \"description\": \"The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.\",\n        \"examples\": [\n          \"\\\"json\\\"\"\n        ]\n      },\n      \"webhook-config-secret\": {\n        \"type\": \"string\",\n        \"description\": \"If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#delivery-headers).\",\n        \"examples\": [\n          \"\\\"********\\\"\"\n        ]\n      },\n      \"webhook-config-insecure-ssl\": {\n        \"oneOf\": [\n          {\n            \"type\": \"string\",\n            \"description\": \"Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.**\",\n            \"examples\": [\n              \"\\\"0\\\"\"\n            ]\n          },\n          {\n            \"type\": \"number\"\n          }\n        ]\n      },\n      \"webhook-config\": {\n        \"title\": \"Webhook Configuration\",\n        \"description\": \"Configuration object of the webhook\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"$ref\": \"#/components/schemas/webhook-config-url\"\n          },\n          \"content_type\": {\n            \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n          },\n          \"secret\": {\n            \"$ref\": \"#/components/schemas/webhook-config-secret\"\n          },\n          \"insecure_ssl\": {\n            \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n          }\n        }\n      },\n      \"enterprise\": {\n        \"title\": \"Enterprise\",\n        \"description\": \"An enterprise account\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"description\": {\n            \"description\": \"A short description of the enterprise.\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/enterprises/octo-business\"\n            ]\n          },\n          \"website_url\": {\n            \"description\": \"The enterprise's website URL.\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"id\": {\n            \"description\": \"Unique identifier of the enterprise\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the enterprise.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Octo Business\"\n            ]\n          },\n          \"slug\": {\n            \"description\": \"The slug url identifier for the enterprise.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"octo-business\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2019-01-26T19:01:12Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2019-01-26T19:14:43Z\"\n            ]\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"name\",\n          \"slug\",\n          \"html_url\",\n          \"created_at\",\n          \"updated_at\",\n          \"avatar_url\"\n        ]\n      },\n      \"installation\": {\n        \"title\": \"Installation\",\n        \"description\": \"Installation\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"The ID of the installation.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"account\": {\n            \"anyOf\": [\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/enterprise\"\n              }\n            ],\n            \"type\": [\n              \"null\",\n              \"object\"\n            ]\n          },\n          \"repository_selection\": {\n            \"description\": \"Describe whether all repositories have been selected or there's a selection involved\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"all\",\n              \"selected\"\n            ]\n          },\n          \"access_tokens_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/installations/1/access_tokens\"\n            ]\n          },\n          \"repositories_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/installation/repositories\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/organizations/github/settings/installations/1\"\n            ]\n          },\n          \"app_id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"target_id\": {\n            \"description\": \"The ID of the user or organization this token is being scoped to.\",\n            \"type\": \"integer\"\n          },\n          \"target_type\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Organization\"\n            ]\n          },\n          \"permissions\": {\n            \"$ref\": \"#/components/schemas/app-permissions\"\n          },\n          \"events\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"single_file_name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"config.yaml\"\n            ]\n          },\n          \"has_multiple_single_files\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"single_file_paths\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"config.yml\",\n              \".github/issue_TEMPLATE.md\"\n            ]\n          },\n          \"app_slug\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"github-actions\"\n            ]\n          },\n          \"suspended_by\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"suspended_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"contact_email\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"\\\"test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com\\\"\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"app_id\",\n          \"app_slug\",\n          \"target_id\",\n          \"target_type\",\n          \"single_file_name\",\n          \"repository_selection\",\n          \"access_tokens_url\",\n          \"html_url\",\n          \"repositories_url\",\n          \"events\",\n          \"account\",\n          \"permissions\",\n          \"created_at\",\n          \"updated_at\",\n          \"suspended_by\",\n          \"suspended_at\"\n        ]\n      },\n      \"license-simple\": {\n        \"title\": \"License Simple\",\n        \"description\": \"License Simple\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"key\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"mit\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MIT License\"\n            ]\n          },\n          \"url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/licenses/mit\"\n            ]\n          },\n          \"spdx_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"MIT\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDc6TGljZW5zZW1pdA==\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          }\n        },\n        \"required\": [\n          \"key\",\n          \"name\",\n          \"url\",\n          \"spdx_id\",\n          \"node_id\"\n        ]\n      },\n      \"repository\": {\n        \"title\": \"Repository\",\n        \"description\": \"A git repository\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"Unique identifier of the repository\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the repository.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Team Environment\"\n            ]\n          },\n          \"full_name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"octocat/Hello-World\"\n            ]\n          },\n          \"license\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/license-simple\"\n              }\n            ]\n          },\n          \"organization\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"forks\": {\n            \"type\": \"integer\"\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"admin\": {\n                \"type\": \"boolean\"\n              },\n              \"pull\": {\n                \"type\": \"boolean\"\n              },\n              \"triage\": {\n                \"type\": \"boolean\"\n              },\n              \"push\": {\n                \"type\": \"boolean\"\n              },\n              \"maintain\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"required\": [\n              \"admin\",\n              \"pull\",\n              \"push\"\n            ]\n          },\n          \"owner\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"private\": {\n            \"description\": \"Whether the repository is private or public.\",\n            \"default\": false,\n            \"type\": \"boolean\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"This your first repo!\"\n            ]\n          },\n          \"fork\": {\n            \"type\": \"boolean\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World\"\n            ]\n          },\n          \"archive_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\"\n            ]\n          },\n          \"assignees_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/assignees{/user}\"\n            ]\n          },\n          \"blobs_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\"\n            ]\n          },\n          \"branches_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/branches{/branch}\"\n            ]\n          },\n          \"collaborators_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\"\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/comments{/number}\"\n            ]\n          },\n          \"commits_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/commits{/sha}\"\n            ]\n          },\n          \"compare_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\"\n            ]\n          },\n          \"contents_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/contents/{+path}\"\n            ]\n          },\n          \"contributors_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/contributors\"\n            ]\n          },\n          \"deployments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/deployments\"\n            ]\n          },\n          \"downloads_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/downloads\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/events\"\n            ]\n          },\n          \"forks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/forks\"\n            ]\n          },\n          \"git_commits_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\"\n            ]\n          },\n          \"git_refs_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\"\n            ]\n          },\n          \"git_tags_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\"\n            ]\n          },\n          \"git_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"git:github.com/octocat/Hello-World.git\"\n            ]\n          },\n          \"issue_comment_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\"\n            ]\n          },\n          \"issue_events_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues/events{/number}\"\n            ]\n          },\n          \"issues_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues{/number}\"\n            ]\n          },\n          \"keys_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/keys{/key_id}\"\n            ]\n          },\n          \"labels_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/labels{/name}\"\n            ]\n          },\n          \"languages_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/languages\"\n            ]\n          },\n          \"merges_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/merges\"\n            ]\n          },\n          \"milestones_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/milestones{/number}\"\n            ]\n          },\n          \"notifications_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\"\n            ]\n          },\n          \"pulls_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/pulls{/number}\"\n            ]\n          },\n          \"releases_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/releases{/id}\"\n            ]\n          },\n          \"ssh_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"git@github.com:octocat/Hello-World.git\"\n            ]\n          },\n          \"stargazers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/stargazers\"\n            ]\n          },\n          \"statuses_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/statuses/{sha}\"\n            ]\n          },\n          \"subscribers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/subscribers\"\n            ]\n          },\n          \"subscription_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/subscription\"\n            ]\n          },\n          \"tags_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/tags\"\n            ]\n          },\n          \"teams_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/teams\"\n            ]\n          },\n          \"trees_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\"\n            ]\n          },\n          \"clone_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World.git\"\n            ]\n          },\n          \"mirror_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"git:git.example.com/octocat/Hello-World\"\n            ]\n          },\n          \"hooks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n            ]\n          },\n          \"svn_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://svn.github.com/octocat/Hello-World\"\n            ]\n          },\n          \"homepage\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com\"\n            ]\n          },\n          \"language\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"forks_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              9\n            ]\n          },\n          \"stargazers_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              80\n            ]\n          },\n          \"watchers_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              80\n            ]\n          },\n          \"size\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              108\n            ]\n          },\n          \"default_branch\": {\n            \"description\": \"The default branch of the repository.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"master\"\n            ]\n          },\n          \"open_issues_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"is_template\": {\n            \"description\": \"Whether this repository acts as a template that can be used to generate new repositories.\",\n            \"default\": false,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"topics\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"has_issues\": {\n            \"description\": \"Whether issues are enabled.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_projects\": {\n            \"description\": \"Whether projects are enabled.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_wiki\": {\n            \"description\": \"Whether the wiki is enabled.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_pages\": {\n            \"type\": \"boolean\"\n          },\n          \"has_downloads\": {\n            \"description\": \"Whether downloads are enabled.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"archived\": {\n            \"description\": \"Whether the repository is archived.\",\n            \"default\": false,\n            \"type\": \"boolean\"\n          },\n          \"disabled\": {\n            \"type\": \"boolean\",\n            \"description\": \"Returns whether or not this repository disabled.\"\n          },\n          \"visibility\": {\n            \"description\": \"The repository visibility: public, private, or internal.\",\n            \"default\": \"public\",\n            \"type\": \"string\"\n          },\n          \"pushed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:06:43Z\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:14:43Z\"\n            ]\n          },\n          \"allow_rebase_merge\": {\n            \"description\": \"Whether to allow rebase merges for pull requests.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"template_repository\": {\n            \"type\": [\n              \"object\",\n              \"null\"\n            ],\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              },\n              \"node_id\": {\n                \"type\": \"string\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"full_name\": {\n                \"type\": \"string\"\n              },\n              \"owner\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"login\": {\n                    \"type\": \"string\"\n                  },\n                  \"id\": {\n                    \"type\": \"integer\"\n                  },\n                  \"node_id\": {\n                    \"type\": \"string\"\n                  },\n                  \"avatar_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"gravatar_id\": {\n                    \"type\": \"string\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\"\n                  },\n                  \"html_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"followers_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"following_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"gists_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"starred_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"subscriptions_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"organizations_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"repos_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"events_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"received_events_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"type\": {\n                    \"type\": \"string\"\n                  },\n                  \"site_admin\": {\n                    \"type\": \"boolean\"\n                  }\n                }\n              },\n              \"private\": {\n                \"type\": \"boolean\"\n              },\n              \"html_url\": {\n                \"type\": \"string\"\n              },\n              \"description\": {\n                \"type\": \"string\"\n              },\n              \"fork\": {\n                \"type\": \"boolean\"\n              },\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"archive_url\": {\n                \"type\": \"string\"\n              },\n              \"assignees_url\": {\n                \"type\": \"string\"\n              },\n              \"blobs_url\": {\n                \"type\": \"string\"\n              },\n              \"branches_url\": {\n                \"type\": \"string\"\n              },\n              \"collaborators_url\": {\n                \"type\": \"string\"\n              },\n              \"comments_url\": {\n                \"type\": \"string\"\n              },\n              \"commits_url\": {\n                \"type\": \"string\"\n              },\n              \"compare_url\": {\n                \"type\": \"string\"\n              },\n              \"contents_url\": {\n                \"type\": \"string\"\n              },\n              \"contributors_url\": {\n                \"type\": \"string\"\n              },\n              \"deployments_url\": {\n                \"type\": \"string\"\n              },\n              \"downloads_url\": {\n                \"type\": \"string\"\n              },\n              \"events_url\": {\n                \"type\": \"string\"\n              },\n              \"forks_url\": {\n                \"type\": \"string\"\n              },\n              \"git_commits_url\": {\n                \"type\": \"string\"\n              },\n              \"git_refs_url\": {\n                \"type\": \"string\"\n              },\n              \"git_tags_url\": {\n                \"type\": \"string\"\n              },\n              \"git_url\": {\n                \"type\": \"string\"\n              },\n              \"issue_comment_url\": {\n                \"type\": \"string\"\n              },\n              \"issue_events_url\": {\n                \"type\": \"string\"\n              },\n              \"issues_url\": {\n                \"type\": \"string\"\n              },\n              \"keys_url\": {\n                \"type\": \"string\"\n              },\n              \"labels_url\": {\n                \"type\": \"string\"\n              },\n              \"languages_url\": {\n                \"type\": \"string\"\n              },\n              \"merges_url\": {\n                \"type\": \"string\"\n              },\n              \"milestones_url\": {\n                \"type\": \"string\"\n              },\n              \"notifications_url\": {\n                \"type\": \"string\"\n              },\n              \"pulls_url\": {\n                \"type\": \"string\"\n              },\n              \"releases_url\": {\n                \"type\": \"string\"\n              },\n              \"ssh_url\": {\n                \"type\": \"string\"\n              },\n              \"stargazers_url\": {\n                \"type\": \"string\"\n              },\n              \"statuses_url\": {\n                \"type\": \"string\"\n              },\n              \"subscribers_url\": {\n                \"type\": \"string\"\n              },\n              \"subscription_url\": {\n                \"type\": \"string\"\n              },\n              \"tags_url\": {\n                \"type\": \"string\"\n              },\n              \"teams_url\": {\n                \"type\": \"string\"\n              },\n              \"trees_url\": {\n                \"type\": \"string\"\n              },\n              \"clone_url\": {\n                \"type\": \"string\"\n              },\n              \"mirror_url\": {\n                \"type\": \"string\"\n              },\n              \"hooks_url\": {\n                \"type\": \"string\"\n              },\n              \"svn_url\": {\n                \"type\": \"string\"\n              },\n              \"homepage\": {\n                \"type\": \"string\"\n              },\n              \"language\": {\n                \"type\": \"string\"\n              },\n              \"forks_count\": {\n                \"type\": \"integer\"\n              },\n              \"stargazers_count\": {\n                \"type\": \"integer\"\n              },\n              \"watchers_count\": {\n                \"type\": \"integer\"\n              },\n              \"size\": {\n                \"type\": \"integer\"\n              },\n              \"default_branch\": {\n                \"type\": \"string\"\n              },\n              \"open_issues_count\": {\n                \"type\": \"integer\"\n              },\n              \"is_template\": {\n                \"type\": \"boolean\"\n              },\n              \"topics\": {\n                \"type\": \"array\",\n                \"items\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"has_issues\": {\n                \"type\": \"boolean\"\n              },\n              \"has_projects\": {\n                \"type\": \"boolean\"\n              },\n              \"has_wiki\": {\n                \"type\": \"boolean\"\n              },\n              \"has_pages\": {\n                \"type\": \"boolean\"\n              },\n              \"has_downloads\": {\n                \"type\": \"boolean\"\n              },\n              \"archived\": {\n                \"type\": \"boolean\"\n              },\n              \"disabled\": {\n                \"type\": \"boolean\"\n              },\n              \"visibility\": {\n                \"type\": \"string\"\n              },\n              \"pushed_at\": {\n                \"type\": \"string\"\n              },\n              \"created_at\": {\n                \"type\": \"string\"\n              },\n              \"updated_at\": {\n                \"type\": \"string\"\n              },\n              \"permissions\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"admin\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"maintain\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"push\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"triage\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"pull\": {\n                    \"type\": \"boolean\"\n                  }\n                }\n              },\n              \"allow_rebase_merge\": {\n                \"type\": \"boolean\"\n              },\n              \"temp_clone_token\": {\n                \"type\": \"string\"\n              },\n              \"allow_squash_merge\": {\n                \"type\": \"boolean\"\n              },\n              \"delete_branch_on_merge\": {\n                \"type\": \"boolean\"\n              },\n              \"allow_update_branch\": {\n                \"type\": \"boolean\"\n              },\n              \"allow_merge_commit\": {\n                \"type\": \"boolean\"\n              },\n              \"subscribers_count\": {\n                \"type\": \"integer\"\n              },\n              \"network_count\": {\n                \"type\": \"integer\"\n              }\n            }\n          },\n          \"temp_clone_token\": {\n            \"type\": \"string\"\n          },\n          \"allow_squash_merge\": {\n            \"description\": \"Whether to allow squash merges for pull requests.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"delete_branch_on_merge\": {\n            \"description\": \"Whether to delete head branches when pull requests are merged\",\n            \"default\": false,\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          },\n          \"allow_merge_commit\": {\n            \"description\": \"Whether to allow merge commits for pull requests.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"allow_forking\": {\n            \"description\": \"Whether to allow forking this repo\",\n            \"type\": \"boolean\"\n          },\n          \"subscribers_count\": {\n            \"type\": \"integer\"\n          },\n          \"network_count\": {\n            \"type\": \"integer\"\n          },\n          \"open_issues\": {\n            \"type\": \"integer\"\n          },\n          \"watchers\": {\n            \"type\": \"integer\"\n          },\n          \"master_branch\": {\n            \"type\": \"string\"\n          },\n          \"starred_at\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"2020-07-09T00:17:42Z\\\"\"\n            ]\n          }\n        },\n        \"required\": [\n          \"archive_url\",\n          \"assignees_url\",\n          \"blobs_url\",\n          \"branches_url\",\n          \"collaborators_url\",\n          \"comments_url\",\n          \"commits_url\",\n          \"compare_url\",\n          \"contents_url\",\n          \"contributors_url\",\n          \"deployments_url\",\n          \"description\",\n          \"downloads_url\",\n          \"events_url\",\n          \"fork\",\n          \"forks_url\",\n          \"full_name\",\n          \"git_commits_url\",\n          \"git_refs_url\",\n          \"git_tags_url\",\n          \"hooks_url\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"issue_comment_url\",\n          \"issue_events_url\",\n          \"issues_url\",\n          \"keys_url\",\n          \"labels_url\",\n          \"languages_url\",\n          \"merges_url\",\n          \"milestones_url\",\n          \"name\",\n          \"notifications_url\",\n          \"owner\",\n          \"private\",\n          \"pulls_url\",\n          \"releases_url\",\n          \"stargazers_url\",\n          \"statuses_url\",\n          \"subscribers_url\",\n          \"subscription_url\",\n          \"tags_url\",\n          \"teams_url\",\n          \"trees_url\",\n          \"url\",\n          \"clone_url\",\n          \"default_branch\",\n          \"forks\",\n          \"forks_count\",\n          \"git_url\",\n          \"has_downloads\",\n          \"has_issues\",\n          \"has_projects\",\n          \"has_wiki\",\n          \"has_pages\",\n          \"homepage\",\n          \"language\",\n          \"archived\",\n          \"disabled\",\n          \"mirror_url\",\n          \"open_issues\",\n          \"open_issues_count\",\n          \"license\",\n          \"pushed_at\",\n          \"size\",\n          \"ssh_url\",\n          \"stargazers_count\",\n          \"svn_url\",\n          \"watchers\",\n          \"watchers_count\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"installation-token\": {\n        \"title\": \"Installation Token\",\n        \"description\": \"Authentication token for a GitHub App installed on a user or org.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"token\": {\n            \"type\": \"string\"\n          },\n          \"expires_at\": {\n            \"type\": \"string\"\n          },\n          \"permissions\": {\n            \"$ref\": \"#/components/schemas/app-permissions\"\n          },\n          \"repository_selection\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"all\",\n              \"selected\"\n            ]\n          },\n          \"repositories\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/repository\"\n            }\n          },\n          \"single_file\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"README.md\"\n            ]\n          },\n          \"has_multiple_single_files\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"single_file_paths\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"config.yml\",\n              \".github/issue_TEMPLATE.md\"\n            ]\n          }\n        },\n        \"required\": [\n          \"token\",\n          \"expires_at\"\n        ]\n      },\n      \"validation-error\": {\n        \"title\": \"Validation Error\",\n        \"description\": \"Validation Error\",\n        \"type\": \"object\",\n        \"required\": [\n          \"message\",\n          \"documentation_url\"\n        ],\n        \"properties\": {\n          \"message\": {\n            \"type\": \"string\"\n          },\n          \"documentation_url\": {\n            \"type\": \"string\"\n          },\n          \"errors\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"required\": [\n                \"code\"\n              ],\n              \"properties\": {\n                \"resource\": {\n                  \"type\": \"string\"\n                },\n                \"field\": {\n                  \"type\": \"string\"\n                },\n                \"message\": {\n                  \"type\": \"string\"\n                },\n                \"code\": {\n                  \"type\": \"string\"\n                },\n                \"index\": {\n                  \"type\": \"integer\"\n                },\n                \"value\": {\n                  \"oneOf\": [\n                    {\n                      \"type\": [\n                        \"string\",\n                        \"null\"\n                      ]\n                    },\n                    {\n                      \"type\": [\n                        \"integer\",\n                        \"null\"\n                      ]\n                    },\n                    {\n                      \"type\": [\n                        \"array\",\n                        \"null\"\n                      ],\n                      \"items\": {\n                        \"type\": \"string\"\n                      }\n                    }\n                  ]\n                }\n              }\n            }\n          }\n        }\n      },\n      \"application-grant\": {\n        \"title\": \"Application Grant\",\n        \"description\": \"The authorization associated with an OAuth Access.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/applications/grants/1\"\n            ]\n          },\n          \"app\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"client_id\": {\n                \"type\": \"string\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"client_id\",\n              \"name\",\n              \"url\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-09-06T17:26:27Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-09-06T20:39:23Z\"\n            ]\n          },\n          \"scopes\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"public_repo\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"app\",\n          \"id\",\n          \"scopes\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"code-of-conduct\": {\n        \"title\": \"Code Of Conduct\",\n        \"description\": \"Code Of Conduct\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"key\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"contributor_covenant\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Contributor Covenant\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/codes_of_conduct/contributor_covenant\"\n            ]\n          },\n          \"body\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"# Contributor Covenant Code of Conduct\\n\\n## Our Pledge\\n\\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\\n\\n## Our Standards\\n\\nExamples of behavior that contributes to creating a positive environment include:\\n\\n* Using welcoming and inclusive language\\n* Being respectful of differing viewpoints and experiences\\n* Gracefully accepting constructive criticism\\n* Focusing on what is best for the community\\n* Showing empathy towards other community members\\n\\nExamples of unacceptable behavior by participants include:\\n\\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\\n* Trolling, insulting/derogatory comments, and personal or political attacks\\n* Public or private harassment\\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\\n* Other conduct which could reasonably be considered inappropriate in a professional setting\\n\\n## Our Responsibilities\\n\\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\\n                  to any instances of unacceptable behavior.\\n\\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\\n\\n## Scope\\n\\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\\n                  posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\\n\\n## Enforcement\\n\\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\\n\\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\\n\\n## Attribution\\n\\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\\n\\n[homepage]: http://contributor-covenant.org\\n[version]: http://contributor-covenant.org/version/1/4/\\n\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"html_url\",\n          \"key\",\n          \"name\"\n        ]\n      },\n      \"announcement-message\": {\n        \"type\": \"string\",\n        \"description\": \"The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see \\\"[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.0/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax).\\\"\",\n        \"examples\": [\n          \"Very **important** announcement about _nothing_.\"\n        ]\n      },\n      \"announcement-expiration\": {\n        \"type\": [\n          \"string\",\n          \"null\"\n        ],\n        \"format\": \"date-time\",\n        \"description\": \"The time at which the announcement expires. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. To set an announcement that never expires, omit this parameter, set it to `null`, or set it to an empty string.\",\n        \"examples\": [\n          \"\\\"2021-01-01T00:00:00.000-07:00\\\"\"\n        ]\n      },\n      \"announcement\": {\n        \"title\": \"Enterprise Announcement\",\n        \"description\": \"Enterprise global announcement\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"announcement\": {\n            \"$ref\": \"#/components/schemas/announcement-message\"\n          },\n          \"expires_at\": {\n            \"$ref\": \"#/components/schemas/announcement-expiration\"\n          }\n        },\n        \"required\": [\n          \"announcement\"\n        ]\n      },\n      \"license-info\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"seats\": {\n            \"oneOf\": [\n              {\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"integer\"\n              }\n            ]\n          },\n          \"seats_used\": {\n            \"type\": \"integer\"\n          },\n          \"seats_available\": {\n            \"oneOf\": [\n              {\n                \"type\": \"string\"\n              },\n              {\n                \"type\": \"integer\"\n              }\n            ]\n          },\n          \"kind\": {\n            \"type\": \"string\"\n          },\n          \"days_until_expiration\": {\n            \"type\": \"integer\"\n          },\n          \"expire_at\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"enterprise-repository-overview\": {\n        \"title\": \"Repository Enterprise Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_repos\": {\n            \"type\": \"integer\"\n          },\n          \"root_repos\": {\n            \"type\": \"integer\"\n          },\n          \"fork_repos\": {\n            \"type\": \"integer\"\n          },\n          \"org_repos\": {\n            \"type\": \"integer\"\n          },\n          \"total_pushes\": {\n            \"type\": \"integer\"\n          },\n          \"total_wikis\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_repos\",\n          \"root_repos\",\n          \"fork_repos\",\n          \"org_repos\",\n          \"total_pushes\",\n          \"total_wikis\"\n        ]\n      },\n      \"enterprise-hook-overview\": {\n        \"title\": \"Hooks Enterprise Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_hooks\": {\n            \"type\": \"integer\"\n          },\n          \"active_hooks\": {\n            \"type\": \"integer\"\n          },\n          \"inactive_hooks\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_hooks\",\n          \"active_hooks\",\n          \"inactive_hooks\"\n        ]\n      },\n      \"enterprise-page-overview\": {\n        \"title\": \"Enterprise Pages Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_pages\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_pages\"\n        ]\n      },\n      \"enterprise-organization-overview\": {\n        \"title\": \"Enterprise Organization Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_orgs\": {\n            \"type\": \"integer\"\n          },\n          \"disabled_orgs\": {\n            \"type\": \"integer\"\n          },\n          \"total_teams\": {\n            \"type\": \"integer\"\n          },\n          \"total_team_members\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_orgs\",\n          \"disabled_orgs\",\n          \"total_teams\",\n          \"total_team_members\"\n        ]\n      },\n      \"enterprise-user-overview\": {\n        \"title\": \"Enterprise User Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_users\": {\n            \"type\": \"integer\"\n          },\n          \"admin_users\": {\n            \"type\": \"integer\"\n          },\n          \"suspended_users\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_users\",\n          \"admin_users\",\n          \"suspended_users\"\n        ]\n      },\n      \"enterprise-pull-request-overview\": {\n        \"title\": \"Enterprise Pull Request Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_pulls\": {\n            \"type\": \"integer\"\n          },\n          \"merged_pulls\": {\n            \"type\": \"integer\"\n          },\n          \"mergeable_pulls\": {\n            \"type\": \"integer\"\n          },\n          \"unmergeable_pulls\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_pulls\",\n          \"merged_pulls\",\n          \"mergeable_pulls\",\n          \"unmergeable_pulls\"\n        ]\n      },\n      \"enterprise-issue-overview\": {\n        \"title\": \"Enterprise Issue Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_issues\": {\n            \"type\": \"integer\"\n          },\n          \"open_issues\": {\n            \"type\": \"integer\"\n          },\n          \"closed_issues\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_issues\",\n          \"open_issues\",\n          \"closed_issues\"\n        ]\n      },\n      \"enterprise-milestone-overview\": {\n        \"title\": \"Enterprise Milestone Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_milestones\": {\n            \"type\": \"integer\"\n          },\n          \"open_milestones\": {\n            \"type\": \"integer\"\n          },\n          \"closed_milestones\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_milestones\",\n          \"open_milestones\",\n          \"closed_milestones\"\n        ]\n      },\n      \"enterprise-gist-overview\": {\n        \"title\": \"Enterprise Gist Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_gists\": {\n            \"type\": \"integer\"\n          },\n          \"private_gists\": {\n            \"type\": \"integer\"\n          },\n          \"public_gists\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_gists\",\n          \"private_gists\",\n          \"public_gists\"\n        ]\n      },\n      \"enterprise-comment-overview\": {\n        \"title\": \"Enterprise Comment Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"total_commit_comments\": {\n            \"type\": \"integer\"\n          },\n          \"total_gist_comments\": {\n            \"type\": \"integer\"\n          },\n          \"total_issue_comments\": {\n            \"type\": \"integer\"\n          },\n          \"total_pull_request_comments\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"total_commit_comments\",\n          \"total_gist_comments\",\n          \"total_issue_comments\",\n          \"total_pull_request_comments\"\n        ]\n      },\n      \"enterprise-overview\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"repos\": {\n            \"$ref\": \"#/components/schemas/enterprise-repository-overview\"\n          },\n          \"hooks\": {\n            \"$ref\": \"#/components/schemas/enterprise-hook-overview\"\n          },\n          \"pages\": {\n            \"$ref\": \"#/components/schemas/enterprise-page-overview\"\n          },\n          \"orgs\": {\n            \"$ref\": \"#/components/schemas/enterprise-organization-overview\"\n          },\n          \"users\": {\n            \"$ref\": \"#/components/schemas/enterprise-user-overview\"\n          },\n          \"pulls\": {\n            \"$ref\": \"#/components/schemas/enterprise-pull-request-overview\"\n          },\n          \"issues\": {\n            \"$ref\": \"#/components/schemas/enterprise-issue-overview\"\n          },\n          \"milestones\": {\n            \"$ref\": \"#/components/schemas/enterprise-milestone-overview\"\n          },\n          \"gists\": {\n            \"$ref\": \"#/components/schemas/enterprise-gist-overview\"\n          },\n          \"comments\": {\n            \"$ref\": \"#/components/schemas/enterprise-comment-overview\"\n          }\n        }\n      },\n      \"enabled-organizations\": {\n        \"type\": \"string\",\n        \"description\": \"The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`.\",\n        \"enum\": [\n          \"all\",\n          \"none\",\n          \"selected\"\n        ]\n      },\n      \"allowed-actions\": {\n        \"type\": \"string\",\n        \"description\": \"The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`.\",\n        \"enum\": [\n          \"all\",\n          \"local_only\",\n          \"selected\"\n        ]\n      },\n      \"selected-actions-url\": {\n        \"type\": \"string\",\n        \"description\": \"The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`.\"\n      },\n      \"actions-enterprise-permissions\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"enabled_organizations\": {\n            \"$ref\": \"#/components/schemas/enabled-organizations\"\n          },\n          \"selected_organizations_url\": {\n            \"type\": \"string\",\n            \"description\": \"The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`.\"\n          },\n          \"allowed_actions\": {\n            \"$ref\": \"#/components/schemas/allowed-actions\"\n          },\n          \"selected_actions_url\": {\n            \"$ref\": \"#/components/schemas/selected-actions-url\"\n          }\n        },\n        \"required\": [\n          \"enabled_organizations\"\n        ]\n      },\n      \"selected-actions\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"github_owned_allowed\": {\n            \"type\": \"boolean\",\n            \"description\": \"Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization.\"\n          },\n          \"patterns_allowed\": {\n            \"type\": \"array\",\n            \"description\": \"Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`.\\\"\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          }\n        },\n        \"required\": [\n          \"github_owned_allowed\",\n          \"patterns_allowed\"\n        ]\n      },\n      \"runner-groups-enterprise\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"number\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"visibility\": {\n            \"type\": \"string\"\n          },\n          \"default\": {\n            \"type\": \"boolean\"\n          },\n          \"selected_organizations_url\": {\n            \"type\": \"string\"\n          },\n          \"runners_url\": {\n            \"type\": \"string\"\n          },\n          \"allows_public_repositories\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"visibility\",\n          \"allows_public_repositories\",\n          \"default\",\n          \"runners_url\"\n        ]\n      },\n      \"runner-label\": {\n        \"title\": \"Self hosted runner label\",\n        \"description\": \"A label for a self hosted runner\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"description\": \"Unique identifier of the label.\"\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"description\": \"Name of the label.\"\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"description\": \"The type of label. Read-only labels are applied automatically when the runner is configured.\",\n            \"enum\": [\n              \"read-only\",\n              \"custom\"\n            ]\n          }\n        },\n        \"required\": [\n          \"name\"\n        ]\n      },\n      \"runner\": {\n        \"title\": \"Self hosted runners\",\n        \"description\": \"A self hosted runner\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"The id of the runner.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the runner.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"iMac\"\n            ]\n          },\n          \"os\": {\n            \"description\": \"The Operating System of the runner.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"macos\"\n            ]\n          },\n          \"status\": {\n            \"description\": \"The status of the runner.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"online\"\n            ]\n          },\n          \"busy\": {\n            \"type\": \"boolean\"\n          },\n          \"labels\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/runner-label\"\n            }\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"os\",\n          \"status\",\n          \"busy\",\n          \"labels\"\n        ]\n      },\n      \"runner-application\": {\n        \"title\": \"Runner Application\",\n        \"description\": \"Runner Application\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"os\": {\n            \"type\": \"string\"\n          },\n          \"architecture\": {\n            \"type\": \"string\"\n          },\n          \"download_url\": {\n            \"type\": \"string\"\n          },\n          \"filename\": {\n            \"type\": \"string\"\n          },\n          \"temp_download_token\": {\n            \"description\": \"A short lived bearer token used to download the runner, if needed.\",\n            \"type\": \"string\"\n          },\n          \"sha256_checksum\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"os\",\n          \"architecture\",\n          \"download_url\",\n          \"filename\"\n        ]\n      },\n      \"authentication-token\": {\n        \"title\": \"Authentication Token\",\n        \"description\": \"Authentication Token\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"token\": {\n            \"description\": \"The token used for authentication\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"v1.1f699f1069f60xxx\"\n            ]\n          },\n          \"expires_at\": {\n            \"description\": \"The time this token expires\",\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2016-07-11T22:14:10Z\"\n            ]\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"examples\": [\n              {\n                \"issues\": \"read\",\n                \"deployments\": \"write\"\n              }\n            ]\n          },\n          \"repositories\": {\n            \"description\": \"The repositories this token has access to\",\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/repository\"\n            }\n          },\n          \"single_file\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"config.yaml\"\n            ]\n          },\n          \"repository_selection\": {\n            \"description\": \"Describe whether all repositories have been selected or there's a selection involved\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"all\",\n              \"selected\"\n            ]\n          }\n        },\n        \"required\": [\n          \"token\",\n          \"expires_at\"\n        ]\n      },\n      \"actor\": {\n        \"title\": \"Actor\",\n        \"description\": \"Actor\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"login\": {\n            \"type\": \"string\"\n          },\n          \"display_login\": {\n            \"type\": \"string\"\n          },\n          \"gravatar_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"login\",\n          \"gravatar_id\",\n          \"url\",\n          \"avatar_url\"\n        ]\n      },\n      \"milestone\": {\n        \"title\": \"Milestone\",\n        \"description\": \"A collection of related issues and pull requests.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/milestones/1\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/milestones/v1.0\"\n            ]\n          },\n          \"labels_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1002604\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDk6TWlsZXN0b25lMTAwMjYwNA==\"\n            ]\n          },\n          \"number\": {\n            \"description\": \"The number of the milestone.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"state\": {\n            \"description\": \"The state of the milestone.\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"open\",\n              \"closed\"\n            ],\n            \"default\": \"open\",\n            \"examples\": [\n              \"open\"\n            ]\n          },\n          \"title\": {\n            \"description\": \"The title of the milestone.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"v1.0\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Tracking milestone for version 1.0\"\n            ]\n          },\n          \"creator\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"open_issues\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              4\n            ]\n          },\n          \"closed_issues\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              8\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-10T20:09:31Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2014-03-03T18:58:10Z\"\n            ]\n          },\n          \"closed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2013-02-12T13:22:01Z\"\n            ]\n          },\n          \"due_on\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-10-09T23:39:01Z\"\n            ]\n          }\n        },\n        \"required\": [\n          \"closed_issues\",\n          \"creator\",\n          \"description\",\n          \"due_on\",\n          \"closed_at\",\n          \"id\",\n          \"node_id\",\n          \"labels_url\",\n          \"html_url\",\n          \"number\",\n          \"open_issues\",\n          \"state\",\n          \"title\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"author_association\": {\n        \"title\": \"author_association\",\n        \"type\": \"string\",\n        \"description\": \"How the author is associated with the repository.\",\n        \"enum\": [\n          \"COLLABORATOR\",\n          \"CONTRIBUTOR\",\n          \"FIRST_TIMER\",\n          \"FIRST_TIME_CONTRIBUTOR\",\n          \"MANNEQUIN\",\n          \"MEMBER\",\n          \"NONE\",\n          \"OWNER\"\n        ],\n        \"examples\": [\n          \"OWNER\"\n        ]\n      },\n      \"reaction-rollup\": {\n        \"title\": \"Reaction Rollup\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"total_count\": {\n            \"type\": \"integer\"\n          },\n          \"+1\": {\n            \"type\": \"integer\"\n          },\n          \"-1\": {\n            \"type\": \"integer\"\n          },\n          \"laugh\": {\n            \"type\": \"integer\"\n          },\n          \"confused\": {\n            \"type\": \"integer\"\n          },\n          \"heart\": {\n            \"type\": \"integer\"\n          },\n          \"hooray\": {\n            \"type\": \"integer\"\n          },\n          \"eyes\": {\n            \"type\": \"integer\"\n          },\n          \"rocket\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"total_count\",\n          \"+1\",\n          \"-1\",\n          \"laugh\",\n          \"confused\",\n          \"heart\",\n          \"hooray\",\n          \"eyes\",\n          \"rocket\"\n        ]\n      },\n      \"issue\": {\n        \"title\": \"Issue\",\n        \"description\": \"Issues are a great way to keep track of tasks, enhancements, and bugs for your projects.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"description\": \"URL for the issue\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repositories/42/issues/1\"\n            ]\n          },\n          \"repository_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"labels_url\": {\n            \"type\": \"string\"\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"number\": {\n            \"description\": \"Number uniquely identifying the issue within its repository\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"state\": {\n            \"description\": \"State of the issue; either 'open' or 'closed'\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"open\"\n            ]\n          },\n          \"title\": {\n            \"description\": \"Title of the issue\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Widget creation fails in Safari on OS X 10.8\"\n            ]\n          },\n          \"body\": {\n            \"description\": \"Contents of the issue\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug?\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"labels\": {\n            \"description\": \"Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository\",\n            \"type\": \"array\",\n            \"items\": {\n              \"oneOf\": [\n                {\n                  \"type\": \"string\"\n                },\n                {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"id\": {\n                      \"type\": \"integer\",\n                      \"format\": \"int64\"\n                    },\n                    \"node_id\": {\n                      \"type\": \"string\"\n                    },\n                    \"url\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri\"\n                    },\n                    \"name\": {\n                      \"type\": \"string\"\n                    },\n                    \"description\": {\n                      \"type\": [\n                        \"string\",\n                        \"null\"\n                      ]\n                    },\n                    \"color\": {\n                      \"type\": [\n                        \"string\",\n                        \"null\"\n                      ]\n                    },\n                    \"default\": {\n                      \"type\": \"boolean\"\n                    }\n                  }\n                }\n              ]\n            },\n            \"examples\": [\n              \"bug\",\n              \"registration\"\n            ]\n          },\n          \"assignee\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"assignees\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/simple-user\"\n            }\n          },\n          \"milestone\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/milestone\"\n              }\n            ]\n          },\n          \"locked\": {\n            \"type\": \"boolean\"\n          },\n          \"active_lock_reason\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"comments\": {\n            \"type\": \"integer\"\n          },\n          \"pull_request\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"merged_at\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"date-time\"\n              },\n              \"diff_url\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"html_url\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"patch_url\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"url\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"diff_url\",\n              \"html_url\",\n              \"patch_url\",\n              \"url\"\n            ]\n          },\n          \"closed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"draft\": {\n            \"type\": \"boolean\"\n          },\n          \"closed_by\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"body_html\": {\n            \"type\": \"string\"\n          },\n          \"body_text\": {\n            \"type\": \"string\"\n          },\n          \"timeline_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/repository\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          }\n        },\n        \"required\": [\n          \"assignee\",\n          \"closed_at\",\n          \"comments\",\n          \"comments_url\",\n          \"events_url\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"labels\",\n          \"labels_url\",\n          \"milestone\",\n          \"number\",\n          \"repository_url\",\n          \"state\",\n          \"locked\",\n          \"title\",\n          \"url\",\n          \"user\",\n          \"author_association\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"issue-comment\": {\n        \"title\": \"Issue Comment\",\n        \"description\": \"Comments provide a way for people to collaborate on an issue.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"Unique identifier of the issue comment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"description\": \"URL for the issue comment\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repositories/42/issues/comments/1\"\n            ]\n          },\n          \"body\": {\n            \"description\": \"Contents of the issue comment\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"What version of Safari were you using when you observed this bug?\"\n            ]\n          },\n          \"body_text\": {\n            \"type\": \"string\"\n          },\n          \"body_html\": {\n            \"type\": \"string\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"issue_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"html_url\",\n          \"issue_url\",\n          \"author_association\",\n          \"user\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"event\": {\n        \"title\": \"Event\",\n        \"description\": \"Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"string\"\n          },\n          \"type\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/actor\"\n          },\n          \"repo\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"id\",\n              \"name\",\n              \"url\"\n            ]\n          },\n          \"org\": {\n            \"$ref\": \"#/components/schemas/actor\"\n          },\n          \"payload\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"action\": {\n                \"type\": \"string\"\n              },\n              \"issue\": {\n                \"$ref\": \"#/components/schemas/issue\"\n              },\n              \"comment\": {\n                \"$ref\": \"#/components/schemas/issue-comment\"\n              },\n              \"pages\": {\n                \"type\": \"array\",\n                \"items\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"page_name\": {\n                      \"type\": \"string\"\n                    },\n                    \"title\": {\n                      \"type\": \"string\"\n                    },\n                    \"summary\": {\n                      \"type\": [\n                        \"string\",\n                        \"null\"\n                      ]\n                    },\n                    \"action\": {\n                      \"type\": \"string\"\n                    },\n                    \"sha\": {\n                      \"type\": \"string\"\n                    },\n                    \"html_url\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"public\": {\n            \"type\": \"boolean\"\n          },\n          \"created_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"type\",\n          \"actor\",\n          \"repo\",\n          \"payload\",\n          \"public\",\n          \"created_at\"\n        ]\n      },\n      \"link-with-type\": {\n        \"title\": \"Link With Type\",\n        \"description\": \"Hypermedia Link with Type\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"href\": {\n            \"type\": \"string\"\n          },\n          \"type\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"href\",\n          \"type\"\n        ]\n      },\n      \"feed\": {\n        \"title\": \"Feed\",\n        \"description\": \"Feed\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"timeline_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/timeline\"\n            ]\n          },\n          \"user_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/{user}\"\n            ]\n          },\n          \"current_user_public_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/octocat\"\n            ]\n          },\n          \"current_user_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/octocat.private?token=abc123\"\n            ]\n          },\n          \"current_user_actor_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/octocat.private.actor?token=abc123\"\n            ]\n          },\n          \"current_user_organization_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/octocat-org\"\n            ]\n          },\n          \"current_user_organization_urls\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\",\n              \"format\": \"uri\"\n            },\n            \"examples\": [\n              \"https://github.com/organizations/github/octocat.private.atom?token=abc123\"\n            ]\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"timeline\": {\n                \"$ref\": \"#/components/schemas/link-with-type\"\n              },\n              \"user\": {\n                \"$ref\": \"#/components/schemas/link-with-type\"\n              },\n              \"security_advisories\": {\n                \"$ref\": \"#/components/schemas/link-with-type\"\n              },\n              \"current_user\": {\n                \"$ref\": \"#/components/schemas/link-with-type\"\n              },\n              \"current_user_public\": {\n                \"$ref\": \"#/components/schemas/link-with-type\"\n              },\n              \"current_user_actor\": {\n                \"$ref\": \"#/components/schemas/link-with-type\"\n              },\n              \"current_user_organization\": {\n                \"$ref\": \"#/components/schemas/link-with-type\"\n              },\n              \"current_user_organizations\": {\n                \"type\": \"array\",\n                \"items\": {\n                  \"$ref\": \"#/components/schemas/link-with-type\"\n                }\n              }\n            },\n            \"required\": [\n              \"timeline\",\n              \"user\"\n            ]\n          }\n        },\n        \"required\": [\n          \"_links\",\n          \"timeline_url\",\n          \"user_url\"\n        ]\n      },\n      \"base-gist\": {\n        \"title\": \"Base Gist\",\n        \"description\": \"Base Gist\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"forks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"commits_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"id\": {\n            \"type\": \"string\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"git_pull_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"git_push_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"files\": {\n            \"type\": \"object\",\n            \"additionalProperties\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"filename\": {\n                  \"type\": \"string\"\n                },\n                \"type\": {\n                  \"type\": \"string\"\n                },\n                \"language\": {\n                  \"type\": \"string\"\n                },\n                \"raw_url\": {\n                  \"type\": \"string\"\n                },\n                \"size\": {\n                  \"type\": \"integer\"\n                }\n              }\n            }\n          },\n          \"public\": {\n            \"type\": \"boolean\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"comments\": {\n            \"type\": \"integer\"\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"owner\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"truncated\": {\n            \"type\": \"boolean\"\n          },\n          \"forks\": {\n            \"type\": \"array\",\n            \"items\": {\n            }\n          },\n          \"history\": {\n            \"type\": \"array\",\n            \"items\": {\n            }\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"forks_url\",\n          \"commits_url\",\n          \"git_pull_url\",\n          \"git_push_url\",\n          \"html_url\",\n          \"comments_url\",\n          \"public\",\n          \"description\",\n          \"comments\",\n          \"user\",\n          \"files\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"public-user\": {\n        \"title\": \"Public User\",\n        \"description\": \"Public User\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"login\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"gravatar_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"followers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"following_url\": {\n            \"type\": \"string\"\n          },\n          \"gists_url\": {\n            \"type\": \"string\"\n          },\n          \"starred_url\": {\n            \"type\": \"string\"\n          },\n          \"subscriptions_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"organizations_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"events_url\": {\n            \"type\": \"string\"\n          },\n          \"received_events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"site_admin\": {\n            \"type\": \"boolean\"\n          },\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"company\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"blog\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"location\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"email\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"email\"\n          },\n          \"hireable\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ]\n          },\n          \"bio\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"public_repos\": {\n            \"type\": \"integer\"\n          },\n          \"public_gists\": {\n            \"type\": \"integer\"\n          },\n          \"followers\": {\n            \"type\": \"integer\"\n          },\n          \"following\": {\n            \"type\": \"integer\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"plan\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"collaborators\": {\n                \"type\": \"integer\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"space\": {\n                \"type\": \"integer\"\n              },\n              \"private_repos\": {\n                \"type\": \"integer\"\n              }\n            },\n            \"required\": [\n              \"collaborators\",\n              \"name\",\n              \"space\",\n              \"private_repos\"\n            ]\n          },\n          \"suspended_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"private_gists\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"total_private_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"owned_private_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"disk_usage\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"collaborators\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              3\n            ]\n          }\n        },\n        \"required\": [\n          \"avatar_url\",\n          \"events_url\",\n          \"followers_url\",\n          \"following_url\",\n          \"gists_url\",\n          \"gravatar_id\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"login\",\n          \"organizations_url\",\n          \"received_events_url\",\n          \"repos_url\",\n          \"site_admin\",\n          \"starred_url\",\n          \"subscriptions_url\",\n          \"type\",\n          \"url\",\n          \"bio\",\n          \"blog\",\n          \"company\",\n          \"email\",\n          \"followers\",\n          \"following\",\n          \"hireable\",\n          \"location\",\n          \"name\",\n          \"public_gists\",\n          \"public_repos\",\n          \"created_at\",\n          \"updated_at\"\n        ],\n        \"additionalProperties\": false\n      },\n      \"gist-history\": {\n        \"title\": \"Gist History\",\n        \"description\": \"Gist History\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"version\": {\n            \"type\": \"string\"\n          },\n          \"committed_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"change_status\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"total\": {\n                \"type\": \"integer\"\n              },\n              \"additions\": {\n                \"type\": \"integer\"\n              },\n              \"deletions\": {\n                \"type\": \"integer\"\n              }\n            }\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          }\n        }\n      },\n      \"gist-simple\": {\n        \"title\": \"Gist Simple\",\n        \"description\": \"Gist Simple\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"forks\": {\n            \"deprecated\": true,\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"string\"\n                },\n                \"url\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\"\n                },\n                \"user\": {\n                  \"$ref\": \"#/components/schemas/public-user\"\n                },\n                \"created_at\": {\n                  \"type\": \"string\",\n                  \"format\": \"date-time\"\n                },\n                \"updated_at\": {\n                  \"type\": \"string\",\n                  \"format\": \"date-time\"\n                }\n              }\n            }\n          },\n          \"history\": {\n            \"deprecated\": true,\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/gist-history\"\n            }\n          },\n          \"fork_of\": {\n            \"title\": \"Gist\",\n            \"description\": \"Gist\",\n            \"type\": [\n              \"object\",\n              \"null\"\n            ],\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"forks_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"commits_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"id\": {\n                \"type\": \"string\"\n              },\n              \"node_id\": {\n                \"type\": \"string\"\n              },\n              \"git_pull_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"git_push_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"html_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"files\": {\n                \"type\": \"object\",\n                \"additionalProperties\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"filename\": {\n                      \"type\": \"string\"\n                    },\n                    \"type\": {\n                      \"type\": \"string\"\n                    },\n                    \"language\": {\n                      \"type\": \"string\"\n                    },\n                    \"raw_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"size\": {\n                      \"type\": \"integer\"\n                    }\n                  }\n                }\n              },\n              \"public\": {\n                \"type\": \"boolean\"\n              },\n              \"created_at\": {\n                \"type\": \"string\",\n                \"format\": \"date-time\"\n              },\n              \"updated_at\": {\n                \"type\": \"string\",\n                \"format\": \"date-time\"\n              },\n              \"description\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"comments\": {\n                \"type\": \"integer\"\n              },\n              \"user\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"null\"\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                ]\n              },\n              \"comments_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"owner\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"null\"\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                ]\n              },\n              \"truncated\": {\n                \"type\": \"boolean\"\n              },\n              \"forks\": {\n                \"type\": \"array\",\n                \"items\": {\n                }\n              },\n              \"history\": {\n                \"type\": \"array\",\n                \"items\": {\n                }\n              }\n            },\n            \"required\": [\n              \"id\",\n              \"node_id\",\n              \"url\",\n              \"forks_url\",\n              \"commits_url\",\n              \"git_pull_url\",\n              \"git_push_url\",\n              \"html_url\",\n              \"comments_url\",\n              \"public\",\n              \"description\",\n              \"comments\",\n              \"user\",\n              \"files\",\n              \"created_at\",\n              \"updated_at\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"forks_url\": {\n            \"type\": \"string\"\n          },\n          \"commits_url\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"string\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"git_pull_url\": {\n            \"type\": \"string\"\n          },\n          \"git_push_url\": {\n            \"type\": \"string\"\n          },\n          \"html_url\": {\n            \"type\": \"string\"\n          },\n          \"files\": {\n            \"type\": \"object\",\n            \"additionalProperties\": {\n              \"type\": [\n                \"object\",\n                \"null\"\n              ],\n              \"properties\": {\n                \"filename\": {\n                  \"type\": \"string\"\n                },\n                \"type\": {\n                  \"type\": \"string\"\n                },\n                \"language\": {\n                  \"type\": \"string\"\n                },\n                \"raw_url\": {\n                  \"type\": \"string\"\n                },\n                \"size\": {\n                  \"type\": \"integer\"\n                },\n                \"truncated\": {\n                  \"type\": \"boolean\"\n                },\n                \"content\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"public\": {\n            \"type\": \"boolean\"\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\"\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"comments\": {\n            \"type\": \"integer\"\n          },\n          \"user\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\"\n          },\n          \"owner\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"truncated\": {\n            \"type\": \"boolean\"\n          }\n        }\n      },\n      \"gist-comment\": {\n        \"title\": \"Gist Comment\",\n        \"description\": \"A comment made to a gist.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDExOkdpc3RDb21tZW50MQ==\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/gists/a6db0bec360bb87e9418/comments/1\"\n            ]\n          },\n          \"body\": {\n            \"description\": \"The comment text.\",\n            \"type\": \"string\",\n            \"maxLength\": 65535,\n            \"examples\": [\n              \"Body of the attachment\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-18T23:23:56Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-18T23:23:56Z\"\n            ]\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"id\",\n          \"node_id\",\n          \"user\",\n          \"body\",\n          \"author_association\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"gist-commit\": {\n        \"title\": \"Gist Commit\",\n        \"description\": \"Gist Commit\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f\"\n            ]\n          },\n          \"version\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"57a7f021a713b1c5a6a199b54cc514735d2d462f\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"change_status\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"total\": {\n                \"type\": \"integer\"\n              },\n              \"additions\": {\n                \"type\": \"integer\"\n              },\n              \"deletions\": {\n                \"type\": \"integer\"\n              }\n            }\n          },\n          \"committed_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2010-04-14T02:15:15Z\"\n            ]\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"user\",\n          \"version\",\n          \"committed_at\",\n          \"change_status\"\n        ]\n      },\n      \"gitignore-template\": {\n        \"title\": \"Gitignore Template\",\n        \"description\": \"Gitignore Template\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"C\"\n            ]\n          },\n          \"source\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"# Object files\\n*.o\\n\\n# Libraries\\n*.lib\\n*.a\\n\\n# Shared objects (inc. Windows DLLs)\\n*.dll\\n*.so\\n*.so.*\\n*.dylib\\n\\n# Executables\\n*.exe\\n*.out\\n*.app\\n\"\n            ]\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"source\"\n        ]\n      },\n      \"license\": {\n        \"title\": \"License\",\n        \"description\": \"License\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"key\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"mit\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MIT License\"\n            ]\n          },\n          \"spdx_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"MIT\"\n            ]\n          },\n          \"url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/licenses/mit\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDc6TGljZW5zZW1pdA==\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://choosealicense.com/licenses/mit/\"\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty.\"\n            ]\n          },\n          \"implementation\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders.\"\n            ]\n          },\n          \"permissions\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"commercial-use\",\n              \"modifications\",\n              \"distribution\",\n              \"sublicense\",\n              \"private-use\"\n            ]\n          },\n          \"conditions\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"include-copyright\"\n            ]\n          },\n          \"limitations\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"no-liability\"\n            ]\n          },\n          \"body\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\n\\nThe MIT License (MIT)\\n\\nCopyright (c) [year] [fullname]\\n\\nPermission is hereby granted, free of charge, to any person obtaining a copy\\nof this software and associated documentation files (the \\\"Software\\\"), to deal\\nin the Software without restriction, including without limitation the rights\\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\ncopies of the Software, and to permit persons to whom the Software is\\nfurnished to do so, subject to the following conditions:\\n\\nThe above copyright notice and this permission notice shall be included in all\\ncopies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\nSOFTWARE.\\n\"\n            ]\n          },\n          \"featured\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          }\n        },\n        \"required\": [\n          \"key\",\n          \"name\",\n          \"url\",\n          \"spdx_id\",\n          \"node_id\",\n          \"html_url\",\n          \"description\",\n          \"implementation\",\n          \"permissions\",\n          \"conditions\",\n          \"limitations\",\n          \"body\",\n          \"featured\"\n        ]\n      },\n      \"api-overview\": {\n        \"title\": \"Api Overview\",\n        \"description\": \"Api Overview\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"verifiable_password_authentication\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"packages\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"13.65.0.0/16\",\n              \"157.55.204.33/32\",\n              \"2a01:111:f403:f90c::/62\"\n            ]\n          },\n          \"dependabot\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"192.168.7.15/32\",\n              \"192.168.7.16/32\"\n            ]\n          },\n          \"installed_version\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"3.0.0\"\n            ]\n          }\n        },\n        \"required\": [\n          \"verifiable_password_authentication\"\n        ]\n      },\n      \"minimal-repository\": {\n        \"title\": \"Minimal Repository\",\n        \"description\": \"Minimal Repository\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1296269\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Hello-World\"\n            ]\n          },\n          \"full_name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"octocat/Hello-World\"\n            ]\n          },\n          \"owner\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"private\": {\n            \"type\": \"boolean\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"This your first repo!\"\n            ]\n          },\n          \"fork\": {\n            \"type\": \"boolean\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World\"\n            ]\n          },\n          \"archive_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\"\n            ]\n          },\n          \"assignees_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/assignees{/user}\"\n            ]\n          },\n          \"blobs_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\"\n            ]\n          },\n          \"branches_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/branches{/branch}\"\n            ]\n          },\n          \"collaborators_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\"\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/comments{/number}\"\n            ]\n          },\n          \"commits_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/commits{/sha}\"\n            ]\n          },\n          \"compare_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\"\n            ]\n          },\n          \"contents_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/contents/{+path}\"\n            ]\n          },\n          \"contributors_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/contributors\"\n            ]\n          },\n          \"deployments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/deployments\"\n            ]\n          },\n          \"downloads_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/downloads\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/events\"\n            ]\n          },\n          \"forks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/forks\"\n            ]\n          },\n          \"git_commits_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\"\n            ]\n          },\n          \"git_refs_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\"\n            ]\n          },\n          \"git_tags_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\"\n            ]\n          },\n          \"git_url\": {\n            \"type\": \"string\"\n          },\n          \"issue_comment_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\"\n            ]\n          },\n          \"issue_events_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues/events{/number}\"\n            ]\n          },\n          \"issues_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues{/number}\"\n            ]\n          },\n          \"keys_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/keys{/key_id}\"\n            ]\n          },\n          \"labels_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/labels{/name}\"\n            ]\n          },\n          \"languages_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/languages\"\n            ]\n          },\n          \"merges_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/merges\"\n            ]\n          },\n          \"milestones_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/milestones{/number}\"\n            ]\n          },\n          \"notifications_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\"\n            ]\n          },\n          \"pulls_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/pulls{/number}\"\n            ]\n          },\n          \"releases_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/releases{/id}\"\n            ]\n          },\n          \"ssh_url\": {\n            \"type\": \"string\"\n          },\n          \"stargazers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/stargazers\"\n            ]\n          },\n          \"statuses_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/statuses/{sha}\"\n            ]\n          },\n          \"subscribers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/subscribers\"\n            ]\n          },\n          \"subscription_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/subscription\"\n            ]\n          },\n          \"tags_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/tags\"\n            ]\n          },\n          \"teams_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/teams\"\n            ]\n          },\n          \"trees_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\"\n            ]\n          },\n          \"clone_url\": {\n            \"type\": \"string\"\n          },\n          \"mirror_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"hooks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n            ]\n          },\n          \"svn_url\": {\n            \"type\": \"string\"\n          },\n          \"homepage\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"language\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"forks_count\": {\n            \"type\": \"integer\"\n          },\n          \"stargazers_count\": {\n            \"type\": \"integer\"\n          },\n          \"watchers_count\": {\n            \"type\": \"integer\"\n          },\n          \"size\": {\n            \"type\": \"integer\"\n          },\n          \"default_branch\": {\n            \"type\": \"string\"\n          },\n          \"open_issues_count\": {\n            \"type\": \"integer\"\n          },\n          \"is_template\": {\n            \"type\": \"boolean\"\n          },\n          \"topics\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"has_issues\": {\n            \"type\": \"boolean\"\n          },\n          \"has_projects\": {\n            \"type\": \"boolean\"\n          },\n          \"has_wiki\": {\n            \"type\": \"boolean\"\n          },\n          \"has_pages\": {\n            \"type\": \"boolean\"\n          },\n          \"has_downloads\": {\n            \"type\": \"boolean\"\n          },\n          \"archived\": {\n            \"type\": \"boolean\"\n          },\n          \"disabled\": {\n            \"type\": \"boolean\"\n          },\n          \"visibility\": {\n            \"type\": \"string\"\n          },\n          \"pushed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:06:43Z\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:14:43Z\"\n            ]\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"admin\": {\n                \"type\": \"boolean\"\n              },\n              \"maintain\": {\n                \"type\": \"boolean\"\n              },\n              \"push\": {\n                \"type\": \"boolean\"\n              },\n              \"triage\": {\n                \"type\": \"boolean\"\n              },\n              \"pull\": {\n                \"type\": \"boolean\"\n              }\n            }\n          },\n          \"template_repository\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/repository\"\n              }\n            ]\n          },\n          \"temp_clone_token\": {\n            \"type\": \"string\"\n          },\n          \"delete_branch_on_merge\": {\n            \"type\": \"boolean\"\n          },\n          \"subscribers_count\": {\n            \"type\": \"integer\"\n          },\n          \"network_count\": {\n            \"type\": \"integer\"\n          },\n          \"code_of_conduct\": {\n            \"$ref\": \"#/components/schemas/code-of-conduct\"\n          },\n          \"license\": {\n            \"type\": [\n              \"object\",\n              \"null\"\n            ],\n            \"properties\": {\n              \"key\": {\n                \"type\": \"string\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"spdx_id\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"node_id\": {\n                \"type\": \"string\"\n              }\n            }\n          },\n          \"forks\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"open_issues\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"watchers\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"allow_forking\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"archive_url\",\n          \"assignees_url\",\n          \"blobs_url\",\n          \"branches_url\",\n          \"collaborators_url\",\n          \"comments_url\",\n          \"commits_url\",\n          \"compare_url\",\n          \"contents_url\",\n          \"contributors_url\",\n          \"deployments_url\",\n          \"description\",\n          \"downloads_url\",\n          \"events_url\",\n          \"fork\",\n          \"forks_url\",\n          \"full_name\",\n          \"git_commits_url\",\n          \"git_refs_url\",\n          \"git_tags_url\",\n          \"hooks_url\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"issue_comment_url\",\n          \"issue_events_url\",\n          \"issues_url\",\n          \"keys_url\",\n          \"labels_url\",\n          \"languages_url\",\n          \"merges_url\",\n          \"milestones_url\",\n          \"name\",\n          \"notifications_url\",\n          \"owner\",\n          \"private\",\n          \"pulls_url\",\n          \"releases_url\",\n          \"stargazers_url\",\n          \"statuses_url\",\n          \"subscribers_url\",\n          \"subscription_url\",\n          \"tags_url\",\n          \"teams_url\",\n          \"trees_url\",\n          \"url\"\n        ]\n      },\n      \"thread\": {\n        \"title\": \"Thread\",\n        \"description\": \"Thread\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"string\"\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          },\n          \"subject\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"title\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"latest_comment_url\": {\n                \"type\": \"string\"\n              },\n              \"type\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"title\",\n              \"url\",\n              \"latest_comment_url\",\n              \"type\"\n            ]\n          },\n          \"reason\": {\n            \"type\": \"string\"\n          },\n          \"unread\": {\n            \"type\": \"boolean\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\"\n          },\n          \"last_read_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"subscription_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/notifications/threads/2/subscription\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"unread\",\n          \"reason\",\n          \"updated_at\",\n          \"last_read_at\",\n          \"subject\",\n          \"repository\",\n          \"url\",\n          \"subscription_url\"\n        ]\n      },\n      \"thread-subscription\": {\n        \"title\": \"Thread Subscription\",\n        \"description\": \"Thread Subscription\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"subscribed\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"ignored\": {\n            \"type\": \"boolean\"\n          },\n          \"reason\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-10-06T21:34:12Z\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/notifications/threads/1/subscription\"\n            ]\n          },\n          \"thread_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/notifications/threads/1\"\n            ]\n          },\n          \"repository_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/1\"\n            ]\n          }\n        },\n        \"required\": [\n          \"created_at\",\n          \"ignored\",\n          \"reason\",\n          \"url\",\n          \"subscribed\"\n        ]\n      },\n      \"organization-full\": {\n        \"title\": \"Organization Full\",\n        \"description\": \"Organization Full\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"login\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"github\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEyOk9yZ2FuaXphdGlvbjE=\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github\"\n            ]\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/repos\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/events\"\n            ]\n          },\n          \"hooks_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/hooks\"\n            ]\n          },\n          \"issues_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/issues\"\n            ]\n          },\n          \"members_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/members{/member}\"\n            ]\n          },\n          \"public_members_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/orgs/github/public_members{/member}\"\n            ]\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/images/error/octocat_happy.gif\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"A great organization\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"github\"\n            ]\n          },\n          \"company\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"GitHub\"\n            ]\n          },\n          \"blog\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/blog\"\n            ]\n          },\n          \"location\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"San Francisco\"\n            ]\n          },\n          \"email\": {\n            \"type\": \"string\",\n            \"format\": \"email\",\n            \"examples\": [\n              \"octocat@github.com\"\n            ]\n          },\n          \"twitter_username\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"github\"\n            ]\n          },\n          \"is_verified\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_organization_projects\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_repository_projects\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"public_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"public_gists\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"followers\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              20\n            ]\n          },\n          \"following\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2008-01-14T04:33:35Z\"\n            ]\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Organization\"\n            ]\n          },\n          \"total_private_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              100\n            ]\n          },\n          \"owned_private_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              100\n            ]\n          },\n          \"private_gists\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              81\n            ]\n          },\n          \"disk_usage\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              10000\n            ]\n          },\n          \"collaborators\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              8\n            ]\n          },\n          \"billing_email\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"email\",\n            \"examples\": [\n              \"org@example.com\"\n            ]\n          },\n          \"plan\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"space\": {\n                \"type\": \"integer\"\n              },\n              \"private_repos\": {\n                \"type\": \"integer\"\n              },\n              \"filled_seats\": {\n                \"type\": \"integer\"\n              },\n              \"seats\": {\n                \"type\": \"integer\"\n              }\n            },\n            \"required\": [\n              \"name\",\n              \"space\",\n              \"private_repos\"\n            ]\n          },\n          \"default_repository_permission\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"members_can_create_repositories\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ],\n            \"examples\": [\n              true\n            ]\n          },\n          \"two_factor_requirement_enabled\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ],\n            \"examples\": [\n              true\n            ]\n          },\n          \"members_allowed_repository_creation_type\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"all\"\n            ]\n          },\n          \"members_can_create_public_repositories\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"members_can_create_private_repositories\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"members_can_create_internal_repositories\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"members_can_create_pages\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"members_can_create_public_pages\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"members_can_create_private_pages\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"members_can_fork_private_repositories\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ],\n            \"examples\": [\n              false\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          }\n        },\n        \"required\": [\n          \"login\",\n          \"url\",\n          \"id\",\n          \"node_id\",\n          \"repos_url\",\n          \"events_url\",\n          \"hooks_url\",\n          \"issues_url\",\n          \"members_url\",\n          \"public_members_url\",\n          \"avatar_url\",\n          \"description\",\n          \"html_url\",\n          \"has_organization_projects\",\n          \"has_repository_projects\",\n          \"public_repos\",\n          \"public_gists\",\n          \"followers\",\n          \"following\",\n          \"type\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"enabled-repositories\": {\n        \"type\": \"string\",\n        \"description\": \"The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`.\",\n        \"enum\": [\n          \"all\",\n          \"none\",\n          \"selected\"\n        ]\n      },\n      \"actions-organization-permissions\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"enabled_repositories\": {\n            \"$ref\": \"#/components/schemas/enabled-repositories\"\n          },\n          \"selected_repositories_url\": {\n            \"type\": \"string\",\n            \"description\": \"The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`.\"\n          },\n          \"allowed_actions\": {\n            \"$ref\": \"#/components/schemas/allowed-actions\"\n          },\n          \"selected_actions_url\": {\n            \"$ref\": \"#/components/schemas/selected-actions-url\"\n          }\n        },\n        \"required\": [\n          \"enabled_repositories\"\n        ]\n      },\n      \"runner-groups-org\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"number\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"visibility\": {\n            \"type\": \"string\"\n          },\n          \"default\": {\n            \"type\": \"boolean\"\n          },\n          \"selected_repositories_url\": {\n            \"description\": \"Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected`\",\n            \"type\": \"string\"\n          },\n          \"runners_url\": {\n            \"type\": \"string\"\n          },\n          \"inherited\": {\n            \"type\": \"boolean\"\n          },\n          \"inherited_allows_public_repositories\": {\n            \"type\": \"boolean\"\n          },\n          \"allows_public_repositories\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"visibility\",\n          \"default\",\n          \"runners_url\",\n          \"inherited\",\n          \"allows_public_repositories\"\n        ]\n      },\n      \"organization-actions-secret\": {\n        \"title\": \"Actions Secret for an Organization\",\n        \"description\": \"Secrets for GitHub Actions for an organization.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"description\": \"The name of the secret.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"SECRET_TOKEN\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"visibility\": {\n            \"description\": \"Visibility of a secret\",\n            \"enum\": [\n              \"all\",\n              \"private\",\n              \"selected\"\n            ],\n            \"type\": \"string\"\n          },\n          \"selected_repositories_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/org/secrets/my_secret/repositories\"\n            ]\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"created_at\",\n          \"updated_at\",\n          \"visibility\"\n        ]\n      },\n      \"actions-public-key\": {\n        \"title\": \"ActionsPublicKey\",\n        \"description\": \"The public key used for setting Actions Secrets.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"key_id\": {\n            \"description\": \"The identifier for the key.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"1234567\"\n            ]\n          },\n          \"key\": {\n            \"description\": \"The Base64 encoded public key.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/user/keys/2\"\n            ]\n          },\n          \"title\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"ssh-rsa AAAAB3NzaC1yc2EAAA\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          }\n        },\n        \"required\": [\n          \"key_id\",\n          \"key\"\n        ]\n      },\n      \"empty-object\": {\n        \"title\": \"Empty Object\",\n        \"description\": \"An object without any properties.\",\n        \"type\": \"object\",\n        \"properties\": {\n        },\n        \"additionalProperties\": false\n      },\n      \"org-hook\": {\n        \"title\": \"Org Hook\",\n        \"description\": \"Org Hook\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/octocat/hooks/1\"\n            ]\n          },\n          \"ping_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/octocat/hooks/1/pings\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"web\"\n            ]\n          },\n          \"events\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"push\",\n              \"pull_request\"\n            ]\n          },\n          \"active\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"config\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"http://example.com/2\\\"\"\n                ]\n              },\n              \"insecure_ssl\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"0\\\"\"\n                ]\n              },\n              \"content_type\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"form\\\"\"\n                ]\n              },\n              \"secret\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"********\\\"\"\n                ]\n              }\n            }\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-09-06T20:39:23Z\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-09-06T17:26:27Z\"\n            ]\n          },\n          \"type\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"url\",\n          \"type\",\n          \"name\",\n          \"active\",\n          \"events\",\n          \"config\",\n          \"ping_url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"org-membership\": {\n        \"title\": \"Org Membership\",\n        \"description\": \"Org Membership\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/octocat/memberships/defunkt\"\n            ]\n          },\n          \"state\": {\n            \"type\": \"string\",\n            \"description\": \"The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation.\",\n            \"enum\": [\n              \"active\",\n              \"pending\"\n            ],\n            \"examples\": [\n              \"active\"\n            ]\n          },\n          \"role\": {\n            \"type\": \"string\",\n            \"description\": \"The user's membership type in the organization.\",\n            \"enum\": [\n              \"admin\",\n              \"member\",\n              \"billing_manager\"\n            ],\n            \"examples\": [\n              \"admin\"\n            ]\n          },\n          \"organization_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/orgs/octocat\"\n            ]\n          },\n          \"organization\": {\n            \"$ref\": \"#/components/schemas/organization-simple\"\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"can_create_repository\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"required\": [\n              \"can_create_repository\"\n            ]\n          }\n        },\n        \"required\": [\n          \"state\",\n          \"role\",\n          \"organization_url\",\n          \"url\",\n          \"organization\",\n          \"user\"\n        ]\n      },\n      \"org-pre-receive-hook\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"enforcement\": {\n            \"type\": \"string\"\n          },\n          \"configuration_url\": {\n            \"type\": \"string\"\n          },\n          \"allow_downstream_configuration\": {\n            \"type\": \"boolean\"\n          }\n        }\n      },\n      \"project\": {\n        \"title\": \"Project\",\n        \"description\": \"Projects are a way to organize columns and cards of work.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"owner_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/api-playground/projects-test\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/projects/1002604\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/api-playground/projects-test/projects/12\"\n            ]\n          },\n          \"columns_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/projects/1002604/columns\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1002604\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDc6UHJvamVjdDEwMDI2MDQ=\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"Name of the project\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Week One Sprint\"\n            ]\n          },\n          \"body\": {\n            \"description\": \"Body of the project\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"This project represents the sprint of the first week in January\"\n            ]\n          },\n          \"number\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"state\": {\n            \"description\": \"State of the project; either 'open' or 'closed'\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"open\"\n            ]\n          },\n          \"creator\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-10T20:09:31Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2014-03-03T18:58:10Z\"\n            ]\n          },\n          \"organization_permission\": {\n            \"description\": \"The baseline permission that all organization members have on this project. Only present if owner is an organization.\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"read\",\n              \"write\",\n              \"admin\",\n              \"none\"\n            ]\n          },\n          \"private\": {\n            \"description\": \"Whether or not this project can be seen by everyone. Only present if owner is an organization.\",\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"number\",\n          \"name\",\n          \"body\",\n          \"state\",\n          \"url\",\n          \"html_url\",\n          \"owner_url\",\n          \"creator\",\n          \"columns_url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"team-simple\": {\n        \"title\": \"Team Simple\",\n        \"description\": \"Groups of organization members that gives permissions on specified repositories.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"Unique identifier of the team\",\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDQ6VGVhbTE=\"\n            ]\n          },\n          \"url\": {\n            \"description\": \"URL for the team\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/1\"\n            ]\n          },\n          \"members_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/1/members{/member}\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"Name of the team\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Justice League\"\n            ]\n          },\n          \"description\": {\n            \"description\": \"Description of the team\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"A great team.\"\n            ]\n          },\n          \"permission\": {\n            \"description\": \"Permission that the team will have for its repositories\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"admin\"\n            ]\n          },\n          \"privacy\": {\n            \"description\": \"The level of privacy this team should have\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"closed\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/orgs/rails/teams/core\"\n            ]\n          },\n          \"repositories_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/1/repos\"\n            ]\n          },\n          \"slug\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"justice-league\"\n            ]\n          },\n          \"ldap_dn\": {\n            \"description\": \"Distinguished Name (DN) that team maps to within LDAP environment\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"uid=example,ou=users,dc=github,dc=com\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"members_url\",\n          \"name\",\n          \"description\",\n          \"permission\",\n          \"html_url\",\n          \"repositories_url\",\n          \"slug\"\n        ]\n      },\n      \"team\": {\n        \"title\": \"Team\",\n        \"description\": \"Groups of organization members that gives permissions on specified repositories.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"slug\": {\n            \"type\": \"string\"\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"privacy\": {\n            \"type\": \"string\"\n          },\n          \"permission\": {\n            \"type\": \"string\"\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"pull\": {\n                \"type\": \"boolean\"\n              },\n              \"triage\": {\n                \"type\": \"boolean\"\n              },\n              \"push\": {\n                \"type\": \"boolean\"\n              },\n              \"maintain\": {\n                \"type\": \"boolean\"\n              },\n              \"admin\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"required\": [\n              \"pull\",\n              \"triage\",\n              \"push\",\n              \"maintain\",\n              \"admin\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/orgs/rails/teams/core\"\n            ]\n          },\n          \"members_url\": {\n            \"type\": \"string\"\n          },\n          \"repositories_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"parent\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/team-simple\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"members_url\",\n          \"name\",\n          \"description\",\n          \"permission\",\n          \"html_url\",\n          \"repositories_url\",\n          \"slug\",\n          \"parent\"\n        ]\n      },\n      \"team-full\": {\n        \"title\": \"Full Team\",\n        \"description\": \"Groups of organization members that gives permissions on specified repositories.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"Unique identifier of the team\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDQ6VGVhbTE=\"\n            ]\n          },\n          \"url\": {\n            \"description\": \"URL for the team\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/1\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/orgs/rails/teams/core\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"Name of the team\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Developers\"\n            ]\n          },\n          \"slug\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"justice-league\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"A great team.\"\n            ]\n          },\n          \"privacy\": {\n            \"description\": \"The level of privacy this team should have\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"closed\",\n              \"secret\"\n            ],\n            \"examples\": [\n              \"closed\"\n            ]\n          },\n          \"permission\": {\n            \"description\": \"Permission that the team will have for its repositories\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"push\"\n            ]\n          },\n          \"members_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/1/members{/member}\"\n            ]\n          },\n          \"repositories_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/1/repos\"\n            ]\n          },\n          \"parent\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/team-simple\"\n              }\n            ]\n          },\n          \"members_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              3\n            ]\n          },\n          \"repos_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              10\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2017-07-14T16:53:42Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2017-08-17T12:37:15Z\"\n            ]\n          },\n          \"organization\": {\n            \"$ref\": \"#/components/schemas/organization-full\"\n          },\n          \"ldap_dn\": {\n            \"description\": \"Distinguished Name (DN) that team maps to within LDAP environment\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"uid=example,ou=users,dc=github,dc=com\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"members_url\",\n          \"name\",\n          \"description\",\n          \"permission\",\n          \"html_url\",\n          \"repositories_url\",\n          \"slug\",\n          \"created_at\",\n          \"updated_at\",\n          \"members_count\",\n          \"repos_count\",\n          \"organization\"\n        ]\n      },\n      \"team-discussion\": {\n        \"title\": \"Team Discussion\",\n        \"description\": \"A team discussion is a persistent record of a free-form conversation within a team.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"author\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"body\": {\n            \"description\": \"The main text of the discussion.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Please suggest improvements to our workflow in comments.\"\n            ]\n          },\n          \"body_html\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"<p>Hi! This is an area for us to collaborate as a team</p>\"\n            ]\n          },\n          \"body_version\": {\n            \"description\": \"The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"0307116bbf7ced493b8d8a346c650b71\"\n            ]\n          },\n          \"comments_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/2343027/discussions/1/comments\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2018-01-25T18:56:31Z\"\n            ]\n          },\n          \"last_edited_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/orgs/github/teams/justice-league/discussions/1\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDE0OlRlYW1EaXNjdXNzaW9uMQ==\"\n            ]\n          },\n          \"number\": {\n            \"description\": \"The unique sequence number of a team discussion.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"pinned\": {\n            \"description\": \"Whether or not this discussion should be pinned for easy retrieval.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"private\": {\n            \"description\": \"Whether or not this discussion should be restricted to team members and organization administrators.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"team_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/2343027\"\n            ]\n          },\n          \"title\": {\n            \"description\": \"The title of the discussion.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"How can we improve our workflow?\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2018-01-25T18:56:31Z\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/2343027/discussions/1\"\n            ]\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          }\n        },\n        \"required\": [\n          \"author\",\n          \"body\",\n          \"body_html\",\n          \"body_version\",\n          \"comments_count\",\n          \"comments_url\",\n          \"created_at\",\n          \"last_edited_at\",\n          \"html_url\",\n          \"pinned\",\n          \"private\",\n          \"node_id\",\n          \"number\",\n          \"team_url\",\n          \"title\",\n          \"updated_at\",\n          \"url\"\n        ]\n      },\n      \"team-discussion-comment\": {\n        \"title\": \"Team Discussion Comment\",\n        \"description\": \"A reply to a discussion within a team.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"author\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"body\": {\n            \"description\": \"The main text of the comment.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"I agree with this suggestion.\"\n            ]\n          },\n          \"body_html\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"<p>Do you like apples?</p>\"\n            ]\n          },\n          \"body_version\": {\n            \"description\": \"The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"0307116bbf7ced493b8d8a346c650b71\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2018-01-15T23:53:58Z\"\n            ]\n          },\n          \"last_edited_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"discussion_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/2403582/discussions/1\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=\"\n            ]\n          },\n          \"number\": {\n            \"description\": \"The unique sequence number of a team discussion comment.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2018-01-15T23:53:58Z\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1\"\n            ]\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          }\n        },\n        \"required\": [\n          \"author\",\n          \"body\",\n          \"body_html\",\n          \"body_version\",\n          \"created_at\",\n          \"last_edited_at\",\n          \"discussion_url\",\n          \"html_url\",\n          \"node_id\",\n          \"number\",\n          \"updated_at\",\n          \"url\"\n        ]\n      },\n      \"reaction\": {\n        \"title\": \"Reaction\",\n        \"description\": \"Reactions to conversations provide a way to help people express their feelings more simply and effectively.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDg6UmVhY3Rpb24x\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"content\": {\n            \"description\": \"The reaction to use\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"+1\",\n              \"-1\",\n              \"laugh\",\n              \"confused\",\n              \"heart\",\n              \"hooray\",\n              \"rocket\",\n              \"eyes\"\n            ],\n            \"examples\": [\n              \"heart\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2016-05-20T20:09:31Z\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"user\",\n          \"content\",\n          \"created_at\"\n        ]\n      },\n      \"team-membership\": {\n        \"title\": \"Team Membership\",\n        \"description\": \"Team Membership\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"role\": {\n            \"description\": \"The role of the user in the team.\",\n            \"enum\": [\n              \"member\",\n              \"maintainer\"\n            ],\n            \"default\": \"member\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"member\"\n            ]\n          },\n          \"state\": {\n            \"description\": \"The state of the user's membership in the team.\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"active\",\n              \"pending\"\n            ]\n          }\n        },\n        \"required\": [\n          \"role\",\n          \"state\",\n          \"url\"\n        ]\n      },\n      \"team-project\": {\n        \"title\": \"Team Project\",\n        \"description\": \"A team's access to a project.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"owner_url\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"html_url\": {\n            \"type\": \"string\"\n          },\n          \"columns_url\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"body\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"number\": {\n            \"type\": \"integer\"\n          },\n          \"state\": {\n            \"type\": \"string\"\n          },\n          \"creator\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\"\n          },\n          \"organization_permission\": {\n            \"description\": \"The organization permission for this project. Only present when owner is an organization.\",\n            \"type\": \"string\"\n          },\n          \"private\": {\n            \"description\": \"Whether the project is private or not. Only present when owner is an organization.\",\n            \"type\": \"boolean\"\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"read\": {\n                \"type\": \"boolean\"\n              },\n              \"write\": {\n                \"type\": \"boolean\"\n              },\n              \"admin\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"required\": [\n              \"read\",\n              \"write\",\n              \"admin\"\n            ]\n          }\n        },\n        \"required\": [\n          \"owner_url\",\n          \"url\",\n          \"html_url\",\n          \"columns_url\",\n          \"id\",\n          \"node_id\",\n          \"name\",\n          \"body\",\n          \"number\",\n          \"state\",\n          \"creator\",\n          \"created_at\",\n          \"updated_at\",\n          \"permissions\"\n        ]\n      },\n      \"team-repository\": {\n        \"title\": \"Team Repository\",\n        \"description\": \"A team's access to a repository.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"Unique identifier of the repository\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the repository.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Team Environment\"\n            ]\n          },\n          \"full_name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"octocat/Hello-World\"\n            ]\n          },\n          \"license\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/license-simple\"\n              }\n            ]\n          },\n          \"forks\": {\n            \"type\": \"integer\"\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"admin\": {\n                \"type\": \"boolean\"\n              },\n              \"pull\": {\n                \"type\": \"boolean\"\n              },\n              \"triage\": {\n                \"type\": \"boolean\"\n              },\n              \"push\": {\n                \"type\": \"boolean\"\n              },\n              \"maintain\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"required\": [\n              \"admin\",\n              \"pull\",\n              \"push\"\n            ]\n          },\n          \"owner\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"private\": {\n            \"description\": \"Whether the repository is private or public.\",\n            \"default\": false,\n            \"type\": \"boolean\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"This your first repo!\"\n            ]\n          },\n          \"fork\": {\n            \"type\": \"boolean\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World\"\n            ]\n          },\n          \"archive_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\"\n            ]\n          },\n          \"assignees_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/assignees{/user}\"\n            ]\n          },\n          \"blobs_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\"\n            ]\n          },\n          \"branches_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/branches{/branch}\"\n            ]\n          },\n          \"collaborators_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\"\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/comments{/number}\"\n            ]\n          },\n          \"commits_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/commits{/sha}\"\n            ]\n          },\n          \"compare_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\"\n            ]\n          },\n          \"contents_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/contents/{+path}\"\n            ]\n          },\n          \"contributors_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/contributors\"\n            ]\n          },\n          \"deployments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/deployments\"\n            ]\n          },\n          \"downloads_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/downloads\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/events\"\n            ]\n          },\n          \"forks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/forks\"\n            ]\n          },\n          \"git_commits_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\"\n            ]\n          },\n          \"git_refs_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\"\n            ]\n          },\n          \"git_tags_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\"\n            ]\n          },\n          \"git_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"git:github.com/octocat/Hello-World.git\"\n            ]\n          },\n          \"issue_comment_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\"\n            ]\n          },\n          \"issue_events_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues/events{/number}\"\n            ]\n          },\n          \"issues_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues{/number}\"\n            ]\n          },\n          \"keys_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/keys{/key_id}\"\n            ]\n          },\n          \"labels_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/labels{/name}\"\n            ]\n          },\n          \"languages_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/languages\"\n            ]\n          },\n          \"merges_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/merges\"\n            ]\n          },\n          \"milestones_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/milestones{/number}\"\n            ]\n          },\n          \"notifications_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\"\n            ]\n          },\n          \"pulls_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/pulls{/number}\"\n            ]\n          },\n          \"releases_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/releases{/id}\"\n            ]\n          },\n          \"ssh_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"git@github.com:octocat/Hello-World.git\"\n            ]\n          },\n          \"stargazers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/stargazers\"\n            ]\n          },\n          \"statuses_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/statuses/{sha}\"\n            ]\n          },\n          \"subscribers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/subscribers\"\n            ]\n          },\n          \"subscription_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/subscription\"\n            ]\n          },\n          \"tags_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/tags\"\n            ]\n          },\n          \"teams_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/teams\"\n            ]\n          },\n          \"trees_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\"\n            ]\n          },\n          \"clone_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World.git\"\n            ]\n          },\n          \"mirror_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"git:git.example.com/octocat/Hello-World\"\n            ]\n          },\n          \"hooks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n            ]\n          },\n          \"svn_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://svn.github.com/octocat/Hello-World\"\n            ]\n          },\n          \"homepage\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com\"\n            ]\n          },\n          \"language\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"forks_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              9\n            ]\n          },\n          \"stargazers_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              80\n            ]\n          },\n          \"watchers_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              80\n            ]\n          },\n          \"size\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              108\n            ]\n          },\n          \"default_branch\": {\n            \"description\": \"The default branch of the repository.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"master\"\n            ]\n          },\n          \"open_issues_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"is_template\": {\n            \"description\": \"Whether this repository acts as a template that can be used to generate new repositories.\",\n            \"default\": false,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"topics\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"has_issues\": {\n            \"description\": \"Whether issues are enabled.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_projects\": {\n            \"description\": \"Whether projects are enabled.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_wiki\": {\n            \"description\": \"Whether the wiki is enabled.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_pages\": {\n            \"type\": \"boolean\"\n          },\n          \"has_downloads\": {\n            \"description\": \"Whether downloads are enabled.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"archived\": {\n            \"description\": \"Whether the repository is archived.\",\n            \"default\": false,\n            \"type\": \"boolean\"\n          },\n          \"disabled\": {\n            \"type\": \"boolean\",\n            \"description\": \"Returns whether or not this repository disabled.\"\n          },\n          \"visibility\": {\n            \"description\": \"The repository visibility: public, private, or internal.\",\n            \"default\": \"public\",\n            \"type\": \"string\"\n          },\n          \"pushed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:06:43Z\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:14:43Z\"\n            ]\n          },\n          \"allow_rebase_merge\": {\n            \"description\": \"Whether to allow rebase merges for pull requests.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"template_repository\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/repository\"\n              }\n            ]\n          },\n          \"temp_clone_token\": {\n            \"type\": \"string\"\n          },\n          \"allow_squash_merge\": {\n            \"description\": \"Whether to allow squash merges for pull requests.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"delete_branch_on_merge\": {\n            \"description\": \"Whether to delete head branches when pull requests are merged\",\n            \"default\": false,\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          },\n          \"allow_merge_commit\": {\n            \"description\": \"Whether to allow merge commits for pull requests.\",\n            \"default\": true,\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"allow_forking\": {\n            \"description\": \"Whether to allow forking this repo\",\n            \"default\": false,\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          },\n          \"subscribers_count\": {\n            \"type\": \"integer\"\n          },\n          \"network_count\": {\n            \"type\": \"integer\"\n          },\n          \"open_issues\": {\n            \"type\": \"integer\"\n          },\n          \"watchers\": {\n            \"type\": \"integer\"\n          },\n          \"master_branch\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"archive_url\",\n          \"assignees_url\",\n          \"blobs_url\",\n          \"branches_url\",\n          \"collaborators_url\",\n          \"comments_url\",\n          \"commits_url\",\n          \"compare_url\",\n          \"contents_url\",\n          \"contributors_url\",\n          \"deployments_url\",\n          \"description\",\n          \"downloads_url\",\n          \"events_url\",\n          \"fork\",\n          \"forks_url\",\n          \"full_name\",\n          \"git_commits_url\",\n          \"git_refs_url\",\n          \"git_tags_url\",\n          \"hooks_url\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"issue_comment_url\",\n          \"issue_events_url\",\n          \"issues_url\",\n          \"keys_url\",\n          \"labels_url\",\n          \"languages_url\",\n          \"merges_url\",\n          \"milestones_url\",\n          \"name\",\n          \"notifications_url\",\n          \"owner\",\n          \"private\",\n          \"pulls_url\",\n          \"releases_url\",\n          \"stargazers_url\",\n          \"statuses_url\",\n          \"subscribers_url\",\n          \"subscription_url\",\n          \"tags_url\",\n          \"teams_url\",\n          \"trees_url\",\n          \"url\",\n          \"clone_url\",\n          \"default_branch\",\n          \"forks\",\n          \"forks_count\",\n          \"git_url\",\n          \"has_downloads\",\n          \"has_issues\",\n          \"has_projects\",\n          \"has_wiki\",\n          \"has_pages\",\n          \"homepage\",\n          \"language\",\n          \"archived\",\n          \"disabled\",\n          \"mirror_url\",\n          \"open_issues\",\n          \"open_issues_count\",\n          \"license\",\n          \"pushed_at\",\n          \"size\",\n          \"ssh_url\",\n          \"stargazers_count\",\n          \"svn_url\",\n          \"watchers\",\n          \"watchers_count\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"project-card\": {\n        \"title\": \"Project Card\",\n        \"description\": \"Project cards represent a scope of work.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/projects/columns/cards/1478\"\n            ]\n          },\n          \"id\": {\n            \"description\": \"The project card's ID\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDExOlByb2plY3RDYXJkMTQ3OA==\"\n            ]\n          },\n          \"note\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Add payload for delete Project column\"\n            ]\n          },\n          \"creator\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2016-09-05T14:21:06Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2016-09-05T14:20:22Z\"\n            ]\n          },\n          \"archived\": {\n            \"description\": \"Whether or not the card is archived\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          },\n          \"column_name\": {\n            \"type\": \"string\"\n          },\n          \"project_id\": {\n            \"type\": \"string\"\n          },\n          \"column_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/projects/columns/367\"\n            ]\n          },\n          \"content_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/api-playground/projects-test/issues/3\"\n            ]\n          },\n          \"project_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/projects/120\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"note\",\n          \"url\",\n          \"column_url\",\n          \"project_url\",\n          \"creator\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"project-column\": {\n        \"title\": \"Project Column\",\n        \"description\": \"Project columns contain cards of work.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/projects/columns/367\"\n            ]\n          },\n          \"project_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/projects/120\"\n            ]\n          },\n          \"cards_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/projects/columns/367/cards\"\n            ]\n          },\n          \"id\": {\n            \"description\": \"The unique identifier of the project column\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEzOlByb2plY3RDb2x1bW4zNjc=\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"Name of the project column\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Remaining tasks\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2016-09-05T14:18:44Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2016-09-05T14:22:28Z\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"project_url\",\n          \"cards_url\",\n          \"name\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"project-collaborator-permission\": {\n        \"title\": \"Project Collaborator Permission\",\n        \"description\": \"Project Collaborator Permission\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"permission\": {\n            \"type\": \"string\"\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"permission\",\n          \"user\"\n        ]\n      },\n      \"rate-limit\": {\n        \"title\": \"Rate Limit\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"limit\": {\n            \"type\": \"integer\"\n          },\n          \"remaining\": {\n            \"type\": \"integer\"\n          },\n          \"reset\": {\n            \"type\": \"integer\"\n          },\n          \"used\": {\n            \"type\": \"integer\"\n          }\n        },\n        \"required\": [\n          \"limit\",\n          \"remaining\",\n          \"reset\",\n          \"used\"\n        ]\n      },\n      \"rate-limit-overview\": {\n        \"title\": \"Rate Limit Overview\",\n        \"description\": \"Rate Limit Overview\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"resources\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"core\": {\n                \"$ref\": \"#/components/schemas/rate-limit\"\n              },\n              \"graphql\": {\n                \"$ref\": \"#/components/schemas/rate-limit\"\n              },\n              \"search\": {\n                \"$ref\": \"#/components/schemas/rate-limit\"\n              },\n              \"source_import\": {\n                \"$ref\": \"#/components/schemas/rate-limit\"\n              },\n              \"integration_manifest\": {\n                \"$ref\": \"#/components/schemas/rate-limit\"\n              },\n              \"code_scanning_upload\": {\n                \"$ref\": \"#/components/schemas/rate-limit\"\n              },\n              \"actions_runner_registration\": {\n                \"$ref\": \"#/components/schemas/rate-limit\"\n              },\n              \"scim\": {\n                \"$ref\": \"#/components/schemas/rate-limit\"\n              }\n            },\n            \"required\": [\n              \"core\",\n              \"search\"\n            ]\n          },\n          \"rate\": {\n            \"$ref\": \"#/components/schemas/rate-limit\"\n          }\n        },\n        \"required\": [\n          \"rate\",\n          \"resources\"\n        ]\n      },\n      \"code-of-conduct-simple\": {\n        \"title\": \"Code Of Conduct Simple\",\n        \"description\": \"Code of Conduct Simple\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/docs/community/code_of_conduct\"\n            ]\n          },\n          \"key\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"citizen_code_of_conduct\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Citizen Code of Conduct\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md\"\n            ]\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"key\",\n          \"name\",\n          \"html_url\"\n        ]\n      },\n      \"full-repository\": {\n        \"title\": \"Full Repository\",\n        \"description\": \"Full Repository\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1296269\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Hello-World\"\n            ]\n          },\n          \"full_name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"octocat/Hello-World\"\n            ]\n          },\n          \"owner\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"private\": {\n            \"type\": \"boolean\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"This your first repo!\"\n            ]\n          },\n          \"fork\": {\n            \"type\": \"boolean\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World\"\n            ]\n          },\n          \"archive_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\"\n            ]\n          },\n          \"assignees_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/assignees{/user}\"\n            ]\n          },\n          \"blobs_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\"\n            ]\n          },\n          \"branches_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/branches{/branch}\"\n            ]\n          },\n          \"collaborators_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\"\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/comments{/number}\"\n            ]\n          },\n          \"commits_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/commits{/sha}\"\n            ]\n          },\n          \"compare_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\"\n            ]\n          },\n          \"contents_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/contents/{+path}\"\n            ]\n          },\n          \"contributors_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/contributors\"\n            ]\n          },\n          \"deployments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/deployments\"\n            ]\n          },\n          \"downloads_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/downloads\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/events\"\n            ]\n          },\n          \"forks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/forks\"\n            ]\n          },\n          \"git_commits_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\"\n            ]\n          },\n          \"git_refs_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\"\n            ]\n          },\n          \"git_tags_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\"\n            ]\n          },\n          \"git_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"git:github.com/octocat/Hello-World.git\"\n            ]\n          },\n          \"issue_comment_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\"\n            ]\n          },\n          \"issue_events_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues/events{/number}\"\n            ]\n          },\n          \"issues_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/issues{/number}\"\n            ]\n          },\n          \"keys_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/keys{/key_id}\"\n            ]\n          },\n          \"labels_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/labels{/name}\"\n            ]\n          },\n          \"languages_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/languages\"\n            ]\n          },\n          \"merges_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/merges\"\n            ]\n          },\n          \"milestones_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/milestones{/number}\"\n            ]\n          },\n          \"notifications_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\"\n            ]\n          },\n          \"pulls_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/pulls{/number}\"\n            ]\n          },\n          \"releases_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/releases{/id}\"\n            ]\n          },\n          \"ssh_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"git@github.com:octocat/Hello-World.git\"\n            ]\n          },\n          \"stargazers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/stargazers\"\n            ]\n          },\n          \"statuses_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/statuses/{sha}\"\n            ]\n          },\n          \"subscribers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/subscribers\"\n            ]\n          },\n          \"subscription_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/subscription\"\n            ]\n          },\n          \"tags_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/tags\"\n            ]\n          },\n          \"teams_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/teams\"\n            ]\n          },\n          \"trees_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\"\n            ]\n          },\n          \"clone_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World.git\"\n            ]\n          },\n          \"mirror_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"git:git.example.com/octocat/Hello-World\"\n            ]\n          },\n          \"hooks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n            ]\n          },\n          \"svn_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://svn.github.com/octocat/Hello-World\"\n            ]\n          },\n          \"homepage\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com\"\n            ]\n          },\n          \"language\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"forks_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              9\n            ]\n          },\n          \"stargazers_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              80\n            ]\n          },\n          \"watchers_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              80\n            ]\n          },\n          \"size\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              108\n            ]\n          },\n          \"default_branch\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"master\"\n            ]\n          },\n          \"open_issues_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"is_template\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"topics\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"API\"\n            ]\n          },\n          \"has_issues\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_projects\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_wiki\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"has_pages\": {\n            \"type\": \"boolean\"\n          },\n          \"has_downloads\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"archived\": {\n            \"type\": \"boolean\"\n          },\n          \"disabled\": {\n            \"type\": \"boolean\",\n            \"description\": \"Returns whether or not this repository disabled.\"\n          },\n          \"visibility\": {\n            \"description\": \"The repository visibility: public, private, or internal.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"public\"\n            ]\n          },\n          \"pushed_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:06:43Z\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:14:43Z\"\n            ]\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"admin\": {\n                \"type\": \"boolean\"\n              },\n              \"maintain\": {\n                \"type\": \"boolean\"\n              },\n              \"push\": {\n                \"type\": \"boolean\"\n              },\n              \"triage\": {\n                \"type\": \"boolean\"\n              },\n              \"pull\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"required\": [\n              \"admin\",\n              \"pull\",\n              \"push\"\n            ]\n          },\n          \"allow_rebase_merge\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"template_repository\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/repository\"\n              }\n            ]\n          },\n          \"temp_clone_token\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"allow_squash_merge\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"delete_branch_on_merge\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          },\n          \"allow_merge_commit\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"allow_forking\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"subscribers_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"network_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"license\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/license-simple\"\n              }\n            ]\n          },\n          \"organization\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"parent\": {\n            \"$ref\": \"#/components/schemas/repository\"\n          },\n          \"source\": {\n            \"$ref\": \"#/components/schemas/repository\"\n          },\n          \"forks\": {\n            \"type\": \"integer\"\n          },\n          \"master_branch\": {\n            \"type\": \"string\"\n          },\n          \"open_issues\": {\n            \"type\": \"integer\"\n          },\n          \"watchers\": {\n            \"type\": \"integer\"\n          },\n          \"anonymous_access_enabled\": {\n            \"description\": \"Whether anonymous git access is allowed.\",\n            \"default\": true,\n            \"type\": \"boolean\"\n          },\n          \"code_of_conduct\": {\n            \"$ref\": \"#/components/schemas/code-of-conduct-simple\"\n          }\n        },\n        \"required\": [\n          \"archive_url\",\n          \"assignees_url\",\n          \"blobs_url\",\n          \"branches_url\",\n          \"collaborators_url\",\n          \"comments_url\",\n          \"commits_url\",\n          \"compare_url\",\n          \"contents_url\",\n          \"contributors_url\",\n          \"deployments_url\",\n          \"description\",\n          \"downloads_url\",\n          \"events_url\",\n          \"fork\",\n          \"forks_url\",\n          \"full_name\",\n          \"git_commits_url\",\n          \"git_refs_url\",\n          \"git_tags_url\",\n          \"hooks_url\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"issue_comment_url\",\n          \"issue_events_url\",\n          \"issues_url\",\n          \"keys_url\",\n          \"labels_url\",\n          \"languages_url\",\n          \"merges_url\",\n          \"milestones_url\",\n          \"name\",\n          \"notifications_url\",\n          \"owner\",\n          \"private\",\n          \"pulls_url\",\n          \"releases_url\",\n          \"stargazers_url\",\n          \"statuses_url\",\n          \"subscribers_url\",\n          \"subscription_url\",\n          \"tags_url\",\n          \"teams_url\",\n          \"trees_url\",\n          \"url\",\n          \"clone_url\",\n          \"default_branch\",\n          \"forks\",\n          \"forks_count\",\n          \"git_url\",\n          \"has_downloads\",\n          \"has_issues\",\n          \"has_projects\",\n          \"has_wiki\",\n          \"has_pages\",\n          \"homepage\",\n          \"language\",\n          \"archived\",\n          \"disabled\",\n          \"mirror_url\",\n          \"open_issues\",\n          \"open_issues_count\",\n          \"license\",\n          \"pushed_at\",\n          \"size\",\n          \"ssh_url\",\n          \"stargazers_count\",\n          \"svn_url\",\n          \"watchers\",\n          \"watchers_count\",\n          \"created_at\",\n          \"updated_at\",\n          \"network_count\",\n          \"subscribers_count\"\n        ]\n      },\n      \"artifact\": {\n        \"title\": \"Artifact\",\n        \"description\": \"An artifact\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOkNoZWNrU3VpdGU1\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the artifact.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"AdventureWorks.Framework\"\n            ]\n          },\n          \"size_in_bytes\": {\n            \"description\": \"The size in bytes of the artifact.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              12345\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/artifacts/5\"\n            ]\n          },\n          \"archive_download_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip\"\n            ]\n          },\n          \"expired\": {\n            \"description\": \"Whether or not the artifact has expired.\",\n            \"type\": \"boolean\"\n          },\n          \"created_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"expires_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"name\",\n          \"size_in_bytes\",\n          \"url\",\n          \"archive_download_url\",\n          \"expired\",\n          \"created_at\",\n          \"expires_at\",\n          \"updated_at\"\n        ]\n      },\n      \"job\": {\n        \"title\": \"Job\",\n        \"description\": \"Information of a job execution in a workflow run\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"The id of the job.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              21\n            ]\n          },\n          \"run_id\": {\n            \"description\": \"The id of the associated workflow run.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"run_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/runs/5\"\n            ]\n          },\n          \"run_attempt\": {\n            \"type\": \"integer\",\n            \"description\": \"Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run.\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDg6Q2hlY2tSdW40\"\n            ]\n          },\n          \"head_sha\": {\n            \"description\": \"The SHA of the commit that is being run.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/jobs/21\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"https://github.com/github/hello-world/runs/4\"\n            ]\n          },\n          \"status\": {\n            \"description\": \"The phase of the lifecycle that the job is currently in.\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"queued\",\n              \"in_progress\",\n              \"completed\"\n            ],\n            \"examples\": [\n              \"queued\"\n            ]\n          },\n          \"conclusion\": {\n            \"description\": \"The outcome of the job.\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"success\"\n            ]\n          },\n          \"started_at\": {\n            \"description\": \"The time that the job started, in ISO 8601 format.\",\n            \"format\": \"date-time\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"2019-08-08T08:00:00-07:00\"\n            ]\n          },\n          \"completed_at\": {\n            \"description\": \"The time that the job finished, in ISO 8601 format.\",\n            \"format\": \"date-time\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"2019-08-08T08:00:00-07:00\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the job.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"test-coverage\"\n            ]\n          },\n          \"steps\": {\n            \"description\": \"Steps in this job.\",\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"required\": [\n                \"name\",\n                \"status\",\n                \"conclusion\",\n                \"number\"\n              ],\n              \"properties\": {\n                \"status\": {\n                  \"description\": \"The phase of the lifecycle that the job is currently in.\",\n                  \"type\": \"string\",\n                  \"enum\": [\n                    \"queued\",\n                    \"in_progress\",\n                    \"completed\"\n                  ],\n                  \"examples\": [\n                    \"queued\"\n                  ]\n                },\n                \"conclusion\": {\n                  \"description\": \"The outcome of the job.\",\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ],\n                  \"examples\": [\n                    \"success\"\n                  ]\n                },\n                \"name\": {\n                  \"description\": \"The name of the job.\",\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"test-coverage\"\n                  ]\n                },\n                \"number\": {\n                  \"type\": \"integer\",\n                  \"examples\": [\n                    1\n                  ]\n                },\n                \"started_at\": {\n                  \"description\": \"The time that the step started, in ISO 8601 format.\",\n                  \"format\": \"date-time\",\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ],\n                  \"examples\": [\n                    \"2019-08-08T08:00:00-07:00\"\n                  ]\n                },\n                \"completed_at\": {\n                  \"description\": \"The time that the job finished, in ISO 8601 format.\",\n                  \"format\": \"date-time\",\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ],\n                  \"examples\": [\n                    \"2019-08-08T08:00:00-07:00\"\n                  ]\n                }\n              }\n            }\n          },\n          \"check_run_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/check-runs/4\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"run_id\",\n          \"run_url\",\n          \"head_sha\",\n          \"name\",\n          \"url\",\n          \"html_url\",\n          \"status\",\n          \"conclusion\",\n          \"started_at\",\n          \"completed_at\",\n          \"check_run_url\"\n        ]\n      },\n      \"actions-enabled\": {\n        \"type\": \"boolean\",\n        \"description\": \"Whether GitHub Actions is enabled on the repository.\"\n      },\n      \"actions-repository-permissions\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"enabled\": {\n            \"$ref\": \"#/components/schemas/actions-enabled\"\n          },\n          \"allowed_actions\": {\n            \"$ref\": \"#/components/schemas/allowed-actions\"\n          },\n          \"selected_actions_url\": {\n            \"$ref\": \"#/components/schemas/selected-actions-url\"\n          }\n        },\n        \"required\": [\n          \"enabled\"\n        ]\n      },\n      \"pull-request-minimal\": {\n        \"title\": \"Pull Request Minimal\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"number\": {\n            \"type\": \"integer\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"head\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"ref\": {\n                \"type\": \"string\"\n              },\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"repo\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"id\": {\n                    \"type\": \"integer\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"id\",\n                  \"url\",\n                  \"name\"\n                ]\n              }\n            },\n            \"required\": [\n              \"ref\",\n              \"sha\",\n              \"repo\"\n            ]\n          },\n          \"base\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"ref\": {\n                \"type\": \"string\"\n              },\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"repo\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"id\": {\n                    \"type\": \"integer\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"id\",\n                  \"url\",\n                  \"name\"\n                ]\n              }\n            },\n            \"required\": [\n              \"ref\",\n              \"sha\",\n              \"repo\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"number\",\n          \"url\",\n          \"head\",\n          \"base\"\n        ]\n      },\n      \"simple-commit\": {\n        \"title\": \"Simple Commit\",\n        \"description\": \"Simple Commit\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"string\"\n          },\n          \"tree_id\": {\n            \"type\": \"string\"\n          },\n          \"message\": {\n            \"type\": \"string\"\n          },\n          \"timestamp\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"author\": {\n            \"type\": [\n              \"object\",\n              \"null\"\n            ],\n            \"properties\": {\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"email\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"name\",\n              \"email\"\n            ]\n          },\n          \"committer\": {\n            \"type\": [\n              \"object\",\n              \"null\"\n            ],\n            \"properties\": {\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"email\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"name\",\n              \"email\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"tree_id\",\n          \"message\",\n          \"timestamp\",\n          \"author\",\n          \"committer\"\n        ]\n      },\n      \"workflow-run\": {\n        \"title\": \"Workflow Run\",\n        \"description\": \"An invocation of a workflow\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"description\": \"The ID of the workflow run.\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"The name of the workflow run.\",\n            \"examples\": [\n              \"Build\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOkNoZWNrU3VpdGU1\"\n            ]\n          },\n          \"check_suite_id\": {\n            \"type\": \"integer\",\n            \"description\": \"The ID of the associated check suite.\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"check_suite_node_id\": {\n            \"type\": \"string\",\n            \"description\": \"The node ID of the associated check suite.\",\n            \"examples\": [\n              \"MDEwOkNoZWNrU3VpdGU0Mg==\"\n            ]\n          },\n          \"head_branch\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"master\"\n            ]\n          },\n          \"head_sha\": {\n            \"description\": \"The SHA of the head commit that points to the version of the workflow being run.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d\"\n            ]\n          },\n          \"run_number\": {\n            \"type\": \"integer\",\n            \"description\": \"The auto incrementing run number for the workflow run.\",\n            \"examples\": [\n              106\n            ]\n          },\n          \"run_attempt\": {\n            \"type\": \"integer\",\n            \"description\": \"Attempt number of the run, 1 for first attempt and higher if the workflow was re-run.\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"event\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"push\"\n            ]\n          },\n          \"status\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"completed\"\n            ]\n          },\n          \"conclusion\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"neutral\"\n            ]\n          },\n          \"workflow_id\": {\n            \"type\": \"integer\",\n            \"description\": \"The ID of the parent workflow.\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"description\": \"The URL to the workflow run.\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/runs/5\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/github/hello-world/suites/4\"\n            ]\n          },\n          \"pull_requests\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/pull-request-minimal\"\n            }\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"run_started_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"description\": \"The start time of the latest run. Resets on re-run.\"\n          },\n          \"jobs_url\": {\n            \"description\": \"The URL to the jobs for the workflow run.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/runs/5/jobs\"\n            ]\n          },\n          \"logs_url\": {\n            \"description\": \"The URL to download the logs for the workflow run.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/runs/5/logs\"\n            ]\n          },\n          \"check_suite_url\": {\n            \"description\": \"The URL to the associated check suite.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/check-suites/12\"\n            ]\n          },\n          \"artifacts_url\": {\n            \"description\": \"The URL to the artifacts for the workflow run.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts\"\n            ]\n          },\n          \"cancel_url\": {\n            \"description\": \"The URL to cancel the workflow run.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/runs/5/cancel\"\n            ]\n          },\n          \"rerun_url\": {\n            \"description\": \"The URL to rerun the workflow run.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/runs/5/rerun\"\n            ]\n          },\n          \"previous_attempt_url\": {\n            \"description\": \"The URL to the previous attempted run of this workflow, if one exists.\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/runs/5/attempts/3\"\n            ]\n          },\n          \"workflow_url\": {\n            \"description\": \"The URL to the workflow.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml\"\n            ]\n          },\n          \"head_commit\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-commit\"\n              }\n            ]\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          },\n          \"head_repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          },\n          \"head_repository_id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"head_branch\",\n          \"run_number\",\n          \"event\",\n          \"status\",\n          \"conclusion\",\n          \"head_sha\",\n          \"workflow_id\",\n          \"url\",\n          \"html_url\",\n          \"created_at\",\n          \"updated_at\",\n          \"head_commit\",\n          \"head_repository\",\n          \"repository\",\n          \"jobs_url\",\n          \"logs_url\",\n          \"check_suite_url\",\n          \"cancel_url\",\n          \"rerun_url\",\n          \"artifacts_url\",\n          \"workflow_url\",\n          \"pull_requests\"\n        ]\n      },\n      \"actions-secret\": {\n        \"title\": \"Actions Secret\",\n        \"description\": \"Set secrets for GitHub Actions.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"description\": \"The name of the secret.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"SECRET_TOKEN\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"workflow\": {\n        \"title\": \"Workflow\",\n        \"description\": \"A GitHub Actions workflow\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDg6V29ya2Zsb3cxMg==\"\n            ]\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"CI\"\n            ]\n          },\n          \"path\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"ruby.yaml\"\n            ]\n          },\n          \"state\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"active\",\n              \"deleted\",\n              \"disabled_fork\",\n              \"disabled_inactivity\",\n              \"disabled_manually\"\n            ],\n            \"examples\": [\n              \"active\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2019-12-06T14:20:20.000Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2019-12-06T14:20:20.000Z\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/actions/setup-ruby/workflows/5\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml\"\n            ]\n          },\n          \"badge_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/actions/setup-ruby/workflows/CI/badge.svg\"\n            ]\n          },\n          \"deleted_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2019-12-06T14:20:20.000Z\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"name\",\n          \"path\",\n          \"state\",\n          \"url\",\n          \"html_url\",\n          \"badge_url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"protected-branch-required-status-check\": {\n        \"title\": \"Protected Branch Required Status Check\",\n        \"description\": \"Protected Branch Required Status Check\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"enforcement_level\": {\n            \"type\": \"string\"\n          },\n          \"contexts\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"contexts_url\": {\n            \"type\": \"string\"\n          },\n          \"strict\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"contexts\"\n        ]\n      },\n      \"protected-branch-admin-enforced\": {\n        \"title\": \"Protected Branch Admin Enforced\",\n        \"description\": \"Protected Branch Admin Enforced\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins\"\n            ]\n          },\n          \"enabled\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"enabled\"\n        ]\n      },\n      \"protected-branch-pull-request-review\": {\n        \"title\": \"Protected Branch Pull Request Review\",\n        \"description\": \"Protected Branch Pull Request Review\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions\"\n            ]\n          },\n          \"dismissal_restrictions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"users\": {\n                \"description\": \"The list of users with review dismissal access.\",\n                \"type\": \"array\",\n                \"items\": {\n                  \"$ref\": \"#/components/schemas/simple-user\"\n                }\n              },\n              \"teams\": {\n                \"description\": \"The list of teams with review dismissal access.\",\n                \"type\": \"array\",\n                \"items\": {\n                  \"$ref\": \"#/components/schemas/team\"\n                }\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions\\\"\"\n                ]\n              },\n              \"users_url\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users\\\"\"\n                ]\n              },\n              \"teams_url\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams\\\"\"\n                ]\n              }\n            }\n          },\n          \"dismiss_stale_reviews\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"require_code_owner_reviews\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"required_approving_review_count\": {\n            \"type\": \"integer\",\n            \"minimum\": 1,\n            \"maximum\": 6,\n            \"examples\": [\n              2\n            ]\n          }\n        },\n        \"required\": [\n          \"dismiss_stale_reviews\",\n          \"require_code_owner_reviews\"\n        ]\n      },\n      \"branch-restriction-policy\": {\n        \"title\": \"Branch Restriction Policy\",\n        \"description\": \"Branch Restriction Policy\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"users_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"teams_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"apps_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"users\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"login\": {\n                  \"type\": \"string\"\n                },\n                \"id\": {\n                  \"type\": \"integer\"\n                },\n                \"node_id\": {\n                  \"type\": \"string\"\n                },\n                \"avatar_url\": {\n                  \"type\": \"string\"\n                },\n                \"gravatar_id\": {\n                  \"type\": \"string\"\n                },\n                \"url\": {\n                  \"type\": \"string\"\n                },\n                \"html_url\": {\n                  \"type\": \"string\"\n                },\n                \"followers_url\": {\n                  \"type\": \"string\"\n                },\n                \"following_url\": {\n                  \"type\": \"string\"\n                },\n                \"gists_url\": {\n                  \"type\": \"string\"\n                },\n                \"starred_url\": {\n                  \"type\": \"string\"\n                },\n                \"subscriptions_url\": {\n                  \"type\": \"string\"\n                },\n                \"organizations_url\": {\n                  \"type\": \"string\"\n                },\n                \"repos_url\": {\n                  \"type\": \"string\"\n                },\n                \"events_url\": {\n                  \"type\": \"string\"\n                },\n                \"received_events_url\": {\n                  \"type\": \"string\"\n                },\n                \"type\": {\n                  \"type\": \"string\"\n                },\n                \"site_admin\": {\n                  \"type\": \"boolean\"\n                }\n              }\n            }\n          },\n          \"teams\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"integer\"\n                },\n                \"node_id\": {\n                  \"type\": \"string\"\n                },\n                \"url\": {\n                  \"type\": \"string\"\n                },\n                \"html_url\": {\n                  \"type\": \"string\"\n                },\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"slug\": {\n                  \"type\": \"string\"\n                },\n                \"description\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ]\n                },\n                \"privacy\": {\n                  \"type\": \"string\"\n                },\n                \"permission\": {\n                  \"type\": \"string\"\n                },\n                \"members_url\": {\n                  \"type\": \"string\"\n                },\n                \"repositories_url\": {\n                  \"type\": \"string\"\n                },\n                \"parent\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ]\n                }\n              }\n            }\n          },\n          \"apps\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"integer\"\n                },\n                \"slug\": {\n                  \"type\": \"string\"\n                },\n                \"node_id\": {\n                  \"type\": \"string\"\n                },\n                \"owner\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"login\": {\n                      \"type\": \"string\"\n                    },\n                    \"id\": {\n                      \"type\": \"integer\"\n                    },\n                    \"node_id\": {\n                      \"type\": \"string\"\n                    },\n                    \"url\": {\n                      \"type\": \"string\"\n                    },\n                    \"repos_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"events_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"hooks_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"issues_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"members_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"public_members_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"avatar_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"description\": {\n                      \"type\": \"string\"\n                    },\n                    \"gravatar_id\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"\\\"\"\n                      ]\n                    },\n                    \"html_url\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"https://github.com/testorg-ea8ec76d71c3af4b\\\"\"\n                      ]\n                    },\n                    \"followers_url\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers\\\"\"\n                      ]\n                    },\n                    \"following_url\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}\\\"\"\n                      ]\n                    },\n                    \"gists_url\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}\\\"\"\n                      ]\n                    },\n                    \"starred_url\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}\\\"\"\n                      ]\n                    },\n                    \"subscriptions_url\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions\\\"\"\n                      ]\n                    },\n                    \"organizations_url\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs\\\"\"\n                      ]\n                    },\n                    \"received_events_url\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events\\\"\"\n                      ]\n                    },\n                    \"type\": {\n                      \"type\": \"string\",\n                      \"examples\": [\n                        \"\\\"Organization\\\"\"\n                      ]\n                    },\n                    \"site_admin\": {\n                      \"type\": \"boolean\",\n                      \"examples\": [\n                        false\n                      ]\n                    }\n                  }\n                },\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"description\": {\n                  \"type\": \"string\"\n                },\n                \"external_url\": {\n                  \"type\": \"string\"\n                },\n                \"html_url\": {\n                  \"type\": \"string\"\n                },\n                \"created_at\": {\n                  \"type\": \"string\"\n                },\n                \"updated_at\": {\n                  \"type\": \"string\"\n                },\n                \"permissions\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"metadata\": {\n                      \"type\": \"string\"\n                    },\n                    \"contents\": {\n                      \"type\": \"string\"\n                    },\n                    \"issues\": {\n                      \"type\": \"string\"\n                    },\n                    \"single_file\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                },\n                \"events\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"users_url\",\n          \"teams_url\",\n          \"apps_url\",\n          \"users\",\n          \"teams\",\n          \"apps\"\n        ]\n      },\n      \"branch-protection\": {\n        \"title\": \"Branch Protection\",\n        \"description\": \"Branch Protection\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"enabled\": {\n            \"type\": \"boolean\"\n          },\n          \"required_status_checks\": {\n            \"$ref\": \"#/components/schemas/protected-branch-required-status-check\"\n          },\n          \"enforce_admins\": {\n            \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n          },\n          \"required_pull_request_reviews\": {\n            \"$ref\": \"#/components/schemas/protected-branch-pull-request-review\"\n          },\n          \"restrictions\": {\n            \"$ref\": \"#/components/schemas/branch-restriction-policy\"\n          },\n          \"required_linear_history\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            }\n          },\n          \"allow_force_pushes\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            }\n          },\n          \"allow_deletions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            }\n          },\n          \"required_conversation_resolution\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            }\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"branch/with/protection\\\"\"\n            ]\n          },\n          \"protection_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection\\\"\"\n            ]\n          },\n          \"required_signatures\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\",\n                \"examples\": [\n                  \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures\"\n                ]\n              },\n              \"enabled\": {\n                \"type\": \"boolean\",\n                \"examples\": [\n                  true\n                ]\n              }\n            },\n            \"required\": [\n              \"url\",\n              \"enabled\"\n            ]\n          }\n        }\n      },\n      \"short-branch\": {\n        \"title\": \"Short Branch\",\n        \"description\": \"Short Branch\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"commit\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"sha\",\n              \"url\"\n            ]\n          },\n          \"protected\": {\n            \"type\": \"boolean\"\n          },\n          \"protection\": {\n            \"$ref\": \"#/components/schemas/branch-protection\"\n          },\n          \"protection_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"commit\",\n          \"protected\"\n        ]\n      },\n      \"git-user\": {\n        \"title\": \"Git User\",\n        \"description\": \"Metaproperties for Git author/committer information.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"Chris Wanstrath\\\"\"\n            ]\n          },\n          \"email\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"chris@ozmm.org\\\"\"\n            ]\n          },\n          \"date\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"2007-10-29T02:42:39.000-07:00\\\"\"\n            ]\n          }\n        }\n      },\n      \"verification\": {\n        \"title\": \"Verification\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"verified\": {\n            \"type\": \"boolean\"\n          },\n          \"reason\": {\n            \"type\": \"string\"\n          },\n          \"payload\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"signature\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          }\n        },\n        \"required\": [\n          \"verified\",\n          \"reason\",\n          \"payload\",\n          \"signature\"\n        ]\n      },\n      \"diff-entry\": {\n        \"title\": \"Diff Entry\",\n        \"description\": \"Diff Entry\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"sha\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"bbcd538c8e72b8c175046e27cc8f907076331401\"\n            ]\n          },\n          \"filename\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"file1.txt\"\n            ]\n          },\n          \"status\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"added\",\n              \"removed\",\n              \"modified\",\n              \"renamed\",\n              \"copied\",\n              \"changed\",\n              \"unchanged\"\n            ],\n            \"examples\": [\n              \"added\"\n            ]\n          },\n          \"additions\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              103\n            ]\n          },\n          \"deletions\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              21\n            ]\n          },\n          \"changes\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              124\n            ]\n          },\n          \"blob_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\"\n            ]\n          },\n          \"raw_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\"\n            ]\n          },\n          \"contents_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"patch\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"\n            ]\n          },\n          \"previous_filename\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"file.txt\"\n            ]\n          }\n        },\n        \"required\": [\n          \"additions\",\n          \"blob_url\",\n          \"changes\",\n          \"contents_url\",\n          \"deletions\",\n          \"filename\",\n          \"raw_url\",\n          \"sha\",\n          \"status\"\n        ]\n      },\n      \"commit\": {\n        \"title\": \"Commit\",\n        \"description\": \"Commit\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"sha\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\"\n            ]\n          },\n          \"commit\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\",\n                \"examples\": [\n                  \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n                ]\n              },\n              \"author\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"null\"\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/git-user\"\n                  }\n                ]\n              },\n              \"committer\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"null\"\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/git-user\"\n                  }\n                ]\n              },\n              \"message\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"Fix all the bugs\"\n                ]\n              },\n              \"comment_count\": {\n                \"type\": \"integer\",\n                \"examples\": [\n                  0\n                ]\n              },\n              \"tree\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"sha\": {\n                    \"type\": \"string\",\n                    \"examples\": [\n                      \"827efc6d56897b048c772eb4087f854f46256132\"\n                    ]\n                  },\n                  \"url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\",\n                    \"examples\": [\n                      \"https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"sha\",\n                  \"url\"\n                ]\n              },\n              \"verification\": {\n                \"$ref\": \"#/components/schemas/verification\"\n              }\n            },\n            \"required\": [\n              \"author\",\n              \"committer\",\n              \"comment_count\",\n              \"message\",\n              \"tree\",\n              \"url\"\n            ]\n          },\n          \"author\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"committer\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"parents\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"sha\": {\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"7638417db6d59f3c431d3e1f261cc637155684cd\"\n                  ]\n                },\n                \"url\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\",\n                  \"examples\": [\n                    \"https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd\"\n                  ]\n                },\n                \"html_url\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\",\n                  \"examples\": [\n                    \"https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd\"\n                  ]\n                }\n              },\n              \"required\": [\n                \"sha\",\n                \"url\"\n              ]\n            }\n          },\n          \"stats\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"additions\": {\n                \"type\": \"integer\"\n              },\n              \"deletions\": {\n                \"type\": \"integer\"\n              },\n              \"total\": {\n                \"type\": \"integer\"\n              }\n            }\n          },\n          \"files\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/diff-entry\"\n            }\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"sha\",\n          \"node_id\",\n          \"html_url\",\n          \"comments_url\",\n          \"commit\",\n          \"author\",\n          \"committer\",\n          \"parents\"\n        ]\n      },\n      \"branch-with-protection\": {\n        \"title\": \"Branch With Protection\",\n        \"description\": \"Branch With Protection\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"commit\": {\n            \"$ref\": \"#/components/schemas/commit\"\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"html\": {\n                \"type\": \"string\"\n              },\n              \"self\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"html\",\n              \"self\"\n            ]\n          },\n          \"protected\": {\n            \"type\": \"boolean\"\n          },\n          \"protection\": {\n            \"$ref\": \"#/components/schemas/branch-protection\"\n          },\n          \"protection_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"pattern\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"mas*\\\"\"\n            ]\n          },\n          \"required_approving_review_count\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"commit\",\n          \"_links\",\n          \"protection\",\n          \"protected\",\n          \"protection_url\"\n        ]\n      },\n      \"status-check-policy\": {\n        \"title\": \"Status Check Policy\",\n        \"description\": \"Status Check Policy\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks\"\n            ]\n          },\n          \"strict\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"contexts\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"continuous-integration/travis-ci\"\n            ]\n          },\n          \"contexts_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts\"\n            ]\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"contexts_url\",\n          \"strict\",\n          \"contexts\"\n        ]\n      },\n      \"protected-branch\": {\n        \"title\": \"Protected Branch\",\n        \"description\": \"Branch protections protect branches\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"required_status_checks\": {\n            \"$ref\": \"#/components/schemas/status-check-policy\"\n          },\n          \"required_pull_request_reviews\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"dismiss_stale_reviews\": {\n                \"type\": \"boolean\"\n              },\n              \"require_code_owner_reviews\": {\n                \"type\": \"boolean\"\n              },\n              \"required_approving_review_count\": {\n                \"type\": \"integer\"\n              },\n              \"dismissal_restrictions\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"users_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"teams_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"users\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"$ref\": \"#/components/schemas/simple-user\"\n                    }\n                  },\n                  \"teams\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"$ref\": \"#/components/schemas/team\"\n                    }\n                  }\n                },\n                \"required\": [\n                  \"url\",\n                  \"users_url\",\n                  \"teams_url\",\n                  \"users\",\n                  \"teams\"\n                ]\n              }\n            },\n            \"required\": [\n              \"url\"\n            ]\n          },\n          \"required_signatures\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\",\n                \"examples\": [\n                  \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures\"\n                ]\n              },\n              \"enabled\": {\n                \"type\": \"boolean\",\n                \"examples\": [\n                  true\n                ]\n              }\n            },\n            \"required\": [\n              \"url\",\n              \"enabled\"\n            ]\n          },\n          \"enforce_admins\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"additionalProperties\": false,\n            \"required\": [\n              \"url\",\n              \"enabled\"\n            ]\n          },\n          \"required_linear_history\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"additionalProperties\": false,\n            \"required\": [\n              \"enabled\"\n            ]\n          },\n          \"allow_force_pushes\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"additionalProperties\": false,\n            \"required\": [\n              \"enabled\"\n            ]\n          },\n          \"allow_deletions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"additionalProperties\": false,\n            \"required\": [\n              \"enabled\"\n            ]\n          },\n          \"restrictions\": {\n            \"$ref\": \"#/components/schemas/branch-restriction-policy\"\n          },\n          \"required_conversation_resolution\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"enabled\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"additionalProperties\": false\n          }\n        },\n        \"required\": [\n          \"url\"\n        ]\n      },\n      \"deployment-simple\": {\n        \"title\": \"Deployment\",\n        \"description\": \"A deployment created as the result of an Actions check run from a workflow that references an environment\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example/deployments/1\"\n            ]\n          },\n          \"id\": {\n            \"description\": \"Unique identifier of the deployment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOkRlcGxveW1lbnQx\"\n            ]\n          },\n          \"task\": {\n            \"description\": \"Parameter to specify a task to execute\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"deploy\"\n            ]\n          },\n          \"original_environment\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"staging\"\n            ]\n          },\n          \"environment\": {\n            \"description\": \"Name for the target deployment environment.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"production\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Deploy request from hubot\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-07-20T01:19:13Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-07-20T01:19:13Z\"\n            ]\n          },\n          \"statuses_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example/deployments/1/statuses\"\n            ]\n          },\n          \"repository_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example\"\n            ]\n          },\n          \"transient_environment\": {\n            \"description\": \"Specifies if the given environment is will no longer exist at some point in the future. Default: false.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"production_environment\": {\n            \"description\": \"Specifies if the given environment is one that end-users directly interact with. Default: false.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"task\",\n          \"environment\",\n          \"description\",\n          \"statuses_url\",\n          \"repository_url\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"check-run\": {\n        \"title\": \"CheckRun\",\n        \"description\": \"A check performed on the code of a given code change\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"The id of the check.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              21\n            ]\n          },\n          \"head_sha\": {\n            \"description\": \"The SHA of the commit that is being checked.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDg6Q2hlY2tSdW40\"\n            ]\n          },\n          \"external_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"42\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/check-runs/4\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"https://github.com/github/hello-world/runs/4\"\n            ]\n          },\n          \"details_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"https://example.com\"\n            ]\n          },\n          \"status\": {\n            \"description\": \"The phase of the lifecycle that the check is currently in.\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"queued\",\n              \"in_progress\",\n              \"completed\"\n            ],\n            \"examples\": [\n              \"queued\"\n            ]\n          },\n          \"conclusion\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"enum\": [\n              \"success\",\n              \"failure\",\n              \"neutral\",\n              \"cancelled\",\n              \"skipped\",\n              \"timed_out\",\n              \"action_required\",\n              null\n            ],\n            \"examples\": [\n              \"neutral\"\n            ]\n          },\n          \"started_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2018-05-04T01:14:52Z\"\n            ]\n          },\n          \"completed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2018-05-04T01:14:52Z\"\n            ]\n          },\n          \"output\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"title\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"summary\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"text\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"annotations_count\": {\n                \"type\": \"integer\"\n              },\n              \"annotations_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"title\",\n              \"summary\",\n              \"text\",\n              \"annotations_count\",\n              \"annotations_url\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the check.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"test-coverage\"\n            ]\n          },\n          \"check_suite\": {\n            \"type\": [\n              \"object\",\n              \"null\"\n            ],\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              }\n            },\n            \"required\": [\n              \"id\"\n            ]\n          },\n          \"app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"pull_requests\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/pull-request-minimal\"\n            }\n          },\n          \"deployment\": {\n            \"$ref\": \"#/components/schemas/deployment-simple\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"head_sha\",\n          \"name\",\n          \"url\",\n          \"html_url\",\n          \"details_url\",\n          \"status\",\n          \"conclusion\",\n          \"started_at\",\n          \"completed_at\",\n          \"external_id\",\n          \"check_suite\",\n          \"output\",\n          \"app\",\n          \"pull_requests\"\n        ]\n      },\n      \"check-annotation\": {\n        \"title\": \"Check Annotation\",\n        \"description\": \"Check Annotation\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"path\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"README.md\"\n            ]\n          },\n          \"start_line\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"end_line\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"start_column\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              5\n            ]\n          },\n          \"end_column\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              10\n            ]\n          },\n          \"annotation_level\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"warning\"\n            ]\n          },\n          \"title\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Spell Checker\"\n            ]\n          },\n          \"message\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Check your spelling for 'banaas'.\"\n            ]\n          },\n          \"raw_details\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Do you mean 'bananas' or 'banana'?\"\n            ]\n          },\n          \"blob_href\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"path\",\n          \"blob_href\",\n          \"start_line\",\n          \"end_line\",\n          \"start_column\",\n          \"end_column\",\n          \"annotation_level\",\n          \"title\",\n          \"message\",\n          \"raw_details\"\n        ]\n      },\n      \"check-suite\": {\n        \"title\": \"CheckSuite\",\n        \"description\": \"A suite of checks performed on the code of a given code change\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOkNoZWNrU3VpdGU1\"\n            ]\n          },\n          \"head_branch\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"master\"\n            ]\n          },\n          \"head_sha\": {\n            \"description\": \"The SHA of the head commit that is being checked.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d\"\n            ]\n          },\n          \"status\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"enum\": [\n              \"queued\",\n              \"in_progress\",\n              \"completed\",\n              null\n            ],\n            \"examples\": [\n              \"completed\"\n            ]\n          },\n          \"conclusion\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"enum\": [\n              \"success\",\n              \"failure\",\n              \"neutral\",\n              \"cancelled\",\n              \"skipped\",\n              \"timed_out\",\n              \"action_required\",\n              null\n            ],\n            \"examples\": [\n              \"neutral\"\n            ]\n          },\n          \"url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/check-suites/5\"\n            ]\n          },\n          \"before\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"146e867f55c26428e5f9fade55a9bbf5e95a7912\"\n            ]\n          },\n          \"after\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"d6fde92930d4715a2b49857d24b940956b26d2d3\"\n            ]\n          },\n          \"pull_requests\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/pull-request-minimal\"\n            }\n          },\n          \"app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          },\n          \"created_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"head_commit\": {\n            \"$ref\": \"#/components/schemas/simple-commit\"\n          },\n          \"latest_check_runs_count\": {\n            \"type\": \"integer\"\n          },\n          \"check_runs_url\": {\n            \"type\": \"string\"\n          },\n          \"rerequestable\": {\n            \"type\": \"boolean\"\n          },\n          \"runs_rerequestable\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"head_branch\",\n          \"status\",\n          \"conclusion\",\n          \"head_sha\",\n          \"url\",\n          \"before\",\n          \"after\",\n          \"created_at\",\n          \"updated_at\",\n          \"app\",\n          \"head_commit\",\n          \"repository\",\n          \"latest_check_runs_count\",\n          \"check_runs_url\",\n          \"pull_requests\"\n        ]\n      },\n      \"check-suite-preference\": {\n        \"title\": \"Check Suite Preference\",\n        \"description\": \"Check suite configuration preferences for a repository.\",\n        \"type\": \"object\",\n        \"required\": [\n          \"preferences\",\n          \"repository\"\n        ],\n        \"properties\": {\n          \"preferences\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"auto_trigger_checks\": {\n                \"type\": \"array\",\n                \"items\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"app_id\": {\n                      \"type\": \"integer\"\n                    },\n                    \"setting\": {\n                      \"type\": \"boolean\"\n                    }\n                  },\n                  \"required\": [\n                    \"app_id\",\n                    \"setting\"\n                  ]\n                }\n              }\n            }\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          }\n        }\n      },\n      \"code-scanning-analysis-tool-name\": {\n        \"type\": \"string\",\n        \"description\": \"The name of the tool used to generate the code scanning analysis.\"\n      },\n      \"code-scanning-analysis-tool-guid\": {\n        \"type\": [\n          \"string\",\n          \"null\"\n        ],\n        \"description\": \"The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data.\"\n      },\n      \"code-scanning-ref\": {\n        \"type\": \"string\",\n        \"description\": \"The full Git reference, formatted as `refs/heads/<branch name>`,\\n`refs/pull/<number>/merge`, or `refs/pull/<number>/head`.\"\n      },\n      \"code-scanning-alert-state\": {\n        \"type\": \"string\",\n        \"description\": \"State of a code scanning alert.\",\n        \"enum\": [\n          \"open\",\n          \"closed\",\n          \"dismissed\",\n          \"fixed\"\n        ]\n      },\n      \"alert-number\": {\n        \"type\": \"integer\",\n        \"description\": \"The security alert number.\",\n        \"readOnly\": true\n      },\n      \"alert-created-at\": {\n        \"type\": \"string\",\n        \"description\": \"The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.\",\n        \"format\": \"date-time\",\n        \"readOnly\": true\n      },\n      \"alert-url\": {\n        \"type\": \"string\",\n        \"description\": \"The REST API URL of the alert resource.\",\n        \"format\": \"uri\",\n        \"readOnly\": true\n      },\n      \"alert-html-url\": {\n        \"type\": \"string\",\n        \"description\": \"The GitHub URL of the alert resource.\",\n        \"format\": \"uri\",\n        \"readOnly\": true\n      },\n      \"alert-instances-url\": {\n        \"type\": \"string\",\n        \"description\": \"The REST API URL for fetching the list of instances for an alert.\",\n        \"format\": \"uri\",\n        \"readOnly\": true\n      },\n      \"code-scanning-alert-dismissed-at\": {\n        \"type\": [\n          \"string\",\n          \"null\"\n        ],\n        \"description\": \"The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.\",\n        \"format\": \"date-time\",\n        \"readOnly\": true\n      },\n      \"code-scanning-alert-dismissed-reason\": {\n        \"type\": [\n          \"string\",\n          \"null\"\n        ],\n        \"description\": \"**Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`.\",\n        \"enum\": [\n          null,\n          \"false positive\",\n          \"won't fix\",\n          \"used in tests\"\n        ]\n      },\n      \"code-scanning-alert-rule-summary\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"A unique identifier for the rule used to detect the alert.\"\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"description\": \"The name of the rule used to detect the alert.\"\n          },\n          \"severity\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"The severity of the alert.\",\n            \"enum\": [\n              \"none\",\n              \"note\",\n              \"warning\",\n              \"error\",\n              null\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\",\n            \"description\": \"A short description of the rule used to detect the alert.\"\n          }\n        }\n      },\n      \"code-scanning-analysis-tool-version\": {\n        \"type\": [\n          \"string\",\n          \"null\"\n        ],\n        \"description\": \"The version of the tool used to generate the code scanning analysis.\"\n      },\n      \"code-scanning-analysis-tool\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-name\"\n          },\n          \"version\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-version\"\n          },\n          \"guid\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-guid\"\n          }\n        }\n      },\n      \"code-scanning-analysis-analysis-key\": {\n        \"type\": \"string\",\n        \"description\": \"Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.\"\n      },\n      \"code-scanning-alert-environment\": {\n        \"type\": \"string\",\n        \"description\": \"Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed.\"\n      },\n      \"code-scanning-analysis-category\": {\n        \"type\": \"string\",\n        \"description\": \"Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code.\"\n      },\n      \"code-scanning-alert-location\": {\n        \"type\": \"object\",\n        \"description\": \"Describe a region within a file for the alert.\",\n        \"properties\": {\n          \"path\": {\n            \"type\": \"string\"\n          },\n          \"start_line\": {\n            \"type\": \"integer\"\n          },\n          \"end_line\": {\n            \"type\": \"integer\"\n          },\n          \"start_column\": {\n            \"type\": \"integer\"\n          },\n          \"end_column\": {\n            \"type\": \"integer\"\n          }\n        }\n      },\n      \"code-scanning-alert-classification\": {\n        \"type\": [\n          \"string\",\n          \"null\"\n        ],\n        \"description\": \"A classification of the file. For example to identify it as generated.\",\n        \"enum\": [\n          \"source\",\n          \"generated\",\n          \"test\",\n          \"library\",\n          null\n        ]\n      },\n      \"code-scanning-alert-instance\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"ref\": {\n            \"$ref\": \"#/components/schemas/code-scanning-ref\"\n          },\n          \"analysis_key\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-analysis-key\"\n          },\n          \"environment\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-environment\"\n          },\n          \"category\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-category\"\n          },\n          \"state\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-state\"\n          },\n          \"commit_sha\": {\n            \"type\": \"string\"\n          },\n          \"message\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"text\": {\n                \"type\": \"string\"\n              }\n            }\n          },\n          \"location\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-location\"\n          },\n          \"html_url\": {\n            \"type\": \"string\"\n          },\n          \"classifications\": {\n            \"type\": \"array\",\n            \"description\": \"Classifications that have been applied to the file that triggered the alert.\\nFor example identifying it as documentation, or a generated file.\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/code-scanning-alert-classification\"\n            }\n          }\n        }\n      },\n      \"code-scanning-alert-items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"number\": {\n            \"$ref\": \"#/components/schemas/alert-number\"\n          },\n          \"created_at\": {\n            \"$ref\": \"#/components/schemas/alert-created-at\"\n          },\n          \"url\": {\n            \"$ref\": \"#/components/schemas/alert-url\"\n          },\n          \"html_url\": {\n            \"$ref\": \"#/components/schemas/alert-html-url\"\n          },\n          \"instances_url\": {\n            \"$ref\": \"#/components/schemas/alert-instances-url\"\n          },\n          \"state\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-state\"\n          },\n          \"dismissed_by\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"dismissed_at\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-at\"\n          },\n          \"dismissed_reason\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-reason\"\n          },\n          \"rule\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-rule-summary\"\n          },\n          \"tool\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-tool\"\n          },\n          \"most_recent_instance\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-instance\"\n          }\n        },\n        \"required\": [\n          \"number\",\n          \"created_at\",\n          \"url\",\n          \"html_url\",\n          \"instances_url\",\n          \"state\",\n          \"dismissed_by\",\n          \"dismissed_at\",\n          \"dismissed_reason\",\n          \"rule\",\n          \"tool\",\n          \"most_recent_instance\"\n        ]\n      },\n      \"code-scanning-alert-rule\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"A unique identifier for the rule used to detect the alert.\"\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"description\": \"The name of the rule used to detect the alert.\"\n          },\n          \"severity\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"The severity of the alert.\",\n            \"enum\": [\n              \"none\",\n              \"note\",\n              \"warning\",\n              \"error\",\n              null\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\",\n            \"description\": \"A short description of the rule used to detect the alert.\"\n          },\n          \"full_description\": {\n            \"type\": \"string\",\n            \"description\": \"description of the rule used to detect the alert.\"\n          },\n          \"tags\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"description\": \"A set of tags applicable for the rule.\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"help\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"Detailed documentation for the rule as GitHub Flavored Markdown.\"\n          }\n        }\n      },\n      \"code-scanning-alert\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"number\": {\n            \"$ref\": \"#/components/schemas/alert-number\"\n          },\n          \"created_at\": {\n            \"$ref\": \"#/components/schemas/alert-created-at\"\n          },\n          \"url\": {\n            \"$ref\": \"#/components/schemas/alert-url\"\n          },\n          \"html_url\": {\n            \"$ref\": \"#/components/schemas/alert-html-url\"\n          },\n          \"instances_url\": {\n            \"$ref\": \"#/components/schemas/alert-instances-url\"\n          },\n          \"state\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-state\"\n          },\n          \"dismissed_by\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"dismissed_at\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-at\"\n          },\n          \"dismissed_reason\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-reason\"\n          },\n          \"rule\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-rule\"\n          },\n          \"tool\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-tool\"\n          },\n          \"most_recent_instance\": {\n            \"$ref\": \"#/components/schemas/code-scanning-alert-instance\"\n          },\n          \"instances\": {\n            \"deprecated\": true\n          }\n        },\n        \"required\": [\n          \"number\",\n          \"created_at\",\n          \"url\",\n          \"html_url\",\n          \"instances_url\",\n          \"state\",\n          \"dismissed_by\",\n          \"dismissed_at\",\n          \"dismissed_reason\",\n          \"rule\",\n          \"tool\",\n          \"most_recent_instance\"\n        ]\n      },\n      \"code-scanning-alert-set-state\": {\n        \"description\": \"Sets the state of the code scanning alert. Can be one of `open` or `dismissed`. You must provide `dismissed_reason` when you set the state to `dismissed`.\",\n        \"type\": \"string\",\n        \"enum\": [\n          \"open\",\n          \"dismissed\"\n        ]\n      },\n      \"code-scanning-analysis-sarif-id\": {\n        \"type\": \"string\",\n        \"description\": \"An identifier for the upload.\",\n        \"examples\": [\n          \"6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53\"\n        ]\n      },\n      \"code-scanning-analysis-commit-sha\": {\n        \"description\": \"The SHA of the commit to which the analysis you are uploading relates.\",\n        \"type\": \"string\",\n        \"minLength\": 40,\n        \"maxLength\": 40,\n        \"pattern\": \"^[0-9a-fA-F]+$\"\n      },\n      \"code-scanning-analysis-environment\": {\n        \"type\": \"string\",\n        \"description\": \"Identifies the variable values associated with the environment in which this analysis was performed.\"\n      },\n      \"code-scanning-analysis-created-at\": {\n        \"type\": \"string\",\n        \"description\": \"The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.\",\n        \"format\": \"date-time\",\n        \"readOnly\": true\n      },\n      \"code-scanning-analysis-url\": {\n        \"type\": \"string\",\n        \"description\": \"The REST API URL of the analysis resource.\",\n        \"format\": \"uri\",\n        \"readOnly\": true\n      },\n      \"code-scanning-analysis\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"ref\": {\n            \"$ref\": \"#/components/schemas/code-scanning-ref\"\n          },\n          \"commit_sha\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-commit-sha\"\n          },\n          \"analysis_key\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-analysis-key\"\n          },\n          \"environment\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-environment\"\n          },\n          \"category\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-category\"\n          },\n          \"error\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"error reading field xyz\"\n            ]\n          },\n          \"created_at\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-created-at\"\n          },\n          \"results_count\": {\n            \"type\": \"integer\",\n            \"description\": \"The total number of results in the analysis.\"\n          },\n          \"rules_count\": {\n            \"type\": \"integer\",\n            \"description\": \"The total number of rules used in the analysis.\"\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"description\": \"Unique identifier for this analysis.\"\n          },\n          \"url\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-url\"\n          },\n          \"sarif_id\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-sarif-id\"\n          },\n          \"tool\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-tool\"\n          },\n          \"deletable\": {\n            \"type\": \"boolean\"\n          },\n          \"warning\": {\n            \"type\": \"string\",\n            \"description\": \"Warning generated when processing the analysis\",\n            \"examples\": [\n              \"123 results were ignored\"\n            ]\n          },\n          \"tool_name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"ref\",\n          \"commit_sha\",\n          \"analysis_key\",\n          \"environment\",\n          \"error\",\n          \"created_at\",\n          \"results_count\",\n          \"rules_count\",\n          \"id\",\n          \"url\",\n          \"sarif_id\",\n          \"tool\",\n          \"deletable\",\n          \"warning\"\n        ]\n      },\n      \"code-scanning-analysis-sarif-file\": {\n        \"description\": \"A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see \\\"[SARIF support for code scanning](https://docs.github.com/enterprise-server@3.0/code-security/secure-coding/sarif-support-for-code-scanning).\\\"\",\n        \"type\": \"string\"\n      },\n      \"code-scanning-sarifs-receipt\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"$ref\": \"#/components/schemas/code-scanning-analysis-sarif-id\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"description\": \"The REST API URL for checking the status of the upload.\",\n            \"format\": \"uri\",\n            \"readOnly\": true\n          }\n        }\n      },\n      \"collaborator\": {\n        \"title\": \"Collaborator\",\n        \"description\": \"Collaborator\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"login\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"octocat\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"email\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDQ6VXNlcjE=\"\n            ]\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/images/error/octocat_happy.gif\"\n            ]\n          },\n          \"gravatar_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"41d064eb2195891e12d0413f63227ea7\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat\"\n            ]\n          },\n          \"followers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/followers\"\n            ]\n          },\n          \"following_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/following{/other_user}\"\n            ]\n          },\n          \"gists_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/gists{/gist_id}\"\n            ]\n          },\n          \"starred_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/starred{/owner}{/repo}\"\n            ]\n          },\n          \"subscriptions_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/subscriptions\"\n            ]\n          },\n          \"organizations_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/orgs\"\n            ]\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/repos\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/events{/privacy}\"\n            ]\n          },\n          \"received_events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/received_events\"\n            ]\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"User\"\n            ]\n          },\n          \"site_admin\": {\n            \"type\": \"boolean\"\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"pull\": {\n                \"type\": \"boolean\"\n              },\n              \"triage\": {\n                \"type\": \"boolean\"\n              },\n              \"push\": {\n                \"type\": \"boolean\"\n              },\n              \"maintain\": {\n                \"type\": \"boolean\"\n              },\n              \"admin\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"required\": [\n              \"pull\",\n              \"push\",\n              \"admin\"\n            ]\n          }\n        },\n        \"required\": [\n          \"avatar_url\",\n          \"events_url\",\n          \"followers_url\",\n          \"following_url\",\n          \"gists_url\",\n          \"gravatar_id\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"login\",\n          \"organizations_url\",\n          \"received_events_url\",\n          \"repos_url\",\n          \"site_admin\",\n          \"starred_url\",\n          \"subscriptions_url\",\n          \"type\",\n          \"url\"\n        ]\n      },\n      \"repository-invitation\": {\n        \"title\": \"Repository Invitation\",\n        \"description\": \"Repository invitations let you manage who you collaborate with.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"Unique identifier of the repository invitation.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          },\n          \"invitee\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"inviter\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"permissions\": {\n            \"description\": \"The permission associated with the invitation.\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"read\",\n              \"write\",\n              \"admin\",\n              \"triage\",\n              \"maintain\"\n            ],\n            \"examples\": [\n              \"read\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2016-06-13T14:52:50-05:00\"\n            ]\n          },\n          \"expired\": {\n            \"description\": \"Whether or not the invitation has expired\",\n            \"type\": \"boolean\"\n          },\n          \"url\": {\n            \"description\": \"URL for the repository invitation\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/user/repository-invitations/1\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/invitations\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"permissions\",\n          \"inviter\",\n          \"invitee\",\n          \"repository\",\n          \"url\",\n          \"html_url\",\n          \"created_at\"\n        ]\n      },\n      \"repository-collaborator-permission\": {\n        \"title\": \"Repository Collaborator Permission\",\n        \"description\": \"Repository Collaborator Permission\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"permission\": {\n            \"type\": \"string\"\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/collaborator\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"permission\",\n          \"user\"\n        ]\n      },\n      \"commit-comment\": {\n        \"title\": \"Commit Comment\",\n        \"description\": \"Commit Comment\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"body\": {\n            \"type\": \"string\"\n          },\n          \"path\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"position\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ]\n          },\n          \"line\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ]\n          },\n          \"commit_id\": {\n            \"type\": \"string\"\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"user\",\n          \"position\",\n          \"line\",\n          \"path\",\n          \"commit_id\",\n          \"body\",\n          \"author_association\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"scim-error\": {\n        \"title\": \"Scim Error\",\n        \"description\": \"Scim Error\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"message\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"documentation_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"detail\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"status\": {\n            \"type\": \"integer\"\n          },\n          \"scimType\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"schemas\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          }\n        }\n      },\n      \"branch-short\": {\n        \"title\": \"Branch Short\",\n        \"description\": \"Branch Short\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"commit\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"sha\",\n              \"url\"\n            ]\n          },\n          \"protected\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"commit\",\n          \"protected\"\n        ]\n      },\n      \"link\": {\n        \"title\": \"Link\",\n        \"description\": \"Hypermedia Link\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"href\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"href\"\n        ]\n      },\n      \"pull-request-simple\": {\n        \"title\": \"Pull Request Simple\",\n        \"description\": \"Pull Request Simple\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDExOlB1bGxSZXF1ZXN0MQ==\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/1347\"\n            ]\n          },\n          \"diff_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/1347.diff\"\n            ]\n          },\n          \"patch_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/1347.patch\"\n            ]\n          },\n          \"issue_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/issues/1347\"\n            ]\n          },\n          \"commits_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\"\n            ]\n          },\n          \"review_comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\"\n            ]\n          },\n          \"review_comment_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\"\n            ]\n          },\n          \"statuses_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"number\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1347\n            ]\n          },\n          \"state\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"open\"\n            ]\n          },\n          \"locked\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"title\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"new-feature\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"body\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Please pull these awesome changes\"\n            ]\n          },\n          \"labels\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"integer\",\n                  \"format\": \"int64\"\n                },\n                \"node_id\": {\n                  \"type\": \"string\"\n                },\n                \"url\": {\n                  \"type\": \"string\"\n                },\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"description\": {\n                  \"type\": \"string\"\n                },\n                \"color\": {\n                  \"type\": \"string\"\n                },\n                \"default\": {\n                  \"type\": \"boolean\"\n                }\n              },\n              \"required\": [\n                \"id\",\n                \"node_id\",\n                \"url\",\n                \"name\",\n                \"description\",\n                \"color\",\n                \"default\"\n              ]\n            }\n          },\n          \"milestone\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/milestone\"\n              }\n            ]\n          },\n          \"active_lock_reason\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"too heated\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"closed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"merged_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"merge_commit_sha\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"e5bd3914e2e596debea16f433f57875b5b90bcd6\"\n            ]\n          },\n          \"assignee\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"assignees\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/simple-user\"\n            }\n          },\n          \"requested_reviewers\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/simple-user\"\n            }\n          },\n          \"requested_teams\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/team\"\n            }\n          },\n          \"head\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"label\": {\n                \"type\": \"string\"\n              },\n              \"ref\": {\n                \"type\": \"string\"\n              },\n              \"repo\": {\n                \"$ref\": \"#/components/schemas/repository\"\n              },\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"user\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"null\"\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                ]\n              }\n            },\n            \"required\": [\n              \"label\",\n              \"ref\",\n              \"repo\",\n              \"sha\",\n              \"user\"\n            ]\n          },\n          \"base\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"label\": {\n                \"type\": \"string\"\n              },\n              \"ref\": {\n                \"type\": \"string\"\n              },\n              \"repo\": {\n                \"$ref\": \"#/components/schemas/repository\"\n              },\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"user\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"null\"\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                  }\n                ]\n              }\n            },\n            \"required\": [\n              \"label\",\n              \"ref\",\n              \"repo\",\n              \"sha\",\n              \"user\"\n            ]\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"comments\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"commits\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"statuses\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"html\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"issue\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"review_comments\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"review_comment\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"self\": {\n                \"$ref\": \"#/components/schemas/link\"\n              }\n            },\n            \"required\": [\n              \"comments\",\n              \"commits\",\n              \"statuses\",\n              \"html\",\n              \"issue\",\n              \"review_comments\",\n              \"review_comment\",\n              \"self\"\n            ]\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"draft\": {\n            \"description\": \"Indicates whether or not the pull request is a draft.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          }\n        },\n        \"required\": [\n          \"_links\",\n          \"assignee\",\n          \"labels\",\n          \"base\",\n          \"body\",\n          \"closed_at\",\n          \"comments_url\",\n          \"commits_url\",\n          \"created_at\",\n          \"diff_url\",\n          \"head\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"issue_url\",\n          \"merge_commit_sha\",\n          \"merged_at\",\n          \"milestone\",\n          \"number\",\n          \"patch_url\",\n          \"review_comment_url\",\n          \"review_comments_url\",\n          \"statuses_url\",\n          \"state\",\n          \"locked\",\n          \"title\",\n          \"updated_at\",\n          \"url\",\n          \"user\",\n          \"author_association\"\n        ]\n      },\n      \"simple-commit-status\": {\n        \"title\": \"Simple Commit Status\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"state\": {\n            \"type\": \"string\"\n          },\n          \"context\": {\n            \"type\": \"string\"\n          },\n          \"target_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"required\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ]\n          },\n          \"avatar_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          }\n        },\n        \"required\": [\n          \"description\",\n          \"id\",\n          \"node_id\",\n          \"state\",\n          \"context\",\n          \"target_url\",\n          \"avatar_url\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"combined-commit-status\": {\n        \"title\": \"Combined Commit Status\",\n        \"description\": \"Combined Commit Status\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"state\": {\n            \"type\": \"string\"\n          },\n          \"statuses\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/simple-commit-status\"\n            }\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"total_count\": {\n            \"type\": \"integer\"\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          },\n          \"commit_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          }\n        },\n        \"required\": [\n          \"state\",\n          \"sha\",\n          \"total_count\",\n          \"statuses\",\n          \"repository\",\n          \"commit_url\",\n          \"url\"\n        ]\n      },\n      \"status\": {\n        \"title\": \"Status\",\n        \"description\": \"The status of a commit.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"avatar_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"state\": {\n            \"type\": \"string\"\n          },\n          \"description\": {\n            \"type\": \"string\"\n          },\n          \"target_url\": {\n            \"type\": \"string\"\n          },\n          \"context\": {\n            \"type\": \"string\"\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\"\n          },\n          \"creator\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"avatar_url\",\n          \"id\",\n          \"node_id\",\n          \"state\",\n          \"description\",\n          \"target_url\",\n          \"context\",\n          \"created_at\",\n          \"updated_at\",\n          \"creator\"\n        ]\n      },\n      \"commit-comparison\": {\n        \"title\": \"Commit Comparison\",\n        \"description\": \"Commit Comparison\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/compare/master...topic\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/compare/master...topic\"\n            ]\n          },\n          \"permalink_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17\"\n            ]\n          },\n          \"diff_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/compare/master...topic.diff\"\n            ]\n          },\n          \"patch_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/compare/master...topic.patch\"\n            ]\n          },\n          \"base_commit\": {\n            \"$ref\": \"#/components/schemas/commit\"\n          },\n          \"merge_base_commit\": {\n            \"$ref\": \"#/components/schemas/commit\"\n          },\n          \"status\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"diverged\",\n              \"ahead\",\n              \"behind\",\n              \"identical\"\n            ],\n            \"examples\": [\n              \"ahead\"\n            ]\n          },\n          \"ahead_by\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              4\n            ]\n          },\n          \"behind_by\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          },\n          \"total_commits\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              6\n            ]\n          },\n          \"commits\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/commit\"\n            }\n          },\n          \"files\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/diff-entry\"\n            }\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"html_url\",\n          \"permalink_url\",\n          \"diff_url\",\n          \"patch_url\",\n          \"base_commit\",\n          \"merge_base_commit\",\n          \"status\",\n          \"ahead_by\",\n          \"behind_by\",\n          \"total_commits\",\n          \"commits\"\n        ]\n      },\n      \"content-reference-attachment\": {\n        \"title\": \"ContentReferenceAttachment\",\n        \"description\": \"Content Reference attachments allow you to provide context around URLs posted in comments\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"The ID of the attachment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              21\n            ]\n          },\n          \"title\": {\n            \"description\": \"The title of the attachment\",\n            \"type\": \"string\",\n            \"maxLength\": 1024,\n            \"examples\": [\n              \"Title of the attachment\"\n            ]\n          },\n          \"body\": {\n            \"description\": \"The body of the attachment\",\n            \"type\": \"string\",\n            \"maxLength\": 262144,\n            \"examples\": [\n              \"Body of the attachment\"\n            ]\n          },\n          \"node_id\": {\n            \"description\": \"The node_id of the content attachment\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"title\",\n          \"body\"\n        ]\n      },\n      \"content-tree\": {\n        \"title\": \"Content Tree\",\n        \"description\": \"Content Tree\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"size\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"path\": {\n            \"type\": \"string\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"git_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"download_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"entries\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"type\": {\n                  \"type\": \"string\"\n                },\n                \"size\": {\n                  \"type\": \"integer\"\n                },\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"path\": {\n                  \"type\": \"string\"\n                },\n                \"content\": {\n                  \"type\": \"string\"\n                },\n                \"sha\": {\n                  \"type\": \"string\"\n                },\n                \"url\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\"\n                },\n                \"git_url\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ],\n                  \"format\": \"uri\"\n                },\n                \"html_url\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ],\n                  \"format\": \"uri\"\n                },\n                \"download_url\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ],\n                  \"format\": \"uri\"\n                },\n                \"_links\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"git\": {\n                      \"type\": [\n                        \"string\",\n                        \"null\"\n                      ],\n                      \"format\": \"uri\"\n                    },\n                    \"html\": {\n                      \"type\": [\n                        \"string\",\n                        \"null\"\n                      ],\n                      \"format\": \"uri\"\n                    },\n                    \"self\": {\n                      \"type\": \"string\",\n                      \"format\": \"uri\"\n                    }\n                  },\n                  \"required\": [\n                    \"git\",\n                    \"html\",\n                    \"self\"\n                  ]\n                }\n              },\n              \"required\": [\n                \"_links\",\n                \"git_url\",\n                \"html_url\",\n                \"download_url\",\n                \"name\",\n                \"path\",\n                \"sha\",\n                \"size\",\n                \"type\",\n                \"url\"\n              ]\n            }\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"git\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"html\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"self\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"git\",\n              \"html\",\n              \"self\"\n            ]\n          }\n        },\n        \"required\": [\n          \"_links\",\n          \"git_url\",\n          \"html_url\",\n          \"download_url\",\n          \"name\",\n          \"path\",\n          \"sha\",\n          \"size\",\n          \"type\",\n          \"url\",\n          \"content\",\n          \"encoding\"\n        ]\n      },\n      \"content-directory\": {\n        \"title\": \"Content Directory\",\n        \"description\": \"A list of directory items\",\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"type\": {\n              \"type\": \"string\"\n            },\n            \"size\": {\n              \"type\": \"integer\"\n            },\n            \"name\": {\n              \"type\": \"string\"\n            },\n            \"path\": {\n              \"type\": \"string\"\n            },\n            \"content\": {\n              \"type\": \"string\"\n            },\n            \"sha\": {\n              \"type\": \"string\"\n            },\n            \"url\": {\n              \"type\": \"string\",\n              \"format\": \"uri\"\n            },\n            \"git_url\": {\n              \"type\": [\n                \"string\",\n                \"null\"\n              ],\n              \"format\": \"uri\"\n            },\n            \"html_url\": {\n              \"type\": [\n                \"string\",\n                \"null\"\n              ],\n              \"format\": \"uri\"\n            },\n            \"download_url\": {\n              \"type\": [\n                \"string\",\n                \"null\"\n              ],\n              \"format\": \"uri\"\n            },\n            \"_links\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"git\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ],\n                  \"format\": \"uri\"\n                },\n                \"html\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ],\n                  \"format\": \"uri\"\n                },\n                \"self\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\"\n                }\n              },\n              \"required\": [\n                \"git\",\n                \"html\",\n                \"self\"\n              ]\n            }\n          },\n          \"required\": [\n            \"_links\",\n            \"git_url\",\n            \"html_url\",\n            \"download_url\",\n            \"name\",\n            \"path\",\n            \"sha\",\n            \"size\",\n            \"type\",\n            \"url\"\n          ]\n        }\n      },\n      \"content-file\": {\n        \"title\": \"Content File\",\n        \"description\": \"Content File\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"encoding\": {\n            \"type\": \"string\"\n          },\n          \"size\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"path\": {\n            \"type\": \"string\"\n          },\n          \"content\": {\n            \"type\": \"string\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"git_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"download_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"git\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"html\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"self\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"git\",\n              \"html\",\n              \"self\"\n            ]\n          },\n          \"target\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"actual/actual.md\\\"\"\n            ]\n          },\n          \"submodule_git_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"git://example.com/defunkt/dotjs.git\\\"\"\n            ]\n          }\n        },\n        \"required\": [\n          \"_links\",\n          \"git_url\",\n          \"html_url\",\n          \"download_url\",\n          \"name\",\n          \"path\",\n          \"sha\",\n          \"size\",\n          \"type\",\n          \"url\",\n          \"content\",\n          \"encoding\"\n        ]\n      },\n      \"content-symlink\": {\n        \"title\": \"Symlink Content\",\n        \"description\": \"An object describing a symlink\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"target\": {\n            \"type\": \"string\"\n          },\n          \"size\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"path\": {\n            \"type\": \"string\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"git_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"download_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"git\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"html\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"self\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"git\",\n              \"html\",\n              \"self\"\n            ]\n          }\n        },\n        \"required\": [\n          \"_links\",\n          \"git_url\",\n          \"html_url\",\n          \"download_url\",\n          \"name\",\n          \"path\",\n          \"sha\",\n          \"size\",\n          \"type\",\n          \"url\",\n          \"target\"\n        ]\n      },\n      \"content-submodule\": {\n        \"title\": \"Symlink Content\",\n        \"description\": \"An object describing a symlink\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"submodule_git_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"size\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"path\": {\n            \"type\": \"string\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"git_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"download_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"git\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"html\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"self\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"git\",\n              \"html\",\n              \"self\"\n            ]\n          }\n        },\n        \"required\": [\n          \"_links\",\n          \"git_url\",\n          \"html_url\",\n          \"download_url\",\n          \"name\",\n          \"path\",\n          \"sha\",\n          \"size\",\n          \"type\",\n          \"url\",\n          \"submodule_git_url\"\n        ]\n      },\n      \"file-commit\": {\n        \"title\": \"File Commit\",\n        \"description\": \"File Commit\",\n        \"type\": \"object\",\n        \"required\": [\n          \"content\",\n          \"commit\"\n        ],\n        \"properties\": {\n          \"content\": {\n            \"type\": [\n              \"object\",\n              \"null\"\n            ],\n            \"properties\": {\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"path\": {\n                \"type\": \"string\"\n              },\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"size\": {\n                \"type\": \"integer\"\n              },\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"html_url\": {\n                \"type\": \"string\"\n              },\n              \"git_url\": {\n                \"type\": \"string\"\n              },\n              \"download_url\": {\n                \"type\": \"string\"\n              },\n              \"type\": {\n                \"type\": \"string\"\n              },\n              \"_links\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"self\": {\n                    \"type\": \"string\"\n                  },\n                  \"git\": {\n                    \"type\": \"string\"\n                  },\n                  \"html\": {\n                    \"type\": \"string\"\n                  }\n                }\n              }\n            }\n          },\n          \"commit\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"node_id\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\"\n              },\n              \"html_url\": {\n                \"type\": \"string\"\n              },\n              \"author\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"date\": {\n                    \"type\": \"string\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\"\n                  },\n                  \"email\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"committer\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"date\": {\n                    \"type\": \"string\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\"\n                  },\n                  \"email\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"message\": {\n                \"type\": \"string\"\n              },\n              \"tree\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"url\": {\n                    \"type\": \"string\"\n                  },\n                  \"sha\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"parents\": {\n                \"type\": \"array\",\n                \"items\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"url\": {\n                      \"type\": \"string\"\n                    },\n                    \"html_url\": {\n                      \"type\": \"string\"\n                    },\n                    \"sha\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              },\n              \"verification\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"verified\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"reason\": {\n                    \"type\": \"string\"\n                  },\n                  \"signature\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"payload\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"contributor\": {\n        \"title\": \"Contributor\",\n        \"description\": \"Contributor\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"login\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"gravatar_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"followers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"following_url\": {\n            \"type\": \"string\"\n          },\n          \"gists_url\": {\n            \"type\": \"string\"\n          },\n          \"starred_url\": {\n            \"type\": \"string\"\n          },\n          \"subscriptions_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"organizations_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"events_url\": {\n            \"type\": \"string\"\n          },\n          \"received_events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"site_admin\": {\n            \"type\": \"boolean\"\n          },\n          \"contributions\": {\n            \"type\": \"integer\"\n          },\n          \"email\": {\n            \"type\": \"string\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"contributions\",\n          \"type\"\n        ]\n      },\n      \"deployment\": {\n        \"title\": \"Deployment\",\n        \"description\": \"A request for a specific ref(branch,sha,tag) to be deployed\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example/deployments/1\"\n            ]\n          },\n          \"id\": {\n            \"description\": \"Unique identifier of the deployment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOkRlcGxveW1lbnQx\"\n            ]\n          },\n          \"sha\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\"\n            ]\n          },\n          \"ref\": {\n            \"description\": \"The ref to deploy. This can be a branch, tag, or sha.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"topic-branch\"\n            ]\n          },\n          \"task\": {\n            \"description\": \"Parameter to specify a task to execute\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"deploy\"\n            ]\n          },\n          \"payload\": {\n            \"oneOf\": [\n              {\n                \"type\": \"object\",\n                \"additionalProperties\": true\n              },\n              {\n                \"type\": \"string\"\n              }\n            ]\n          },\n          \"original_environment\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"staging\"\n            ]\n          },\n          \"environment\": {\n            \"description\": \"Name for the target deployment environment.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"production\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Deploy request from hubot\"\n            ]\n          },\n          \"creator\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-07-20T01:19:13Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-07-20T01:19:13Z\"\n            ]\n          },\n          \"statuses_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example/deployments/1/statuses\"\n            ]\n          },\n          \"repository_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example\"\n            ]\n          },\n          \"transient_environment\": {\n            \"description\": \"Specifies if the given environment is will no longer exist at some point in the future. Default: false.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"production_environment\": {\n            \"description\": \"Specifies if the given environment is one that end-users directly interact with. Default: false.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"sha\",\n          \"ref\",\n          \"task\",\n          \"environment\",\n          \"creator\",\n          \"payload\",\n          \"description\",\n          \"statuses_url\",\n          \"repository_url\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"deployment-status\": {\n        \"title\": \"Deployment Status\",\n        \"description\": \"The status of a deployment.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example/deployments/42/statuses/1\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDE2OkRlcGxveW1lbnRTdGF0dXMx\"\n            ]\n          },\n          \"state\": {\n            \"description\": \"The state of the status.\",\n            \"enum\": [\n              \"error\",\n              \"failure\",\n              \"inactive\",\n              \"pending\",\n              \"success\",\n              \"queued\",\n              \"in_progress\"\n            ],\n            \"type\": \"string\",\n            \"examples\": [\n              \"success\"\n            ]\n          },\n          \"creator\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"description\": {\n            \"description\": \"A short description of the status.\",\n            \"default\": \"\",\n            \"type\": \"string\",\n            \"maxLength\": 140,\n            \"examples\": [\n              \"Deployment finished successfully.\"\n            ]\n          },\n          \"environment\": {\n            \"description\": \"The environment of the deployment that the status is for.\",\n            \"default\": \"\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"production\"\n            ]\n          },\n          \"target_url\": {\n            \"description\": \"Deprecated: the URL to associate with this status.\",\n            \"default\": \"\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://example.com/deployment/42/output\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-07-20T01:19:13Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-07-20T01:19:13Z\"\n            ]\n          },\n          \"deployment_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example/deployments/42\"\n            ]\n          },\n          \"repository_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example\"\n            ]\n          },\n          \"environment_url\": {\n            \"description\": \"The URL for accessing your environment.\",\n            \"default\": \"\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://staging.example.com/\"\n            ]\n          },\n          \"log_url\": {\n            \"description\": \"The URL to associate with this status.\",\n            \"default\": \"\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://example.com/deployment/42/output\"\n            ]\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"state\",\n          \"creator\",\n          \"description\",\n          \"deployment_url\",\n          \"target_url\",\n          \"repository_url\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"short-blob\": {\n        \"title\": \"Short Blob\",\n        \"description\": \"Short Blob\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"sha\"\n        ]\n      },\n      \"blob\": {\n        \"title\": \"Blob\",\n        \"description\": \"Blob\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"content\": {\n            \"type\": \"string\"\n          },\n          \"encoding\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"size\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"highlighted_content\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"sha\",\n          \"url\",\n          \"node_id\",\n          \"size\",\n          \"content\",\n          \"encoding\"\n        ]\n      },\n      \"git-commit\": {\n        \"title\": \"Git Commit\",\n        \"description\": \"Low-level Git commit operations within a repository\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"sha\": {\n            \"description\": \"SHA for the commit\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"7638417db6d59f3c431d3e1f261cc637155684cd\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"author\": {\n            \"description\": \"Identifying information for the git-user\",\n            \"type\": \"object\",\n            \"properties\": {\n              \"date\": {\n                \"description\": \"Timestamp of the commit\",\n                \"format\": \"date-time\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"2014-08-09T08:02:04+12:00\"\n                ]\n              },\n              \"email\": {\n                \"type\": \"string\",\n                \"description\": \"Git email address of the user\",\n                \"examples\": [\n                  \"monalisa.octocat@example.com\"\n                ]\n              },\n              \"name\": {\n                \"description\": \"Name of the git user\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"Monalisa Octocat\"\n                ]\n              }\n            },\n            \"required\": [\n              \"email\",\n              \"name\",\n              \"date\"\n            ]\n          },\n          \"committer\": {\n            \"description\": \"Identifying information for the git-user\",\n            \"type\": \"object\",\n            \"properties\": {\n              \"date\": {\n                \"description\": \"Timestamp of the commit\",\n                \"format\": \"date-time\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"2014-08-09T08:02:04+12:00\"\n                ]\n              },\n              \"email\": {\n                \"type\": \"string\",\n                \"description\": \"Git email address of the user\",\n                \"examples\": [\n                  \"monalisa.octocat@example.com\"\n                ]\n              },\n              \"name\": {\n                \"description\": \"Name of the git user\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"Monalisa Octocat\"\n                ]\n              }\n            },\n            \"required\": [\n              \"email\",\n              \"name\",\n              \"date\"\n            ]\n          },\n          \"message\": {\n            \"description\": \"Message describing the purpose of the commit\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Fix #42\"\n            ]\n          },\n          \"tree\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"sha\": {\n                \"description\": \"SHA for the commit\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"7638417db6d59f3c431d3e1f261cc637155684cd\"\n                ]\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"sha\",\n              \"url\"\n            ]\n          },\n          \"parents\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"sha\": {\n                  \"description\": \"SHA for the commit\",\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"7638417db6d59f3c431d3e1f261cc637155684cd\"\n                  ]\n                },\n                \"url\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\"\n                },\n                \"html_url\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\"\n                }\n              },\n              \"required\": [\n                \"sha\",\n                \"url\",\n                \"html_url\"\n              ]\n            }\n          },\n          \"verification\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"verified\": {\n                \"type\": \"boolean\"\n              },\n              \"reason\": {\n                \"type\": \"string\"\n              },\n              \"signature\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"payload\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              }\n            },\n            \"required\": [\n              \"verified\",\n              \"reason\",\n              \"signature\",\n              \"payload\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          }\n        },\n        \"required\": [\n          \"sha\",\n          \"node_id\",\n          \"url\",\n          \"html_url\",\n          \"author\",\n          \"committer\",\n          \"tree\",\n          \"message\",\n          \"parents\",\n          \"verification\"\n        ]\n      },\n      \"git-ref\": {\n        \"title\": \"Git Reference\",\n        \"description\": \"Git references within a repository\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"ref\": {\n            \"type\": \"string\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"object\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"type\": {\n                \"type\": \"string\"\n              },\n              \"sha\": {\n                \"description\": \"SHA for the reference\",\n                \"type\": \"string\",\n                \"minLength\": 40,\n                \"maxLength\": 40,\n                \"examples\": [\n                  \"7638417db6d59f3c431d3e1f261cc637155684cd\"\n                ]\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"type\",\n              \"sha\",\n              \"url\"\n            ]\n          }\n        },\n        \"required\": [\n          \"ref\",\n          \"node_id\",\n          \"url\",\n          \"object\"\n        ]\n      },\n      \"git-tag\": {\n        \"title\": \"Git Tag\",\n        \"description\": \"Metadata for a Git tag\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==\"\n            ]\n          },\n          \"tag\": {\n            \"description\": \"Name of the tag\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"v0.0.1\"\n            ]\n          },\n          \"sha\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"940bd336248efae0f9ee5bc7b2d5c985887b16ac\"\n            ]\n          },\n          \"url\": {\n            \"description\": \"URL for the tag\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repositories/42/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac\"\n            ]\n          },\n          \"message\": {\n            \"description\": \"Message describing the purpose of the tag\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Initial public release\"\n            ]\n          },\n          \"tagger\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"date\": {\n                \"type\": \"string\"\n              },\n              \"email\": {\n                \"type\": \"string\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"date\",\n              \"email\",\n              \"name\"\n            ]\n          },\n          \"object\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"type\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"sha\",\n              \"type\",\n              \"url\"\n            ]\n          },\n          \"verification\": {\n            \"$ref\": \"#/components/schemas/verification\"\n          }\n        },\n        \"required\": [\n          \"sha\",\n          \"url\",\n          \"node_id\",\n          \"tagger\",\n          \"object\",\n          \"tag\",\n          \"message\"\n        ]\n      },\n      \"git-tree\": {\n        \"title\": \"Git Tree\",\n        \"description\": \"The hierarchy between files in a Git repository.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"truncated\": {\n            \"type\": \"boolean\"\n          },\n          \"tree\": {\n            \"description\": \"Objects specifying a tree structure\",\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"path\": {\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"test/file.rb\"\n                  ]\n                },\n                \"mode\": {\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"040000\"\n                  ]\n                },\n                \"type\": {\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"tree\"\n                  ]\n                },\n                \"sha\": {\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"23f6827669e43831def8a7ad935069c8bd418261\"\n                  ]\n                },\n                \"size\": {\n                  \"type\": \"integer\",\n                  \"examples\": [\n                    12\n                  ]\n                },\n                \"url\": {\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261\"\n                  ]\n                }\n              }\n            },\n            \"examples\": [\n              {\n                \"path\": \"file.rb\",\n                \"mode\": \"100644\",\n                \"type\": \"blob\",\n                \"size\": 30,\n                \"sha\": \"44b4fc6d56897b048c772eb4087f854f46256132\",\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132\",\n                \"properties\": {\n                  \"path\": {\n                    \"type\": \"string\"\n                  },\n                  \"mode\": {\n                    \"type\": \"string\"\n                  },\n                  \"type\": {\n                    \"type\": \"string\"\n                  },\n                  \"size\": {\n                    \"type\": \"integer\"\n                  },\n                  \"sha\": {\n                    \"type\": \"string\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"path\",\n                  \"mode\",\n                  \"type\",\n                  \"sha\",\n                  \"url\",\n                  \"size\"\n                ]\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"sha\",\n          \"url\",\n          \"tree\",\n          \"truncated\"\n        ]\n      },\n      \"hook-response\": {\n        \"title\": \"Hook Response\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"code\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ]\n          },\n          \"status\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"message\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          }\n        },\n        \"required\": [\n          \"code\",\n          \"status\",\n          \"message\"\n        ]\n      },\n      \"hook\": {\n        \"title\": \"Webhook\",\n        \"description\": \"Webhooks for repositories.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"description\": \"Unique identifier of the webhook.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of a valid service, use 'web' for a webhook.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"web\"\n            ]\n          },\n          \"active\": {\n            \"description\": \"Determines whether the hook is actually triggered on pushes.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"events\": {\n            \"description\": \"Determines what events the hook is triggered for. Default: ['push'].\",\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"push\",\n              \"pull_request\"\n            ]\n          },\n          \"config\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"email\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"foo@bar.com\\\"\"\n                ]\n              },\n              \"password\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"foo\\\"\"\n                ]\n              },\n              \"room\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"roomer\\\"\"\n                ]\n              },\n              \"subdomain\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"foo\\\"\"\n                ]\n              },\n              \"url\": {\n                \"$ref\": \"#/components/schemas/webhook-config-url\"\n              },\n              \"insecure_ssl\": {\n                \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n              },\n              \"content_type\": {\n                \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n              },\n              \"digest\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"sha256\\\"\"\n                ]\n              },\n              \"secret\": {\n                \"$ref\": \"#/components/schemas/webhook-config-secret\"\n              },\n              \"token\": {\n                \"type\": \"string\",\n                \"examples\": [\n                  \"\\\"abc\\\"\"\n                ]\n              }\n            }\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-09-06T20:39:23Z\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-09-06T17:26:27Z\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/hooks/1\"\n            ]\n          },\n          \"test_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/hooks/1/test\"\n            ]\n          },\n          \"ping_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/hooks/1/pings\"\n            ]\n          },\n          \"last_response\": {\n            \"$ref\": \"#/components/schemas/hook-response\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"url\",\n          \"type\",\n          \"name\",\n          \"active\",\n          \"events\",\n          \"config\",\n          \"ping_url\",\n          \"created_at\",\n          \"updated_at\",\n          \"last_response\",\n          \"test_url\"\n        ]\n      },\n      \"issue-event-label\": {\n        \"title\": \"Issue Event Label\",\n        \"description\": \"Issue Event Label\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"color\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"color\"\n        ]\n      },\n      \"issue-event-dismissed-review\": {\n        \"title\": \"Issue Event Dismissed Review\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"state\": {\n            \"type\": \"string\"\n          },\n          \"review_id\": {\n            \"type\": \"integer\"\n          },\n          \"dismissal_message\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"dismissal_commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          }\n        },\n        \"required\": [\n          \"state\",\n          \"review_id\",\n          \"dismissal_message\"\n        ]\n      },\n      \"issue-event-milestone\": {\n        \"title\": \"Issue Event Milestone\",\n        \"description\": \"Issue Event Milestone\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"title\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"title\"\n        ]\n      },\n      \"issue-event-project-card\": {\n        \"title\": \"Issue Event Project Card\",\n        \"description\": \"Issue Event Project Card\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"project_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"project_id\": {\n            \"type\": \"integer\"\n          },\n          \"column_name\": {\n            \"type\": \"string\"\n          },\n          \"previous_column_name\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"id\",\n          \"project_url\",\n          \"project_id\",\n          \"column_name\"\n        ]\n      },\n      \"issue-event-rename\": {\n        \"title\": \"Issue Event Rename\",\n        \"description\": \"Issue Event Rename\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"from\": {\n            \"type\": \"string\"\n          },\n          \"to\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"from\",\n          \"to\"\n        ]\n      },\n      \"issue-event\": {\n        \"title\": \"Issue Event\",\n        \"description\": \"Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDEwOklzc3VlRXZlbnQx\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/issues/events/1\"\n            ]\n          },\n          \"actor\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"event\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"closed\"\n            ]\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"issue\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/issue\"\n              }\n            ]\n          },\n          \"label\": {\n            \"$ref\": \"#/components/schemas/issue-event-label\"\n          },\n          \"assignee\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"assigner\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"review_requester\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"requested_reviewer\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"requested_team\": {\n            \"$ref\": \"#/components/schemas/team\"\n          },\n          \"dismissed_review\": {\n            \"$ref\": \"#/components/schemas/issue-event-dismissed-review\"\n          },\n          \"milestone\": {\n            \"$ref\": \"#/components/schemas/issue-event-milestone\"\n          },\n          \"project_card\": {\n            \"$ref\": \"#/components/schemas/issue-event-project-card\"\n          },\n          \"rename\": {\n            \"$ref\": \"#/components/schemas/issue-event-rename\"\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"lock_reason\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\"\n        ]\n      },\n      \"labeled-issue-event\": {\n        \"title\": \"Labeled Issue Event\",\n        \"description\": \"Labeled Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"label\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"color\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"name\",\n              \"color\"\n            ]\n          }\n        },\n        \"required\": [\n          \"label\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"unlabeled-issue-event\": {\n        \"title\": \"Unlabeled Issue Event\",\n        \"description\": \"Unlabeled Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"label\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"color\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"name\",\n              \"color\"\n            ]\n          }\n        },\n        \"required\": [\n          \"label\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"assigned-issue-event\": {\n        \"title\": \"Assigned Issue Event\",\n        \"description\": \"Assigned Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"$ref\": \"#/components/schemas/integration\"\n          },\n          \"assignee\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"assigner\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\",\n          \"assignee\",\n          \"assigner\"\n        ]\n      },\n      \"unassigned-issue-event\": {\n        \"title\": \"Unassigned Issue Event\",\n        \"description\": \"Unassigned Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"assignee\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"assigner\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\",\n          \"assignee\",\n          \"assigner\"\n        ]\n      },\n      \"milestoned-issue-event\": {\n        \"title\": \"Milestoned Issue Event\",\n        \"description\": \"Milestoned Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"milestone\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"title\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"title\"\n            ]\n          }\n        },\n        \"required\": [\n          \"milestone\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"demilestoned-issue-event\": {\n        \"title\": \"Demilestoned Issue Event\",\n        \"description\": \"Demilestoned Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"milestone\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"title\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"title\"\n            ]\n          }\n        },\n        \"required\": [\n          \"milestone\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"renamed-issue-event\": {\n        \"title\": \"Renamed Issue Event\",\n        \"description\": \"Renamed Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"rename\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"from\": {\n                \"type\": \"string\"\n              },\n              \"to\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"from\",\n              \"to\"\n            ]\n          }\n        },\n        \"required\": [\n          \"rename\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"review-requested-issue-event\": {\n        \"title\": \"Review Requested Issue Event\",\n        \"description\": \"Review Requested Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"review_requester\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"requested_team\": {\n            \"$ref\": \"#/components/schemas/team\"\n          },\n          \"requested_reviewer\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          }\n        },\n        \"required\": [\n          \"review_requester\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"review-request-removed-issue-event\": {\n        \"title\": \"Review Request Removed Issue Event\",\n        \"description\": \"Review Request Removed Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"review_requester\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"requested_team\": {\n            \"$ref\": \"#/components/schemas/team\"\n          },\n          \"requested_reviewer\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          }\n        },\n        \"required\": [\n          \"review_requester\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"review-dismissed-issue-event\": {\n        \"title\": \"Review Dismissed Issue Event\",\n        \"description\": \"Review Dismissed Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"dismissed_review\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"state\": {\n                \"type\": \"string\"\n              },\n              \"review_id\": {\n                \"type\": \"integer\"\n              },\n              \"dismissal_message\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"dismissal_commit_id\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"state\",\n              \"review_id\",\n              \"dismissal_message\"\n            ]\n          }\n        },\n        \"required\": [\n          \"dismissed_review\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"locked-issue-event\": {\n        \"title\": \"Locked Issue Event\",\n        \"description\": \"Locked Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"lock_reason\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"\\\"off-topic\\\"\"\n            ]\n          }\n        },\n        \"required\": [\n          \"lock_reason\",\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"added-to-project-issue-event\": {\n        \"title\": \"Added to Project Issue Event\",\n        \"description\": \"Added to Project Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"project_card\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"project_id\": {\n                \"type\": \"integer\"\n              },\n              \"project_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"column_name\": {\n                \"type\": \"string\"\n              },\n              \"previous_column_name\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"id\",\n              \"url\",\n              \"project_id\",\n              \"project_url\",\n              \"column_name\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"moved-column-in-project-issue-event\": {\n        \"title\": \"Moved Column in Project Issue Event\",\n        \"description\": \"Moved Column in Project Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"project_card\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"project_id\": {\n                \"type\": \"integer\"\n              },\n              \"project_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"column_name\": {\n                \"type\": \"string\"\n              },\n              \"previous_column_name\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"id\",\n              \"url\",\n              \"project_id\",\n              \"project_url\",\n              \"column_name\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"removed-from-project-issue-event\": {\n        \"title\": \"Removed from Project Issue Event\",\n        \"description\": \"Removed from Project Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"project_card\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"project_id\": {\n                \"type\": \"integer\"\n              },\n              \"project_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"column_name\": {\n                \"type\": \"string\"\n              },\n              \"previous_column_name\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"id\",\n              \"url\",\n              \"project_id\",\n              \"project_url\",\n              \"column_name\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"converted-note-to-issue-issue-event\": {\n        \"title\": \"Converted Note to Issue Issue Event\",\n        \"description\": \"Converted Note to Issue Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"$ref\": \"#/components/schemas/integration\"\n          },\n          \"project_card\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"id\": {\n                \"type\": \"integer\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"project_id\": {\n                \"type\": \"integer\"\n              },\n              \"project_url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"column_name\": {\n                \"type\": \"string\"\n              },\n              \"previous_column_name\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"id\",\n              \"url\",\n              \"project_id\",\n              \"project_url\",\n              \"column_name\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"issue-event-for-issue\": {\n        \"title\": \"Issue Event for Issue\",\n        \"description\": \"Issue Event for Issue\",\n        \"anyOf\": [\n          {\n            \"$ref\": \"#/components/schemas/labeled-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/unlabeled-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/assigned-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/unassigned-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/milestoned-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/demilestoned-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/renamed-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/review-requested-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/review-request-removed-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/review-dismissed-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/locked-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/added-to-project-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/moved-column-in-project-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/removed-from-project-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/converted-note-to-issue-issue-event\"\n          }\n        ]\n      },\n      \"label\": {\n        \"title\": \"Label\",\n        \"description\": \"Color-coded labels help you categorize and filter your issues (just like labels in Gmail).\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"format\": \"int64\",\n            \"examples\": [\n              208045946\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDU6TGFiZWwyMDgwNDU5NDY=\"\n            ]\n          },\n          \"url\": {\n            \"description\": \"URL for the label\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repositories/42/labels/bug\"\n            ]\n          },\n          \"name\": {\n            \"description\": \"The name of the label.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"bug\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Something isn't working\"\n            ]\n          },\n          \"color\": {\n            \"description\": \"6-character hex code, without the leading #, identifying the color\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"FFFFFF\"\n            ]\n          },\n          \"default\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"name\",\n          \"description\",\n          \"color\",\n          \"default\"\n        ]\n      },\n      \"timeline-comment-event\": {\n        \"title\": \"Timeline Comment Event\",\n        \"description\": \"Timeline Comment Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"id\": {\n            \"description\": \"Unique identifier of the issue comment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"description\": \"URL for the issue comment\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repositories/42/issues/comments/1\"\n            ]\n          },\n          \"body\": {\n            \"description\": \"Contents of the issue comment\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"What version of Safari were you using when you observed this bug?\"\n            ]\n          },\n          \"body_text\": {\n            \"type\": \"string\"\n          },\n          \"body_html\": {\n            \"type\": \"string\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"user\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"issue_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          }\n        },\n        \"required\": [\n          \"event\",\n          \"actor\",\n          \"id\",\n          \"node_id\",\n          \"html_url\",\n          \"issue_url\",\n          \"author_association\",\n          \"user\",\n          \"url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"timeline-cross-referenced-event\": {\n        \"title\": \"Timeline Cross Referenced Event\",\n        \"description\": \"Timeline Cross Referenced Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"source\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"type\": {\n                \"type\": \"string\"\n              },\n              \"issue\": {\n                \"$ref\": \"#/components/schemas/issue\"\n              }\n            }\n          }\n        },\n        \"required\": [\n          \"event\",\n          \"created_at\",\n          \"updated_at\",\n          \"source\"\n        ]\n      },\n      \"timeline-committed-event\": {\n        \"title\": \"Timeline Committed Event\",\n        \"description\": \"Timeline Committed Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"sha\": {\n            \"description\": \"SHA for the commit\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"7638417db6d59f3c431d3e1f261cc637155684cd\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"author\": {\n            \"description\": \"Identifying information for the git-user\",\n            \"type\": \"object\",\n            \"properties\": {\n              \"date\": {\n                \"description\": \"Timestamp of the commit\",\n                \"format\": \"date-time\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"2014-08-09T08:02:04+12:00\"\n                ]\n              },\n              \"email\": {\n                \"type\": \"string\",\n                \"description\": \"Git email address of the user\",\n                \"examples\": [\n                  \"monalisa.octocat@example.com\"\n                ]\n              },\n              \"name\": {\n                \"description\": \"Name of the git user\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"Monalisa Octocat\"\n                ]\n              }\n            },\n            \"required\": [\n              \"email\",\n              \"name\",\n              \"date\"\n            ]\n          },\n          \"committer\": {\n            \"description\": \"Identifying information for the git-user\",\n            \"type\": \"object\",\n            \"properties\": {\n              \"date\": {\n                \"description\": \"Timestamp of the commit\",\n                \"format\": \"date-time\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"2014-08-09T08:02:04+12:00\"\n                ]\n              },\n              \"email\": {\n                \"type\": \"string\",\n                \"description\": \"Git email address of the user\",\n                \"examples\": [\n                  \"monalisa.octocat@example.com\"\n                ]\n              },\n              \"name\": {\n                \"description\": \"Name of the git user\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"Monalisa Octocat\"\n                ]\n              }\n            },\n            \"required\": [\n              \"email\",\n              \"name\",\n              \"date\"\n            ]\n          },\n          \"message\": {\n            \"description\": \"Message describing the purpose of the commit\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Fix #42\"\n            ]\n          },\n          \"tree\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"sha\": {\n                \"description\": \"SHA for the commit\",\n                \"type\": \"string\",\n                \"examples\": [\n                  \"7638417db6d59f3c431d3e1f261cc637155684cd\"\n                ]\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"sha\",\n              \"url\"\n            ]\n          },\n          \"parents\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"sha\": {\n                  \"description\": \"SHA for the commit\",\n                  \"type\": \"string\",\n                  \"examples\": [\n                    \"7638417db6d59f3c431d3e1f261cc637155684cd\"\n                  ]\n                },\n                \"url\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\"\n                },\n                \"html_url\": {\n                  \"type\": \"string\",\n                  \"format\": \"uri\"\n                }\n              },\n              \"required\": [\n                \"sha\",\n                \"url\",\n                \"html_url\"\n              ]\n            }\n          },\n          \"verification\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"verified\": {\n                \"type\": \"boolean\"\n              },\n              \"reason\": {\n                \"type\": \"string\"\n              },\n              \"signature\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"payload\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              }\n            },\n            \"required\": [\n              \"verified\",\n              \"reason\",\n              \"signature\",\n              \"payload\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          }\n        },\n        \"required\": [\n          \"sha\",\n          \"node_id\",\n          \"url\",\n          \"html_url\",\n          \"author\",\n          \"committer\",\n          \"tree\",\n          \"message\",\n          \"parents\",\n          \"verification\"\n        ]\n      },\n      \"timeline-reviewed-event\": {\n        \"title\": \"Timeline Reviewed Event\",\n        \"description\": \"Timeline Reviewed Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"description\": \"Unique identifier of the review\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\"\n            ]\n          },\n          \"user\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"body\": {\n            \"description\": \"The text of the review.\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"This looks great.\"\n            ]\n          },\n          \"state\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"CHANGES_REQUESTED\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\"\n            ]\n          },\n          \"pull_request_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/12\"\n            ]\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"html\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"href\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"href\"\n                ]\n              },\n              \"pull_request\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"href\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"href\"\n                ]\n              }\n            },\n            \"required\": [\n              \"html\",\n              \"pull_request\"\n            ]\n          },\n          \"submitted_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"commit_id\": {\n            \"description\": \"A commit SHA for the review.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"54bb654c9e6025347f57900a4a5c2313a96b8035\"\n            ]\n          },\n          \"body_html\": {\n            \"type\": \"string\"\n          },\n          \"body_text\": {\n            \"type\": \"string\"\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          }\n        },\n        \"required\": [\n          \"event\",\n          \"id\",\n          \"node_id\",\n          \"user\",\n          \"body\",\n          \"state\",\n          \"commit_id\",\n          \"html_url\",\n          \"pull_request_url\",\n          \"_links\",\n          \"author_association\"\n        ]\n      },\n      \"pull-request-review-comment\": {\n        \"title\": \"Pull Request Review Comment\",\n        \"description\": \"Pull Request Review Comments are comments on a portion of the Pull Request's diff.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"description\": \"URL for the pull request review comment\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\"\n            ]\n          },\n          \"pull_request_review_id\": {\n            \"description\": \"The ID of the pull request review to which the comment belongs.\",\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              42\n            ]\n          },\n          \"id\": {\n            \"description\": \"The ID of the pull request review comment.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"description\": \"The node ID of the pull request review comment.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\"\n            ]\n          },\n          \"diff_hunk\": {\n            \"description\": \"The diff of the line that the comment refers to.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n            ]\n          },\n          \"path\": {\n            \"description\": \"The relative path of the file to which the comment applies.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"config/database.yaml\"\n            ]\n          },\n          \"position\": {\n            \"description\": \"The line index in the diff to which the comment applies.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"original_position\": {\n            \"description\": \"The index of the original line in the diff to which the comment applies.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              4\n            ]\n          },\n          \"commit_id\": {\n            \"description\": \"The SHA of the commit to which the comment applies.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"original_commit_id\": {\n            \"description\": \"The SHA of the original commit to which the comment applies.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\"\n            ]\n          },\n          \"in_reply_to_id\": {\n            \"description\": \"The comment ID to reply to.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              8\n            ]\n          },\n          \"user\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"body\": {\n            \"description\": \"The text of the comment.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"We should probably include a check for null values here.\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"html_url\": {\n            \"description\": \"HTML URL for the pull request review comment.\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\"\n            ]\n          },\n          \"pull_request_url\": {\n            \"description\": \"URL for the pull request that the review comment belongs to.\",\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/1\"\n            ]\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"self\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"href\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\",\n                    \"examples\": [\n                      \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"href\"\n                ]\n              },\n              \"html\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"href\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\",\n                    \"examples\": [\n                      \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"href\"\n                ]\n              },\n              \"pull_request\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"href\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\",\n                    \"examples\": [\n                      \"https://api.github.com/repos/octocat/Hello-World/pulls/1\"\n                    ]\n                  }\n                },\n                \"required\": [\n                  \"href\"\n                ]\n              }\n            },\n            \"required\": [\n              \"self\",\n              \"html\",\n              \"pull_request\"\n            ]\n          },\n          \"start_line\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"description\": \"The first line of the range for a multi-line comment.\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"original_start_line\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"description\": \"The first line of the range for a multi-line comment.\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"start_side\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"The side of the first line of the range for a multi-line comment.\",\n            \"enum\": [\n              \"LEFT\",\n              \"RIGHT\",\n              null\n            ],\n            \"default\": \"RIGHT\"\n          },\n          \"line\": {\n            \"description\": \"The line of the blob to which the comment applies. The last line of the range for a multi-line comment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"original_line\": {\n            \"description\": \"The line of the blob to which the comment applies. The last line of the range for a multi-line comment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"side\": {\n            \"description\": \"The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment\",\n            \"enum\": [\n              \"LEFT\",\n              \"RIGHT\"\n            ],\n            \"default\": \"RIGHT\",\n            \"type\": \"string\"\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          },\n          \"body_html\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"<p>comment body</p>\\\"\"\n            ]\n          },\n          \"body_text\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"\\\"comment body\\\"\"\n            ]\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"id\",\n          \"node_id\",\n          \"pull_request_review_id\",\n          \"diff_hunk\",\n          \"path\",\n          \"position\",\n          \"original_position\",\n          \"commit_id\",\n          \"original_commit_id\",\n          \"user\",\n          \"body\",\n          \"created_at\",\n          \"updated_at\",\n          \"html_url\",\n          \"pull_request_url\",\n          \"author_association\",\n          \"_links\"\n        ]\n      },\n      \"timeline-line-commented-event\": {\n        \"title\": \"Timeline Line Commented Event\",\n        \"description\": \"Timeline Line Commented Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"comments\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n            }\n          }\n        }\n      },\n      \"timeline-commit-commented-event\": {\n        \"title\": \"Timeline Commit Commented Event\",\n        \"description\": \"Timeline Commit Commented Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": \"string\"\n          },\n          \"comments\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/commit-comment\"\n            }\n          }\n        }\n      },\n      \"timeline-assigned-issue-event\": {\n        \"title\": \"Timeline Assigned Issue Event\",\n        \"description\": \"Timeline Assigned Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"assignee\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\",\n          \"assignee\"\n        ]\n      },\n      \"timeline-unassigned-issue-event\": {\n        \"title\": \"Timeline Unassigned Issue Event\",\n        \"description\": \"Timeline Unassigned Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"assignee\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\",\n          \"assignee\"\n        ]\n      },\n      \"state-change-issue-event\": {\n        \"title\": \"State Change Issue Event\",\n        \"description\": \"State Change Issue Event\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"actor\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"event\": {\n            \"type\": \"string\"\n          },\n          \"commit_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"commit_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"actor\",\n          \"event\",\n          \"commit_id\",\n          \"commit_url\",\n          \"created_at\",\n          \"performed_via_github_app\"\n        ]\n      },\n      \"timeline-issue-events\": {\n        \"title\": \"Timeline Event\",\n        \"description\": \"Timeline Event\",\n        \"type\": \"object\",\n        \"anyOf\": [\n          {\n            \"$ref\": \"#/components/schemas/labeled-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/unlabeled-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/milestoned-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/demilestoned-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/renamed-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/review-requested-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/review-request-removed-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/review-dismissed-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/locked-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/added-to-project-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/moved-column-in-project-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/removed-from-project-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/converted-note-to-issue-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/timeline-comment-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/timeline-cross-referenced-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/timeline-committed-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/timeline-reviewed-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/timeline-line-commented-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/timeline-commit-commented-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/timeline-assigned-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/timeline-unassigned-issue-event\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/state-change-issue-event\"\n          }\n        ]\n      },\n      \"deploy-key\": {\n        \"title\": \"Deploy Key\",\n        \"description\": \"An SSH key granting access to a single repository.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"key\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"title\": {\n            \"type\": \"string\"\n          },\n          \"verified\": {\n            \"type\": \"boolean\"\n          },\n          \"created_at\": {\n            \"type\": \"string\"\n          },\n          \"read_only\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"key\",\n          \"url\",\n          \"title\",\n          \"verified\",\n          \"created_at\",\n          \"read_only\"\n        ]\n      },\n      \"language\": {\n        \"title\": \"Language\",\n        \"description\": \"Language\",\n        \"type\": \"object\",\n        \"additionalProperties\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"license-content\": {\n        \"title\": \"License Content\",\n        \"description\": \"License Content\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"path\": {\n            \"type\": \"string\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"size\": {\n            \"type\": \"integer\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"git_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"download_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"content\": {\n            \"type\": \"string\"\n          },\n          \"encoding\": {\n            \"type\": \"string\"\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"git\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"html\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"self\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"git\",\n              \"html\",\n              \"self\"\n            ]\n          },\n          \"license\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/license-simple\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"_links\",\n          \"git_url\",\n          \"html_url\",\n          \"download_url\",\n          \"name\",\n          \"path\",\n          \"sha\",\n          \"size\",\n          \"type\",\n          \"url\",\n          \"content\",\n          \"encoding\",\n          \"license\"\n        ]\n      },\n      \"pages-source-hash\": {\n        \"title\": \"Pages Source Hash\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"branch\": {\n            \"type\": \"string\"\n          },\n          \"path\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"branch\",\n          \"path\"\n        ]\n      },\n      \"pages-https-certificate\": {\n        \"title\": \"Pages Https Certificate\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"state\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"new\",\n              \"authorization_created\",\n              \"authorization_pending\",\n              \"authorized\",\n              \"authorization_revoked\",\n              \"issued\",\n              \"uploaded\",\n              \"approved\",\n              \"errored\",\n              \"bad_authz\",\n              \"destroy_pending\",\n              \"dns_changed\"\n            ],\n            \"examples\": [\n              \"approved\"\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Certificate is approved\"\n            ]\n          },\n          \"domains\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"description\": \"Array of the domain set and its alternate name (if it is configured)\",\n            \"examples\": [\n              \"example.com\",\n              \"www.example.com\"\n            ]\n          },\n          \"expires_at\": {\n            \"type\": \"string\",\n            \"format\": \"date\"\n          }\n        },\n        \"required\": [\n          \"state\",\n          \"description\",\n          \"domains\"\n        ]\n      },\n      \"page\": {\n        \"title\": \"GitHub Pages\",\n        \"description\": \"The configuration for GitHub Pages for a repository.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"description\": \"The API address for accessing this Page resource.\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/pages\"\n            ]\n          },\n          \"status\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"The status of the most recent build of the Page.\",\n            \"enum\": [\n              \"built\",\n              \"building\",\n              \"errored\",\n              null\n            ],\n            \"examples\": [\n              \"built\"\n            ]\n          },\n          \"cname\": {\n            \"description\": \"The Pages site's custom domain\",\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"example.com\"\n            ]\n          },\n          \"protected_domain_state\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"The state if the domain is verified\",\n            \"enum\": [\n              \"pending\",\n              \"verified\",\n              \"unverified\",\n              null\n            ],\n            \"examples\": [\n              \"pending\"\n            ]\n          },\n          \"pending_domain_unverified_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"The timestamp when a pending domain becomes unverified.\",\n            \"format\": \"date-time\"\n          },\n          \"custom_404\": {\n            \"type\": \"boolean\",\n            \"description\": \"Whether the Page has a custom 404 page.\",\n            \"default\": false,\n            \"examples\": [\n              false\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"description\": \"The web address the Page can be accessed from.\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://example.com\"\n            ]\n          },\n          \"source\": {\n            \"$ref\": \"#/components/schemas/pages-source-hash\"\n          },\n          \"public\": {\n            \"type\": \"boolean\",\n            \"description\": \"Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site.\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"https_certificate\": {\n            \"$ref\": \"#/components/schemas/pages-https-certificate\"\n          },\n          \"https_enforced\": {\n            \"type\": \"boolean\",\n            \"description\": \"Whether https is enabled on the domain\",\n            \"examples\": [\n              true\n            ]\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"status\",\n          \"cname\",\n          \"custom_404\",\n          \"public\"\n        ]\n      },\n      \"page-build\": {\n        \"title\": \"Page Build\",\n        \"description\": \"Page Build\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"status\": {\n            \"type\": \"string\"\n          },\n          \"error\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"message\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              }\n            },\n            \"required\": [\n              \"message\"\n            ]\n          },\n          \"pusher\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"commit\": {\n            \"type\": \"string\"\n          },\n          \"duration\": {\n            \"type\": \"integer\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"status\",\n          \"error\",\n          \"pusher\",\n          \"commit\",\n          \"duration\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"page-build-status\": {\n        \"title\": \"Page Build Status\",\n        \"description\": \"Page Build Status\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/github/hello-world/pages/builds/latest\"\n            ]\n          },\n          \"status\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"queued\"\n            ]\n          }\n        },\n        \"required\": [\n          \"url\",\n          \"status\"\n        ]\n      },\n      \"repository-pre-receive-hook\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"enforcement\": {\n            \"type\": \"string\"\n          },\n          \"configuration_url\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"pull-request\": {\n        \"type\": \"object\",\n        \"title\": \"Pull Request\",\n        \"description\": \"Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDExOlB1bGxSZXF1ZXN0MQ==\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/1347\"\n            ]\n          },\n          \"diff_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/1347.diff\"\n            ]\n          },\n          \"patch_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/1347.patch\"\n            ]\n          },\n          \"issue_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/issues/1347\"\n            ]\n          },\n          \"commits_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\"\n            ]\n          },\n          \"review_comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\"\n            ]\n          },\n          \"review_comment_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"\n            ]\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\"\n            ]\n          },\n          \"statuses_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"number\": {\n            \"description\": \"Number uniquely identifying the pull request within its repository.\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"state\": {\n            \"description\": \"State of this Pull Request. Either `open` or `closed`.\",\n            \"enum\": [\n              \"open\",\n              \"closed\"\n            ],\n            \"type\": \"string\",\n            \"examples\": [\n              \"open\"\n            ]\n          },\n          \"locked\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"title\": {\n            \"description\": \"The title of the pull request.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Amazing new feature\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"body\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"Please pull these awesome changes\"\n            ]\n          },\n          \"labels\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"integer\",\n                  \"format\": \"int64\"\n                },\n                \"node_id\": {\n                  \"type\": \"string\"\n                },\n                \"url\": {\n                  \"type\": \"string\"\n                },\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"description\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ]\n                },\n                \"color\": {\n                  \"type\": \"string\"\n                },\n                \"default\": {\n                  \"type\": \"boolean\"\n                }\n              },\n              \"required\": [\n                \"id\",\n                \"node_id\",\n                \"url\",\n                \"name\",\n                \"description\",\n                \"color\",\n                \"default\"\n              ]\n            }\n          },\n          \"milestone\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/milestone\"\n              }\n            ]\n          },\n          \"active_lock_reason\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"too heated\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"closed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"merged_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-01-26T19:01:12Z\"\n            ]\n          },\n          \"merge_commit_sha\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"e5bd3914e2e596debea16f433f57875b5b90bcd6\"\n            ]\n          },\n          \"assignee\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"assignees\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/simple-user\"\n            }\n          },\n          \"requested_reviewers\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/simple-user\"\n            }\n          },\n          \"requested_teams\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/team-simple\"\n            }\n          },\n          \"head\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"label\": {\n                \"type\": \"string\"\n              },\n              \"ref\": {\n                \"type\": \"string\"\n              },\n              \"repo\": {\n                \"type\": [\n                  \"object\",\n                  \"null\"\n                ],\n                \"properties\": {\n                  \"archive_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"assignees_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"blobs_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"branches_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"collaborators_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"comments_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"commits_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"compare_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"contents_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"contributors_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"deployments_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"description\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"downloads_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"events_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"fork\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"forks_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"full_name\": {\n                    \"type\": \"string\"\n                  },\n                  \"git_commits_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"git_refs_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"git_tags_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"hooks_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"html_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"id\": {\n                    \"type\": \"integer\"\n                  },\n                  \"node_id\": {\n                    \"type\": \"string\"\n                  },\n                  \"issue_comment_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"issue_events_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"issues_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"keys_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"labels_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"languages_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"merges_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"milestones_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\"\n                  },\n                  \"notifications_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"owner\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"avatar_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"events_url\": {\n                        \"type\": \"string\"\n                      },\n                      \"followers_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"following_url\": {\n                        \"type\": \"string\"\n                      },\n                      \"gists_url\": {\n                        \"type\": \"string\"\n                      },\n                      \"gravatar_id\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ]\n                      },\n                      \"html_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"id\": {\n                        \"type\": \"integer\"\n                      },\n                      \"node_id\": {\n                        \"type\": \"string\"\n                      },\n                      \"login\": {\n                        \"type\": \"string\"\n                      },\n                      \"organizations_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"received_events_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"repos_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"site_admin\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"starred_url\": {\n                        \"type\": \"string\"\n                      },\n                      \"subscriptions_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"type\": {\n                        \"type\": \"string\"\n                      },\n                      \"url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      }\n                    },\n                    \"required\": [\n                      \"avatar_url\",\n                      \"events_url\",\n                      \"followers_url\",\n                      \"following_url\",\n                      \"gists_url\",\n                      \"gravatar_id\",\n                      \"html_url\",\n                      \"id\",\n                      \"node_id\",\n                      \"login\",\n                      \"organizations_url\",\n                      \"received_events_url\",\n                      \"repos_url\",\n                      \"site_admin\",\n                      \"starred_url\",\n                      \"subscriptions_url\",\n                      \"type\",\n                      \"url\"\n                    ]\n                  },\n                  \"private\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"pulls_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"releases_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"stargazers_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"statuses_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"subscribers_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"subscription_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"tags_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"teams_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"trees_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"clone_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"default_branch\": {\n                    \"type\": \"string\"\n                  },\n                  \"forks\": {\n                    \"type\": \"integer\"\n                  },\n                  \"forks_count\": {\n                    \"type\": \"integer\"\n                  },\n                  \"git_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"has_downloads\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"has_issues\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"has_projects\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"has_wiki\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"has_pages\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"homepage\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"format\": \"uri\"\n                  },\n                  \"language\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"master_branch\": {\n                    \"type\": \"string\"\n                  },\n                  \"archived\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"disabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"visibility\": {\n                    \"description\": \"The repository visibility: public, private, or internal.\",\n                    \"type\": \"string\"\n                  },\n                  \"mirror_url\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"format\": \"uri\"\n                  },\n                  \"open_issues\": {\n                    \"type\": \"integer\"\n                  },\n                  \"open_issues_count\": {\n                    \"type\": \"integer\"\n                  },\n                  \"permissions\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"admin\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"maintain\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"push\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"triage\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"pull\": {\n                        \"type\": \"boolean\"\n                      }\n                    },\n                    \"required\": [\n                      \"admin\",\n                      \"pull\",\n                      \"push\"\n                    ]\n                  },\n                  \"temp_clone_token\": {\n                    \"type\": \"string\"\n                  },\n                  \"allow_merge_commit\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"allow_squash_merge\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"allow_rebase_merge\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"license\": {\n                    \"type\": [\n                      \"object\",\n                      \"null\"\n                    ],\n                    \"properties\": {\n                      \"key\": {\n                        \"type\": \"string\"\n                      },\n                      \"name\": {\n                        \"type\": \"string\"\n                      },\n                      \"url\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ],\n                        \"format\": \"uri\"\n                      },\n                      \"spdx_id\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ]\n                      },\n                      \"node_id\": {\n                        \"type\": \"string\"\n                      }\n                    },\n                    \"required\": [\n                      \"key\",\n                      \"name\",\n                      \"url\",\n                      \"spdx_id\",\n                      \"node_id\"\n                    ]\n                  },\n                  \"pushed_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\"\n                  },\n                  \"size\": {\n                    \"type\": \"integer\"\n                  },\n                  \"ssh_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"stargazers_count\": {\n                    \"type\": \"integer\"\n                  },\n                  \"svn_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"topics\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"watchers\": {\n                    \"type\": \"integer\"\n                  },\n                  \"watchers_count\": {\n                    \"type\": \"integer\"\n                  },\n                  \"created_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\"\n                  },\n                  \"updated_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\"\n                  },\n                  \"allow_forking\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"is_template\": {\n                    \"type\": \"boolean\"\n                  }\n                },\n                \"required\": [\n                  \"archive_url\",\n                  \"assignees_url\",\n                  \"blobs_url\",\n                  \"branches_url\",\n                  \"collaborators_url\",\n                  \"comments_url\",\n                  \"commits_url\",\n                  \"compare_url\",\n                  \"contents_url\",\n                  \"contributors_url\",\n                  \"deployments_url\",\n                  \"description\",\n                  \"downloads_url\",\n                  \"events_url\",\n                  \"fork\",\n                  \"forks_url\",\n                  \"full_name\",\n                  \"git_commits_url\",\n                  \"git_refs_url\",\n                  \"git_tags_url\",\n                  \"hooks_url\",\n                  \"html_url\",\n                  \"id\",\n                  \"node_id\",\n                  \"issue_comment_url\",\n                  \"issue_events_url\",\n                  \"issues_url\",\n                  \"keys_url\",\n                  \"labels_url\",\n                  \"languages_url\",\n                  \"merges_url\",\n                  \"milestones_url\",\n                  \"name\",\n                  \"notifications_url\",\n                  \"owner\",\n                  \"private\",\n                  \"pulls_url\",\n                  \"releases_url\",\n                  \"stargazers_url\",\n                  \"statuses_url\",\n                  \"subscribers_url\",\n                  \"subscription_url\",\n                  \"tags_url\",\n                  \"teams_url\",\n                  \"trees_url\",\n                  \"url\",\n                  \"clone_url\",\n                  \"default_branch\",\n                  \"forks\",\n                  \"forks_count\",\n                  \"git_url\",\n                  \"has_downloads\",\n                  \"has_issues\",\n                  \"has_projects\",\n                  \"has_wiki\",\n                  \"has_pages\",\n                  \"homepage\",\n                  \"language\",\n                  \"archived\",\n                  \"disabled\",\n                  \"mirror_url\",\n                  \"open_issues\",\n                  \"open_issues_count\",\n                  \"license\",\n                  \"pushed_at\",\n                  \"size\",\n                  \"ssh_url\",\n                  \"stargazers_count\",\n                  \"svn_url\",\n                  \"watchers\",\n                  \"watchers_count\",\n                  \"created_at\",\n                  \"updated_at\"\n                ]\n              },\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"user\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"avatar_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"events_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"followers_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"following_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"gists_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"gravatar_id\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"html_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"id\": {\n                    \"type\": \"integer\"\n                  },\n                  \"node_id\": {\n                    \"type\": \"string\"\n                  },\n                  \"login\": {\n                    \"type\": \"string\"\n                  },\n                  \"organizations_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"received_events_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"repos_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"site_admin\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"starred_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"subscriptions_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"type\": {\n                    \"type\": \"string\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  }\n                },\n                \"required\": [\n                  \"avatar_url\",\n                  \"events_url\",\n                  \"followers_url\",\n                  \"following_url\",\n                  \"gists_url\",\n                  \"gravatar_id\",\n                  \"html_url\",\n                  \"id\",\n                  \"node_id\",\n                  \"login\",\n                  \"organizations_url\",\n                  \"received_events_url\",\n                  \"repos_url\",\n                  \"site_admin\",\n                  \"starred_url\",\n                  \"subscriptions_url\",\n                  \"type\",\n                  \"url\"\n                ]\n              }\n            },\n            \"required\": [\n              \"label\",\n              \"ref\",\n              \"repo\",\n              \"sha\",\n              \"user\"\n            ]\n          },\n          \"base\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"label\": {\n                \"type\": \"string\"\n              },\n              \"ref\": {\n                \"type\": \"string\"\n              },\n              \"repo\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"archive_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"assignees_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"blobs_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"branches_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"collaborators_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"comments_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"commits_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"compare_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"contents_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"contributors_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"deployments_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"description\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"downloads_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"events_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"fork\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"forks_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"full_name\": {\n                    \"type\": \"string\"\n                  },\n                  \"git_commits_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"git_refs_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"git_tags_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"hooks_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"html_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"id\": {\n                    \"type\": \"integer\"\n                  },\n                  \"is_template\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"node_id\": {\n                    \"type\": \"string\"\n                  },\n                  \"issue_comment_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"issue_events_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"issues_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"keys_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"labels_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"languages_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"merges_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"milestones_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"name\": {\n                    \"type\": \"string\"\n                  },\n                  \"notifications_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"owner\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"avatar_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"events_url\": {\n                        \"type\": \"string\"\n                      },\n                      \"followers_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"following_url\": {\n                        \"type\": \"string\"\n                      },\n                      \"gists_url\": {\n                        \"type\": \"string\"\n                      },\n                      \"gravatar_id\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ]\n                      },\n                      \"html_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"id\": {\n                        \"type\": \"integer\"\n                      },\n                      \"node_id\": {\n                        \"type\": \"string\"\n                      },\n                      \"login\": {\n                        \"type\": \"string\"\n                      },\n                      \"organizations_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"received_events_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"repos_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"site_admin\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"starred_url\": {\n                        \"type\": \"string\"\n                      },\n                      \"subscriptions_url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      },\n                      \"type\": {\n                        \"type\": \"string\"\n                      },\n                      \"url\": {\n                        \"type\": \"string\",\n                        \"format\": \"uri\"\n                      }\n                    },\n                    \"required\": [\n                      \"avatar_url\",\n                      \"events_url\",\n                      \"followers_url\",\n                      \"following_url\",\n                      \"gists_url\",\n                      \"gravatar_id\",\n                      \"html_url\",\n                      \"id\",\n                      \"node_id\",\n                      \"login\",\n                      \"organizations_url\",\n                      \"received_events_url\",\n                      \"repos_url\",\n                      \"site_admin\",\n                      \"starred_url\",\n                      \"subscriptions_url\",\n                      \"type\",\n                      \"url\"\n                    ]\n                  },\n                  \"private\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"pulls_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"releases_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"stargazers_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"statuses_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"subscribers_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"subscription_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"tags_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"teams_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"trees_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"clone_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"default_branch\": {\n                    \"type\": \"string\"\n                  },\n                  \"forks\": {\n                    \"type\": \"integer\"\n                  },\n                  \"forks_count\": {\n                    \"type\": \"integer\"\n                  },\n                  \"git_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"has_downloads\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"has_issues\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"has_projects\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"has_wiki\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"has_pages\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"homepage\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"format\": \"uri\"\n                  },\n                  \"language\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"master_branch\": {\n                    \"type\": \"string\"\n                  },\n                  \"archived\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"disabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"visibility\": {\n                    \"description\": \"The repository visibility: public, private, or internal.\",\n                    \"type\": \"string\"\n                  },\n                  \"mirror_url\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ],\n                    \"format\": \"uri\"\n                  },\n                  \"open_issues\": {\n                    \"type\": \"integer\"\n                  },\n                  \"open_issues_count\": {\n                    \"type\": \"integer\"\n                  },\n                  \"permissions\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"admin\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"maintain\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"push\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"triage\": {\n                        \"type\": \"boolean\"\n                      },\n                      \"pull\": {\n                        \"type\": \"boolean\"\n                      }\n                    },\n                    \"required\": [\n                      \"admin\",\n                      \"pull\",\n                      \"push\"\n                    ]\n                  },\n                  \"temp_clone_token\": {\n                    \"type\": \"string\"\n                  },\n                  \"allow_merge_commit\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"allow_squash_merge\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"allow_rebase_merge\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"license\": {\n                    \"anyOf\": [\n                      {\n                        \"type\": \"null\"\n                      },\n                      {\n                        \"$ref\": \"#/components/schemas/license-simple\"\n                      }\n                    ]\n                  },\n                  \"pushed_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\"\n                  },\n                  \"size\": {\n                    \"type\": \"integer\"\n                  },\n                  \"ssh_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"stargazers_count\": {\n                    \"type\": \"integer\"\n                  },\n                  \"svn_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"topics\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"watchers\": {\n                    \"type\": \"integer\"\n                  },\n                  \"watchers_count\": {\n                    \"type\": \"integer\"\n                  },\n                  \"created_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\"\n                  },\n                  \"updated_at\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\"\n                  },\n                  \"allow_forking\": {\n                    \"type\": \"boolean\"\n                  }\n                },\n                \"required\": [\n                  \"archive_url\",\n                  \"assignees_url\",\n                  \"blobs_url\",\n                  \"branches_url\",\n                  \"collaborators_url\",\n                  \"comments_url\",\n                  \"commits_url\",\n                  \"compare_url\",\n                  \"contents_url\",\n                  \"contributors_url\",\n                  \"deployments_url\",\n                  \"description\",\n                  \"downloads_url\",\n                  \"events_url\",\n                  \"fork\",\n                  \"forks_url\",\n                  \"full_name\",\n                  \"git_commits_url\",\n                  \"git_refs_url\",\n                  \"git_tags_url\",\n                  \"hooks_url\",\n                  \"html_url\",\n                  \"id\",\n                  \"node_id\",\n                  \"issue_comment_url\",\n                  \"issue_events_url\",\n                  \"issues_url\",\n                  \"keys_url\",\n                  \"labels_url\",\n                  \"languages_url\",\n                  \"merges_url\",\n                  \"milestones_url\",\n                  \"name\",\n                  \"notifications_url\",\n                  \"owner\",\n                  \"private\",\n                  \"pulls_url\",\n                  \"releases_url\",\n                  \"stargazers_url\",\n                  \"statuses_url\",\n                  \"subscribers_url\",\n                  \"subscription_url\",\n                  \"tags_url\",\n                  \"teams_url\",\n                  \"trees_url\",\n                  \"url\",\n                  \"clone_url\",\n                  \"default_branch\",\n                  \"forks\",\n                  \"forks_count\",\n                  \"git_url\",\n                  \"has_downloads\",\n                  \"has_issues\",\n                  \"has_projects\",\n                  \"has_wiki\",\n                  \"has_pages\",\n                  \"homepage\",\n                  \"language\",\n                  \"archived\",\n                  \"disabled\",\n                  \"mirror_url\",\n                  \"open_issues\",\n                  \"open_issues_count\",\n                  \"license\",\n                  \"pushed_at\",\n                  \"size\",\n                  \"ssh_url\",\n                  \"stargazers_count\",\n                  \"svn_url\",\n                  \"watchers\",\n                  \"watchers_count\",\n                  \"created_at\",\n                  \"updated_at\"\n                ]\n              },\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"user\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"avatar_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"events_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"followers_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"following_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"gists_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"gravatar_id\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"html_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"id\": {\n                    \"type\": \"integer\"\n                  },\n                  \"node_id\": {\n                    \"type\": \"string\"\n                  },\n                  \"login\": {\n                    \"type\": \"string\"\n                  },\n                  \"organizations_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"received_events_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"repos_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"site_admin\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"starred_url\": {\n                    \"type\": \"string\"\n                  },\n                  \"subscriptions_url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  },\n                  \"type\": {\n                    \"type\": \"string\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  }\n                },\n                \"required\": [\n                  \"avatar_url\",\n                  \"events_url\",\n                  \"followers_url\",\n                  \"following_url\",\n                  \"gists_url\",\n                  \"gravatar_id\",\n                  \"html_url\",\n                  \"id\",\n                  \"node_id\",\n                  \"login\",\n                  \"organizations_url\",\n                  \"received_events_url\",\n                  \"repos_url\",\n                  \"site_admin\",\n                  \"starred_url\",\n                  \"subscriptions_url\",\n                  \"type\",\n                  \"url\"\n                ]\n              }\n            },\n            \"required\": [\n              \"label\",\n              \"ref\",\n              \"repo\",\n              \"sha\",\n              \"user\"\n            ]\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"comments\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"commits\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"statuses\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"html\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"issue\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"review_comments\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"review_comment\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"self\": {\n                \"$ref\": \"#/components/schemas/link\"\n              }\n            },\n            \"required\": [\n              \"comments\",\n              \"commits\",\n              \"statuses\",\n              \"html\",\n              \"issue\",\n              \"review_comments\",\n              \"review_comment\",\n              \"self\"\n            ]\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"draft\": {\n            \"description\": \"Indicates whether or not the pull request is a draft.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          },\n          \"merged\": {\n            \"type\": \"boolean\"\n          },\n          \"mergeable\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ],\n            \"examples\": [\n              true\n            ]\n          },\n          \"rebaseable\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ],\n            \"examples\": [\n              true\n            ]\n          },\n          \"mergeable_state\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"clean\"\n            ]\n          },\n          \"merged_by\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"comments\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              10\n            ]\n          },\n          \"review_comments\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"maintainer_can_modify\": {\n            \"description\": \"Indicates whether maintainers can modify the pull request.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"commits\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              3\n            ]\n          },\n          \"additions\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              100\n            ]\n          },\n          \"deletions\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              3\n            ]\n          },\n          \"changed_files\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              5\n            ]\n          }\n        },\n        \"required\": [\n          \"_links\",\n          \"assignee\",\n          \"labels\",\n          \"base\",\n          \"body\",\n          \"closed_at\",\n          \"comments_url\",\n          \"commits_url\",\n          \"created_at\",\n          \"diff_url\",\n          \"head\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"issue_url\",\n          \"merge_commit_sha\",\n          \"merged_at\",\n          \"milestone\",\n          \"number\",\n          \"patch_url\",\n          \"review_comment_url\",\n          \"review_comments_url\",\n          \"statuses_url\",\n          \"state\",\n          \"locked\",\n          \"title\",\n          \"updated_at\",\n          \"url\",\n          \"user\",\n          \"author_association\",\n          \"additions\",\n          \"changed_files\",\n          \"comments\",\n          \"commits\",\n          \"deletions\",\n          \"mergeable\",\n          \"mergeable_state\",\n          \"merged\",\n          \"maintainer_can_modify\",\n          \"merged_by\",\n          \"review_comments\"\n        ]\n      },\n      \"pull-request-merge-result\": {\n        \"title\": \"Pull Request Merge Result\",\n        \"description\": \"Pull Request Merge Result\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"merged\": {\n            \"type\": \"boolean\"\n          },\n          \"message\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"merged\",\n          \"message\",\n          \"sha\"\n        ]\n      },\n      \"pull-request-review-request\": {\n        \"title\": \"Pull Request Review Request\",\n        \"description\": \"Pull Request Review Request\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"users\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/simple-user\"\n            }\n          },\n          \"teams\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/team\"\n            }\n          }\n        },\n        \"required\": [\n          \"users\",\n          \"teams\"\n        ]\n      },\n      \"pull-request-review\": {\n        \"title\": \"Pull Request Review\",\n        \"description\": \"Pull Request Reviews are reviews on pull requests.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"Unique identifier of the review\",\n            \"type\": \"integer\",\n            \"examples\": [\n              42\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\"\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"body\": {\n            \"description\": \"The text of the review.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"This looks great.\"\n            ]\n          },\n          \"state\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"CHANGES_REQUESTED\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\"\n            ]\n          },\n          \"pull_request_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/12\"\n            ]\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"html\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"href\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"href\"\n                ]\n              },\n              \"pull_request\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"href\": {\n                    \"type\": \"string\"\n                  }\n                },\n                \"required\": [\n                  \"href\"\n                ]\n              }\n            },\n            \"required\": [\n              \"html\",\n              \"pull_request\"\n            ]\n          },\n          \"submitted_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"commit_id\": {\n            \"description\": \"A commit SHA for the review.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"54bb654c9e6025347f57900a4a5c2313a96b8035\"\n            ]\n          },\n          \"body_html\": {\n            \"type\": \"string\"\n          },\n          \"body_text\": {\n            \"type\": \"string\"\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"user\",\n          \"body\",\n          \"state\",\n          \"commit_id\",\n          \"html_url\",\n          \"pull_request_url\",\n          \"_links\",\n          \"author_association\"\n        ]\n      },\n      \"review-comment\": {\n        \"title\": \"Legacy Review Comment\",\n        \"description\": \"Legacy Review Comment\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\"\n            ]\n          },\n          \"pull_request_review_id\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              42\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              10\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\"\n            ]\n          },\n          \"diff_hunk\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n            ]\n          },\n          \"path\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"file1.txt\"\n            ]\n          },\n          \"position\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              1\n            ]\n          },\n          \"original_position\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              4\n            ]\n          },\n          \"commit_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            ]\n          },\n          \"original_commit_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\"\n            ]\n          },\n          \"in_reply_to_id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              8\n            ]\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"body\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"Great stuff\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2011-04-14T16:00:49Z\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\"\n            ]\n          },\n          \"pull_request_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/Hello-World/pulls/1\"\n            ]\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"_links\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"self\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"html\": {\n                \"$ref\": \"#/components/schemas/link\"\n              },\n              \"pull_request\": {\n                \"$ref\": \"#/components/schemas/link\"\n              }\n            },\n            \"required\": [\n              \"self\",\n              \"html\",\n              \"pull_request\"\n            ]\n          },\n          \"body_text\": {\n            \"type\": \"string\"\n          },\n          \"body_html\": {\n            \"type\": \"string\"\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          },\n          \"side\": {\n            \"description\": \"The side of the first line of the range for a multi-line comment.\",\n            \"enum\": [\n              \"LEFT\",\n              \"RIGHT\"\n            ],\n            \"default\": \"RIGHT\",\n            \"type\": \"string\"\n          },\n          \"start_side\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"description\": \"The side of the first line of the range for a multi-line comment.\",\n            \"enum\": [\n              \"LEFT\",\n              \"RIGHT\",\n              null\n            ],\n            \"default\": \"RIGHT\"\n          },\n          \"line\": {\n            \"description\": \"The line of the blob to which the comment applies. The last line of the range for a multi-line comment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"original_line\": {\n            \"description\": \"The original line of the blob to which the comment applies. The last line of the range for a multi-line comment\",\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"start_line\": {\n            \"description\": \"The first line of the range for a multi-line comment.\",\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              2\n            ]\n          },\n          \"original_start_line\": {\n            \"description\": \"The original first line of the range for a multi-line comment.\",\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ],\n            \"examples\": [\n              2\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"body\",\n          \"diff_hunk\",\n          \"path\",\n          \"position\",\n          \"original_position\",\n          \"commit_id\",\n          \"original_commit_id\",\n          \"user\",\n          \"pull_request_review_id\",\n          \"html_url\",\n          \"pull_request_url\",\n          \"_links\",\n          \"author_association\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"release-asset\": {\n        \"title\": \"Release Asset\",\n        \"description\": \"Data related to a release.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"browser_download_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"name\": {\n            \"description\": \"The file name of the asset.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"Team Environment\"\n            ]\n          },\n          \"label\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"state\": {\n            \"description\": \"State of the release asset.\",\n            \"type\": \"string\",\n            \"enum\": [\n              \"uploaded\",\n              \"open\"\n            ]\n          },\n          \"content_type\": {\n            \"type\": \"string\"\n          },\n          \"size\": {\n            \"type\": \"integer\"\n          },\n          \"download_count\": {\n            \"type\": \"integer\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"uploader\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"content_type\",\n          \"size\",\n          \"state\",\n          \"url\",\n          \"node_id\",\n          \"download_count\",\n          \"label\",\n          \"uploader\",\n          \"browser_download_url\",\n          \"created_at\",\n          \"updated_at\"\n        ]\n      },\n      \"release\": {\n        \"title\": \"Release\",\n        \"description\": \"A release.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"assets_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"upload_url\": {\n            \"type\": \"string\"\n          },\n          \"tarball_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"zipball_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"tag_name\": {\n            \"description\": \"The name of the tag.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"v1.0.0\"\n            ]\n          },\n          \"target_commitish\": {\n            \"description\": \"Specifies the commitish value that determines where the Git tag is created from.\",\n            \"type\": \"string\",\n            \"examples\": [\n              \"master\"\n            ]\n          },\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"body\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"draft\": {\n            \"description\": \"true to create a draft (unpublished) release, false to create a published one.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          },\n          \"prerelease\": {\n            \"description\": \"Whether to identify the release as a prerelease or a full release.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              false\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"published_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"author\": {\n            \"$ref\": \"#/components/schemas/simple-user\"\n          },\n          \"assets\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/release-asset\"\n            }\n          },\n          \"body_html\": {\n            \"type\": \"string\"\n          },\n          \"body_text\": {\n            \"type\": \"string\"\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          }\n        },\n        \"required\": [\n          \"assets_url\",\n          \"upload_url\",\n          \"tarball_url\",\n          \"zipball_url\",\n          \"created_at\",\n          \"published_at\",\n          \"draft\",\n          \"id\",\n          \"node_id\",\n          \"author\",\n          \"html_url\",\n          \"name\",\n          \"prerelease\",\n          \"tag_name\",\n          \"target_commitish\",\n          \"assets\",\n          \"url\"\n        ]\n      },\n      \"stargazer\": {\n        \"title\": \"Stargazer\",\n        \"description\": \"Stargazer\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"starred_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"starred_at\",\n          \"user\"\n        ]\n      },\n      \"code-frequency-stat\": {\n        \"title\": \"Code Frequency Stat\",\n        \"description\": \"Code Frequency Stat\",\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"commit-activity\": {\n        \"title\": \"Commit Activity\",\n        \"description\": \"Commit Activity\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"days\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"integer\"\n            },\n            \"examples\": [\n              0,\n              3,\n              26,\n              20,\n              39,\n              1,\n              0\n            ]\n          },\n          \"total\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              89\n            ]\n          },\n          \"week\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1336280400\n            ]\n          }\n        },\n        \"required\": [\n          \"days\",\n          \"total\",\n          \"week\"\n        ]\n      },\n      \"contributor-activity\": {\n        \"title\": \"Contributor Activity\",\n        \"description\": \"Contributor Activity\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"author\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"total\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              135\n            ]\n          },\n          \"weeks\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"w\": {\n                  \"type\": \"integer\"\n                },\n                \"a\": {\n                  \"type\": \"integer\"\n                },\n                \"d\": {\n                  \"type\": \"integer\"\n                },\n                \"c\": {\n                  \"type\": \"integer\"\n                }\n              }\n            },\n            \"examples\": [\n              {\n                \"w\": \"1367712000\",\n                \"a\": 6898,\n                \"d\": 77,\n                \"c\": 10\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"author\",\n          \"total\",\n          \"weeks\"\n        ]\n      },\n      \"participation-stats\": {\n        \"title\": \"Participation Stats\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"all\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"integer\"\n            }\n          },\n          \"owner\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"integer\"\n            }\n          }\n        },\n        \"required\": [\n          \"all\",\n          \"owner\"\n        ]\n      },\n      \"repository-subscription\": {\n        \"title\": \"Repository Invitation\",\n        \"description\": \"Repository invitations let you manage who you collaborate with.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"subscribed\": {\n            \"description\": \"Determines if notifications should be received from this repository.\",\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"ignored\": {\n            \"description\": \"Determines if all notifications should be blocked from this repository.\",\n            \"type\": \"boolean\"\n          },\n          \"reason\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2012-10-06T21:34:12Z\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example/subscription\"\n            ]\n          },\n          \"repository_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/repos/octocat/example\"\n            ]\n          }\n        },\n        \"required\": [\n          \"created_at\",\n          \"ignored\",\n          \"reason\",\n          \"subscribed\",\n          \"url\",\n          \"repository_url\"\n        ]\n      },\n      \"tag\": {\n        \"title\": \"Tag\",\n        \"description\": \"Tag\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"v0.1\"\n            ]\n          },\n          \"commit\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"sha\": {\n                \"type\": \"string\"\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"sha\",\n              \"url\"\n            ]\n          },\n          \"zipball_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/zipball/v0.1\"\n            ]\n          },\n          \"tarball_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat/Hello-World/tarball/v0.1\"\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"node_id\",\n          \"commit\",\n          \"zipball_url\",\n          \"tarball_url\"\n        ]\n      },\n      \"topic\": {\n        \"title\": \"Topic\",\n        \"description\": \"A topic aggregates entities that are related to a subject.\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"names\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          }\n        },\n        \"required\": [\n          \"names\"\n        ]\n      },\n      \"search-result-text-matches\": {\n        \"title\": \"Search Result Text Matches\",\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"object_url\": {\n              \"type\": \"string\"\n            },\n            \"object_type\": {\n              \"type\": [\n                \"string\",\n                \"null\"\n              ]\n            },\n            \"property\": {\n              \"type\": \"string\"\n            },\n            \"fragment\": {\n              \"type\": \"string\"\n            },\n            \"matches\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"text\": {\n                    \"type\": \"string\"\n                  },\n                  \"indices\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                      \"type\": \"integer\"\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"code-search-result-item\": {\n        \"title\": \"Code Search Result Item\",\n        \"description\": \"Code Search Result Item\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"path\": {\n            \"type\": \"string\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"git_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          },\n          \"score\": {\n            \"type\": \"number\"\n          },\n          \"file_size\": {\n            \"type\": \"integer\"\n          },\n          \"language\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"last_modified_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"line_numbers\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"examples\": [\n              \"73..77\",\n              \"77..78\"\n            ]\n          },\n          \"text_matches\": {\n            \"$ref\": \"#/components/schemas/search-result-text-matches\"\n          }\n        },\n        \"required\": [\n          \"score\",\n          \"name\",\n          \"path\",\n          \"sha\",\n          \"git_url\",\n          \"html_url\",\n          \"url\",\n          \"repository\"\n        ]\n      },\n      \"commit-search-result-item\": {\n        \"title\": \"Commit Search Result Item\",\n        \"description\": \"Commit Search Result Item\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"sha\": {\n            \"type\": \"string\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"commit\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"author\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\"\n                  },\n                  \"email\": {\n                    \"type\": \"string\"\n                  },\n                  \"date\": {\n                    \"type\": \"string\",\n                    \"format\": \"date-time\"\n                  }\n                },\n                \"required\": [\n                  \"name\",\n                  \"email\",\n                  \"date\"\n                ]\n              },\n              \"committer\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"null\"\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/git-user\"\n                  }\n                ]\n              },\n              \"comment_count\": {\n                \"type\": \"integer\"\n              },\n              \"message\": {\n                \"type\": \"string\"\n              },\n              \"tree\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"sha\": {\n                    \"type\": \"string\"\n                  },\n                  \"url\": {\n                    \"type\": \"string\",\n                    \"format\": \"uri\"\n                  }\n                },\n                \"required\": [\n                  \"sha\",\n                  \"url\"\n                ]\n              },\n              \"url\": {\n                \"type\": \"string\",\n                \"format\": \"uri\"\n              },\n              \"verification\": {\n                \"$ref\": \"#/components/schemas/verification\"\n              }\n            },\n            \"required\": [\n              \"author\",\n              \"committer\",\n              \"comment_count\",\n              \"message\",\n              \"tree\",\n              \"url\"\n            ]\n          },\n          \"author\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"committer\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/git-user\"\n              }\n            ]\n          },\n          \"parents\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"url\": {\n                  \"type\": \"string\"\n                },\n                \"html_url\": {\n                  \"type\": \"string\"\n                },\n                \"sha\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/minimal-repository\"\n          },\n          \"score\": {\n            \"type\": \"number\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"text_matches\": {\n            \"$ref\": \"#/components/schemas/search-result-text-matches\"\n          }\n        },\n        \"required\": [\n          \"sha\",\n          \"node_id\",\n          \"url\",\n          \"html_url\",\n          \"author\",\n          \"committer\",\n          \"parents\",\n          \"comments_url\",\n          \"commit\",\n          \"repository\",\n          \"score\"\n        ]\n      },\n      \"issue-search-result-item\": {\n        \"title\": \"Issue Search Result Item\",\n        \"description\": \"Issue Search Result Item\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"repository_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"labels_url\": {\n            \"type\": \"string\"\n          },\n          \"comments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"number\": {\n            \"type\": \"integer\"\n          },\n          \"title\": {\n            \"type\": \"string\"\n          },\n          \"locked\": {\n            \"type\": \"boolean\"\n          },\n          \"active_lock_reason\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"assignees\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"$ref\": \"#/components/schemas/simple-user\"\n            }\n          },\n          \"user\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"labels\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"integer\",\n                  \"format\": \"int64\"\n                },\n                \"node_id\": {\n                  \"type\": \"string\"\n                },\n                \"url\": {\n                  \"type\": \"string\"\n                },\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"color\": {\n                  \"type\": \"string\"\n                },\n                \"default\": {\n                  \"type\": \"boolean\"\n                },\n                \"description\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ]\n                }\n              }\n            }\n          },\n          \"state\": {\n            \"type\": \"string\"\n          },\n          \"assignee\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"milestone\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/milestone\"\n              }\n            ]\n          },\n          \"comments\": {\n            \"type\": \"integer\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"closed_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"text_matches\": {\n            \"$ref\": \"#/components/schemas/search-result-text-matches\"\n          },\n          \"pull_request\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"merged_at\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"date-time\"\n              },\n              \"diff_url\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"html_url\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"patch_url\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              },\n              \"url\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ],\n                \"format\": \"uri\"\n              }\n            },\n            \"required\": [\n              \"diff_url\",\n              \"html_url\",\n              \"patch_url\",\n              \"url\"\n            ]\n          },\n          \"body\": {\n            \"type\": \"string\"\n          },\n          \"score\": {\n            \"type\": \"number\"\n          },\n          \"author_association\": {\n            \"$ref\": \"#/components/schemas/author_association\"\n          },\n          \"draft\": {\n            \"type\": \"boolean\"\n          },\n          \"repository\": {\n            \"$ref\": \"#/components/schemas/repository\"\n          },\n          \"body_html\": {\n            \"type\": \"string\"\n          },\n          \"body_text\": {\n            \"type\": \"string\"\n          },\n          \"timeline_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"performed_via_github_app\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/integration\"\n              }\n            ]\n          },\n          \"reactions\": {\n            \"$ref\": \"#/components/schemas/reaction-rollup\"\n          }\n        },\n        \"required\": [\n          \"assignee\",\n          \"closed_at\",\n          \"comments\",\n          \"comments_url\",\n          \"events_url\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"labels\",\n          \"labels_url\",\n          \"milestone\",\n          \"number\",\n          \"repository_url\",\n          \"state\",\n          \"locked\",\n          \"title\",\n          \"url\",\n          \"user\",\n          \"author_association\",\n          \"created_at\",\n          \"updated_at\",\n          \"score\"\n        ]\n      },\n      \"label-search-result-item\": {\n        \"title\": \"Label Search Result Item\",\n        \"description\": \"Label Search Result Item\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"color\": {\n            \"type\": \"string\"\n          },\n          \"default\": {\n            \"type\": \"boolean\"\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"score\": {\n            \"type\": \"number\"\n          },\n          \"text_matches\": {\n            \"$ref\": \"#/components/schemas/search-result-text-matches\"\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"node_id\",\n          \"url\",\n          \"name\",\n          \"color\",\n          \"default\",\n          \"description\",\n          \"score\"\n        ]\n      },\n      \"repo-search-result-item\": {\n        \"title\": \"Repo Search Result Item\",\n        \"description\": \"Repo Search Result Item\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"full_name\": {\n            \"type\": \"string\"\n          },\n          \"owner\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/simple-user\"\n              }\n            ]\n          },\n          \"private\": {\n            \"type\": \"boolean\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"fork\": {\n            \"type\": \"boolean\"\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"pushed_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"homepage\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"size\": {\n            \"type\": \"integer\"\n          },\n          \"stargazers_count\": {\n            \"type\": \"integer\"\n          },\n          \"watchers_count\": {\n            \"type\": \"integer\"\n          },\n          \"language\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"forks_count\": {\n            \"type\": \"integer\"\n          },\n          \"open_issues_count\": {\n            \"type\": \"integer\"\n          },\n          \"master_branch\": {\n            \"type\": \"string\"\n          },\n          \"default_branch\": {\n            \"type\": \"string\"\n          },\n          \"score\": {\n            \"type\": \"number\"\n          },\n          \"forks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"keys_url\": {\n            \"type\": \"string\"\n          },\n          \"collaborators_url\": {\n            \"type\": \"string\"\n          },\n          \"teams_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"hooks_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"issue_events_url\": {\n            \"type\": \"string\"\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"assignees_url\": {\n            \"type\": \"string\"\n          },\n          \"branches_url\": {\n            \"type\": \"string\"\n          },\n          \"tags_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"blobs_url\": {\n            \"type\": \"string\"\n          },\n          \"git_tags_url\": {\n            \"type\": \"string\"\n          },\n          \"git_refs_url\": {\n            \"type\": \"string\"\n          },\n          \"trees_url\": {\n            \"type\": \"string\"\n          },\n          \"statuses_url\": {\n            \"type\": \"string\"\n          },\n          \"languages_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"stargazers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"contributors_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"subscribers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"subscription_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"commits_url\": {\n            \"type\": \"string\"\n          },\n          \"git_commits_url\": {\n            \"type\": \"string\"\n          },\n          \"comments_url\": {\n            \"type\": \"string\"\n          },\n          \"issue_comment_url\": {\n            \"type\": \"string\"\n          },\n          \"contents_url\": {\n            \"type\": \"string\"\n          },\n          \"compare_url\": {\n            \"type\": \"string\"\n          },\n          \"merges_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"archive_url\": {\n            \"type\": \"string\"\n          },\n          \"downloads_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"issues_url\": {\n            \"type\": \"string\"\n          },\n          \"pulls_url\": {\n            \"type\": \"string\"\n          },\n          \"milestones_url\": {\n            \"type\": \"string\"\n          },\n          \"notifications_url\": {\n            \"type\": \"string\"\n          },\n          \"labels_url\": {\n            \"type\": \"string\"\n          },\n          \"releases_url\": {\n            \"type\": \"string\"\n          },\n          \"deployments_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"git_url\": {\n            \"type\": \"string\"\n          },\n          \"ssh_url\": {\n            \"type\": \"string\"\n          },\n          \"clone_url\": {\n            \"type\": \"string\"\n          },\n          \"svn_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"forks\": {\n            \"type\": \"integer\"\n          },\n          \"open_issues\": {\n            \"type\": \"integer\"\n          },\n          \"watchers\": {\n            \"type\": \"integer\"\n          },\n          \"topics\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"mirror_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"has_issues\": {\n            \"type\": \"boolean\"\n          },\n          \"has_projects\": {\n            \"type\": \"boolean\"\n          },\n          \"has_pages\": {\n            \"type\": \"boolean\"\n          },\n          \"has_wiki\": {\n            \"type\": \"boolean\"\n          },\n          \"has_downloads\": {\n            \"type\": \"boolean\"\n          },\n          \"archived\": {\n            \"type\": \"boolean\"\n          },\n          \"disabled\": {\n            \"type\": \"boolean\",\n            \"description\": \"Returns whether or not this repository disabled.\"\n          },\n          \"visibility\": {\n            \"description\": \"The repository visibility: public, private, or internal.\",\n            \"type\": \"string\"\n          },\n          \"license\": {\n            \"anyOf\": [\n              {\n                \"type\": \"null\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/license-simple\"\n              }\n            ]\n          },\n          \"permissions\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"admin\": {\n                \"type\": \"boolean\"\n              },\n              \"maintain\": {\n                \"type\": \"boolean\"\n              },\n              \"push\": {\n                \"type\": \"boolean\"\n              },\n              \"triage\": {\n                \"type\": \"boolean\"\n              },\n              \"pull\": {\n                \"type\": \"boolean\"\n              }\n            },\n            \"required\": [\n              \"admin\",\n              \"pull\",\n              \"push\"\n            ]\n          },\n          \"text_matches\": {\n            \"$ref\": \"#/components/schemas/search-result-text-matches\"\n          },\n          \"temp_clone_token\": {\n            \"type\": \"string\"\n          },\n          \"allow_merge_commit\": {\n            \"type\": \"boolean\"\n          },\n          \"allow_squash_merge\": {\n            \"type\": \"boolean\"\n          },\n          \"allow_rebase_merge\": {\n            \"type\": \"boolean\"\n          },\n          \"delete_branch_on_merge\": {\n            \"type\": \"boolean\"\n          },\n          \"allow_forking\": {\n            \"type\": \"boolean\"\n          },\n          \"is_template\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"archive_url\",\n          \"assignees_url\",\n          \"blobs_url\",\n          \"branches_url\",\n          \"collaborators_url\",\n          \"comments_url\",\n          \"commits_url\",\n          \"compare_url\",\n          \"contents_url\",\n          \"contributors_url\",\n          \"deployments_url\",\n          \"description\",\n          \"downloads_url\",\n          \"events_url\",\n          \"fork\",\n          \"forks_url\",\n          \"full_name\",\n          \"git_commits_url\",\n          \"git_refs_url\",\n          \"git_tags_url\",\n          \"hooks_url\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"issue_comment_url\",\n          \"issue_events_url\",\n          \"issues_url\",\n          \"keys_url\",\n          \"labels_url\",\n          \"languages_url\",\n          \"merges_url\",\n          \"milestones_url\",\n          \"name\",\n          \"notifications_url\",\n          \"owner\",\n          \"private\",\n          \"pulls_url\",\n          \"releases_url\",\n          \"stargazers_url\",\n          \"statuses_url\",\n          \"subscribers_url\",\n          \"subscription_url\",\n          \"tags_url\",\n          \"teams_url\",\n          \"trees_url\",\n          \"url\",\n          \"clone_url\",\n          \"default_branch\",\n          \"forks\",\n          \"forks_count\",\n          \"git_url\",\n          \"has_downloads\",\n          \"has_issues\",\n          \"has_projects\",\n          \"has_wiki\",\n          \"has_pages\",\n          \"homepage\",\n          \"language\",\n          \"archived\",\n          \"disabled\",\n          \"mirror_url\",\n          \"open_issues\",\n          \"open_issues_count\",\n          \"license\",\n          \"pushed_at\",\n          \"size\",\n          \"ssh_url\",\n          \"stargazers_count\",\n          \"svn_url\",\n          \"watchers\",\n          \"watchers_count\",\n          \"created_at\",\n          \"updated_at\",\n          \"score\"\n        ]\n      },\n      \"topic-search-result-item\": {\n        \"title\": \"Topic Search Result Item\",\n        \"description\": \"Topic Search Result Item\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"display_name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"short_description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"description\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_by\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"released\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"featured\": {\n            \"type\": \"boolean\"\n          },\n          \"curated\": {\n            \"type\": \"boolean\"\n          },\n          \"score\": {\n            \"type\": \"number\"\n          },\n          \"repository_count\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ]\n          },\n          \"logo_url\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"uri\"\n          },\n          \"text_matches\": {\n            \"$ref\": \"#/components/schemas/search-result-text-matches\"\n          },\n          \"related\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"topic_relation\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"id\": {\n                      \"type\": \"integer\"\n                    },\n                    \"name\": {\n                      \"type\": \"string\"\n                    },\n                    \"topic_id\": {\n                      \"type\": \"integer\"\n                    },\n                    \"relation_type\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              }\n            }\n          },\n          \"aliases\": {\n            \"type\": [\n              \"array\",\n              \"null\"\n            ],\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"topic_relation\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"id\": {\n                      \"type\": \"integer\"\n                    },\n                    \"name\": {\n                      \"type\": \"string\"\n                    },\n                    \"topic_id\": {\n                      \"type\": \"integer\"\n                    },\n                    \"relation_type\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"display_name\",\n          \"short_description\",\n          \"description\",\n          \"created_by\",\n          \"released\",\n          \"created_at\",\n          \"updated_at\",\n          \"featured\",\n          \"curated\",\n          \"score\"\n        ]\n      },\n      \"user-search-result-item\": {\n        \"title\": \"User Search Result Item\",\n        \"description\": \"User Search Result Item\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"login\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"node_id\": {\n            \"type\": \"string\"\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"gravatar_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"followers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"subscriptions_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"organizations_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"received_events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\"\n          },\n          \"type\": {\n            \"type\": \"string\"\n          },\n          \"score\": {\n            \"type\": \"number\"\n          },\n          \"following_url\": {\n            \"type\": \"string\"\n          },\n          \"gists_url\": {\n            \"type\": \"string\"\n          },\n          \"starred_url\": {\n            \"type\": \"string\"\n          },\n          \"events_url\": {\n            \"type\": \"string\"\n          },\n          \"public_repos\": {\n            \"type\": \"integer\"\n          },\n          \"public_gists\": {\n            \"type\": \"integer\"\n          },\n          \"followers\": {\n            \"type\": \"integer\"\n          },\n          \"following\": {\n            \"type\": \"integer\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"bio\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"email\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"email\"\n          },\n          \"location\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"site_admin\": {\n            \"type\": \"boolean\"\n          },\n          \"hireable\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ]\n          },\n          \"text_matches\": {\n            \"$ref\": \"#/components/schemas/search-result-text-matches\"\n          },\n          \"blog\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"company\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          },\n          \"suspended_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          }\n        },\n        \"required\": [\n          \"avatar_url\",\n          \"events_url\",\n          \"followers_url\",\n          \"following_url\",\n          \"gists_url\",\n          \"gravatar_id\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"login\",\n          \"organizations_url\",\n          \"received_events_url\",\n          \"repos_url\",\n          \"site_admin\",\n          \"starred_url\",\n          \"subscriptions_url\",\n          \"type\",\n          \"url\",\n          \"score\"\n        ]\n      },\n      \"configuration-status\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"status\": {\n            \"type\": \"string\"\n          },\n          \"progress\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"status\": {\n                  \"type\": \"string\"\n                },\n                \"key\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"required\": [\n                \"status\",\n                \"key\"\n              ]\n            }\n          }\n        }\n      },\n      \"maintenance-status\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"status\": {\n            \"type\": \"string\"\n          },\n          \"scheduled_time\": {\n            \"type\": \"string\"\n          },\n          \"connection_services\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"number\": {\n                  \"type\": \"integer\"\n                }\n              },\n              \"required\": [\n                \"name\",\n                \"number\"\n              ]\n            }\n          }\n        }\n      },\n      \"enterprise-settings\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"enterprise\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"private_mode\": {\n                \"type\": \"boolean\"\n              },\n              \"public_pages\": {\n                \"type\": \"boolean\"\n              },\n              \"subdomain_isolation\": {\n                \"type\": \"boolean\"\n              },\n              \"signup_enabled\": {\n                \"type\": \"boolean\"\n              },\n              \"github_hostname\": {\n                \"type\": \"string\"\n              },\n              \"identicons_host\": {\n                \"type\": \"string\"\n              },\n              \"http_proxy\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"auth_mode\": {\n                \"type\": \"string\"\n              },\n              \"expire_sessions\": {\n                \"type\": \"boolean\"\n              },\n              \"admin_password\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"configuration_id\": {\n                \"type\": \"integer\"\n              },\n              \"configuration_run_count\": {\n                \"type\": \"integer\"\n              },\n              \"avatar\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"uri\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"customer\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\"\n                  },\n                  \"email\": {\n                    \"type\": \"string\"\n                  },\n                  \"uuid\": {\n                    \"type\": \"string\"\n                  },\n                  \"secret_key_data\": {\n                    \"type\": \"string\"\n                  },\n                  \"public_key_data\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"license\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"seats\": {\n                    \"type\": \"integer\"\n                  },\n                  \"evaluation\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"perpetual\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"unlimited_seating\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"support_key\": {\n                    \"type\": \"string\"\n                  },\n                  \"ssh_allowed\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"cluster_support\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"expire_at\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"github_ssl\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"cert\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"key\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  }\n                }\n              },\n              \"ldap\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"host\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"port\": {\n                    \"type\": \"integer\"\n                  },\n                  \"base\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                    }\n                  },\n                  \"uid\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"bind_dn\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"password\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"method\": {\n                    \"type\": \"string\"\n                  },\n                  \"search_strategy\": {\n                    \"type\": \"string\"\n                  },\n                  \"user_groups\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                    }\n                  },\n                  \"admin_group\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"virtual_attribute_enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"recursive_group_search\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"posix_support\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"user_sync_emails\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"user_sync_keys\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"user_sync_interval\": {\n                    \"type\": \"integer\"\n                  },\n                  \"team_sync_interval\": {\n                    \"type\": \"integer\"\n                  },\n                  \"sync_enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"reconciliation\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"user\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ]\n                      },\n                      \"org\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ]\n                      }\n                    }\n                  },\n                  \"profile\": {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"uid\": {\n                        \"type\": \"string\"\n                      },\n                      \"name\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ]\n                      },\n                      \"mail\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ]\n                      },\n                      \"key\": {\n                        \"type\": [\n                          \"string\",\n                          \"null\"\n                        ]\n                      }\n                    }\n                  }\n                }\n              },\n              \"cas\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"url\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  }\n                }\n              },\n              \"saml\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"sso_url\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"certificate\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"certificate_path\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"issuer\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"idp_initiated_sso\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"disable_admin_demote\": {\n                    \"type\": \"boolean\"\n                  }\n                }\n              },\n              \"github_oauth\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"client_id\": {\n                    \"type\": \"string\"\n                  },\n                  \"client_secret\": {\n                    \"type\": \"string\"\n                  },\n                  \"organization_name\": {\n                    \"type\": \"string\"\n                  },\n                  \"organization_team\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"smtp\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"address\": {\n                    \"type\": \"string\"\n                  },\n                  \"authentication\": {\n                    \"type\": \"string\"\n                  },\n                  \"port\": {\n                    \"type\": \"string\"\n                  },\n                  \"domain\": {\n                    \"type\": \"string\"\n                  },\n                  \"username\": {\n                    \"type\": \"string\"\n                  },\n                  \"user_name\": {\n                    \"type\": \"string\"\n                  },\n                  \"enable_starttls_auto\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"password\": {\n                    \"type\": \"string\"\n                  },\n                  \"discard-to-noreply-address\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"support_address\": {\n                    \"type\": \"string\"\n                  },\n                  \"support_address_type\": {\n                    \"type\": \"string\"\n                  },\n                  \"noreply_address\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"ntp\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"primary_server\": {\n                    \"type\": \"string\"\n                  },\n                  \"secondary_server\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"timezone\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"snmp\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"community\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"syslog\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"server\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"protocol_name\": {\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              \"assets\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              },\n              \"pages\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"type\": \"boolean\"\n                  }\n                }\n              },\n              \"collectd\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"server\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"port\": {\n                    \"type\": \"integer\"\n                  },\n                  \"encryption\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"username\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"password\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  }\n                }\n              },\n              \"mapping\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"enabled\": {\n                    \"type\": \"boolean\"\n                  },\n                  \"tileserver\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  },\n                  \"basemap\": {\n                    \"type\": \"string\"\n                  },\n                  \"token\": {\n                    \"type\": [\n                      \"string\",\n                      \"null\"\n                    ]\n                  }\n                }\n              },\n              \"load_balancer\": {\n                \"type\": [\n                  \"string\",\n                  \"null\"\n                ]\n              }\n            }\n          },\n          \"run_list\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          }\n        }\n      },\n      \"ssh-key\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"key\": {\n            \"type\": \"string\"\n          },\n          \"pretty-print\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"private-user\": {\n        \"title\": \"Private User\",\n        \"description\": \"Private User\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"login\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"octocat\"\n            ]\n          },\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"node_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"MDQ6VXNlcjE=\"\n            ]\n          },\n          \"avatar_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/images/error/octocat_happy.gif\"\n            ]\n          },\n          \"gravatar_id\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"41d064eb2195891e12d0413f63227ea7\"\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat\"\n            ]\n          },\n          \"html_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://github.com/octocat\"\n            ]\n          },\n          \"followers_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/followers\"\n            ]\n          },\n          \"following_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/following{/other_user}\"\n            ]\n          },\n          \"gists_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/gists{/gist_id}\"\n            ]\n          },\n          \"starred_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/starred{/owner}{/repo}\"\n            ]\n          },\n          \"subscriptions_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/subscriptions\"\n            ]\n          },\n          \"organizations_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/orgs\"\n            ]\n          },\n          \"repos_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/repos\"\n            ]\n          },\n          \"events_url\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/events{/privacy}\"\n            ]\n          },\n          \"received_events_url\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"examples\": [\n              \"https://api.github.com/users/octocat/received_events\"\n            ]\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"User\"\n            ]\n          },\n          \"site_admin\": {\n            \"type\": \"boolean\"\n          },\n          \"name\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"monalisa octocat\"\n            ]\n          },\n          \"company\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"GitHub\"\n            ]\n          },\n          \"blog\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"https://github.com/blog\"\n            ]\n          },\n          \"location\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"San Francisco\"\n            ]\n          },\n          \"email\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"email\",\n            \"examples\": [\n              \"octocat@github.com\"\n            ]\n          },\n          \"hireable\": {\n            \"type\": [\n              \"boolean\",\n              \"null\"\n            ]\n          },\n          \"bio\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"There once was...\"\n            ]\n          },\n          \"public_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              2\n            ]\n          },\n          \"public_gists\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              1\n            ]\n          },\n          \"followers\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              20\n            ]\n          },\n          \"following\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              0\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2008-01-14T04:33:35Z\"\n            ]\n          },\n          \"updated_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2008-01-14T04:33:35Z\"\n            ]\n          },\n          \"private_gists\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              81\n            ]\n          },\n          \"total_private_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              100\n            ]\n          },\n          \"owned_private_repos\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              100\n            ]\n          },\n          \"disk_usage\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              10000\n            ]\n          },\n          \"collaborators\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              8\n            ]\n          },\n          \"two_factor_authentication\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"plan\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"collaborators\": {\n                \"type\": \"integer\"\n              },\n              \"name\": {\n                \"type\": \"string\"\n              },\n              \"space\": {\n                \"type\": \"integer\"\n              },\n              \"private_repos\": {\n                \"type\": \"integer\"\n              }\n            },\n            \"required\": [\n              \"collaborators\",\n              \"name\",\n              \"space\",\n              \"private_repos\"\n            ]\n          },\n          \"suspended_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"business_plus\": {\n            \"type\": \"boolean\"\n          },\n          \"ldap_dn\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"avatar_url\",\n          \"events_url\",\n          \"followers_url\",\n          \"following_url\",\n          \"gists_url\",\n          \"gravatar_id\",\n          \"html_url\",\n          \"id\",\n          \"node_id\",\n          \"login\",\n          \"organizations_url\",\n          \"received_events_url\",\n          \"repos_url\",\n          \"site_admin\",\n          \"starred_url\",\n          \"subscriptions_url\",\n          \"type\",\n          \"url\",\n          \"bio\",\n          \"blog\",\n          \"company\",\n          \"email\",\n          \"followers\",\n          \"following\",\n          \"hireable\",\n          \"location\",\n          \"name\",\n          \"public_gists\",\n          \"public_repos\",\n          \"created_at\",\n          \"updated_at\",\n          \"collaborators\",\n          \"disk_usage\",\n          \"owned_private_repos\",\n          \"private_gists\",\n          \"total_private_repos\",\n          \"two_factor_authentication\"\n        ]\n      },\n      \"email\": {\n        \"title\": \"Email\",\n        \"description\": \"Email\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"email\": {\n            \"type\": \"string\",\n            \"format\": \"email\",\n            \"examples\": [\n              \"octocat@github.com\"\n            ]\n          },\n          \"primary\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"verified\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"visibility\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"examples\": [\n              \"public\"\n            ]\n          }\n        },\n        \"required\": [\n          \"email\",\n          \"primary\",\n          \"verified\",\n          \"visibility\"\n        ]\n      },\n      \"gpg-key\": {\n        \"title\": \"GPG Key\",\n        \"description\": \"A unique encryption key\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"examples\": [\n              3\n            ]\n          },\n          \"primary_key_id\": {\n            \"type\": [\n              \"integer\",\n              \"null\"\n            ]\n          },\n          \"key_id\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"3262EFF25BA0D270\"\n            ]\n          },\n          \"public_key\": {\n            \"type\": \"string\",\n            \"examples\": [\n              \"xsBNBFayYZ...\"\n            ]\n          },\n          \"emails\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"email\": {\n                  \"type\": \"string\"\n                },\n                \"verified\": {\n                  \"type\": \"boolean\"\n                }\n              }\n            },\n            \"examples\": [\n              {\n                \"email\": \"mastahyeti@users.noreply.github.com\",\n                \"verified\": true\n              }\n            ]\n          },\n          \"subkeys\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"integer\"\n                },\n                \"primary_key_id\": {\n                  \"type\": \"integer\"\n                },\n                \"key_id\": {\n                  \"type\": \"string\"\n                },\n                \"public_key\": {\n                  \"type\": \"string\"\n                },\n                \"emails\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                  }\n                },\n                \"subkeys\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                  }\n                },\n                \"can_sign\": {\n                  \"type\": \"boolean\"\n                },\n                \"can_encrypt_comms\": {\n                  \"type\": \"boolean\"\n                },\n                \"can_encrypt_storage\": {\n                  \"type\": \"boolean\"\n                },\n                \"can_certify\": {\n                  \"type\": \"boolean\"\n                },\n                \"created_at\": {\n                  \"type\": \"string\"\n                },\n                \"expires_at\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ]\n                },\n                \"raw_key\": {\n                  \"type\": [\n                    \"string\",\n                    \"null\"\n                  ]\n                }\n              }\n            },\n            \"examples\": [\n              {\n                \"id\": 4,\n                \"primary_key_id\": 3,\n                \"key_id\": \"4A595D4C72EE49C7\",\n                \"public_key\": \"zsBNBFayYZ...\",\n                \"emails\": [\n\n                ],\n                \"subkeys\": [\n\n                ],\n                \"can_sign\": false,\n                \"can_encrypt_comms\": true,\n                \"can_encrypt_storage\": true,\n                \"can_certify\": false,\n                \"created_at\": \"2016-03-24T11:31:04-06:00\",\n                \"expires_at\": null\n              }\n            ]\n          },\n          \"can_sign\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"can_encrypt_comms\": {\n            \"type\": \"boolean\"\n          },\n          \"can_encrypt_storage\": {\n            \"type\": \"boolean\"\n          },\n          \"can_certify\": {\n            \"type\": \"boolean\",\n            \"examples\": [\n              true\n            ]\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"examples\": [\n              \"2016-03-24T11:31:04-06:00\"\n            ]\n          },\n          \"expires_at\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ],\n            \"format\": \"date-time\"\n          },\n          \"raw_key\": {\n            \"type\": [\n              \"string\",\n              \"null\"\n            ]\n          }\n        },\n        \"required\": [\n          \"id\",\n          \"primary_key_id\",\n          \"key_id\",\n          \"raw_key\",\n          \"public_key\",\n          \"created_at\",\n          \"expires_at\",\n          \"can_sign\",\n          \"can_encrypt_comms\",\n          \"can_encrypt_storage\",\n          \"can_certify\",\n          \"emails\",\n          \"subkeys\"\n        ]\n      },\n      \"key\": {\n        \"title\": \"Key\",\n        \"description\": \"Key\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"key\": {\n            \"type\": \"string\"\n          },\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"url\": {\n            \"type\": \"string\"\n          },\n          \"title\": {\n            \"type\": \"string\"\n          },\n          \"created_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"verified\": {\n            \"type\": \"boolean\"\n          },\n          \"read_only\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"key\",\n          \"id\",\n          \"url\",\n          \"title\",\n          \"created_at\",\n          \"verified\",\n          \"read_only\"\n        ]\n      },\n      \"starred-repository\": {\n        \"title\": \"Starred Repository\",\n        \"description\": \"Starred Repository\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"starred_at\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\"\n          },\n          \"repo\": {\n            \"$ref\": \"#/components/schemas/repository\"\n          }\n        },\n        \"required\": [\n          \"starred_at\",\n          \"repo\"\n        ]\n      },\n      \"hovercard\": {\n        \"title\": \"Hovercard\",\n        \"description\": \"Hovercard\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"contexts\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"message\": {\n                  \"type\": \"string\"\n                },\n                \"octicon\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"required\": [\n                \"message\",\n                \"octicon\"\n              ]\n            }\n          }\n        },\n        \"required\": [\n          \"contexts\"\n        ]\n      },\n      \"key-simple\": {\n        \"title\": \"Key Simple\",\n        \"description\": \"Key Simple\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"key\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"key\",\n          \"id\"\n        ]\n      }\n    },\n    \"examples\": {\n      \"global-hook-items\": {\n        \"value\": [\n          {\n            \"type\": \"Global\",\n            \"id\": 1,\n            \"name\": \"web\",\n            \"active\": true,\n            \"events\": [\n              \"organization\",\n              \"user\"\n            ],\n            \"config\": {\n              \"url\": \"https://example.com\",\n              \"content_type\": \"json\",\n              \"insecure_ssl\": \"0\",\n              \"secret\": \"********\"\n            },\n            \"updated_at\": \"2017-12-07T00:14:59Z\",\n            \"created_at\": \"2017-12-07T00:14:59Z\",\n            \"url\": \"https://api.github.com/admin/hooks/1\",\n            \"ping_url\": \"https://api.github.com/admin/hooks/1/pings\"\n          }\n        ]\n      },\n      \"global-hook\": {\n        \"value\": {\n          \"type\": \"Global\",\n          \"id\": 1,\n          \"name\": \"web\",\n          \"active\": true,\n          \"events\": [\n            \"organization\",\n            \"user\"\n          ],\n          \"config\": {\n            \"url\": \"https://example.com\",\n            \"content_type\": \"json\",\n            \"insecure_ssl\": \"0\",\n            \"secret\": \"********\"\n          },\n          \"updated_at\": \"2017-12-07T00:14:59Z\",\n          \"created_at\": \"2017-12-07T00:14:59Z\",\n          \"url\": \"https://api.github.com/admin/hooks/1\",\n          \"ping_url\": \"https://api.github.com/admin/hooks/1/pings\"\n        }\n      },\n      \"global-hook-2\": {\n        \"value\": {\n          \"type\": \"Global\",\n          \"id\": 1,\n          \"name\": \"web\",\n          \"active\": true,\n          \"events\": [\n            \"organization\"\n          ],\n          \"config\": {\n            \"url\": \"https://example.com\",\n            \"content_type\": \"form\",\n            \"insecure_ssl\": \"0\"\n          },\n          \"updated_at\": \"2017-12-07T00:14:59Z\",\n          \"created_at\": \"2017-12-07T00:14:59Z\",\n          \"url\": \"https://api.github.com/admin/hooks/1\",\n          \"ping_url\": \"https://api.github.com/admin/hooks/1/pings\"\n        }\n      },\n      \"enterprise-public-key-items\": {\n        \"value\": [\n          {\n            \"key\": \"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\",\n            \"id\": 2,\n            \"url\": \"https://api.github.com/user/keys/2\",\n            \"title\": \"ssh-rsa AAAAB3NzaC1yc2EAAA\",\n            \"created_at\": \"2020-06-11T21:31:57Z\",\n            \"verified\": false,\n            \"read_only\": false,\n            \"last_used\": \"2020-06-11T22:31:57Z\",\n            \"user_id\": 1,\n            \"repository_id\": 2\n          },\n          {\n            \"key\": \"9Og8iYjAyymI9LvABpJerYrMxURPc8r+dB7TJyvv1234\",\n            \"id\": 3,\n            \"url\": \"https://api.github.com/user/keys/2\",\n            \"title\": \"ssh-rsa AAAAB3NzaC1yc2EAAA\",\n            \"created_at\": \"2020-06-11T21:31:57Z\",\n            \"verified\": false,\n            \"read_only\": false,\n            \"last_used\": \"2020-06-11T22:31:57Z\",\n            \"user_id\": 1,\n            \"repository_id\": 2\n          }\n        ]\n      },\n      \"ldap-mapping-team\": {\n        \"value\": {\n          \"ldap_dn\": \"cn=Enterprise Ops,ou=teams,dc=github,dc=com\",\n          \"id\": 1,\n          \"node_id\": \"MDQ6VGVhbTE=\",\n          \"url\": \"https://api.github.com/teams/1\",\n          \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n          \"name\": \"Justice League\",\n          \"slug\": \"justice-league\",\n          \"description\": \"A great team.\",\n          \"privacy\": \"closed\",\n          \"permission\": \"admin\",\n          \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n          \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n          \"parent\": null\n        }\n      },\n      \"ldap-mapping-user\": {\n        \"value\": {\n          \"ldap_dn\": \"uid=asdf,ou=users,dc=github,dc=com\",\n          \"login\": \"octocat\",\n          \"id\": 1,\n          \"node_id\": \"MDQ6VXNlcjE=\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/octocat\",\n          \"html_url\": \"https://github.com/octocat\",\n          \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n          \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n          \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false,\n          \"name\": \"monalisa octocat\",\n          \"company\": \"GitHub\",\n          \"blog\": \"https://github.com/blog\",\n          \"location\": \"San Francisco\",\n          \"email\": \"octocat@github.com\",\n          \"hireable\": false,\n          \"bio\": \"There once was...\",\n          \"twitter_username\": \"monatheoctocat\",\n          \"public_repos\": 2,\n          \"public_gists\": 1,\n          \"followers\": 20,\n          \"following\": 0,\n          \"created_at\": \"2008-01-14T04:33:35Z\",\n          \"updated_at\": \"2008-01-14T04:33:35Z\",\n          \"private_gists\": 81,\n          \"total_private_repos\": 100,\n          \"owned_private_repos\": 100,\n          \"disk_usage\": 10000,\n          \"collaborators\": 8,\n          \"two_factor_authentication\": true,\n          \"plan\": {\n            \"name\": \"Medium\",\n            \"space\": 400,\n            \"private_repos\": 20,\n            \"collaborators\": 0\n          }\n        }\n      },\n      \"organization-simple\": {\n        \"value\": {\n          \"login\": \"github\",\n          \"id\": 1,\n          \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n          \"url\": \"https://api.github.com/orgs/github\",\n          \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n          \"events_url\": \"https://api.github.com/orgs/github/events\",\n          \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n          \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n          \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n          \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"description\": \"A great organization\"\n        }\n      },\n      \"pre-receive-environment-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"name\": \"Default\",\n            \"image_url\": \"githubenterprise://internal\",\n            \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/1\",\n            \"html_url\": \"https://github.example.com/admin/pre-receive-environments/1\",\n            \"default_environment\": true,\n            \"created_at\": \"2016-05-20T11:35:45-05:00\",\n            \"hooks_count\": 14,\n            \"download\": {\n              \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/1/downloads/latest\",\n              \"state\": \"not_started\",\n              \"downloaded_at\": \"2016-05-26T07:42:53-05:00\",\n              \"message\": null\n            }\n          },\n          {\n            \"id\": 2,\n            \"name\": \"DevTools Hook Env\",\n            \"image_url\": \"https://my_file_server/path/to/devtools_env.tar.gz\",\n            \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\n            \"html_url\": \"https://github.example.com/admin/pre-receive-environments/2\",\n            \"default_environment\": false,\n            \"created_at\": \"2016-05-20T11:35:45-05:00\",\n            \"hooks_count\": 1,\n            \"download\": {\n              \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\n              \"state\": \"success\",\n              \"downloaded_at\": \"2016-05-26T07:42:53-05:00\",\n              \"message\": null\n            }\n          }\n        ]\n      },\n      \"pre-receive-environment\": {\n        \"value\": {\n          \"id\": 2,\n          \"name\": \"DevTools Hook Env\",\n          \"image_url\": \"https://my_file_server/path/to/devtools_env.tar.gz\",\n          \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\n          \"html_url\": \"https://github.example.com/admin/pre-receive-environments/2\",\n          \"default_environment\": false,\n          \"created_at\": \"2016-05-20T11:35:45-05:00\",\n          \"hooks_count\": 1,\n          \"download\": {\n            \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\n            \"state\": \"not_started\",\n            \"downloaded_at\": null,\n            \"message\": null\n          }\n        }\n      },\n      \"pre-receive-environment-default-response\": {\n        \"value\": {\n          \"id\": 2,\n          \"name\": \"DevTools Hook Env\",\n          \"image_url\": \"https://my_file_server/path/to/devtools_env.tar.gz\",\n          \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\n          \"html_url\": \"https://github.example.com/admin/pre-receive-environments/2\",\n          \"default_environment\": false,\n          \"created_at\": \"2016-05-20T11:35:45-05:00\",\n          \"hooks_count\": 1,\n          \"download\": {\n            \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\n            \"state\": \"success\",\n            \"downloaded_at\": \"2016-05-26T07:42:53-05:00\",\n            \"message\": null\n          }\n        }\n      },\n      \"pre-receive-environment-download-status-default-response\": {\n        \"value\": {\n          \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/3/downloads/latest\",\n          \"state\": \"not_started\",\n          \"downloaded_at\": null,\n          \"message\": null\n        }\n      },\n      \"pre-receive-environment-download-status\": {\n        \"value\": {\n          \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/3/downloads/latest\",\n          \"state\": \"success\",\n          \"downloaded_at\": \"2016-05-26T07:42:53-05:00\",\n          \"message\": null\n        }\n      },\n      \"pre-receive-hook-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"name\": \"Check Commits\",\n            \"enforcement\": \"disabled\",\n            \"script\": \"scripts/commmit_check.sh\",\n            \"script_repository\": {\n              \"id\": 595,\n              \"full_name\": \"DevIT/hooks\",\n              \"url\": \"https://github.example.com/api/v3/repos/DevIT/hooks\",\n              \"html_url\": \"https://github.example.com/DevIT/hooks\"\n            },\n            \"environment\": {\n              \"id\": 2,\n              \"name\": \"DevTools Hook Env\",\n              \"image_url\": \"https://my_file_server/path/to/devtools_env.tar.gz\",\n              \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\n              \"html_url\": \"https://github.example.com/admin/pre-receive-environments/2\",\n              \"default_environment\": false,\n              \"created_at\": \"2016-05-20T11:35:45-05:00\",\n              \"hooks_count\": 1,\n              \"download\": {\n                \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\n                \"state\": \"success\",\n                \"downloaded_at\": \"2016-05-26T07:42:53-05:00\",\n                \"message\": null\n              }\n            },\n            \"allow_downstream_configuration\": false\n          }\n        ]\n      },\n      \"pre-receive-hook\": {\n        \"value\": {\n          \"id\": 1,\n          \"name\": \"Check Commits\",\n          \"enforcement\": \"disabled\",\n          \"script\": \"scripts/commmit_check.sh\",\n          \"script_repository\": {\n            \"id\": 595,\n            \"full_name\": \"DevIT/hooks\",\n            \"url\": \"https://github.example.com/api/v3/repos/DevIT/hooks\",\n            \"html_url\": \"https://github.example.com/DevIT/hooks\"\n          },\n          \"environment\": {\n            \"id\": 2,\n            \"name\": \"DevTools Hook Env\",\n            \"image_url\": \"https://my_file_server/path/to/devtools_env.tar.gz\",\n            \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\n            \"html_url\": \"https://github.example.com/admin/pre-receive-environments/2\",\n            \"default_environment\": false,\n            \"created_at\": \"2016-05-20T11:35:45-05:00\",\n            \"hooks_count\": 1,\n            \"download\": {\n              \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\n              \"state\": \"success\",\n              \"downloaded_at\": \"2016-05-26T07:42:53-05:00\",\n              \"message\": null\n            }\n          },\n          \"allow_downstream_configuration\": false\n        }\n      },\n      \"pre-receive-hook-2\": {\n        \"value\": {\n          \"id\": 1,\n          \"name\": \"Check Commits\",\n          \"enforcement\": \"disabled\",\n          \"script\": \"scripts/commmit_check.sh\",\n          \"script_repository\": {\n            \"id\": 595,\n            \"full_name\": \"DevIT/hooks\",\n            \"url\": \"https://github.example.com/api/v3/repos/DevIT/hooks\",\n            \"html_url\": \"https://github.example.com/DevIT/hooks\"\n          },\n          \"environment\": {\n            \"id\": 1,\n            \"name\": \"Default\",\n            \"image_url\": \"githubenterprise://internal\",\n            \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/1\",\n            \"html_url\": \"https://github.example.com/admin/pre-receive-environments/1\",\n            \"default_environment\": true,\n            \"created_at\": \"2016-05-20T11:35:45-05:00\",\n            \"hooks_count\": 1,\n            \"download\": {\n              \"url\": \"https://github.example.com/api/v3/admin/pre-receive-environments/1/downloads/latest\",\n              \"state\": \"success\",\n              \"downloaded_at\": \"2016-05-26T07:42:53-05:00\",\n              \"message\": null\n            }\n          },\n          \"allow_downstream_configuration\": true\n        }\n      },\n      \"authorization-items\": {\n        \"value\": [\n          {\n            \"id\": 2,\n            \"url\": \"https://enterprise.octocat.com/api/v3/authorizations/2\",\n            \"app\": {\n              \"name\": \"My personal access token\",\n              \"url\": \"https://docs.github.com/enterprise/rest/reference/enterprise-admin#list-personal-access-tokens\",\n              \"client_id\": \"00000000000000000000\"\n            },\n            \"token\": \"ghp_16C7e42F292c6912E7710c838347Ae178B4a\",\n            \"hashed_token\": \"23cffb2fab1b0a62747863eba88cb9327e561f2f7a0c8661c0d9b83146cb8d45\",\n            \"token_last_eight\": \"Ae178B4a\",\n            \"note\": \"My personal access token\",\n            \"note_url\": null,\n            \"created_at\": \"2019-04-24T21:49:02Z\",\n            \"updated_at\": \"2019-04-24T21:49:02Z\",\n            \"scopes\": [\n              \"admin:business\",\n              \"admin:gpg_key\",\n              \"admin:org\",\n              \"admin:org_hook\",\n              \"admin:pre_receive_hook\",\n              \"admin:public_key\",\n              \"admin:repo_hook\",\n              \"delete_repo\",\n              \"gist\",\n              \"notifications\",\n              \"repo\",\n              \"user\",\n              \"write:discussion\"\n            ],\n            \"fingerprint\": null\n          }\n        ]\n      },\n      \"simple-user\": {\n        \"value\": {\n          \"login\": \"octocat\",\n          \"id\": 1,\n          \"node_id\": \"MDQ6VXNlcjE=\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/octocat\",\n          \"html_url\": \"https://github.com/octocat\",\n          \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n          \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n          \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        }\n      },\n      \"authorization\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/authorizations/1\",\n          \"scopes\": [\n            \"public_repo\"\n          ],\n          \"token\": \"ghu_16C7e42F292c6912E7710c838347Ae178B4a\",\n          \"token_last_eight\": \"Ae178B4a\",\n          \"hashed_token\": \"25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\",\n          \"app\": {\n            \"url\": \"http://my-github-app.com\",\n            \"name\": \"my github app\",\n            \"client_id\": \"abcde12345fghij67890\"\n          },\n          \"note\": \"optional note\",\n          \"note_url\": \"http://optional/note/url\",\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"fingerprint\": \"jklmnop12345678\"\n        }\n      },\n      \"integration\": {\n        \"value\": {\n          \"id\": 1,\n          \"slug\": \"octoapp\",\n          \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n          \"owner\": {\n            \"login\": \"github\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n            \"url\": \"https://api.github.com/orgs/github\",\n            \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n            \"events_url\": \"https://api.github.com/orgs/github/events\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": true\n          },\n          \"name\": \"Octocat App\",\n          \"description\": \"\",\n          \"external_url\": \"https://example.com\",\n          \"html_url\": \"https://github.com/apps/octoapp\",\n          \"created_at\": \"2017-07-08T16:18:44-04:00\",\n          \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n          \"permissions\": {\n            \"metadata\": \"read\",\n            \"contents\": \"read\",\n            \"issues\": \"write\",\n            \"single_file\": \"write\"\n          },\n          \"events\": [\n            \"push\",\n            \"pull_request\"\n          ]\n        }\n      },\n      \"integration-from-manifest\": {\n        \"value\": {\n          \"id\": 1,\n          \"slug\": \"octoapp\",\n          \"node_id\": \"MDxOkludGVncmF0aW9uMQ==\",\n          \"owner\": {\n            \"login\": \"github\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n            \"url\": \"https://api.github.com/orgs/github\",\n            \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n            \"events_url\": \"https://api.github.com/orgs/github/events\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": true\n          },\n          \"name\": \"Octocat App\",\n          \"description\": \"\",\n          \"external_url\": \"https://example.com\",\n          \"html_url\": \"https://github.com/apps/octoapp\",\n          \"created_at\": \"2017-07-08T16:18:44-04:00\",\n          \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n          \"permissions\": {\n            \"metadata\": \"read\",\n            \"contents\": \"read\",\n            \"issues\": \"write\",\n            \"single_file\": \"write\"\n          },\n          \"events\": [\n            \"push\",\n            \"pull_request\"\n          ],\n          \"client_id\": \"Iv1.8a61f9b3a7aba766\",\n          \"client_secret\": \"1726be1638095a19edd134c77bde3aa2ece1e5d8\",\n          \"webhook_secret\": \"e340154128314309424b7c8e90325147d99fdafa\",\n          \"pem\": \"-----BEGIN RSA PRIVATE KEY-----\\nMIIEowIBAAKCAQEAuEPzOUE+kiEH1WLiMeBytTEF856j0hOVcSUSUkZxKvqczkWM\\n9vo1gDyC7ZXhdH9fKh32aapba3RSsp4ke+giSmYTk2mGR538ShSDxh0OgpJmjiKP\\nX0Bj4j5sFqfXuCtl9SkH4iueivv4R53ktqM+n6hk98l6hRwC39GVIblAh2lEM4L/\\n6WvYwuQXPMM5OG2Ryh2tDZ1WS5RKfgq+9ksNJ5Q9UtqtqHkO+E63N5OK9sbzpUUm\\noNaOl3udTlZD3A8iqwMPVxH4SxgATBPAc+bmjk6BMJ0qIzDcVGTrqrzUiywCTLma\\nszdk8GjzXtPDmuBgNn+o6s02qVGpyydgEuqmTQIDAQABAoIBACL6AvkjQVVLn8kJ\\ndBYznJJ4M8ECo+YEgaFwgAHODT0zRQCCgzd+Vxl4YwHmKV2Lr+y2s0drZt8GvYva\\nKOK8NYYZyi15IlwFyRXmvvykF1UBpSXluYFDH7KaVroWMgRreHcIys5LqVSIb6Bo\\ngDmK0yBLPp8qR29s2b7ScZRtLaqGJiX+j55rNzrZwxHkxFHyG9OG+u9IsBElcKCP\\nkYCVE8ZdYexfnKOZbgn2kZB9qu0T/Mdvki8yk3I2bI6xYO24oQmhnT36qnqWoCBX\\nNuCNsBQgpYZeZET8mEAUmo9d+ABmIHIvSs005agK8xRaP4+6jYgy6WwoejJRF5yd\\nNBuF7aECgYEA50nZ4FiZYV0vcJDxFYeY3kYOvVuKn8OyW+2rg7JIQTremIjv8FkE\\nZnwuF9ZRxgqLxUIfKKfzp/5l5LrycNoj2YKfHKnRejxRWXqG+ZETfxxlmlRns0QG\\nJ4+BYL0CoanDSeA4fuyn4Bv7cy/03TDhfg/Uq0Aeg+hhcPE/vx3ebPsCgYEAy/Pv\\neDLssOSdeyIxf0Brtocg6aPXIVaLdus+bXmLg77rJIFytAZmTTW8SkkSczWtucI3\\nFI1I6sei/8FdPzAl62/JDdlf7Wd9K7JIotY4TzT7Tm7QU7xpfLLYIP1bOFjN81rk\\n77oOD4LsXcosB/U6s1blPJMZ6AlO2EKs10UuR1cCgYBipzuJ2ADEaOz9RLWwi0AH\\nPza2Sj+c2epQD9ZivD7Zo/Sid3ZwvGeGF13JyR7kLEdmAkgsHUdu1rI7mAolXMaB\\n1pdrsHureeLxGbRM6za3tzMXWv1Il7FQWoPC8ZwXvMOR1VQDv4nzq7vbbA8z8c+c\\n57+8tALQHOTDOgQIzwK61QKBgERGVc0EJy4Uag+VY8J4m1ZQKBluqo7TfP6DQ7O8\\nM5MX73maB/7yAX8pVO39RjrhJlYACRZNMbK+v/ckEQYdJSSKmGCVe0JrGYDuPtic\\nI9+IGfSorf7KHPoMmMN6bPYQ7Gjh7a++tgRFTMEc8956Hnt4xGahy9NcglNtBpVN\\n6G8jAoGBAMCh028pdzJa/xeBHLLaVB2sc0Fe7993WlsPmnVE779dAz7qMscOtXJK\\nfgtriltLSSD6rTA9hUAsL/X62rY0wdXuNdijjBb/qvrx7CAV6i37NK1CjABNjsfG\\nZM372Ac6zc1EqSrid2IjET1YqyIW2KGLI1R2xbQc98UGlt48OdWu\\n-----END RSA PRIVATE KEY-----\\n\"\n        }\n      },\n      \"webhook-config\": {\n        \"value\": {\n          \"content_type\": \"json\",\n          \"insecure_ssl\": \"0\",\n          \"secret\": \"********\",\n          \"url\": \"https://example.com/webhook\"\n        }\n      },\n      \"base-installation-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"account\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"access_tokens_url\": \"https://api.github.com/installations/1/access_tokens\",\n            \"repositories_url\": \"https://api.github.com/installation/repositories\",\n            \"html_url\": \"https://github.com/organizations/github/settings/installations/1\",\n            \"app_id\": 1,\n            \"target_id\": 1,\n            \"target_type\": \"Organization\",\n            \"permissions\": {\n              \"checks\": \"write\",\n              \"metadata\": \"read\",\n              \"contents\": \"read\"\n            },\n            \"events\": [\n              \"push\",\n              \"pull_request\"\n            ],\n            \"single_file_name\": \"config.yaml\",\n            \"has_multiple_single_files\": true,\n            \"single_file_paths\": [\n              \"config.yml\",\n              \".github/issue_TEMPLATE.md\"\n            ],\n            \"repository_selection\": \"selected\",\n            \"created_at\": \"2017-07-08T16:18:44-04:00\",\n            \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n            \"app_slug\": \"github-actions\",\n            \"suspended_at\": null,\n            \"suspended_by\": null\n          }\n        ]\n      },\n      \"base-installation\": {\n        \"value\": {\n          \"id\": 1,\n          \"account\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"access_tokens_url\": \"https://api.github.com/installations/1/access_tokens\",\n          \"repositories_url\": \"https://api.github.com/installation/repositories\",\n          \"html_url\": \"https://github.com/organizations/github/settings/installations/1\",\n          \"app_id\": 1,\n          \"target_id\": 1,\n          \"target_type\": \"Organization\",\n          \"permissions\": {\n            \"checks\": \"write\",\n            \"metadata\": \"read\",\n            \"contents\": \"read\"\n          },\n          \"events\": [\n            \"push\",\n            \"pull_request\"\n          ],\n          \"single_file_name\": \"config.yaml\",\n          \"has_multiple_single_files\": true,\n          \"single_file_paths\": [\n            \"config.yml\",\n            \".github/issue_TEMPLATE.md\"\n          ],\n          \"repository_selection\": \"selected\",\n          \"created_at\": \"2017-07-08T16:18:44-04:00\",\n          \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n          \"app_slug\": \"github-actions\",\n          \"suspended_at\": null,\n          \"suspended_by\": null\n        }\n      },\n      \"installation-token\": {\n        \"value\": {\n          \"token\": \"ghs_16C7e42F292c6912E7710c838347Ae178B4a\",\n          \"expires_at\": \"2016-07-11T22:14:10Z\",\n          \"permissions\": {\n            \"issues\": \"write\",\n            \"contents\": \"read\"\n          },\n          \"repository_selection\": \"selected\",\n          \"repositories\": [\n            {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"language\": null,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"template_repository\": null,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://github.com/licenses/mit\"\n              },\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1\n            }\n          ]\n        }\n      },\n      \"application-grant-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"url\": \"https://api.github.com/applications/grants/1\",\n            \"app\": {\n              \"url\": \"http://my-github-app.com\",\n              \"name\": \"my github app\",\n              \"client_id\": \"abcde12345fghij67890\"\n            },\n            \"created_at\": \"2011-09-06T17:26:27Z\",\n            \"updated_at\": \"2011-09-06T20:39:23Z\",\n            \"scopes\": [\n              \"public_repo\"\n            ]\n          }\n        ]\n      },\n      \"application-grant\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/applications/grants/1\",\n          \"app\": {\n            \"url\": \"http://my-github-app.com\",\n            \"name\": \"my github app\",\n            \"client_id\": \"abcde12345fghij67890\"\n          },\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"scopes\": [\n            \"public_repo\"\n          ]\n        }\n      },\n      \"authorization-with-user\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/authorizations/1\",\n          \"scopes\": [\n            \"public_repo\",\n            \"user\"\n          ],\n          \"token\": \"ghu_16C7e42F292c6912E7710c838347Ae178B4a\",\n          \"token_last_eight\": \"Ae178B4a\",\n          \"hashed_token\": \"25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\",\n          \"app\": {\n            \"url\": \"http://my-github-app.com\",\n            \"name\": \"my github app\",\n            \"client_id\": \"abcde12345fghij67890\"\n          },\n          \"note\": \"optional note\",\n          \"note_url\": \"http://optional/note/url\",\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"fingerprint\": \"jklmnop12345678\",\n          \"expires_at\": \"2011-09-08T17:26:27Z\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"scope-token\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/authorizations/1\",\n          \"scopes\": [\n\n          ],\n          \"token\": \"ghu_16C7e42F292c6912E7710c838347Ae178B4a\",\n          \"token_last_eight\": \"Ae178B4a\",\n          \"hashed_token\": \"25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\",\n          \"app\": {\n            \"url\": \"http://my-github-app.com\",\n            \"name\": \"my github app\",\n            \"client_id\": \"abcde12345fghij67890\"\n          },\n          \"note\": \"optional note\",\n          \"note_url\": \"http://optional/note/url\",\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"fingerprint\": \"jklmnop12345678\",\n          \"expires_at\": \"2011-09-08T17:26:27Z\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"installation\": {\n            \"permissions\": {\n              \"metadata\": \"read\",\n              \"issues\": \"write\",\n              \"contents\": \"read\"\n            },\n            \"repository_selection\": \"selected\",\n            \"single_file_name\": \".github/workflow.yml\",\n            \"repositories_url\": \"https://api.github.com/user/repos\",\n            \"account\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"has_multiple_single_files\": false,\n            \"single_file_paths\": [\n\n            ]\n          }\n        }\n      },\n      \"authorization-response-if-returning-an-existing-token-2\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/authorizations/1\",\n          \"scopes\": [\n            \"public_repo\"\n          ],\n          \"token\": \"ghu_16C7e42F292c6912E7710c838347Ae178B4a\",\n          \"token_last_eight\": \"Ae178B4a\",\n          \"hashed_token\": \"25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\",\n          \"app\": {\n            \"url\": \"http://my-github-app.com\",\n            \"name\": \"my github app\",\n            \"client_id\": \"abcde12345fghij67890\"\n          },\n          \"note\": \"optional note\",\n          \"note_url\": \"http://optional/note/url\",\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"fingerprint\": \"\"\n        }\n      },\n      \"authorization-response-if-returning-an-existing-token\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/authorizations/1\",\n          \"scopes\": [\n            \"public_repo\"\n          ],\n          \"token\": \"ghu_16C7e42F292c6912E7710c838347Ae178B4a\",\n          \"token_last_eight\": \"Ae178B4a\",\n          \"hashed_token\": \"25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\",\n          \"app\": {\n            \"url\": \"http://my-github-app.com\",\n            \"name\": \"my github app\",\n            \"client_id\": \"abcde12345fghij67890\"\n          },\n          \"note\": \"optional note\",\n          \"note_url\": \"http://optional/note/url\",\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"fingerprint\": \"jklmnop12345678\"\n        }\n      },\n      \"authorization-3\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/authorizations/1\",\n          \"scopes\": [\n            \"public_repo\"\n          ],\n          \"token\": \"ghu_16C7e42F292c6912E7710c838347Ae178B4a\",\n          \"token_last_eight\": \"Ae178B4a\",\n          \"hashed_token\": \"25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\",\n          \"app\": {\n            \"url\": \"http://my-github-app.com\",\n            \"name\": \"my github app\",\n            \"client_id\": \"abcde12345fghij67890\"\n          },\n          \"note\": \"optional note\",\n          \"note_url\": \"http://optional/note/url\",\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"fingerprint\": \"jklmnop12345678\"\n        }\n      },\n      \"authorization-2\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/authorizations/1\",\n          \"scopes\": [\n            \"public_repo\"\n          ],\n          \"token\": \"ghu_16C7e42F292c6912E7710c838347Ae178B4a\",\n          \"token_last_eight\": \"Ae178B4a\",\n          \"hashed_token\": \"25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\",\n          \"app\": {\n            \"url\": \"http://my-github-app.com\",\n            \"name\": \"my github app\",\n            \"client_id\": \"abcde12345fghij67890\"\n          },\n          \"note\": \"optional note\",\n          \"note_url\": \"http://optional/note/url\",\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"fingerprint\": \"jklmnop12345678\"\n        }\n      },\n      \"code-of-conduct-simple-items\": {\n        \"value\": [\n          {\n            \"key\": \"citizen_code_of_conduct\",\n            \"name\": \"Citizen Code of Conduct\",\n            \"url\": \"https://api.github.com/codes_of_conduct/citizen_code_of_conduct\",\n            \"html_url\": \"http://citizencodeofconduct.org/\"\n          },\n          {\n            \"key\": \"contributor_covenant\",\n            \"name\": \"Contributor Covenant\",\n            \"url\": \"https://api.github.com/codes_of_conduct/contributor_covenant\",\n            \"html_url\": \"https://www.contributor-covenant.org/version/2/0/code_of_conduct/\"\n          }\n        ]\n      },\n      \"code-of-conduct\": {\n        \"value\": {\n          \"key\": \"contributor_covenant\",\n          \"name\": \"Contributor Covenant\",\n          \"url\": \"https://api.github.com/codes_of_conduct/contributor_covenant\",\n          \"body\": \"# Contributor Covenant Code of Conduct\\n\\n## Our Pledge\\n\\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\\n\\n## Our Standards\\n\\nExamples of behavior that contributes to creating a positive environment include:\\n\\n* Using welcoming and inclusive language\\n* Being respectful of differing viewpoints and experiences\\n* Gracefully accepting constructive criticism\\n* Focusing on what is best for the community\\n* Showing empathy towards other community members\\n\\nExamples of unacceptable behavior by participants include:\\n\\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\\n* Trolling, insulting/derogatory comments, and personal or political attacks\\n* Public or private harassment\\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\\n* Other conduct which could reasonably be considered inappropriate in a professional setting\\n\\n## Our Responsibilities\\n\\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\\n                  to any instances of unacceptable behavior.\\n\\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\\n\\n## Scope\\n\\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\\n                  posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\\n\\n## Enforcement\\n\\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\\n\\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\\n\\n## Attribution\\n\\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\\n\\n[homepage]: http://contributor-covenant.org\\n[version]: http://contributor-covenant.org/version/1/4/\\n\",\n          \"html_url\": \"http://contributor-covenant.org/version/1/4/\"\n        }\n      },\n      \"announcement\": {\n        \"summary\": \"Default response\",\n        \"value\": {\n          \"announcement\": \"Very **important** announcement about _nothing_.\",\n          \"expires_at\": \"2021-01-01T00:00:00.000+00:00\"\n        }\n      },\n      \"license-info\": {\n        \"value\": {\n          \"seats\": 1400,\n          \"seats_used\": 1316,\n          \"seats_available\": 84,\n          \"kind\": \"standard\",\n          \"days_until_expiration\": 365,\n          \"expire_at\": \"2016/02/06 12:41:52 -0600\"\n        }\n      },\n      \"enterprise-overview\": {\n        \"value\": {\n          \"repos\": {\n            \"total_repos\": 212,\n            \"root_repos\": 194,\n            \"fork_repos\": 18,\n            \"org_repos\": 51,\n            \"total_pushes\": 3082,\n            \"total_wikis\": 15\n          },\n          \"hooks\": {\n            \"total_hooks\": 27,\n            \"active_hooks\": 23,\n            \"inactive_hooks\": 4\n          },\n          \"pages\": {\n            \"total_pages\": 36\n          },\n          \"orgs\": {\n            \"total_orgs\": 33,\n            \"disabled_orgs\": 0,\n            \"total_teams\": 60,\n            \"total_team_members\": 314\n          },\n          \"users\": {\n            \"total_users\": 254,\n            \"admin_users\": 45,\n            \"suspended_users\": 21\n          },\n          \"pulls\": {\n            \"total_pulls\": 86,\n            \"merged_pulls\": 60,\n            \"mergeable_pulls\": 21,\n            \"unmergeable_pulls\": 3\n          },\n          \"issues\": {\n            \"total_issues\": 179,\n            \"open_issues\": 83,\n            \"closed_issues\": 96\n          },\n          \"milestones\": {\n            \"total_milestones\": 7,\n            \"open_milestones\": 6,\n            \"closed_milestones\": 1\n          },\n          \"gists\": {\n            \"total_gists\": 178,\n            \"private_gists\": 151,\n            \"public_gists\": 25\n          },\n          \"comments\": {\n            \"total_commit_comments\": 6,\n            \"total_gist_comments\": 28,\n            \"total_issue_comments\": 366,\n            \"total_pull_request_comments\": 30\n          }\n        }\n      },\n      \"actions-enterprise-permissions\": {\n        \"value\": {\n          \"enabled_organizations\": \"all\",\n          \"allowed_actions\": \"selected\",\n          \"selected_actions_url\": \"https://api.github.com/enterprises/2/actions/permissions/selected-actions\"\n        }\n      },\n      \"organization-targets\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"organizations\": [\n            {\n              \"login\": \"octocat\",\n              \"id\": 161335,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"url\": \"https://api.github.com/orgs/octo-org\",\n              \"repos_url\": \"https://api.github.com/orgs/octo-org/repos\",\n              \"events_url\": \"https://api.github.com/orgs/octo-org/events\",\n              \"hooks_url\": \"https://api.github.com/orgs/octo-org/hooks\",\n              \"issues_url\": \"https://api.github.com/orgs/octo-org/issues\",\n              \"members_url\": \"https://api.github.com/orgs/octo-org/members{/member}\",\n              \"public_members_url\": \"https://api.github.com/orgs/octo-org/public_members{/member}\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"description\": \"A great organization\"\n            }\n          ]\n        }\n      },\n      \"selected-actions\": {\n        \"value\": {\n          \"github_owned_allowed\": true,\n          \"verified_allowed\": false,\n          \"patterns_allowed\": [\n            \"monalisa/octocat@*\",\n            \"docker/*\"\n          ]\n        }\n      },\n      \"runner-groups-enterprise\": {\n        \"value\": {\n          \"total_count\": 3,\n          \"runner_groups\": [\n            {\n              \"id\": 1,\n              \"name\": \"Default\",\n              \"visibility\": \"all\",\n              \"default\": true,\n              \"runners_url\": \"https://api.github.com/enterprises/octo-corp/actions/runner_groups/1/runners\",\n              \"allows_public_repositories\": false\n            },\n            {\n              \"id\": 2,\n              \"name\": \"octo-runner-group\",\n              \"visibility\": \"selected\",\n              \"default\": false,\n              \"selected_organizations_url\": \"https://api.github.com/enterprises/octo-corp/actions/runner_groups/2/organizations\",\n              \"runners_url\": \"https://api.github.com/enterprises/octo-corp/actions/runner_groups/2/runners\",\n              \"allows_public_repositories\": true\n            },\n            {\n              \"id\": 3,\n              \"name\": \"expensive-hardware\",\n              \"visibility\": \"private\",\n              \"default\": false,\n              \"runners_url\": \"https://api.github.com/enterprises/octo-corp/actions/runner_groups/3/runners\",\n              \"allows_public_repositories\": true\n            }\n          ]\n        }\n      },\n      \"runner-group-enterprise\": {\n        \"value\": {\n          \"id\": 2,\n          \"name\": \"octo-runner-group\",\n          \"visibility\": \"selected\",\n          \"default\": false,\n          \"selected_organizations_url\": \"https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/organizations\",\n          \"runners_url\": \"https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/runners\",\n          \"allows_public_repositories\": false\n        }\n      },\n      \"runner-group-update-enterprise\": {\n        \"value\": {\n          \"id\": 2,\n          \"name\": \"Expensive hardware runners\",\n          \"visibility\": \"selected\",\n          \"default\": false,\n          \"selected_organizations_url\": \"https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/organizations\",\n          \"runners_url\": \"https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/runners\",\n          \"allows_public_repositories\": true\n        }\n      },\n      \"runner-paginated\": {\n        \"value\": {\n          \"total_count\": 2,\n          \"runners\": [\n            {\n              \"id\": 23,\n              \"name\": \"linux_runner\",\n              \"os\": \"linux\",\n              \"status\": \"online\",\n              \"busy\": true,\n              \"labels\": [\n                {\n                  \"id\": 5,\n                  \"name\": \"self-hosted\",\n                  \"type\": \"read-only\"\n                },\n                {\n                  \"id\": 7,\n                  \"name\": \"X64\",\n                  \"type\": \"read-only\"\n                },\n                {\n                  \"id\": 11,\n                  \"name\": \"Linux\",\n                  \"type\": \"read-only\"\n                }\n              ]\n            },\n            {\n              \"id\": 24,\n              \"name\": \"mac_runner\",\n              \"os\": \"macos\",\n              \"status\": \"offline\",\n              \"busy\": false,\n              \"labels\": [\n                {\n                  \"id\": 5,\n                  \"name\": \"self-hosted\",\n                  \"type\": \"read-only\"\n                },\n                {\n                  \"id\": 7,\n                  \"name\": \"X64\",\n                  \"type\": \"read-only\"\n                },\n                {\n                  \"id\": 20,\n                  \"name\": \"macOS\",\n                  \"type\": \"read-only\"\n                },\n                {\n                  \"id\": 21,\n                  \"name\": \"no-gpu\",\n                  \"type\": \"custom\"\n                }\n              ]\n            }\n          ]\n        }\n      },\n      \"runner-application-items\": {\n        \"value\": [\n          {\n            \"os\": \"osx\",\n            \"architecture\": \"x64\",\n            \"download_url\": \"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz\",\n            \"filename\": \"actions-runner-osx-x64-2.164.0.tar.gz\"\n          },\n          {\n            \"os\": \"linux\",\n            \"architecture\": \"x64\",\n            \"download_url\": \"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz\",\n            \"filename\": \"actions-runner-linux-x64-2.164.0.tar.gz\"\n          },\n          {\n            \"os\": \"linux\",\n            \"architecture\": \"arm\",\n            \"download_url\": \"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz\",\n            \"filename\": \"actions-runner-linux-arm-2.164.0.tar.gz\"\n          },\n          {\n            \"os\": \"win\",\n            \"architecture\": \"x64\",\n            \"download_url\": \"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip\",\n            \"filename\": \"actions-runner-win-x64-2.164.0.zip\"\n          },\n          {\n            \"os\": \"linux\",\n            \"architecture\": \"arm64\",\n            \"download_url\": \"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz\",\n            \"filename\": \"actions-runner-linux-arm64-2.164.0.tar.gz\"\n          }\n        ]\n      },\n      \"authentication-token\": {\n        \"value\": {\n          \"token\": \"LLBF3JGZDX3P5PMEXLND6TS6FCWO6\",\n          \"expires_at\": \"2020-01-22T12:13:35.123-08:00\"\n        }\n      },\n      \"authentication-token-2\": {\n        \"value\": {\n          \"token\": \"AABF3JGZDX3P5PMEXLND6TS6FCWO6\",\n          \"expires_at\": \"2020-01-29T12:13:35.123-08:00\"\n        }\n      },\n      \"runner\": {\n        \"value\": {\n          \"id\": 23,\n          \"name\": \"MBP\",\n          \"os\": \"macos\",\n          \"status\": \"online\",\n          \"busy\": true,\n          \"labels\": [\n            {\n              \"id\": 5,\n              \"name\": \"self-hosted\",\n              \"type\": \"read-only\"\n            },\n            {\n              \"id\": 7,\n              \"name\": \"X64\",\n              \"type\": \"read-only\"\n            },\n            {\n              \"id\": 20,\n              \"name\": \"macOS\",\n              \"type\": \"read-only\"\n            },\n            {\n              \"id\": 21,\n              \"name\": \"no-gpu\",\n              \"type\": \"custom\"\n            }\n          ]\n        }\n      },\n      \"feed\": {\n        \"value\": {\n          \"timeline_url\": \"https://github.com/timeline\",\n          \"user_url\": \"https://github.com/{user}\",\n          \"current_user_public_url\": \"https://github.com/octocat\",\n          \"current_user_url\": \"https://github.com/octocat.private?token=abc123\",\n          \"current_user_actor_url\": \"https://github.com/octocat.private.actor?token=abc123\",\n          \"current_user_organization_url\": \"\",\n          \"current_user_organization_urls\": [\n            \"https://github.com/organizations/github/octocat.private.atom?token=abc123\"\n          ],\n          \"_links\": {\n            \"timeline\": {\n              \"href\": \"https://github.com/timeline\",\n              \"type\": \"application/atom+xml\"\n            },\n            \"user\": {\n              \"href\": \"https://github.com/{user}\",\n              \"type\": \"application/atom+xml\"\n            },\n            \"current_user_public\": {\n              \"href\": \"https://github.com/octocat\",\n              \"type\": \"application/atom+xml\"\n            },\n            \"current_user\": {\n              \"href\": \"https://github.com/octocat.private?token=abc123\",\n              \"type\": \"application/atom+xml\"\n            },\n            \"current_user_actor\": {\n              \"href\": \"https://github.com/octocat.private.actor?token=abc123\",\n              \"type\": \"application/atom+xml\"\n            },\n            \"current_user_organization\": {\n              \"href\": \"\",\n              \"type\": \"\"\n            },\n            \"current_user_organizations\": [\n              {\n                \"href\": \"https://github.com/organizations/github/octocat.private.atom?token=abc123\",\n                \"type\": \"application/atom+xml\"\n              }\n            ]\n          }\n        }\n      },\n      \"base-gist-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d\",\n            \"forks_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/forks\",\n            \"commits_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/commits\",\n            \"id\": \"aa5a315d61ae9438b18d\",\n            \"node_id\": \"MDQ6R2lzdGFhNWEzMTVkNjFhZTk0MzhiMThk\",\n            \"git_pull_url\": \"https://gist.github.com/aa5a315d61ae9438b18d.git\",\n            \"git_push_url\": \"https://gist.github.com/aa5a315d61ae9438b18d.git\",\n            \"html_url\": \"https://gist.github.com/aa5a315d61ae9438b18d\",\n            \"files\": {\n              \"hello_world.rb\": {\n                \"filename\": \"hello_world.rb\",\n                \"type\": \"application/x-ruby\",\n                \"language\": \"Ruby\",\n                \"raw_url\": \"https://gist.githubusercontent.com/octocat/6cad326836d38bd3a7ae/raw/db9c55113504e46fa076e7df3a04ce592e2e86d8/hello_world.rb\",\n                \"size\": 167\n              }\n            },\n            \"public\": true,\n            \"created_at\": \"2010-04-14T02:15:15Z\",\n            \"updated_at\": \"2011-06-20T11:34:15Z\",\n            \"description\": \"Hello World Examples\",\n            \"comments\": 0,\n            \"user\": null,\n            \"comments_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/comments/\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"truncated\": false\n          }\n        ]\n      },\n      \"gist\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d\",\n          \"forks_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/forks\",\n          \"commits_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/commits\",\n          \"id\": \"aa5a315d61ae9438b18d\",\n          \"node_id\": \"MDQ6R2lzdGFhNWEzMTVkNjFhZTk0MzhiMThk\",\n          \"git_pull_url\": \"https://gist.github.com/aa5a315d61ae9438b18d.git\",\n          \"git_push_url\": \"https://gist.github.com/aa5a315d61ae9438b18d.git\",\n          \"html_url\": \"https://gist.github.com/aa5a315d61ae9438b18d\",\n          \"created_at\": \"2010-04-14T02:15:15Z\",\n          \"updated_at\": \"2011-06-20T11:34:15Z\",\n          \"description\": \"Hello World Examples\",\n          \"comments\": 0,\n          \"comments_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/comments/\"\n        }\n      },\n      \"gist-comment-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDExOkdpc3RDb21tZW50MQ==\",\n            \"url\": \"https://api.github.com/gists/a6db0bec360bb87e9418/comments/1\",\n            \"body\": \"Just commenting for the sake of commenting\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2011-04-18T23:23:56Z\",\n            \"updated_at\": \"2011-04-18T23:23:56Z\",\n            \"author_association\": \"COLLABORATOR\"\n          }\n        ]\n      },\n      \"gist-comment\": {\n        \"value\": {\n          \"id\": 1,\n          \"node_id\": \"MDExOkdpc3RDb21tZW50MQ==\",\n          \"url\": \"https://api.github.com/gists/a6db0bec360bb87e9418/comments/1\",\n          \"body\": \"Just commenting for the sake of commenting\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2011-04-18T23:23:56Z\",\n          \"updated_at\": \"2011-04-18T23:23:56Z\",\n          \"author_association\": \"COLLABORATOR\"\n        }\n      },\n      \"gist-commit-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f\",\n            \"version\": \"57a7f021a713b1c5a6a199b54cc514735d2d462f\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"change_status\": {\n              \"deletions\": 0,\n              \"additions\": 180,\n              \"total\": 180\n            },\n            \"committed_at\": \"2010-04-14T02:15:15Z\"\n          }\n        ]\n      },\n      \"gist-fork-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d\",\n            \"forks_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/forks\",\n            \"commits_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/commits\",\n            \"id\": \"aa5a315d61ae9438b18d\",\n            \"node_id\": \"MDQ6R2lzdGFhNWEzMTVkNjFhZTk0MzhiMThk\",\n            \"git_pull_url\": \"https://gist.github.com/aa5a315d61ae9438b18d.git\",\n            \"git_push_url\": \"https://gist.github.com/aa5a315d61ae9438b18d.git\",\n            \"html_url\": \"https://gist.github.com/aa5a315d61ae9438b18d\",\n            \"files\": {\n              \"hello_world.rb\": {\n                \"filename\": \"hello_world.rb\",\n                \"type\": \"application/x-ruby\",\n                \"language\": \"Ruby\",\n                \"raw_url\": \"https://gist.githubusercontent.com/octocat/6cad326836d38bd3a7ae/raw/db9c55113504e46fa076e7df3a04ce592e2e86d8/hello_world.rb\",\n                \"size\": 167\n              }\n            },\n            \"public\": true,\n            \"created_at\": \"2010-04-14T02:15:15Z\",\n            \"updated_at\": \"2011-06-20T11:34:15Z\",\n            \"description\": \"Hello World Examples\",\n            \"comments\": 1,\n            \"user\": null,\n            \"comments_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/comments/\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          }\n        ]\n      },\n      \"base-gist\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d\",\n          \"forks_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/forks\",\n          \"commits_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/commits\",\n          \"id\": \"aa5a315d61ae9438b18d\",\n          \"node_id\": \"MDQ6R2lzdGFhNWEzMTVkNjFhZTk0MzhiMThk\",\n          \"git_pull_url\": \"https://gist.github.com/aa5a315d61ae9438b18d.git\",\n          \"git_push_url\": \"https://gist.github.com/aa5a315d61ae9438b18d.git\",\n          \"html_url\": \"https://gist.github.com/aa5a315d61ae9438b18d\",\n          \"files\": {\n            \"hello_world.rb\": {\n              \"filename\": \"hello_world.rb\",\n              \"type\": \"application/x-ruby\",\n              \"language\": \"Ruby\",\n              \"raw_url\": \"https://gist.githubusercontent.com/octocat/6cad326836d38bd3a7ae/raw/db9c55113504e46fa076e7df3a04ce592e2e86d8/hello_world.rb\",\n              \"size\": 167\n            }\n          },\n          \"public\": true,\n          \"created_at\": \"2010-04-14T02:15:15Z\",\n          \"updated_at\": \"2011-06-20T11:34:15Z\",\n          \"description\": \"Hello World Examples\",\n          \"comments\": 0,\n          \"user\": null,\n          \"comments_url\": \"https://api.github.com/gists/aa5a315d61ae9438b18d/comments/\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"truncated\": false\n        }\n      },\n      \"gitignore-template\": {\n        \"value\": {\n          \"name\": \"C\",\n          \"source\": \"# Object files\\n*.o\\n\\n# Libraries\\n*.lib\\n*.a\\n\\n# Shared objects (inc. Windows DLLs)\\n*.dll\\n*.so\\n*.so.*\\n*.dylib\\n\\n# Executables\\n*.exe\\n*.out\\n*.app\\n\"\n        }\n      },\n      \"repository-paginated-2\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"repositories\": [\n            {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"language\": null,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"allow_rebase_merge\": true,\n              \"template_repository\": null,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://github.com/licenses/mit\"\n              },\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1\n            }\n          ]\n        }\n      },\n      \"issue-with-repo-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDU6SXNzdWUx\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n            \"repository_url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/events\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/issues/1347\",\n            \"number\": 1347,\n            \"state\": \"open\",\n            \"title\": \"Found a bug\",\n            \"body\": \"I'm having a problem with this.\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"labels\": [\n              {\n                \"id\": 208045946,\n                \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n                \"name\": \"bug\",\n                \"description\": \"Something isn't working\",\n                \"color\": \"f29513\",\n                \"default\": true\n              }\n            ],\n            \"assignee\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"assignees\": [\n              {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              }\n            ],\n            \"milestone\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n              \"id\": 1002604,\n              \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n              \"number\": 1,\n              \"state\": \"open\",\n              \"title\": \"v1.0\",\n              \"description\": \"Tracking milestone for version 1.0\",\n              \"creator\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"open_issues\": 4,\n              \"closed_issues\": 8,\n              \"created_at\": \"2011-04-10T20:09:31Z\",\n              \"updated_at\": \"2014-03-03T18:58:10Z\",\n              \"closed_at\": \"2013-02-12T13:22:01Z\",\n              \"due_on\": \"2012-10-09T23:39:01Z\"\n            },\n            \"locked\": true,\n            \"active_lock_reason\": \"too heated\",\n            \"comments\": 0,\n            \"pull_request\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n              \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n              \"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\"\n            },\n            \"closed_at\": null,\n            \"created_at\": \"2011-04-22T13:33:48Z\",\n            \"updated_at\": \"2011-04-22T13:33:48Z\",\n            \"repository\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"language\": null,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"template_repository\": null,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://github.com/licenses/mit\"\n              },\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1\n            },\n            \"author_association\": \"COLLABORATOR\"\n          }\n        ]\n      },\n      \"license-simple-items\": {\n        \"value\": [\n          {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"spdx_id\": \"MIT\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          },\n          {\n            \"key\": \"lgpl-3.0\",\n            \"name\": \"GNU Lesser General Public License v3.0\",\n            \"spdx_id\": \"LGPL-3.0\",\n            \"url\": \"https://api.github.com/licenses/lgpl-3.0\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          },\n          {\n            \"key\": \"mpl-2.0\",\n            \"name\": \"Mozilla Public License 2.0\",\n            \"spdx_id\": \"MPL-2.0\",\n            \"url\": \"https://api.github.com/licenses/mpl-2.0\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          },\n          {\n            \"key\": \"agpl-3.0\",\n            \"name\": \"GNU Affero General Public License v3.0\",\n            \"spdx_id\": \"AGPL-3.0\",\n            \"url\": \"https://api.github.com/licenses/agpl-3.0\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          },\n          {\n            \"key\": \"unlicense\",\n            \"name\": \"The Unlicense\",\n            \"spdx_id\": \"Unlicense\",\n            \"url\": \"https://api.github.com/licenses/unlicense\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          },\n          {\n            \"key\": \"apache-2.0\",\n            \"name\": \"Apache License 2.0\",\n            \"spdx_id\": \"Apache-2.0\",\n            \"url\": \"https://api.github.com/licenses/apache-2.0\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          },\n          {\n            \"key\": \"gpl-3.0\",\n            \"name\": \"GNU General Public License v3.0\",\n            \"spdx_id\": \"GPL-3.0\",\n            \"url\": \"https://api.github.com/licenses/gpl-3.0\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          }\n        ]\n      },\n      \"license\": {\n        \"value\": {\n          \"key\": \"mit\",\n          \"name\": \"MIT License\",\n          \"spdx_id\": \"MIT\",\n          \"url\": \"https://api.github.com/licenses/mit\",\n          \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n          \"html_url\": \"http://choosealicense.com/licenses/mit/\",\n          \"description\": \"A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty.\",\n          \"implementation\": \"Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders.\",\n          \"permissions\": [\n            \"commercial-use\",\n            \"modifications\",\n            \"distribution\",\n            \"sublicense\",\n            \"private-use\"\n          ],\n          \"conditions\": [\n            \"include-copyright\"\n          ],\n          \"limitations\": [\n            \"no-liability\"\n          ],\n          \"body\": \"\\n\\nThe MIT License (MIT)\\n\\nCopyright (c) [year] [fullname]\\n\\nPermission is hereby granted, free of charge, to any person obtaining a copy\\nof this software and associated documentation files (the \\\"Software\\\"), to deal\\nin the Software without restriction, including without limitation the rights\\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\ncopies of the Software, and to permit persons to whom the Software is\\nfurnished to do so, subject to the following conditions:\\n\\nThe above copyright notice and this permission notice shall be included in all\\ncopies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\nSOFTWARE.\\n\",\n          \"featured\": true\n        }\n      },\n      \"api-overview\": {\n        \"value\": {\n          \"verifiable_password_authentication\": true,\n          \"packages\": [\n            \"192.30.252.0/22\"\n          ],\n          \"dependabot\": [\n            \"54.158.161.132\"\n          ],\n          \"installed_version\": \"3.0.0\"\n        }\n      },\n      \"thread-items\": {\n        \"value\": [\n          {\n            \"id\": \"1\",\n            \"repository\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n            },\n            \"subject\": {\n              \"title\": \"Greetings\",\n              \"url\": \"https://api.github.com/repos/octokit/octokit.rb/issues/123\",\n              \"latest_comment_url\": \"https://api.github.com/repos/octokit/octokit.rb/issues/comments/123\",\n              \"type\": \"Issue\"\n            },\n            \"reason\": \"subscribed\",\n            \"unread\": true,\n            \"updated_at\": \"2014-11-07T22:01:45Z\",\n            \"last_read_at\": \"2014-11-07T22:01:45Z\",\n            \"url\": \"https://api.github.com/notifications/threads/1\",\n            \"subscription_url\": \"https://api.github.com/notifications/threads/1/subscription\"\n          }\n        ]\n      },\n      \"thread\": {\n        \"value\": {\n          \"id\": \"1\",\n          \"repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n          },\n          \"subject\": {\n            \"title\": \"Greetings\",\n            \"url\": \"https://api.github.com/repos/octokit/octokit.rb/issues/123\",\n            \"latest_comment_url\": \"https://api.github.com/repos/octokit/octokit.rb/issues/comments/123\",\n            \"type\": \"Issue\"\n          },\n          \"reason\": \"subscribed\",\n          \"unread\": true,\n          \"updated_at\": \"2014-11-07T22:01:45Z\",\n          \"last_read_at\": \"2014-11-07T22:01:45Z\",\n          \"url\": \"https://api.github.com/notifications/threads/1\",\n          \"subscription_url\": \"https://api.github.com/notifications/threads/1/subscription\"\n        }\n      },\n      \"thread-subscription\": {\n        \"value\": {\n          \"subscribed\": true,\n          \"ignored\": false,\n          \"reason\": null,\n          \"created_at\": \"2012-10-06T21:34:12Z\",\n          \"url\": \"https://api.github.com/notifications/threads/1/subscription\",\n          \"thread_url\": \"https://api.github.com/notifications/threads/1\"\n        }\n      },\n      \"organization-simple-items\": {\n        \"value\": [\n          {\n            \"login\": \"github\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n            \"url\": \"https://api.github.com/orgs/github\",\n            \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n            \"events_url\": \"https://api.github.com/orgs/github/events\",\n            \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n            \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n            \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n            \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"description\": \"A great organization\"\n          }\n        ]\n      },\n      \"organization-full-default-response\": {\n        \"summary\": \"Default response\",\n        \"value\": {\n          \"login\": \"github\",\n          \"id\": 1,\n          \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n          \"url\": \"https://api.github.com/orgs/github\",\n          \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n          \"events_url\": \"https://api.github.com/orgs/github/events\",\n          \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n          \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n          \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n          \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"description\": \"A great organization\",\n          \"name\": \"github\",\n          \"company\": \"GitHub\",\n          \"blog\": \"https://github.com/blog\",\n          \"location\": \"San Francisco\",\n          \"email\": \"octocat@github.com\",\n          \"twitter_username\": \"github\",\n          \"is_verified\": true,\n          \"has_organization_projects\": true,\n          \"has_repository_projects\": true,\n          \"public_repos\": 2,\n          \"public_gists\": 1,\n          \"followers\": 20,\n          \"following\": 0,\n          \"html_url\": \"https://github.com/octocat\",\n          \"created_at\": \"2008-01-14T04:33:35Z\",\n          \"updated_at\": \"2014-03-03T18:58:10Z\",\n          \"type\": \"Organization\",\n          \"total_private_repos\": 100,\n          \"owned_private_repos\": 100,\n          \"private_gists\": 81,\n          \"disk_usage\": 10000,\n          \"collaborators\": 8,\n          \"billing_email\": \"mona@github.com\",\n          \"plan\": {\n            \"name\": \"Medium\",\n            \"space\": 400,\n            \"private_repos\": 20,\n            \"filled_seats\": 4,\n            \"seats\": 5\n          },\n          \"default_repository_permission\": \"read\",\n          \"members_can_create_repositories\": true,\n          \"two_factor_requirement_enabled\": true,\n          \"members_allowed_repository_creation_type\": \"all\",\n          \"members_can_create_public_repositories\": false,\n          \"members_can_create_private_repositories\": false,\n          \"members_can_create_internal_repositories\": false,\n          \"members_can_create_pages\": true,\n          \"members_can_fork_private_repositories\": false\n        }\n      },\n      \"organization-full\": {\n        \"value\": {\n          \"login\": \"github\",\n          \"id\": 1,\n          \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n          \"url\": \"https://api.github.com/orgs/github\",\n          \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n          \"events_url\": \"https://api.github.com/orgs/github/events\",\n          \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n          \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n          \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n          \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"description\": \"A great organization\",\n          \"name\": \"github\",\n          \"company\": \"GitHub\",\n          \"blog\": \"https://github.com/blog\",\n          \"location\": \"San Francisco\",\n          \"email\": \"octocat@github.com\",\n          \"twitter_username\": \"github\",\n          \"is_verified\": true,\n          \"has_organization_projects\": true,\n          \"has_repository_projects\": true,\n          \"public_repos\": 2,\n          \"public_gists\": 1,\n          \"followers\": 20,\n          \"following\": 0,\n          \"html_url\": \"https://github.com/octocat\",\n          \"created_at\": \"2008-01-14T04:33:35Z\",\n          \"type\": \"Organization\",\n          \"total_private_repos\": 100,\n          \"owned_private_repos\": 100,\n          \"private_gists\": 81,\n          \"disk_usage\": 10000,\n          \"collaborators\": 8,\n          \"billing_email\": \"mona@github.com\",\n          \"plan\": {\n            \"name\": \"Medium\",\n            \"space\": 400,\n            \"private_repos\": 20\n          },\n          \"default_repository_permission\": \"read\",\n          \"members_can_create_repositories\": true,\n          \"two_factor_requirement_enabled\": true,\n          \"members_allowed_repository_creation_type\": \"all\",\n          \"members_can_create_public_repositories\": false,\n          \"members_can_create_private_repositories\": false,\n          \"members_can_create_internal_repositories\": false,\n          \"members_can_create_pages\": true,\n          \"members_can_create_public_pages\": true,\n          \"members_can_create_private_pages\": true,\n          \"members_can_fork_private_repositories\": false,\n          \"updated_at\": \"2014-03-03T18:58:10Z\"\n        }\n      },\n      \"actions-organization-permissions\": {\n        \"value\": {\n          \"enabled_repositories\": \"all\",\n          \"allowed_actions\": \"selected\",\n          \"selected_actions_url\": \"https://api.github.com/organizations/42/actions/permissions/selected-actions\"\n        }\n      },\n      \"repository-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"repositories\": [\n            {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"language\": null,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"template_repository\": null,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://github.com/licenses/mit\"\n              },\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1\n            }\n          ]\n        }\n      },\n      \"runner-groups-org\": {\n        \"value\": {\n          \"total_count\": 3,\n          \"runner_groups\": [\n            {\n              \"id\": 1,\n              \"name\": \"Default\",\n              \"visibility\": \"all\",\n              \"default\": true,\n              \"runners_url\": \"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners\",\n              \"inherited\": false,\n              \"allows_public_repositories\": true\n            },\n            {\n              \"id\": 2,\n              \"name\": \"octo-runner-group\",\n              \"visibility\": \"selected\",\n              \"default\": false,\n              \"selected_repositories_url\": \"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\",\n              \"runners_url\": \"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\",\n              \"inherited\": true,\n              \"allows_public_repositories\": true\n            },\n            {\n              \"id\": 3,\n              \"name\": \"expensive-hardware\",\n              \"visibility\": \"private\",\n              \"default\": false,\n              \"runners_url\": \"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners\",\n              \"inherited\": false,\n              \"allows_public_repositories\": true\n            }\n          ]\n        }\n      },\n      \"runner-group\": {\n        \"value\": {\n          \"id\": 2,\n          \"name\": \"octo-runner-group\",\n          \"visibility\": \"selected\",\n          \"default\": false,\n          \"selected_repositories_url\": \"https://api.github.com/orgs/octo-org/actions/runner-groups/2/repositories\",\n          \"runners_url\": \"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\",\n          \"inherited\": false,\n          \"allows_public_repositories\": true\n        }\n      },\n      \"runner-group-item\": {\n        \"value\": {\n          \"id\": 2,\n          \"name\": \"octo-runner-group\",\n          \"visibility\": \"selected\",\n          \"default\": false,\n          \"selected_repositories_url\": \"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\",\n          \"runners_url\": \"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\",\n          \"inherited\": false,\n          \"allows_public_repositories\": true\n        }\n      },\n      \"minimal-repository-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"repositories\": [\n            {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"language\": null,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"template_repository\": {\n                \"id\": 1296269,\n                \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n                \"name\": \"Hello-World\",\n                \"full_name\": \"octocat/Hello-World\",\n                \"owner\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"private\": false,\n                \"html_url\": \"https://github.com/octocat/Hello-World\",\n                \"description\": \"This your first repo!\",\n                \"fork\": false,\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n                \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n                \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n                \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n                \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n                \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n                \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n                \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n                \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n                \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n                \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n                \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n                \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n                \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n                \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n                \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n                \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n                \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n                \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n                \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n                \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n                \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n                \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n                \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n                \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n                \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n                \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n                \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n                \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n                \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n                \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n                \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n                \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n                \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n                \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n                \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n                \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n                \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n                \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n                \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n                \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n                \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n                \"homepage\": \"https://github.com\",\n                \"organization\": null,\n                \"language\": null,\n                \"forks\": 9,\n                \"forks_count\": 9,\n                \"stargazers_count\": 80,\n                \"watchers_count\": 80,\n                \"watchers\": 80,\n                \"size\": 108,\n                \"default_branch\": \"master\",\n                \"open_issues\": 0,\n                \"open_issues_count\": 0,\n                \"is_template\": true,\n                \"license\": {\n                  \"key\": \"mit\",\n                  \"name\": \"MIT License\",\n                  \"url\": \"https://api.github.com/licenses/mit\",\n                  \"spdx_id\": \"MIT\",\n                  \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                  \"html_url\": \"https://api.github.com/licenses/mit\"\n                },\n                \"topics\": [\n                  \"octocat\",\n                  \"atom\",\n                  \"electron\",\n                  \"api\"\n                ],\n                \"has_issues\": true,\n                \"has_projects\": true,\n                \"has_wiki\": true,\n                \"has_pages\": false,\n                \"has_downloads\": true,\n                \"archived\": false,\n                \"disabled\": false,\n                \"visibility\": \"public\",\n                \"pushed_at\": \"2011-01-26T19:06:43Z\",\n                \"created_at\": \"2011-01-26T19:01:12Z\",\n                \"updated_at\": \"2011-01-26T19:14:43Z\",\n                \"permissions\": {\n                  \"admin\": false,\n                  \"push\": false,\n                  \"pull\": true\n                },\n                \"allow_rebase_merge\": true,\n                \"template_repository\": null,\n                \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n                \"allow_squash_merge\": true,\n                \"delete_branch_on_merge\": true,\n                \"allow_merge_commit\": true,\n                \"subscribers_count\": 42,\n                \"network_count\": 0\n              },\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"delete_branch_on_merge\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n              },\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1\n            }\n          ]\n        }\n      },\n      \"organization-actions-secret-paginated\": {\n        \"value\": {\n          \"total_count\": 3,\n          \"secrets\": [\n            {\n              \"name\": \"GIST_ID\",\n              \"created_at\": \"2019-08-10T14:59:22Z\",\n              \"updated_at\": \"2020-01-10T14:59:22Z\",\n              \"visibility\": \"private\"\n            },\n            {\n              \"name\": \"DEPLOY_TOKEN\",\n              \"created_at\": \"2019-08-10T14:59:22Z\",\n              \"updated_at\": \"2020-01-10T14:59:22Z\",\n              \"visibility\": \"all\"\n            },\n            {\n              \"name\": \"GH_TOKEN\",\n              \"created_at\": \"2019-08-10T14:59:22Z\",\n              \"updated_at\": \"2020-01-10T14:59:22Z\",\n              \"visibility\": \"selected\",\n              \"selected_repositories_url\": \"https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories\"\n            }\n          ]\n        }\n      },\n      \"actions-public-key\": {\n        \"value\": {\n          \"key_id\": \"012345678912345678\",\n          \"key\": \"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"\n        }\n      },\n      \"organization-actions-secret\": {\n        \"value\": {\n          \"name\": \"GH_TOKEN\",\n          \"created_at\": \"2019-08-10T14:59:22Z\",\n          \"updated_at\": \"2020-01-10T14:59:22Z\",\n          \"visibility\": \"selected\",\n          \"selected_repositories_url\": \"https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories\"\n        }\n      },\n      \"public-repository-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"repositories\": [\n            {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n            }\n          ]\n        }\n      },\n      \"org-hook-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"url\": \"https://api.github.com/orgs/octocat/hooks/1\",\n            \"ping_url\": \"https://api.github.com/orgs/octocat/hooks/1/pings\",\n            \"name\": \"web\",\n            \"events\": [\n              \"push\",\n              \"pull_request\"\n            ],\n            \"active\": true,\n            \"config\": {\n              \"url\": \"http://example.com\",\n              \"content_type\": \"json\"\n            },\n            \"updated_at\": \"2011-09-06T20:39:23Z\",\n            \"created_at\": \"2011-09-06T17:26:27Z\",\n            \"type\": \"Organization\"\n          }\n        ]\n      },\n      \"org-hook\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/orgs/octocat/hooks/1\",\n          \"ping_url\": \"https://api.github.com/orgs/octocat/hooks/1/pings\",\n          \"name\": \"web\",\n          \"events\": [\n            \"push\",\n            \"pull_request\"\n          ],\n          \"active\": true,\n          \"config\": {\n            \"url\": \"http://example.com\",\n            \"content_type\": \"json\"\n          },\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"type\": \"Organization\"\n        }\n      },\n      \"org-hook-2\": {\n        \"value\": {\n          \"id\": 1,\n          \"url\": \"https://api.github.com/orgs/octocat/hooks/1\",\n          \"ping_url\": \"https://api.github.com/orgs/octocat/hooks/1/pings\",\n          \"name\": \"web\",\n          \"events\": [\n            \"pull_request\"\n          ],\n          \"active\": true,\n          \"config\": {\n            \"url\": \"http://example.com\",\n            \"content_type\": \"json\"\n          },\n          \"updated_at\": \"2011-09-06T20:39:23Z\",\n          \"created_at\": \"2011-09-06T17:26:27Z\",\n          \"type\": \"Organization\"\n        }\n      },\n      \"installation\": {\n        \"value\": {\n          \"id\": 1,\n          \"account\": {\n            \"login\": \"github\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n            \"avatar_url\": \"https://github.com/images/error/hubot_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/orgs/github\",\n            \"html_url\": \"https://github.com/github\",\n            \"followers_url\": \"https://api.github.com/users/github/followers\",\n            \"following_url\": \"https://api.github.com/users/github/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/github/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/github/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/github/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/github/orgs\",\n            \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n            \"events_url\": \"https://api.github.com/orgs/github/events\",\n            \"received_events_url\": \"https://api.github.com/users/github/received_events\",\n            \"type\": \"Organization\",\n            \"site_admin\": false\n          },\n          \"repository_selection\": \"all\",\n          \"access_tokens_url\": \"https://api.github.com/installations/1/access_tokens\",\n          \"repositories_url\": \"https://api.github.com/installation/repositories\",\n          \"html_url\": \"https://github.com/organizations/github/settings/installations/1\",\n          \"app_id\": 1,\n          \"target_id\": 1,\n          \"target_type\": \"Organization\",\n          \"permissions\": {\n            \"checks\": \"write\",\n            \"metadata\": \"read\",\n            \"contents\": \"read\"\n          },\n          \"events\": [\n            \"push\",\n            \"pull_request\"\n          ],\n          \"created_at\": \"2018-02-09T20:51:14Z\",\n          \"updated_at\": \"2018-02-09T20:51:14Z\",\n          \"single_file_name\": \"config.yml\",\n          \"has_multiple_single_files\": true,\n          \"single_file_paths\": [\n            \"config.yml\",\n            \".github/issue_TEMPLATE.md\"\n          ],\n          \"app_slug\": \"github-actions\",\n          \"suspended_at\": null,\n          \"suspended_by\": null\n        }\n      },\n      \"installation-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"installations\": [\n            {\n              \"id\": 25381,\n              \"account\": {\n                \"login\": \"octo-org\",\n                \"id\": 6811672,\n                \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=\",\n                \"avatar_url\": \"https://avatars3.githubusercontent.com/u/6811672?v=4\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octo-org\",\n                \"html_url\": \"https://github.com/octo-org\",\n                \"followers_url\": \"https://api.github.com/users/octo-org/followers\",\n                \"following_url\": \"https://api.github.com/users/octo-org/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octo-org/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octo-org/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octo-org/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octo-org/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octo-org/repos\",\n                \"events_url\": \"https://api.github.com/users/octo-org/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octo-org/received_events\",\n                \"type\": \"Organization\",\n                \"site_admin\": false\n              },\n              \"repository_selection\": \"selected\",\n              \"access_tokens_url\": \"https://api.github.com/app/installations/25381/access_tokens\",\n              \"repositories_url\": \"https://api.github.com/installation/repositories\",\n              \"html_url\": \"https://github.com/organizations/octo-org/settings/installations/25381\",\n              \"app_id\": 2218,\n              \"target_id\": 6811672,\n              \"target_type\": \"Organization\",\n              \"permissions\": {\n                \"deployments\": \"write\",\n                \"metadata\": \"read\",\n                \"pull_requests\": \"read\",\n                \"statuses\": \"read\"\n              },\n              \"events\": [\n                \"deployment\",\n                \"deployment_status\"\n              ],\n              \"created_at\": \"2017-05-16T08:47:09.000-07:00\",\n              \"updated_at\": \"2017-06-06T11:23:23.000-07:00\",\n              \"single_file_name\": \"config.yml\",\n              \"has_multiple_single_files\": true,\n              \"single_file_paths\": [\n                \"config.yml\",\n                \".github/issue_TEMPLATE.md\"\n              ],\n              \"app_slug\": \"github-actions\",\n              \"suspended_at\": null,\n              \"suspended_by\": null\n            }\n          ]\n        }\n      },\n      \"simple-user-items\": {\n        \"value\": [\n          {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        ]\n      },\n      \"org-membership-response-if-user-has-an-active-admin-membership-with-organization\": {\n        \"summary\": \"Response if user has an active admin membership with organization\",\n        \"value\": {\n          \"url\": \"https://api.github.com/orgs/octocat/memberships/defunkt\",\n          \"state\": \"active\",\n          \"role\": \"admin\",\n          \"organization_url\": \"https://api.github.com/orgs/octocat\",\n          \"organization\": {\n            \"login\": \"github\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n            \"url\": \"https://api.github.com/orgs/github\",\n            \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n            \"events_url\": \"https://api.github.com/orgs/github/events\",\n            \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n            \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n            \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n            \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"description\": \"A great organization\"\n          },\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"org-pre-receive-hook-items\": {\n        \"value\": [\n          {\n            \"id\": 42,\n            \"name\": \"Check Commits\",\n            \"enforcement\": \"disabled\",\n            \"configuration_url\": \"https://github.example.com/api/v3/admin/pre-receive-hooks/42\",\n            \"allow_downstream_configuration\": true\n          }\n        ]\n      },\n      \"org-pre-receive-hook\": {\n        \"value\": {\n          \"id\": 42,\n          \"name\": \"Check Commits\",\n          \"enforcement\": \"disabled\",\n          \"configuration_url\": \"https://github.example.com/api/v3/admin/pre-receive-hooks/42\",\n          \"allow_downstream_configuration\": true\n        }\n      },\n      \"org-pre-receive-hook-2\": {\n        \"value\": {\n          \"id\": 42,\n          \"name\": \"Check Commits\",\n          \"enforcement\": \"enabled\",\n          \"configuration_url\": \"https://github.example.com/api/v3/orgs/octocat/pre-receive-hooks/42\",\n          \"allow_downstream_configuration\": false\n        }\n      },\n      \"project-items\": {\n        \"value\": [\n          {\n            \"owner_url\": \"https://api.github.com/orgs/octocat\",\n            \"url\": \"https://api.github.com/projects/1002605\",\n            \"html_url\": \"https://github.com/orgs/api-playground/projects/1\",\n            \"columns_url\": \"https://api.github.com/projects/1002605/columns\",\n            \"id\": 1002605,\n            \"node_id\": \"MDc6UHJvamVjdDEwMDI2MDU=\",\n            \"name\": \"Organization Roadmap\",\n            \"body\": \"High-level roadmap for the upcoming year.\",\n            \"number\": 1,\n            \"state\": \"open\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2011-04-11T20:09:31Z\",\n            \"updated_at\": \"2014-03-04T18:58:10Z\"\n          }\n        ]\n      },\n      \"project-2\": {\n        \"value\": {\n          \"owner_url\": \"https://api.github.com/orgs/octocat\",\n          \"url\": \"https://api.github.com/projects/1002605\",\n          \"html_url\": \"https://github.com/orgs/api-playground/projects/1\",\n          \"columns_url\": \"https://api.github.com/projects/1002605/columns\",\n          \"id\": 1002605,\n          \"node_id\": \"MDc6UHJvamVjdDEwMDI2MDU=\",\n          \"name\": \"Organization Roadmap\",\n          \"body\": \"High-level roadmap for the upcoming year.\",\n          \"number\": 1,\n          \"state\": \"open\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2011-04-11T20:09:31Z\",\n          \"updated_at\": \"2014-03-04T18:58:10Z\"\n        }\n      },\n      \"minimal-repository-items\": {\n        \"value\": [\n          {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"language\": null,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": false,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"template_repository\": null\n          }\n        ]\n      },\n      \"repository\": {\n        \"value\": {\n          \"id\": 1296269,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"name\": \"Hello-World\",\n          \"full_name\": \"octocat/Hello-World\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"private\": false,\n          \"html_url\": \"https://github.com/octocat/Hello-World\",\n          \"description\": \"This your first repo!\",\n          \"fork\": false,\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n          \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n          \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n          \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n          \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n          \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n          \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n          \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n          \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n          \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n          \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n          \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n          \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n          \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n          \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n          \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n          \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n          \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n          \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n          \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n          \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n          \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n          \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n          \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n          \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n          \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n          \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n          \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n          \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n          \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n          \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n          \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n          \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n          \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n          \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n          \"homepage\": \"https://github.com\",\n          \"forks\": 9,\n          \"forks_count\": 9,\n          \"stargazers_count\": 80,\n          \"watchers_count\": 80,\n          \"watchers\": 80,\n          \"size\": 108,\n          \"default_branch\": \"master\",\n          \"open_issues\": 0,\n          \"open_issues_count\": 0,\n          \"is_template\": true,\n          \"license\": {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"spdx_id\": \"MIT\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n            \"html_url\": \"https://api.github.com/licenses/mit\"\n          },\n          \"topics\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ],\n          \"has_issues\": true,\n          \"has_projects\": true,\n          \"has_wiki\": true,\n          \"has_pages\": false,\n          \"has_downloads\": true,\n          \"archived\": false,\n          \"disabled\": false,\n          \"visibility\": \"public\",\n          \"pushed_at\": \"2011-01-26T19:06:43Z\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:14:43Z\",\n          \"permissions\": {\n            \"admin\": false,\n            \"push\": false,\n            \"pull\": true\n          },\n          \"allow_rebase_merge\": true,\n          \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n          \"allow_squash_merge\": true,\n          \"delete_branch_on_merge\": true,\n          \"allow_merge_commit\": true,\n          \"subscribers_count\": 42,\n          \"network_count\": 0\n        }\n      },\n      \"team-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDQ6VGVhbTE=\",\n            \"url\": \"https://api.github.com/teams/1\",\n            \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n            \"name\": \"Justice League\",\n            \"slug\": \"justice-league\",\n            \"description\": \"A great team.\",\n            \"privacy\": \"closed\",\n            \"permission\": \"admin\",\n            \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n            \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n            \"parent\": null\n          }\n        ]\n      },\n      \"team-full\": {\n        \"value\": {\n          \"id\": 1,\n          \"node_id\": \"MDQ6VGVhbTE=\",\n          \"url\": \"https://api.github.com/teams/1\",\n          \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n          \"name\": \"Justice League\",\n          \"slug\": \"justice-league\",\n          \"description\": \"A great team.\",\n          \"privacy\": \"closed\",\n          \"permission\": \"admin\",\n          \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n          \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n          \"members_count\": 3,\n          \"repos_count\": 10,\n          \"created_at\": \"2017-07-14T16:53:42Z\",\n          \"updated_at\": \"2017-08-17T12:37:15Z\",\n          \"organization\": {\n            \"login\": \"github\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n            \"url\": \"https://api.github.com/orgs/github\",\n            \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n            \"events_url\": \"https://api.github.com/orgs/github/events\",\n            \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n            \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n            \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n            \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"description\": \"A great organization\",\n            \"name\": \"github\",\n            \"company\": \"GitHub\",\n            \"blog\": \"https://github.com/blog\",\n            \"location\": \"San Francisco\",\n            \"email\": \"octocat@github.com\",\n            \"has_organization_projects\": true,\n            \"has_repository_projects\": true,\n            \"public_repos\": 2,\n            \"public_gists\": 1,\n            \"followers\": 20,\n            \"following\": 0,\n            \"html_url\": \"https://github.com/octocat\",\n            \"created_at\": \"2008-01-14T04:33:35Z\",\n            \"updated_at\": \"2017-08-17T12:37:15Z\",\n            \"type\": \"Organization\"\n          },\n          \"ldap_dn\": \"uid=asdf,ou=users,dc=github,dc=com\"\n        }\n      },\n      \"team-discussion-items\": {\n        \"value\": [\n          {\n            \"author\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"body\": \"Hi! This is an area for us to collaborate as a team.\",\n            \"body_html\": \"<p>Hi! This is an area for us to collaborate as a team</p>\",\n            \"body_version\": \"0d495416a700fb06133c612575d92bfb\",\n            \"comments_count\": 0,\n            \"comments_url\": \"https://api.github.com/teams/2343027/discussions/1/comments\",\n            \"created_at\": \"2018-01-25T18:56:31Z\",\n            \"last_edited_at\": null,\n            \"html_url\": \"https://github.com/orgs/github/teams/justice-league/discussions/1\",\n            \"node_id\": \"MDE0OlRlYW1EaXNjdXNzaW9uMQ==\",\n            \"number\": 1,\n            \"pinned\": false,\n            \"private\": false,\n            \"team_url\": \"https://api.github.com/teams/2343027\",\n            \"title\": \"Our first team post\",\n            \"updated_at\": \"2018-01-25T18:56:31Z\",\n            \"url\": \"https://api.github.com/teams/2343027/discussions/1\",\n            \"reactions\": {\n              \"url\": \"https://api.github.com/teams/2343027/discussions/1/reactions\",\n              \"total_count\": 5,\n              \"+1\": 3,\n              \"-1\": 1,\n              \"laugh\": 0,\n              \"confused\": 0,\n              \"heart\": 1,\n              \"hooray\": 0,\n              \"eyes\": 1,\n              \"rocket\": 1\n            }\n          }\n        ]\n      },\n      \"team-discussion\": {\n        \"value\": {\n          \"author\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Hi! This is an area for us to collaborate as a team.\",\n          \"body_html\": \"<p>Hi! This is an area for us to collaborate as a team</p>\",\n          \"body_version\": \"0d495416a700fb06133c612575d92bfb\",\n          \"comments_count\": 0,\n          \"comments_url\": \"https://api.github.com/teams/2343027/discussions/1/comments\",\n          \"created_at\": \"2018-01-25T18:56:31Z\",\n          \"last_edited_at\": null,\n          \"html_url\": \"https://github.com/orgs/github/teams/justice-league/discussions/1\",\n          \"node_id\": \"MDE0OlRlYW1EaXNjdXNzaW9uMQ==\",\n          \"number\": 1,\n          \"pinned\": false,\n          \"private\": false,\n          \"team_url\": \"https://api.github.com/teams/2343027\",\n          \"title\": \"Our first team post\",\n          \"updated_at\": \"2018-01-25T18:56:31Z\",\n          \"url\": \"https://api.github.com/teams/2343027/discussions/1\",\n          \"reactions\": {\n            \"url\": \"https://api.github.com/teams/2343027/discussions/1/reactions\",\n            \"total_count\": 5,\n            \"+1\": 3,\n            \"-1\": 1,\n            \"laugh\": 0,\n            \"confused\": 0,\n            \"heart\": 1,\n            \"hooray\": 0,\n            \"eyes\": 1,\n            \"rocket\": 1\n          }\n        }\n      },\n      \"team-discussion-2\": {\n        \"value\": {\n          \"author\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Hi! This is an area for us to collaborate as a team.\",\n          \"body_html\": \"<p>Hi! This is an area for us to collaborate as a team</p>\",\n          \"body_version\": \"0d495416a700fb06133c612575d92bfb\",\n          \"comments_count\": 1,\n          \"comments_url\": \"https://api.github.com/teams/2343027/discussions/1/comments\",\n          \"created_at\": \"2018-01-25T18:56:31Z\",\n          \"last_edited_at\": \"2018-01-26T18:22:20Z\",\n          \"html_url\": \"https://github.com/orgs/github/teams/justice-league/discussions/1\",\n          \"node_id\": \"MDE0OlRlYW1EaXNjdXNzaW9uMQ==\",\n          \"number\": 1,\n          \"pinned\": false,\n          \"private\": false,\n          \"team_url\": \"https://api.github.com/teams/2343027\",\n          \"title\": \"Welcome to our first team post\",\n          \"updated_at\": \"2018-01-26T18:22:20Z\",\n          \"url\": \"https://api.github.com/teams/2343027/discussions/1\",\n          \"reactions\": {\n            \"url\": \"https://api.github.com/teams/2343027/discussions/1/reactions\",\n            \"total_count\": 5,\n            \"+1\": 3,\n            \"-1\": 1,\n            \"laugh\": 0,\n            \"confused\": 0,\n            \"heart\": 1,\n            \"hooray\": 0,\n            \"eyes\": 1,\n            \"rocket\": 1\n          }\n        }\n      },\n      \"team-discussion-comment-items\": {\n        \"value\": [\n          {\n            \"author\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"body\": \"Do you like apples?\",\n            \"body_html\": \"<p>Do you like apples?</p>\",\n            \"body_version\": \"5eb32b219cdc6a5a9b29ba5d6caa9c51\",\n            \"created_at\": \"2018-01-15T23:53:58Z\",\n            \"last_edited_at\": null,\n            \"discussion_url\": \"https://api.github.com/teams/2403582/discussions/1\",\n            \"html_url\": \"https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1\",\n            \"node_id\": \"MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=\",\n            \"number\": 1,\n            \"updated_at\": \"2018-01-15T23:53:58Z\",\n            \"url\": \"https://api.github.com/teams/2403582/discussions/1/comments/1\",\n            \"reactions\": {\n              \"url\": \"https://api.github.com/teams/2403582/discussions/1/reactions\",\n              \"total_count\": 5,\n              \"+1\": 3,\n              \"-1\": 1,\n              \"laugh\": 0,\n              \"confused\": 0,\n              \"heart\": 1,\n              \"hooray\": 0,\n              \"eyes\": 1,\n              \"rocket\": 1\n            }\n          }\n        ]\n      },\n      \"team-discussion-comment\": {\n        \"value\": {\n          \"author\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Do you like apples?\",\n          \"body_html\": \"<p>Do you like apples?</p>\",\n          \"body_version\": \"5eb32b219cdc6a5a9b29ba5d6caa9c51\",\n          \"created_at\": \"2018-01-15T23:53:58Z\",\n          \"last_edited_at\": null,\n          \"discussion_url\": \"https://api.github.com/teams/2403582/discussions/1\",\n          \"html_url\": \"https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1\",\n          \"node_id\": \"MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=\",\n          \"number\": 1,\n          \"updated_at\": \"2018-01-15T23:53:58Z\",\n          \"url\": \"https://api.github.com/teams/2403582/discussions/1/comments/1\",\n          \"reactions\": {\n            \"url\": \"https://api.github.com/teams/2403582/discussions/1/reactions\",\n            \"total_count\": 5,\n            \"+1\": 3,\n            \"-1\": 1,\n            \"laugh\": 0,\n            \"confused\": 0,\n            \"heart\": 1,\n            \"hooray\": 0,\n            \"eyes\": 1,\n            \"rocket\": 1\n          }\n        }\n      },\n      \"team-discussion-comment-2\": {\n        \"value\": {\n          \"author\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Do you like pineapples?\",\n          \"body_html\": \"<p>Do you like pineapples?</p>\",\n          \"body_version\": \"e6907b24d9c93cc0c5024a7af5888116\",\n          \"created_at\": \"2018-01-15T23:53:58Z\",\n          \"last_edited_at\": \"2018-01-26T18:22:20Z\",\n          \"discussion_url\": \"https://api.github.com/teams/2403582/discussions/1\",\n          \"html_url\": \"https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1\",\n          \"node_id\": \"MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=\",\n          \"number\": 1,\n          \"updated_at\": \"2018-01-26T18:22:20Z\",\n          \"url\": \"https://api.github.com/teams/2403582/discussions/1/comments/1\",\n          \"reactions\": {\n            \"url\": \"https://api.github.com/teams/2403582/discussions/1/reactions\",\n            \"total_count\": 5,\n            \"+1\": 3,\n            \"-1\": 1,\n            \"laugh\": 0,\n            \"confused\": 0,\n            \"heart\": 1,\n            \"hooray\": 0,\n            \"eyes\": 1,\n            \"rocket\": 1\n          }\n        }\n      },\n      \"reaction-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDg6UmVhY3Rpb24x\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"content\": \"heart\",\n            \"created_at\": \"2016-05-20T20:09:31Z\"\n          }\n        ]\n      },\n      \"reaction\": {\n        \"value\": {\n          \"id\": 1,\n          \"node_id\": \"MDg6UmVhY3Rpb24x\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"content\": \"heart\",\n          \"created_at\": \"2016-05-20T20:09:31Z\"\n        }\n      },\n      \"team-membership-response-if-user-is-a-team-maintainer\": {\n        \"summary\": \"Response if user is a team maintainer\",\n        \"value\": {\n          \"url\": \"https://api.github.com/teams/1/memberships/octocat\",\n          \"role\": \"maintainer\",\n          \"state\": \"active\"\n        }\n      },\n      \"team-membership-response-if-users-membership-with-team-is-now-pending\": {\n        \"summary\": \"Response if user's membership with team is now pending\",\n        \"value\": {\n          \"url\": \"https://api.github.com/teams/1/memberships/octocat\",\n          \"role\": \"member\",\n          \"state\": \"pending\"\n        }\n      },\n      \"team-project-items\": {\n        \"value\": [\n          {\n            \"owner_url\": \"https://api.github.com/orgs/octocat\",\n            \"url\": \"https://api.github.com/projects/1002605\",\n            \"html_url\": \"https://github.com/orgs/api-playground/projects/1\",\n            \"columns_url\": \"https://api.github.com/projects/1002605/columns\",\n            \"id\": 1002605,\n            \"node_id\": \"MDc6UHJvamVjdDEwMDI2MDU=\",\n            \"name\": \"Organization Roadmap\",\n            \"body\": \"High-level roadmap for the upcoming year.\",\n            \"number\": 1,\n            \"state\": \"open\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2011-04-11T20:09:31Z\",\n            \"updated_at\": \"2014-03-04T18:58:10Z\",\n            \"organization_permission\": \"write\",\n            \"private\": false,\n            \"permissions\": {\n              \"read\": true,\n              \"write\": true,\n              \"admin\": false\n            }\n          }\n        ]\n      },\n      \"team-project\": {\n        \"value\": {\n          \"owner_url\": \"https://api.github.com/orgs/octocat\",\n          \"url\": \"https://api.github.com/projects/1002605\",\n          \"html_url\": \"https://github.com/orgs/api-playground/projects/1\",\n          \"columns_url\": \"https://api.github.com/projects/1002605/columns\",\n          \"id\": 1002605,\n          \"node_id\": \"MDc6UHJvamVjdDEwMDI2MDU=\",\n          \"name\": \"Organization Roadmap\",\n          \"body\": \"High-level roadmap for the upcoming year.\",\n          \"number\": 1,\n          \"state\": \"open\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2011-04-11T20:09:31Z\",\n          \"updated_at\": \"2014-03-04T18:58:10Z\",\n          \"organization_permission\": \"write\",\n          \"private\": false,\n          \"permissions\": {\n            \"read\": true,\n            \"write\": true,\n            \"admin\": false\n          }\n        }\n      },\n      \"team-repository-alternative-response-with-repository-permissions\": {\n        \"value\": {\n          \"id\": 1296269,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"name\": \"Hello-World\",\n          \"full_name\": \"octocat/Hello-World\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"private\": false,\n          \"html_url\": \"https://github.com/octocat/Hello-World\",\n          \"description\": \"This your first repo!\",\n          \"fork\": false,\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n          \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n          \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n          \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n          \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n          \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n          \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n          \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n          \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n          \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n          \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n          \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n          \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n          \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n          \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n          \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n          \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n          \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n          \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n          \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n          \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n          \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n          \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n          \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n          \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n          \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n          \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n          \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n          \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n          \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n          \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n          \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n          \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n          \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n          \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n          \"homepage\": \"https://github.com\",\n          \"forks_count\": 9,\n          \"stargazers_count\": 80,\n          \"watchers_count\": 80,\n          \"size\": 108,\n          \"default_branch\": \"master\",\n          \"open_issues_count\": 0,\n          \"is_template\": false,\n          \"topics\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ],\n          \"has_issues\": true,\n          \"has_projects\": true,\n          \"has_wiki\": true,\n          \"has_pages\": false,\n          \"has_downloads\": true,\n          \"archived\": false,\n          \"disabled\": false,\n          \"visibility\": \"public\",\n          \"pushed_at\": \"2011-01-26T19:06:43Z\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:14:43Z\",\n          \"permissions\": {\n            \"admin\": false,\n            \"maintain\": false,\n            \"push\": false,\n            \"triage\": false,\n            \"pull\": true\n          },\n          \"allow_rebase_merge\": true,\n          \"template_repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World-Template\",\n            \"full_name\": \"octocat/Hello-World-Template\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World-Template\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World-Template\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World-Template.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World-Template.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World-Template.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World-Template\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World-Template\",\n            \"homepage\": \"https://github.com\",\n            \"forks\": 9,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"watchers\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues\": 0,\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"pull\": true,\n              \"triage\": false,\n              \"push\": false,\n              \"maintain\": false,\n              \"admin\": false\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0\n          },\n          \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n          \"allow_squash_merge\": true,\n          \"delete_branch_on_merge\": true,\n          \"allow_merge_commit\": true,\n          \"subscribers_count\": 42,\n          \"network_count\": 0,\n          \"license\": {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"spdx_id\": \"MIT\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n            \"html_url\": \"https://api.github.com/licenses/mit\"\n          },\n          \"forks\": 1,\n          \"open_issues\": 1,\n          \"watchers\": 1\n        }\n      },\n      \"team-items-response-if-child-teams-exist\": {\n        \"value\": [\n          {\n            \"id\": 2,\n            \"node_id\": \"MDQ6VGVhbTI=\",\n            \"url\": \"https://api.github.com/teams/2\",\n            \"name\": \"Original Roster\",\n            \"slug\": \"original-roster\",\n            \"description\": \"Started it all.\",\n            \"privacy\": \"closed\",\n            \"permission\": \"admin\",\n            \"members_url\": \"https://api.github.com/teams/2/members{/member}\",\n            \"repositories_url\": \"https://api.github.com/teams/2/repos\",\n            \"parent\": {\n              \"id\": 1,\n              \"node_id\": \"MDQ6VGVhbTE=\",\n              \"url\": \"https://api.github.com/teams/1\",\n              \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n              \"name\": \"Justice League\",\n              \"slug\": \"justice-league\",\n              \"description\": \"A great team.\",\n              \"privacy\": \"closed\",\n              \"permission\": \"admin\",\n              \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n              \"repositories_url\": \"https://api.github.com/teams/1/repos\"\n            },\n            \"html_url\": \"https://github.com/orgs/rails/teams/core\"\n          }\n        ]\n      },\n      \"project-card\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/projects/columns/cards/1478\",\n          \"id\": 1478,\n          \"node_id\": \"MDExOlByb2plY3RDYXJkMTQ3OA==\",\n          \"note\": \"Add payload for delete Project column\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2016-09-05T14:21:06Z\",\n          \"updated_at\": \"2016-09-05T14:20:22Z\",\n          \"archived\": false,\n          \"column_url\": \"https://api.github.com/projects/columns/367\",\n          \"content_url\": \"https://api.github.com/repos/api-playground/projects-test/issues/3\",\n          \"project_url\": \"https://api.github.com/projects/120\"\n        }\n      },\n      \"project-column\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/projects/columns/367\",\n          \"project_url\": \"https://api.github.com/projects/120\",\n          \"cards_url\": \"https://api.github.com/projects/columns/367/cards\",\n          \"id\": 367,\n          \"node_id\": \"MDEzOlByb2plY3RDb2x1bW4zNjc=\",\n          \"name\": \"To Do\",\n          \"created_at\": \"2016-09-05T14:18:44Z\",\n          \"updated_at\": \"2016-09-05T14:22:28Z\"\n        }\n      },\n      \"project-card-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/projects/columns/cards/1478\",\n            \"id\": 1478,\n            \"node_id\": \"MDExOlByb2plY3RDYXJkMTQ3OA==\",\n            \"note\": \"Add payload for delete Project column\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2016-09-05T14:21:06Z\",\n            \"updated_at\": \"2016-09-05T14:20:22Z\",\n            \"archived\": false,\n            \"column_url\": \"https://api.github.com/projects/columns/367\",\n            \"content_url\": \"https://api.github.com/repos/api-playground/projects-test/issues/3\",\n            \"project_url\": \"https://api.github.com/projects/120\"\n          }\n        ]\n      },\n      \"project-3\": {\n        \"value\": {\n          \"owner_url\": \"https://api.github.com/repos/api-playground/projects-test\",\n          \"url\": \"https://api.github.com/projects/1002604\",\n          \"html_url\": \"https://github.com/api-playground/projects-test/projects/1\",\n          \"columns_url\": \"https://api.github.com/projects/1002604/columns\",\n          \"id\": 1002604,\n          \"node_id\": \"MDc6UHJvamVjdDEwMDI2MDQ=\",\n          \"name\": \"Projects Documentation\",\n          \"body\": \"Developer documentation project for the developer site.\",\n          \"number\": 1,\n          \"state\": \"open\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2011-04-10T20:09:31Z\",\n          \"updated_at\": \"2014-03-03T18:58:10Z\"\n        }\n      },\n      \"project-collaborator-permission\": {\n        \"value\": {\n          \"permission\": \"admin\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"project-column-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/projects/columns/367\",\n            \"project_url\": \"https://api.github.com/projects/120\",\n            \"cards_url\": \"https://api.github.com/projects/columns/367/cards\",\n            \"id\": 367,\n            \"node_id\": \"MDEzOlByb2plY3RDb2x1bW4zNjc=\",\n            \"name\": \"To Do\",\n            \"created_at\": \"2016-09-05T14:18:44Z\",\n            \"updated_at\": \"2016-09-05T14:22:28Z\"\n          }\n        ]\n      },\n      \"rate-limit-overview\": {\n        \"value\": {\n          \"resources\": {\n            \"core\": {\n              \"limit\": 5000,\n              \"remaining\": 4999,\n              \"reset\": 1372700873,\n              \"used\": 1\n            },\n            \"search\": {\n              \"limit\": 30,\n              \"remaining\": 18,\n              \"reset\": 1372697452,\n              \"used\": 12\n            },\n            \"graphql\": {\n              \"limit\": 5000,\n              \"remaining\": 4993,\n              \"reset\": 1372700389,\n              \"used\": 7\n            },\n            \"integration_manifest\": {\n              \"limit\": 5000,\n              \"remaining\": 4999,\n              \"reset\": 1551806725,\n              \"used\": 1\n            },\n            \"code_scanning_upload\": {\n              \"limit\": 500,\n              \"remaining\": 499,\n              \"reset\": 1551806725,\n              \"used\": 1\n            }\n          },\n          \"rate\": {\n            \"limit\": 5000,\n            \"remaining\": 4999,\n            \"reset\": 1372700873,\n            \"used\": 1\n          }\n        }\n      },\n      \"full-repository-default-response\": {\n        \"summary\": \"Default response\",\n        \"value\": {\n          \"id\": 1296269,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"name\": \"Hello-World\",\n          \"full_name\": \"octocat/Hello-World\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"private\": false,\n          \"html_url\": \"https://github.com/octocat/Hello-World\",\n          \"description\": \"This your first repo!\",\n          \"fork\": false,\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n          \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n          \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n          \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n          \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n          \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n          \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n          \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n          \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n          \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n          \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n          \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n          \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n          \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n          \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n          \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n          \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n          \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n          \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n          \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n          \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n          \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n          \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n          \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n          \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n          \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n          \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n          \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n          \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n          \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n          \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n          \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n          \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n          \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n          \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n          \"homepage\": \"https://github.com\",\n          \"forks_count\": 9,\n          \"forks\": 9,\n          \"stargazers_count\": 80,\n          \"watchers_count\": 80,\n          \"watchers\": 80,\n          \"size\": 108,\n          \"default_branch\": \"master\",\n          \"open_issues_count\": 0,\n          \"open_issues\": 0,\n          \"is_template\": false,\n          \"topics\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ],\n          \"has_issues\": true,\n          \"has_projects\": true,\n          \"has_wiki\": true,\n          \"has_pages\": false,\n          \"has_downloads\": true,\n          \"archived\": false,\n          \"disabled\": false,\n          \"visibility\": \"public\",\n          \"pushed_at\": \"2011-01-26T19:06:43Z\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:14:43Z\",\n          \"permissions\": {\n            \"pull\": true,\n            \"push\": false,\n            \"admin\": false\n          },\n          \"allow_rebase_merge\": true,\n          \"template_repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World-Template\",\n            \"full_name\": \"octocat/Hello-World-Template\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World-Template\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World-Template\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World-Template.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World-Template.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World-Template.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World-Template\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World-Template\",\n            \"homepage\": \"https://github.com\",\n            \"forks\": 9,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"watchers\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues\": 0,\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0\n          },\n          \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n          \"allow_squash_merge\": true,\n          \"delete_branch_on_merge\": true,\n          \"allow_merge_commit\": true,\n          \"subscribers_count\": 42,\n          \"network_count\": 0,\n          \"license\": {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"spdx_id\": \"MIT\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          },\n          \"organization\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"Organization\",\n            \"site_admin\": false\n          },\n          \"parent\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"forks\": 1,\n            \"open_issues\": 1,\n            \"watchers\": 1\n          },\n          \"source\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"forks\": 1,\n            \"open_issues\": 1,\n            \"watchers\": 1\n          }\n        }\n      },\n      \"full-repository-response-with-scarlet-witch-preview-media-type\": {\n        \"summary\": \"Response with scarlet-witch-preview media type\",\n        \"value\": {\n          \"id\": 1296269,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"name\": \"Hello-World\",\n          \"full_name\": \"octocat/Hello-World\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"private\": false,\n          \"html_url\": \"https://github.com/octocat/Hello-World\",\n          \"description\": \"This your first repo!\",\n          \"fork\": false,\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n          \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n          \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n          \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n          \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n          \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n          \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n          \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n          \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n          \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n          \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n          \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n          \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n          \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n          \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n          \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n          \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n          \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n          \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n          \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n          \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n          \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n          \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n          \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n          \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n          \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n          \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n          \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n          \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n          \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n          \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n          \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n          \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n          \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n          \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n          \"homepage\": \"https://github.com\",\n          \"forks_count\": 9,\n          \"forks\": 9,\n          \"stargazers_count\": 80,\n          \"watchers_count\": 80,\n          \"watchers\": 80,\n          \"size\": 108,\n          \"default_branch\": \"master\",\n          \"open_issues_count\": 0,\n          \"open_issues\": 0,\n          \"is_template\": false,\n          \"topics\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ],\n          \"has_issues\": true,\n          \"has_projects\": true,\n          \"has_wiki\": true,\n          \"has_pages\": false,\n          \"has_downloads\": true,\n          \"archived\": false,\n          \"disabled\": false,\n          \"visibility\": \"public\",\n          \"pushed_at\": \"2011-01-26T19:06:43Z\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:14:43Z\",\n          \"permissions\": {\n            \"pull\": true,\n            \"push\": false,\n            \"admin\": false\n          },\n          \"allow_rebase_merge\": true,\n          \"template_repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World-Template\",\n            \"full_name\": \"octocat/Hello-World-Template\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World-Template\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World-Template\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World-Template.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World-Template.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World-Template.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World-Template\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World-Template\",\n            \"homepage\": \"https://github.com\",\n            \"forks\": 9,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"watchers\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues\": 0,\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0\n          },\n          \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n          \"allow_squash_merge\": true,\n          \"delete_branch_on_merge\": true,\n          \"allow_merge_commit\": true,\n          \"subscribers_count\": 42,\n          \"network_count\": 0,\n          \"license\": {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"spdx_id\": \"MIT\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          },\n          \"organization\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"Organization\",\n            \"site_admin\": false\n          },\n          \"parent\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"forks\": 1,\n            \"open_issues\": 1,\n            \"watchers\": 1\n          },\n          \"source\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"forks\": 1,\n            \"open_issues\": 1,\n            \"watchers\": 1\n          },\n          \"code_of_conduct\": {\n            \"key\": \"other\",\n            \"name\": \"Other\",\n            \"html_url\": \"https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md\",\n            \"url\": \"https://api.github.com/repos/github/docs/community/code_of_conduct\"\n          }\n        }\n      },\n      \"full-repository\": {\n        \"value\": {\n          \"id\": 1296269,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"name\": \"Hello-World\",\n          \"full_name\": \"octocat/Hello-World\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"private\": false,\n          \"html_url\": \"https://github.com/octocat/Hello-World\",\n          \"description\": \"This your first repo!\",\n          \"fork\": false,\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n          \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n          \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n          \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n          \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n          \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n          \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n          \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n          \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n          \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n          \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n          \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n          \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n          \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n          \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n          \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n          \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n          \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n          \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n          \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n          \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n          \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n          \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n          \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n          \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n          \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n          \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n          \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n          \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n          \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n          \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n          \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n          \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n          \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n          \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n          \"homepage\": \"https://github.com\",\n          \"license\": {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"spdx_id\": \"MIT\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n            \"html_url\": \"https://github.com/licenses/mit\"\n          },\n          \"forks_count\": 9,\n          \"forks\": 9,\n          \"stargazers_count\": 80,\n          \"watchers_count\": 80,\n          \"watchers\": 80,\n          \"size\": 108,\n          \"default_branch\": \"master\",\n          \"open_issues_count\": 0,\n          \"open_issues\": 0,\n          \"is_template\": false,\n          \"topics\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ],\n          \"has_issues\": true,\n          \"has_projects\": true,\n          \"has_wiki\": true,\n          \"has_pages\": false,\n          \"has_downloads\": true,\n          \"archived\": false,\n          \"disabled\": false,\n          \"visibility\": \"public\",\n          \"pushed_at\": \"2011-01-26T19:06:43Z\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:14:43Z\",\n          \"permissions\": {\n            \"pull\": true,\n            \"push\": false,\n            \"admin\": false\n          },\n          \"allow_rebase_merge\": true,\n          \"template_repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World-Template\",\n            \"full_name\": \"octocat/Hello-World-Template\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World-Template\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World-Template\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World-Template.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World-Template.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World-Template.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World-Template\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World-Template\",\n            \"homepage\": \"https://github.com\",\n            \"forks\": 9,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"watchers\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues\": 0,\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0\n          },\n          \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n          \"allow_squash_merge\": true,\n          \"delete_branch_on_merge\": true,\n          \"allow_merge_commit\": true,\n          \"allow_forking\": true,\n          \"subscribers_count\": 42,\n          \"network_count\": 0,\n          \"organization\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"Organization\",\n            \"site_admin\": false\n          },\n          \"parent\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"forks\": 1,\n            \"open_issues\": 1,\n            \"watchers\": 1\n          },\n          \"source\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"forks\": 1,\n            \"open_issues\": 1,\n            \"watchers\": 1\n          }\n        }\n      },\n      \"artifact-paginated\": {\n        \"value\": {\n          \"total_count\": 2,\n          \"artifacts\": [\n            {\n              \"id\": 11,\n              \"node_id\": \"MDg6QXJ0aWZhY3QxMQ==\",\n              \"name\": \"Rails\",\n              \"size_in_bytes\": 556,\n              \"url\": \"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11\",\n              \"archive_download_url\": \"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip\",\n              \"expired\": false,\n              \"created_at\": \"2020-01-10T14:59:22Z\",\n              \"expires_at\": \"2020-03-21T14:59:22Z\",\n              \"updated_at\": \"2020-02-21T14:59:22Z\"\n            },\n            {\n              \"id\": 13,\n              \"node_id\": \"MDg6QXJ0aWZhY3QxMw==\",\n              \"name\": \"\",\n              \"size_in_bytes\": 453,\n              \"url\": \"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13\",\n              \"archive_download_url\": \"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13/zip\",\n              \"expired\": false,\n              \"created_at\": \"2020-01-10T14:59:22Z\",\n              \"expires_at\": \"2020-03-21T14:59:22Z\",\n              \"updated_at\": \"2020-02-21T14:59:22Z\"\n            }\n          ]\n        }\n      },\n      \"artifact\": {\n        \"value\": {\n          \"id\": 11,\n          \"node_id\": \"MDg6QXJ0aWZhY3QxMQ==\",\n          \"name\": \"Rails\",\n          \"size_in_bytes\": 556,\n          \"url\": \"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11\",\n          \"archive_download_url\": \"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip\",\n          \"expired\": false,\n          \"created_at\": \"2020-01-10T14:59:22Z\",\n          \"expires_at\": \"2020-01-21T14:59:22Z\",\n          \"updated_at\": \"2020-01-21T14:59:22Z\"\n        }\n      },\n      \"job\": {\n        \"value\": {\n          \"id\": 399444496,\n          \"run_id\": 29679449,\n          \"run_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449\",\n          \"node_id\": \"MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==\",\n          \"head_sha\": \"f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0\",\n          \"url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496\",\n          \"html_url\": \"https://github.com/octo-org/octo-repo/runs/399444496\",\n          \"status\": \"completed\",\n          \"conclusion\": \"success\",\n          \"started_at\": \"2020-01-20T17:42:40Z\",\n          \"completed_at\": \"2020-01-20T17:44:39Z\",\n          \"name\": \"build\",\n          \"steps\": [\n            {\n              \"name\": \"Set up job\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 1,\n              \"started_at\": \"2020-01-20T09:42:40.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:42:41.000-08:00\"\n            },\n            {\n              \"name\": \"Run actions/checkout@v2\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 2,\n              \"started_at\": \"2020-01-20T09:42:41.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:42:45.000-08:00\"\n            },\n            {\n              \"name\": \"Set up Ruby\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 3,\n              \"started_at\": \"2020-01-20T09:42:45.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:42:45.000-08:00\"\n            },\n            {\n              \"name\": \"Run actions/cache@v2\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 4,\n              \"started_at\": \"2020-01-20T09:42:45.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:42:48.000-08:00\"\n            },\n            {\n              \"name\": \"Install Bundler\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 5,\n              \"started_at\": \"2020-01-20T09:42:48.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:42:52.000-08:00\"\n            },\n            {\n              \"name\": \"Install Gems\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 6,\n              \"started_at\": \"2020-01-20T09:42:52.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:42:53.000-08:00\"\n            },\n            {\n              \"name\": \"Run Tests\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 7,\n              \"started_at\": \"2020-01-20T09:42:53.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:42:59.000-08:00\"\n            },\n            {\n              \"name\": \"Deploy to Heroku\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 8,\n              \"started_at\": \"2020-01-20T09:42:59.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:44:39.000-08:00\"\n            },\n            {\n              \"name\": \"Post actions/cache@v2\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 16,\n              \"started_at\": \"2020-01-20T09:44:39.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:44:39.000-08:00\"\n            },\n            {\n              \"name\": \"Complete job\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"number\": 17,\n              \"started_at\": \"2020-01-20T09:44:39.000-08:00\",\n              \"completed_at\": \"2020-01-20T09:44:39.000-08:00\"\n            }\n          ],\n          \"check_run_url\": \"https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496\"\n        }\n      },\n      \"actions-repository-permissions\": {\n        \"value\": {\n          \"enabled\": true,\n          \"allowed_actions\": \"selected\",\n          \"selected_actions_url\": \"https://api.github.com/repositories/42/actions/permissions/selected-actions\"\n        }\n      },\n      \"workflow-run-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"workflow_runs\": [\n            {\n              \"id\": 30433642,\n              \"name\": \"Build\",\n              \"node_id\": \"MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==\",\n              \"head_branch\": \"master\",\n              \"head_sha\": \"acb5820ced9479c074f688cc328bf03f341a511d\",\n              \"run_number\": 562,\n              \"event\": \"push\",\n              \"status\": \"queued\",\n              \"conclusion\": null,\n              \"workflow_id\": 159038,\n              \"url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642\",\n              \"html_url\": \"https://github.com/octo-org/octo-repo/actions/runs/30433642\",\n              \"pull_requests\": [\n\n              ],\n              \"created_at\": \"2020-01-22T19:33:08Z\",\n              \"updated_at\": \"2020-01-22T19:33:08Z\",\n              \"jobs_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs\",\n              \"logs_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs\",\n              \"check_suite_url\": \"https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374\",\n              \"artifacts_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts\",\n              \"cancel_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel\",\n              \"rerun_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun\",\n              \"workflow_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038\",\n              \"head_commit\": {\n                \"id\": \"acb5820ced9479c074f688cc328bf03f341a511d\",\n                \"tree_id\": \"d23f6eedb1e1b9610bbc754ddb5197bfe7271223\",\n                \"message\": \"Create linter.yaml\",\n                \"timestamp\": \"2020-01-22T19:33:05Z\",\n                \"author\": {\n                  \"name\": \"Octo Cat\",\n                  \"email\": \"octocat@github.com\"\n                },\n                \"committer\": {\n                  \"name\": \"GitHub\",\n                  \"email\": \"noreply@github.com\"\n                }\n              },\n              \"repository\": {\n                \"id\": 1296269,\n                \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n                \"name\": \"Hello-World\",\n                \"full_name\": \"octocat/Hello-World\",\n                \"owner\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"private\": false,\n                \"html_url\": \"https://github.com/octocat/Hello-World\",\n                \"description\": \"This your first repo!\",\n                \"fork\": false,\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n                \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n                \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n                \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n                \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n                \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n                \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n                \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n                \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n                \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n                \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n                \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n                \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n                \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n                \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n                \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n                \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n                \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n                \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n                \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n                \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n                \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n                \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n                \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n                \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n                \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n                \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n                \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n                \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n                \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n                \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n                \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n                \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n                \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n                \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n                \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n                \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n                \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n                \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n              },\n              \"head_repository\": {\n                \"id\": 217723378,\n                \"node_id\": \"MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=\",\n                \"name\": \"octo-repo\",\n                \"full_name\": \"octo-org/octo-repo\",\n                \"private\": true,\n                \"owner\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"html_url\": \"https://github.com/octo-org/octo-repo\",\n                \"description\": null,\n                \"fork\": false,\n                \"url\": \"https://api.github.com/repos/octo-org/octo-repo\",\n                \"forks_url\": \"https://api.github.com/repos/octo-org/octo-repo/forks\",\n                \"keys_url\": \"https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}\",\n                \"collaborators_url\": \"https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}\",\n                \"teams_url\": \"https://api.github.com/repos/octo-org/octo-repo/teams\",\n                \"hooks_url\": \"https://api.github.com/repos/octo-org/octo-repo/hooks\",\n                \"issue_events_url\": \"https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}\",\n                \"events_url\": \"https://api.github.com/repos/octo-org/octo-repo/events\",\n                \"assignees_url\": \"https://api.github.com/repos/octo-org/octo-repo/assignees{/user}\",\n                \"branches_url\": \"https://api.github.com/repos/octo-org/octo-repo/branches{/branch}\",\n                \"tags_url\": \"https://api.github.com/repos/octo-org/octo-repo/tags\",\n                \"blobs_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}\",\n                \"git_tags_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}\",\n                \"git_refs_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}\",\n                \"trees_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}\",\n                \"statuses_url\": \"https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}\",\n                \"languages_url\": \"https://api.github.com/repos/octo-org/octo-repo/languages\",\n                \"stargazers_url\": \"https://api.github.com/repos/octo-org/octo-repo/stargazers\",\n                \"contributors_url\": \"https://api.github.com/repos/octo-org/octo-repo/contributors\",\n                \"subscribers_url\": \"https://api.github.com/repos/octo-org/octo-repo/subscribers\",\n                \"subscription_url\": \"https://api.github.com/repos/octo-org/octo-repo/subscription\",\n                \"commits_url\": \"https://api.github.com/repos/octo-org/octo-repo/commits{/sha}\",\n                \"git_commits_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}\",\n                \"comments_url\": \"https://api.github.com/repos/octo-org/octo-repo/comments{/number}\",\n                \"issue_comment_url\": \"https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}\",\n                \"contents_url\": \"https://api.github.com/repos/octo-org/octo-repo/contents/{+path}\",\n                \"compare_url\": \"https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}\",\n                \"merges_url\": \"https://api.github.com/repos/octo-org/octo-repo/merges\",\n                \"archive_url\": \"https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}\",\n                \"downloads_url\": \"https://api.github.com/repos/octo-org/octo-repo/downloads\",\n                \"issues_url\": \"https://api.github.com/repos/octo-org/octo-repo/issues{/number}\",\n                \"pulls_url\": \"https://api.github.com/repos/octo-org/octo-repo/pulls{/number}\",\n                \"milestones_url\": \"https://api.github.com/repos/octo-org/octo-repo/milestones{/number}\",\n                \"notifications_url\": \"https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}\",\n                \"labels_url\": \"https://api.github.com/repos/octo-org/octo-repo/labels{/name}\",\n                \"releases_url\": \"https://api.github.com/repos/octo-org/octo-repo/releases{/id}\",\n                \"deployments_url\": \"https://api.github.com/repos/octo-org/octo-repo/deployments\"\n              }\n            }\n          ]\n        }\n      },\n      \"workflow-run\": {\n        \"value\": {\n          \"id\": 30433642,\n          \"name\": \"Build\",\n          \"node_id\": \"MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==\",\n          \"check_suite_id\": 42,\n          \"check_suite_node_id\": \"MDEwOkNoZWNrU3VpdGU0Mg==\",\n          \"head_branch\": \"master\",\n          \"head_sha\": \"acb5820ced9479c074f688cc328bf03f341a511d\",\n          \"run_number\": 562,\n          \"event\": \"push\",\n          \"status\": \"queued\",\n          \"workflow_id\": 159038,\n          \"url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642\",\n          \"html_url\": \"https://github.com/octo-org/octo-repo/actions/runs/30433642\",\n          \"pull_requests\": [\n\n          ],\n          \"created_at\": \"2020-01-22T19:33:08Z\",\n          \"updated_at\": \"2020-01-22T19:33:08Z\",\n          \"jobs_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs\",\n          \"logs_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs\",\n          \"check_suite_url\": \"https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374\",\n          \"artifacts_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts\",\n          \"cancel_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel\",\n          \"rerun_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun\",\n          \"workflow_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038\",\n          \"head_commit\": {\n            \"id\": \"acb5820ced9479c074f688cc328bf03f341a511d\",\n            \"tree_id\": \"d23f6eedb1e1b9610bbc754ddb5197bfe7271223\",\n            \"message\": \"Create linter.yaml\",\n            \"timestamp\": \"2020-01-22T19:33:05Z\",\n            \"author\": {\n              \"name\": \"Octo Cat\",\n              \"email\": \"octocat@github.com\"\n            },\n            \"committer\": {\n              \"name\": \"GitHub\",\n              \"email\": \"noreply@github.com\"\n            }\n          },\n          \"repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n          },\n          \"head_repository\": {\n            \"id\": 217723378,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=\",\n            \"name\": \"octo-repo\",\n            \"full_name\": \"octo-org/octo-repo\",\n            \"private\": true,\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"html_url\": \"https://github.com/octo-org/octo-repo\",\n            \"description\": null,\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octo-org/octo-repo\",\n            \"forks_url\": \"https://api.github.com/repos/octo-org/octo-repo/forks\",\n            \"keys_url\": \"https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}\",\n            \"teams_url\": \"https://api.github.com/repos/octo-org/octo-repo/teams\",\n            \"hooks_url\": \"https://api.github.com/repos/octo-org/octo-repo/hooks\",\n            \"issue_events_url\": \"https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}\",\n            \"events_url\": \"https://api.github.com/repos/octo-org/octo-repo/events\",\n            \"assignees_url\": \"https://api.github.com/repos/octo-org/octo-repo/assignees{/user}\",\n            \"branches_url\": \"https://api.github.com/repos/octo-org/octo-repo/branches{/branch}\",\n            \"tags_url\": \"https://api.github.com/repos/octo-org/octo-repo/tags\",\n            \"blobs_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}\",\n            \"trees_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}\",\n            \"statuses_url\": \"https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}\",\n            \"languages_url\": \"https://api.github.com/repos/octo-org/octo-repo/languages\",\n            \"stargazers_url\": \"https://api.github.com/repos/octo-org/octo-repo/stargazers\",\n            \"contributors_url\": \"https://api.github.com/repos/octo-org/octo-repo/contributors\",\n            \"subscribers_url\": \"https://api.github.com/repos/octo-org/octo-repo/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octo-org/octo-repo/subscription\",\n            \"commits_url\": \"https://api.github.com/repos/octo-org/octo-repo/commits{/sha}\",\n            \"git_commits_url\": \"https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}\",\n            \"comments_url\": \"https://api.github.com/repos/octo-org/octo-repo/comments{/number}\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}\",\n            \"contents_url\": \"https://api.github.com/repos/octo-org/octo-repo/contents/{+path}\",\n            \"compare_url\": \"https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}\",\n            \"merges_url\": \"https://api.github.com/repos/octo-org/octo-repo/merges\",\n            \"archive_url\": \"https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}\",\n            \"downloads_url\": \"https://api.github.com/repos/octo-org/octo-repo/downloads\",\n            \"issues_url\": \"https://api.github.com/repos/octo-org/octo-repo/issues{/number}\",\n            \"pulls_url\": \"https://api.github.com/repos/octo-org/octo-repo/pulls{/number}\",\n            \"milestones_url\": \"https://api.github.com/repos/octo-org/octo-repo/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}\",\n            \"labels_url\": \"https://api.github.com/repos/octo-org/octo-repo/labels{/name}\",\n            \"releases_url\": \"https://api.github.com/repos/octo-org/octo-repo/releases{/id}\",\n            \"deployments_url\": \"https://api.github.com/repos/octo-org/octo-repo/deployments\"\n          }\n        }\n      },\n      \"job-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"jobs\": [\n            {\n              \"id\": 399444496,\n              \"run_id\": 29679449,\n              \"run_url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449\",\n              \"node_id\": \"MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==\",\n              \"head_sha\": \"f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0\",\n              \"url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496\",\n              \"html_url\": \"https://github.com/octo-org/octo-repo/runs/399444496\",\n              \"status\": \"completed\",\n              \"conclusion\": \"success\",\n              \"started_at\": \"2020-01-20T17:42:40Z\",\n              \"completed_at\": \"2020-01-20T17:44:39Z\",\n              \"name\": \"build\",\n              \"steps\": [\n                {\n                  \"name\": \"Set up job\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 1,\n                  \"started_at\": \"2020-01-20T09:42:40.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:42:41.000-08:00\"\n                },\n                {\n                  \"name\": \"Run actions/checkout@v2\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 2,\n                  \"started_at\": \"2020-01-20T09:42:41.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:42:45.000-08:00\"\n                },\n                {\n                  \"name\": \"Set up Ruby\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 3,\n                  \"started_at\": \"2020-01-20T09:42:45.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:42:45.000-08:00\"\n                },\n                {\n                  \"name\": \"Run actions/cache@v2\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 4,\n                  \"started_at\": \"2020-01-20T09:42:45.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:42:48.000-08:00\"\n                },\n                {\n                  \"name\": \"Install Bundler\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 5,\n                  \"started_at\": \"2020-01-20T09:42:48.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:42:52.000-08:00\"\n                },\n                {\n                  \"name\": \"Install Gems\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 6,\n                  \"started_at\": \"2020-01-20T09:42:52.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:42:53.000-08:00\"\n                },\n                {\n                  \"name\": \"Run Tests\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 7,\n                  \"started_at\": \"2020-01-20T09:42:53.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:42:59.000-08:00\"\n                },\n                {\n                  \"name\": \"Deploy to Heroku\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 8,\n                  \"started_at\": \"2020-01-20T09:42:59.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:44:39.000-08:00\"\n                },\n                {\n                  \"name\": \"Post actions/cache@v2\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 16,\n                  \"started_at\": \"2020-01-20T09:44:39.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:44:39.000-08:00\"\n                },\n                {\n                  \"name\": \"Complete job\",\n                  \"status\": \"completed\",\n                  \"conclusion\": \"success\",\n                  \"number\": 17,\n                  \"started_at\": \"2020-01-20T09:44:39.000-08:00\",\n                  \"completed_at\": \"2020-01-20T09:44:39.000-08:00\"\n                }\n              ],\n              \"check_run_url\": \"https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496\"\n            }\n          ]\n        }\n      },\n      \"actions-secret-paginated\": {\n        \"value\": {\n          \"total_count\": 2,\n          \"secrets\": [\n            {\n              \"name\": \"GH_TOKEN\",\n              \"created_at\": \"2019-08-10T14:59:22Z\",\n              \"updated_at\": \"2020-01-10T14:59:22Z\"\n            },\n            {\n              \"name\": \"GIST_ID\",\n              \"created_at\": \"2020-01-10T10:59:22Z\",\n              \"updated_at\": \"2020-01-11T11:59:22Z\"\n            }\n          ]\n        }\n      },\n      \"actions-secret\": {\n        \"value\": {\n          \"name\": \"GH_TOKEN\",\n          \"created_at\": \"2019-08-10T14:59:22Z\",\n          \"updated_at\": \"2020-01-10T14:59:22Z\"\n        }\n      },\n      \"workflow-paginated\": {\n        \"value\": {\n          \"total_count\": 2,\n          \"workflows\": [\n            {\n              \"id\": 161335,\n              \"node_id\": \"MDg6V29ya2Zsb3cxNjEzMzU=\",\n              \"name\": \"CI\",\n              \"path\": \".github/workflows/blank.yaml\",\n              \"state\": \"active\",\n              \"created_at\": \"2020-01-08T23:48:37.000-08:00\",\n              \"updated_at\": \"2020-01-08T23:50:21.000-08:00\",\n              \"url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/workflows/161335\",\n              \"html_url\": \"https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335\",\n              \"badge_url\": \"https://github.com/octo-org/octo-repo/workflows/CI/badge.svg\"\n            },\n            {\n              \"id\": 269289,\n              \"node_id\": \"MDE4OldvcmtmbG93IFNlY29uZGFyeTI2OTI4OQ==\",\n              \"name\": \"Linter\",\n              \"path\": \".github/workflows/linter.yaml\",\n              \"state\": \"active\",\n              \"created_at\": \"2020-01-08T23:48:37.000-08:00\",\n              \"updated_at\": \"2020-01-08T23:50:21.000-08:00\",\n              \"url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/workflows/269289\",\n              \"html_url\": \"https://github.com/octo-org/octo-repo/blob/master/.github/workflows/269289\",\n              \"badge_url\": \"https://github.com/octo-org/octo-repo/workflows/Linter/badge.svg\"\n            }\n          ]\n        }\n      },\n      \"workflow\": {\n        \"value\": {\n          \"id\": 161335,\n          \"node_id\": \"MDg6V29ya2Zsb3cxNjEzMzU=\",\n          \"name\": \"CI\",\n          \"path\": \".github/workflows/blank.yaml\",\n          \"state\": \"active\",\n          \"created_at\": \"2020-01-08T23:48:37.000-08:00\",\n          \"updated_at\": \"2020-01-08T23:50:21.000-08:00\",\n          \"url\": \"https://api.github.com/repos/octo-org/octo-repo/actions/workflows/161335\",\n          \"html_url\": \"https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335\",\n          \"badge_url\": \"https://github.com/octo-org/octo-repo/workflows/CI/badge.svg\"\n        }\n      },\n      \"short-branch-with-protection-items\": {\n        \"value\": [\n          {\n            \"name\": \"master\",\n            \"commit\": {\n              \"sha\": \"c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\"\n            },\n            \"protected\": true,\n            \"protection\": {\n              \"required_status_checks\": {\n                \"enforcement_level\": \"non_admins\",\n                \"contexts\": [\n                  \"ci-test\",\n                  \"linter\"\n                ]\n              }\n            },\n            \"protection_url\": \"https://api.github.com/repos/octocat/hello-world/branches/master/protection\"\n          }\n        ]\n      },\n      \"branch-protection\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection\",\n          \"required_status_checks\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks\",\n            \"contexts\": [\n              \"continuous-integration/travis-ci\"\n            ],\n            \"contexts_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts\",\n            \"enforcement_level\": \"non_admins\"\n          },\n          \"enforce_admins\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins\",\n            \"enabled\": true\n          },\n          \"required_pull_request_reviews\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_pull_request_reviews\",\n            \"dismissal_restrictions\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions\",\n              \"users_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions/users\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions/teams\",\n              \"users\": [\n                {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                }\n              ],\n              \"teams\": [\n                {\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VGVhbTE=\",\n                  \"url\": \"https://api.github.com/teams/1\",\n                  \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n                  \"name\": \"Justice League\",\n                  \"slug\": \"justice-league\",\n                  \"description\": \"A great team.\",\n                  \"privacy\": \"closed\",\n                  \"permission\": \"admin\",\n                  \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n                  \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n                  \"parent\": null\n                }\n              ]\n            },\n            \"dismiss_stale_reviews\": true,\n            \"require_code_owner_reviews\": true,\n            \"required_approving_review_count\": 2\n          },\n          \"restrictions\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions\",\n            \"users_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/users\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams\",\n            \"apps_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams\",\n            \"users\": [\n              {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              }\n            ],\n            \"teams\": [\n              {\n                \"id\": 1,\n                \"node_id\": \"MDQ6VGVhbTE=\",\n                \"url\": \"https://api.github.com/teams/1\",\n                \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n                \"name\": \"Justice League\",\n                \"slug\": \"justice-league\",\n                \"description\": \"A great team.\",\n                \"privacy\": \"closed\",\n                \"permission\": \"admin\",\n                \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n                \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n                \"parent\": null\n              }\n            ],\n            \"apps\": [\n              {\n                \"id\": 1,\n                \"slug\": \"octoapp\",\n                \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n                \"owner\": {\n                  \"login\": \"github\",\n                  \"id\": 1,\n                  \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n                  \"url\": \"https://api.github.com/orgs/github\",\n                  \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n                  \"events_url\": \"https://api.github.com/orgs/github/events\",\n                  \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n                  \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n                  \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n                  \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"description\": \"A great organization\"\n                },\n                \"name\": \"Octocat App\",\n                \"description\": \"\",\n                \"external_url\": \"https://example.com\",\n                \"html_url\": \"https://github.com/apps/octoapp\",\n                \"created_at\": \"2017-07-08T16:18:44-04:00\",\n                \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n                \"permissions\": {\n                  \"metadata\": \"read\",\n                  \"contents\": \"read\",\n                  \"issues\": \"write\",\n                  \"single_file\": \"write\"\n                },\n                \"events\": [\n                  \"push\",\n                  \"pull_request\"\n                ]\n              }\n            ]\n          },\n          \"required_linear_history\": {\n            \"enabled\": true\n          },\n          \"allow_force_pushes\": {\n            \"enabled\": true\n          },\n          \"allow_deletions\": {\n            \"enabled\": true\n          },\n          \"required_conversation_resolution\": {\n            \"enabled\": true\n          }\n        }\n      },\n      \"protected-branch-admin-enforced-2\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins\",\n          \"enabled\": true\n        }\n      },\n      \"protected-branch-pull-request-review\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_pull_request_reviews\",\n          \"dismissal_restrictions\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions\",\n            \"users_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions/users\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions/teams\",\n            \"users\": [\n              {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              }\n            ],\n            \"teams\": [\n              {\n                \"id\": 1,\n                \"node_id\": \"MDQ6VGVhbTE=\",\n                \"url\": \"https://api.github.com/teams/1\",\n                \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n                \"name\": \"Justice League\",\n                \"slug\": \"justice-league\",\n                \"description\": \"A great team.\",\n                \"privacy\": \"closed\",\n                \"permission\": \"admin\",\n                \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n                \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n                \"parent\": null\n              }\n            ]\n          },\n          \"dismiss_stale_reviews\": true,\n          \"require_code_owner_reviews\": true,\n          \"required_approving_review_count\": 2\n        }\n      },\n      \"protected-branch-admin-enforced\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures\",\n          \"enabled\": true\n        }\n      },\n      \"status-check-policy\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks\",\n          \"strict\": true,\n          \"contexts\": [\n            \"continuous-integration/travis-ci\"\n          ],\n          \"contexts_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts\"\n        }\n      },\n      \"branch-restriction-policy\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions\",\n          \"users_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/users\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams\",\n          \"apps_url\": \"https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams\",\n          \"users\": [\n            {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          ],\n          \"teams\": [\n            {\n              \"id\": 1,\n              \"node_id\": \"MDQ6VGVhbTE=\",\n              \"url\": \"https://api.github.com/teams/1\",\n              \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n              \"name\": \"Justice League\",\n              \"slug\": \"justice-league\",\n              \"description\": \"A great team.\",\n              \"privacy\": \"closed\",\n              \"permission\": \"admin\",\n              \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n              \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n              \"parent\": null\n            }\n          ],\n          \"apps\": [\n            {\n              \"id\": 1,\n              \"slug\": \"octoapp\",\n              \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n              \"owner\": {\n                \"login\": \"github\",\n                \"id\": 1,\n                \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n                \"url\": \"https://api.github.com/orgs/github\",\n                \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n                \"events_url\": \"https://api.github.com/orgs/github/events\",\n                \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n                \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n                \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n                \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"description\": \"A great organization\"\n              },\n              \"name\": \"Octocat App\",\n              \"description\": \"\",\n              \"external_url\": \"https://example.com\",\n              \"html_url\": \"https://github.com/apps/octoapp\",\n              \"created_at\": \"2017-07-08T16:18:44-04:00\",\n              \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n              \"permissions\": {\n                \"metadata\": \"read\",\n                \"contents\": \"read\",\n                \"issues\": \"write\",\n                \"single_file\": \"write\"\n              },\n              \"events\": [\n                \"push\",\n                \"pull_request\"\n              ]\n            }\n          ]\n        }\n      },\n      \"integration-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"slug\": \"octoapp\",\n            \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n            \"owner\": {\n              \"login\": \"github\",\n              \"id\": 1,\n              \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n              \"url\": \"https://api.github.com/orgs/github\",\n              \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n              \"events_url\": \"https://api.github.com/orgs/github/events\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": true\n            },\n            \"name\": \"Octocat App\",\n            \"description\": \"\",\n            \"external_url\": \"https://example.com\",\n            \"html_url\": \"https://github.com/apps/octoapp\",\n            \"created_at\": \"2017-07-08T16:18:44-04:00\",\n            \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n            \"permissions\": {\n              \"metadata\": \"read\",\n              \"contents\": \"read\",\n              \"issues\": \"write\",\n              \"single_file\": \"write\"\n            },\n            \"events\": [\n              \"push\",\n              \"pull_request\"\n            ]\n          }\n        ]\n      },\n      \"check-run-example-of-completed-conclusion\": {\n        \"summary\": \"Response for completed conclusion\",\n        \"value\": {\n          \"id\": 4,\n          \"head_sha\": \"ce587453ced02b1526dfb4cb910479d431683101\",\n          \"node_id\": \"MDg6Q2hlY2tSdW40\",\n          \"external_id\": \"\",\n          \"url\": \"https://api.github.com/repos/github/hello-world/check-runs/4\",\n          \"html_url\": \"https://github.com/github/hello-world/runs/4\",\n          \"details_url\": \"https://example.com\",\n          \"status\": \"completed\",\n          \"conclusion\": \"neutral\",\n          \"started_at\": \"2018-05-04T01:14:52Z\",\n          \"completed_at\": \"2018-05-04T01:14:52Z\",\n          \"output\": {\n            \"title\": \"Mighty Readme report\",\n            \"summary\": \"There are 0 failures, 2 warnings, and 1 notice.\",\n            \"text\": \"You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.\",\n            \"annotations_count\": 2,\n            \"annotations_url\": \"https://api.github.com/repos/github/hello-world/check-runs/4/annotations\"\n          },\n          \"name\": \"mighty_readme\",\n          \"check_suite\": {\n            \"id\": 5\n          },\n          \"app\": {\n            \"id\": 1,\n            \"slug\": \"octoapp\",\n            \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n            \"owner\": {\n              \"login\": \"github\",\n              \"id\": 1,\n              \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n              \"url\": \"https://api.github.com/orgs/github\",\n              \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n              \"events_url\": \"https://api.github.com/orgs/github/events\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": true\n            },\n            \"name\": \"Octocat App\",\n            \"description\": \"\",\n            \"external_url\": \"https://example.com\",\n            \"html_url\": \"https://github.com/apps/octoapp\",\n            \"created_at\": \"2017-07-08T16:18:44-04:00\",\n            \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n            \"permissions\": {\n              \"metadata\": \"read\",\n              \"contents\": \"read\",\n              \"issues\": \"write\",\n              \"single_file\": \"write\"\n            },\n            \"events\": [\n              \"push\",\n              \"pull_request\"\n            ]\n          },\n          \"pull_requests\": [\n            {\n              \"url\": \"https://api.github.com/repos/github/hello-world/pulls/1\",\n              \"id\": 1934,\n              \"number\": 3956,\n              \"head\": {\n                \"ref\": \"say-hello\",\n                \"sha\": \"3dca65fa3e8d4b3da3f3d056c59aee1c50f41390\",\n                \"repo\": {\n                  \"id\": 526,\n                  \"url\": \"https://api.github.com/repos/github/hello-world\",\n                  \"name\": \"hello-world\"\n                }\n              },\n              \"base\": {\n                \"ref\": \"master\",\n                \"sha\": \"e7fdf7640066d71ad16a86fbcbb9c6a10a18af4f\",\n                \"repo\": {\n                  \"id\": 526,\n                  \"url\": \"https://api.github.com/repos/github/hello-world\",\n                  \"name\": \"hello-world\"\n                }\n              }\n            }\n          ]\n        }\n      },\n      \"check-run\": {\n        \"value\": {\n          \"id\": 4,\n          \"head_sha\": \"ce587453ced02b1526dfb4cb910479d431683101\",\n          \"node_id\": \"MDg6Q2hlY2tSdW40\",\n          \"external_id\": \"\",\n          \"url\": \"https://api.github.com/repos/github/hello-world/check-runs/4\",\n          \"html_url\": \"https://github.com/github/hello-world/runs/4\",\n          \"details_url\": \"https://example.com\",\n          \"status\": \"completed\",\n          \"conclusion\": \"neutral\",\n          \"started_at\": \"2018-05-04T01:14:52Z\",\n          \"completed_at\": \"2018-05-04T01:14:52Z\",\n          \"output\": {\n            \"title\": \"Mighty Readme report\",\n            \"summary\": \"There are 0 failures, 2 warnings, and 1 notice.\",\n            \"text\": \"You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.\",\n            \"annotations_count\": 2,\n            \"annotations_url\": \"https://api.github.com/repos/github/hello-world/check-runs/4/annotations\"\n          },\n          \"name\": \"mighty_readme\",\n          \"check_suite\": {\n            \"id\": 5\n          },\n          \"app\": {\n            \"id\": 1,\n            \"slug\": \"octoapp\",\n            \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n            \"owner\": {\n              \"login\": \"github\",\n              \"id\": 1,\n              \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n              \"url\": \"https://api.github.com/orgs/github\",\n              \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n              \"events_url\": \"https://api.github.com/orgs/github/events\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": true\n            },\n            \"name\": \"Octocat App\",\n            \"description\": \"\",\n            \"external_url\": \"https://example.com\",\n            \"html_url\": \"https://github.com/apps/octoapp\",\n            \"created_at\": \"2017-07-08T16:18:44-04:00\",\n            \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n            \"permissions\": {\n              \"metadata\": \"read\",\n              \"contents\": \"read\",\n              \"issues\": \"write\",\n              \"single_file\": \"write\"\n            },\n            \"events\": [\n              \"push\",\n              \"pull_request\"\n            ]\n          },\n          \"pull_requests\": [\n            {\n              \"url\": \"https://api.github.com/repos/github/hello-world/pulls/1\",\n              \"id\": 1934,\n              \"number\": 3956,\n              \"head\": {\n                \"ref\": \"say-hello\",\n                \"sha\": \"3dca65fa3e8d4b3da3f3d056c59aee1c50f41390\",\n                \"repo\": {\n                  \"id\": 526,\n                  \"url\": \"https://api.github.com/repos/github/hello-world\",\n                  \"name\": \"hello-world\"\n                }\n              },\n              \"base\": {\n                \"ref\": \"master\",\n                \"sha\": \"e7fdf7640066d71ad16a86fbcbb9c6a10a18af4f\",\n                \"repo\": {\n                  \"id\": 526,\n                  \"url\": \"https://api.github.com/repos/github/hello-world\",\n                  \"name\": \"hello-world\"\n                }\n              }\n            }\n          ]\n        }\n      },\n      \"check-annotation-items\": {\n        \"value\": [\n          {\n            \"path\": \"README.md\",\n            \"start_line\": 2,\n            \"end_line\": 2,\n            \"start_column\": 5,\n            \"end_column\": 10,\n            \"annotation_level\": \"warning\",\n            \"title\": \"Spell Checker\",\n            \"message\": \"Check your spelling for 'banaas'.\",\n            \"raw_details\": \"Do you mean 'bananas' or 'banana'?\",\n            \"blob_href\": \"https://api.github.com/repos/github/rest-api-description/git/blobs/abc\"\n          }\n        ]\n      },\n      \"check-suite\": {\n        \"value\": {\n          \"id\": 5,\n          \"node_id\": \"MDEwOkNoZWNrU3VpdGU1\",\n          \"head_branch\": \"master\",\n          \"head_sha\": \"d6fde92930d4715a2b49857d24b940956b26d2d3\",\n          \"status\": \"completed\",\n          \"conclusion\": \"neutral\",\n          \"url\": \"https://api.github.com/repos/github/hello-world/check-suites/5\",\n          \"before\": \"146e867f55c26428e5f9fade55a9bbf5e95a7912\",\n          \"after\": \"d6fde92930d4715a2b49857d24b940956b26d2d3\",\n          \"pull_requests\": [\n\n          ],\n          \"created_at\": \"2017-07-08T16:18:44-04:00\",\n          \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n          \"app\": {\n            \"id\": 1,\n            \"slug\": \"octoapp\",\n            \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n            \"owner\": {\n              \"login\": \"github\",\n              \"id\": 1,\n              \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n              \"url\": \"https://api.github.com/orgs/github\",\n              \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n              \"events_url\": \"https://api.github.com/orgs/github/events\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": true\n            },\n            \"name\": \"Octocat App\",\n            \"description\": \"\",\n            \"external_url\": \"https://example.com\",\n            \"html_url\": \"https://github.com/apps/octoapp\",\n            \"created_at\": \"2017-07-08T16:18:44-04:00\",\n            \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n            \"permissions\": {\n              \"metadata\": \"read\",\n              \"contents\": \"read\",\n              \"issues\": \"write\",\n              \"single_file\": \"write\"\n            },\n            \"events\": [\n              \"push\",\n              \"pull_request\"\n            ]\n          },\n          \"repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"template_repository\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World-Template\",\n              \"full_name\": \"octocat/Hello-World-Template\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World-Template\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World-Template\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World-Template.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World-Template.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World-Template.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World-Template\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World-Template\",\n              \"homepage\": \"https://github.com\",\n              \"forks\": 9,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"watchers\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues\": 0,\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://api.github.com/licenses/mit\"\n              },\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0\n            },\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": false,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"delete_branch_on_merge\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0\n          },\n          \"head_commit\": {\n            \"id\": \"7fd1a60b01f91b314f59955a4e4d4e80d8edf11d\",\n            \"tree_id\": \"7fd1a60b01f91b314f59955a4e4d4e80d8edf11d\",\n            \"message\": \"Merge pull request #6 from Spaceghost/patch-1\\n\\nNew line at end of file.\",\n            \"timestamp\": \"2016-10-10T00:00:00Z\",\n            \"author\": {\n              \"name\": \"The Octocat\",\n              \"email\": \"octocat@nowhere.com\"\n            },\n            \"committer\": {\n              \"name\": \"The Octocat\",\n              \"email\": \"octocat@nowhere.com\"\n            }\n          },\n          \"latest_check_runs_count\": 1,\n          \"check_runs_url\": \"https://api.github.com/repos/octocat/Hello-World/check-suites/5/check-runs\"\n        }\n      },\n      \"check-suite-preference\": {\n        \"value\": {\n          \"preferences\": {\n            \"auto_trigger_checks\": [\n              {\n                \"app_id\": 2,\n                \"setting\": true\n              },\n              {\n                \"app_id\": 4,\n                \"setting\": false\n              }\n            ]\n          },\n          \"repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": false,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"template_repository\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World-Template\",\n              \"full_name\": \"octocat/Hello-World-Template\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World-Template\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World-Template\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World-Template.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World-Template.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World-Template.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World-Template\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World-Template\",\n              \"homepage\": \"https://github.com\",\n              \"forks\": 9,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"watchers\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues\": 0,\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://api.github.com/licenses/mit\"\n              },\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0\n            }\n          }\n        }\n      },\n      \"check-run-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"check_runs\": [\n            {\n              \"id\": 4,\n              \"head_sha\": \"ce587453ced02b1526dfb4cb910479d431683101\",\n              \"node_id\": \"MDg6Q2hlY2tSdW40\",\n              \"external_id\": \"\",\n              \"url\": \"https://api.github.com/repos/github/hello-world/check-runs/4\",\n              \"html_url\": \"https://github.com/github/hello-world/runs/4\",\n              \"details_url\": \"https://example.com\",\n              \"status\": \"completed\",\n              \"conclusion\": \"neutral\",\n              \"started_at\": \"2018-05-04T01:14:52Z\",\n              \"completed_at\": \"2018-05-04T01:14:52Z\",\n              \"output\": {\n                \"title\": \"Mighty Readme report\",\n                \"summary\": \"There are 0 failures, 2 warnings, and 1 notice.\",\n                \"text\": \"You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.\",\n                \"annotations_count\": 2,\n                \"annotations_url\": \"https://api.github.com/repos/github/hello-world/check-runs/4/annotations\"\n              },\n              \"name\": \"mighty_readme\",\n              \"check_suite\": {\n                \"id\": 5\n              },\n              \"app\": {\n                \"id\": 1,\n                \"slug\": \"octoapp\",\n                \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n                \"owner\": {\n                  \"login\": \"github\",\n                  \"id\": 1,\n                  \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n                  \"url\": \"https://api.github.com/orgs/github\",\n                  \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n                  \"events_url\": \"https://api.github.com/orgs/github/events\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": true\n                },\n                \"name\": \"Octocat App\",\n                \"description\": \"\",\n                \"external_url\": \"https://example.com\",\n                \"html_url\": \"https://github.com/apps/octoapp\",\n                \"created_at\": \"2017-07-08T16:18:44-04:00\",\n                \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n                \"permissions\": {\n                  \"metadata\": \"read\",\n                  \"contents\": \"read\",\n                  \"issues\": \"write\",\n                  \"single_file\": \"write\"\n                },\n                \"events\": [\n                  \"push\",\n                  \"pull_request\"\n                ]\n              },\n              \"pull_requests\": [\n                {\n                  \"url\": \"https://api.github.com/repos/github/hello-world/pulls/1\",\n                  \"id\": 1934,\n                  \"number\": 3956,\n                  \"head\": {\n                    \"ref\": \"say-hello\",\n                    \"sha\": \"3dca65fa3e8d4b3da3f3d056c59aee1c50f41390\",\n                    \"repo\": {\n                      \"id\": 526,\n                      \"url\": \"https://api.github.com/repos/github/hello-world\",\n                      \"name\": \"hello-world\"\n                    }\n                  },\n                  \"base\": {\n                    \"ref\": \"master\",\n                    \"sha\": \"e7fdf7640066d71ad16a86fbcbb9c6a10a18af4f\",\n                    \"repo\": {\n                      \"id\": 526,\n                      \"url\": \"https://api.github.com/repos/github/hello-world\",\n                      \"name\": \"hello-world\"\n                    }\n                  }\n                }\n              ]\n            }\n          ]\n        }\n      },\n      \"code-scanning-alert-items\": {\n        \"value\": [\n          {\n            \"number\": 4,\n            \"created_at\": \"2020-02-13T12:29:18Z\",\n            \"url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/4\",\n            \"html_url\": \"https://github.com/octocat/hello-world/code-scanning/4\",\n            \"state\": \"open\",\n            \"dismissed_by\": null,\n            \"dismissed_at\": null,\n            \"dismissed_reason\": null,\n            \"rule\": {\n              \"id\": \"js/zipslip\",\n              \"severity\": \"error\",\n              \"description\": \"Arbitrary file write during zip extraction\",\n              \"name\": \"js/zipslip\"\n            },\n            \"tool\": {\n              \"name\": \"CodeQL\",\n              \"guid\": null,\n              \"version\": \"2.4.0\"\n            },\n            \"most_recent_instance\": {\n              \"ref\": \"refs/heads/main\",\n              \"analysis_key\": \".github/workflows/codeql-analysis.yml:CodeQL-Build\",\n              \"environment\": \"{}\",\n              \"state\": \"open\",\n              \"commit_sha\": \"39406e42cb832f683daa691dd652a8dc36ee8930\",\n              \"message\": {\n                \"text\": \"This path depends on a user-provided value.\"\n              },\n              \"location\": {\n                \"path\": \"spec-main/api-session-spec.ts\",\n                \"start_line\": 917,\n                \"end_line\": 917,\n                \"start_column\": 7,\n                \"end_column\": 18\n              },\n              \"classifications\": [\n                \"test\"\n              ]\n            },\n            \"instances_url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/4/instances\"\n          },\n          {\n            \"number\": 3,\n            \"created_at\": \"2020-02-13T12:29:18Z\",\n            \"url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/3\",\n            \"html_url\": \"https://github.com/octocat/hello-world/code-scanning/3\",\n            \"state\": \"dismissed\",\n            \"dismissed_by\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"dismissed_at\": \"2020-02-14T12:29:18Z\",\n            \"dismissed_reason\": \"false positive\",\n            \"rule\": {\n              \"id\": \"js/zipslip\",\n              \"severity\": \"error\",\n              \"description\": \"Arbitrary file write during zip extraction\",\n              \"name\": \"js/zipslip\"\n            },\n            \"tool\": {\n              \"name\": \"CodeQL\",\n              \"guid\": null,\n              \"version\": \"2.4.0\"\n            },\n            \"most_recent_instance\": {\n              \"ref\": \"refs/heads/main\",\n              \"analysis_key\": \".github/workflows/codeql-analysis.yml:CodeQL-Build\",\n              \"environment\": \"{}\",\n              \"state\": \"open\",\n              \"commit_sha\": \"39406e42cb832f683daa691dd652a8dc36ee8930\",\n              \"message\": {\n                \"text\": \"This path depends on a user-provided value.\"\n              },\n              \"location\": {\n                \"path\": \"lib/ab12-gen.js\",\n                \"start_line\": 917,\n                \"end_line\": 917,\n                \"start_column\": 7,\n                \"end_column\": 18\n              },\n              \"classifications\": [\n\n              ]\n            },\n            \"instances_url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/3/instances\"\n          }\n        ]\n      },\n      \"code-scanning-alert\": {\n        \"value\": {\n          \"number\": 42,\n          \"created_at\": \"2020-06-19T11:21:34Z\",\n          \"url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42\",\n          \"html_url\": \"https://github.com/octocat/hello-world/code-scanning/42\",\n          \"state\": \"dismissed\",\n          \"dismissed_by\": {\n            \"login\": \"octocat\",\n            \"id\": 54933897,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"dismissed_at\": \"2020-02-14T12:29:18Z\",\n          \"dismissed_reason\": \"false positive\",\n          \"rule\": {\n            \"id\": \"js/zipslip\",\n            \"severity\": \"error\",\n            \"description\": \"Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\",\n            \"name\": \"js/zipslip\",\n            \"full_description\": \"Extracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten.\",\n            \"tags\": [\n              \"security\",\n              \"external/cwe/cwe-022\"\n            ],\n            \"help\": \"# Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\\\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...\"\n          },\n          \"tool\": {\n            \"name\": \"CodeQL\",\n            \"guid\": null,\n            \"version\": \"2.4.0\"\n          },\n          \"most_recent_instance\": {\n            \"ref\": \"refs/heads/main\",\n            \"analysis_key\": \".github/workflows/codeql-analysis.yml:CodeQL-Build\",\n            \"environment\": \"{}\",\n            \"state\": \"dismissed\",\n            \"commit_sha\": \"39406e42cb832f683daa691dd652a8dc36ee8930\",\n            \"message\": {\n              \"text\": \"This path depends on a user-provided value.\"\n            },\n            \"location\": {\n              \"path\": \"spec-main/api-session-spec.ts\",\n              \"start_line\": 917,\n              \"end_line\": 917,\n              \"start_column\": 7,\n              \"end_column\": 18\n            },\n            \"classifications\": [\n              \"test\"\n            ]\n          },\n          \"instances_url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances\"\n        }\n      },\n      \"code-scanning-alert-dismissed\": {\n        \"value\": {\n          \"number\": 42,\n          \"created_at\": \"2020-08-25T21:28:36Z\",\n          \"url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42\",\n          \"html_url\": \"https://github.com/octocat/hello-world/code-scanning/42\",\n          \"state\": \"dismissed\",\n          \"dismissed_by\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"dismissed_at\": \"2020-09-02T22:34:56Z\",\n          \"dismissed_reason\": \"false positive\",\n          \"rule\": {\n            \"id\": \"js/zipslip\",\n            \"severity\": \"error\",\n            \"description\": \"Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\",\n            \"name\": \"js/zipslip\",\n            \"full_description\": \"Extracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten.\",\n            \"tags\": [\n              \"security\",\n              \"external/cwe/cwe-022\"\n            ],\n            \"help\": \"# Arbitrary file write during zip extraction (\\\"Zip Slip\\\")\\\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...\"\n          },\n          \"tool\": {\n            \"name\": \"CodeQL\",\n            \"guid\": null,\n            \"version\": \"2.4.0\"\n          },\n          \"most_recent_instance\": {\n            \"ref\": \"refs/heads/main\",\n            \"analysis_key\": \".github/workflows/codeql-analysis.yml:CodeQL-Build\",\n            \"environment\": \"{}\",\n            \"state\": \"dismissed\",\n            \"commit_sha\": \"39406e42cb832f683daa691dd652a8dc36ee8930\",\n            \"message\": {\n              \"text\": \"This path depends on a user-provided value.\"\n            },\n            \"location\": {\n              \"path\": \"spec-main/api-session-spec.ts\",\n              \"start_line\": 917,\n              \"end_line\": 917,\n              \"start_column\": 7,\n              \"end_column\": 18\n            },\n            \"classifications\": [\n              \"test\"\n            ]\n          },\n          \"instances_url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances\"\n        }\n      },\n      \"code-scanning-analysis-items\": {\n        \"value\": [\n          {\n            \"ref\": \"refs/heads/main\",\n            \"commit_sha\": \"d99612c3e1f2970085cfbaeadf8f010ef69bad83\",\n            \"analysis_key\": \".github/workflows/codeql-analysis.yml:analyze\",\n            \"environment\": \"{\\\"language\\\":\\\"python\\\"}\",\n            \"error\": \"\",\n            \"category\": \".github/workflows/codeql-analysis.yml:analyze/language:python\",\n            \"created_at\": \"2020-08-27T15:05:21Z\",\n            \"results_count\": 17,\n            \"rules_count\": 49,\n            \"id\": 201,\n            \"url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\",\n            \"sarif_id\": \"6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53\",\n            \"tool\": {\n              \"name\": \"CodeQL\",\n              \"guid\": null,\n              \"version\": \"2.4.0\"\n            },\n            \"deletable\": true,\n            \"warning\": \"\"\n          },\n          {\n            \"ref\": \"refs/heads/my-branch\",\n            \"commit_sha\": \"c8cff6510d4d084fb1b4aa13b64b97ca12b07321\",\n            \"analysis_key\": \".github/workflows/shiftleft.yml:build\",\n            \"environment\": \"{}\",\n            \"error\": \"\",\n            \"category\": \".github/workflows/shiftleft.yml:build/\",\n            \"created_at\": \"2020-08-31T22:46:44Z\",\n            \"results_count\": 17,\n            \"rules_count\": 32,\n            \"id\": 200,\n            \"url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/200\",\n            \"sarif_id\": \"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\",\n            \"tool\": {\n              \"name\": \"Python Security Analysis\",\n              \"guid\": null,\n              \"version\": \"1.2.0\"\n            },\n            \"deletable\": true,\n            \"warning\": \"\"\n          }\n        ]\n      },\n      \"code-scanning-sarif-upload\": {\n        \"summary\": \"Default response\",\n        \"value\": {\n          \"id\": \"47177e22-5596-11eb-80a1-c1e54ef945c6\",\n          \"url\": \"https://api.github.com/repos/octocat/hello-world/code-scanning/sarifs/47177e22-5596-11eb-80a1-c1e54ef945c6\"\n        }\n      },\n      \"collaborator-items\": {\n        \"value\": [\n          {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false,\n            \"permissions\": {\n              \"pull\": true,\n              \"push\": true,\n              \"admin\": false\n            }\n          }\n        ]\n      },\n      \"repository-invitation-response-when-a-new-invitation-is-created\": {\n        \"value\": {\n          \"id\": 1,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n          },\n          \"invitee\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"inviter\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"permissions\": \"write\",\n          \"created_at\": \"2016-06-13T14:52:50-05:00\",\n          \"url\": \"https://api.github.com/user/repository_invitations/1296269\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/invitations\"\n        }\n      },\n      \"repository-collaborator-permission-response-if-user-has-admin-permissions\": {\n        \"value\": {\n          \"permission\": \"admin\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"commit-comment-items\": {\n        \"value\": [\n          {\n            \"html_url\": \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e#commitcomment-1\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/comments/1\",\n            \"id\": 1,\n            \"node_id\": \"MDEzOkNvbW1pdENvbW1lbnQx\",\n            \"body\": \"Great stuff\",\n            \"path\": \"file1.txt\",\n            \"position\": 4,\n            \"line\": 14,\n            \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2011-04-14T16:00:49Z\",\n            \"updated_at\": \"2011-04-14T16:00:49Z\",\n            \"author_association\": \"COLLABORATOR\"\n          }\n        ]\n      },\n      \"commit-comment\": {\n        \"value\": {\n          \"html_url\": \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e#commitcomment-1\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/comments/1\",\n          \"id\": 1,\n          \"node_id\": \"MDEzOkNvbW1pdENvbW1lbnQx\",\n          \"body\": \"Great stuff\",\n          \"path\": \"file1.txt\",\n          \"position\": 4,\n          \"line\": 14,\n          \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"author_association\": \"COLLABORATOR\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2011-04-14T16:00:49Z\",\n          \"updated_at\": \"2011-04-14T16:00:49Z\"\n        }\n      },\n      \"commit-comment-2\": {\n        \"value\": {\n          \"html_url\": \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e#commitcomment-1\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/comments/1\",\n          \"id\": 1,\n          \"node_id\": \"MDEzOkNvbW1pdENvbW1lbnQx\",\n          \"body\": \"Nice change\",\n          \"path\": \"file1.txt\",\n          \"position\": 4,\n          \"line\": 14,\n          \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"author_association\": \"COLLABORATOR\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2011-04-14T16:00:49Z\",\n          \"updated_at\": \"2011-04-14T16:00:49Z\"\n        }\n      },\n      \"commit-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"node_id\": \"MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\",\n            \"commit\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"author\": {\n                \"name\": \"Monalisa Octocat\",\n                \"email\": \"support@github.com\",\n                \"date\": \"2011-04-14T16:00:49Z\"\n              },\n              \"committer\": {\n                \"name\": \"Monalisa Octocat\",\n                \"email\": \"support@github.com\",\n                \"date\": \"2011-04-14T16:00:49Z\"\n              },\n              \"message\": \"Fix all the bugs\",\n              \"tree\": {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n              },\n              \"comment_count\": 0,\n              \"verification\": {\n                \"verified\": false,\n                \"reason\": \"unsigned\",\n                \"signature\": null,\n                \"payload\": null\n              }\n            },\n            \"author\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"committer\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"parents\": [\n              {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n              }\n            ]\n          }\n        ]\n      },\n      \"branch-short-items\": {\n        \"value\": [\n          {\n            \"name\": \"branch_5\",\n            \"commit\": {\n              \"sha\": \"c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\"\n            },\n            \"protected\": false\n          }\n        ]\n      },\n      \"pull-request-simple-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n            \"id\": 1,\n            \"node_id\": \"MDExOlB1bGxSZXF1ZXN0MQ==\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n            \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n            \"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\",\n            \"issue_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\",\n            \"review_comments_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\",\n            \"review_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"number\": 1347,\n            \"state\": \"open\",\n            \"locked\": true,\n            \"title\": \"Amazing new feature\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"body\": \"Please pull these awesome changes in!\",\n            \"labels\": [\n              {\n                \"id\": 208045946,\n                \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n                \"name\": \"bug\",\n                \"description\": \"Something isn't working\",\n                \"color\": \"f29513\",\n                \"default\": true\n              }\n            ],\n            \"milestone\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n              \"id\": 1002604,\n              \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n              \"number\": 1,\n              \"state\": \"open\",\n              \"title\": \"v1.0\",\n              \"description\": \"Tracking milestone for version 1.0\",\n              \"creator\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"open_issues\": 4,\n              \"closed_issues\": 8,\n              \"created_at\": \"2011-04-10T20:09:31Z\",\n              \"updated_at\": \"2014-03-03T18:58:10Z\",\n              \"closed_at\": \"2013-02-12T13:22:01Z\",\n              \"due_on\": \"2012-10-09T23:39:01Z\"\n            },\n            \"active_lock_reason\": \"too heated\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:01:12Z\",\n            \"closed_at\": \"2011-01-26T19:01:12Z\",\n            \"merged_at\": \"2011-01-26T19:01:12Z\",\n            \"merge_commit_sha\": \"e5bd3914e2e596debea16f433f57875b5b90bcd6\",\n            \"assignee\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"assignees\": [\n              {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              {\n                \"login\": \"hubot\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/hubot_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/hubot\",\n                \"html_url\": \"https://github.com/hubot\",\n                \"followers_url\": \"https://api.github.com/users/hubot/followers\",\n                \"following_url\": \"https://api.github.com/users/hubot/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/hubot/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/hubot/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/hubot/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/hubot/orgs\",\n                \"repos_url\": \"https://api.github.com/users/hubot/repos\",\n                \"events_url\": \"https://api.github.com/users/hubot/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/hubot/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": true\n              }\n            ],\n            \"requested_reviewers\": [\n              {\n                \"login\": \"other_user\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/other_user_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/other_user\",\n                \"html_url\": \"https://github.com/other_user\",\n                \"followers_url\": \"https://api.github.com/users/other_user/followers\",\n                \"following_url\": \"https://api.github.com/users/other_user/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/other_user/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/other_user/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/other_user/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/other_user/orgs\",\n                \"repos_url\": \"https://api.github.com/users/other_user/repos\",\n                \"events_url\": \"https://api.github.com/users/other_user/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/other_user/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              }\n            ],\n            \"requested_teams\": [\n              {\n                \"id\": 1,\n                \"node_id\": \"MDQ6VGVhbTE=\",\n                \"url\": \"https://api.github.com/teams/1\",\n                \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n                \"name\": \"Justice League\",\n                \"slug\": \"justice-league\",\n                \"description\": \"A great team.\",\n                \"privacy\": \"closed\",\n                \"permission\": \"admin\",\n                \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n                \"repositories_url\": \"https://api.github.com/teams/1/repos\"\n              }\n            ],\n            \"head\": {\n              \"label\": \"octocat:new-topic\",\n              \"ref\": \"new-topic\",\n              \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"user\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"repo\": {\n                \"id\": 1296269,\n                \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n                \"name\": \"Hello-World\",\n                \"full_name\": \"octocat/Hello-World\",\n                \"owner\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"private\": false,\n                \"html_url\": \"https://github.com/octocat/Hello-World\",\n                \"description\": \"This your first repo!\",\n                \"fork\": false,\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n                \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n                \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n                \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n                \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n                \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n                \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n                \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n                \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n                \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n                \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n                \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n                \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n                \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n                \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n                \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n                \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n                \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n                \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n                \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n                \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n                \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n                \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n                \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n                \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n                \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n                \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n                \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n                \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n                \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n                \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n                \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n                \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n                \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n                \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n                \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n                \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n                \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n                \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n                \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n                \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n                \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n                \"homepage\": \"https://github.com\",\n                \"language\": null,\n                \"forks_count\": 9,\n                \"stargazers_count\": 80,\n                \"watchers_count\": 80,\n                \"size\": 108,\n                \"default_branch\": \"master\",\n                \"open_issues_count\": 0,\n                \"is_template\": true,\n                \"topics\": [\n                  \"octocat\",\n                  \"atom\",\n                  \"electron\",\n                  \"api\"\n                ],\n                \"has_issues\": true,\n                \"has_projects\": true,\n                \"has_wiki\": true,\n                \"has_pages\": false,\n                \"has_downloads\": true,\n                \"archived\": false,\n                \"disabled\": false,\n                \"visibility\": \"public\",\n                \"pushed_at\": \"2011-01-26T19:06:43Z\",\n                \"created_at\": \"2011-01-26T19:01:12Z\",\n                \"updated_at\": \"2011-01-26T19:14:43Z\",\n                \"permissions\": {\n                  \"admin\": false,\n                  \"push\": false,\n                  \"pull\": true\n                },\n                \"allow_rebase_merge\": true,\n                \"template_repository\": null,\n                \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n                \"allow_squash_merge\": true,\n                \"delete_branch_on_merge\": true,\n                \"allow_merge_commit\": true,\n                \"subscribers_count\": 42,\n                \"network_count\": 0,\n                \"license\": {\n                  \"key\": \"mit\",\n                  \"name\": \"MIT License\",\n                  \"url\": \"https://api.github.com/licenses/mit\",\n                  \"spdx_id\": \"MIT\",\n                  \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                  \"html_url\": \"https://github.com/licenses/mit\"\n                },\n                \"forks\": 1,\n                \"open_issues\": 1,\n                \"watchers\": 1\n              }\n            },\n            \"base\": {\n              \"label\": \"octocat:master\",\n              \"ref\": \"master\",\n              \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"user\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"repo\": {\n                \"id\": 1296269,\n                \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n                \"name\": \"Hello-World\",\n                \"full_name\": \"octocat/Hello-World\",\n                \"owner\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"private\": false,\n                \"html_url\": \"https://github.com/octocat/Hello-World\",\n                \"description\": \"This your first repo!\",\n                \"fork\": false,\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n                \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n                \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n                \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n                \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n                \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n                \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n                \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n                \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n                \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n                \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n                \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n                \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n                \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n                \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n                \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n                \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n                \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n                \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n                \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n                \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n                \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n                \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n                \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n                \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n                \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n                \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n                \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n                \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n                \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n                \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n                \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n                \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n                \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n                \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n                \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n                \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n                \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n                \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n                \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n                \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n                \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n                \"homepage\": \"https://github.com\",\n                \"language\": null,\n                \"forks_count\": 9,\n                \"stargazers_count\": 80,\n                \"watchers_count\": 80,\n                \"size\": 108,\n                \"default_branch\": \"master\",\n                \"open_issues_count\": 0,\n                \"is_template\": true,\n                \"topics\": [\n                  \"octocat\",\n                  \"atom\",\n                  \"electron\",\n                  \"api\"\n                ],\n                \"has_issues\": true,\n                \"has_projects\": true,\n                \"has_wiki\": true,\n                \"has_pages\": false,\n                \"has_downloads\": true,\n                \"archived\": false,\n                \"disabled\": false,\n                \"visibility\": \"public\",\n                \"pushed_at\": \"2011-01-26T19:06:43Z\",\n                \"created_at\": \"2011-01-26T19:01:12Z\",\n                \"updated_at\": \"2011-01-26T19:14:43Z\",\n                \"permissions\": {\n                  \"admin\": false,\n                  \"push\": false,\n                  \"pull\": true\n                },\n                \"allow_rebase_merge\": true,\n                \"template_repository\": null,\n                \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n                \"allow_squash_merge\": true,\n                \"delete_branch_on_merge\": true,\n                \"allow_merge_commit\": true,\n                \"subscribers_count\": 42,\n                \"network_count\": 0,\n                \"license\": {\n                  \"key\": \"mit\",\n                  \"name\": \"MIT License\",\n                  \"url\": \"https://api.github.com/licenses/mit\",\n                  \"spdx_id\": \"MIT\",\n                  \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                  \"html_url\": \"https://github.com/licenses/mit\"\n                },\n                \"forks\": 1,\n                \"open_issues\": 1,\n                \"watchers\": 1\n              }\n            },\n            \"_links\": {\n              \"self\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"\n              },\n              \"html\": {\n                \"href\": \"https://github.com/octocat/Hello-World/pull/1347\"\n              },\n              \"issue\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\"\n              },\n              \"comments\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\"\n              },\n              \"review_comments\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\"\n              },\n              \"review_comment\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"\n              },\n              \"commits\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\"\n              },\n              \"statuses\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n              }\n            },\n            \"author_association\": \"OWNER\",\n            \"draft\": false\n          }\n        ]\n      },\n      \"commit\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"node_id\": \"MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\",\n          \"commit\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"author\": {\n              \"name\": \"Monalisa Octocat\",\n              \"email\": \"mona@github.com\",\n              \"date\": \"2011-04-14T16:00:49Z\"\n            },\n            \"committer\": {\n              \"name\": \"Monalisa Octocat\",\n              \"email\": \"mona@github.com\",\n              \"date\": \"2011-04-14T16:00:49Z\"\n            },\n            \"message\": \"Fix all the bugs\",\n            \"tree\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            },\n            \"comment_count\": 0,\n            \"verification\": {\n              \"verified\": false,\n              \"reason\": \"unsigned\",\n              \"signature\": null,\n              \"payload\": null\n            }\n          },\n          \"author\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"committer\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"parents\": [\n            {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            }\n          ],\n          \"stats\": {\n            \"additions\": 104,\n            \"deletions\": 4,\n            \"total\": 108\n          },\n          \"files\": [\n            {\n              \"filename\": \"file1.txt\",\n              \"additions\": 10,\n              \"deletions\": 2,\n              \"changes\": 12,\n              \"status\": \"modified\",\n              \"raw_url\": \"https://github.com/octocat/Hello-World/raw/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt\",\n              \"blob_url\": \"https://github.com/octocat/Hello-World/blob/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt\",\n              \"patch\": \"@@ -29,7 +29,7 @@\\n.....\"\n            }\n          ]\n        }\n      },\n      \"check-suite-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"check_suites\": [\n            {\n              \"id\": 5,\n              \"node_id\": \"MDEwOkNoZWNrU3VpdGU1\",\n              \"head_branch\": \"master\",\n              \"head_sha\": \"d6fde92930d4715a2b49857d24b940956b26d2d3\",\n              \"status\": \"completed\",\n              \"conclusion\": \"neutral\",\n              \"url\": \"https://api.github.com/repos/github/hello-world/check-suites/5\",\n              \"before\": \"146e867f55c26428e5f9fade55a9bbf5e95a7912\",\n              \"after\": \"d6fde92930d4715a2b49857d24b940956b26d2d3\",\n              \"pull_requests\": [\n\n              ],\n              \"app\": {\n                \"id\": 1,\n                \"slug\": \"octoapp\",\n                \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n                \"owner\": {\n                  \"login\": \"github\",\n                  \"id\": 1,\n                  \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n                  \"url\": \"https://api.github.com/orgs/github\",\n                  \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n                  \"events_url\": \"https://api.github.com/orgs/github/events\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": true\n                },\n                \"name\": \"Octocat App\",\n                \"description\": \"\",\n                \"external_url\": \"https://example.com\",\n                \"html_url\": \"https://github.com/apps/octoapp\",\n                \"created_at\": \"2017-07-08T16:18:44-04:00\",\n                \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n                \"permissions\": {\n                  \"metadata\": \"read\",\n                  \"contents\": \"read\",\n                  \"issues\": \"write\",\n                  \"single_file\": \"write\"\n                },\n                \"events\": [\n                  \"push\",\n                  \"pull_request\"\n                ]\n              },\n              \"repository\": {\n                \"id\": 1296269,\n                \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n                \"name\": \"Hello-World\",\n                \"full_name\": \"octocat/Hello-World\",\n                \"owner\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"private\": false,\n                \"html_url\": \"https://github.com/octocat/Hello-World\",\n                \"description\": \"This your first repo!\",\n                \"fork\": false,\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n                \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n                \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n                \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n                \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n                \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n                \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n                \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n                \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n                \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n                \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n                \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n                \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n                \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n                \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n                \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n                \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n                \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n                \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n                \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n                \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n                \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n                \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n                \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n                \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n                \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n                \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n                \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n                \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n                \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n                \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n                \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n                \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n                \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n                \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n                \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n                \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n                \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n                \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n                \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n                \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n                \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n                \"homepage\": \"https://github.com\",\n                \"language\": null,\n                \"forks_count\": 9,\n                \"stargazers_count\": 80,\n                \"watchers_count\": 80,\n                \"size\": 108,\n                \"default_branch\": \"master\",\n                \"open_issues_count\": 0,\n                \"is_template\": true,\n                \"topics\": [\n                  \"octocat\",\n                  \"atom\",\n                  \"electron\",\n                  \"api\"\n                ],\n                \"has_issues\": true,\n                \"has_projects\": true,\n                \"has_wiki\": true,\n                \"has_pages\": false,\n                \"has_downloads\": true,\n                \"archived\": false,\n                \"disabled\": false,\n                \"visibility\": \"public\",\n                \"pushed_at\": \"2011-01-26T19:06:43Z\",\n                \"created_at\": \"2011-01-26T19:01:12Z\",\n                \"updated_at\": \"2011-01-26T19:14:43Z\",\n                \"permissions\": {\n                  \"admin\": false,\n                  \"push\": false,\n                  \"pull\": true\n                },\n                \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n                \"delete_branch_on_merge\": true,\n                \"subscribers_count\": 42,\n                \"network_count\": 0\n              },\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"head_commit\": {\n                \"id\": \"7fd1a60b01f91b314f59955a4e4d4e80d8edf11d\",\n                \"tree_id\": \"7fd1a60b01f91b314f59955a4e4d4e80d8edf11d\",\n                \"message\": \"Merge pull request #6 from Spaceghost/patch-1\\n\\nNew line at end of file.\",\n                \"timestamp\": \"2016-10-10T00:00:00Z\",\n                \"author\": {\n                  \"name\": \"The Octocat\",\n                  \"email\": \"octocat@nowhere.com\"\n                },\n                \"committer\": {\n                  \"name\": \"The Octocat\",\n                  \"email\": \"octocat@nowhere.com\"\n                }\n              },\n              \"latest_check_runs_count\": 1,\n              \"check_runs_url\": \"https://api.github.com/repos/octocat/Hello-World/check-suites/5/check-runs\"\n            }\n          ]\n        }\n      },\n      \"combined-commit-status\": {\n        \"value\": {\n          \"state\": \"success\",\n          \"statuses\": [\n            {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"avatar_url\": \"https://github.com/images/error/hubot_happy.gif\",\n              \"id\": 1,\n              \"node_id\": \"MDY6U3RhdHVzMQ==\",\n              \"state\": \"success\",\n              \"description\": \"Build has completed successfully\",\n              \"target_url\": \"https://ci.example.com/1000/output\",\n              \"context\": \"continuous-integration/jenkins\",\n              \"created_at\": \"2012-07-20T01:19:13Z\",\n              \"updated_at\": \"2012-07-20T01:19:13Z\"\n            },\n            {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"avatar_url\": \"https://github.com/images/error/other_user_happy.gif\",\n              \"id\": 2,\n              \"node_id\": \"MDY6U3RhdHVzMg==\",\n              \"state\": \"success\",\n              \"description\": \"Testing has completed successfully\",\n              \"target_url\": \"https://ci.example.com/2000/output\",\n              \"context\": \"security/brakeman\",\n              \"created_at\": \"2012-08-20T01:19:13Z\",\n              \"updated_at\": \"2012-08-20T01:19:13Z\"\n            }\n          ],\n          \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"total_count\": 2,\n          \"repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n          },\n          \"commit_url\": \"https://api.github.com/repos/octocat/Hello-World/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/6dcb09b5b57875f334f61aebed695e2e4193db5e/status\"\n        }\n      },\n      \"status-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"avatar_url\": \"https://github.com/images/error/hubot_happy.gif\",\n            \"id\": 1,\n            \"node_id\": \"MDY6U3RhdHVzMQ==\",\n            \"state\": \"success\",\n            \"description\": \"Build has completed successfully\",\n            \"target_url\": \"https://ci.example.com/1000/output\",\n            \"context\": \"continuous-integration/jenkins\",\n            \"created_at\": \"2012-07-20T01:19:13Z\",\n            \"updated_at\": \"2012-07-20T01:19:13Z\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          }\n        ]\n      },\n      \"commit-comparison\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/compare/master...topic\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/compare/master...topic\",\n          \"permalink_url\": \"https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17\",\n          \"diff_url\": \"https://github.com/octocat/Hello-World/compare/master...topic.diff\",\n          \"patch_url\": \"https://github.com/octocat/Hello-World/compare/master...topic.patch\",\n          \"base_commit\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"node_id\": \"MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\",\n            \"commit\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"author\": {\n                \"name\": \"Monalisa Octocat\",\n                \"email\": \"mona@github.com\",\n                \"date\": \"2011-04-14T16:00:49Z\"\n              },\n              \"committer\": {\n                \"name\": \"Monalisa Octocat\",\n                \"email\": \"mona@github.com\",\n                \"date\": \"2011-04-14T16:00:49Z\"\n              },\n              \"message\": \"Fix all the bugs\",\n              \"tree\": {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n              },\n              \"comment_count\": 0,\n              \"verification\": {\n                \"verified\": false,\n                \"reason\": \"unsigned\",\n                \"signature\": null,\n                \"payload\": null\n              }\n            },\n            \"author\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"committer\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"parents\": [\n              {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n              }\n            ]\n          },\n          \"merge_base_commit\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"node_id\": \"MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\",\n            \"commit\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"author\": {\n                \"name\": \"Monalisa Octocat\",\n                \"email\": \"mona@github.com\",\n                \"date\": \"2011-04-14T16:00:49Z\"\n              },\n              \"committer\": {\n                \"name\": \"Monalisa Octocat\",\n                \"email\": \"mona@github.com\",\n                \"date\": \"2011-04-14T16:00:49Z\"\n              },\n              \"message\": \"Fix all the bugs\",\n              \"tree\": {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n              },\n              \"comment_count\": 0,\n              \"verification\": {\n                \"verified\": false,\n                \"reason\": \"unsigned\",\n                \"signature\": null,\n                \"payload\": null\n              }\n            },\n            \"author\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"committer\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"parents\": [\n              {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n              }\n            ]\n          },\n          \"status\": \"behind\",\n          \"ahead_by\": 1,\n          \"behind_by\": 2,\n          \"total_commits\": 1,\n          \"commits\": [\n            {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"node_id\": \"MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\",\n              \"commit\": {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                \"author\": {\n                  \"name\": \"Monalisa Octocat\",\n                  \"email\": \"mona@github.com\",\n                  \"date\": \"2011-04-14T16:00:49Z\"\n                },\n                \"committer\": {\n                  \"name\": \"Monalisa Octocat\",\n                  \"email\": \"mona@github.com\",\n                  \"date\": \"2011-04-14T16:00:49Z\"\n                },\n                \"message\": \"Fix all the bugs\",\n                \"tree\": {\n                  \"url\": \"https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                  \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n                },\n                \"comment_count\": 0,\n                \"verification\": {\n                  \"verified\": false,\n                  \"reason\": \"unsigned\",\n                  \"signature\": null,\n                  \"payload\": null\n                }\n              },\n              \"author\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"committer\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"parents\": [\n                {\n                  \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n                  \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n                }\n              ]\n            }\n          ],\n          \"files\": [\n            {\n              \"sha\": \"bbcd538c8e72b8c175046e27cc8f907076331401\",\n              \"filename\": \"file1.txt\",\n              \"status\": \"added\",\n              \"additions\": 103,\n              \"deletions\": 21,\n              \"changes\": 124,\n              \"blob_url\": \"https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\",\n              \"raw_url\": \"https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n              \"patch\": \"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"\n            }\n          ]\n        }\n      },\n      \"content-reference-attachment\": {\n        \"value\": {\n          \"id\": 101,\n          \"title\": \"[A-1234] Error found in core/models.py file'\",\n          \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n        }\n      },\n      \"content-file-response-if-content-is-a-file\": {\n        \"summary\": \"Response if content is a file\",\n        \"value\": {\n          \"type\": \"file\",\n          \"encoding\": \"base64\",\n          \"size\": 5362,\n          \"name\": \"README.md\",\n          \"path\": \"README.md\",\n          \"content\": \"encoded content ...\",\n          \"sha\": \"3d21ec53a331a6f037a91c368710b99387d012c1\",\n          \"url\": \"https://api.github.com/repos/octokit/octokit.rb/contents/README.md\",\n          \"git_url\": \"https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1\",\n          \"html_url\": \"https://github.com/octokit/octokit.rb/blob/master/README.md\",\n          \"download_url\": \"https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md\",\n          \"_links\": {\n            \"git\": \"https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1\",\n            \"self\": \"https://api.github.com/repos/octokit/octokit.rb/contents/README.md\",\n            \"html\": \"https://github.com/octokit/octokit.rb/blob/master/README.md\"\n          }\n        }\n      },\n      \"content-file-response-if-content-is-a-directory\": {\n        \"summary\": \"Response if content is a directory\",\n        \"value\": [\n          {\n            \"type\": \"file\",\n            \"size\": 625,\n            \"name\": \"octokit.rb\",\n            \"path\": \"lib/octokit.rb\",\n            \"sha\": \"fff6fe3a23bf1c8ea0692b4a883af99bee26fd3b\",\n            \"url\": \"https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit.rb\",\n            \"git_url\": \"https://api.github.com/repos/octokit/octokit.rb/git/blobs/fff6fe3a23bf1c8ea0692b4a883af99bee26fd3b\",\n            \"html_url\": \"https://github.com/octokit/octokit.rb/blob/master/lib/octokit.rb\",\n            \"download_url\": \"https://raw.githubusercontent.com/octokit/octokit.rb/master/lib/octokit.rb\",\n            \"_links\": {\n              \"self\": \"https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit.rb\",\n              \"git\": \"https://api.github.com/repos/octokit/octokit.rb/git/blobs/fff6fe3a23bf1c8ea0692b4a883af99bee26fd3b\",\n              \"html\": \"https://github.com/octokit/octokit.rb/blob/master/lib/octokit.rb\"\n            }\n          },\n          {\n            \"type\": \"dir\",\n            \"size\": 0,\n            \"name\": \"octokit\",\n            \"path\": \"lib/octokit\",\n            \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n            \"url\": \"https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit\",\n            \"git_url\": \"https://api.github.com/repos/octokit/octokit.rb/git/trees/a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n            \"html_url\": \"https://github.com/octokit/octokit.rb/tree/master/lib/octokit\",\n            \"download_url\": null,\n            \"_links\": {\n              \"self\": \"https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit\",\n              \"git\": \"https://api.github.com/repos/octokit/octokit.rb/git/trees/a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n              \"html\": \"https://github.com/octokit/octokit.rb/tree/master/lib/octokit\"\n            }\n          }\n        ]\n      },\n      \"content-file-response-if-content-is-a-symlink\": {\n        \"summary\": \"Response if content is a symlink\",\n        \"value\": {\n          \"type\": \"symlink\",\n          \"target\": \"/path/to/symlink/target\",\n          \"size\": 23,\n          \"name\": \"some-symlink\",\n          \"path\": \"bin/some-symlink\",\n          \"sha\": \"452a98979c88e093d682cab404a3ec82babebb48\",\n          \"url\": \"https://api.github.com/repos/octokit/octokit.rb/contents/bin/some-symlink\",\n          \"git_url\": \"https://api.github.com/repos/octokit/octokit.rb/git/blobs/452a98979c88e093d682cab404a3ec82babebb48\",\n          \"html_url\": \"https://github.com/octokit/octokit.rb/blob/master/bin/some-symlink\",\n          \"download_url\": \"https://raw.githubusercontent.com/octokit/octokit.rb/master/bin/some-symlink\",\n          \"_links\": {\n            \"git\": \"https://api.github.com/repos/octokit/octokit.rb/git/blobs/452a98979c88e093d682cab404a3ec82babebb48\",\n            \"self\": \"https://api.github.com/repos/octokit/octokit.rb/contents/bin/some-symlink\",\n            \"html\": \"https://github.com/octokit/octokit.rb/blob/master/bin/some-symlink\"\n          }\n        }\n      },\n      \"content-file-response-if-content-is-a-submodule\": {\n        \"summary\": \"Response if content is a submodule\",\n        \"value\": {\n          \"type\": \"submodule\",\n          \"submodule_git_url\": \"git://github.com/jquery/qunit.git\",\n          \"size\": 0,\n          \"name\": \"qunit\",\n          \"path\": \"test/qunit\",\n          \"sha\": \"6ca3721222109997540bd6d9ccd396902e0ad2f9\",\n          \"url\": \"https://api.github.com/repos/jquery/jquery/contents/test/qunit?ref=master\",\n          \"git_url\": \"https://api.github.com/repos/jquery/qunit/git/trees/6ca3721222109997540bd6d9ccd396902e0ad2f9\",\n          \"html_url\": \"https://github.com/jquery/qunit/tree/6ca3721222109997540bd6d9ccd396902e0ad2f9\",\n          \"download_url\": null,\n          \"_links\": {\n            \"git\": \"https://api.github.com/repos/jquery/qunit/git/trees/6ca3721222109997540bd6d9ccd396902e0ad2f9\",\n            \"self\": \"https://api.github.com/repos/jquery/jquery/contents/test/qunit?ref=master\",\n            \"html\": \"https://github.com/jquery/qunit/tree/6ca3721222109997540bd6d9ccd396902e0ad2f9\"\n          }\n        }\n      },\n      \"file-commit-example-for-updating-a-file\": {\n        \"value\": {\n          \"content\": {\n            \"name\": \"hello.txt\",\n            \"path\": \"notes/hello.txt\",\n            \"sha\": \"a56507ed892d05a37c6d6128c260937ea4d287bd\",\n            \"size\": 9,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/blob/master/notes/hello.txt\",\n            \"git_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/a56507ed892d05a37c6d6128c260937ea4d287bd\",\n            \"download_url\": \"https://raw.githubusercontent.com/octocat/HelloWorld/master/notes/hello.txt\",\n            \"type\": \"file\",\n            \"_links\": {\n              \"self\": \"https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt\",\n              \"git\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/a56507ed892d05a37c6d6128c260937ea4d287bd\",\n              \"html\": \"https://github.com/octocat/Hello-World/blob/master/notes/hello.txt\"\n            }\n          },\n          \"commit\": {\n            \"sha\": \"18a43cd8e1e3a79c786e3d808a73d23b6d212b16\",\n            \"node_id\": \"MDY6Q29tbWl0MThhNDNjZDhlMWUzYTc5Yzc4NmUzZDgwOGE3M2QyM2I2ZDIxMmIxNg==\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/18a43cd8e1e3a79c786e3d808a73d23b6d212b16\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/git/commit/18a43cd8e1e3a79c786e3d808a73d23b6d212b16\",\n            \"author\": {\n              \"date\": \"2014-11-07T22:01:45Z\",\n              \"name\": \"Monalisa Octocat\",\n              \"email\": \"octocat@github.com\"\n            },\n            \"committer\": {\n              \"date\": \"2014-11-07T22:01:45Z\",\n              \"name\": \"Monalisa Octocat\",\n              \"email\": \"octocat@github.com\"\n            },\n            \"message\": \"my commit message\",\n            \"tree\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees/9a21f8e2018f42ffcf369b24d2cd20bc25c9e66f\",\n              \"sha\": \"9a21f8e2018f42ffcf369b24d2cd20bc25c9e66f\"\n            },\n            \"parents\": [\n              {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/da5a433788da5c255edad7979b328b67d79f53f6\",\n                \"html_url\": \"https://github.com/octocat/Hello-World/git/commit/da5a433788da5c255edad7979b328b67d79f53f6\",\n                \"sha\": \"da5a433788da5c255edad7979b328b67d79f53f6\"\n              }\n            ],\n            \"verification\": {\n              \"verified\": false,\n              \"reason\": \"unsigned\",\n              \"signature\": null,\n              \"payload\": null\n            }\n          }\n        }\n      },\n      \"file-commit-example-for-creating-a-file\": {\n        \"value\": {\n          \"content\": {\n            \"name\": \"hello.txt\",\n            \"path\": \"notes/hello.txt\",\n            \"sha\": \"95b966ae1c166bd92f8ae7d1c313e738c731dfc3\",\n            \"size\": 9,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/blob/master/notes/hello.txt\",\n            \"git_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/95b966ae1c166bd92f8ae7d1c313e738c731dfc3\",\n            \"download_url\": \"https://raw.githubusercontent.com/octocat/HelloWorld/master/notes/hello.txt\",\n            \"type\": \"file\",\n            \"_links\": {\n              \"self\": \"https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt\",\n              \"git\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/95b966ae1c166bd92f8ae7d1c313e738c731dfc3\",\n              \"html\": \"https://github.com/octocat/Hello-World/blob/master/notes/hello.txt\"\n            }\n          },\n          \"commit\": {\n            \"sha\": \"7638417db6d59f3c431d3e1f261cc637155684cd\",\n            \"node_id\": \"MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/git/commit/7638417db6d59f3c431d3e1f261cc637155684cd\",\n            \"author\": {\n              \"date\": \"2014-11-07T22:01:45Z\",\n              \"name\": \"Monalisa Octocat\",\n              \"email\": \"octocat@github.com\"\n            },\n            \"committer\": {\n              \"date\": \"2014-11-07T22:01:45Z\",\n              \"name\": \"Monalisa Octocat\",\n              \"email\": \"octocat@github.com\"\n            },\n            \"message\": \"my commit message\",\n            \"tree\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb\",\n              \"sha\": \"691272480426f78a0138979dd3ce63b77f706feb\"\n            },\n            \"parents\": [\n              {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5\",\n                \"html_url\": \"https://github.com/octocat/Hello-World/git/commit/1acc419d4d6a9ce985db7be48c6349a0475975b5\",\n                \"sha\": \"1acc419d4d6a9ce985db7be48c6349a0475975b5\"\n              }\n            ],\n            \"verification\": {\n              \"verified\": false,\n              \"reason\": \"unsigned\",\n              \"signature\": null,\n              \"payload\": null\n            }\n          }\n        }\n      },\n      \"file-commit\": {\n        \"value\": {\n          \"content\": null,\n          \"commit\": {\n            \"sha\": \"7638417db6d59f3c431d3e1f261cc637155684cd\",\n            \"node_id\": \"MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/git/commit/7638417db6d59f3c431d3e1f261cc637155684cd\",\n            \"author\": {\n              \"date\": \"2014-11-07T22:01:45Z\",\n              \"name\": \"Monalisa Octocat\",\n              \"email\": \"octocat@github.com\"\n            },\n            \"committer\": {\n              \"date\": \"2014-11-07T22:01:45Z\",\n              \"name\": \"Monalisa Octocat\",\n              \"email\": \"octocat@github.com\"\n            },\n            \"message\": \"my commit message\",\n            \"tree\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb\",\n              \"sha\": \"691272480426f78a0138979dd3ce63b77f706feb\"\n            },\n            \"parents\": [\n              {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5\",\n                \"html_url\": \"https://github.com/octocat/Hello-World/git/commit/1acc419d4d6a9ce985db7be48c6349a0475975b5\",\n                \"sha\": \"1acc419d4d6a9ce985db7be48c6349a0475975b5\"\n              }\n            ],\n            \"verification\": {\n              \"verified\": false,\n              \"reason\": \"unsigned\",\n              \"signature\": null,\n              \"payload\": null\n            }\n          }\n        }\n      },\n      \"contributor-items-response-if-repository-contains-content\": {\n        \"value\": [\n          {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false,\n            \"contributions\": 32\n          }\n        ]\n      },\n      \"deployment-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n            \"id\": 1,\n            \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n            \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n            \"ref\": \"topic-branch\",\n            \"task\": \"deploy\",\n            \"payload\": {\n            },\n            \"original_environment\": \"staging\",\n            \"environment\": \"production\",\n            \"description\": \"Deploy request from hubot\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2012-07-20T01:19:13Z\",\n            \"updated_at\": \"2012-07-20T01:19:13Z\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n            \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n            \"transient_environment\": false,\n            \"production_environment\": true\n          }\n        ]\n      },\n      \"deployment-simple-example\": {\n        \"summary\": \"Simple example\",\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n          \"id\": 1,\n          \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n          \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n          \"ref\": \"topic-branch\",\n          \"task\": \"deploy\",\n          \"payload\": {\n          },\n          \"original_environment\": \"staging\",\n          \"environment\": \"production\",\n          \"description\": \"Deploy request from hubot\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2012-07-20T01:19:13Z\",\n          \"updated_at\": \"2012-07-20T01:19:13Z\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n          \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n          \"transient_environment\": false,\n          \"production_environment\": true\n        }\n      },\n      \"deployment\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/example/deployments/1\",\n          \"id\": 1,\n          \"node_id\": \"MDEwOkRlcGxveW1lbnQx\",\n          \"sha\": \"a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\",\n          \"ref\": \"topic-branch\",\n          \"task\": \"deploy\",\n          \"payload\": {\n          },\n          \"original_environment\": \"staging\",\n          \"environment\": \"production\",\n          \"description\": \"Deploy request from hubot\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2012-07-20T01:19:13Z\",\n          \"updated_at\": \"2012-07-20T01:19:13Z\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/example/deployments/1/statuses\",\n          \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n          \"transient_environment\": false,\n          \"production_environment\": true\n        }\n      },\n      \"deployment-status-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/example/deployments/42/statuses/1\",\n            \"id\": 1,\n            \"node_id\": \"MDE2OkRlcGxveW1lbnRTdGF0dXMx\",\n            \"state\": \"success\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"description\": \"Deployment finished successfully.\",\n            \"environment\": \"production\",\n            \"target_url\": \"https://example.com/deployment/42/output\",\n            \"created_at\": \"2012-07-20T01:19:13Z\",\n            \"updated_at\": \"2012-07-20T01:19:13Z\",\n            \"deployment_url\": \"https://api.github.com/repos/octocat/example/deployments/42\",\n            \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n            \"environment_url\": \"https://test-branch.lab.acme.com\",\n            \"log_url\": \"https://example.com/deployment/42/output\"\n          }\n        ]\n      },\n      \"deployment-status\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/example/deployments/42/statuses/1\",\n          \"id\": 1,\n          \"node_id\": \"MDE2OkRlcGxveW1lbnRTdGF0dXMx\",\n          \"state\": \"success\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"description\": \"Deployment finished successfully.\",\n          \"environment\": \"production\",\n          \"target_url\": \"https://example.com/deployment/42/output\",\n          \"created_at\": \"2012-07-20T01:19:13Z\",\n          \"updated_at\": \"2012-07-20T01:19:13Z\",\n          \"deployment_url\": \"https://api.github.com/repos/octocat/example/deployments/42\",\n          \"repository_url\": \"https://api.github.com/repos/octocat/example\",\n          \"environment_url\": \"https://test-branch.lab.acme.com\",\n          \"log_url\": \"https://example.com/deployment/42/output\"\n        }\n      },\n      \"minimal-repository-items-2\": {\n        \"value\": [\n          {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": true,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"language\": null,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"delete_branch_on_merge\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"spdx_id\": \"MIT\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n            }\n          }\n        ]\n      },\n      \"short-blob\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/example/git/blobs/3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\",\n          \"sha\": \"3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\"\n        }\n      },\n      \"blob\": {\n        \"value\": {\n          \"content\": \"Q29udGVudCBvZiB0aGUgYmxvYg==\",\n          \"encoding\": \"base64\",\n          \"url\": \"https://api.github.com/repos/octocat/example/git/blobs/3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\",\n          \"sha\": \"3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\",\n          \"size\": 19,\n          \"node_id\": \"Q29udGVudCBvZiB0aGUgYmxvYg==\"\n        }\n      },\n      \"git-commit\": {\n        \"value\": {\n          \"sha\": \"7638417db6d59f3c431d3e1f261cc637155684cd\",\n          \"node_id\": \"MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\",\n          \"author\": {\n            \"date\": \"2014-11-07T22:01:45Z\",\n            \"name\": \"Monalisa Octocat\",\n            \"email\": \"octocat@github.com\"\n          },\n          \"committer\": {\n            \"date\": \"2014-11-07T22:01:45Z\",\n            \"name\": \"Monalisa Octocat\",\n            \"email\": \"octocat@github.com\"\n          },\n          \"message\": \"my commit message\",\n          \"tree\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees/827efc6d56897b048c772eb4087f854f46256132\",\n            \"sha\": \"827efc6d56897b048c772eb4087f854f46256132\"\n          },\n          \"parents\": [\n            {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/7d1b31e74ee336d15cbd21741bc88a537ed063a0\",\n              \"sha\": \"7d1b31e74ee336d15cbd21741bc88a537ed063a0\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/commit/7d1b31e74ee336d15cbd21741bc88a537ed063a0\"\n            }\n          ],\n          \"verification\": {\n            \"verified\": false,\n            \"reason\": \"unsigned\",\n            \"signature\": null,\n            \"payload\": null\n          },\n          \"html_url\": \"https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd\"\n        }\n      },\n      \"git-commit-2\": {\n        \"value\": {\n          \"sha\": \"7638417db6d59f3c431d3e1f261cc637155684cd\",\n          \"node_id\": \"MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd\",\n          \"author\": {\n            \"date\": \"2014-11-07T22:01:45Z\",\n            \"name\": \"Monalisa Octocat\",\n            \"email\": \"octocat@github.com\"\n          },\n          \"committer\": {\n            \"date\": \"2014-11-07T22:01:45Z\",\n            \"name\": \"Monalisa Octocat\",\n            \"email\": \"octocat@github.com\"\n          },\n          \"message\": \"added readme, because im a good github citizen\",\n          \"tree\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb\",\n            \"sha\": \"691272480426f78a0138979dd3ce63b77f706feb\"\n          },\n          \"parents\": [\n            {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5\",\n              \"sha\": \"1acc419d4d6a9ce985db7be48c6349a0475975b5\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd\"\n            }\n          ],\n          \"verification\": {\n            \"verified\": false,\n            \"reason\": \"unsigned\",\n            \"signature\": null,\n            \"payload\": null\n          }\n        }\n      },\n      \"git-ref-items\": {\n        \"value\": [\n          {\n            \"ref\": \"refs/heads/feature-a\",\n            \"node_id\": \"MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlLWE=\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs/heads/feature-a\",\n            \"object\": {\n              \"type\": \"commit\",\n              \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n            }\n          },\n          {\n            \"ref\": \"refs/heads/feature-b\",\n            \"node_id\": \"MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlLWI=\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs/heads/feature-b\",\n            \"object\": {\n              \"type\": \"commit\",\n              \"sha\": \"612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac\"\n            }\n          }\n        ]\n      },\n      \"git-ref\": {\n        \"value\": {\n          \"ref\": \"refs/heads/featureA\",\n          \"node_id\": \"MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlQQ==\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs/heads/featureA\",\n          \"object\": {\n            \"type\": \"commit\",\n            \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n          }\n        }\n      },\n      \"git-tag\": {\n        \"value\": {\n          \"node_id\": \"MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==\",\n          \"tag\": \"v0.0.1\",\n          \"sha\": \"940bd336248efae0f9ee5bc7b2d5c985887b16ac\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac\",\n          \"message\": \"initial version\",\n          \"tagger\": {\n            \"name\": \"Monalisa Octocat\",\n            \"email\": \"octocat@github.com\",\n            \"date\": \"2014-11-07T22:01:45Z\"\n          },\n          \"object\": {\n            \"type\": \"commit\",\n            \"sha\": \"c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c\"\n          },\n          \"verification\": {\n            \"verified\": false,\n            \"reason\": \"unsigned\",\n            \"signature\": null,\n            \"payload\": null\n          }\n        }\n      },\n      \"git-tree\": {\n        \"value\": {\n          \"sha\": \"cd8274d15fa3ae2ab983129fb037999f264ba9a7\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/trees/cd8274d15fa3ae2ab983129fb037999f264ba9a7\",\n          \"tree\": [\n            {\n              \"path\": \"file.rb\",\n              \"mode\": \"100644\",\n              \"type\": \"blob\",\n              \"size\": 132,\n              \"sha\": \"7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\"\n            }\n          ],\n          \"truncated\": true\n        }\n      },\n      \"git-tree-default-response\": {\n        \"summary\": \"Default response\",\n        \"value\": {\n          \"sha\": \"9fb037999f264ba9a7fc6274d15fa3ae2ab98312\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/trees/9fb037999f264ba9a7fc6274d15fa3ae2ab98312\",\n          \"tree\": [\n            {\n              \"path\": \"file.rb\",\n              \"mode\": \"100644\",\n              \"type\": \"blob\",\n              \"size\": 30,\n              \"sha\": \"44b4fc6d56897b048c772eb4087f854f46256132\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132\"\n            },\n            {\n              \"path\": \"subdir\",\n              \"mode\": \"040000\",\n              \"type\": \"tree\",\n              \"sha\": \"f484d249c660418515fb01c2b9662073663c242e\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/f484d249c660418515fb01c2b9662073663c242e\"\n            },\n            {\n              \"path\": \"exec_file\",\n              \"mode\": \"100755\",\n              \"type\": \"blob\",\n              \"size\": 75,\n              \"sha\": \"45b983be36b73c0788dc9cbcb76cbb80fc7bb057\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs/45b983be36b73c0788dc9cbcb76cbb80fc7bb057\"\n            }\n          ],\n          \"truncated\": false\n        }\n      },\n      \"git-tree-response-recursively-retrieving-a-tree\": {\n        \"summary\": \"Response recursively retrieving a tree\",\n        \"value\": {\n          \"sha\": \"fc6274d15fa3ae2ab983129fb037999f264ba9a7\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/trees/fc6274d15fa3ae2ab983129fb037999f264ba9a7\",\n          \"tree\": [\n            {\n              \"path\": \"subdir/file.txt\",\n              \"mode\": \"100644\",\n              \"type\": \"blob\",\n              \"size\": 132,\n              \"sha\": \"7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/git/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\"\n            }\n          ],\n          \"truncated\": false\n        }\n      },\n      \"hook-items\": {\n        \"value\": [\n          {\n            \"type\": \"Repository\",\n            \"id\": 12345678,\n            \"name\": \"web\",\n            \"active\": true,\n            \"events\": [\n              \"push\",\n              \"pull_request\"\n            ],\n            \"config\": {\n              \"content_type\": \"json\",\n              \"insecure_ssl\": \"0\",\n              \"url\": \"https://example.com/webhook\"\n            },\n            \"updated_at\": \"2019-06-03T00:57:16Z\",\n            \"created_at\": \"2019-06-03T00:57:16Z\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/hooks/12345678\",\n            \"test_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks/12345678/test\",\n            \"ping_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks/12345678/pings\",\n            \"last_response\": {\n              \"code\": null,\n              \"status\": \"unused\",\n              \"message\": null\n            }\n          }\n        ]\n      },\n      \"hook\": {\n        \"value\": {\n          \"type\": \"Repository\",\n          \"id\": 12345678,\n          \"name\": \"web\",\n          \"active\": true,\n          \"events\": [\n            \"push\",\n            \"pull_request\"\n          ],\n          \"config\": {\n            \"content_type\": \"json\",\n            \"insecure_ssl\": \"0\",\n            \"url\": \"https://example.com/webhook\"\n          },\n          \"updated_at\": \"2019-06-03T00:57:16Z\",\n          \"created_at\": \"2019-06-03T00:57:16Z\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/hooks/12345678\",\n          \"test_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks/12345678/test\",\n          \"ping_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks/12345678/pings\",\n          \"last_response\": {\n            \"code\": null,\n            \"status\": \"unused\",\n            \"message\": null\n          }\n        }\n      },\n      \"repository-invitation-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"repository\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n            },\n            \"invitee\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"inviter\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"permissions\": \"write\",\n            \"created_at\": \"2016-06-13T14:52:50-05:00\",\n            \"url\": \"https://api.github.com/user/repository_invitations/1296269\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/invitations\",\n            \"node_id\": \"MDQ6VXNlcjE=\"\n          }\n        ]\n      },\n      \"repository-invitation\": {\n        \"value\": {\n          \"id\": 1,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n          },\n          \"invitee\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"inviter\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"permissions\": \"write\",\n          \"created_at\": \"2016-06-13T14:52:50-05:00\",\n          \"expired\": false,\n          \"url\": \"https://api.github.com/user/repository_invitations/1296269\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/invitations\"\n        }\n      },\n      \"issue-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDU6SXNzdWUx\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n            \"repository_url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/events\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/issues/1347\",\n            \"number\": 1347,\n            \"state\": \"open\",\n            \"title\": \"Found a bug\",\n            \"body\": \"I'm having a problem with this.\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"labels\": [\n              {\n                \"id\": 208045946,\n                \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n                \"name\": \"bug\",\n                \"description\": \"Something isn't working\",\n                \"color\": \"f29513\",\n                \"default\": true\n              }\n            ],\n            \"assignee\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"assignees\": [\n              {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              }\n            ],\n            \"milestone\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n              \"id\": 1002604,\n              \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n              \"number\": 1,\n              \"state\": \"open\",\n              \"title\": \"v1.0\",\n              \"description\": \"Tracking milestone for version 1.0\",\n              \"creator\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"open_issues\": 4,\n              \"closed_issues\": 8,\n              \"created_at\": \"2011-04-10T20:09:31Z\",\n              \"updated_at\": \"2014-03-03T18:58:10Z\",\n              \"closed_at\": \"2013-02-12T13:22:01Z\",\n              \"due_on\": \"2012-10-09T23:39:01Z\"\n            },\n            \"locked\": true,\n            \"active_lock_reason\": \"too heated\",\n            \"comments\": 0,\n            \"pull_request\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n              \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n              \"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\"\n            },\n            \"closed_at\": null,\n            \"created_at\": \"2011-04-22T13:33:48Z\",\n            \"updated_at\": \"2011-04-22T13:33:48Z\",\n            \"closed_by\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"author_association\": \"COLLABORATOR\"\n          }\n        ]\n      },\n      \"issue\": {\n        \"value\": {\n          \"id\": 1,\n          \"node_id\": \"MDU6SXNzdWUx\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n          \"repository_url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/events\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/issues/1347\",\n          \"number\": 1347,\n          \"state\": \"open\",\n          \"title\": \"Found a bug\",\n          \"body\": \"I'm having a problem with this.\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"labels\": [\n            {\n              \"id\": 208045946,\n              \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n              \"name\": \"bug\",\n              \"description\": \"Something isn't working\",\n              \"color\": \"f29513\",\n              \"default\": true\n            }\n          ],\n          \"assignee\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"assignees\": [\n            {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          ],\n          \"milestone\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n            \"id\": 1002604,\n            \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n            \"number\": 1,\n            \"state\": \"open\",\n            \"title\": \"v1.0\",\n            \"description\": \"Tracking milestone for version 1.0\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"open_issues\": 4,\n            \"closed_issues\": 8,\n            \"created_at\": \"2011-04-10T20:09:31Z\",\n            \"updated_at\": \"2014-03-03T18:58:10Z\",\n            \"closed_at\": \"2013-02-12T13:22:01Z\",\n            \"due_on\": \"2012-10-09T23:39:01Z\"\n          },\n          \"locked\": true,\n          \"active_lock_reason\": \"too heated\",\n          \"comments\": 0,\n          \"pull_request\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n            \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n            \"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\"\n          },\n          \"closed_at\": null,\n          \"created_at\": \"2011-04-22T13:33:48Z\",\n          \"updated_at\": \"2011-04-22T13:33:48Z\",\n          \"closed_by\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"author_association\": \"COLLABORATOR\"\n        }\n      },\n      \"issue-comment-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDEyOklzc3VlQ29tbWVudDE=\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments/1\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/issues/1347#issuecomment-1\",\n            \"body\": \"Me too\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2011-04-14T16:00:49Z\",\n            \"updated_at\": \"2011-04-14T16:00:49Z\",\n            \"issue_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n            \"author_association\": \"COLLABORATOR\"\n          }\n        ]\n      },\n      \"issue-comment\": {\n        \"value\": {\n          \"id\": 1,\n          \"node_id\": \"MDEyOklzc3VlQ29tbWVudDE=\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments/1\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/issues/1347#issuecomment-1\",\n          \"body\": \"Me too\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2011-04-14T16:00:49Z\",\n          \"updated_at\": \"2011-04-14T16:00:49Z\",\n          \"issue_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n          \"author_association\": \"COLLABORATOR\"\n        }\n      },\n      \"issue-event-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDEwOklzc3VlRXZlbnQx\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events/1\",\n            \"actor\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"event\": \"closed\",\n            \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"commit_url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"created_at\": \"2011-04-14T16:00:49Z\",\n            \"issue\": {\n              \"id\": 1,\n              \"node_id\": \"MDU6SXNzdWUx\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n              \"repository_url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/events\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/issues/1347\",\n              \"number\": 1347,\n              \"state\": \"open\",\n              \"title\": \"Found a bug\",\n              \"body\": \"I'm having a problem with this.\",\n              \"user\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"labels\": [\n                {\n                  \"id\": 208045946,\n                  \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n                  \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n                  \"name\": \"bug\",\n                  \"description\": \"Something isn't working\",\n                  \"color\": \"f29513\",\n                  \"default\": true\n                }\n              ],\n              \"assignee\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"assignees\": [\n                {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                }\n              ],\n              \"milestone\": {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n                \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n                \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n                \"id\": 1002604,\n                \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n                \"number\": 1,\n                \"state\": \"open\",\n                \"title\": \"v1.0\",\n                \"description\": \"Tracking milestone for version 1.0\",\n                \"creator\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"open_issues\": 4,\n                \"closed_issues\": 8,\n                \"created_at\": \"2011-04-10T20:09:31Z\",\n                \"updated_at\": \"2014-03-03T18:58:10Z\",\n                \"closed_at\": \"2013-02-12T13:22:01Z\",\n                \"due_on\": \"2012-10-09T23:39:01Z\"\n              },\n              \"locked\": true,\n              \"active_lock_reason\": \"too heated\",\n              \"comments\": 0,\n              \"pull_request\": {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n                \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n                \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n                \"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\"\n              },\n              \"closed_at\": null,\n              \"created_at\": \"2011-04-22T13:33:48Z\",\n              \"updated_at\": \"2011-04-22T13:33:48Z\",\n              \"author_association\": \"COLLABORATOR\"\n            }\n          }\n        ]\n      },\n      \"issue-event\": {\n        \"value\": {\n          \"id\": 1,\n          \"node_id\": \"MDEwOklzc3VlRXZlbnQx\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events/1\",\n          \"actor\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"event\": \"closed\",\n          \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"commit_url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"created_at\": \"2011-04-14T16:00:49Z\",\n          \"issue\": {\n            \"id\": 1,\n            \"node_id\": \"MDU6SXNzdWUx\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n            \"repository_url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/events\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/issues/1347\",\n            \"number\": 1347,\n            \"state\": \"open\",\n            \"title\": \"Found a bug\",\n            \"body\": \"I'm having a problem with this.\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"labels\": [\n              {\n                \"id\": 208045946,\n                \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n                \"name\": \"bug\",\n                \"description\": \"Something isn't working\",\n                \"color\": \"f29513\",\n                \"default\": true\n              }\n            ],\n            \"assignee\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"assignees\": [\n              {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              }\n            ],\n            \"milestone\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n              \"id\": 1002604,\n              \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n              \"number\": 1,\n              \"state\": \"open\",\n              \"title\": \"v1.0\",\n              \"description\": \"Tracking milestone for version 1.0\",\n              \"creator\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"open_issues\": 4,\n              \"closed_issues\": 8,\n              \"created_at\": \"2011-04-10T20:09:31Z\",\n              \"updated_at\": \"2014-03-03T18:58:10Z\",\n              \"closed_at\": \"2013-02-12T13:22:01Z\",\n              \"due_on\": \"2012-10-09T23:39:01Z\"\n            },\n            \"locked\": true,\n            \"performed_via_github_app\": {\n              \"id\": 1,\n              \"slug\": \"octoapp\",\n              \"node_id\": \"MDExOkludGVncmF0aW9uMQ==\",\n              \"owner\": {\n                \"login\": \"github\",\n                \"id\": 1,\n                \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n                \"url\": \"https://api.github.com/orgs/github\",\n                \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n                \"events_url\": \"https://api.github.com/orgs/github/events\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": true\n              },\n              \"name\": \"Octocat App\",\n              \"description\": \"\",\n              \"external_url\": \"https://example.com\",\n              \"html_url\": \"https://github.com/apps/octoapp\",\n              \"created_at\": \"2017-07-08T16:18:44-04:00\",\n              \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n              \"permissions\": {\n                \"metadata\": \"read\",\n                \"contents\": \"read\",\n                \"issues\": \"write\",\n                \"single_file\": \"write\"\n              },\n              \"events\": [\n                \"push\",\n                \"pull_request\"\n              ]\n            },\n            \"comments\": 0,\n            \"pull_request\": {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n              \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n              \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n              \"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\"\n            },\n            \"closed_at\": null,\n            \"created_at\": \"2011-04-22T13:33:48Z\",\n            \"updated_at\": \"2011-04-22T13:33:48Z\",\n            \"author_association\": \"COLLABORATOR\"\n          }\n        }\n      },\n      \"issue-event-for-issue-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDEwOklzc3VlRXZlbnQx\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events/1\",\n            \"actor\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"event\": \"closed\",\n            \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"commit_url\": \"https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"created_at\": \"2011-04-14T16:00:49Z\",\n            \"performed_via_github_app\": null,\n            \"label\": {\n              \"name\": \"label\",\n              \"color\": \"red\"\n            }\n          }\n        ]\n      },\n      \"label-items\": {\n        \"value\": [\n          {\n            \"id\": 208045946,\n            \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n            \"name\": \"bug\",\n            \"description\": \"Something isn't working\",\n            \"color\": \"f29513\",\n            \"default\": true\n          },\n          {\n            \"id\": 208045947,\n            \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDc=\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/enhancement\",\n            \"name\": \"enhancement\",\n            \"description\": \"New feature or request\",\n            \"color\": \"a2eeef\",\n            \"default\": false\n          }\n        ]\n      },\n      \"label-items-2\": {\n        \"value\": [\n          {\n            \"id\": 208045946,\n            \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n            \"name\": \"bug\",\n            \"description\": \"Something isn't working\",\n            \"color\": \"f29513\",\n            \"default\": true\n          }\n        ]\n      },\n      \"deploy-key-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"key\": \"ssh-rsa AAA...\",\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n            \"title\": \"octocat@octomac\",\n            \"verified\": true,\n            \"created_at\": \"2014-12-10T15:53:42Z\",\n            \"read_only\": true\n          }\n        ]\n      },\n      \"deploy-key\": {\n        \"value\": {\n          \"id\": 1,\n          \"key\": \"ssh-rsa AAA...\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/keys/1\",\n          \"title\": \"octocat@octomac\",\n          \"verified\": true,\n          \"created_at\": \"2014-12-10T15:53:42Z\",\n          \"read_only\": true\n        }\n      },\n      \"label\": {\n        \"value\": {\n          \"id\": 208045946,\n          \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n          \"name\": \"bug\",\n          \"description\": \"Something isn't working\",\n          \"color\": \"f29513\",\n          \"default\": true\n        }\n      },\n      \"label-2\": {\n        \"value\": {\n          \"id\": 208045946,\n          \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug%20:bug:\",\n          \"name\": \"bug :bug:\",\n          \"description\": \"Small bug fix required\",\n          \"color\": \"b01f26\",\n          \"default\": true\n        }\n      },\n      \"language\": {\n        \"value\": {\n          \"C\": 78769,\n          \"Python\": 7769\n        }\n      },\n      \"license-content\": {\n        \"value\": {\n          \"name\": \"LICENSE\",\n          \"path\": \"LICENSE\",\n          \"sha\": \"401c59dcc4570b954dd6d345e76199e1f4e76266\",\n          \"size\": 1077,\n          \"url\": \"https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=master\",\n          \"html_url\": \"https://github.com/benbalter/gman/blob/master/LICENSE\",\n          \"git_url\": \"https://api.github.com/repos/benbalter/gman/git/blobs/401c59dcc4570b954dd6d345e76199e1f4e76266\",\n          \"download_url\": \"https://raw.githubusercontent.com/benbalter/gman/master/LICENSE?lab=true\",\n          \"type\": \"file\",\n          \"content\": \"VGhlIE1JVCBMaWNlbnNlIChNSVQpCgpDb3B5cmlnaHQgKGMpIDIwMTMgQmVu\\nIEJhbHRlcgoKUGVybWlzc2lvbiBpcyBoZXJlYnkgZ3JhbnRlZCwgZnJlZSBv\\nZiBjaGFyZ2UsIHRvIGFueSBwZXJzb24gb2J0YWluaW5nIGEgY29weSBvZgp0\\naGlzIHNvZnR3YXJlIGFuZCBhc3NvY2lhdGVkIGRvY3VtZW50YXRpb24gZmls\\nZXMgKHRoZSAiU29mdHdhcmUiKSwgdG8gZGVhbCBpbgp0aGUgU29mdHdhcmUg\\nd2l0aG91dCByZXN0cmljdGlvbiwgaW5jbHVkaW5nIHdpdGhvdXQgbGltaXRh\\ndGlvbiB0aGUgcmlnaHRzIHRvCnVzZSwgY29weSwgbW9kaWZ5LCBtZXJnZSwg\\ncHVibGlzaCwgZGlzdHJpYnV0ZSwgc3VibGljZW5zZSwgYW5kL29yIHNlbGwg\\nY29waWVzIG9mCnRoZSBTb2Z0d2FyZSwgYW5kIHRvIHBlcm1pdCBwZXJzb25z\\nIHRvIHdob20gdGhlIFNvZnR3YXJlIGlzIGZ1cm5pc2hlZCB0byBkbyBzbywK\\nc3ViamVjdCB0byB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnM6CgpUaGUgYWJv\\ndmUgY29weXJpZ2h0IG5vdGljZSBhbmQgdGhpcyBwZXJtaXNzaW9uIG5vdGlj\\nZSBzaGFsbCBiZSBpbmNsdWRlZCBpbiBhbGwKY29waWVzIG9yIHN1YnN0YW50\\naWFsIHBvcnRpb25zIG9mIHRoZSBTb2Z0d2FyZS4KClRIRSBTT0ZUV0FSRSBJ\\nUyBQUk9WSURFRCAiQVMgSVMiLCBXSVRIT1VUIFdBUlJBTlRZIE9GIEFOWSBL\\nSU5ELCBFWFBSRVNTIE9SCklNUExJRUQsIElOQ0xVRElORyBCVVQgTk9UIExJ\\nTUlURUQgVE8gVEhFIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZLCBG\\nSVRORVNTCkZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSBBTkQgTk9OSU5GUklO\\nR0VNRU5ULiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUgQVVUSE9SUyBPUgpDT1BZ\\nUklHSFQgSE9MREVSUyBCRSBMSUFCTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdF\\nUyBPUiBPVEhFUiBMSUFCSUxJVFksIFdIRVRIRVIKSU4gQU4gQUNUSU9OIE9G\\nIENPTlRSQUNULCBUT1JUIE9SIE9USEVSV0lTRSwgQVJJU0lORyBGUk9NLCBP\\nVVQgT0YgT1IgSU4KQ09OTkVDVElPTiBXSVRIIFRIRSBTT0ZUV0FSRSBPUiBU\\nSEUgVVNFIE9SIE9USEVSIERFQUxJTkdTIElOIFRIRSBTT0ZUV0FSRS4K\\n\",\n          \"encoding\": \"base64\",\n          \"_links\": {\n            \"self\": \"https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=master\",\n            \"git\": \"https://api.github.com/repos/benbalter/gman/git/blobs/401c59dcc4570b954dd6d345e76199e1f4e76266\",\n            \"html\": \"https://github.com/benbalter/gman/blob/master/LICENSE\"\n          },\n          \"license\": {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"spdx_id\": \"MIT\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n          }\n        }\n      },\n      \"milestone-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n            \"id\": 1002604,\n            \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n            \"number\": 1,\n            \"state\": \"open\",\n            \"title\": \"v1.0\",\n            \"description\": \"Tracking milestone for version 1.0\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"open_issues\": 4,\n            \"closed_issues\": 8,\n            \"created_at\": \"2011-04-10T20:09:31Z\",\n            \"updated_at\": \"2014-03-03T18:58:10Z\",\n            \"closed_at\": \"2013-02-12T13:22:01Z\",\n            \"due_on\": \"2012-10-09T23:39:01Z\"\n          }\n        ]\n      },\n      \"milestone\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n          \"id\": 1002604,\n          \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n          \"number\": 1,\n          \"state\": \"open\",\n          \"title\": \"v1.0\",\n          \"description\": \"Tracking milestone for version 1.0\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"open_issues\": 4,\n          \"closed_issues\": 8,\n          \"created_at\": \"2011-04-10T20:09:31Z\",\n          \"updated_at\": \"2014-03-03T18:58:10Z\",\n          \"closed_at\": \"2013-02-12T13:22:01Z\",\n          \"due_on\": \"2012-10-09T23:39:01Z\"\n        }\n      },\n      \"page\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/github/developer.github.com/pages\",\n          \"status\": \"built\",\n          \"cname\": \"developer.github.com\",\n          \"custom_404\": false,\n          \"html_url\": \"https://developer.github.com\",\n          \"source\": {\n            \"branch\": \"master\",\n            \"path\": \"/\"\n          },\n          \"public\": true,\n          \"https_certificate\": {\n            \"state\": \"approved\",\n            \"description\": \"Certificate is approved\",\n            \"domains\": [\n              \"developer.github.com\"\n            ],\n            \"expires_at\": \"2021-05-22\"\n          },\n          \"https_enforced\": true\n        }\n      },\n      \"page-build-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/github/developer.github.com/pages/builds/5472601\",\n            \"status\": \"built\",\n            \"error\": {\n              \"message\": null\n            },\n            \"pusher\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"commit\": \"351391cdcb88ffae71ec3028c91f375a8036a26b\",\n            \"duration\": 2104,\n            \"created_at\": \"2014-02-10T19:00:49Z\",\n            \"updated_at\": \"2014-02-10T19:00:51Z\"\n          }\n        ]\n      },\n      \"page-build-status\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/github/developer.github.com/pages/builds/latest\",\n          \"status\": \"queued\"\n        }\n      },\n      \"page-build\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/github/developer.github.com/pages/builds/5472601\",\n          \"status\": \"built\",\n          \"error\": {\n            \"message\": null\n          },\n          \"pusher\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"commit\": \"351391cdcb88ffae71ec3028c91f375a8036a26b\",\n          \"duration\": 2104,\n          \"created_at\": \"2014-02-10T19:00:49Z\",\n          \"updated_at\": \"2014-02-10T19:00:51Z\"\n        }\n      },\n      \"repository-pre-receive-hook-items\": {\n        \"value\": [\n          {\n            \"id\": 42,\n            \"name\": \"Check Commits\",\n            \"enforcement\": \"disabled\",\n            \"configuration_url\": \"https://github.example.com/api/v3/orgs/octocat/pre-receive-hooks/42\"\n          }\n        ]\n      },\n      \"repository-pre-receive-hook\": {\n        \"value\": {\n          \"id\": 42,\n          \"name\": \"Check Commits\",\n          \"enforcement\": \"disabled\",\n          \"configuration_url\": \"https://github.example.com/api/v3/orgs/octocat/pre-receive-hooks/42\"\n        }\n      },\n      \"repository-pre-receive-hook-2\": {\n        \"value\": {\n          \"id\": 42,\n          \"name\": \"Check Commits\",\n          \"enforcement\": \"enabled\",\n          \"configuration_url\": \"https://github.example.com/api/v3/repos/octocat/hello-world/pre-receive-hooks/42\"\n        }\n      },\n      \"project-items-2\": {\n        \"value\": [\n          {\n            \"owner_url\": \"https://api.github.com/repos/api-playground/projects-test\",\n            \"url\": \"https://api.github.com/projects/1002604\",\n            \"html_url\": \"https://github.com/api-playground/projects-test/projects/1\",\n            \"columns_url\": \"https://api.github.com/projects/1002604/columns\",\n            \"id\": 1002604,\n            \"node_id\": \"MDc6UHJvamVjdDEwMDI2MDQ=\",\n            \"name\": \"Projects Documentation\",\n            \"body\": \"Developer documentation project for the developer site.\",\n            \"number\": 1,\n            \"state\": \"open\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2011-04-10T20:09:31Z\",\n            \"updated_at\": \"2014-03-03T18:58:10Z\"\n          }\n        ]\n      },\n      \"pull-request\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n          \"id\": 1,\n          \"node_id\": \"MDExOlB1bGxSZXF1ZXN0MQ==\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n          \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n          \"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\",\n          \"issue_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\",\n          \"review_comments_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\",\n          \"review_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"number\": 1347,\n          \"state\": \"open\",\n          \"locked\": true,\n          \"title\": \"Amazing new feature\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Please pull these awesome changes in!\",\n          \"labels\": [\n            {\n              \"id\": 208045946,\n              \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n              \"name\": \"bug\",\n              \"description\": \"Something isn't working\",\n              \"color\": \"f29513\",\n              \"default\": true\n            }\n          ],\n          \"milestone\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n            \"id\": 1002604,\n            \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n            \"number\": 1,\n            \"state\": \"open\",\n            \"title\": \"v1.0\",\n            \"description\": \"Tracking milestone for version 1.0\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"open_issues\": 4,\n            \"closed_issues\": 8,\n            \"created_at\": \"2011-04-10T20:09:31Z\",\n            \"updated_at\": \"2014-03-03T18:58:10Z\",\n            \"closed_at\": \"2013-02-12T13:22:01Z\",\n            \"due_on\": \"2012-10-09T23:39:01Z\"\n          },\n          \"active_lock_reason\": \"too heated\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:01:12Z\",\n          \"closed_at\": \"2011-01-26T19:01:12Z\",\n          \"merged_at\": \"2011-01-26T19:01:12Z\",\n          \"merge_commit_sha\": \"e5bd3914e2e596debea16f433f57875b5b90bcd6\",\n          \"assignee\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"assignees\": [\n            {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            {\n              \"login\": \"hubot\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/hubot_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/hubot\",\n              \"html_url\": \"https://github.com/hubot\",\n              \"followers_url\": \"https://api.github.com/users/hubot/followers\",\n              \"following_url\": \"https://api.github.com/users/hubot/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/hubot/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/hubot/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/hubot/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/hubot/orgs\",\n              \"repos_url\": \"https://api.github.com/users/hubot/repos\",\n              \"events_url\": \"https://api.github.com/users/hubot/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/hubot/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": true\n            }\n          ],\n          \"requested_reviewers\": [\n            {\n              \"login\": \"other_user\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/other_user_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/other_user\",\n              \"html_url\": \"https://github.com/other_user\",\n              \"followers_url\": \"https://api.github.com/users/other_user/followers\",\n              \"following_url\": \"https://api.github.com/users/other_user/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/other_user/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/other_user/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/other_user/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/other_user/orgs\",\n              \"repos_url\": \"https://api.github.com/users/other_user/repos\",\n              \"events_url\": \"https://api.github.com/users/other_user/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/other_user/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          ],\n          \"requested_teams\": [\n            {\n              \"id\": 1,\n              \"node_id\": \"MDQ6VGVhbTE=\",\n              \"url\": \"https://api.github.com/teams/1\",\n              \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n              \"name\": \"Justice League\",\n              \"slug\": \"justice-league\",\n              \"description\": \"A great team.\",\n              \"privacy\": \"closed\",\n              \"permission\": \"admin\",\n              \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n              \"repositories_url\": \"https://api.github.com/teams/1/repos\"\n            }\n          ],\n          \"head\": {\n            \"label\": \"octocat:new-topic\",\n            \"ref\": \"new-topic\",\n            \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"repo\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"language\": null,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"allow_merge_commit\": true,\n              \"allow_forking\": true,\n              \"forks\": 123,\n              \"open_issues\": 123,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n              },\n              \"watchers\": 123\n            }\n          },\n          \"base\": {\n            \"label\": \"octocat:master\",\n            \"ref\": \"master\",\n            \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"repo\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"language\": null,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"allow_merge_commit\": true,\n              \"forks\": 123,\n              \"open_issues\": 123,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n              },\n              \"watchers\": 123\n            }\n          },\n          \"_links\": {\n            \"self\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"\n            },\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/1347\"\n            },\n            \"issue\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\"\n            },\n            \"comments\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\"\n            },\n            \"review_comments\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\"\n            },\n            \"review_comment\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"\n            },\n            \"commits\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\"\n            },\n            \"statuses\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            }\n          },\n          \"author_association\": \"OWNER\",\n          \"draft\": false,\n          \"merged\": false,\n          \"mergeable\": true,\n          \"rebaseable\": true,\n          \"mergeable_state\": \"clean\",\n          \"merged_by\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"comments\": 10,\n          \"review_comments\": 0,\n          \"maintainer_can_modify\": true,\n          \"commits\": 3,\n          \"additions\": 100,\n          \"deletions\": 3,\n          \"changed_files\": 5\n        }\n      },\n      \"pull-request-review-comment-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\",\n            \"pull_request_review_id\": 42,\n            \"id\": 10,\n            \"node_id\": \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\",\n            \"diff_hunk\": \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\",\n            \"path\": \"file1.txt\",\n            \"position\": 1,\n            \"original_position\": 4,\n            \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"original_commit_id\": \"9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\",\n            \"in_reply_to_id\": 8,\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"body\": \"Great stuff!\",\n            \"created_at\": \"2011-04-14T16:00:49Z\",\n            \"updated_at\": \"2011-04-14T16:00:49Z\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\",\n            \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\",\n            \"author_association\": \"NONE\",\n            \"_links\": {\n              \"self\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\"\n              },\n              \"html\": {\n                \"href\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\"\n              },\n              \"pull_request\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\"\n              }\n            },\n            \"start_line\": 1,\n            \"original_start_line\": 1,\n            \"start_side\": \"RIGHT\",\n            \"line\": 2,\n            \"original_line\": 2,\n            \"side\": \"RIGHT\"\n          }\n        ]\n      },\n      \"pull-request-review-comment-2\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\",\n          \"pull_request_review_id\": 42,\n          \"id\": 10,\n          \"node_id\": \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\",\n          \"diff_hunk\": \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\",\n          \"path\": \"file1.txt\",\n          \"position\": 1,\n          \"original_position\": 4,\n          \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"original_commit_id\": \"9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\",\n          \"in_reply_to_id\": 8,\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Great stuff!\",\n          \"created_at\": \"2011-04-14T16:00:49Z\",\n          \"updated_at\": \"2011-04-14T16:00:49Z\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\",\n          \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\",\n          \"author_association\": \"NONE\",\n          \"_links\": {\n            \"self\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\"\n            },\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\"\n            },\n            \"pull_request\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\"\n            }\n          },\n          \"start_line\": 1,\n          \"original_start_line\": 1,\n          \"start_side\": \"RIGHT\",\n          \"line\": 2,\n          \"original_line\": 2,\n          \"side\": \"RIGHT\"\n        }\n      },\n      \"pull-request-review-comment-example-for-a-multi-line-comment\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\",\n          \"pull_request_review_id\": 42,\n          \"id\": 10,\n          \"node_id\": \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\",\n          \"diff_hunk\": \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\",\n          \"path\": \"file1.txt\",\n          \"position\": 1,\n          \"original_position\": 4,\n          \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"original_commit_id\": \"9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\",\n          \"in_reply_to_id\": 8,\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Great stuff!\",\n          \"created_at\": \"2011-04-14T16:00:49Z\",\n          \"updated_at\": \"2011-04-14T16:00:49Z\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\",\n          \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\",\n          \"author_association\": \"NONE\",\n          \"_links\": {\n            \"self\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\"\n            },\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\"\n            },\n            \"pull_request\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\"\n            }\n          },\n          \"start_line\": 1,\n          \"original_start_line\": 1,\n          \"start_side\": \"RIGHT\",\n          \"line\": 2,\n          \"original_line\": 2,\n          \"side\": \"RIGHT\"\n        }\n      },\n      \"pull-request-review-comment\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\",\n          \"pull_request_review_id\": 42,\n          \"id\": 10,\n          \"node_id\": \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\",\n          \"diff_hunk\": \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\",\n          \"path\": \"file1.txt\",\n          \"position\": 1,\n          \"original_position\": 4,\n          \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"original_commit_id\": \"9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\",\n          \"in_reply_to_id\": 426899381,\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Great stuff!\",\n          \"created_at\": \"2011-04-14T16:00:49Z\",\n          \"updated_at\": \"2011-04-14T16:00:49Z\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\",\n          \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\",\n          \"author_association\": \"NONE\",\n          \"_links\": {\n            \"self\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\"\n            },\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\"\n            },\n            \"pull_request\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\"\n            }\n          },\n          \"start_line\": 1,\n          \"original_start_line\": 1,\n          \"start_side\": \"RIGHT\",\n          \"line\": 2,\n          \"original_line\": 2,\n          \"side\": \"RIGHT\"\n        }\n      },\n      \"diff-entry-items\": {\n        \"value\": [\n          {\n            \"sha\": \"bbcd538c8e72b8c175046e27cc8f907076331401\",\n            \"filename\": \"file1.txt\",\n            \"status\": \"added\",\n            \"additions\": 103,\n            \"deletions\": 21,\n            \"changes\": 124,\n            \"blob_url\": \"https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\",\n            \"raw_url\": \"https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"patch\": \"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"\n          }\n        ]\n      },\n      \"pull-request-merge-result-response-if-merge-was-successful\": {\n        \"value\": {\n          \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"merged\": true,\n          \"message\": \"Pull Request successfully merged\"\n        }\n      },\n      \"simple-pull-request-review-request\": {\n        \"value\": {\n          \"users\": [\n            {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          ],\n          \"teams\": [\n            {\n              \"id\": 1,\n              \"node_id\": \"MDQ6VGVhbTE=\",\n              \"url\": \"https://api.github.com/teams/1\",\n              \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n              \"name\": \"Justice League\",\n              \"slug\": \"justice-league\",\n              \"description\": \"A great team.\",\n              \"privacy\": \"closed\",\n              \"permission\": \"admin\",\n              \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n              \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n              \"parent\": null\n            }\n          ]\n        }\n      },\n      \"pull-request-review-request\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n          \"id\": 1,\n          \"node_id\": \"MDExOlB1bGxSZXF1ZXN0MQ==\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n          \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n          \"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\",\n          \"issue_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\",\n          \"review_comments_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\",\n          \"review_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"number\": 1347,\n          \"state\": \"open\",\n          \"locked\": true,\n          \"title\": \"Amazing new feature\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Please pull these awesome changes in!\",\n          \"labels\": [\n            {\n              \"id\": 208045946,\n              \"node_id\": \"MDU6TGFiZWwyMDgwNDU5NDY=\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n              \"name\": \"bug\",\n              \"description\": \"Something isn't working\",\n              \"color\": \"f29513\",\n              \"default\": true\n            }\n          ],\n          \"milestone\": {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n            \"id\": 1002604,\n            \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n            \"number\": 1,\n            \"state\": \"open\",\n            \"title\": \"v1.0\",\n            \"description\": \"Tracking milestone for version 1.0\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"open_issues\": 4,\n            \"closed_issues\": 8,\n            \"created_at\": \"2011-04-10T20:09:31Z\",\n            \"updated_at\": \"2014-03-03T18:58:10Z\",\n            \"closed_at\": \"2013-02-12T13:22:01Z\",\n            \"due_on\": \"2012-10-09T23:39:01Z\"\n          },\n          \"active_lock_reason\": \"too heated\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:01:12Z\",\n          \"closed_at\": \"2011-01-26T19:01:12Z\",\n          \"merged_at\": \"2011-01-26T19:01:12Z\",\n          \"merge_commit_sha\": \"e5bd3914e2e596debea16f433f57875b5b90bcd6\",\n          \"assignee\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"assignees\": [\n            {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            {\n              \"login\": \"hubot\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/hubot_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/hubot\",\n              \"html_url\": \"https://github.com/hubot\",\n              \"followers_url\": \"https://api.github.com/users/hubot/followers\",\n              \"following_url\": \"https://api.github.com/users/hubot/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/hubot/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/hubot/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/hubot/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/hubot/orgs\",\n              \"repos_url\": \"https://api.github.com/users/hubot/repos\",\n              \"events_url\": \"https://api.github.com/users/hubot/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/hubot/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": true\n            }\n          ],\n          \"requested_reviewers\": [\n            {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            {\n              \"login\": \"hubot\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/hubot_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/hubot\",\n              \"html_url\": \"https://github.com/hubot\",\n              \"followers_url\": \"https://api.github.com/users/hubot/followers\",\n              \"following_url\": \"https://api.github.com/users/hubot/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/hubot/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/hubot/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/hubot/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/hubot/orgs\",\n              \"repos_url\": \"https://api.github.com/users/hubot/repos\",\n              \"events_url\": \"https://api.github.com/users/hubot/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/hubot/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": true\n            },\n            {\n              \"login\": \"other_user\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/other_user_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/other_user\",\n              \"html_url\": \"https://github.com/other_user\",\n              \"followers_url\": \"https://api.github.com/users/other_user/followers\",\n              \"following_url\": \"https://api.github.com/users/other_user/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/other_user/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/other_user/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/other_user/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/other_user/orgs\",\n              \"repos_url\": \"https://api.github.com/users/other_user/repos\",\n              \"events_url\": \"https://api.github.com/users/other_user/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/other_user/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          ],\n          \"requested_teams\": [\n            {\n              \"id\": 1,\n              \"node_id\": \"MDQ6VGVhbTE=\",\n              \"url\": \"https://api.github.com/teams/1\",\n              \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n              \"name\": \"Justice League\",\n              \"slug\": \"justice-league\",\n              \"description\": \"A great team.\",\n              \"privacy\": \"closed\",\n              \"permission\": \"admin\",\n              \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n              \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n              \"parent\": null\n            }\n          ],\n          \"head\": {\n            \"label\": \"octocat:new-topic\",\n            \"ref\": \"new-topic\",\n            \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"repo\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://github.com/licenses/mit\"\n              },\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1\n            }\n          },\n          \"base\": {\n            \"label\": \"octocat:master\",\n            \"ref\": \"master\",\n            \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"repo\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://api.github.com/licenses/mit\"\n              },\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1\n            }\n          },\n          \"_links\": {\n            \"self\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"\n            },\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/1347\"\n            },\n            \"issue\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\"\n            },\n            \"comments\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\"\n            },\n            \"review_comments\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\"\n            },\n            \"review_comment\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"\n            },\n            \"commits\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\"\n            },\n            \"statuses\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\"\n            }\n          },\n          \"author_association\": \"OWNER\",\n          \"draft\": false\n        }\n      },\n      \"pull-request-review-items\": {\n        \"value\": [\n          {\n            \"id\": 80,\n            \"node_id\": \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"body\": \"Here is the body for the review.\",\n            \"state\": \"APPROVED\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\",\n            \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\",\n            \"_links\": {\n              \"html\": {\n                \"href\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\"\n              },\n              \"pull_request\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\"\n              }\n            },\n            \"submitted_at\": \"2019-11-17T17:43:43Z\",\n            \"commit_id\": \"ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\",\n            \"author_association\": \"COLLABORATOR\"\n          }\n        ]\n      },\n      \"pull-request-review\": {\n        \"value\": {\n          \"id\": 80,\n          \"node_id\": \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"This is close to perfect! Please address the suggested inline change.\",\n          \"state\": \"CHANGES_REQUESTED\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\",\n          \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\",\n          \"_links\": {\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\"\n            },\n            \"pull_request\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\"\n            }\n          },\n          \"submitted_at\": \"2019-11-17T17:43:43Z\",\n          \"commit_id\": \"ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\",\n          \"author_association\": \"COLLABORATOR\"\n        }\n      },\n      \"pull-request-review-4\": {\n        \"value\": {\n          \"id\": 80,\n          \"node_id\": \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Here is the body for the review.\",\n          \"state\": \"APPROVED\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\",\n          \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\",\n          \"_links\": {\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\"\n            },\n            \"pull_request\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\"\n            }\n          },\n          \"submitted_at\": \"2019-11-17T17:43:43Z\",\n          \"commit_id\": \"ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\",\n          \"author_association\": \"COLLABORATOR\"\n        }\n      },\n      \"pull-request-review-5\": {\n        \"value\": {\n          \"id\": 80,\n          \"node_id\": \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"This is close to perfect! Please address the suggested inline change. And add more about this.\",\n          \"state\": \"CHANGES_REQUESTED\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\",\n          \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\",\n          \"_links\": {\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\"\n            },\n            \"pull_request\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\"\n            }\n          },\n          \"submitted_at\": \"2019-11-17T17:43:43Z\",\n          \"commit_id\": \"ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\",\n          \"author_association\": \"COLLABORATOR\"\n        }\n      },\n      \"review-comment-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\",\n            \"pull_request_review_id\": 42,\n            \"id\": 10,\n            \"node_id\": \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\",\n            \"diff_hunk\": \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\",\n            \"path\": \"file1.txt\",\n            \"position\": 1,\n            \"original_position\": 4,\n            \"commit_id\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n            \"original_commit_id\": \"9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\",\n            \"in_reply_to_id\": 8,\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"body\": \"Great stuff!\",\n            \"created_at\": \"2011-04-14T16:00:49Z\",\n            \"updated_at\": \"2011-04-14T16:00:49Z\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\",\n            \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\",\n            \"author_association\": \"NONE\",\n            \"_links\": {\n              \"self\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\"\n              },\n              \"html\": {\n                \"href\": \"https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\"\n              },\n              \"pull_request\": {\n                \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1\"\n              }\n            }\n          }\n        ]\n      },\n      \"pull-request-review-3\": {\n        \"value\": {\n          \"id\": 80,\n          \"node_id\": \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\",\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"body\": \"Here is the body for the review.\",\n          \"state\": \"DISMISSED\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\",\n          \"pull_request_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\",\n          \"_links\": {\n            \"html\": {\n              \"href\": \"https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\"\n            },\n            \"pull_request\": {\n              \"href\": \"https://api.github.com/repos/octocat/Hello-World/pulls/12\"\n            }\n          },\n          \"submitted_at\": \"2019-11-17T17:43:43Z\",\n          \"commit_id\": \"ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\",\n          \"author_association\": \"COLLABORATOR\"\n        }\n      },\n      \"content-file\": {\n        \"value\": {\n          \"type\": \"file\",\n          \"encoding\": \"base64\",\n          \"size\": 5362,\n          \"name\": \"README.md\",\n          \"path\": \"README.md\",\n          \"content\": \"encoded content ...\",\n          \"sha\": \"3d21ec53a331a6f037a91c368710b99387d012c1\",\n          \"url\": \"https://api.github.com/repos/octokit/octokit.rb/contents/README.md\",\n          \"git_url\": \"https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1\",\n          \"html_url\": \"https://github.com/octokit/octokit.rb/blob/master/README.md\",\n          \"download_url\": \"https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md\",\n          \"_links\": {\n            \"git\": \"https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1\",\n            \"self\": \"https://api.github.com/repos/octokit/octokit.rb/contents/README.md\",\n            \"html\": \"https://github.com/octokit/octokit.rb/blob/master/README.md\"\n          }\n        }\n      },\n      \"release-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/releases/1\",\n            \"html_url\": \"https://github.com/octocat/Hello-World/releases/v1.0.0\",\n            \"assets_url\": \"https://api.github.com/repos/octocat/Hello-World/releases/1/assets\",\n            \"upload_url\": \"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}\",\n            \"tarball_url\": \"https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0\",\n            \"zipball_url\": \"https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0\",\n            \"id\": 1,\n            \"node_id\": \"MDc6UmVsZWFzZTE=\",\n            \"tag_name\": \"v1.0.0\",\n            \"target_commitish\": \"master\",\n            \"name\": \"v1.0.0\",\n            \"body\": \"Description of the release\",\n            \"draft\": false,\n            \"prerelease\": false,\n            \"created_at\": \"2013-02-27T19:35:32Z\",\n            \"published_at\": \"2013-02-27T19:35:32Z\",\n            \"author\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"assets\": [\n              {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/releases/assets/1\",\n                \"browser_download_url\": \"https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\",\n                \"id\": 1,\n                \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDE=\",\n                \"name\": \"example.zip\",\n                \"label\": \"short description\",\n                \"state\": \"uploaded\",\n                \"content_type\": \"application/zip\",\n                \"size\": 1024,\n                \"download_count\": 42,\n                \"created_at\": \"2013-02-27T19:35:32Z\",\n                \"updated_at\": \"2013-02-27T19:35:32Z\",\n                \"uploader\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                }\n              }\n            ]\n          }\n        ]\n      },\n      \"release\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/releases/1\",\n          \"html_url\": \"https://github.com/octocat/Hello-World/releases/v1.0.0\",\n          \"assets_url\": \"https://api.github.com/repos/octocat/Hello-World/releases/1/assets\",\n          \"upload_url\": \"https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}\",\n          \"tarball_url\": \"https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0\",\n          \"zipball_url\": \"https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0\",\n          \"discussion_url\": \"https://github.com/octocat/Hello-World/discussions/90\",\n          \"id\": 1,\n          \"node_id\": \"MDc6UmVsZWFzZTE=\",\n          \"tag_name\": \"v1.0.0\",\n          \"target_commitish\": \"master\",\n          \"name\": \"v1.0.0\",\n          \"body\": \"Description of the release\",\n          \"draft\": false,\n          \"prerelease\": false,\n          \"created_at\": \"2013-02-27T19:35:32Z\",\n          \"published_at\": \"2013-02-27T19:35:32Z\",\n          \"author\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"assets\": [\n            {\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/releases/assets/1\",\n              \"browser_download_url\": \"https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\",\n              \"id\": 1,\n              \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDE=\",\n              \"name\": \"example.zip\",\n              \"label\": \"short description\",\n              \"state\": \"uploaded\",\n              \"content_type\": \"application/zip\",\n              \"size\": 1024,\n              \"download_count\": 42,\n              \"created_at\": \"2013-02-27T19:35:32Z\",\n              \"updated_at\": \"2013-02-27T19:35:32Z\",\n              \"uploader\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              }\n            }\n          ]\n        }\n      },\n      \"release-asset\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/releases/assets/1\",\n          \"browser_download_url\": \"https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\",\n          \"id\": 1,\n          \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDE=\",\n          \"name\": \"example.zip\",\n          \"label\": \"short description\",\n          \"state\": \"uploaded\",\n          \"content_type\": \"application/zip\",\n          \"size\": 1024,\n          \"download_count\": 42,\n          \"created_at\": \"2013-02-27T19:35:32Z\",\n          \"updated_at\": \"2013-02-27T19:35:32Z\",\n          \"uploader\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"release-asset-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World/releases/assets/1\",\n            \"browser_download_url\": \"https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDE=\",\n            \"name\": \"example.zip\",\n            \"label\": \"short description\",\n            \"state\": \"uploaded\",\n            \"content_type\": \"application/zip\",\n            \"size\": 1024,\n            \"download_count\": 42,\n            \"created_at\": \"2013-02-27T19:35:32Z\",\n            \"updated_at\": \"2013-02-27T19:35:32Z\",\n            \"uploader\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          }\n        ]\n      },\n      \"release-asset-response-for-successful-upload\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/releases/assets/1\",\n          \"browser_download_url\": \"https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\",\n          \"id\": 1,\n          \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDE=\",\n          \"name\": \"example.zip\",\n          \"label\": \"short description\",\n          \"state\": \"uploaded\",\n          \"content_type\": \"application/zip\",\n          \"size\": 1024,\n          \"download_count\": 42,\n          \"created_at\": \"2013-02-27T19:35:32Z\",\n          \"updated_at\": \"2013-02-27T19:35:32Z\",\n          \"uploader\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"simple-user-items-default-response\": {\n        \"summary\": \"Default response\",\n        \"value\": [\n          {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        ]\n      },\n      \"stargazer-items-alternative-response-with-star-creation-timestamps\": {\n        \"summary\": \"Alternative response with star creation timestamps\",\n        \"value\": [\n          {\n            \"starred_at\": \"2011-01-16T19:06:43Z\",\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          }\n        ]\n      },\n      \"code-frequency-stat-items\": {\n        \"value\": [\n          [\n            1302998400,\n            1124,\n            -435\n          ]\n        ]\n      },\n      \"commit-activity-items\": {\n        \"value\": [\n          {\n            \"days\": [\n              0,\n              3,\n              26,\n              20,\n              39,\n              1,\n              0\n            ],\n            \"total\": 89,\n            \"week\": 1336280400\n          }\n        ]\n      },\n      \"contributor-activity-items\": {\n        \"value\": [\n          {\n            \"author\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"total\": 135,\n            \"weeks\": [\n              {\n                \"w\": 1367712000,\n                \"a\": 6898,\n                \"d\": 77,\n                \"c\": 10\n              }\n            ]\n          }\n        ]\n      },\n      \"participation-stats\": {\n        \"value\": {\n          \"all\": [\n            11,\n            21,\n            15,\n            2,\n            8,\n            1,\n            8,\n            23,\n            17,\n            21,\n            11,\n            10,\n            33,\n            91,\n            38,\n            34,\n            22,\n            23,\n            32,\n            3,\n            43,\n            87,\n            71,\n            18,\n            13,\n            5,\n            13,\n            16,\n            66,\n            27,\n            12,\n            45,\n            110,\n            117,\n            13,\n            8,\n            18,\n            9,\n            19,\n            26,\n            39,\n            12,\n            20,\n            31,\n            46,\n            91,\n            45,\n            10,\n            24,\n            9,\n            29,\n            7\n          ],\n          \"owner\": [\n            3,\n            2,\n            3,\n            0,\n            2,\n            0,\n            5,\n            14,\n            7,\n            9,\n            1,\n            5,\n            0,\n            48,\n            19,\n            2,\n            0,\n            1,\n            10,\n            2,\n            23,\n            40,\n            35,\n            8,\n            8,\n            2,\n            10,\n            6,\n            30,\n            0,\n            2,\n            9,\n            53,\n            104,\n            3,\n            3,\n            10,\n            4,\n            7,\n            11,\n            21,\n            4,\n            4,\n            22,\n            26,\n            63,\n            11,\n            2,\n            14,\n            1,\n            10,\n            3\n          ]\n        }\n      },\n      \"code-frequency-stat-items-2\": {\n        \"value\": [\n          [\n            0,\n            0,\n            5\n          ],\n          [\n            0,\n            1,\n            43\n          ],\n          [\n            0,\n            2,\n            21\n          ]\n        ]\n      },\n      \"status\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n          \"avatar_url\": \"https://github.com/images/error/hubot_happy.gif\",\n          \"id\": 1,\n          \"node_id\": \"MDY6U3RhdHVzMQ==\",\n          \"state\": \"success\",\n          \"description\": \"Build has completed successfully\",\n          \"target_url\": \"https://ci.example.com/1000/output\",\n          \"context\": \"continuous-integration/jenkins\",\n          \"created_at\": \"2012-07-20T01:19:13Z\",\n          \"updated_at\": \"2012-07-20T01:19:13Z\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"repository-subscription-response-if-you-subscribe-to-the-repository\": {\n        \"value\": {\n          \"subscribed\": true,\n          \"ignored\": false,\n          \"reason\": null,\n          \"created_at\": \"2012-10-06T21:34:12Z\",\n          \"url\": \"https://api.github.com/repos/octocat/example/subscription\",\n          \"repository_url\": \"https://api.github.com/repos/octocat/example\"\n        }\n      },\n      \"repository-subscription\": {\n        \"value\": {\n          \"subscribed\": true,\n          \"ignored\": false,\n          \"reason\": null,\n          \"created_at\": \"2012-10-06T21:34:12Z\",\n          \"url\": \"https://api.github.com/repos/octocat/example/subscription\",\n          \"repository_url\": \"https://api.github.com/repos/octocat/example\"\n        }\n      },\n      \"tag-items\": {\n        \"value\": [\n          {\n            \"name\": \"v0.1\",\n            \"commit\": {\n              \"sha\": \"c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\",\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\"\n            },\n            \"zipball_url\": \"https://github.com/octocat/Hello-World/zipball/v0.1\",\n            \"tarball_url\": \"https://github.com/octocat/Hello-World/tarball/v0.1\",\n            \"node_id\": \"MDQ6VXNlcjE=\"\n          }\n        ]\n      },\n      \"topic\": {\n        \"value\": {\n          \"names\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ]\n        }\n      },\n      \"minimal-repository\": {\n        \"value\": {\n          \"id\": 1296269,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"name\": \"Hello-World\",\n          \"full_name\": \"octocat/Hello-World\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"private\": false,\n          \"html_url\": \"https://github.com/octocat/Hello-World\",\n          \"description\": \"This your first repo!\",\n          \"fork\": false,\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n          \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n          \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n          \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n          \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n          \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n          \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n          \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n          \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n          \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n          \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n          \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n          \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n          \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n          \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n          \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n          \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n          \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n          \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n          \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n          \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n          \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n          \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n          \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n          \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n          \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n          \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n          \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n          \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n          \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n          \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n          \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n          \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n          \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n          \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n          \"homepage\": \"https://github.com\",\n          \"forks_count\": 9,\n          \"stargazers_count\": 80,\n          \"watchers_count\": 80,\n          \"size\": 108,\n          \"default_branch\": \"master\",\n          \"open_issues_count\": 0,\n          \"is_template\": false,\n          \"topics\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ],\n          \"has_issues\": true,\n          \"has_projects\": true,\n          \"has_wiki\": true,\n          \"has_pages\": false,\n          \"has_downloads\": true,\n          \"archived\": false,\n          \"disabled\": false,\n          \"visibility\": \"public\",\n          \"pushed_at\": \"2011-01-26T19:06:43Z\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:14:43Z\",\n          \"permissions\": {\n            \"admin\": false,\n            \"push\": false,\n            \"pull\": true\n          },\n          \"template_repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World-Template\",\n            \"full_name\": \"octocat/Hello-World-Template\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World-Template\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World-Template\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World-Template.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World-Template.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World-Template.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World-Template\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World-Template\",\n            \"homepage\": \"https://github.com\",\n            \"forks\": 9,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"watchers\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues\": 0,\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"allow_forking\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0\n          }\n        }\n      },\n      \"repository-3\": {\n        \"value\": {\n          \"id\": 1296269,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"name\": \"Hello-World\",\n          \"full_name\": \"octocat/Hello-World\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"private\": false,\n          \"html_url\": \"https://github.com/octocat/Hello-World\",\n          \"description\": \"This your first repo!\",\n          \"fork\": false,\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n          \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n          \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n          \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n          \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n          \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n          \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n          \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n          \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n          \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n          \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n          \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n          \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n          \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n          \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n          \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n          \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n          \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n          \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n          \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n          \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n          \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n          \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n          \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n          \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n          \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n          \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n          \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n          \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n          \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n          \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n          \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n          \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n          \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n          \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n          \"homepage\": \"https://github.com\",\n          \"forks_count\": 9,\n          \"forks\": 9,\n          \"stargazers_count\": 80,\n          \"watchers_count\": 80,\n          \"watchers\": 80,\n          \"size\": 108,\n          \"default_branch\": \"master\",\n          \"open_issues_count\": 0,\n          \"open_issues\": 0,\n          \"is_template\": false,\n          \"topics\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ],\n          \"has_issues\": true,\n          \"has_projects\": true,\n          \"has_wiki\": true,\n          \"has_pages\": false,\n          \"has_downloads\": true,\n          \"archived\": false,\n          \"disabled\": false,\n          \"visibility\": \"public\",\n          \"pushed_at\": \"2011-01-26T19:06:43Z\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:14:43Z\",\n          \"permissions\": {\n            \"admin\": false,\n            \"push\": false,\n            \"pull\": true\n          },\n          \"allow_rebase_merge\": true,\n          \"license\": {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"spdx_id\": \"MIT\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n            \"html_url\": \"https://github.com/licenses/mit\"\n          },\n          \"template_repository\": {\n          }\n        }\n      },\n      \"public-repository-items\": {\n        \"value\": [\n          {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"hooks_url\": \"http://api.github.com/repos/octocat/Hello-World/hooks\"\n          }\n        ]\n      },\n      \"code-search-result-item-paginated\": {\n        \"value\": {\n          \"total_count\": 7,\n          \"incomplete_results\": false,\n          \"items\": [\n            {\n              \"name\": \"classes.js\",\n              \"path\": \"src/attributes/classes.js\",\n              \"sha\": \"d7212f9dee2dcc18f084d7df8f417b80846ded5a\",\n              \"url\": \"https://api.github.com/repositories/167174/contents/src/attributes/classes.js?ref=825ac3773694e0cd23ee74895fd5aeb535b27da4\",\n              \"git_url\": \"https://api.github.com/repositories/167174/git/blobs/d7212f9dee2dcc18f084d7df8f417b80846ded5a\",\n              \"html_url\": \"https://github.com/jquery/jquery/blob/825ac3773694e0cd23ee74895fd5aeb535b27da4/src/attributes/classes.js\",\n              \"repository\": {\n                \"id\": 167174,\n                \"node_id\": \"MDEwOlJlcG9zaXRvcnkxNjcxNzQ=\",\n                \"name\": \"jquery\",\n                \"full_name\": \"jquery/jquery\",\n                \"owner\": {\n                  \"login\": \"jquery\",\n                  \"id\": 70142,\n                  \"node_id\": \"MDQ6VXNlcjcwMTQy\",\n                  \"avatar_url\": \"https://0.gravatar.com/avatar/6906f317a4733f4379b06c32229ef02f?d=https%3A%2F%2Fidenticons.github.com%2Ff426f04f2f9813718fb806b30e0093de.png\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/jquery\",\n                  \"html_url\": \"https://github.com/jquery\",\n                  \"followers_url\": \"https://api.github.com/users/jquery/followers\",\n                  \"following_url\": \"https://api.github.com/users/jquery/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/jquery/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/jquery/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/jquery/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/jquery/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/jquery/repos\",\n                  \"events_url\": \"https://api.github.com/users/jquery/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/jquery/received_events\",\n                  \"type\": \"Organization\",\n                  \"site_admin\": false\n                },\n                \"private\": false,\n                \"html_url\": \"https://github.com/jquery/jquery\",\n                \"description\": \"jQuery JavaScript Library\",\n                \"fork\": false,\n                \"url\": \"https://api.github.com/repos/jquery/jquery\",\n                \"forks_url\": \"https://api.github.com/repos/jquery/jquery/forks\",\n                \"keys_url\": \"https://api.github.com/repos/jquery/jquery/keys{/key_id}\",\n                \"collaborators_url\": \"https://api.github.com/repos/jquery/jquery/collaborators{/collaborator}\",\n                \"teams_url\": \"https://api.github.com/repos/jquery/jquery/teams\",\n                \"hooks_url\": \"https://api.github.com/repos/jquery/jquery/hooks\",\n                \"issue_events_url\": \"https://api.github.com/repos/jquery/jquery/issues/events{/number}\",\n                \"events_url\": \"https://api.github.com/repos/jquery/jquery/events\",\n                \"assignees_url\": \"https://api.github.com/repos/jquery/jquery/assignees{/user}\",\n                \"branches_url\": \"https://api.github.com/repos/jquery/jquery/branches{/branch}\",\n                \"tags_url\": \"https://api.github.com/repos/jquery/jquery/tags\",\n                \"blobs_url\": \"https://api.github.com/repos/jquery/jquery/git/blobs{/sha}\",\n                \"git_tags_url\": \"https://api.github.com/repos/jquery/jquery/git/tags{/sha}\",\n                \"git_refs_url\": \"https://api.github.com/repos/jquery/jquery/git/refs{/sha}\",\n                \"trees_url\": \"https://api.github.com/repos/jquery/jquery/git/trees{/sha}\",\n                \"statuses_url\": \"https://api.github.com/repos/jquery/jquery/statuses/{sha}\",\n                \"languages_url\": \"https://api.github.com/repos/jquery/jquery/languages\",\n                \"stargazers_url\": \"https://api.github.com/repos/jquery/jquery/stargazers\",\n                \"contributors_url\": \"https://api.github.com/repos/jquery/jquery/contributors\",\n                \"subscribers_url\": \"https://api.github.com/repos/jquery/jquery/subscribers\",\n                \"subscription_url\": \"https://api.github.com/repos/jquery/jquery/subscription\",\n                \"commits_url\": \"https://api.github.com/repos/jquery/jquery/commits{/sha}\",\n                \"git_commits_url\": \"https://api.github.com/repos/jquery/jquery/git/commits{/sha}\",\n                \"comments_url\": \"https://api.github.com/repos/jquery/jquery/comments{/number}\",\n                \"issue_comment_url\": \"https://api.github.com/repos/jquery/jquery/issues/comments/{number}\",\n                \"contents_url\": \"https://api.github.com/repos/jquery/jquery/contents/{+path}\",\n                \"compare_url\": \"https://api.github.com/repos/jquery/jquery/compare/{base}...{head}\",\n                \"merges_url\": \"https://api.github.com/repos/jquery/jquery/merges\",\n                \"archive_url\": \"https://api.github.com/repos/jquery/jquery/{archive_format}{/ref}\",\n                \"downloads_url\": \"https://api.github.com/repos/jquery/jquery/downloads\",\n                \"issues_url\": \"https://api.github.com/repos/jquery/jquery/issues{/number}\",\n                \"pulls_url\": \"https://api.github.com/repos/jquery/jquery/pulls{/number}\",\n                \"milestones_url\": \"https://api.github.com/repos/jquery/jquery/milestones{/number}\",\n                \"notifications_url\": \"https://api.github.com/repos/jquery/jquery/notifications{?since,all,participating}\",\n                \"labels_url\": \"https://api.github.com/repos/jquery/jquery/labels{/name}\",\n                \"deployments_url\": \"http://api.github.com/repos/octocat/Hello-World/deployments\",\n                \"releases_url\": \"http://api.github.com/repos/octocat/Hello-World/releases{/id}\"\n              },\n              \"score\": 1\n            }\n          ]\n        }\n      },\n      \"commit-search-result-item-paginated\": {\n        \"value\": {\n          \"total_count\": 1,\n          \"incomplete_results\": false,\n          \"items\": [\n            {\n              \"url\": \"https://api.github.com/repos/octocat/Spoon-Knife/commits/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f\",\n              \"sha\": \"bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f\",\n              \"html_url\": \"https://github.com/octocat/Spoon-Knife/commit/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/commits/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f/comments\",\n              \"commit\": {\n                \"url\": \"https://api.github.com/repos/octocat/Spoon-Knife/git/commits/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f\",\n                \"author\": {\n                  \"date\": \"2014-02-04T14:38:36-08:00\",\n                  \"name\": \"The Octocat\",\n                  \"email\": \"octocat@nowhere.com\"\n                },\n                \"committer\": {\n                  \"date\": \"2014-02-12T15:18:55-08:00\",\n                  \"name\": \"The Octocat\",\n                  \"email\": \"octocat@nowhere.com\"\n                },\n                \"message\": \"Create styles.css and updated README\",\n                \"tree\": {\n                  \"url\": \"https://api.github.com/repos/octocat/Spoon-Knife/git/trees/a639e96f9038797fba6e0469f94a4b0cc459fa68\",\n                  \"sha\": \"a639e96f9038797fba6e0469f94a4b0cc459fa68\"\n                },\n                \"comment_count\": 8\n              },\n              \"author\": {\n                \"login\": \"octocat\",\n                \"id\": 583231,\n                \"node_id\": \"MDQ6VXNlcjU4MzIzMQ==\",\n                \"avatar_url\": \"https://avatars.githubusercontent.com/u/583231?v=3\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"committer\": {\n              },\n              \"parents\": [\n                {\n                  \"url\": \"https://api.github.com/repos/octocat/Spoon-Knife/commits/a30c19e3f13765a3b48829788bc1cb8b4e95cee4\",\n                  \"html_url\": \"https://github.com/octocat/Spoon-Knife/commit/a30c19e3f13765a3b48829788bc1cb8b4e95cee4\",\n                  \"sha\": \"a30c19e3f13765a3b48829788bc1cb8b4e95cee4\"\n                }\n              ],\n              \"repository\": {\n                \"id\": 1300192,\n                \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMzAwMTky\",\n                \"name\": \"Spoon-Knife\",\n                \"full_name\": \"octocat/Spoon-Knife\",\n                \"owner\": {\n                  \"login\": \"octocat\",\n                  \"id\": 583231,\n                  \"node_id\": \"MDQ6VXNlcjU4MzIzMQ==\",\n                  \"avatar_url\": \"https://avatars.githubusercontent.com/u/583231?v=3\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"private\": false,\n                \"html_url\": \"https://github.com/octocat/Spoon-Knife\",\n                \"description\": \"This repo is for demonstration purposes only.\",\n                \"fork\": false,\n                \"url\": \"https://api.github.com/repos/octocat/Spoon-Knife\",\n                \"forks_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/forks\",\n                \"keys_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/keys{/key_id}\",\n                \"collaborators_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/collaborators{/collaborator}\",\n                \"teams_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/teams\",\n                \"hooks_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/hooks\",\n                \"issue_events_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/issues/events{/number}\",\n                \"events_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/events\",\n                \"assignees_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/assignees{/user}\",\n                \"branches_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/branches{/branch}\",\n                \"tags_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/tags\",\n                \"blobs_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/git/blobs{/sha}\",\n                \"git_tags_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/git/tags{/sha}\",\n                \"git_refs_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/git/refs{/sha}\",\n                \"trees_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/git/trees{/sha}\",\n                \"statuses_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/statuses/{sha}\",\n                \"languages_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/languages\",\n                \"stargazers_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/stargazers\",\n                \"contributors_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/contributors\",\n                \"subscribers_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/subscribers\",\n                \"subscription_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/subscription\",\n                \"commits_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/commits{/sha}\",\n                \"git_commits_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/git/commits{/sha}\",\n                \"comments_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/comments{/number}\",\n                \"issue_comment_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/issues/comments{/number}\",\n                \"contents_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/contents/{+path}\",\n                \"compare_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/compare/{base}...{head}\",\n                \"merges_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/merges\",\n                \"archive_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/{archive_format}{/ref}\",\n                \"downloads_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/downloads\",\n                \"issues_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/issues{/number}\",\n                \"pulls_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/pulls{/number}\",\n                \"milestones_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/milestones{/number}\",\n                \"notifications_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/notifications{?since,all,participating}\",\n                \"labels_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/labels{/name}\",\n                \"releases_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/releases{/id}\",\n                \"deployments_url\": \"https://api.github.com/repos/octocat/Spoon-Knife/deployments\"\n              },\n              \"score\": 1,\n              \"node_id\": \"MDQ6VXNlcjU4MzIzMQ==\"\n            }\n          ]\n        }\n      },\n      \"issue-search-result-item-paginated\": {\n        \"value\": {\n          \"total_count\": 280,\n          \"incomplete_results\": false,\n          \"items\": [\n            {\n              \"url\": \"https://api.github.com/repos/batterseapower/pinyin-toolkit/issues/132\",\n              \"repository_url\": \"https://api.github.com/repos/batterseapower/pinyin-toolkit\",\n              \"labels_url\": \"https://api.github.com/repos/batterseapower/pinyin-toolkit/issues/132/labels{/name}\",\n              \"comments_url\": \"https://api.github.com/repos/batterseapower/pinyin-toolkit/issues/132/comments\",\n              \"events_url\": \"https://api.github.com/repos/batterseapower/pinyin-toolkit/issues/132/events\",\n              \"html_url\": \"https://github.com/batterseapower/pinyin-toolkit/issues/132\",\n              \"id\": 35802,\n              \"node_id\": \"MDU6SXNzdWUzNTgwMg==\",\n              \"number\": 132,\n              \"title\": \"Line Number Indexes Beyond 20 Not Displayed\",\n              \"user\": {\n                \"login\": \"Nick3C\",\n                \"id\": 90254,\n                \"node_id\": \"MDQ6VXNlcjkwMjU0\",\n                \"avatar_url\": \"https://secure.gravatar.com/avatar/934442aadfe3b2f4630510de416c5718?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/Nick3C\",\n                \"html_url\": \"https://github.com/Nick3C\",\n                \"followers_url\": \"https://api.github.com/users/Nick3C/followers\",\n                \"following_url\": \"https://api.github.com/users/Nick3C/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/Nick3C/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/Nick3C/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/Nick3C/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/Nick3C/orgs\",\n                \"repos_url\": \"https://api.github.com/users/Nick3C/repos\",\n                \"events_url\": \"https://api.github.com/users/Nick3C/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/Nick3C/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": true\n              },\n              \"labels\": [\n                {\n                  \"id\": 4,\n                  \"node_id\": \"MDU6TGFiZWw0\",\n                  \"url\": \"https://api.github.com/repos/batterseapower/pinyin-toolkit/labels/bug\",\n                  \"name\": \"bug\",\n                  \"color\": \"ff0000\"\n                }\n              ],\n              \"state\": \"open\",\n              \"assignee\": null,\n              \"milestone\": {\n                \"url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1\",\n                \"html_url\": \"https://github.com/octocat/Hello-World/milestones/v1.0\",\n                \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\",\n                \"id\": 1002604,\n                \"node_id\": \"MDk6TWlsZXN0b25lMTAwMjYwNA==\",\n                \"number\": 1,\n                \"state\": \"open\",\n                \"title\": \"v1.0\",\n                \"description\": \"Tracking milestone for version 1.0\",\n                \"creator\": {\n                  \"login\": \"octocat\",\n                  \"id\": 1,\n                  \"node_id\": \"MDQ6VXNlcjE=\",\n                  \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                  \"gravatar_id\": \"\",\n                  \"url\": \"https://api.github.com/users/octocat\",\n                  \"html_url\": \"https://github.com/octocat\",\n                  \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                  \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                  \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                  \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                  \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                  \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                  \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                  \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                  \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                  \"type\": \"User\",\n                  \"site_admin\": false\n                },\n                \"open_issues\": 4,\n                \"closed_issues\": 8,\n                \"created_at\": \"2011-04-10T20:09:31Z\",\n                \"updated_at\": \"2014-03-03T18:58:10Z\",\n                \"closed_at\": \"2013-02-12T13:22:01Z\",\n                \"due_on\": \"2012-10-09T23:39:01Z\"\n              },\n              \"comments\": 15,\n              \"created_at\": \"2009-07-12T20:10:41Z\",\n              \"updated_at\": \"2009-07-19T09:23:43Z\",\n              \"closed_at\": null,\n              \"pull_request\": {\n                \"url\": \"https://api/github.com/repos/octocat/Hello-World/pull/1347\",\n                \"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n                \"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n                \"patch_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"\n              },\n              \"body\": \"...\",\n              \"score\": 1,\n              \"locked\": true,\n              \"author_association\": \"COLLABORATOR\"\n            }\n          ]\n        }\n      },\n      \"label-search-result-item-paginated\": {\n        \"value\": {\n          \"total_count\": 2,\n          \"incomplete_results\": false,\n          \"items\": [\n            {\n              \"id\": 418327088,\n              \"node_id\": \"MDU6TGFiZWw0MTgzMjcwODg=\",\n              \"url\": \"https://api.github.com/repos/octocat/linguist/labels/enhancement\",\n              \"name\": \"enhancement\",\n              \"color\": \"84b6eb\",\n              \"default\": true,\n              \"description\": \"New feature or request.\",\n              \"score\": 1\n            },\n            {\n              \"id\": 418327086,\n              \"node_id\": \"MDU6TGFiZWw0MTgzMjcwODY=\",\n              \"url\": \"https://api.github.com/repos/octocat/linguist/labels/bug\",\n              \"name\": \"bug\",\n              \"color\": \"ee0701\",\n              \"default\": true,\n              \"description\": \"Something isn't working.\",\n              \"score\": 1\n            }\n          ]\n        }\n      },\n      \"repo-search-result-item-paginated\": {\n        \"value\": {\n          \"total_count\": 40,\n          \"incomplete_results\": false,\n          \"items\": [\n            {\n              \"id\": 3081286,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkzMDgxMjg2\",\n              \"name\": \"Tetris\",\n              \"full_name\": \"dtrupenn/Tetris\",\n              \"owner\": {\n                \"login\": \"dtrupenn\",\n                \"id\": 872147,\n                \"node_id\": \"MDQ6VXNlcjg3MjE0Nw==\",\n                \"avatar_url\": \"https://secure.gravatar.com/avatar/e7956084e75f239de85d3a31bc172ace?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/dtrupenn\",\n                \"received_events_url\": \"https://api.github.com/users/dtrupenn/received_events\",\n                \"type\": \"User\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"site_admin\": true\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/dtrupenn/Tetris\",\n              \"description\": \"A C implementation of Tetris using Pennsim through LC4\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/dtrupenn/Tetris\",\n              \"created_at\": \"2012-01-01T00:31:50Z\",\n              \"updated_at\": \"2013-01-05T17:58:47Z\",\n              \"pushed_at\": \"2012-01-01T00:37:02Z\",\n              \"homepage\": \"https://github.com\",\n              \"size\": 524,\n              \"stargazers_count\": 1,\n              \"watchers_count\": 1,\n              \"language\": \"Assembly\",\n              \"forks_count\": 0,\n              \"open_issues_count\": 0,\n              \"master_branch\": \"master\",\n              \"default_branch\": \"master\",\n              \"score\": 1,\n              \"archive_url\": \"https://api.github.com/repos/dtrupenn/Tetris/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/dtrupenn/Tetris/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/dtrupenn/Tetris/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/dtrupenn/Tetris/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/dtrupenn/Tetris/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/dtrupenn/Tetris/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/dtrupenn/Tetris/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/dtrupenn/Tetris/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/dtrupenn/Tetris/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/dtrupenn/Tetris/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/dtrupenn/Tetris/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/dtrupenn/Tetris/downloads\",\n              \"events_url\": \"https://api.github.com/repos/dtrupenn/Tetris/events\",\n              \"forks_url\": \"https://api.github.com/repos/dtrupenn/Tetris/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/dtrupenn/Tetris/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/dtrupenn/Tetris/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/dtrupenn/Tetris/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/dtrupenn/Tetris.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/dtrupenn/Tetris/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/dtrupenn/Tetris/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/dtrupenn/Tetris/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/dtrupenn/Tetris/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/dtrupenn/Tetris/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/dtrupenn/Tetris/languages\",\n              \"merges_url\": \"https://api.github.com/repos/dtrupenn/Tetris/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/dtrupenn/Tetris/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/dtrupenn/Tetris/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/dtrupenn/Tetris/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/dtrupenn/Tetris/releases{/id}\",\n              \"ssh_url\": \"git@github.com:dtrupenn/Tetris.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/dtrupenn/Tetris/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/dtrupenn/Tetris/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/dtrupenn/Tetris/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/dtrupenn/Tetris/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/dtrupenn/Tetris/tags\",\n              \"teams_url\": \"https://api.github.com/repos/dtrupenn/Tetris/teams\",\n              \"trees_url\": \"https://api.github.com/repos/dtrupenn/Tetris/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/dtrupenn/Tetris.git\",\n              \"mirror_url\": \"git:git.example.com/dtrupenn/Tetris\",\n              \"hooks_url\": \"https://api.github.com/repos/dtrupenn/Tetris/hooks\",\n              \"svn_url\": \"https://svn.github.com/dtrupenn/Tetris\",\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1,\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_pages\": true,\n              \"has_wiki\": true,\n              \"has_downloads\": true,\n              \"archived\": true,\n              \"disabled\": true,\n              \"visibility\": \"private\",\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://api.github.com/licenses/mit\"\n              }\n            }\n          ]\n        }\n      },\n      \"topic-search-result-item-paginated\": {\n        \"value\": {\n          \"total_count\": 6,\n          \"incomplete_results\": false,\n          \"items\": [\n            {\n              \"name\": \"ruby\",\n              \"display_name\": \"Ruby\",\n              \"short_description\": \"Ruby is a scripting language designed for simplified object-oriented programming.\",\n              \"description\": \"Ruby was developed by Yukihiro \\\"Matz\\\" Matsumoto in 1995 with the intent of having an easily readable programming language. It is integrated with the Rails framework to create dynamic web-applications. Ruby's syntax is similar to that of Perl and Python.\",\n              \"created_by\": \"Yukihiro Matsumoto\",\n              \"released\": \"December 21, 1995\",\n              \"created_at\": \"2016-11-28T22:03:59Z\",\n              \"updated_at\": \"2017-10-30T18:16:32Z\",\n              \"featured\": true,\n              \"curated\": true,\n              \"score\": 1\n            },\n            {\n              \"name\": \"rails\",\n              \"display_name\": \"Rails\",\n              \"short_description\": \"Ruby on Rails (Rails) is a web application framework written in Ruby.\",\n              \"description\": \"Ruby on Rails (Rails) is a web application framework written in Ruby. It is meant to help simplify the building of complex websites.\",\n              \"created_by\": \"David Heinemeier Hansson\",\n              \"released\": \"December 13 2005\",\n              \"created_at\": \"2016-12-09T17:03:50Z\",\n              \"updated_at\": \"2017-10-30T16:20:19Z\",\n              \"featured\": true,\n              \"curated\": true,\n              \"score\": 1\n            },\n            {\n              \"name\": \"python\",\n              \"display_name\": \"Python\",\n              \"short_description\": \"Python is a dynamically typed programming language.\",\n              \"description\": \"Python is a dynamically typed programming language designed by Guido Van Rossum. Much like the programming language Ruby, Python was designed to be easily read by programmers. Because of its large following and many libraries, Python can be implemented and used to do anything from webpages to scientific research.\",\n              \"created_by\": \"Guido van Rossum\",\n              \"released\": \"February 20, 1991\",\n              \"created_at\": \"2016-12-07T00:07:02Z\",\n              \"updated_at\": \"2017-10-27T22:45:43Z\",\n              \"featured\": true,\n              \"curated\": true,\n              \"score\": 1\n            },\n            {\n              \"name\": \"jekyll\",\n              \"display_name\": \"Jekyll\",\n              \"short_description\": \"Jekyll is a simple, blog-aware static site generator.\",\n              \"description\": \"Jekyll is a blog-aware, site generator written in Ruby. It takes raw text files, runs it through a renderer and produces a publishable static website.\",\n              \"created_by\": \"Tom Preston-Werner\",\n              \"released\": \"2008\",\n              \"created_at\": \"2016-12-16T21:53:08Z\",\n              \"updated_at\": \"2017-10-27T19:00:24Z\",\n              \"featured\": true,\n              \"curated\": true,\n              \"score\": 1\n            },\n            {\n              \"name\": \"sass\",\n              \"display_name\": \"Sass\",\n              \"short_description\": \"Sass is a stable extension to classic CSS.\",\n              \"description\": \"Sass is a stylesheet language with a main implementation in Ruby. It is an extension of CSS that makes improvements to the old stylesheet format, such as being able to declare variables and using a cleaner nesting syntax.\",\n              \"created_by\": \"Hampton Catlin, Natalie Weizenbaum, Chris Eppstein\",\n              \"released\": \"November 28, 2006\",\n              \"created_at\": \"2016-12-16T21:53:45Z\",\n              \"updated_at\": \"2018-01-16T16:30:40Z\",\n              \"featured\": true,\n              \"curated\": true,\n              \"score\": 1\n            },\n            {\n              \"name\": \"homebrew\",\n              \"display_name\": \"Homebrew\",\n              \"short_description\": \"Homebrew is a package manager for macOS.\",\n              \"description\": \"Homebrew is a package manager for Apple's macOS operating system. It simplifies the installation of software and is popular in the Ruby on Rails community.\",\n              \"created_by\": \"Max Howell\",\n              \"released\": \"2009\",\n              \"created_at\": \"2016-12-17T20:30:44Z\",\n              \"updated_at\": \"2018-02-06T16:14:56Z\",\n              \"featured\": true,\n              \"curated\": true,\n              \"score\": 1\n            }\n          ]\n        }\n      },\n      \"user-search-result-item-paginated\": {\n        \"value\": {\n          \"total_count\": 12,\n          \"incomplete_results\": false,\n          \"items\": [\n            {\n              \"login\": \"mojombo\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://secure.gravatar.com/avatar/25c7c18223fb42a4c6ae1c8db6f50f9b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/mojombo\",\n              \"html_url\": \"https://github.com/mojombo\",\n              \"followers_url\": \"https://api.github.com/users/mojombo/followers\",\n              \"subscriptions_url\": \"https://api.github.com/users/mojombo/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/mojombo/orgs\",\n              \"repos_url\": \"https://api.github.com/users/mojombo/repos\",\n              \"received_events_url\": \"https://api.github.com/users/mojombo/received_events\",\n              \"type\": \"User\",\n              \"score\": 1,\n              \"following_url\": \"https://api.github.com/users/mojombo/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/mojombo/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/mojombo/starred{/owner}{/repo}\",\n              \"events_url\": \"https://api.github.com/users/mojombo/events{/privacy}\",\n              \"site_admin\": true\n            }\n          ]\n        }\n      },\n      \"configuration-status\": {\n        \"value\": {\n          \"status\": \"running\",\n          \"progress\": [\n            {\n              \"status\": \"DONE\",\n              \"key\": \"Appliance core components\"\n            },\n            {\n              \"status\": \"DONE\",\n              \"key\": \"GitHub utilities\"\n            },\n            {\n              \"status\": \"DONE\",\n              \"key\": \"GitHub applications\"\n            },\n            {\n              \"status\": \"CONFIGURING\",\n              \"key\": \"GitHub services\"\n            },\n            {\n              \"status\": \"PENDING\",\n              \"key\": \"Reloading appliance services\"\n            }\n          ]\n        }\n      },\n      \"maintenance-status\": {\n        \"value\": {\n          \"status\": \"scheduled\",\n          \"scheduled_time\": \"Tuesday, January 22 at 15:34 -0800\",\n          \"connection_services\": [\n            {\n              \"name\": \"git operations\",\n              \"number\": 0\n            },\n            {\n              \"name\": \"mysql queries\",\n              \"number\": 233\n            },\n            {\n              \"name\": \"resque jobs\",\n              \"number\": 54\n            }\n          ]\n        }\n      },\n      \"enterprise-settings\": {\n        \"value\": {\n          \"enterprise\": {\n            \"private_mode\": false,\n            \"public_pages\": false,\n            \"subdomain_isolation\": true,\n            \"signup_enabled\": false,\n            \"github_hostname\": \"ghe.local\",\n            \"identicons_host\": \"dotcom\",\n            \"http_proxy\": null,\n            \"auth_mode\": \"default\",\n            \"expire_sessions\": false,\n            \"admin_password\": null,\n            \"configuration_id\": 1401777404,\n            \"configuration_run_count\": 4,\n            \"avatar\": {\n              \"enabled\": false,\n              \"uri\": \"\"\n            },\n            \"customer\": {\n              \"name\": \"GitHub\",\n              \"email\": \"stannis@themannis.biz\",\n              \"uuid\": \"af6cac80-e4e1-012e-d822-1231380e52e9\",\n              \"secret_key_data\": \"-----BEGIN PGP PRIVATE KEY BLOCK-----\\nVersion: GnuPG v1.4.10 (GNU/Linux)\\n\\nlQcYBE5TCgsBEACk4yHpUcapplebaumBMXYMiLF+nCQ0lxpx...\\n-----END PGP PRIVATE KEY BLOCK-----\\n\",\n              \"public_key_data\": \"-----BEGIN PGP PUBLIC KEY BLOCK-----\\nVersion: GnuPG v1.4.10 (GNU/Linux)\\n\\nmI0ETqzZYgEEALSe6snowdenXyqvLfSQ34HWD6C7....\\n-----END PGP PUBLIC KEY BLOCK-----\\n\"\n            },\n            \"license\": {\n              \"seats\": 0,\n              \"evaluation\": false,\n              \"perpetual\": false,\n              \"unlimited_seating\": true,\n              \"support_key\": \"ssh-rsa AAAAB3N....\",\n              \"ssh_allowed\": true,\n              \"cluster_support\": false,\n              \"expire_at\": \"2016-04-27T00:00:00-07:00\"\n            },\n            \"github_ssl\": {\n              \"enabled\": false,\n              \"cert\": null,\n              \"key\": null\n            },\n            \"ldap\": {\n              \"host\": null,\n              \"port\": 0,\n              \"base\": [\n\n              ],\n              \"uid\": null,\n              \"bind_dn\": null,\n              \"password\": null,\n              \"method\": \"Plain\",\n              \"search_strategy\": \"detect\",\n              \"user_groups\": [\n\n              ],\n              \"admin_group\": null,\n              \"virtual_attribute_enabled\": false,\n              \"recursive_group_search\": false,\n              \"posix_support\": true,\n              \"user_sync_emails\": false,\n              \"user_sync_keys\": false,\n              \"user_sync_interval\": 4,\n              \"team_sync_interval\": 4,\n              \"sync_enabled\": false,\n              \"reconciliation\": {\n                \"user\": null,\n                \"org\": null\n              },\n              \"profile\": {\n                \"uid\": \"uid\",\n                \"name\": null,\n                \"mail\": null,\n                \"key\": null\n              }\n            },\n            \"cas\": {\n              \"url\": null\n            },\n            \"saml\": {\n              \"sso_url\": null,\n              \"certificate\": null,\n              \"certificate_path\": null,\n              \"issuer\": null,\n              \"idp_initiated_sso\": false,\n              \"disable_admin_demote\": false\n            },\n            \"github_oauth\": {\n              \"client_id\": \"12313412\",\n              \"client_secret\": \"kj123131132\",\n              \"organization_name\": \"Homestar Runners\",\n              \"organization_team\": \"homestarrunners/characters\"\n            },\n            \"smtp\": {\n              \"enabled\": true,\n              \"address\": \"smtp.example.com\",\n              \"authentication\": \"plain\",\n              \"port\": \"1234\",\n              \"domain\": \"blah\",\n              \"username\": \"foo\",\n              \"user_name\": \"mr_foo\",\n              \"enable_starttls_auto\": true,\n              \"password\": \"bar\",\n              \"discard-to-noreply-address\": true,\n              \"support_address\": \"enterprise@github.com\",\n              \"support_address_type\": \"email\",\n              \"noreply_address\": \"noreply@github.com\"\n            },\n            \"ntp\": {\n              \"primary_server\": \"0.pool.ntp.org\",\n              \"secondary_server\": \"1.pool.ntp.org\"\n            },\n            \"timezone\": null,\n            \"snmp\": {\n              \"enabled\": false,\n              \"community\": \"\"\n            },\n            \"syslog\": {\n              \"enabled\": false,\n              \"server\": null,\n              \"protocol_name\": \"udp\"\n            },\n            \"assets\": null,\n            \"pages\": {\n              \"enabled\": true\n            },\n            \"collectd\": {\n              \"enabled\": false,\n              \"server\": null,\n              \"port\": 0,\n              \"encryption\": null,\n              \"username\": null,\n              \"password\": null\n            },\n            \"mapping\": {\n              \"enabled\": true,\n              \"tileserver\": null,\n              \"basemap\": \"company.map-qsz2zrvs\",\n              \"token\": null\n            },\n            \"load_balancer\": null\n          },\n          \"run_list\": [\n            \"recipe[enterprise-configure]\"\n          ]\n        }\n      },\n      \"ssh-key-items\": {\n        \"value\": [\n          {\n            \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAAB...\",\n            \"pretty-print\": \"ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64\"\n          },\n          {\n            \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAAB...\",\n            \"pretty-print\": \"ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64\"\n          },\n          {\n            \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAAB...\",\n            \"pretty-print\": \"ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64\"\n          }\n        ]\n      },\n      \"team-repository-alternative-response-with-extra-repository-information\": {\n        \"value\": {\n          \"id\": 1296269,\n          \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n          \"name\": \"Hello-World\",\n          \"full_name\": \"octocat/Hello-World\",\n          \"owner\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"private\": false,\n          \"html_url\": \"https://github.com/octocat/Hello-World\",\n          \"description\": \"This your first repo!\",\n          \"fork\": false,\n          \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n          \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n          \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n          \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n          \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n          \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n          \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n          \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n          \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n          \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n          \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n          \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n          \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n          \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n          \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n          \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n          \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n          \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n          \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n          \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n          \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n          \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n          \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n          \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n          \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n          \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n          \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n          \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n          \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n          \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n          \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n          \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n          \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n          \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n          \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n          \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n          \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n          \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n          \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n          \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n          \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n          \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n          \"homepage\": \"https://github.com\",\n          \"forks_count\": 9,\n          \"stargazers_count\": 80,\n          \"watchers_count\": 80,\n          \"size\": 108,\n          \"default_branch\": \"master\",\n          \"open_issues_count\": 0,\n          \"is_template\": false,\n          \"topics\": [\n            \"octocat\",\n            \"atom\",\n            \"electron\",\n            \"api\"\n          ],\n          \"has_issues\": true,\n          \"has_projects\": true,\n          \"has_wiki\": true,\n          \"has_pages\": false,\n          \"has_downloads\": true,\n          \"archived\": false,\n          \"disabled\": false,\n          \"visibility\": \"public\",\n          \"pushed_at\": \"2011-01-26T19:06:43Z\",\n          \"created_at\": \"2011-01-26T19:01:12Z\",\n          \"updated_at\": \"2011-01-26T19:14:43Z\",\n          \"permissions\": {\n            \"admin\": false,\n            \"maintain\": false,\n            \"push\": false,\n            \"triage\": false,\n            \"pull\": true\n          },\n          \"allow_rebase_merge\": true,\n          \"template_repository\": {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World-Template\",\n            \"full_name\": \"octocat/Hello-World-Template\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World-Template\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World-Template\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World-Template.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World-Template.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World-Template.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World-Template\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World-Template/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World-Template\",\n            \"homepage\": \"https://github.com\",\n            \"forks\": 9,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"watchers\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues\": 0,\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://api.github.com/licenses/mit\"\n            },\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"pull\": true,\n              \"triage\": false,\n              \"push\": false,\n              \"maintain\": false,\n              \"admin\": false\n            },\n            \"allow_rebase_merge\": true,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0\n          },\n          \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n          \"allow_squash_merge\": true,\n          \"delete_branch_on_merge\": true,\n          \"allow_merge_commit\": true,\n          \"subscribers_count\": 42,\n          \"network_count\": 0,\n          \"license\": {\n            \"key\": \"mit\",\n            \"name\": \"MIT License\",\n            \"url\": \"https://api.github.com/licenses/mit\",\n            \"spdx_id\": \"MIT\",\n            \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n            \"html_url\": \"https://api.github.com/licenses/mit\"\n          },\n          \"forks\": 1,\n          \"open_issues\": 1,\n          \"watchers\": 1\n        }\n      },\n      \"private-user-response-with-public-and-private-profile-information\": {\n        \"summary\": \"Response with public and private profile information\",\n        \"value\": {\n          \"login\": \"octocat\",\n          \"id\": 1,\n          \"node_id\": \"MDQ6VXNlcjE=\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/octocat\",\n          \"html_url\": \"https://github.com/octocat\",\n          \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n          \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n          \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false,\n          \"name\": \"monalisa octocat\",\n          \"company\": \"GitHub\",\n          \"blog\": \"https://github.com/blog\",\n          \"location\": \"San Francisco\",\n          \"email\": \"octocat@github.com\",\n          \"hireable\": false,\n          \"bio\": \"There once was...\",\n          \"public_repos\": 2,\n          \"public_gists\": 1,\n          \"followers\": 20,\n          \"following\": 0,\n          \"created_at\": \"2008-01-14T04:33:35Z\",\n          \"updated_at\": \"2008-01-14T04:33:35Z\",\n          \"private_gists\": 81,\n          \"total_private_repos\": 100,\n          \"owned_private_repos\": 100,\n          \"disk_usage\": 10000,\n          \"collaborators\": 8,\n          \"two_factor_authentication\": true,\n          \"plan\": {\n            \"name\": \"Medium\",\n            \"space\": 400,\n            \"private_repos\": 20,\n            \"collaborators\": 0\n          }\n        }\n      },\n      \"private-user-response-with-public-profile-information\": {\n        \"summary\": \"Response with public profile information\",\n        \"value\": {\n          \"login\": \"octocat\",\n          \"id\": 1,\n          \"node_id\": \"MDQ6VXNlcjE=\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/octocat\",\n          \"html_url\": \"https://github.com/octocat\",\n          \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n          \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n          \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false,\n          \"name\": \"monalisa octocat\",\n          \"company\": \"GitHub\",\n          \"blog\": \"https://github.com/blog\",\n          \"location\": \"San Francisco\",\n          \"email\": \"octocat@github.com\",\n          \"hireable\": false,\n          \"bio\": \"There once was...\",\n          \"public_repos\": 2,\n          \"public_gists\": 1,\n          \"followers\": 20,\n          \"following\": 0,\n          \"created_at\": \"2008-01-14T04:33:35Z\",\n          \"updated_at\": \"2008-01-14T04:33:35Z\"\n        }\n      },\n      \"private-user\": {\n        \"value\": {\n          \"login\": \"octocat\",\n          \"id\": 1,\n          \"node_id\": \"MDQ6VXNlcjE=\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/octocat\",\n          \"html_url\": \"https://github.com/octocat\",\n          \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n          \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n          \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false,\n          \"name\": \"monalisa octocat\",\n          \"company\": \"GitHub\",\n          \"blog\": \"https://github.com/blog\",\n          \"location\": \"San Francisco\",\n          \"email\": \"octocat@github.com\",\n          \"hireable\": false,\n          \"bio\": \"There once was...\",\n          \"public_repos\": 2,\n          \"public_gists\": 1,\n          \"followers\": 20,\n          \"following\": 0,\n          \"created_at\": \"2008-01-14T04:33:35Z\",\n          \"updated_at\": \"2008-01-14T04:33:35Z\",\n          \"private_gists\": 81,\n          \"total_private_repos\": 100,\n          \"owned_private_repos\": 100,\n          \"disk_usage\": 10000,\n          \"collaborators\": 8,\n          \"two_factor_authentication\": true,\n          \"plan\": {\n            \"name\": \"Medium\",\n            \"space\": 400,\n            \"private_repos\": 20,\n            \"collaborators\": 0\n          }\n        }\n      },\n      \"email-items-2\": {\n        \"value\": [\n          {\n            \"email\": \"octocat@github.com\",\n            \"verified\": true,\n            \"primary\": true,\n            \"visibility\": \"public\"\n          }\n        ]\n      },\n      \"email-items\": {\n        \"value\": [\n          {\n            \"email\": \"octocat@octocat.org\",\n            \"primary\": false,\n            \"verified\": false,\n            \"visibility\": \"public\"\n          },\n          {\n            \"email\": \"octocat@github.com\",\n            \"primary\": false,\n            \"verified\": false,\n            \"visibility\": null\n          },\n          {\n            \"email\": \"mona@github.com\",\n            \"primary\": false,\n            \"verified\": false,\n            \"visibility\": null\n          }\n        ]\n      },\n      \"gpg-key-items\": {\n        \"value\": [\n          {\n            \"id\": 3,\n            \"primary_key_id\": 2,\n            \"key_id\": \"3262EFF25BA0D270\",\n            \"public_key\": \"xsBNBFayYZ...\",\n            \"emails\": [\n              {\n                \"email\": \"mastahyeti@users.noreply.github.com\",\n                \"verified\": true\n              }\n            ],\n            \"subkeys\": [\n              {\n                \"id\": 4,\n                \"primary_key_id\": 3,\n                \"key_id\": \"4A595D4C72EE49C7\",\n                \"public_key\": \"zsBNBFayYZ...\",\n                \"emails\": [\n\n                ],\n                \"subkeys\": [\n\n                ],\n                \"can_sign\": false,\n                \"can_encrypt_comms\": true,\n                \"can_encrypt_storage\": true,\n                \"can_certify\": false,\n                \"created_at\": \"2016-03-24T11:31:04-06:00\",\n                \"expires_at\": \"2016-03-24T11:31:04-07:00\"\n              }\n            ],\n            \"can_sign\": true,\n            \"can_encrypt_comms\": false,\n            \"can_encrypt_storage\": false,\n            \"can_certify\": true,\n            \"created_at\": \"2016-03-24T11:31:04-06:00\",\n            \"expires_at\": \"2016-03-24T11:31:04-07:00\",\n            \"raw_key\": \"string\"\n          }\n        ]\n      },\n      \"gpg-key\": {\n        \"value\": {\n          \"id\": 3,\n          \"primary_key_id\": 2,\n          \"key_id\": \"3262EFF25BA0D270\",\n          \"public_key\": \"xsBNBFayYZ...\",\n          \"emails\": [\n            {\n              \"email\": \"mastahyeti@users.noreply.github.com\",\n              \"verified\": true\n            }\n          ],\n          \"subkeys\": [\n            {\n              \"id\": 4,\n              \"primary_key_id\": 3,\n              \"key_id\": \"4A595D4C72EE49C7\",\n              \"public_key\": \"zsBNBFayYZ...\",\n              \"emails\": [\n\n              ],\n              \"subkeys\": [\n\n              ],\n              \"can_sign\": false,\n              \"can_encrypt_comms\": true,\n              \"can_encrypt_storage\": true,\n              \"can_certify\": false,\n              \"created_at\": \"2016-03-24T11:31:04-06:00\",\n              \"expires_at\": \"2016-03-24T11:31:04-07:00\"\n            }\n          ],\n          \"can_sign\": true,\n          \"can_encrypt_comms\": false,\n          \"can_encrypt_storage\": false,\n          \"can_certify\": true,\n          \"created_at\": \"2016-03-24T11:31:04-06:00\",\n          \"expires_at\": \"2016-03-24T11:31:04-07:00\",\n          \"raw_key\": \"\\\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\\\nVersion: GnuPG v2\\\\n\\\\nmQENBFayYZ0BCAC4hScoJXXpyR+MXGcrBxElqw3FzCVvkViuyeko+Jp76QJhg8kr\\\\nucRTxbnOoHfda/FmilEa/wxf9ch5/PSrrL26FxEoPHhJolp8fnIDLQeITn94NYdB\\\\nZtnnEKslpPrG97qSUWIchvyqCPtvOb8+8fWvGx9K/ZWcEEdh1X8+WFR2jMENMeoX\\\\nwxHWQoPnS7LpX/85/M7VUcJxvDVfv+eHsnQupmE5bGarKNih0oMe3LbdN3qA5PTz\\\\nSCm6Iudar1VsQ+xTz08ymL7t4pnEtLguQ7EyatFHCjxNblv5RzxoL0tDgN3HqoDz\\\\nc7TEA+q4RtDQl9amcvQ95emnXmZ974u7UkYdABEBAAG0HlNvbWUgVXNlciA8c29t\\\\nZXVzZXJAZ21haWwuY29tPokBOAQTAQIAIgUCVrJhnQIbAwYLCQgHAwIGFQgCCQoL\\\\nBBYCAwECHgECF4AACgkQMmLv8lug0nAViQgArWjI55+7p48URr2z9Jvak+yrBTx1\\\\nzkufltQAnHTJkq+Kl9dySSmTnOop8o3rE4++IOpYV5Y36PkKf9EZMk4n1RQiDPKE\\\\nAFtRVTkRaoWzOir9KQXJPfhKrl01j/QzY+utfiMvUoBJZ9ybq8Pa885SljW9lbaX\\\\nIYw+hl8ZdJ2KStvGrEyfQvRyq3aN5c9TV//4BdGnwx7Qabq/U+G18lizG6f/yq15\\\\ned7t0KELaCfeKPvytp4VE9/z/Ksah/h3+Qilx07/oG2Ae5kC1bEC9coD/ogPUhbv\\\\nb2bsBIoY9E9YwsLoif2lU+o1t76zLgUktuNscRRUKobW028H1zuFS/XQhrkBDQRW\\\\nsmGdAQgApnyyv3i144OLYy0O4UKQxd3e10Y3WpDwfnGIBefAI1m7RxnUxBag/DsU\\\\n7gi9qLEC4VHSfq4eiNfr1LJOyCL2edTgCWFgBhVjbXjZe6YAOrAnhxwCErnN0Y7N\\\\n6s8wVh9fObSOyf8ZE6G7JeKpcq9Q6gd/KxagfD48a1v+fyRHpyQc6J9pUEmtrDJ7\\\\nBjmsd2VWzLBvNWdHyxDNtZweIaqIO9VUYYpr1mtTliNBOZLUelmgrt7HBRcJpWMA\\\\nS8muVVbuP5MK0trLBq/JB8qUH3zRzB/PhMgzmkIfjEK1VYDWm4E8DYyTWEJcHqkb\\\\neqFsNjrIlwPaA122BWC6gUOPwwH+oQARAQABiQEfBBgBAgAJBQJWsmGdAhsMAAoJ\\\\nEDJi7/JboNJwAyAIALd4xcdmGbZD98gScJzqwzkOMcO8zFHqHNvJ42xIFvGny7c0\\\\n1Rx7iyrdypOby5AxE+viQcjG4rpLZW/xKYBNGrCfDyQO7511I0v8x20EICMlMfD/\\\\nNrWQCzesEPcUlKTP07d+sFyP8AyseOidbzY/92CpskTgdSBjY/ntLSaoknl/fjJE\\\\nQM8OkPqU7IraO1Jzzdnm20d5PZL9+PIwIWdSTedU/vBMTJyNcoqvSfKf1wNC66XP\\\\nhqfYgXJE564AdWZKA3C0IyCqiv+LHwxLnUHio1a4/r91C8KPzxs6tGxRDjXLd7ms\\\\nuYFGWymiUGOE/giHlcxdYcHzwLnPDliMQOLiTkK5AQ0EVuxMygEIAOD+bW1cDTmE\\\\nBxh5JECoqeHuwgl6DlLhnubWPkQ4ZeRzBRAsFcEJQlwlJjrzFDicL+lnm6Qq4tt0\\\\n560TwHdf15/AKTZIZu7H25axvGNzgeaUkJEJdYAq9zTKWwX7wKyzBszi485nQg97\\\\nMfAqwhMpDW0Qqf8+7Ug+WEmfBSGv9uL3aQC6WEeIsHfri0n0n8v4XgwhfShXguxO\\\\nCsOztEsuW7WWKW9P4TngKKv4lCHdPlV6FwxeMzODBJvc2fkHVHnqc0PqszJ5xcF8\\\\n6gZCpMM027SbpeYWCAD5zwJyYP9ntfO1p2HjnQ1dZaP9FeNcO7uIV1Lnd1eGCu6I\\\\nsrVp5k1f3isAEQEAAYkCPgQYAQIACQUCVuxMygIbAgEpCRAyYu/yW6DScMBdIAQZ\\\\nAQIABgUCVuxMygAKCRCKohN4dhq2b4tcCACHxmOHVXNpu47OvUGYQydLgMACUlXN\\\\nlj+HfE0VReqShxdDmpasAY9IRpuMB2RsGK8GbNP+4SlOlAiPf5SMhS7nZNkNDgQQ\\\\naZ3HFpgrFmFwmE10BKT4iQtoxELLM57z0qGOAfTsEjWFQa4sF+6IHAQR/ptkdkkI\\\\nBUEXiMnAwVwBysLIJiLO8qdjB6qp52QkT074JVrwywT/P+DkMfC2k4r/AfEbf6eF\\\\ndmPDuPk6KD87+hJZsSa5MaMUBQVvRO/mgEkhJRITVu58eWGaBOcQJ8gqurhCqM5P\\\\nDfUA4TJ7wiqM6sS764vV1rOioTTXkszzhClQqET7hPVnVQjenYgv0EZHNyQH/1f1\\\\n/CYqvV1vFjM9vJjMbxXsATCkZe6wvBVKD8vLsJAr8N+onKQz+4OPc3kmKq7aESu3\\\\nCi/iuie5KKVwnuNhr9AzT61vEkKxwHcVFEvHB77F6ZAAInhRvjzmQbD2dlPLLQCC\\\\nqDj71ODSSAPTEmUy6969bgD9PfWei7kNkBIx7s3eBv8yzytSc2EcuUgopqFazquw\\\\nFs1+tqGHjBvQfTo6bqbJjp/9Ci2pvde3ElV2rAgUlb3lqXyXjRDqrXosh5GcRPQj\\\\nK8Nhj1BNhnrCVskE4BP0LYbOHuzgm86uXwGCFsY+w2VOsSm16Jx5GHyG5S5WU3+D\\\\nIts/HFYRLiFgDLmTlxo=\\\\n=+OzK\\\\n-----END PGP PUBLIC KEY BLOCK-----\\\"\"\n        }\n      },\n      \"base-installation-for-auth-user-paginated\": {\n        \"value\": {\n          \"total_count\": 2,\n          \"installations\": [\n            {\n              \"id\": 1,\n              \"account\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"access_tokens_url\": \"https://api.github.com/installations/1/access_tokens\",\n              \"repositories_url\": \"https://api.github.com/installation/repositories\",\n              \"html_url\": \"https://github.com/organizations/github/settings/installations/1\",\n              \"app_id\": 1,\n              \"target_id\": 1,\n              \"target_type\": \"Organization\",\n              \"permissions\": {\n                \"checks\": \"write\",\n                \"metadata\": \"read\",\n                \"contents\": \"read\"\n              },\n              \"events\": [\n                \"push\",\n                \"pull_request\"\n              ],\n              \"single_file_name\": \"config.yaml\",\n              \"has_multiple_single_files\": true,\n              \"single_file_paths\": [\n                \"config.yml\",\n                \".github/issue_TEMPLATE.md\"\n              ],\n              \"repository_selection\": \"all\",\n              \"created_at\": \"2017-07-08T16:18:44-04:00\",\n              \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n              \"app_slug\": \"github-actions\",\n              \"suspended_at\": null,\n              \"suspended_by\": null\n            },\n            {\n              \"id\": 3,\n              \"account\": {\n                \"login\": \"octocat\",\n                \"id\": 2,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"access_tokens_url\": \"https://api.github.com/installations/1/access_tokens\",\n              \"repositories_url\": \"https://api.github.com/installation/repositories\",\n              \"html_url\": \"https://github.com/organizations/github/settings/installations/1\",\n              \"app_id\": 1,\n              \"target_id\": 1,\n              \"target_type\": \"Organization\",\n              \"permissions\": {\n                \"checks\": \"write\",\n                \"metadata\": \"read\",\n                \"contents\": \"read\"\n              },\n              \"events\": [\n                \"push\",\n                \"pull_request\"\n              ],\n              \"single_file_name\": \"config.yaml\",\n              \"has_multiple_single_files\": true,\n              \"single_file_paths\": [\n                \"config.yml\",\n                \".github/issue_TEMPLATE.md\"\n              ],\n              \"repository_selection\": \"all\",\n              \"created_at\": \"2017-07-08T16:18:44-04:00\",\n              \"updated_at\": \"2017-07-08T16:18:44-04:00\",\n              \"app_slug\": \"github-actions\",\n              \"suspended_at\": null,\n              \"suspended_by\": null\n            }\n          ]\n        }\n      },\n      \"key-items\": {\n        \"value\": [\n          {\n            \"key\": \"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\",\n            \"id\": 2,\n            \"url\": \"https://api.github.com/user/keys/2\",\n            \"title\": \"ssh-rsa AAAAB3NzaC1yc2EAAA\",\n            \"created_at\": \"2020-06-11T21:31:57Z\",\n            \"verified\": false,\n            \"read_only\": false\n          },\n          {\n            \"key\": \"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJy931234\",\n            \"id\": 3,\n            \"url\": \"https://api.github.com/user/keys/3\",\n            \"title\": \"ssh-rsa AAAAB3NzaC1yc2EAAB\",\n            \"created_at\": \"2020-07-11T21:31:57Z\",\n            \"verified\": false,\n            \"read_only\": false\n          }\n        ]\n      },\n      \"key\": {\n        \"value\": {\n          \"key\": \"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\",\n          \"id\": 2,\n          \"url\": \"https://api.github.com/user/keys/2\",\n          \"title\": \"ssh-rsa AAAAB3NzaC1yc2EAAA\",\n          \"created_at\": \"2020-06-11T21:31:57Z\",\n          \"verified\": false,\n          \"read_only\": false\n        }\n      },\n      \"org-membership-items\": {\n        \"value\": [\n          {\n            \"url\": \"https://api.github.com/orgs/octocat/memberships/defunkt\",\n            \"state\": \"active\",\n            \"role\": \"admin\",\n            \"organization_url\": \"https://api.github.com/orgs/octocat\",\n            \"organization\": {\n              \"login\": \"github\",\n              \"id\": 1,\n              \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n              \"url\": \"https://api.github.com/orgs/github\",\n              \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n              \"events_url\": \"https://api.github.com/orgs/github/events\",\n              \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n              \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n              \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n              \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"description\": \"A great organization\"\n            },\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          },\n          {\n            \"url\": \"https://api.github.com/orgs/invitocat/memberships/defunkt\",\n            \"state\": \"pending\",\n            \"role\": \"admin\",\n            \"organization_url\": \"https://api.github.com/orgs/invitocat\",\n            \"organization\": {\n              \"login\": \"github\",\n              \"id\": 1,\n              \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n              \"url\": \"https://api.github.com/orgs/github\",\n              \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n              \"events_url\": \"https://api.github.com/orgs/github/events\",\n              \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n              \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n              \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n              \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"description\": \"A great organization\"\n            },\n            \"user\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            }\n          }\n        ]\n      },\n      \"org-membership\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/orgs/invitocat/memberships/defunkt\",\n          \"state\": \"pending\",\n          \"role\": \"admin\",\n          \"organization_url\": \"https://api.github.com/orgs/invitocat\",\n          \"organization\": {\n            \"login\": \"github\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n            \"url\": \"https://api.github.com/orgs/github\",\n            \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n            \"events_url\": \"https://api.github.com/orgs/github/events\",\n            \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n            \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n            \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n            \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"description\": \"A great organization\"\n          },\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"org-membership-2\": {\n        \"value\": {\n          \"url\": \"https://api.github.com/orgs/octocat/memberships/defunkt\",\n          \"state\": \"active\",\n          \"role\": \"admin\",\n          \"organization_url\": \"https://api.github.com/orgs/octocat\",\n          \"organization\": {\n            \"login\": \"github\",\n            \"id\": 1,\n            \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n            \"url\": \"https://api.github.com/orgs/github\",\n            \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n            \"events_url\": \"https://api.github.com/orgs/github/events\",\n            \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n            \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n            \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n            \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"description\": \"A great organization\"\n          },\n          \"user\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          }\n        }\n      },\n      \"project\": {\n        \"value\": {\n          \"owner_url\": \"https://api.github.com/users/octocat\",\n          \"url\": \"https://api.github.com/projects/1002603\",\n          \"html_url\": \"https://github.com/users/octocat/projects/1\",\n          \"columns_url\": \"https://api.github.com/projects/1002603/columns\",\n          \"id\": 1002603,\n          \"node_id\": \"MDc6UHJvamVjdDEwMDI2MDM=\",\n          \"name\": \"My Projects\",\n          \"body\": \"A board to manage my personal projects.\",\n          \"number\": 1,\n          \"state\": \"open\",\n          \"creator\": {\n            \"login\": \"octocat\",\n            \"id\": 1,\n            \"node_id\": \"MDQ6VXNlcjE=\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"gravatar_id\": \"\",\n            \"url\": \"https://api.github.com/users/octocat\",\n            \"html_url\": \"https://github.com/octocat\",\n            \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n            \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n            \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n            \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n            \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n            \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n            \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n            \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n            \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n            \"type\": \"User\",\n            \"site_admin\": false\n          },\n          \"created_at\": \"2011-04-10T20:09:31Z\",\n          \"updated_at\": \"2014-03-03T18:58:10Z\"\n        }\n      },\n      \"repository-items-default-response\": {\n        \"summary\": \"Default response\",\n        \"value\": [\n          {\n            \"id\": 1296269,\n            \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n            \"name\": \"Hello-World\",\n            \"full_name\": \"octocat/Hello-World\",\n            \"owner\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"private\": false,\n            \"html_url\": \"https://github.com/octocat/Hello-World\",\n            \"description\": \"This your first repo!\",\n            \"fork\": false,\n            \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n            \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n            \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n            \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n            \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n            \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n            \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n            \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n            \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n            \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n            \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n            \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n            \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n            \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n            \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n            \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n            \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n            \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n            \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n            \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n            \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n            \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n            \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n            \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n            \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n            \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n            \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n            \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n            \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n            \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n            \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n            \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n            \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n            \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n            \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n            \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n            \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n            \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n            \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n            \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n            \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n            \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n            \"homepage\": \"https://github.com\",\n            \"language\": null,\n            \"forks_count\": 9,\n            \"stargazers_count\": 80,\n            \"watchers_count\": 80,\n            \"size\": 108,\n            \"default_branch\": \"master\",\n            \"open_issues_count\": 0,\n            \"is_template\": true,\n            \"topics\": [\n              \"octocat\",\n              \"atom\",\n              \"electron\",\n              \"api\"\n            ],\n            \"has_issues\": true,\n            \"has_projects\": true,\n            \"has_wiki\": true,\n            \"has_pages\": false,\n            \"has_downloads\": true,\n            \"archived\": false,\n            \"disabled\": false,\n            \"visibility\": \"public\",\n            \"pushed_at\": \"2011-01-26T19:06:43Z\",\n            \"created_at\": \"2011-01-26T19:01:12Z\",\n            \"updated_at\": \"2011-01-26T19:14:43Z\",\n            \"permissions\": {\n              \"admin\": false,\n              \"push\": false,\n              \"pull\": true\n            },\n            \"allow_rebase_merge\": true,\n            \"template_repository\": null,\n            \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n            \"allow_squash_merge\": true,\n            \"delete_branch_on_merge\": true,\n            \"allow_merge_commit\": true,\n            \"subscribers_count\": 42,\n            \"network_count\": 0,\n            \"license\": {\n              \"key\": \"mit\",\n              \"name\": \"MIT License\",\n              \"url\": \"https://api.github.com/licenses/mit\",\n              \"spdx_id\": \"MIT\",\n              \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n              \"html_url\": \"https://github.com/licenses/mit\"\n            },\n            \"forks\": 1,\n            \"open_issues\": 1,\n            \"watchers\": 1\n          }\n        ]\n      },\n      \"starred-repository-items-alternative-response-with-star-creation-timestamps\": {\n        \"summary\": \"Alternative response with star creation timestamps\",\n        \"value\": [\n          {\n            \"starred_at\": \"2011-01-16T19:06:43Z\",\n            \"repo\": {\n              \"id\": 1296269,\n              \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n              \"name\": \"Hello-World\",\n              \"full_name\": \"octocat/Hello-World\",\n              \"owner\": {\n                \"login\": \"octocat\",\n                \"id\": 1,\n                \"node_id\": \"MDQ6VXNlcjE=\",\n                \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n                \"gravatar_id\": \"\",\n                \"url\": \"https://api.github.com/users/octocat\",\n                \"html_url\": \"https://github.com/octocat\",\n                \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n                \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n                \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n                \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n                \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n                \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n                \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n                \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n                \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n                \"type\": \"User\",\n                \"site_admin\": false\n              },\n              \"private\": false,\n              \"html_url\": \"https://github.com/octocat/Hello-World\",\n              \"description\": \"This your first repo!\",\n              \"fork\": false,\n              \"url\": \"https://api.github.com/repos/octocat/Hello-World\",\n              \"archive_url\": \"https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\",\n              \"assignees_url\": \"https://api.github.com/repos/octocat/Hello-World/assignees{/user}\",\n              \"blobs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\",\n              \"branches_url\": \"https://api.github.com/repos/octocat/Hello-World/branches{/branch}\",\n              \"collaborators_url\": \"https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\",\n              \"comments_url\": \"https://api.github.com/repos/octocat/Hello-World/comments{/number}\",\n              \"commits_url\": \"https://api.github.com/repos/octocat/Hello-World/commits{/sha}\",\n              \"compare_url\": \"https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\",\n              \"contents_url\": \"https://api.github.com/repos/octocat/Hello-World/contents/{+path}\",\n              \"contributors_url\": \"https://api.github.com/repos/octocat/Hello-World/contributors\",\n              \"deployments_url\": \"https://api.github.com/repos/octocat/Hello-World/deployments\",\n              \"downloads_url\": \"https://api.github.com/repos/octocat/Hello-World/downloads\",\n              \"events_url\": \"https://api.github.com/repos/octocat/Hello-World/events\",\n              \"forks_url\": \"https://api.github.com/repos/octocat/Hello-World/forks\",\n              \"git_commits_url\": \"https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\",\n              \"git_refs_url\": \"https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\",\n              \"git_tags_url\": \"https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\",\n              \"git_url\": \"git:github.com/octocat/Hello-World.git\",\n              \"issue_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\",\n              \"issue_events_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\",\n              \"issues_url\": \"https://api.github.com/repos/octocat/Hello-World/issues{/number}\",\n              \"keys_url\": \"https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\",\n              \"labels_url\": \"https://api.github.com/repos/octocat/Hello-World/labels{/name}\",\n              \"languages_url\": \"https://api.github.com/repos/octocat/Hello-World/languages\",\n              \"merges_url\": \"https://api.github.com/repos/octocat/Hello-World/merges\",\n              \"milestones_url\": \"https://api.github.com/repos/octocat/Hello-World/milestones{/number}\",\n              \"notifications_url\": \"https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\",\n              \"pulls_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls{/number}\",\n              \"releases_url\": \"https://api.github.com/repos/octocat/Hello-World/releases{/id}\",\n              \"ssh_url\": \"git@github.com:octocat/Hello-World.git\",\n              \"stargazers_url\": \"https://api.github.com/repos/octocat/Hello-World/stargazers\",\n              \"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\",\n              \"subscribers_url\": \"https://api.github.com/repos/octocat/Hello-World/subscribers\",\n              \"subscription_url\": \"https://api.github.com/repos/octocat/Hello-World/subscription\",\n              \"tags_url\": \"https://api.github.com/repos/octocat/Hello-World/tags\",\n              \"teams_url\": \"https://api.github.com/repos/octocat/Hello-World/teams\",\n              \"trees_url\": \"https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\",\n              \"clone_url\": \"https://github.com/octocat/Hello-World.git\",\n              \"mirror_url\": \"git:git.example.com/octocat/Hello-World\",\n              \"hooks_url\": \"https://api.github.com/repos/octocat/Hello-World/hooks\",\n              \"svn_url\": \"https://svn.github.com/octocat/Hello-World\",\n              \"homepage\": \"https://github.com\",\n              \"language\": null,\n              \"forks_count\": 9,\n              \"stargazers_count\": 80,\n              \"watchers_count\": 80,\n              \"size\": 108,\n              \"default_branch\": \"master\",\n              \"open_issues_count\": 0,\n              \"is_template\": true,\n              \"topics\": [\n                \"octocat\",\n                \"atom\",\n                \"electron\",\n                \"api\"\n              ],\n              \"has_issues\": true,\n              \"has_projects\": true,\n              \"has_wiki\": true,\n              \"has_pages\": false,\n              \"has_downloads\": true,\n              \"archived\": false,\n              \"disabled\": false,\n              \"visibility\": \"public\",\n              \"pushed_at\": \"2011-01-26T19:06:43Z\",\n              \"created_at\": \"2011-01-26T19:01:12Z\",\n              \"updated_at\": \"2011-01-26T19:14:43Z\",\n              \"permissions\": {\n                \"admin\": false,\n                \"push\": false,\n                \"pull\": true\n              },\n              \"allow_rebase_merge\": true,\n              \"template_repository\": null,\n              \"temp_clone_token\": \"ABTLWHOULUVAXGTRYU7OC2876QJ2O\",\n              \"allow_squash_merge\": true,\n              \"delete_branch_on_merge\": true,\n              \"allow_merge_commit\": true,\n              \"subscribers_count\": 42,\n              \"network_count\": 0,\n              \"license\": {\n                \"key\": \"mit\",\n                \"name\": \"MIT License\",\n                \"url\": \"https://api.github.com/licenses/mit\",\n                \"spdx_id\": \"MIT\",\n                \"node_id\": \"MDc6TGljZW5zZW1pdA==\",\n                \"html_url\": \"https://github.com/licenses/mit\"\n              },\n              \"forks\": 1,\n              \"open_issues\": 1,\n              \"watchers\": 1\n            }\n          }\n        ]\n      },\n      \"team-full-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"node_id\": \"MDQ6VGVhbTE=\",\n            \"url\": \"https://api.github.com/teams/1\",\n            \"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n            \"name\": \"Justice League\",\n            \"slug\": \"justice-league\",\n            \"description\": \"A great team.\",\n            \"privacy\": \"closed\",\n            \"permission\": \"admin\",\n            \"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n            \"repositories_url\": \"https://api.github.com/teams/1/repos\",\n            \"parent\": null,\n            \"members_count\": 3,\n            \"repos_count\": 10,\n            \"created_at\": \"2017-07-14T16:53:42Z\",\n            \"updated_at\": \"2017-08-17T12:37:15Z\",\n            \"organization\": {\n              \"login\": \"github\",\n              \"id\": 1,\n              \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n              \"url\": \"https://api.github.com/orgs/github\",\n              \"repos_url\": \"https://api.github.com/orgs/github/repos\",\n              \"events_url\": \"https://api.github.com/orgs/github/events\",\n              \"hooks_url\": \"https://api.github.com/orgs/github/hooks\",\n              \"issues_url\": \"https://api.github.com/orgs/github/issues\",\n              \"members_url\": \"https://api.github.com/orgs/github/members{/member}\",\n              \"public_members_url\": \"https://api.github.com/orgs/github/public_members{/member}\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"description\": \"A great organization\",\n              \"name\": \"github\",\n              \"company\": \"GitHub\",\n              \"blog\": \"https://github.com/blog\",\n              \"location\": \"San Francisco\",\n              \"email\": \"octocat@github.com\",\n              \"has_organization_projects\": true,\n              \"has_repository_projects\": true,\n              \"public_repos\": 2,\n              \"public_gists\": 1,\n              \"followers\": 20,\n              \"following\": 0,\n              \"html_url\": \"https://github.com/octocat\",\n              \"created_at\": \"2008-01-14T04:33:35Z\",\n              \"type\": \"Organization\"\n            },\n            \"ldap_dn\": \"uid=asdf,ou=users,dc=github,dc=com\"\n          }\n        ]\n      },\n      \"public-user-default-response\": {\n        \"summary\": \"Default response\",\n        \"value\": {\n          \"login\": \"octocat\",\n          \"id\": 1,\n          \"node_id\": \"MDQ6VXNlcjE=\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/octocat\",\n          \"html_url\": \"https://github.com/octocat\",\n          \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n          \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n          \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false,\n          \"name\": \"monalisa octocat\",\n          \"company\": \"GitHub\",\n          \"blog\": \"https://github.com/blog\",\n          \"location\": \"San Francisco\",\n          \"email\": \"octocat@github.com\",\n          \"hireable\": false,\n          \"bio\": \"There once was...\",\n          \"twitter_username\": \"monatheoctocat\",\n          \"public_repos\": 2,\n          \"public_gists\": 1,\n          \"followers\": 20,\n          \"following\": 0,\n          \"created_at\": \"2008-01-14T04:33:35Z\",\n          \"updated_at\": \"2008-01-14T04:33:35Z\"\n        }\n      },\n      \"public-user-response-with-git-hub-plan-information\": {\n        \"summary\": \"Response with GitHub plan information\",\n        \"value\": {\n          \"login\": \"octocat\",\n          \"id\": 1,\n          \"node_id\": \"MDQ6VXNlcjE=\",\n          \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/octocat\",\n          \"html_url\": \"https://github.com/octocat\",\n          \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n          \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n          \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n          \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false,\n          \"name\": \"monalisa octocat\",\n          \"company\": \"GitHub\",\n          \"blog\": \"https://github.com/blog\",\n          \"location\": \"San Francisco\",\n          \"email\": \"octocat@github.com\",\n          \"hireable\": false,\n          \"bio\": \"There once was...\",\n          \"twitter_username\": \"monatheoctocat\",\n          \"public_repos\": 2,\n          \"public_gists\": 1,\n          \"followers\": 20,\n          \"following\": 0,\n          \"created_at\": \"2008-01-14T04:33:35Z\",\n          \"updated_at\": \"2008-01-14T04:33:35Z\",\n          \"plan\": {\n            \"name\": \"pro\",\n            \"space\": 976562499,\n            \"collaborators\": 0,\n            \"private_repos\": 9999\n          }\n        }\n      },\n      \"hovercard\": {\n        \"value\": {\n          \"contexts\": [\n            {\n              \"message\": \"Owns this repository\",\n              \"octicon\": \"repo\"\n            }\n          ]\n        }\n      },\n      \"key-simple-items\": {\n        \"value\": [\n          {\n            \"id\": 1,\n            \"key\": \"ssh-rsa AAA...\"\n          }\n        ]\n      },\n      \"project-items-3\": {\n        \"value\": [\n          {\n            \"owner_url\": \"https://api.github.com/users/octocat\",\n            \"url\": \"https://api.github.com/projects/1002603\",\n            \"html_url\": \"https://github.com/users/octocat/projects/1\",\n            \"columns_url\": \"https://api.github.com/projects/1002603/columns\",\n            \"id\": 1002603,\n            \"node_id\": \"MDc6UHJvamVjdDEwMDI2MDM=\",\n            \"name\": \"My Projects\",\n            \"body\": \"A board to manage my personal projects.\",\n            \"number\": 1,\n            \"state\": \"open\",\n            \"creator\": {\n              \"login\": \"octocat\",\n              \"id\": 1,\n              \"node_id\": \"MDQ6VXNlcjE=\",\n              \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n              \"gravatar_id\": \"\",\n              \"url\": \"https://api.github.com/users/octocat\",\n              \"html_url\": \"https://github.com/octocat\",\n              \"followers_url\": \"https://api.github.com/users/octocat/followers\",\n              \"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n              \"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n              \"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n              \"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n              \"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n              \"repos_url\": \"https://api.github.com/users/octocat/repos\",\n              \"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n              \"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n              \"type\": \"User\",\n              \"site_admin\": false\n            },\n            \"created_at\": \"2011-04-10T20:09:31Z\",\n            \"updated_at\": \"2014-03-03T18:58:10Z\"\n          }\n        ]\n      }\n    },\n    \"headers\": {\n      \"link\": {\n        \"example\": \"<https://api.github.com/resource?page=2>; rel=\\\"next\\\", <https://api.github.com/resource?page=5>; rel=\\\"last\\\"\",\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"content-type\": {\n        \"example\": \"text/html\",\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"x-common-marker-version\": {\n        \"example\": \"0.17.4\",\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      },\n      \"x-rate-limit-limit\": {\n        \"example\": 5000,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"x-rate-limit-remaining\": {\n        \"example\": 4999,\n        \"schema\": {\n          \"type\": \"integer\"\n        }\n      },\n      \"x-rate-limit-reset\": {\n        \"example\": 1590701888,\n        \"schema\": {\n          \"type\": \"integer\",\n          \"format\": \"timestamp\"\n        }\n      },\n      \"location\": {\n        \"example\": \"https://pipelines.actions.githubusercontent.com/OhgS4QRKqmgx7bKC27GKU83jnQjyeqG8oIMTge8eqtheppcmw8/_apis/pipelines/1/runs/176/signedlogcontent?urlExpires=2020-01-24T18%3A10%3A31.5729946Z&urlSigningMethod=HMACV1&urlSignature=agG73JakPYkHrh06seAkvmH7rBR4Ji4c2%2B6a2ejYh3E%3D\",\n        \"schema\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"responses\": {\n      \"not_found\": {\n        \"description\": \"Resource not found\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"validation_failed_simple\": {\n        \"description\": \"Validation failed\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/validation-error-simple\"\n            }\n          }\n        }\n      },\n      \"preview_header_missing\": {\n        \"description\": \"Preview header missing\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"type\": \"object\",\n              \"required\": [\n                \"message\",\n                \"documentation_url\"\n              ],\n              \"properties\": {\n                \"message\": {\n                  \"type\": \"string\"\n                },\n                \"documentation_url\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        }\n      },\n      \"forbidden\": {\n        \"description\": \"Forbidden\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"requires_authentication\": {\n        \"description\": \"Requires authentication\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"validation_failed\": {\n        \"description\": \"Validation failed\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/validation-error\"\n            }\n          }\n        }\n      },\n      \"not_modified\": {\n        \"description\": \"Not modified\"\n      },\n      \"gone\": {\n        \"description\": \"Gone\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"service_unavailable\": {\n        \"description\": \"Service unavailable\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"code\": {\n                  \"type\": \"string\"\n                },\n                \"message\": {\n                  \"type\": \"string\"\n                },\n                \"documentation_url\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        }\n      },\n      \"forbidden_gist\": {\n        \"description\": \"Forbidden Gist\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"block\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"reason\": {\n                      \"type\": \"string\"\n                    },\n                    \"created_at\": {\n                      \"type\": \"string\"\n                    },\n                    \"html_url\": {\n                      \"type\": [\n                        \"string\",\n                        \"null\"\n                      ]\n                    }\n                  }\n                },\n                \"message\": {\n                  \"type\": \"string\"\n                },\n                \"documentation_url\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        }\n      },\n      \"moved_permanently\": {\n        \"description\": \"Moved permanently\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"conflict\": {\n        \"description\": \"Conflict\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"temporary_redirect\": {\n        \"description\": \"Temporary Redirect\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"internal_error\": {\n        \"description\": \"Internal Error\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"code_scanning_forbidden_read\": {\n        \"description\": \"Response if GitHub Advanced Security is not enabled for this repository\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"code_scanning_forbidden_write\": {\n        \"description\": \"Response if the repository is archived or if github advanced security is not enabled for this repository\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          }\n        }\n      },\n      \"bad_request\": {\n        \"description\": \"Bad Request\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/basic-error\"\n            }\n          },\n          \"application/scim+json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/scim-error\"\n            }\n          }\n        }\n      },\n      \"found\": {\n        \"description\": \"Found\"\n      },\n      \"accepted\": {\n        \"description\": \"Accepted\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"type\": \"object\"\n            }\n          }\n        }\n      },\n      \"no_content\": {\n        \"description\": \"A header with no content is returned.\"\n      }\n    }\n  }\n}"
  },
  {
    "path": "python/tests/data/ghes-3.0.yaml",
    "content": "---\nopenapi: 3.1.0\ninfo:\n  version: 1.1.4\n  title: GitHub v3 REST API\n  description: GitHub's v3 REST API.\n  license:\n    name: MIT\n    url: https://spdx.org/licenses/MIT\n  termsOfService: https://docs.github.com/articles/github-terms-of-service\n  contact:\n    name: Support\n    url: https://support.github.com/contact?tags=dotcom-rest-api\ntags:\n- name: actions\n  description: Endpoints to manage GitHub Actions using the REST API.\n- name: activity\n  description: Activity APIs provide access to notifications, subscriptions, and timelines.\n- name: apps\n  description: Information for integrations and installations.\n- name: billing\n  description: Monitor charges and usage from Actions and Packages.\n- name: checks\n  description: Rich interactions with checks run by your integrations.\n- name: code-scanning\n  description: Retrieve code scanning alerts from a repository.\n- name: codes-of-conduct\n  description: Insight into codes of conduct for your communities.\n- name: codespaces\n  description: Endpoints to manage Codespaces using the REST API.\n- name: emojis\n  description: List emojis available to use on GitHub.\n- name: enterprise-admin\n  description: Administer a GitHub enterprise.\n- name: dependabot\n  description: Endpoints to manage Dependabot.\n- name: gists\n  description: View, modify your gists.\n- name: git\n  description: Raw Git functionality.\n- name: gitignore\n  description: View gitignore templates\n- name: interactions\n  description: Owner or admin management of users interactions.\n- name: issues\n  description: Interact with GitHub Issues.\n- name: licenses\n  description: View various OSS licenses.\n- name: markdown\n  description: Render GitHub flavored markdown\n- name: meta\n  description: Endpoints that give information about the API.\n- name: migrations\n  description: Move projects to or from GitHub.\n- name: oauth-authorizations\n  description: Manage access of OAuth applications\n- name: orgs\n  description: Interact with GitHub Orgs.\n- name: packages\n  description: Manage packages for authenticated users and organizations.\n- name: projects\n  description: Interact with GitHub Projects.\n- name: pulls\n  description: Interact with GitHub Pull Requests.\n- name: rate-limit\n  description: Check your current rate limit status\n- name: reactions\n  description: Interact with reactions to various GitHub entities.\n- name: repos\n  description: Interact with GitHub Repos.\n- name: scim\n  description: Provisioning of GitHub organization membership for SCIM-enabled providers.\n- name: search\n  description: Look for stuff on GitHub.\n- name: secret-scanning\n  description: Retrieve secret scanning alerts from a repository.\n- name: server-statistics\n  description: GHES statistics\n- name: teams\n  description: Interact with GitHub Teams.\n- name: users\n  description: Interact with and view information about users and also current user.\nservers:\n- url: \"{protocol}://{hostname}/api/v3\"\n  variables:\n    hostname:\n      description: Self-hosted Enterprise Server or Enterprise Cloud hostname\n      default: HOSTNAME\n    protocol:\n      description: Self-hosted Enterprise Server or Enterprise Cloud protocol\n      default: http\nexternalDocs:\n  description: GitHub Enterprise Developer Docs\n  url: https://docs.github.com/enterprise-server@3.0/rest/\npaths:\n  \"/\":\n    get:\n      summary: GitHub API Root\n      description: Get Hypermedia links to resources accessible in GitHub's REST API\n      tags:\n      - meta\n      operationId: meta/root\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  current_user_url:\n                    type: string\n                    format: uri-template\n                  current_user_authorizations_html_url:\n                    type: string\n                    format: uri-template\n                  authorizations_url:\n                    type: string\n                    format: uri-template\n                  code_search_url:\n                    type: string\n                    format: uri-template\n                  commit_search_url:\n                    type: string\n                    format: uri-template\n                  emails_url:\n                    type: string\n                    format: uri-template\n                  emojis_url:\n                    type: string\n                    format: uri-template\n                  events_url:\n                    type: string\n                    format: uri-template\n                  feeds_url:\n                    type: string\n                    format: uri-template\n                  followers_url:\n                    type: string\n                    format: uri-template\n                  following_url:\n                    type: string\n                    format: uri-template\n                  gists_url:\n                    type: string\n                    format: uri-template\n                  hub_url:\n                    type: string\n                    format: uri-template\n                  issue_search_url:\n                    type: string\n                    format: uri-template\n                  issues_url:\n                    type: string\n                    format: uri-template\n                  keys_url:\n                    type: string\n                    format: uri-template\n                  label_search_url:\n                    type: string\n                    format: uri-template\n                  notifications_url:\n                    type: string\n                    format: uri-template\n                  organization_url:\n                    type: string\n                    format: uri-template\n                  organization_repositories_url:\n                    type: string\n                    format: uri-template\n                  organization_teams_url:\n                    type: string\n                    format: uri-template\n                  public_gists_url:\n                    type: string\n                    format: uri-template\n                  rate_limit_url:\n                    type: string\n                    format: uri-template\n                  repository_url:\n                    type: string\n                    format: uri-template\n                  repository_search_url:\n                    type: string\n                    format: uri-template\n                  current_user_repositories_url:\n                    type: string\n                    format: uri-template\n                  starred_url:\n                    type: string\n                    format: uri-template\n                  starred_gists_url:\n                    type: string\n                    format: uri-template\n                  topic_search_url:\n                    type: string\n                    format: uri-template\n                  user_url:\n                    type: string\n                    format: uri-template\n                  user_organizations_url:\n                    type: string\n                    format: uri-template\n                  user_repositories_url:\n                    type: string\n                    format: uri-template\n                  user_search_url:\n                    type: string\n                    format: uri-template\n                required:\n                - current_user_url\n                - current_user_authorizations_html_url\n                - authorizations_url\n                - code_search_url\n                - commit_search_url\n                - emails_url\n                - emojis_url\n                - events_url\n                - feeds_url\n                - followers_url\n                - following_url\n                - gists_url\n                - hub_url\n                - issue_search_url\n                - issues_url\n                - keys_url\n                - label_search_url\n                - notifications_url\n                - organization_url\n                - organization_repositories_url\n                - organization_teams_url\n                - public_gists_url\n                - rate_limit_url\n                - repository_url\n                - repository_search_url\n                - current_user_repositories_url\n                - starred_url\n                - starred_gists_url\n                - user_url\n                - user_organizations_url\n                - user_repositories_url\n                - user_search_url\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: meta\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#root-endpoint\n  \"/admin/hooks\":\n    get:\n      summary: List global webhooks\n      description: ''\n      operationId: enterprise-admin/list-global-webhooks\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-global-webhooks\n      parameters:\n      - name: accept\n        description: This API is under preview and subject to change.\n        in: header\n        schema:\n          type: string\n          default: application/vnd.github.superpro-preview+json\n        required: true\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/global-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/global-hook-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: global-webhooks\n        previews:\n        - required: true\n          name: superpro\n          note: |-\n            The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.superpro-preview+json\n            ```\n    post:\n      summary: Create a global webhook\n      description: ''\n      operationId: enterprise-admin/create-global-webhook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-global-webhook\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/global-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/global-hook\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: Must be passed as \"web\".\n                config:\n                  type: object\n                  description: Key/value pairs to provide settings for this webhook.\n                  properties:\n                    url:\n                      type: string\n                      description: The URL to which the payloads will be delivered.\n                    content_type:\n                      type: string\n                      description: The media type used to serialize the payloads.\n                        Supported values include `json` and `form`. The default is\n                        `form`.\n                    secret:\n                      type: string\n                      description: If provided, the `secret` will be used as the `key`\n                        to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#delivery-headers)\n                        header.\n                    insecure_ssl:\n                      type: string\n                      description: Determines whether the SSL certificate of the host\n                        for `url` will be verified when delivering payloads. Supported\n                        values include `0` (verification is performed) and `1` (verification\n                        is not performed). The default is `0`. **We strongly recommend\n                        not setting this to `1` as you are subject to man-in-the-middle\n                        and other attacks.**\n                  required:\n                  - url\n                events:\n                  type: array\n                  description: 'The [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads)\n                    that trigger this webhook. A global webhook can be triggered by\n                    `user` and `organization` events. Default: `user` and `organization`.'\n                  items:\n                    type: string\n                active:\n                  type: boolean\n                  description: Determines if notifications are sent when the webhook\n                    is triggered. Set to `true` to send notifications.\n                  default: true\n              required:\n              - name\n              - config\n            example:\n              name: web\n              events:\n              - organization\n              - user\n              config:\n                url: https://example.com/webhook\n                content_type: json\n                secret: secret\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: global-webhooks\n        previews:\n        - required: true\n          name: superpro\n          note: |-\n            The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.superpro-preview+json\n            ```\n      parameters:\n      - name: accept\n        description: This API is under preview and subject to change.\n        in: header\n        schema:\n          type: string\n          default: application/vnd.github.superpro-preview+json\n        required: true\n  \"/admin/hooks/{hook_id}\":\n    get:\n      summary: Get a global webhook\n      description: ''\n      operationId: enterprise-admin/get-global-webhook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-global-webhook\n      parameters:\n      - name: accept\n        description: This API is under preview and subject to change.\n        in: header\n        schema:\n          type: string\n          default: application/vnd.github.superpro-preview+json\n        required: true\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/global-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/global-hook\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: global-webhooks\n        previews:\n        - required: true\n          name: superpro\n          note: |-\n            The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.superpro-preview+json\n            ```\n    patch:\n      summary: Update a global webhook\n      description: Parameters that are not provided will be overwritten with the default\n        value or removed if no default exists.\n      operationId: enterprise-admin/update-global-webhook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-a-global-webhook\n      parameters:\n      - name: accept\n        description: This API is under preview and subject to change.\n        in: header\n        schema:\n          type: string\n          default: application/vnd.github.superpro-preview+json\n        required: true\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/global-hook-2\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/global-hook-2\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                config:\n                  type: object\n                  description: Key/value pairs to provide settings for this webhook.\n                  properties:\n                    url:\n                      type: string\n                      description: The URL to which the payloads will be delivered.\n                    content_type:\n                      type: string\n                      description: The media type used to serialize the payloads.\n                        Supported values include `json` and `form`. The default is\n                        `form`.\n                    secret:\n                      type: string\n                      description: If provided, the `secret` will be used as the `key`\n                        to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#delivery-headers)\n                        header.\n                    insecure_ssl:\n                      type: string\n                      description: Determines whether the SSL certificate of the host\n                        for `url` will be verified when delivering payloads. Supported\n                        values include `0` (verification is performed) and `1` (verification\n                        is not performed). The default is `0`. **We strongly recommend\n                        not setting this to `1` as you are subject to man-in-the-middle\n                        and other attacks.**\n                  required:\n                  - url\n                events:\n                  type: array\n                  description: 'The [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads)\n                    that trigger this webhook. A global webhook can be triggered by\n                    `user` and `organization` events. Default: `user` and `organization`.'\n                  items:\n                    type: string\n                active:\n                  type: boolean\n                  description: Determines if notifications are sent when the webhook\n                    is triggered. Set to `true` to send notifications.\n                  default: true\n            example:\n              events:\n              - organization\n              config:\n                url: https://example.com/webhook\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: global-webhooks\n        previews:\n        - required: true\n          name: superpro\n          note: |-\n            The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.superpro-preview+json\n            ```\n    delete:\n      summary: Delete a global webhook\n      description: ''\n      operationId: enterprise-admin/delete-global-webhook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-global-webhook\n      parameters:\n      - name: accept\n        description: This API is under preview and subject to change.\n        in: header\n        schema:\n          type: string\n          default: application/vnd.github.superpro-preview+json\n        required: true\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: global-webhooks\n        previews:\n        - required: true\n          name: superpro\n          note: |-\n            The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.superpro-preview+json\n            ```\n  \"/admin/hooks/{hook_id}/pings\":\n    post:\n      summary: Ping a global webhook\n      description: This will trigger a [ping event](https://docs.github.com/enterprise-server@3.0/webhooks/#ping-event)\n        to be sent to the webhook.\n      operationId: enterprise-admin/ping-global-webhook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#ping-a-global-webhook\n      parameters:\n      - name: accept\n        description: This API is under preview and subject to change.\n        in: header\n        schema:\n          type: string\n          default: application/vnd.github.superpro-preview+json\n        required: true\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: global-webhooks\n        previews:\n        - required: true\n          name: superpro\n          note: |-\n            The [Global Webhooks API](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#global-webhooks) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.superpro-preview+json\n            ```\n  \"/admin/keys\":\n    get:\n      summary: List public keys\n      description: ''\n      operationId: enterprise-admin/list-public-keys\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-public-keys\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - name: sort\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - accessed\n          default: created\n      - name: since\n        description: Only show public keys accessed after the given time.\n        in: query\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/public-key-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/enterprise-public-key-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/admin/keys/{key_ids}\":\n    delete:\n      summary: Delete a public key\n      description: ''\n      operationId: enterprise-admin/delete-public-key\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-public-key\n      parameters:\n      - \"$ref\": \"#/components/parameters/key-ids\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/admin/ldap/teams/{team_id}/mapping\":\n    patch:\n      summary: Update LDAP mapping for a team\n      description: |-\n        Updates the [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. [LDAP synchronization](https://docs.github.com/enterprise/admin/guides/user-management/using-ldap/#enabling-ldap-sync) must be enabled to map LDAP entries to a team. Use the [Create a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#create-a-team) endpoint to create a team with LDAP mapping.\n\n        If you pass the `hellcat-preview` media type, you can also update the LDAP mapping of a child team.\n      operationId: enterprise-admin/update-ldap-mapping-for-team\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-ldap-mapping-for-a-team\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/ldap-mapping-team\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/ldap-mapping-team\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                ldap_dn:\n                  type: string\n                  description: The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns)\n                    (DN) of the LDAP entry to map to a team.\n              required:\n              - ldap_dn\n            example:\n              ldap_dn: cn=Enterprise Ops,ou=teams,dc=github,dc=com\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: ldap\n        previews:\n        - required: false\n          name: hellcat\n          note: |-\n            The Nested Teams API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2017-08-30-preview-nested-teams) for full details. To access the API, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.hellcat-preview+json\n            ```\n  \"/admin/ldap/teams/{team_id}/sync\":\n    post:\n      summary: Sync LDAP mapping for a team\n      description: Note that this API call does not automatically initiate an LDAP\n        sync. Rather, if a `201` is returned, the sync job is queued successfully,\n        and is performed when the instance is ready.\n      operationId: enterprise-admin/sync-ldap-mapping-for-team\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#sync-ldap-mapping-for-a-team\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  status:\n                    type: string\n              example:\n                status: queued\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: ldap\n  \"/admin/ldap/users/{username}/mapping\":\n    patch:\n      summary: Update LDAP mapping for a user\n      description: ''\n      operationId: enterprise-admin/update-ldap-mapping-for-user\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-ldap-mapping-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/ldap-mapping-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/ldap-mapping-user\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                ldap_dn:\n                  type: string\n                  description: The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns)\n                    (DN) of the LDAP entry to map to a team.\n              required:\n              - ldap_dn\n            example:\n              ldap_dn: uid=asdf,ou=users,dc=github,dc=com\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: ldap\n  \"/admin/ldap/users/{username}/sync\":\n    post:\n      summary: Sync LDAP mapping for a user\n      description: Note that this API call does not automatically initiate an LDAP\n        sync. Rather, if a `201` is returned, the sync job is queued successfully,\n        and is performed when the instance is ready.\n      operationId: enterprise-admin/sync-ldap-mapping-for-user\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#sync-ldap-mapping-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  status:\n                    type: string\n              example:\n                status: queued\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: ldap\n  \"/admin/organizations\":\n    post:\n      summary: Create an organization\n      description: ''\n      operationId: enterprise-admin/create-org\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-an-organization\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/organization-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-simple\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                login:\n                  type: string\n                  description: The organization's username.\n                admin:\n                  type: string\n                  description: The login of the user who will manage this organization.\n                profile_name:\n                  type: string\n                  description: The organization's display name.\n              required:\n              - login\n              - admin\n            example:\n              login: github\n              profile_name: GitHub, Inc.\n              admin: monalisaoctocat\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: orgs\n  \"/admin/organizations/{org}\":\n    patch:\n      summary: Update an organization name\n      description: ''\n      operationId: enterprise-admin/update-org-name\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-an-organization-name\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  url:\n                    type: string\n              example:\n                message: Job queued to rename organization. It may take a few minutes\n                  to complete.\n                url: https://<hostname>/api/v3/organizations/1\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                login:\n                  type: string\n                  description: The organization's new name.\n              required:\n              - login\n            example:\n              login: the-new-octocats\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: orgs\n  \"/admin/pre-receive-environments\":\n    get:\n      summary: List pre-receive environments\n      description: ''\n      operationId: enterprise-admin/list-pre-receive-environments\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-pre-receive-environments\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - name: sort\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - name\n          default: created\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/pre-receive-environment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pre-receive-environment-items\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-environments\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    post:\n      summary: Create a pre-receive environment\n      description: ''\n      operationId: enterprise-admin/create-pre-receive-environment\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-pre-receive-environment\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pre-receive-environment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pre-receive-environment\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The new pre-receive environment's name.\n                image_url:\n                  type: string\n                  description: URL from which to download a tarball of this environment.\n              required:\n              - name\n              - image_url\n            example:\n              name: DevTools Hook Env\n              image_url: https://my_file_server/path/to/devtools_env.tar.gz\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-environments\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/admin/pre-receive-environments/{pre_receive_environment_id}\":\n    get:\n      summary: Get a pre-receive environment\n      description: ''\n      operationId: enterprise-admin/get-pre-receive-environment\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-pre-receive-environment\n      parameters:\n      - \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pre-receive-environment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pre-receive-environment\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-environments\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    patch:\n      summary: Update a pre-receive environment\n      description: You cannot modify the default environment. If you attempt to modify\n        the default environment, you will receive a `422 Unprocessable Entity` response.\n      operationId: enterprise-admin/update-pre-receive-environment\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-a-pre-receive-environment\n      parameters:\n      - \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pre-receive-environment\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/pre-receive-environment-default-response\"\n        '422':\n          description: Client Errors\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        resource:\n                          type: string\n                        code:\n                          type: string\n                        message:\n                          type: string\n              examples:\n                client-errors:\n                  value:\n                    message: Validation Failed\n                    errors:\n                    - resource: PreReceiveEnvironment\n                      code: custom\n                      message: Cannot modify or delete the default environment\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: This pre-receive environment's new name.\n                image_url:\n                  type: string\n                  description: URL from which to download a tarball of this environment.\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-environments\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    delete:\n      summary: Delete a pre-receive environment\n      description: |-\n        If you attempt to delete an environment that cannot be deleted, you will receive a `422 Unprocessable Entity` response.\n\n        The possible error messages are:\n\n        *   _Cannot modify or delete the default environment_\n        *   _Cannot delete environment that has hooks_\n        *   _Cannot delete environment when download is in progress_\n      operationId: enterprise-admin/delete-pre-receive-environment\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-pre-receive-environment\n      parameters:\n      - \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n      responses:\n        '204':\n          description: Response\n        '422':\n          description: Client Errors\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        resource:\n                          type: string\n                        code:\n                          type: string\n                        message:\n                          type: string\n              examples:\n                client-errors:\n                  value:\n                    message: Validation Failed\n                    errors:\n                    - resource: PreReceiveEnvironment\n                      code: custom\n                      message: Cannot modify or delete the default environment\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-environments\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/admin/pre-receive-environments/{pre_receive_environment_id}/downloads\":\n    post:\n      summary: Start a pre-receive environment download\n      description: |-\n        Triggers a new download of the environment tarball from the environment's `image_url`. When the download is finished, the newly downloaded tarball will overwrite the existing environment.\n\n        If a download cannot be triggered, you will receive a `422 Unprocessable Entity` response.\n\n        The possible error messages are:\n\n        * _Cannot modify or delete the default environment_\n        * _Can not start a new download when a download is in progress_\n      operationId: enterprise-admin/start-pre-receive-environment-download\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#start-a-pre-receive-environment-download\n      parameters:\n      - \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pre-receive-environment-download-status\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/pre-receive-environment-download-status-default-response\"\n        '422':\n          description: Client Errors\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        resource:\n                          type: string\n                        code:\n                          type: string\n                        message:\n                          type: string\n              examples:\n                client-errors:\n                  value:\n                    message: Validation Failed\n                    errors:\n                    - resource: PreReceiveEnvironment\n                      code: custom\n                      message: Can not start a new download when a download is in\n                        progress\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-environments\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest\":\n    get:\n      summary: Get the download status for a pre-receive environment\n      description: In addition to seeing the download status at the \"[Get a pre-receive\n        environment](#get-a-pre-receive-environment)\" endpoint, there is also this\n        separate endpoint for just the download status.\n      operationId: enterprise-admin/get-download-status-for-pre-receive-environment\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-the-download-status-for-a-pre-receive-environment\n      parameters:\n      - \"$ref\": \"#/components/parameters/pre-receive-environment-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pre-receive-environment-download-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pre-receive-environment-download-status\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-environments\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/admin/pre-receive-hooks\":\n    get:\n      summary: List pre-receive hooks\n      description: ''\n      operationId: enterprise-admin/list-pre-receive-hooks\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-pre-receive-hooks\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - name: sort\n        description: One of `created` (when the repository was starred) or `updated`\n          (when it was last pushed to) or `name`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - name\n          default: created\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pre-receive-hook-items\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    post:\n      summary: Create a pre-receive hook\n      description: ''\n      operationId: enterprise-admin/create-pre-receive-hook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-pre-receive-hook\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pre-receive-hook\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the hook.\n                script:\n                  type: string\n                  description: The script that the hook runs.\n                script_repository:\n                  type: object\n                  description: The GitHub repository where the script is kept.\n                  properties: {}\n                  additionalProperties: true\n                environment:\n                  type: object\n                  description: The pre-receive environment where the script is executed.\n                  properties: {}\n                  additionalProperties: true\n                enforcement:\n                  type: string\n                  description: 'The state of enforcement for this hook. default: `disabled`'\n                allow_downstream_configuration:\n                  type: boolean\n                  description: 'Whether enforcement can be overridden at the org or\n                    repo level. default: `false`'\n              required:\n              - name\n              - script\n              - script_repository\n              - environment\n            example:\n              name: Check Commits\n              script: scripts/commit_check.sh\n              enforcement: disabled\n              allow_downstream_configuration: false\n              script_repository:\n                full_name: DevIT/hooks\n              environment:\n                id: 2\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/admin/pre-receive-hooks/{pre_receive_hook_id}\":\n    get:\n      summary: Get a pre-receive hook\n      description: ''\n      operationId: enterprise-admin/get-pre-receive-hook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-pre-receive-hook\n      parameters:\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pre-receive-hook\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    patch:\n      summary: Update a pre-receive hook\n      description: ''\n      operationId: enterprise-admin/update-pre-receive-hook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-a-pre-receive-hook\n      parameters:\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pre-receive-hook-2\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the hook.\n                script:\n                  type: string\n                  description: The script that the hook runs.\n                script_repository:\n                  type: object\n                  description: The GitHub repository where the script is kept.\n                  properties: {}\n                  additionalProperties: true\n                environment:\n                  type: object\n                  description: The pre-receive environment where the script is executed.\n                  properties: {}\n                  additionalProperties: true\n                enforcement:\n                  type: string\n                  description: The state of enforcement for this hook.\n                allow_downstream_configuration:\n                  type: boolean\n                  description: Whether enforcement can be overridden at the org or\n                    repo level.\n            example:\n              name: Check Commits\n              environment:\n                id: 1\n              allow_downstream_configuration: true\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    delete:\n      summary: Delete a pre-receive hook\n      description: ''\n      operationId: enterprise-admin/delete-pre-receive-hook\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-pre-receive-hook\n      parameters:\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/admin/tokens\":\n    get:\n      summary: List personal access tokens\n      description: Lists personal access tokens for all users, including admin users.\n      operationId: enterprise-admin/list-personal-access-tokens\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-personal-access-tokens\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/admin/tokens/{token_id}\":\n    delete:\n      summary: Delete a personal access token\n      description: Deletes a personal access token. Returns a `403 - Forbidden` status\n        when a personal access token is in use. For example, if you access this endpoint\n        with the same personal access token that you are trying to delete, you will\n        receive this error.\n      operationId: enterprise-admin/delete-personal-access-token\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-personal-access-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/token-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/admin/users\":\n    post:\n      summary: Create a user\n      description: |-\n        If an external authentication mechanism is used, the login name should match the login name in the external system. If you are using LDAP authentication, you should also [update the LDAP mapping](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-ldap-mapping-for-a-user) for the user.\n\n        The login name will be normalized to only contain alphanumeric characters or single hyphens. For example, if you send `\"octo_cat\"` as the login, a user named `\"octo-cat\"` will be created.\n\n        If the login name or email address is already associated with an account, the server will return a `422` response.\n      operationId: enterprise-admin/create-user\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-user\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                login:\n                  type: string\n                  description: The user's username.\n                email:\n                  type: string\n                  description: \"**Required for built-in authentication.** The user's\n                    email address. This parameter can be omitted when using CAS, LDAP,\n                    or SAML. For details on built-in and centrally-managed authentication,\n                    see the the [GitHub authentication guide](https://docs.github.com/enterprise/2.18/admin/guides/user-management/authenticating-users-for-your-github-enterprise-server-instance/).\"\n              required:\n              - login\n            example:\n              login: monalisa\n              email: octocat@github.com\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/admin/users/{username}\":\n    patch:\n      summary: Update the username for a user\n      description: ''\n      operationId: enterprise-admin/update-username-for-user\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-the-username-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  url:\n                    type: string\n              example:\n                message: Job queued to rename user. It may take a few minutes to complete.\n                url: https://api.github.com/user/1\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                login:\n                  type: string\n                  description: The user's new username.\n              required:\n              - login\n            example:\n              login: thenewmonalisa\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n    delete:\n      summary: Delete a user\n      description: |-\n        Deleting a user will delete all their repositories, gists, applications, and personal settings. [Suspending a user](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#suspend-a-user) is often a better option.\n\n        You can delete any user account except your own.\n      operationId: enterprise-admin/delete-user\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/admin/users/{username}/authorizations\":\n    post:\n      summary: Create an impersonation OAuth token\n      description: ''\n      operationId: enterprise-admin/create-impersonation-o-auth-token\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-an-impersonation-oauth-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                scopes:\n                  type: array\n                  description: A list of [scopes](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n                  items:\n                    type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n    delete:\n      summary: Delete an impersonation OAuth token\n      description: ''\n      operationId: enterprise-admin/delete-impersonation-o-auth-token\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#delete-an-impersonation-oauth-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/app\":\n    get:\n      summary: Get the authenticated app\n      description: |-\n        Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the \"[List installations for the authenticated app](https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-installations-for-the-authenticated-app)\" endpoint.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/get-authenticated\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-the-authenticated-app\n      parameters: []\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/integration\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/integration\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: apps\n        subcategory: \n  \"/app-manifests/{code}/conversions\":\n    post:\n      summary: Create a GitHub App from a manifest\n      description: Use this endpoint to complete the handshake necessary when implementing\n        the [GitHub App Manifest flow](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/creating-github-apps-from-a-manifest/).\n        When you create a GitHub App with the manifest flow, you receive a temporary\n        `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`.\n      tags:\n      - apps\n      operationId: apps/create-from-manifest\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-github-app-from-a-manifest\n      parameters:\n      - name: code\n        in: path\n        required: true\n        schema:\n          type: string\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              additionalProperties: false\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                allOf:\n                - \"$ref\": \"#/components/schemas/integration\"\n                - type: object\n                  properties:\n                    client_id:\n                      type: string\n                    client_secret:\n                      type: string\n                    webhook_secret:\n                      type:\n                      - string\n                      - 'null'\n                    pem:\n                      type: string\n                  required:\n                  - client_id\n                  - client_secret\n                  - webhook_secret\n                  - pem\n                  additionalProperties: true\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/integration-from-manifest\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: \n  \"/app/hook/config\":\n    get:\n      summary: Get a webhook configuration for an app\n      description: |-\n        Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"[Creating a GitHub App](/developers/apps/creating-a-github-app).\"\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/get-webhook-config-for-app\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-a-webhook-configuration-for-an-app\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/webhook-config\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/webhook-config\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: webhooks\n    patch:\n      summary: Update a webhook configuration for an app\n      description: |-\n        Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"[Creating a GitHub App](/developers/apps/creating-a-github-app).\"\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/update-webhook-config-for-app\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#update-a-webhook-configuration-for-an-app\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                url:\n                  \"$ref\": \"#/components/schemas/webhook-config-url\"\n                content_type:\n                  \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                secret:\n                  \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                insecure_ssl:\n                  \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n              example:\n                content_type: json\n                insecure_ssl: '0'\n                secret: \"********\"\n                url: https://example.com/webhook\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/webhook-config\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/webhook-config\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: webhooks\n  \"/app/installations\":\n    get:\n      summary: List installations for the authenticated app\n      description: |-\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n\n        The permissions the installation has are included under the `permissions` key.\n      tags:\n      - apps\n      operationId: apps/list-installations\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-installations-for-the-authenticated-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - name: outdated\n        in: query\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: The permissions the installation has are included under the\n            `permissions` key.\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/installation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/base-installation-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: apps\n        subcategory: \n  \"/app/installations/{installation_id}\":\n    get:\n      summary: Get an installation for the authenticated app\n      description: |-\n        Enables an authenticated GitHub App to find an installation's information using the installation id.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/get-installation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-an-installation-for-the-authenticated-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/installation-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/installation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/base-installation\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: apps\n        subcategory: \n    delete:\n      summary: Delete an installation for the authenticated app\n      description: |-\n        Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the \"[Suspend an app installation](https://docs.github.com/enterprise-server@3.0/rest/reference/apps/#suspend-an-app-installation)\" endpoint.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/delete-installation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#delete-an-installation-for-the-authenticated-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/installation-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: \n  \"/app/installations/{installation_id}/access_tokens\":\n    post:\n      summary: Create an installation access token for an app\n      description: |-\n        Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/create-installation-access-token\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps/#create-an-installation-access-token-for-an-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/installation-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                repositories:\n                  description: List of repository names that the token should have\n                    access to\n                  type: array\n                  items:\n                    type: string\n                    examples:\n                    - rails\n                repository_ids:\n                  description: List of repository IDs that the token should have access\n                    to\n                  type: array\n                  items:\n                    type: integer\n                  examples:\n                  - 1\n                permissions:\n                  \"$ref\": \"#/components/schemas/app-permissions\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/installation-token\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/installation-token\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: apps\n        subcategory: \n  \"/app/installations/{installation_id}/suspended\":\n    put:\n      summary: Suspend an app installation\n      description: |-\n        Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub Enterprise Server API or webhook events is blocked for that account.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/suspend-installation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#suspend-an-app-installation\n      parameters:\n      - \"$ref\": \"#/components/parameters/installation-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: \n    delete:\n      summary: Unsuspend an app installation\n      description: |-\n        Removes a GitHub App installation suspension.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/unsuspend-installation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#unsuspend-an-app-installation\n      parameters:\n      - \"$ref\": \"#/components/parameters/installation-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: \n  \"/applications/grants\":\n    get:\n      summary: List your grants\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n        You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `[\"repo\", \"user\"]`.\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/list-grants\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#list-your-grants\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - name: client_id\n        in: query\n        required: false\n        description: The client ID of your GitHub app.\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/application-grant\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/application-grant-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n  \"/applications/grants/{grant_id}\":\n    get:\n      summary: Get a single grant\n      description: \"**Deprecation Notice:** GitHub Enterprise Server will discontinue\n        the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations),\n        which is used by integrations to create personal access tokens and OAuth tokens,\n        and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow).\n        The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations)\n        will be removed on November, 13, 2020. For more information, including scheduled\n        brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\"\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/get-grant\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#get-a-single-grant\n      parameters:\n      - \"$ref\": \"#/components/parameters/grant-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/application-grant\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/application-grant\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n    delete:\n      summary: Delete a grant\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n        Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/delete-grant\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#delete-a-grant\n      parameters:\n      - \"$ref\": \"#/components/parameters/grant-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n  \"/applications/{client_id}/grant\":\n    delete:\n      summary: Delete an app authorization\n      description: |-\n        OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.\n        Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).\n      operationId: apps/delete-authorization\n      tags:\n      - apps\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#delete-an-app-authorization\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                access_token:\n                  type: string\n                  description: The OAuth access token used to authenticate to the\n                    GitHub API.\n              required:\n              - access_token\n            example:\n              access_token: e72e16c7e42f292c6912e7710c838347ae178b4a\n      responses:\n        '204':\n          description: Response\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: oauth-applications\n  \"/applications/{client_id}/grants/{access_token}\":\n    delete:\n      summary: Revoke a grant for an application\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\n        OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted.\n\n        Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under \"Authorized OAuth Apps\" on GitHub Enterprise Server](https://github.com/settings/applications#authorized).\n      tags:\n      - apps\n      operationId: apps/revoke-grant-for-application\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#revoke-a-grant-for-an-application\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      - \"$ref\": \"#/components/parameters/access-token\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2021-05-05'\n        deprecationDate: '2020-02-14'\n        category: apps\n        subcategory: oauth-applications\n      deprecated: true\n  \"/applications/{client_id}/token\":\n    post:\n      summary: Check a token\n      description: OAuth applications can use a special API method for checking OAuth\n        token validity without exceeding the normal rate limits for failed login attempts.\n        Authentication works differently with this particular endpoint. You must use\n        [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication)\n        to use this endpoint, where the username is the OAuth application `client_id`\n        and the password is its `client_secret`. Invalid tokens will return `404 NOT\n        FOUND`.\n      tags:\n      - apps\n      operationId: apps/check-token\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#check-a-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                access_token:\n                  description: The access_token of the OAuth application.\n                  type: string\n              required:\n              - access_token\n              type: object\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-with-user\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: oauth-applications\n    patch:\n      summary: Reset a token\n      description: OAuth applications can use this API method to reset a valid OAuth\n        token without end-user involvement. Applications must save the \"token\" property\n        in the response because changes take effect immediately. You must use [Basic\n        Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication)\n        when accessing this endpoint, using the OAuth application's `client_id` and\n        `client_secret` as the username and password. Invalid tokens will return `404\n        NOT FOUND`.\n      tags:\n      - apps\n      operationId: apps/reset-token\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#reset-a-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                access_token:\n                  description: The access_token of the OAuth application.\n                  type: string\n              required:\n              - access_token\n              type: object\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-with-user\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: oauth-applications\n    delete:\n      summary: Delete an app token\n      description: OAuth application owners can revoke a single token for an OAuth\n        application. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication)\n        when accessing this endpoint, using the OAuth application's `client_id` and\n        `client_secret` as the username and password.\n      tags:\n      - apps\n      operationId: apps/delete-token\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#delete-an-app-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                access_token:\n                  type: string\n                  description: The OAuth access token used to authenticate to the\n                    GitHub API.\n              required:\n              - access_token\n            example:\n              access_token: e72e16c7e42f292c6912e7710c838347ae178b4a\n      responses:\n        '204':\n          description: Response\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: oauth-applications\n  \"/applications/{client_id}/token/scoped\":\n    post:\n      summary: Create a scoped access token\n      description: Use a non-scoped user-to-server OAuth access token to create a\n        repository scoped and/or permission scoped user-to-server OAuth access token.\n        You can specify which repositories the token can access and which permissions\n        are granted to the token. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication)\n        when accessing this endpoint, using the OAuth application's `client_id` and\n        `client_secret` as the username and password. Invalid tokens will return `404\n        NOT FOUND`.\n      tags:\n      - apps\n      operationId: apps/scope-token\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-scoped-access-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                access_token:\n                  type: string\n                  description: The OAuth access token used to authenticate to the\n                    GitHub API.\n                  examples:\n                  - e72e16c7e42f292c6912e7710c838347ae178b4a\n                target:\n                  description: The name of the user or organization to scope the user-to-server\n                    access token to. **Required** unless `target_id` is specified.\n                  type: string\n                  examples:\n                  - octocat\n                target_id:\n                  description: The ID of the user or organization to scope the user-to-server\n                    access token to. **Required** unless `target` is specified.\n                  type: integer\n                  examples:\n                  - 1\n                repositories:\n                  description: The list of repository names to scope the user-to-server\n                    access token to. `repositories` may not be specified if `repository_ids`\n                    is specified.\n                  type: array\n                  items:\n                    type: string\n                    examples:\n                    - rails\n                repository_ids:\n                  description: The list of repository IDs to scope the user-to-server\n                    access token to. `repository_ids` may not be specified if `repositories`\n                    is specified.\n                  type: array\n                  items:\n                    type: integer\n                  examples:\n                  - 1\n                permissions:\n                  \"$ref\": \"#/components/schemas/app-permissions\"\n              required:\n              - access_token\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/scope-token\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: oauth-applications\n  \"/applications/{client_id}/tokens/{access_token}\":\n    get:\n      summary: Check an authorization\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\n        OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.\n      tags:\n      - apps\n      operationId: apps/check-authorization\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#check-an-authorization\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      - \"$ref\": \"#/components/parameters/access-token\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                anyOf:\n                - type: 'null'\n                - \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-with-user\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2021-05-05'\n        deprecationDate: '2020-02-14'\n        category: apps\n        subcategory: oauth-applications\n      deprecated: true\n    post:\n      summary: Reset an authorization\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\n        OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \"token\" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.\n      tags:\n      - apps\n      operationId: apps/reset-authorization\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#reset-an-authorization\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      - \"$ref\": \"#/components/parameters/access-token\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-with-user\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2021-05-05'\n        deprecationDate: '2020-02-14'\n        category: apps\n        subcategory: oauth-applications\n      deprecated: true\n    delete:\n      summary: Revoke an authorization for an application\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\n        OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password.\n      tags:\n      - apps\n      operationId: apps/revoke-authorization-for-application\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#revoke-an-authorization-for-an-application\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      - \"$ref\": \"#/components/parameters/access-token\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2021-05-05'\n        deprecationDate: '2020-02-14'\n        category: apps\n        subcategory: oauth-applications\n      deprecated: true\n  \"/apps/{app_slug}\":\n    get:\n      summary: Get an app\n      description: |-\n        **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).\n\n        If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/get-by-slug\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps/#get-an-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/app-slug\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/integration\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/integration\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: apps\n        subcategory: \n  \"/authorizations\":\n    get:\n      summary: List your authorizations\n      description: \"**Deprecation Notice:** GitHub Enterprise Server will discontinue\n        the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations),\n        which is used by integrations to create personal access tokens and OAuth tokens,\n        and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow).\n        The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations)\n        will be removed on November, 13, 2020. For more information, including scheduled\n        brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\"\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/list-authorizations\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#list-your-authorizations\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - name: client_id\n        in: query\n        required: false\n        description: The client ID of your GitHub app.\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n    post:\n      summary: Create a new authorization\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n        **Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\n\n        Creates OAuth tokens using [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\"\n\n        To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them.\n\n        You can also create tokens on GitHub Enterprise Server from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://docs.github.com/articles/creating-an-access-token-for-command-line-use).\n\n        Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://docs.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on).\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/create-authorization\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#create-a-new-authorization\n      parameters: []\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                scopes:\n                  description: A list of scopes that this authorization is in.\n                  type:\n                  - array\n                  - 'null'\n                  items:\n                    type: string\n                  examples:\n                  - public_repo\n                  - user\n                note:\n                  description: A note to remind you what the OAuth token is for.\n                  type: string\n                  examples:\n                  - Update all gems\n                note_url:\n                  description: A URL to remind you what app the OAuth token is for.\n                  type: string\n                client_id:\n                  description: The OAuth app client key for which to create the token.\n                  maxLength: 20\n                  type: string\n                client_secret:\n                  description: The OAuth app client secret for which to create the\n                    token.\n                  maxLength: 40\n                  type: string\n                fingerprint:\n                  description: A unique string to distinguish an authorization from\n                    others created for the same client ID and user.\n                  type: string\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization\"\n          headers:\n            Location:\n              example: https://api.github.com/authorizations/1\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n  \"/authorizations/clients/{client_id}\":\n    put:\n      summary: Get-or-create an authorization for a specific app\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n        **Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\n\n        Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.\n\n        If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\"\n\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/get-or-create-authorization-for-app\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                client_secret:\n                  description: The OAuth app client secret for which to create the\n                    token.\n                  maxLength: 40\n                  type: string\n                scopes:\n                  description: A list of scopes that this authorization is in.\n                  type:\n                  - array\n                  - 'null'\n                  items:\n                    type: string\n                  examples:\n                  - public_repo\n                  - user\n                note:\n                  description: A note to remind you what the OAuth token is for.\n                  type: string\n                  examples:\n                  - Update all gems\n                note_url:\n                  description: A URL to remind you what app the OAuth token is for.\n                  type: string\n                fingerprint:\n                  description: A unique string to distinguish an authorization from\n                    others created for the same client ID and user.\n                  type: string\n              required:\n              - client_secret\n              type: object\n      responses:\n        '200':\n          description: if returning an existing token\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                response-if-returning-an-existing-token:\n                  \"$ref\": \"#/components/examples/authorization-response-if-returning-an-existing-token-2\"\n          headers:\n            Location:\n              example: https://api.github.com/authorizations/1\n              schema:\n                type: string\n        '201':\n          description: \"**Deprecation Notice:** GitHub will discontinue the [OAuth\n            Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations),\n            which is used by integrations to create personal access tokens and OAuth\n            tokens, and you must now create these tokens using our [web application\n            flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow).\n            The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations)\n            will be removed on November, 13, 2020. For more information, including\n            scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\"\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization\"\n          headers:\n            Location:\n              example: https://api.github.com/authorizations/1\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n  \"/authorizations/clients/{client_id}/{fingerprint}\":\n    put:\n      summary: Get-or-create an authorization for a specific app and fingerprint\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n        **Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\n\n        This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.\n\n        If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\"\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint\n      parameters:\n      - \"$ref\": \"#/components/parameters/client-id\"\n      - name: fingerprint\n        in: path\n        required: true\n        schema:\n          type: string\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                client_secret:\n                  description: The OAuth app client secret for which to create the\n                    token.\n                  maxLength: 40\n                  type: string\n                scopes:\n                  description: A list of scopes that this authorization is in.\n                  type:\n                  - array\n                  - 'null'\n                  items:\n                    type: string\n                  examples:\n                  - public_repo\n                  - user\n                note:\n                  description: A note to remind you what the OAuth token is for.\n                  type: string\n                  examples:\n                  - Update all gems\n                note_url:\n                  description: A URL to remind you what app the OAuth token is for.\n                  type: string\n              required:\n              - client_secret\n              type: object\n      responses:\n        '200':\n          description: if returning an existing token\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                response-if-returning-an-existing-token:\n                  \"$ref\": \"#/components/examples/authorization-response-if-returning-an-existing-token\"\n          headers:\n            Location:\n              example: https://api.github.com/authorizations/1\n              schema:\n                type: string\n        '201':\n          description: Response if returning a new token\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-3\"\n          headers:\n            Location:\n              example: https://api.github.com/authorizations/1\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n  \"/authorizations/{authorization_id}\":\n    get:\n      summary: Get a single authorization\n      description: \"**Deprecation Notice:** GitHub Enterprise Server will discontinue\n        the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations),\n        which is used by integrations to create personal access tokens and OAuth tokens,\n        and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow).\n        The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations)\n        will be removed on November, 13, 2020. For more information, including scheduled\n        brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\"\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/get-authorization\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#get-a-single-authorization\n      parameters:\n      - \"$ref\": \"#/components/parameters/authorization-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-2\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n    patch:\n      summary: Update an existing authorization\n      description: |-\n        **Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n        If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\"\n\n        You can only send one of these scope keys at a time.\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/update-authorization\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#update-an-existing-authorization\n      parameters:\n      - \"$ref\": \"#/components/parameters/authorization-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                scopes:\n                  description: A list of scopes that this authorization is in.\n                  type:\n                  - array\n                  - 'null'\n                  items:\n                    type: string\n                  examples:\n                  - public_repo\n                  - user\n                add_scopes:\n                  description: A list of scopes to add to this authorization.\n                  type: array\n                  items:\n                    type: string\n                remove_scopes:\n                  description: A list of scopes to remove from this authorization.\n                  type: array\n                  items:\n                    type: string\n                note:\n                  description: A note to remind you what the OAuth token is for.\n                  type: string\n                  examples:\n                  - Update all gems\n                note_url:\n                  description: A URL to remind you what app the OAuth token is for.\n                  type: string\n                fingerprint:\n                  description: A unique string to distinguish an authorization from\n                    others created for the same client ID and user.\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authorization\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authorization-2\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n    delete:\n      summary: Delete an authorization\n      description: \"**Deprecation Notice:** GitHub Enterprise Server will discontinue\n        the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations),\n        which is used by integrations to create personal access tokens and OAuth tokens,\n        and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow).\n        The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations)\n        will be removed on November, 13, 2020. For more information, including scheduled\n        brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\"\n      tags:\n      - oauth-authorizations\n      operationId: oauth-authorizations/delete-authorization\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/oauth-authorizations#delete-an-authorization\n      parameters:\n      - \"$ref\": \"#/components/parameters/authorization-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2020-11-13'\n        deprecationDate: '2020-02-14'\n        category: oauth-authorizations\n        subcategory: \n      deprecated: true\n  \"/codes_of_conduct\":\n    get:\n      summary: Get all codes of conduct\n      description: ''\n      tags:\n      - codes-of-conduct\n      operationId: codes-of-conduct/get-all-codes-of-conduct\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/codes-of-conduct#get-all-codes-of-conduct\n      parameters: []\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/code-of-conduct\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-of-conduct-simple-items\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: codes-of-conduct\n        subcategory: \n  \"/codes_of_conduct/{key}\":\n    get:\n      summary: Get a code of conduct\n      description: ''\n      tags:\n      - codes-of-conduct\n      operationId: codes-of-conduct/get-conduct-code\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/codes-of-conduct#get-a-code-of-conduct\n      parameters:\n      - name: key\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/code-of-conduct\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-of-conduct\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: codes-of-conduct\n        subcategory: \n  \"/emojis\":\n    get:\n      summary: Get emojis\n      description: Lists all the emojis available to use on GitHub Enterprise Server.\n      operationId: emojis/get\n      tags:\n      - emojis\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/emojis#get-emojis\n      parameters: []\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                type: object\n                additionalProperties:\n                  type: string\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: emojis\n        subcategory: \n  \"/enterprise/announcement\":\n    get:\n      summary: Get the global announcement banner\n      description: Gets the current message and expiration date of the global announcement\n        banner in your enterprise.\n      tags:\n      - enterprise-admin\n      operationId: enterprise-admin/get-announcement\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/announcement\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/announcement\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: announcement\n    patch:\n      summary: Set the global announcement banner\n      description: Sets the message and expiration time for the global announcement\n        banner in your enterprise.\n      tags:\n      - enterprise-admin\n      operationId: enterprise-admin/set-announcement\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              \"$ref\": \"#/components/schemas/announcement\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/announcement\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/announcement\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: announcement\n    delete:\n      summary: Remove the global announcement banner\n      description: Removes the global announcement banner in your enterprise.\n      tags:\n      - enterprise-admin\n      operationId: enterprise-admin/remove-announcement\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: announcement\n  \"/enterprise/settings/license\":\n    get:\n      summary: Get license information\n      description: ''\n      operationId: enterprise-admin/get-license-information\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-license-information\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/license-info\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/license-info\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: license\n  \"/enterprise/stats/all\":\n    get:\n      summary: Get all statistics\n      description: ''\n      operationId: enterprise-admin/get-all-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-overview\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/enterprise-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/comments\":\n    get:\n      summary: Get comment statistics\n      description: ''\n      operationId: enterprise-admin/get-comment-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-comment-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-comment-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/gists\":\n    get:\n      summary: Get gist statistics\n      description: ''\n      operationId: enterprise-admin/get-gist-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-gist-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-gist-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/hooks\":\n    get:\n      summary: Get hooks statistics\n      operationId: enterprise-admin/get-hooks-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-hooks-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-hook-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/issues\":\n    get:\n      summary: Get issue statistics\n      description: ''\n      operationId: enterprise-admin/get-issue-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-issues-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-issue-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/milestones\":\n    get:\n      summary: Get milestone statistics\n      description: ''\n      operationId: enterprise-admin/get-milestone-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-milestone-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-milestone-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/orgs\":\n    get:\n      summary: Get organization statistics\n      description: ''\n      operationId: enterprise-admin/get-org-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-organization-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-organization-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/pages\":\n    get:\n      summary: Get pages statistics\n      description: ''\n      operationId: enterprise-admin/get-pages-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-pages-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-page-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/pulls\":\n    get:\n      summary: Get pull request statistics\n      description: ''\n      operationId: enterprise-admin/get-pull-request-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-pull-requests-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-pull-request-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/repos\":\n    get:\n      summary: Get repository statistics\n      operationId: enterprise-admin/get-repo-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-repository-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-repository-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprise/stats/users\":\n    get:\n      summary: Get users statistics\n      description: ''\n      operationId: enterprise-admin/get-user-stats\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-users-statistics\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-user-overview\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: admin-stats\n  \"/enterprises/{enterprise}/actions/permissions\":\n    get:\n      summary: Get GitHub Actions permissions for an enterprise\n      description: |-\n        Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/get-github-actions-permissions-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-github-actions-permissions-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/actions-enterprise-permissions\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/actions-enterprise-permissions\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    put:\n      summary: Set GitHub Actions permissions for an enterprise\n      description: |-\n        Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/set-github-actions-permissions-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-github-actions-permissions-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                enabled_organizations:\n                  \"$ref\": \"#/components/schemas/enabled-organizations\"\n                allowed_actions:\n                  \"$ref\": \"#/components/schemas/allowed-actions\"\n              required:\n              - enabled_organizations\n            example:\n              enabled_organizations: all\n              allowed_actions: selected\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/enterprises/{enterprise}/actions/permissions/organizations\":\n    get:\n      summary: List selected organizations enabled for GitHub Actions in an enterprise\n      description: |-\n        Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/list-selected-organizations-enabled-github-actions-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  total_count:\n                    type: number\n                  organizations:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/organization-simple\"\n                required:\n                - total_count\n                - organizations\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-targets\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    put:\n      summary: Set selected organizations enabled for GitHub Actions in an enterprise\n      description: |-\n        Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/set-selected-organizations-enabled-github-actions-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                selected_organization_ids:\n                  description: List of organization IDs to enable for GitHub Actions.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the organization.\n              required:\n              - selected_organization_ids\n            example:\n              selected_organization_ids:\n              - 32\n              - 91\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/enterprises/{enterprise}/actions/permissions/organizations/{org_id}\":\n    put:\n      summary: Enable a selected organization for GitHub Actions in an enterprise\n      description: |-\n        Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/enable-selected-organization-github-actions-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#enable-a-selected-organization-for-github-actions-in-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/org-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    delete:\n      summary: Disable a selected organization for GitHub Actions in an enterprise\n      description: |-\n        Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/disable-selected-organization-github-actions-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#disable-a-selected-organization-for-github-actions-in-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/org-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/enterprises/{enterprise}/actions/permissions/selected-actions\":\n    get:\n      summary: Get allowed actions for an enterprise\n      description: |-\n        Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/get-allowed-actions-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-allowed-actions-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/selected-actions\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/selected-actions\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    put:\n      summary: Set allowed actions for an enterprise\n      description: |-\n        Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/set-allowed-actions-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-allowed-actions-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              \"$ref\": \"#/components/schemas/selected-actions\"\n            examples:\n              selected_actions:\n                \"$ref\": \"#/components/examples/selected-actions\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/enterprises/{enterprise}/actions/runner-groups\":\n    get:\n      summary: List self-hosted runner groups for an enterprise\n      description: |-\n        Lists all self-hosted runner groups for an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/list-self-hosted-runner-groups-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runner-groups-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  total_count:\n                    type: number\n                  runner_groups:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/runner-groups-enterprise\"\n                required:\n                - total_count\n                - runner_groups\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-groups-enterprise\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    post:\n      summary: Create a self-hosted runner group for an enterprise\n      description: |-\n        Creates a new self-hosted runner group for an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/create-self-hosted-runner-group-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-self-hosted-runner-group-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  description: Name of the runner group.\n                  type: string\n                visibility:\n                  description: 'Visibility of a runner group. You can select all organizations\n                    or select individual organization. Can be one of: `all` or `selected`'\n                  type: string\n                  enum:\n                  - selected\n                  - all\n                selected_organization_ids:\n                  description: List of organization IDs that can access the runner\n                    group.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the organization.\n                runners:\n                  description: List of runner IDs to add to the runner group.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the runner.\n                allows_public_repositories:\n                  description: Whether the runner group can be used by `public` repositories.\n                  type: boolean\n                  default: false\n              required:\n              - name\n            example:\n              name: Expensive hardware runners\n              visibility: selected\n              selected_organization_ids:\n              - 32\n              - 91\n              runners:\n              - 9\n              - 2\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner-groups-enterprise\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-group-enterprise\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}\":\n    get:\n      summary: Get a self-hosted runner group for an enterprise\n      description: |-\n        Gets a specific self-hosted runner group for an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/get-self-hosted-runner-group-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-group-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner-groups-enterprise\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-group-enterprise\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    patch:\n      summary: Update a self-hosted runner group for an enterprise\n      description: |-\n        Updates the `name` and `visibility` of a self-hosted runner group in an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/update-self-hosted-runner-group-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#update-a-self-hosted-runner-group-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  description: Name of the runner group.\n                  type: string\n                visibility:\n                  description: 'Visibility of a runner group. You can select all organizations\n                    or select individual organizations. Can be one of: `all` or `selected`'\n                  type: string\n                  enum:\n                  - selected\n                  - all\n                  default: all\n                allows_public_repositories:\n                  description: Whether the runner group can be used by `public` repositories.\n                  type: boolean\n                  default: false\n            example:\n              name: Expensive hardware runners\n              visibility: selected\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner-groups-enterprise\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-group-update-enterprise\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    delete:\n      summary: Delete a self-hosted runner group from an enterprise\n      description: |-\n        Deletes a self-hosted runner group for an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/delete-self-hosted-runner-group-from-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\":\n    get:\n      summary: List organization access to a self-hosted runner group in an enterprise\n      description: |-\n        Lists the organizations with access to a self-hosted runner group.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/list-org-access-to-self-hosted-runner-group-in-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-organization-access-to-a-self-hosted-runner-group-in-a-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  total_count:\n                    type: number\n                  organizations:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/organization-simple\"\n                required:\n                - total_count\n                - organizations\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-targets\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    put:\n      summary: Set organization access for a self-hosted runner group in an enterprise\n      description: |-\n        Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/set-org-access-to-self-hosted-runner-group-in-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-organization-access-to-a-self-hosted-runner-group-in-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                selected_organization_ids:\n                  description: List of organization IDs that can access the runner\n                    group.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the organization.\n              required:\n              - selected_organization_ids\n            example:\n              selected_organization_ids:\n              - 32\n              - 91\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}\":\n    put:\n      summary: Add organization access to a self-hosted runner group in an enterprise\n      description: |-\n        Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \"[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise).\"\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/add-org-access-to-self-hosted-runner-group-in-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/org-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    delete:\n      summary: Remove organization access to a self-hosted runner group in an enterprise\n      description: |-\n        Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \"[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise).\"\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/remove-org-access-to-self-hosted-runner-group-in-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/org-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\":\n    get:\n      summary: List self-hosted runners in a group for an enterprise\n      description: |-\n        Lists the self-hosted runners that are in a specific enterprise group.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/list-self-hosted-runners-in-group-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  total_count:\n                    type: number\n                  runners:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/runner\"\n                required:\n                - total_count\n                - runners\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    put:\n      summary: Set self-hosted runners in a group for an enterprise\n      description: |-\n        Replaces the list of self-hosted runners that are part of an enterprise runner group.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/set-self-hosted-runners-in-group-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                runners:\n                  description: List of runner IDs to add to the runner group.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the runner.\n              required:\n              - runners\n            example:\n              runners:\n              - 9\n              - 2\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\":\n    put:\n      summary: Add a self-hosted runner to a group for an enterprise\n      description: |-\n        Adds a self-hosted runner to a runner group configured in an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise`\n        scope to use this endpoint.\n      operationId: enterprise-admin/add-self-hosted-runner-to-group-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    delete:\n      summary: Remove a self-hosted runner from a group for an enterprise\n      description: |-\n        Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/remove-self-hosted-runner-from-group-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/enterprises/{enterprise}/actions/runners\":\n    get:\n      summary: List self-hosted runners for an enterprise\n      description: |-\n        Lists all self-hosted runners configured for an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/list-self-hosted-runners-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  total_count:\n                    type: number\n                  runners:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/runner\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runners\n  \"/enterprises/{enterprise}/actions/runners/downloads\":\n    get:\n      summary: List runner applications for an enterprise\n      description: |-\n        Lists binaries for the runner application that you can download and run.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/list-runner-applications-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-runner-applications-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/runner-application\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-application-items\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runners\n  \"/enterprises/{enterprise}/actions/runners/registration-token\":\n    post:\n      summary: Create a registration token for an enterprise\n      description: |-\n        Returns a token that you can pass to the `config` script. The token expires after one hour.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n\n        #### Example using registration token\n\n        Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n        ```\n        ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN\n        ```\n      operationId: enterprise-admin/create-registration-token-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-registration-token-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authentication-token\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authentication-token\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runners\n  \"/enterprises/{enterprise}/actions/runners/remove-token\":\n    post:\n      summary: Create a remove token for an enterprise\n      description: |-\n        Returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n\n        #### Example using remove token\n\n        To remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by this\n        endpoint.\n\n        ```\n        ./config.sh remove --token TOKEN\n        ```\n      operationId: enterprise-admin/create-remove-token-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-remove-token-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authentication-token\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authentication-token-2\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runners\n  \"/enterprises/{enterprise}/actions/runners/{runner_id}\":\n    get:\n      summary: Get a self-hosted runner for an enterprise\n      description: |-\n        Gets a specific self-hosted runner configured in an enterprise.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/get-self-hosted-runner-for-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-for-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner\"\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runners\n    delete:\n      summary: Delete a self-hosted runner from an enterprise\n      description: |-\n        Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\n\n        You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n      operationId: enterprise-admin/delete-self-hosted-runner-from-enterprise\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-self-hosted-runner-from-an-enterprise\n      parameters:\n      - \"$ref\": \"#/components/parameters/enterprise\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: false\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runners\n  \"/events\":\n    get:\n      summary: List public events\n      description: We delay the public events feed by five minutes, which means the\n        most recent event returned by the public events API actually occurred at least\n        five minutes ago.\n      tags:\n      - activity\n      operationId: activity/list-public-events\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-events\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: events\n  \"/feeds\":\n    get:\n      summary: Get feeds\n      description: |-\n        GitHub Enterprise Server provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user:\n\n        *   **Timeline**: The GitHub Enterprise Server global public timeline\n        *   **User**: The public timeline for any user, using [URI template](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#hypermedia)\n        *   **Current user public**: The public timeline for the authenticated user\n        *   **Current user**: The private timeline for the authenticated user\n        *   **Current user actor**: The private timeline for activity created by the authenticated user\n        *   **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.\n        *   **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub Enterprise Server.\n\n        **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens.\n      tags:\n      - activity\n      operationId: activity/get-feeds\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-feeds\n      parameters: []\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/feed\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/feed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: feeds\n  \"/gists\":\n    get:\n      summary: List gists for the authenticated user\n      description: 'Lists the authenticated user''s gists or if called anonymously,\n        this endpoint returns all public gists:'\n      tags:\n      - gists\n      operationId: gists/list\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gists-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/base-gist\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/base-gist-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n    post:\n      summary: Create a gist\n      description: |-\n        Allows you to add a new gist with one or more files.\n\n        **Note:** Don't name your files \"gistfile\" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.\n      operationId: gists/create\n      tags:\n      - gists\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#create-a-gist\n      parameters: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                description:\n                  description: Description of the gist\n                  type: string\n                  examples:\n                  - Example Ruby script\n                files:\n                  description: Names and content for the files that make up the gist\n                  type: object\n                  additionalProperties:\n                    type: object\n                    properties:\n                      content:\n                        description: Content of the file\n                        readOnly: false\n                        type: string\n                    required:\n                    - content\n                  examples:\n                  - hello.rb:\n                      content: puts \"Hello, World!\"\n                public:\n                  oneOf:\n                  - description: Flag indicating whether the gist is public\n                    type: boolean\n                    default: false\n                    examples:\n                    - true\n                  - type: string\n                    default: 'false'\n                    enum:\n                    - 'true'\n                    - 'false'\n                    examples:\n                    - 'true'\n              required:\n              - files\n              type: object\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gist-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist\"\n          headers:\n            Location:\n              example: https://api.github.com/gists/aa5a315d61ae9438b18d\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/gists/public\":\n    get:\n      summary: List public gists\n      description: |-\n        List public gists sorted by most recently updated to least recently updated.\n\n        Note: With [pagination](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.\n      tags:\n      - gists\n      operationId: gists/list-public\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-public-gists\n      parameters:\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/base-gist\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/base-gist-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/gists/starred\":\n    get:\n      summary: List starred gists\n      description: 'List the authenticated user''s starred gists:'\n      tags:\n      - gists\n      operationId: gists/list-starred\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-starred-gists\n      parameters:\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/base-gist\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/base-gist-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/gists/{gist_id}\":\n    get:\n      summary: Get a gist\n      description: ''\n      tags:\n      - gists\n      operationId: gists/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#get-a-gist\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gist-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden_gist\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n    patch:\n      summary: Update a gist\n      description: Allows you to update or delete a gist file and rename gist files.\n        Files from the previous version of the gist that aren't explicitly changed\n        during an edit are unchanged.\n      tags:\n      - gists\n      operationId: gists/update\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists/#update-a-gist\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                description:\n                  description: Description of the gist\n                  type: string\n                  examples:\n                  - Example Ruby script\n                files:\n                  description: Names of files to be updated\n                  type: object\n                  additionalProperties:\n                    type:\n                    - object\n                    - 'null'\n                    properties:\n                      content:\n                        description: The new content of the file\n                        type: string\n                      filename:\n                        description: The new filename for the file\n                        type:\n                        - string\n                        - 'null'\n                    anyOf:\n                    - required:\n                      - content\n                    - required:\n                      - filename\n                    - type: object\n                      maxProperties: 0\n                  examples:\n                  - hello.rb:\n                      content: blah\n                      filename: goodbye.rb\n              anyOf:\n              - required:\n                - description\n              - required:\n                - files\n              type:\n              - object\n              - 'null'\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gist-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n    delete:\n      summary: Delete a gist\n      description: ''\n      tags:\n      - gists\n      operationId: gists/delete\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#delete-a-gist\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/gists/{gist_id}/comments\":\n    get:\n      summary: List gist comments\n      description: ''\n      tags:\n      - gists\n      operationId: gists/list-comments\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gist-comments\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/gist-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: comments\n    post:\n      summary: Create a gist comment\n      description: ''\n      tags:\n      - gists\n      operationId: gists/create-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#create-a-gist-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                body:\n                  description: The comment text.\n                  type: string\n                  maxLength: 65535\n                  examples:\n                  - Body of the attachment\n              type: object\n              required:\n              - body\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gist-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist-comment\"\n          headers:\n            Location:\n              example: https://api.github.com/gists/a6db0bec360bb87e9418/comments/1\n              schema:\n                type: string\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: comments\n  \"/gists/{gist_id}/comments/{comment_id}\":\n    get:\n      summary: Get a gist comment\n      description: ''\n      tags:\n      - gists\n      operationId: gists/get-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#get-a-gist-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gist-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist-comment\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden_gist\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: comments\n    patch:\n      summary: Update a gist comment\n      description: ''\n      tags:\n      - gists\n      operationId: gists/update-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#update-a-gist-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                body:\n                  description: The comment text.\n                  type: string\n                  maxLength: 65535\n                  examples:\n                  - Body of the attachment\n              type: object\n              required:\n              - body\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gist-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist-comment\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: comments\n    delete:\n      summary: Delete a gist comment\n      description: ''\n      tags:\n      - gists\n      operationId: gists/delete-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#delete-a-gist-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: comments\n  \"/gists/{gist_id}/commits\":\n    get:\n      summary: List gist commits\n      description: ''\n      tags:\n      - gists\n      operationId: gists/list-commits\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gist-commits\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/gist-commit\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist-commit-items\"\n          headers:\n            Link:\n              example: <https://api.github.com/resource?page=2>; rel=\"next\"\n              schema:\n                type: string\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/gists/{gist_id}/forks\":\n    get:\n      summary: List gist forks\n      description: ''\n      tags:\n      - gists\n      operationId: gists/list-forks\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gist-forks\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/gist-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist-fork-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n    post:\n      summary: Fork a gist\n      description: \"**Note**: This was previously `/gists/:gist_id/fork`.\"\n      tags:\n      - gists\n      operationId: gists/fork\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#fork-a-gist\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/base-gist\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/base-gist\"\n          headers:\n            Location:\n              example: https://api.github.com/gists/aa5a315d61ae9438b18d\n              schema:\n                type: string\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/gists/{gist_id}/star\":\n    get:\n      summary: Check if a gist is starred\n      description: ''\n      tags:\n      - gists\n      operationId: gists/check-is-starred\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#check-if-a-gist-is-starred\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      responses:\n        '204':\n          description: Response if gist is starred\n        '404':\n          description: Not Found if gist is not starred\n          content:\n            application/json:\n              schema:\n                type: object\n                properties: {}\n                additionalProperties: false\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n    put:\n      summary: Star a gist\n      description: Note that you'll need to set `Content-Length` to zero when calling\n        out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n      tags:\n      - gists\n      operationId: gists/star\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#star-a-gist\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n    delete:\n      summary: Unstar a gist\n      description: ''\n      tags:\n      - gists\n      operationId: gists/unstar\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#unstar-a-gist\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/gists/{gist_id}/{sha}\":\n    get:\n      summary: Get a gist revision\n      description: ''\n      tags:\n      - gists\n      operationId: gists/get-revision\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#get-a-gist-revision\n      parameters:\n      - \"$ref\": \"#/components/parameters/gist-id\"\n      - name: sha\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gist-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gist\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/gitignore/templates\":\n    get:\n      summary: Get all gitignore templates\n      description: List all templates available to pass as an option when [creating\n        a repository](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-for-the-authenticated-user).\n      operationId: gitignore/get-all-templates\n      tags:\n      - gitignore\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gitignore#get-all-gitignore-templates\n      parameters: []\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  type: string\n              example:\n              - Actionscript\n              - Android\n              - AppceleratorTitanium\n              - Autotools\n              - Bancha\n              - C\n              - C++\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: gitignore\n        subcategory: \n  \"/gitignore/templates/{name}\":\n    get:\n      summary: Get a gitignore template\n      description: |-\n        The API also allows fetching the source of a single template.\n        Use the raw [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) to get the raw contents.\n      operationId: gitignore/get-template\n      tags:\n      - gitignore\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gitignore#get-a-gitignore-template\n      parameters:\n      - name: name\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gitignore-template\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gitignore-template\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: gitignore\n        subcategory: \n  \"/installation/repositories\":\n    get:\n      summary: List repositories accessible to the app installation\n      description: |-\n        List repositories that an app installation can access.\n\n        You must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/list-repos-accessible-to-installation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-repositories-accessible-to-the-app-installation\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - repositories\n                properties:\n                  total_count:\n                    type: integer\n                  repositories:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/repository\"\n                  repository_selection:\n                    type: string\n                    examples:\n                    - selected\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-paginated-2\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: apps\n        subcategory: installations\n        previews:\n        - required: false\n          name: mercy\n          note: |-\n            The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.mercy-preview+json\n            ```\n  \"/installation/token\":\n    delete:\n      summary: Revoke an installation access token\n      description: |-\n        Revokes the installation token you're using to authenticate as an installation and access this endpoint.\n\n        Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the \"[Create an installation access token for an app](https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-an-installation-access-token-for-an-app)\" endpoint.\n\n        You must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/revoke-installation-access-token\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#revoke-an-installation-access-token\n      parameters: []\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: apps\n        subcategory: installations\n  \"/issues\":\n    get:\n      summary: List issues assigned to the authenticated user\n      description: |-\n        List issues assigned to the authenticated user across all visible repositories including owned repositories, member\n        repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not\n        necessarily assigned to you.\n\n\n        **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\n        reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\n        the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\n        request id, use the \"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\" endpoint.\n      tags:\n      - issues\n      operationId: issues/list\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issues-assigned-to-the-authenticated-user\n      parameters:\n      - name: filter\n        description: \"Indicates which sorts of issues to return. Can be one of:  \\n\\\\*\n          `assigned`: Issues assigned to you  \\n\\\\* `created`: Issues created by you\n          \\ \\n\\\\* `mentioned`: Issues mentioning you  \\n\\\\* `subscribed`: Issues you're\n          subscribed to updates for  \\n\\\\* `all` or `repos`: All issues the authenticated\n          user can see, regardless of participation or creation\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - assigned\n          - created\n          - mentioned\n          - subscribed\n          - repos\n          - all\n          default: assigned\n      - name: state\n        description: Indicates the state of the issues to return. Can be either `open`,\n          `closed`, or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - \"$ref\": \"#/components/parameters/labels\"\n      - name: sort\n        description: What to sort results by. Can be either `created`, `updated`,\n          `comments`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - comments\n          default: created\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - name: collab\n        in: query\n        required: false\n        schema:\n          type: boolean\n      - name: orgs\n        in: query\n        required: false\n        schema:\n          type: boolean\n      - name: owned\n        in: query\n        required: false\n        schema:\n          type: boolean\n      - name: pulls\n        in: query\n        required: false\n        schema:\n          type: boolean\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-with-repo-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: issues\n        previews:\n        - required: false\n          name: machine-man\n          note: \"If an issue event is created via a GitHub App, the response will\n            include the `performed_via_github_app` object with\\tinformation about\n            the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo\n            receive the `performed_via_github_app` object in the response, you must\n            provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types)\n            in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/licenses\":\n    get:\n      summary: Get all commonly used licenses\n      description: ''\n      tags:\n      - licenses\n      operationId: licenses/get-all-commonly-used\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/licenses#get-all-commonly-used-licenses\n      parameters:\n      - name: featured\n        in: query\n        required: false\n        schema:\n          type: boolean\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/license-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/license-simple-items\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: licenses\n        subcategory: \n  \"/licenses/{license}\":\n    get:\n      summary: Get a license\n      description: ''\n      tags:\n      - licenses\n      operationId: licenses/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/licenses#get-a-license\n      parameters:\n      - name: license\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/license\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/license\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: licenses\n        subcategory: \n  \"/markdown\":\n    post:\n      summary: Render a Markdown document\n      description: ''\n      operationId: markdown/render\n      tags:\n      - markdown\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/markdown#render-a-markdown-document\n      parameters: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                text:\n                  description: The Markdown text to render in HTML.\n                  type: string\n                mode:\n                  description: The rendering mode. Can be either `markdown` or `gfm`.\n                  enum:\n                  - markdown\n                  - gfm\n                  default: markdown\n                  type: string\n                  examples:\n                  - markdown\n                context:\n                  description: The repository context to use when creating references\n                    in `gfm` mode.  For example, setting `context` to `octo-org/octo-repo`\n                    will change the text `#42` into an HTML link to issue 42 in the\n                    `octo-org/octo-repo` repository.\n                  type: string\n              required:\n              - text\n              type: object\n      responses:\n        '200':\n          description: Response\n          headers:\n            Content-Type:\n              \"$ref\": \"#/components/headers/content-type\"\n            Content-Length:\n              example: '279'\n              schema:\n                type: string\n            X-CommonMarker-Version:\n              \"$ref\": \"#/components/headers/x-common-marker-version\"\n          content:\n            text/html:\n              schema:\n                type: string\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: markdown\n        subcategory: \n  \"/markdown/raw\":\n    post:\n      summary: Render a Markdown document in raw mode\n      description: You must send Markdown as plain text (using a `Content-Type` header\n        of `text/plain` or `text/x-markdown`) to this endpoint, rather than using\n        JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/)\n        is not supported and Markdown will be rendered in plain format like a README.md\n        file. Markdown content must be 400 KB or less.\n      operationId: markdown/render-raw\n      tags:\n      - markdown\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/markdown#render-a-markdown-document-in-raw-mode\n      parameters: []\n      requestBody:\n        required: false\n        content:\n          text/plain:\n            schema:\n              type: string\n          text/x-markdown:\n            schema:\n              type: string\n      responses:\n        '200':\n          description: Response\n          headers:\n            X-CommonMarker-Version:\n              \"$ref\": \"#/components/headers/x-common-marker-version\"\n          content:\n            text/html:\n              schema:\n                type: string\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: markdown\n        subcategory: \n  \"/meta\":\n    get:\n      summary: Get GitHub Enterprise Server meta information\n      description: ''\n      tags:\n      - meta\n      operationId: meta/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/meta#get-github-meta-information\n      parameters: []\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/api-overview\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/api-overview\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: meta\n        subcategory: \n  \"/networks/{owner}/{repo}/events\":\n    get:\n      summary: List public events for a network of repositories\n      description: ''\n      tags:\n      - activity\n      operationId: activity/list-public-events-for-repo-network\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-events-for-a-network-of-repositories\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '301':\n          \"$ref\": \"#/components/responses/moved_permanently\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: events\n  \"/notifications\":\n    get:\n      summary: List notifications for the authenticated user\n      description: List all notifications for the current user, sorted by most recently\n        updated.\n      tags:\n      - activity\n      operationId: activity/list-notifications-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-notifications-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/all\"\n      - \"$ref\": \"#/components/parameters/participating\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/before\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/thread\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/thread-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n    put:\n      summary: Mark notifications as read\n      description: Marks all notifications as \"read\" removes it from the [default\n        view on GitHub Enterprise Server](https://github.com/notifications). If the\n        number of notifications is too large to complete in one request, you will\n        receive a `202 Accepted` status and GitHub Enterprise Server will run an asynchronous\n        process to mark notifications as \"read.\" To check whether any \"unread\" notifications\n        remain, you can use the [List notifications for the authenticated user](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-notifications-for-the-authenticated-user)\n        endpoint and pass the query parameter `all=false`.\n      tags:\n      - activity\n      operationId: activity/mark-notifications-as-read\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#mark-notifications-as-read\n      parameters: []\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                last_read_at:\n                  description: Describes the last point that notifications were checked.\n                  type: string\n                  format: date-time\n                read:\n                  description: Whether the notification has been read.\n                  type: boolean\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n        '205':\n          description: Reset Content\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n  \"/notifications/threads/{thread_id}\":\n    get:\n      summary: Get a thread\n      description: ''\n      tags:\n      - activity\n      operationId: activity/get-thread\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-a-thread\n      parameters:\n      - \"$ref\": \"#/components/parameters/thread-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/thread\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/thread\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n    patch:\n      summary: Mark a thread as read\n      description: ''\n      tags:\n      - activity\n      operationId: activity/mark-thread-as-read\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#mark-a-thread-as-read\n      parameters:\n      - \"$ref\": \"#/components/parameters/thread-id\"\n      responses:\n        '205':\n          description: Reset Content\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n  \"/notifications/threads/{thread_id}/subscription\":\n    get:\n      summary: Get a thread subscription for the authenticated user\n      description: |-\n        This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-a-repository-subscription).\n\n        Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.\n      tags:\n      - activity\n      operationId: activity/get-thread-subscription-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-a-thread-subscription-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/thread-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/thread-subscription\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/thread-subscription\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n    put:\n      summary: Set a thread subscription\n      description: |-\n        If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.\n\n        You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.\n\n        Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-thread-subscription) endpoint.\n      tags:\n      - activity\n      operationId: activity/set-thread-subscription\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#set-a-thread-subscription\n      parameters:\n      - \"$ref\": \"#/components/parameters/thread-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              properties:\n                ignored:\n                  description: Whether to block all notifications from a thread.\n                  default: false\n                  type: boolean\n              type: object\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/thread-subscription\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/thread-subscription\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n    delete:\n      summary: Delete a thread subscription\n      description: Mutes all future notifications for a conversation until you comment\n        on the thread or get an **@mention**. If you are watching the repository of\n        the thread, you will still receive notifications. To ignore future notifications\n        for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#set-a-thread-subscription)\n        endpoint and set `ignore` to `true`.\n      tags:\n      - activity\n      operationId: activity/delete-thread-subscription\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-thread-subscription\n      parameters:\n      - \"$ref\": \"#/components/parameters/thread-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n  \"/octocat\":\n    get:\n      summary: Get Octocat\n      description: Get the octocat as ASCII art\n      tags:\n      - meta\n      operationId: meta/get-octocat\n      parameters:\n      - name: s\n        in: query\n        description: The words to show in Octocat's speech bubble\n        schema:\n          type: string\n        required: false\n      responses:\n        '200':\n          description: Response\n          content:\n            application/octocat-stream:\n              schema:\n                type: string\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/meta#get-octocat\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: meta\n  \"/organizations\":\n    get:\n      summary: List organizations\n      description: |-\n        Lists all organizations, in the order that they were created on GitHub Enterprise Server.\n\n        **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations.\n      tags:\n      - orgs\n      operationId: orgs/list\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organizations\n      parameters:\n      - \"$ref\": \"#/components/parameters/since-org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/organization-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-simple-items\"\n          headers:\n            Link:\n              example: <https://api.github.com/organizations?since=135>; rel=\"next\"\n              schema:\n                type: string\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: \n  \"/orgs/{org}\":\n    get:\n      summary: Get an organization\n      description: |-\n        To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).\n\n        GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub Enterprise Server plan. See \"[Authenticating with GitHub Apps](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/)\" for details. For an example response, see 'Response with GitHub Enterprise Server plan information' below.\"\n      tags:\n      - orgs\n      operationId: orgs/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/organization-full\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/organization-full-default-response\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        previews:\n        - required: false\n          name: surtur\n          note: |-\n            New repository creation permissions are available to preview. You can now use `members_can_create_public_repositories`, `members_can_create_private_repositories`, and `members_can_create_internal_repositories`. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. These parameters provide more granular permissions to configure the type of repositories organization members can create.\n\n            To access these new parameters during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.surtur-preview+json\n            ```\n    patch:\n      summary: Update an organization\n      description: |-\n        **Parameter Deprecation Notice:** GitHub Enterprise Server will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).\n\n        Enables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges.\n      tags:\n      - orgs\n      operationId: orgs/update\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs/#update-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                billing_email:\n                  type: string\n                  description: Billing email address. This address is not publicized.\n                company:\n                  type: string\n                  description: The company name.\n                email:\n                  type: string\n                  description: The publicly visible email address.\n                twitter_username:\n                  type: string\n                  description: The Twitter username of the company.\n                location:\n                  type: string\n                  description: The location.\n                name:\n                  type: string\n                  description: The shorthand name of the company.\n                description:\n                  type: string\n                  description: The description of the company.\n                has_organization_projects:\n                  type: boolean\n                  description: Toggles whether an organization can use organization\n                    projects.\n                has_repository_projects:\n                  type: boolean\n                  description: Toggles whether repositories that belong to the organization\n                    can use repository projects.\n                default_repository_permission:\n                  type: string\n                  description: \"Default permission level members have for organization\n                    repositories:  \\n\\\\* `read` - can pull, but not push to or administer\n                    this repository.  \\n\\\\* `write` - can pull and push, but not administer\n                    this repository.  \\n\\\\* `admin` - can pull, push, and administer\n                    this repository.  \\n\\\\* `none` - no permissions granted by default.\"\n                  enum:\n                  - read\n                  - write\n                  - admin\n                  - none\n                  default: read\n                members_can_create_repositories:\n                  type: boolean\n                  description: \"Toggles the ability of non-admin organization members\n                    to create repositories. Can be one of:  \\n\\\\* `true` - all organization\n                    members can create repositories.  \\n\\\\* `false` - only organization\n                    owners can create repositories.  \\nDefault: `true`  \\n**Note:**\n                    A parameter can override this parameter. See `members_allowed_repository_creation_type`\n                    in this table for details. **Note:** A parameter can override\n                    this parameter. See `members_allowed_repository_creation_type`\n                    in this table for details.\"\n                  default: true\n                members_can_create_internal_repositories:\n                  type: boolean\n                  description: \"Toggles whether organization members can create internal\n                    repositories, which are visible to all enterprise members. You\n                    can only allow members to create internal repositories if your\n                    organization is associated with an enterprise account using GitHub\n                    Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one\n                    of:  \\n\\\\* `true` - all organization members can create internal\n                    repositories.  \\n\\\\* `false` - only organization owners can create\n                    internal repositories.  \\nDefault: `true`. For more information,\n                    see \\\"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\\\"\n                    in the GitHub Help documentation.\"\n                members_can_create_private_repositories:\n                  type: boolean\n                  description: \"Toggles whether organization members can create private\n                    repositories, which are visible to organization members with permission.\n                    Can be one of:  \\n\\\\* `true` - all organization members can create\n                    private repositories.  \\n\\\\* `false` - only organization owners\n                    can create private repositories.  \\nDefault: `true`. For more\n                    information, see \\\"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\\\"\n                    in the GitHub Help documentation.\"\n                members_can_create_public_repositories:\n                  type: boolean\n                  description: \"Toggles whether organization members can create public\n                    repositories, which are visible to anyone. Can be one of:  \\n\\\\*\n                    `true` - all organization members can create public repositories.\n                    \\ \\n\\\\* `false` - only organization owners can create public repositories.\n                    \\ \\nDefault: `true`. For more information, see \\\"[Restricting\n                    repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\\\"\n                    in the GitHub Help documentation.\"\n                members_allowed_repository_creation_type:\n                  type: string\n                  description: \"Specifies which types of repositories non-admin organization\n                    members can create. Can be one of:  \\n\\\\* `all` - all organization\n                    members can create public and private repositories.  \\n\\\\* `private`\n                    - members can create private repositories. This option is only\n                    available to repositories that are part of an organization on\n                    GitHub Enterprise Cloud.  \\n\\\\* `none` - only admin members can\n                    create repositories.  \\n**Note:** This parameter is deprecated\n                    and will be removed in the future. Its return value ignores internal\n                    repositories. Using this parameter overrides values set in `members_can_create_repositories`.\n                    See the parameter deprecation notice in the operation description\n                    for details.\"\n                  enum:\n                  - all\n                  - private\n                  - none\n                members_can_create_pages:\n                  type: boolean\n                  description: \"Toggles whether organization members can create GitHub\n                    Pages sites. Can be one of:  \\n\\\\* `true` - all organization members\n                    can create GitHub Pages sites.  \\n\\\\* `false` - no organization\n                    members can create GitHub Pages sites. Existing published sites\n                    will not be impacted.\"\n                  default: true\n                members_can_fork_private_repositories:\n                  type: boolean\n                  description: \"Toggles whether organization members can fork private\n                    organization repositories. Can be one of:  \\n\\\\* `true` - all\n                    organization members can fork private repositories within the\n                    organization.  \\n\\\\* `false` - no organization members can fork\n                    private repositories within the organization.\"\n                  default: false\n                blog:\n                  type: string\n                  examples:\n                  - '\"http://github.blog\"'\n            example:\n              billing_email: mona@github.com\n              company: GitHub\n              email: mona@github.com\n              twitter_username: github\n              location: San Francisco\n              name: github\n              description: GitHub, the company.\n              default_repository_permission: read\n              members_can_create_repositories: true\n              members_allowed_repository_creation_type: all\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/organization-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-full\"\n        '422':\n          description: Validation failed\n          content:\n            application/json:\n              schema:\n                oneOf:\n                - \"$ref\": \"#/components/schemas/validation-error\"\n                - \"$ref\": \"#/components/schemas/validation-error-simple\"\n        '409':\n          \"$ref\": \"#/components/responses/conflict\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        previews:\n        - required: false\n          name: surtur\n          note: |-\n            New repository creation permissions are available to preview. You can now use `members_can_create_public_repositories`, `members_can_create_private_repositories`, and `members_can_create_internal_repositories`. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. These parameters provide more granular permissions to configure the type of repositories organization members can create.\n\n            To access these new parameters during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.surtur-preview+json\n            ```\n  \"/orgs/{org}/actions/permissions\":\n    get:\n      summary: Get GitHub Actions permissions for an organization\n      description: |-\n        Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\n      operationId: actions/get-github-actions-permissions-organization\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-github-actions-permissions-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/actions-organization-permissions\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/actions-organization-permissions\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    put:\n      summary: Set GitHub Actions permissions for an organization\n      description: |-\n        Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.\n\n        If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\n      operationId: actions/set-github-actions-permissions-organization\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-github-actions-permissions-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                enabled_repositories:\n                  \"$ref\": \"#/components/schemas/enabled-repositories\"\n                allowed_actions:\n                  \"$ref\": \"#/components/schemas/allowed-actions\"\n              required:\n              - enabled_repositories\n            example:\n              enabled_repositories: all\n              allowed_actions: selected\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/orgs/{org}/actions/permissions/repositories\":\n    get:\n      summary: List selected repositories enabled for GitHub Actions in an organization\n      description: |-\n        Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\n      operationId: actions/list-selected-repositories-enabled-github-actions-organization\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-selected-repositories-enabled-for-github-actions-in-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - repositories\n                properties:\n                  total_count:\n                    type: number\n                  repositories:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-paginated\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    put:\n      summary: Set selected repositories enabled for GitHub Actions in an organization\n      description: |-\n        Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\n      operationId: actions/set-selected-repositories-enabled-github-actions-organization\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-enabled-for-github-actions-in-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                selected_repository_ids:\n                  description: List of repository IDs to enable for GitHub Actions.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the repository.\n              required:\n              - selected_repository_ids\n            example:\n              selected_repository_ids:\n              - 32\n              - 42\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/orgs/{org}/actions/permissions/repositories/{repository_id}\":\n    put:\n      summary: Enable a selected repository for GitHub Actions in an organization\n      description: |-\n        Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\n      operationId: actions/enable-selected-repository-github-actions-organization\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#enable-a-selected-repository-for-github-actions-in-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/repository-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    delete:\n      summary: Disable a selected repository for GitHub Actions in an organization\n      description: |-\n        Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\n      operationId: actions/disable-selected-repository-github-actions-organization\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#disable-a-selected-repository-for-github-actions-in-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/repository-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/orgs/{org}/actions/permissions/selected-actions\":\n    get:\n      summary: Get allowed actions for an organization\n      description: |-\n        Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\"\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\n      operationId: actions/get-allowed-actions-organization\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-allowed-actions-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/selected-actions\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/selected-actions\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    put:\n      summary: Set allowed actions for an organization\n      description: |-\n        Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\n        If the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.\n\n        To use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.\n      operationId: actions/set-allowed-actions-organization\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-allowed-actions-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              \"$ref\": \"#/components/schemas/selected-actions\"\n            examples:\n              selected_actions:\n                \"$ref\": \"#/components/examples/selected-actions\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/orgs/{org}/actions/runner-groups\":\n    get:\n      summary: List self-hosted runner groups for an organization\n      description: |-\n        Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/list-self-hosted-runner-groups-for-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - runner_groups\n                properties:\n                  total_count:\n                    type: number\n                  runner_groups:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/runner-groups-org\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-groups-org\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    post:\n      summary: Create a self-hosted runner group for an organization\n      description: |-\n        The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see \"[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products).\"\n\n        Creates a new self-hosted runner group for an organization.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/create-self-hosted-runner-group-for-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-self-hosted-runner-group-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  description: Name of the runner group.\n                  type: string\n                visibility:\n                  description: 'Visibility of a runner group. You can select all repositories,\n                    select individual repositories, or limit access to private repositories.\n                    Can be one of: `all`, `selected`, or `private`.'\n                  type: string\n                  enum:\n                  - selected\n                  - all\n                  - private\n                  default: all\n                selected_repository_ids:\n                  description: List of repository IDs that can access the runner group.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the repository.\n                runners:\n                  description: List of runner IDs to add to the runner group.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the runner.\n                allows_public_repositories:\n                  description: Whether the runner group can be used by `public` repositories.\n                  type: boolean\n                  default: false\n              required:\n              - name\n            example:\n              name: Expensive hardware runners\n              visibility: selected\n              selected_repository_ids:\n              - 32\n              - 91\n              runners:\n              - 9\n              - 2\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner-groups-org\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-group\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/orgs/{org}/actions/runner-groups/{runner_group_id}\":\n    get:\n      summary: Get a self-hosted runner group for an organization\n      description: |-\n        Gets a specific self-hosted runner group for an organization.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/get-self-hosted-runner-group-for-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-group-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner-groups-org\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-group-item\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    patch:\n      summary: Update a self-hosted runner group for an organization\n      description: |-\n        Updates the `name` and `visibility` of a self-hosted runner group in an organization.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/update-self-hosted-runner-group-for-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#update-a-self-hosted-runner-group-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  description: Name of the runner group.\n                  type: string\n                visibility:\n                  description: 'Visibility of a runner group. You can select all repositories,\n                    select individual repositories, or all private repositories. Can\n                    be one of: `all`, `selected`, or `private`.'\n                  type: string\n                  enum:\n                  - selected\n                  - all\n                  - private\n                allows_public_repositories:\n                  description: Whether the runner group can be used by `public` repositories.\n                  type: boolean\n                  default: false\n              required:\n              - name\n            example:\n              name: Expensive hardware runners\n              visibility: selected\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner-groups-org\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-group\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    delete:\n      summary: Delete a self-hosted runner group from an organization\n      description: |-\n        Deletes a self-hosted runner group for an organization.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/delete-self-hosted-runner-group-from-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\":\n    get:\n      summary: List repository access to a self-hosted runner group in an organization\n      description: |-\n        The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see \"[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products).\"\n\n        Lists the repositories with access to a self-hosted runner group configured in an organization.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/list-repo-access-to-self-hosted-runner-group-in-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-repository-access-to-a-self-hosted-runner-group-in-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - repositories\n                properties:\n                  total_count:\n                    type: number\n                  repositories:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository-paginated\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    put:\n      summary: Set repository access for a self-hosted runner group in an organization\n      description: |-\n        Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/set-repo-access-to-self-hosted-runner-group-in-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-repository-access-to-a-self-hosted-runner-group-in-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                selected_repository_ids:\n                  description: List of repository IDs that can access the runner group.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the repository.\n              required:\n              - selected_repository_ids\n            example:\n              selected_repository_ids:\n              - 32\n              - 91\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}\":\n    put:\n      summary: Add repository access to a self-hosted runner group in an organization\n      description: |-\n        Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \"[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization).\"\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/add-repo-access-to-self-hosted-runner-group-in-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-repository-acess-to-a-self-hosted-runner-group-in-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/repository-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: true\n        category: actions\n        subcategory: self-hosted-runner-groups\n    delete:\n      summary: Remove repository access to a self-hosted runner group in an organization\n      description: |-\n        Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \"[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization).\"\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/remove-repo-access-to-self-hosted-runner-group-in-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/repository-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners\":\n    get:\n      summary: List self-hosted runners in a group for an organization\n      description: |-\n        Lists self-hosted runners that are in a specific organization group.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/list-self-hosted-runners-in-group-for-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - runners\n                properties:\n                  total_count:\n                    type: number\n                  runners:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/runner\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    put:\n      summary: Set self-hosted runners in a group for an organization\n      description: |-\n        Replaces the list of self-hosted runners that are part of an organization runner group.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/set-self-hosted-runners-in-group-for-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                runners:\n                  description: List of runner IDs to add to the runner group.\n                  type: array\n                  items:\n                    type: integer\n                    description: Unique identifier of the runner.\n              required:\n              - runners\n            example:\n              runners:\n              - 9\n              - 2\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\":\n    put:\n      summary: Add a self-hosted runner to a group for an organization\n      description: |-\n        Adds a self-hosted runner to a runner group configured in an organization.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/add-self-hosted-runner-to-group-for-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n    delete:\n      summary: Remove a self-hosted runner from a group for an organization\n      description: |-\n        Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      operationId: actions/remove-self-hosted-runner-from-group-for-org\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-group-id\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: self-hosted-runner-groups\n  \"/orgs/{org}/actions/runners\":\n    get:\n      summary: List self-hosted runners for an organization\n      description: |-\n        Lists all self-hosted runners configured in an organization.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-self-hosted-runners-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - runners\n                properties:\n                  total_count:\n                    type: integer\n                  runners:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/runner\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/orgs/{org}/actions/runners/downloads\":\n    get:\n      summary: List runner applications for an organization\n      description: |-\n        Lists binaries for the runner application that you can download and run.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-runner-applications-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-runner-applications-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/runner-application\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-application-items\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/orgs/{org}/actions/runners/registration-token\":\n    post:\n      summary: Create a registration token for an organization\n      description: |-\n        Returns a token that you can pass to the `config` script. The token expires after one hour.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\n        #### Example using registration token\n\n        Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n        ```\n        ./config.sh --url https://github.com/octo-org --token TOKEN\n        ```\n      tags:\n      - actions\n      operationId: actions/create-registration-token-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-registration-token-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authentication-token\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authentication-token\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/orgs/{org}/actions/runners/remove-token\":\n    post:\n      summary: Create a remove token for an organization\n      description: |-\n        Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\n        #### Example using remove token\n\n        To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this\n        endpoint.\n\n        ```\n        ./config.sh remove --token TOKEN\n        ```\n      tags:\n      - actions\n      operationId: actions/create-remove-token-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-remove-token-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authentication-token\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authentication-token-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/orgs/{org}/actions/runners/{runner_id}\":\n    get:\n      summary: Get a self-hosted runner for an organization\n      description: |-\n        Gets a specific self-hosted runner configured in an organization.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-self-hosted-runner-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n    delete:\n      summary: Delete a self-hosted runner from an organization\n      description: |-\n        Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\n\n        You must authenticate using an access token with the `admin:org` scope to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/delete-self-hosted-runner-from-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-self-hosted-runner-from-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/orgs/{org}/actions/secrets\":\n    get:\n      summary: List organization secrets\n      description: Lists all secrets available in an organization without revealing\n        their encrypted values. You must authenticate using an access token with the\n        `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets`\n        organization permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-org-secrets\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-organization-secrets\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - secrets\n                properties:\n                  total_count:\n                    type: integer\n                  secrets:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/organization-actions-secret\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-actions-secret-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n  \"/orgs/{org}/actions/secrets/public-key\":\n    get:\n      summary: Get an organization public key\n      description: Gets your public key, which you need to encrypt secrets. You need\n        to encrypt a secret before you can create or update secrets. You must authenticate\n        using an access token with the `admin:org` scope to use this endpoint. GitHub\n        Apps must have the `secrets` organization permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-org-public-key\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-an-organization-public-key\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/actions-public-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/actions-public-key\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n  \"/orgs/{org}/actions/secrets/{secret_name}\":\n    get:\n      summary: Get an organization secret\n      description: Gets a single organization secret without revealing its encrypted\n        value. You must authenticate using an access token with the `admin:org` scope\n        to use this endpoint. GitHub Apps must have the `secrets` organization permission\n        to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-org-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-an-organization-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/organization-actions-secret\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-actions-secret\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n    put:\n      summary: Create or update an organization secret\n      description: |-\n        Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n        [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\n        token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to\n        use this endpoint.\n\n        #### Example encrypting a secret using Node.js\n\n        Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\n\n        ```\n        const sodium = require('tweetsodium');\n\n        const key = \"base64-encoded-public-key\";\n        const value = \"plain-text-secret\";\n\n        // Convert the message and key to Uint8Array's (Buffer implements that interface)\n        const messageBytes = Buffer.from(value);\n        const keyBytes = Buffer.from(key, 'base64');\n\n        // Encrypt using LibSodium.\n        const encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n        // Base64 the encrypted secret\n        const encrypted = Buffer.from(encryptedBytes).toString('base64');\n\n        console.log(encrypted);\n        ```\n\n\n        #### Example encrypting a secret using Python\n\n        Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n        ```\n        from base64 import b64encode\n        from nacl import encoding, public\n\n        def encrypt(public_key: str, secret_value: str) -> str:\n          \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n          public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n          sealed_box = public.SealedBox(public_key)\n          encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n          return b64encode(encrypted).decode(\"utf-8\")\n        ```\n\n        #### Example encrypting a secret using C#\n\n        Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n        ```\n        var secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\n        var publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\n        var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\n        Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n        ```\n\n        #### Example encrypting a secret using Ruby\n\n        Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n        ```ruby\n        require \"rbnacl\"\n        require \"base64\"\n\n        key = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\n        public_key = RbNaCl::PublicKey.new(key)\n\n        box = RbNaCl::Boxes::Sealed.from_public_key(public_key)\n        encrypted_secret = box.encrypt(\"my_secret\")\n\n        # Print the base64 encoded secret\n        puts Base64.strict_encode64(encrypted_secret)\n        ```\n      tags:\n      - actions\n      operationId: actions/create-or-update-org-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                encrypted_value:\n                  type: string\n                  description: Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages)\n                    using the public key retrieved from the [Get an organization public\n                    key](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-an-organization-public-key)\n                    endpoint.\n                  pattern: \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$\"\n                key_id:\n                  type: string\n                  description: ID of the key you used to encrypt the secret.\n                visibility:\n                  type: string\n                  description: \"Configures the access that repositories have to the\n                    organization secret. Can be one of:  \\n\\\\- `all` - All repositories\n                    in an organization can access the secret.  \\n\\\\- `private` - Private\n                    repositories in an organization can access the secret.  \\n\\\\-\n                    `selected` - Only specific repositories can access the secret.\"\n                  enum:\n                  - all\n                  - private\n                  - selected\n                selected_repository_ids:\n                  type: array\n                  description: An array of repository ids that can access the organization\n                    secret. You can only provide a list of repository ids when the\n                    `visibility` is set to `selected`. You can manage the list of\n                    selected repositories using the [List selected repositories for\n                    an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-selected-repositories-for-an-organization-secret),\n                    [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-for-an-organization-secret),\n                    and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-selected-repository-from-an-organization-secret)\n                    endpoints.\n                  items:\n                    type: string\n              required:\n              - visibility\n            example:\n              encrypted_value: c2VjcmV0\n              key_id: '012345678912345678'\n              visibility: selected\n              selected_repository_ids:\n              - '1296269'\n              - '1296280'\n      responses:\n        '201':\n          description: Response when creating a secret\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/empty-object\"\n        '204':\n          description: Response when updating a secret\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n    delete:\n      summary: Delete an organization secret\n      description: Deletes a secret in an organization using the secret name. You\n        must authenticate using an access token with the `admin:org` scope to use\n        this endpoint. GitHub Apps must have the `secrets` organization permission\n        to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/delete-org-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-an-organization-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n  \"/orgs/{org}/actions/secrets/{secret_name}/repositories\":\n    get:\n      summary: List selected repositories for an organization secret\n      description: Lists all repositories that have been selected when the `visibility`\n        for repository access to a secret is set to `selected`. You must authenticate\n        using an access token with the `admin:org` scope to use this endpoint. GitHub\n        Apps must have the `secrets` organization permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-selected-repos-for-org-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-selected-repositories-for-an-organization-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - repositories\n                properties:\n                  total_count:\n                    type: integer\n                  repositories:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/public-repository-paginated\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n    put:\n      summary: Set selected repositories for an organization secret\n      description: Replaces all repositories for an organization secret when the `visibility`\n        for repository access is set to `selected`. The visibility is set when you\n        [Create or update an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret).\n        You must authenticate using an access token with the `admin:org` scope to\n        use this endpoint. GitHub Apps must have the `secrets` organization permission\n        to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/set-selected-repos-for-org-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-for-an-organization-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                selected_repository_ids:\n                  type: array\n                  description: An array of repository ids that can access the organization\n                    secret. You can only provide a list of repository ids when the\n                    `visibility` is set to `selected`. You can add and remove individual\n                    repositories using the [Set selected repositories for an organization\n                    secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-for-an-organization-secret)\n                    and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-selected-repository-from-an-organization-secret)\n                    endpoints.\n                  items:\n                    type: integer\n              required:\n              - selected_repository_ids\n            example:\n              selected_repository_ids:\n              - 64780797\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n  \"/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\":\n    put:\n      summary: Add selected repository to an organization secret\n      description: Adds a repository to an organization secret when the `visibility`\n        for repository access is set to `selected`. The visibility is set when you\n        [Create or update an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret).\n        You must authenticate using an access token with the `admin:org` scope to\n        use this endpoint. GitHub Apps must have the `secrets` organization permission\n        to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/add-selected-repo-to-org-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#add-selected-repository-to-an-organization-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      - name: repository_id\n        in: path\n        required: true\n        schema:\n          type: integer\n      responses:\n        '204':\n          description: No Content when repository was added to the selected list\n        '409':\n          description: Conflict when visibility type is not set to selected\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n    delete:\n      summary: Remove selected repository from an organization secret\n      description: Removes a repository from an organization secret when the `visibility`\n        for repository access is set to `selected`. The visibility is set when you\n        [Create or update an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret).\n        You must authenticate using an access token with the `admin:org` scope to\n        use this endpoint. GitHub Apps must have the `secrets` organization permission\n        to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/remove-selected-repo-from-org-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-selected-repository-from-an-organization-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      - name: repository_id\n        in: path\n        required: true\n        schema:\n          type: integer\n      responses:\n        '204':\n          description: Response when repository was removed from the selected list\n        '409':\n          description: Conflict when visibility type not set to selected\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n  \"/orgs/{org}/events\":\n    get:\n      summary: List public organization events\n      description: ''\n      tags:\n      - activity\n      operationId: activity/list-public-org-events\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-organization-events\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: events\n  \"/orgs/{org}/hooks\":\n    get:\n      summary: List organization webhooks\n      description: ''\n      tags:\n      - orgs\n      operationId: orgs/list-webhooks\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organization-webhooks\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/org-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-hook-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: webhooks\n    post:\n      summary: Create an organization webhook\n      description: 'Here''s how you can create a hook that posts payloads in JSON\n        format:'\n      tags:\n      - orgs\n      operationId: orgs/create-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#create-an-organization-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: Must be passed as \"web\".\n                config:\n                  type: object\n                  description: Key/value pairs to provide settings for this webhook.\n                    [These are defined below](https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#create-hook-config-params).\n                  properties:\n                    url:\n                      \"$ref\": \"#/components/schemas/webhook-config-url\"\n                    content_type:\n                      \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                    secret:\n                      \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                    insecure_ssl:\n                      \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                    username:\n                      type: string\n                      examples:\n                      - '\"kdaigle\"'\n                    password:\n                      type: string\n                      examples:\n                      - '\"password\"'\n                  required:\n                  - url\n                events:\n                  type: array\n                  description: Determines what [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads)\n                    the hook is triggered for.\n                  default:\n                  - push\n                  items:\n                    type: string\n                active:\n                  type: boolean\n                  description: Determines if notifications are sent when the webhook\n                    is triggered. Set to `true` to send notifications.\n                  default: true\n              required:\n              - name\n              - config\n            example:\n              name: web\n              active: true\n              events:\n              - push\n              - pull_request\n              config:\n                url: http://example.com/webhook\n                content_type: json\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-hook\"\n          headers:\n            Location:\n              example: https://api.github.com/orgs/octocat/hooks/1\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: webhooks\n  \"/orgs/{org}/hooks/{hook_id}\":\n    get:\n      summary: Get an organization webhook\n      description: Returns a webhook configured in an organization. To get only the\n        webhook `config` properties, see \"[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization).\"\n      tags:\n      - orgs\n      operationId: orgs/get-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-an-organization-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-hook\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: webhooks\n    patch:\n      summary: Update an organization webhook\n      description: Updates a webhook configured in an organization. When you update\n        a webhook, the `secret` will be overwritten. If you previously had a `secret`\n        set, you must provide the same `secret` or set a new `secret` or the secret\n        will be removed. If you are only updating individual webhook `config` properties,\n        use \"[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization).\"\n      tags:\n      - orgs\n      operationId: orgs/update-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#update-an-organization-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                config:\n                  type: object\n                  description: Key/value pairs to provide settings for this webhook.\n                    [These are defined below](https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#update-hook-config-params).\n                  properties:\n                    url:\n                      \"$ref\": \"#/components/schemas/webhook-config-url\"\n                    content_type:\n                      \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                    secret:\n                      \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                    insecure_ssl:\n                      \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                  required:\n                  - url\n                events:\n                  type: array\n                  description: Determines what [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads)\n                    the hook is triggered for.\n                  default:\n                  - push\n                  items:\n                    type: string\n                active:\n                  type: boolean\n                  description: Determines if notifications are sent when the webhook\n                    is triggered. Set to `true` to send notifications.\n                  default: true\n                name:\n                  type: string\n                  examples:\n                  - '\"web\"'\n            example:\n              active: true\n              events:\n              - pull_request\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-hook-2\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: webhooks\n    delete:\n      summary: Delete an organization webhook\n      description: ''\n      tags:\n      - orgs\n      operationId: orgs/delete-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#delete-an-organization-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: webhooks\n  \"/orgs/{org}/hooks/{hook_id}/config\":\n    get:\n      summary: Get a webhook configuration for an organization\n      description: |-\n        Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use \"[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook).\"\n\n        Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission.\n      tags:\n      - orgs\n      operationId: orgs/get-webhook-config-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-a-webhook-configuration-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/webhook-config\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/webhook-config\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: webhooks\n    patch:\n      summary: Update a webhook configuration for an organization\n      description: |-\n        Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use \"[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook).\"\n\n        Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission.\n      tags:\n      - orgs\n      operationId: orgs/update-webhook-config-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#update-a-webhook-configuration-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                url:\n                  \"$ref\": \"#/components/schemas/webhook-config-url\"\n                content_type:\n                  \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                secret:\n                  \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                insecure_ssl:\n                  \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n              example:\n                content_type: json\n                insecure_ssl: '0'\n                secret: \"********\"\n                url: https://example.com/webhook\n              additionalProperties: false\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/webhook-config\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/webhook-config\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: webhooks\n  \"/orgs/{org}/hooks/{hook_id}/pings\":\n    post:\n      summary: Ping an organization webhook\n      description: This will trigger a [ping event](https://docs.github.com/enterprise-server@3.0/webhooks/#ping-event)\n        to be sent to the hook.\n      tags:\n      - orgs\n      operationId: orgs/ping-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#ping-an-organization-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: webhooks\n  \"/orgs/{org}/installation\":\n    get:\n      summary: Get an organization installation for the authenticated app\n      description: |-\n        Enables an authenticated GitHub App to find the organization's installation information.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/get-org-installation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-an-organization-installation-for-the-authenticated-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/installation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/installation\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: \n  \"/orgs/{org}/installations\":\n    get:\n      summary: List app installations for an organization\n      description: Lists all GitHub Apps in an organization. The installation count\n        includes all GitHub Apps installed on repositories in the organization. You\n        must be an organization owner with `admin:read` scope to use this endpoint.\n      tags:\n      - orgs\n      operationId: orgs/list-app-installations\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-app-installations-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - installations\n                properties:\n                  total_count:\n                    type: integer\n                  installations:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/installation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/installation-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: \n  \"/orgs/{org}/issues\":\n    get:\n      summary: List organization issues assigned to the authenticated user\n      description: |-\n        List issues in an organization assigned to the authenticated user.\n\n        **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\n        reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\n        the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\n        request id, use the \"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\" endpoint.\n      tags:\n      - issues\n      operationId: issues/list-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-organization-issues-assigned-to-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - name: filter\n        description: \"Indicates which sorts of issues to return. Can be one of:  \\n\\\\*\n          `assigned`: Issues assigned to you  \\n\\\\* `created`: Issues created by you\n          \\ \\n\\\\* `mentioned`: Issues mentioning you  \\n\\\\* `subscribed`: Issues you're\n          subscribed to updates for  \\n\\\\* `all` or `repos`: All issues the authenticated\n          user can see, regardless of participation or creation\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - assigned\n          - created\n          - mentioned\n          - subscribed\n          - repos\n          - all\n          default: assigned\n      - name: state\n        description: Indicates the state of the issues to return. Can be either `open`,\n          `closed`, or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - \"$ref\": \"#/components/parameters/labels\"\n      - name: sort\n        description: What to sort results by. Can be either `created`, `updated`,\n          `comments`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - comments\n          default: created\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-with-repo-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: issues\n        previews:\n        - required: false\n          name: machine-man\n          note: \"If an issue event is created via a GitHub App, the response will\n            include the `performed_via_github_app` object with\\tinformation about\n            the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo\n            receive the `performed_via_github_app` object in the response, you must\n            provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types)\n            in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/orgs/{org}/members\":\n    get:\n      summary: List organization members\n      description: List all users who are members of an organization. If the authenticated\n        user is also a member of this organization then both concealed and public\n        members will be returned.\n      tags:\n      - orgs\n      operationId: orgs/list-members\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organization-members\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - name: filter\n        description: \"Filter members returned in the list. Can be one of:  \\n\\\\* `2fa_disabled`\n          - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication)\n          enabled. Available for organization owners.  \\n\\\\* `all` - All members the\n          authenticated user can see.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - 2fa_disabled\n          - all\n          default: all\n      - name: role\n        description: \"Filter members returned by their role. Can be one of:  \\n\\\\*\n          `all` - All members of the organization, regardless of role.  \\n\\\\* `admin`\n          - Organization owners.  \\n\\\\* `member` - Non-owner organization members.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - all\n          - admin\n          - member\n          default: all\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '302':\n          description: Response if requester is not an organization member\n          headers:\n            Location:\n              example: https://api.github.com/orgs/github/public_members\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: members\n  \"/orgs/{org}/members/{username}\":\n    get:\n      summary: Check organization membership for a user\n      description: Check if a user is, publicly or privately, a member of the organization.\n      tags:\n      - orgs\n      operationId: orgs/check-membership-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#check-organization-membership-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response if requester is an organization member and user is\n            a member\n        '302':\n          description: Response if requester is not an organization member\n          headers:\n            Location:\n              example: https://api.github.com/orgs/github/public_members/pezra\n              schema:\n                type: string\n        '404':\n          description: Not Found if requester is an organization member and user is\n            not a member\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: members\n    delete:\n      summary: Remove an organization member\n      description: Removing a user from this list will remove them from all teams\n        and they will no longer have any access to the organization's repositories.\n      tags:\n      - orgs\n      operationId: orgs/remove-member\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-an-organization-member\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: members\n  \"/orgs/{org}/memberships/{username}\":\n    get:\n      summary: Get organization membership for a user\n      description: In order to get a user's membership with an organization, the authenticated\n        user must be an organization member. The `state` parameter in the response\n        can be used to identify the user's membership status.\n      tags:\n      - orgs\n      operationId: orgs/get-membership-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-organization-membership-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-membership\"\n              examples:\n                response-if-user-has-an-active-admin-membership-with-organization:\n                  \"$ref\": \"#/components/examples/org-membership-response-if-user-has-an-active-admin-membership-with-organization\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: members\n    put:\n      summary: Set organization membership for a user\n      description: \"Only authenticated organization owners can add a member to the\n        organization or update the member's role.\\n\\n*   If the authenticated user\n        is _adding_ a member to the organization, the invited user will receive an\n        email inviting them to the organization. The user's [membership status](https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-organization-membership-for-a-user)\n        will be `pending` until they accept the invitation.\\n    \\n*   Authenticated\n        users can _update_ a user's membership by passing the `role` parameter. If\n        the authenticated user changes a member's role to `admin`, the affected user\n        will receive an email notifying them that they've been made an organization\n        owner. If the authenticated user changes an owner's role to `member`, no email\n        will be sent.\\n\\n**Rate limits**\\n\\nTo prevent abuse, the authenticated user\n        is limited to 50 organization invitations per 24 hour period. If the organization\n        is more than one month old or on a paid plan, the limit is 500 invitations\n        per 24 hour period.\"\n      tags:\n      - orgs\n      operationId: orgs/set-membership-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#set-organization-membership-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                role:\n                  type: string\n                  description: \"The role to give the user in the organization. Can\n                    be one of:  \\n\\\\* `admin` - The user will become an owner of the\n                    organization.  \\n\\\\* `member` - The user will become a non-owner\n                    member of the organization.\"\n                  enum:\n                  - admin\n                  - member\n                  default: member\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-membership\"\n              examples:\n                response-if-user-already-had-membership-with-organization:\n                  \"$ref\": \"#/components/examples/org-membership-response-if-user-has-an-active-admin-membership-with-organization\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: members\n    delete:\n      summary: Remove organization membership for a user\n      description: |-\n        In order to remove a user's membership with an organization, the authenticated user must be an organization owner.\n\n        If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.\n      tags:\n      - orgs\n      operationId: orgs/remove-membership-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-organization-membership-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: members\n  \"/orgs/{org}/outside_collaborators\":\n    get:\n      summary: List outside collaborators for an organization\n      description: List all users who are outside collaborators of an organization.\n      tags:\n      - orgs\n      operationId: orgs/list-outside-collaborators\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-outside-collaborators-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - name: filter\n        description: \"Filter the list of outside collaborators. Can be one of:  \\n\\\\*\n          `2fa_disabled`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication)\n          enabled.  \\n\\\\* `all`: All outside collaborators.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - 2fa_disabled\n          - all\n          default: all\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: outside-collaborators\n  \"/orgs/{org}/outside_collaborators/{username}\":\n    put:\n      summary: Convert an organization member to outside collaborator\n      description: When an organization member is converted to an outside collaborator,\n        they'll only have access to the repositories that their current team membership\n        allows. The user will no longer be a member of the organization. For more\n        information, see \"[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)\".\n      tags:\n      - orgs\n      operationId: orgs/convert-member-to-outside-collaborator\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#convert-an-organization-member-to-outside-collaborator\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '202':\n          description: User is getting converted asynchronously\n          content:\n            application/json:\n              schema:\n                type: object\n                properties: {}\n                additionalProperties: false\n        '204':\n          description: User was converted\n        '403':\n          description: Forbidden if user is the last owner of the organization or\n            not a member of the organization\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: outside-collaborators\n    delete:\n      summary: Remove outside collaborator from an organization\n      description: Removing a user from this list will remove them from all the organization's\n        repositories.\n      tags:\n      - orgs\n      operationId: orgs/remove-outside-collaborator\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-outside-collaborator-from-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '422':\n          description: Unprocessable Entity if user is a member of the organization\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n              examples:\n                response-if-user-is-a-member-of-the-organization:\n                  value:\n                    message: You cannot specify an organization member to remove as\n                      an outside collaborator.\n                    documentation_url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-outside-collaborator\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: outside-collaborators\n  \"/orgs/{org}/pre-receive-hooks\":\n    get:\n      summary: List pre-receive hooks for an organization\n      description: List all pre-receive hooks that are enabled or testing for this\n        organization as well as any disabled hooks that can be configured at the organization\n        level. Globally disabled pre-receive hooks that do not allow downstream configuration\n        are not listed.\n      operationId: enterprise-admin/list-pre-receive-hooks-for-org\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-pre-receive-hooks-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - name: sort\n        description: The sort order for the response collection.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - name\n          default: created\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/org-pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-pre-receive-hook-items\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: enterprise-admin\n        subcategory: org-pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}\":\n    get:\n      summary: Get a pre-receive hook for an organization\n      description: ''\n      operationId: enterprise-admin/get-pre-receive-hook-for-org\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-pre-receive-hook-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-pre-receive-hook\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: enterprise-admin\n        subcategory: org-pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    patch:\n      summary: Update pre-receive hook enforcement for an organization\n      description: For pre-receive hooks which are allowed to be configured at the\n        org level, you can set `enforcement` and `allow_downstream_configuration`\n      operationId: enterprise-admin/update-pre-receive-hook-enforcement-for-org\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-pre-receive-hook-enforcement-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-pre-receive-hook-2\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                enforcement:\n                  description: The state of enforcement for the hook on this repository.\n                  type: string\n                allow_downstream_configuration:\n                  description: Whether repositories can override enforcement.\n                  type: boolean\n            example:\n              enforcement: enabled\n              allow_downstream_configuration: false\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: enterprise-admin\n        subcategory: org-pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    delete:\n      summary: Remove pre-receive hook enforcement for an organization\n      description: Removes any overrides for this hook at the org level for this org.\n      operationId: enterprise-admin/remove-pre-receive-hook-enforcement-for-org\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#remove-pre-receive-hook-enforcement-for-an-organization\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-pre-receive-hook\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: enterprise-admin\n        subcategory: org-pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/orgs/{org}/projects\":\n    get:\n      summary: List organization projects\n      description: Lists the projects in an organization. Returns a `404 Not Found`\n        status if projects are disabled in the organization. If you do not have sufficient\n        privileges to perform this action, a `401 Unauthorized` or `410 Gone` status\n        is returned.\n      tags:\n      - projects\n      operationId: projects/list-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-organization-projects\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - name: state\n        description: Indicates the state of the projects to return. Can be either\n          `open`, `closed`, or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    post:\n      summary: Create an organization project\n      description: Creates an organization project board. Returns a `404 Not Found`\n        status if projects are disabled in the organization. If you do not have sufficient\n        privileges to perform this action, a `401 Unauthorized` or `410 Gone` status\n        is returned.\n      tags:\n      - projects\n      operationId: projects/create-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-an-organization-project\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the project.\n                body:\n                  type: string\n                  description: The description of the project.\n              required:\n              - name\n            example:\n              name: Organization Roadmap\n              body: High-level roadmap for the upcoming year.\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-2\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/orgs/{org}/public_members\":\n    get:\n      summary: List public organization members\n      description: Members of an organization can choose to have their membership\n        publicized or not.\n      tags:\n      - orgs\n      operationId: orgs/list-public-members\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-public-organization-members\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: members\n  \"/orgs/{org}/public_members/{username}\":\n    get:\n      summary: Check public organization membership for a user\n      description: ''\n      tags:\n      - orgs\n      operationId: orgs/check-public-membership-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#check-public-organization-membership-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response if user is a public member\n        '404':\n          description: Not Found if user is not a public member\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: members\n    put:\n      summary: Set public organization membership for the authenticated user\n      description: |-\n        The user can publicize their own membership. (A user cannot publicize the membership for another user.)\n\n        Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n      tags:\n      - orgs\n      operationId: orgs/set-public-membership-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#set-public-organization-membership-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: orgs\n        subcategory: members\n    delete:\n      summary: Remove public organization membership for the authenticated user\n      description: ''\n      tags:\n      - orgs\n      operationId: orgs/remove-public-membership-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#remove-public-organization-membership-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: orgs\n        subcategory: members\n  \"/orgs/{org}/repos\":\n    get:\n      summary: List organization repositories\n      description: Lists repositories for the specified organization.\n      tags:\n      - repos\n      operationId: repos/list-for-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-organization-repositories\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - name: type\n        description: 'Specifies the types of repositories you want returned. Can be\n          one of `all`, `public`, `private`, `forks`, `sources`, `member`, `internal`.\n          Note: For GitHub AE, can be one of `all`, `private`, `forks`, `sources`,\n          `member`, `internal`. Default: `all`. If your organization is associated\n          with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise\n          Server 2.20+, `type` can also be `internal`. However, the `internal` value\n          is not yet supported when a GitHub App calls this API with an installation\n          access token.'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - all\n          - public\n          - private\n          - forks\n          - sources\n          - member\n          - internal\n      - name: sort\n        description: Can be one of `created`, `updated`, `pushed`, `full_name`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - pushed\n          - full_name\n          default: created\n      - name: direction\n        description: 'Can be one of `asc` or `desc`. Default: when using `full_name`:\n          `asc`, otherwise `desc`'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - asc\n          - desc\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        previews:\n        - required: false\n          name: nebula\n          note: |-\n            You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\n            To access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.nebula-preview+json\n            ```\n        - required: false\n          name: baptiste\n          note: |-\n            The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.baptiste-preview+json\n            ```\n    post:\n      summary: Create an organization repository\n      description: |-\n        Creates a new repository in the specified organization. The authenticated user must be a member of the organization.\n\n        **OAuth scope requirements**\n\n        When using [OAuth](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n        *   `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n        *   `repo` scope to create a private repository\n      tags:\n      - repos\n      operationId: repos/create-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-an-organization-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the repository.\n                description:\n                  type: string\n                  description: A short description of the repository.\n                homepage:\n                  type: string\n                  description: A URL with more information about the repository.\n                private:\n                  type: boolean\n                  description: Whether the repository is private.\n                  default: false\n                visibility:\n                  type: string\n                  description: \"Can be `public` or `private`. If your organization\n                    is associated with an enterprise account using GitHub Enterprise\n                    Cloud or GitHub Enterprise Server 2.20+, `visibility` can also\n                    be `internal`. Note: For GitHub Enterprise Server and GitHub AE,\n                    this endpoint will only list repositories available to all users\n                    on the enterprise. For more information, see \\\"[Creating an internal\n                    repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)\\\"\n                    in the GitHub Help documentation.  \\nThe `visibility` parameter\n                    overrides the `private` parameter when you use both parameters\n                    with the `nebula-preview` preview header.\"\n                  enum:\n                  - public\n                  - private\n                  - internal\n                has_issues:\n                  type: boolean\n                  description: Either `true` to enable issues for this repository\n                    or `false` to disable them.\n                  default: true\n                has_projects:\n                  type: boolean\n                  description: Either `true` to enable projects for this repository\n                    or `false` to disable them. **Note:** If you're creating a repository\n                    in an organization that has disabled repository projects, the\n                    default is `false`, and if you pass `true`, the API returns an\n                    error.\n                  default: true\n                has_wiki:\n                  type: boolean\n                  description: Either `true` to enable the wiki for this repository\n                    or `false` to disable it.\n                  default: true\n                is_template:\n                  type: boolean\n                  description: Either `true` to make this repo available as a template\n                    repository or `false` to prevent it.\n                  default: false\n                team_id:\n                  type: integer\n                  description: The id of the team that will be granted access to this\n                    repository. This is only valid when creating a repository in an\n                    organization.\n                auto_init:\n                  type: boolean\n                  description: Pass `true` to create an initial commit with empty\n                    README.\n                  default: false\n                gitignore_template:\n                  type: string\n                  description: Desired language or platform [.gitignore template](https://github.com/github/gitignore)\n                    to apply. Use the name of the template without the extension.\n                    For example, \"Haskell\".\n                license_template:\n                  type: string\n                  description: Choose an [open source license template](https://choosealicense.com/)\n                    that best suits your needs, and then use the [license keyword](https://docs.github.com/articles/licensing-a-repository/#searching-github-by-license-type)\n                    as the `license_template` string. For example, \"mit\" or \"mpl-2.0\".\n                allow_squash_merge:\n                  type: boolean\n                  description: Either `true` to allow squash-merging pull requests,\n                    or `false` to prevent squash-merging.\n                  default: true\n                allow_merge_commit:\n                  type: boolean\n                  description: Either `true` to allow merging pull requests with a\n                    merge commit, or `false` to prevent merging pull requests with\n                    merge commits.\n                  default: true\n                allow_rebase_merge:\n                  type: boolean\n                  description: Either `true` to allow rebase-merging pull requests,\n                    or `false` to prevent rebase-merging.\n                  default: true\n                delete_branch_on_merge:\n                  type: boolean\n                  description: Either `true` to allow automatically deleting head\n                    branches when pull requests are merged, or `false` to prevent\n                    automatic deletion.\n                  default: false\n              required:\n              - name\n            example:\n              name: Hello-World\n              description: This is your first repository\n              homepage: https://github.com\n              private: false\n              has_issues: true\n              has_projects: true\n              has_wiki: true\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World\n              schema:\n                type: string\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        previews:\n        - required: false\n          name: nebula\n          note: |-\n            You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\n            To access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.nebula-preview+json\n            ```\n        - required: false\n          name: baptiste\n          note: |-\n            The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.baptiste-preview+json\n            ```\n  \"/orgs/{org}/teams\":\n    get:\n      summary: List teams\n      description: Lists all teams in an organization that are visible to the authenticated\n        user.\n      tags:\n      - teams\n      operationId: teams/list\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-teams\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n    post:\n      summary: Create a team\n      description: |-\n        To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see \"[Setting team creation permissions](https://docs.github.com/en/articles/setting-team-creation-permissions-in-your-organization).\"\n\n        When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see \"[About teams](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)\".\n      tags:\n      - teams\n      operationId: teams/create\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-team\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the team.\n                description:\n                  type: string\n                  description: The description of the team.\n                maintainers:\n                  type: array\n                  description: List GitHub IDs for organization members who will become\n                    team maintainers.\n                  items:\n                    type: string\n                repo_names:\n                  type: array\n                  description: The full name (e.g., \"organization-name/repository-name\")\n                    of repositories to add the team to.\n                  items:\n                    type: string\n                privacy:\n                  type: string\n                  description: \"The level of privacy this team should have. The options\n                    are:  \\n**For a non-nested team:**  \\n\\\\* `secret` - only visible\n                    to organization owners and members of this team.  \\n\\\\* `closed`\n                    - visible to all members of this organization.  \\nDefault: `secret`\n                    \\ \\n**For a parent or child team:**  \\n\\\\* `closed` - visible\n                    to all members of this organization.  \\nDefault for child team:\n                    `closed`\"\n                  enum:\n                  - secret\n                  - closed\n                permission:\n                  type: string\n                  description: \"**Deprecated**. The permission that new repositories\n                    will be added to the team with when none is specified. Can be\n                    one of:  \\n\\\\* `pull` - team members can pull, but not push to\n                    or administer newly-added repositories.  \\n\\\\* `push` - team members\n                    can pull and push, but not administer newly-added repositories.\"\n                  enum:\n                  - pull\n                  - push\n                  default: pull\n                parent_team_id:\n                  type: integer\n                  description: The ID of a team to set as the parent team.\n                ldap_dn:\n                  type: string\n                  description: The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns)\n                    (DN) of the LDAP entry to map to a team. LDAP synchronization\n                    must be enabled to map LDAP entries to a team. Use the \"[Update\n                    LDAP mapping for a team](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-ldap-mapping-for-a-team)\"\n                    endpoint to change the LDAP DN. For more information, see \"[Using\n                    LDAP](https://docs.github.com/enterprise-server@3.0/admin/identity-and-access-management/authenticating-users-for-your-github-enterprise-server-instance/using-ldap#enabling-ldap-sync).\"\n              required:\n              - name\n            example:\n              name: Justice League\n              description: A great team\n              permission: push\n              privacy: closed\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-full\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n  \"/orgs/{org}/teams/{team_slug}\":\n    get:\n      summary: Get a team by name\n      description: |-\n        Gets a team using the team's `slug`. GitHub Enterprise Server generates the `slug` from the team `name`.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`.\n      tags:\n      - teams\n      operationId: teams/get-by-name\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-team-by-name\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-full\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n    patch:\n      summary: Update a team\n      description: |-\n        To edit a team, the authenticated user must either be an organization owner or a team maintainer.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`.\n      tags:\n      - teams\n      operationId: teams/update-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-team\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the team.\n                description:\n                  type: string\n                  description: The description of the team.\n                privacy:\n                  type: string\n                  description: \"The level of privacy this team should have. Editing\n                    teams without specifying this parameter leaves `privacy` intact.\n                    When a team is nested, the `privacy` for parent teams cannot be\n                    `secret`. The options are:  \\n**For a non-nested team:**  \\n\\\\*\n                    `secret` - only visible to organization owners and members of\n                    this team.  \\n\\\\* `closed` - visible to all members of this organization.\n                    \\ \\n**For a parent or child team:**  \\n\\\\* `closed` - visible\n                    to all members of this organization.\"\n                  enum:\n                  - secret\n                  - closed\n                permission:\n                  type: string\n                  description: \"**Deprecated**. The permission that new repositories\n                    will be added to the team with when none is specified. Can be\n                    one of:  \\n\\\\* `pull` - team members can pull, but not push to\n                    or administer newly-added repositories.  \\n\\\\* `push` - team members\n                    can pull and push, but not administer newly-added repositories.\n                    \\ \\n\\\\* `admin` - team members can pull, push and administer newly-added\n                    repositories.\"\n                  enum:\n                  - pull\n                  - push\n                  - admin\n                  default: pull\n                parent_team_id:\n                  type:\n                  - integer\n                  - 'null'\n                  description: The ID of a team to set as the parent team.\n            example:\n              name: new team name\n              description: new team description\n              privacy: closed\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-full\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n    delete:\n      summary: Delete a team\n      description: |-\n        To delete a team, the authenticated user must be an organization owner or team maintainer.\n\n        If you are an organization owner, deleting a parent team will delete all of its child teams as well.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`.\n      tags:\n      - teams\n      operationId: teams/delete-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-team\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n  \"/orgs/{org}/teams/{team_slug}/discussions\":\n    get:\n      summary: List discussions\n      description: |-\n        List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.\n      tags:\n      - teams\n      operationId: teams/list-discussions-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussions\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - name: pinned\n        in: query\n        required: false\n        description: Pinned discussions only filter\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team-discussion\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussions\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create a discussion\n      description: |-\n        Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.\n      tags:\n      - teams\n      operationId: teams/create-discussion-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: The discussion post's title.\n                body:\n                  type: string\n                  description: The discussion post's body text.\n                private:\n                  type: boolean\n                  description: Private posts are only visible to team members, organization\n                    owners, and team maintainers. Public posts are visible to all\n                    members of the organization. Set to `true` to create a private\n                    post.\n                  default: false\n              required:\n              - title\n              - body\n            example:\n              title: Our first team post\n              body: Hi! This is an area for us to collaborate as a team.\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussions\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\":\n    get:\n      summary: Get a discussion\n      description: |-\n        Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.\n      tags:\n      - teams\n      operationId: teams/get-discussion-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussions\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    patch:\n      summary: Update a discussion\n      description: |-\n        Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.\n      tags:\n      - teams\n      operationId: teams/update-discussion-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: The discussion post's title.\n                body:\n                  type: string\n                  description: The discussion post's body text.\n            example:\n              title: Welcome to our first team post\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussions\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    delete:\n      summary: Delete a discussion\n      description: |-\n        Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.\n      tags:\n      - teams\n      operationId: teams/delete-discussion-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussions\n  \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\":\n    get:\n      summary: List discussion comments\n      description: |-\n        List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.\n      tags:\n      - teams\n      operationId: teams/list-discussion-comments-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussion-comments\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team-discussion-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussion-comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create a discussion comment\n      description: |-\n        Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.\n      tags:\n      - teams\n      operationId: teams/create-discussion-comment-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The discussion comment's body text.\n              required:\n              - body\n            example:\n              body: Do you like apples?\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-comment\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussion-comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\":\n    get:\n      summary: Get a discussion comment\n      description: |-\n        Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.\n      tags:\n      - teams\n      operationId: teams/get-discussion-comment-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-comment\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussion-comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    patch:\n      summary: Update a discussion comment\n      description: |-\n        Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.\n      tags:\n      - teams\n      operationId: teams/update-discussion-comment-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The discussion comment's body text.\n              required:\n              - body\n            example:\n              body: Do you like pineapples?\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-comment-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussion-comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    delete:\n      summary: Delete a discussion comment\n      description: |-\n        Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.\n      tags:\n      - teams\n      operationId: teams/delete-discussion-comment-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: discussion-comments\n  \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\":\n    get:\n      summary: List reactions for a team discussion comment\n      description: |-\n        List the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.\n      tags:\n      - reactions\n      operationId: reactions/list-for-team-discussion-comment-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-team-discussion-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      - name: content\n        description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types).\n          Omit this parameter to list all reactions to a team discussion comment.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create reaction for a team discussion comment\n      description: |-\n        Create a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.\n      tags:\n      - reactions\n      operationId: reactions/create-for-team-discussion-comment-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-team-discussion-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types)\n                    to add to the team discussion comment.\n                  enum:\n                  - \"+1\"\n                  - \"-1\"\n                  - laugh\n                  - confused\n                  - heart\n                  - hooray\n                  - rocket\n                  - eyes\n              required:\n              - content\n            example:\n              content: heart\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\":\n    delete:\n      summary: Delete team discussion comment reaction\n      description: |-\n        **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.\n\n        Delete a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - reactions\n      operationId: reactions/delete-for-team-discussion-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-team-discussion-comment-reaction\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      - \"$ref\": \"#/components/parameters/reaction-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\":\n    get:\n      summary: List reactions for a team discussion\n      description: |-\n        List the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.\n      tags:\n      - reactions\n      operationId: reactions/list-for-team-discussion-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-team-discussion\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - name: content\n        description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types).\n          Omit this parameter to list all reactions to a team discussion.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create reaction for a team discussion\n      description: |-\n        Create a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.\n      tags:\n      - reactions\n      operationId: reactions/create-for-team-discussion-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-team-discussion\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types)\n                    to add to the team discussion.\n                  enum:\n                  - \"+1\"\n                  - \"-1\"\n                  - laugh\n                  - confused\n                  - heart\n                  - hooray\n                  - rocket\n                  - eyes\n              required:\n              - content\n            example:\n              content: heart\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\":\n    delete:\n      summary: Delete team discussion reaction\n      description: |-\n        **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.\n\n        Delete a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - reactions\n      operationId: reactions/delete-for-team-discussion\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-team-discussion-reaction\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/reaction-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/orgs/{org}/teams/{team_slug}/members\":\n    get:\n      summary: List team members\n      description: |-\n        Team members will include the members of child teams.\n\n        To list members in a team, the team must be visible to the authenticated user.\n      tags:\n      - teams\n      operationId: teams/list-members-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-members\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - name: role\n        description: \"Filters members returned by their role in the team. Can be one\n          of:  \\n\\\\* `member` - normal members of the team.  \\n\\\\* `maintainer` -\n          team maintainers.  \\n\\\\* `all` - all members of the team.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - member\n          - maintainer\n          - all\n          default: all\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: members\n  \"/orgs/{org}/teams/{team_slug}/memberships/{username}\":\n    get:\n      summary: Get team membership for a user\n      description: |-\n        Team members will include the members of child teams.\n\n        To get a user's membership with a team, the team must be visible to the authenticated user.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.\n\n        **Note:**\n        The response contains the `state` of the membership and the member's `role`.\n\n        The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see see [Create a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-team).\n      tags:\n      - teams\n      operationId: teams/get-membership-for-user-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-membership-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-membership\"\n              examples:\n                response-if-user-is-a-team-maintainer:\n                  \"$ref\": \"#/components/examples/team-membership-response-if-user-is-a-team-maintainer\"\n        '404':\n          description: if user has no team membership\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: members\n    put:\n      summary: Add or update team membership for a user\n      description: |-\n        Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.\n\n        **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\"\n\n        An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the \"pending\" state until the person accepts the invitation, at which point the membership will transition to the \"active\" state and the user will be added as a member of the team.\n\n        If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`.\n      tags:\n      - teams\n      operationId: teams/add-or-update-membership-for-user-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-membership-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/username\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                role:\n                  type: string\n                  description: \"The role that this user should have in the team. Can\n                    be one of:  \\n\\\\* `member` - a normal member of the team.  \\n\\\\*\n                    `maintainer` - a team maintainer. Able to add/remove other team\n                    members, promote other team members to team maintainer, and edit\n                    the team's name and description.\"\n                  enum:\n                  - member\n                  - maintainer\n                  default: member\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-membership\"\n              examples:\n                response-if-users-membership-with-team-is-now-pending:\n                  \"$ref\": \"#/components/examples/team-membership-response-if-users-membership-with-team-is-now-pending\"\n        '403':\n          description: Forbidden if team synchronization is set up\n        '422':\n          description: Unprocessable Entity if you attempt to add an organization\n            to a team\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: members\n    delete:\n      summary: Remove team membership for a user\n      description: |-\n        Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.\n\n        **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\"\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`.\n      tags:\n      - teams\n      operationId: teams/remove-membership-for-user-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-membership-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          description: Forbidden if team synchronization is set up\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: members\n  \"/orgs/{org}/teams/{team_slug}/projects\":\n    get:\n      summary: List team projects\n      description: |-\n        Lists the organization projects for a team.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`.\n      tags:\n      - teams\n      operationId: teams/list-projects-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-projects\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team-project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-project-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/orgs/{org}/teams/{team_slug}/projects/{project_id}\":\n    get:\n      summary: Check team permissions for a project\n      description: |-\n        Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`.\n      tags:\n      - teams\n      operationId: teams/check-permissions-for-project-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#check-team-permissions-for-a-project\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/project-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-project\"\n        '404':\n          description: Not Found if project is not managed by this team\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    put:\n      summary: Add or update team project permissions\n      description: |-\n        Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`.\n      tags:\n      - teams\n      operationId: teams/add-or-update-project-permissions-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-project-permissions\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/project-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                permission:\n                  type: string\n                  description: \"The permission to grant to the team for this project.\n                    Can be one of:  \\n\\\\* `read` - team members can read, but not\n                    write to or administer this project.  \\n\\\\* `write` - team members\n                    can read and write, but not administer this project.  \\n\\\\* `admin`\n                    - team members can read, write and administer this project.  \\nDefault:\n                    the team's `permission` attribute will be used to determine what\n                    permission to grant the team on this project. Note that, if you\n                    choose not to pass any parameters, you'll need to set `Content-Length`\n                    to zero when calling out to this endpoint. For more information,\n                    see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\"\n                  enum:\n                  - read\n                  - write\n                  - admin\n      responses:\n        '204':\n          description: Response\n        '403':\n          description: Forbidden if the project is not owned by the organization\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n              examples:\n                response-if-the-project-is-not-owned-by-the-organization:\n                  value:\n                    message: Must have admin rights to Repository.\n                    documentation_url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-project-permissions\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    delete:\n      summary: Remove a project from a team\n      description: |-\n        Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`.\n      tags:\n      - teams\n      operationId: teams/remove-project-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-a-project-from-a-team\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/project-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n  \"/orgs/{org}/teams/{team_slug}/repos\":\n    get:\n      summary: List team repositories\n      description: |-\n        Lists a team's repositories visible to the authenticated user.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`.\n      tags:\n      - teams\n      operationId: teams/list-repos-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-repositories\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n  \"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\":\n    get:\n      summary: Check team permissions for a repository\n      description: |-\n        Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.\n\n        You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header.\n\n        If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.\n      tags:\n      - teams\n      operationId: teams/check-permissions-for-repo-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#check-team-permissions-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Alternative response with repository permissions\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-repository\"\n              examples:\n                alternative-response-with-repository-permissions:\n                  \"$ref\": \"#/components/examples/team-repository-alternative-response-with-repository-permissions\"\n        '204':\n          description: Response if team has permission for the repository. This is\n            the response when the repository media type hasn't been provded in the\n            Accept header.\n        '404':\n          description: Not Found if team does not have permission for the repository\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n    put:\n      summary: Add or update team repository permissions\n      description: |-\n        To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.\n\n        For more information about the permission levels, see \"[Repository permission levels for an organization](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)\".\n      tags:\n      - teams\n      operationId: teams/add-or-update-repo-permissions-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#add-or-update-team-repository-permissions\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                permission:\n                  type: string\n                  description: \"The permission to grant the team on this repository.\n                    Can be one of:  \\n\\\\* `pull` - team members can pull, but not\n                    push to or administer this repository.  \\n\\\\* `push` - team members\n                    can pull and push, but not administer this repository.  \\n\\\\*\n                    `admin` - team members can pull, push and administer this repository.\n                    \\ \\n\\\\* `maintain` - team members can manage the repository without\n                    access to sensitive or destructive actions. Recommended for project\n                    managers. Only applies to repositories owned by organizations.\n                    \\ \\n\\\\* `triage` - team members can proactively manage issues\n                    and pull requests without write access. Recommended for contributors\n                    who triage a repository. Only applies to repositories owned by\n                    organizations.  \\n  \\nIf no permission is specified, the team's\n                    `permission` attribute will be used to determine what permission\n                    to grant the team on this repository.\"\n                  enum:\n                  - pull\n                  - push\n                  - admin\n                  - maintain\n                  - triage\n                  default: push\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n    delete:\n      summary: Remove a repository from a team\n      description: |-\n        If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.\n      tags:\n      - teams\n      operationId: teams/remove-repo-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#remove-a-repository-from-a-team\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n  \"/orgs/{org}/teams/{team_slug}/teams\":\n    get:\n      summary: List child teams\n      description: |-\n        Lists the child teams of the team specified by `{team_slug}`.\n\n        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`.\n      tags:\n      - teams\n      operationId: teams/list-child-in-org\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-child-teams\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/team-slug\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: if child teams exist\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team\"\n              examples:\n                response-if-child-teams-exist:\n                  \"$ref\": \"#/components/examples/team-items-response-if-child-teams-exist\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: teams\n        subcategory: \n  \"/projects/columns/cards/{card_id}\":\n    get:\n      summary: Get a project card\n      description: ''\n      tags:\n      - projects\n      operationId: projects/get-card\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#get-a-project-card\n      parameters:\n      - \"$ref\": \"#/components/parameters/card-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project-card\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-card\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: cards\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    patch:\n      summary: Update an existing project card\n      description: ''\n      tags:\n      - projects\n      operationId: projects/update-card\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#update-a-project-card\n      parameters:\n      - \"$ref\": \"#/components/parameters/card-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                note:\n                  description: The project card's note\n                  type:\n                  - string\n                  - 'null'\n                  examples:\n                  - Update all gems\n                archived:\n                  description: Whether or not the card is archived\n                  type: boolean\n                  examples:\n                  - false\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project-card\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-card\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: cards\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    delete:\n      summary: Delete a project card\n      description: ''\n      tags:\n      - projects\n      operationId: projects/delete-card\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#delete-a-project-card\n      parameters:\n      - \"$ref\": \"#/components/parameters/card-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          description: Forbidden\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: string\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: cards\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/columns/cards/{card_id}/moves\":\n    post:\n      summary: Move a project card\n      description: ''\n      tags:\n      - projects\n      operationId: projects/move-card\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#move-a-project-card\n      parameters:\n      - \"$ref\": \"#/components/parameters/card-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                position:\n                  description: 'The position of the card in a column. Can be one of:\n                    `top`, `bottom`, or `after:<card_id>` to place after the specified\n                    card.'\n                  type: string\n                  pattern: \"^(?:top|bottom|after:\\\\d+)$\"\n                  examples:\n                  - bottom\n                column_id:\n                  description: The unique identifier of the column the card should\n                    be moved to\n                  type: integer\n                  examples:\n                  - 42\n              required:\n              - position\n              type: object\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties: {}\n                additionalProperties: false\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          description: Forbidden\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        code:\n                          type: string\n                        message:\n                          type: string\n                        resource:\n                          type: string\n                        field:\n                          type: string\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '503':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  code:\n                    type: string\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        code:\n                          type: string\n                        message:\n                          type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: cards\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/columns/{column_id}\":\n    get:\n      summary: Get a project column\n      description: ''\n      tags:\n      - projects\n      operationId: projects/get-column\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#get-a-project-column\n      parameters:\n      - \"$ref\": \"#/components/parameters/column-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project-column\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-column\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: columns\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    patch:\n      summary: Update an existing project column\n      description: ''\n      tags:\n      - projects\n      operationId: projects/update-column\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#update-a-project-column\n      parameters:\n      - \"$ref\": \"#/components/parameters/column-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                name:\n                  description: Name of the project column\n                  type: string\n                  examples:\n                  - Remaining tasks\n              required:\n              - name\n              type: object\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project-column\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-column\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: columns\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    delete:\n      summary: Delete a project column\n      description: ''\n      tags:\n      - projects\n      operationId: projects/delete-column\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#delete-a-project-column\n      parameters:\n      - \"$ref\": \"#/components/parameters/column-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: columns\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/columns/{column_id}/cards\":\n    get:\n      summary: List project cards\n      description: ''\n      tags:\n      - projects\n      operationId: projects/list-cards\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-project-cards\n      parameters:\n      - \"$ref\": \"#/components/parameters/column-id\"\n      - name: archived_state\n        description: Filters the project cards that are returned by the card's state.\n          Can be one of `all`,`archived`, or `not_archived`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - all\n          - archived\n          - not_archived\n          default: not_archived\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/project-card\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-card-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: cards\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    post:\n      summary: Create a project card\n      description: ''\n      tags:\n      - projects\n      operationId: projects/create-card\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-a-project-card\n      parameters:\n      - \"$ref\": \"#/components/parameters/column-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  note:\n                    description: The project card's note\n                    type:\n                    - string\n                    - 'null'\n                    examples:\n                    - Update all gems\n                required:\n                - note\n              - type: object\n                properties:\n                  content_id:\n                    description: The unique identifier of the content associated with\n                      the card\n                    type: integer\n                    examples:\n                    - 42\n                  content_type:\n                    description: The piece of content associated with the card\n                    type: string\n                    examples:\n                    - PullRequest\n                required:\n                - content_id\n                - content_type\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project-card\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-card\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '422':\n          description: Validation failed\n          content:\n            application/json:\n              schema:\n                oneOf:\n                - \"$ref\": \"#/components/schemas/validation-error\"\n                - \"$ref\": \"#/components/schemas/validation-error-simple\"\n        '503':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  code:\n                    type: string\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        code:\n                          type: string\n                        message:\n                          type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: cards\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/columns/{column_id}/moves\":\n    post:\n      summary: Move a project column\n      description: ''\n      tags:\n      - projects\n      operationId: projects/move-column\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#move-a-project-column\n      parameters:\n      - \"$ref\": \"#/components/parameters/column-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                position:\n                  description: 'The position of the column in a project. Can be one\n                    of: `first`, `last`, or `after:<column_id>` to place after the\n                    specified column.'\n                  type: string\n                  pattern: \"^(?:first|last|after:\\\\d+)$\"\n                  examples:\n                  - last\n              required:\n              - position\n              type: object\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties: {}\n                additionalProperties: false\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: columns\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/{project_id}\":\n    get:\n      summary: Get a project\n      description: Gets a project by its `id`. Returns a `404 Not Found` status if\n        projects are disabled. If you do not have sufficient privileges to perform\n        this action, a `401 Unauthorized` or `410 Gone` status is returned.\n      tags:\n      - projects\n      operationId: projects/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#get-a-project\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-3\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    patch:\n      summary: Update a project\n      description: Updates a project board's information. Returns a `404 Not Found`\n        status if projects are disabled. If you do not have sufficient privileges\n        to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.\n      operationId: projects/update\n      tags:\n      - projects\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#update-a-project\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              properties:\n                name:\n                  description: Name of the project\n                  type: string\n                  examples:\n                  - Week One Sprint\n                body:\n                  description: Body of the project\n                  type:\n                  - string\n                  - 'null'\n                  examples:\n                  - This project represents the sprint of the first week in January\n                state:\n                  description: State of the project; either 'open' or 'closed'\n                  type: string\n                  examples:\n                  - open\n                organization_permission:\n                  description: The baseline permission that all organization members\n                    have on this project\n                  type: string\n                  enum:\n                  - read\n                  - write\n                  - admin\n                  - none\n                private:\n                  description: Whether or not this project can be seen by everyone.\n                  type: boolean\n              type: object\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-3\"\n        '404':\n          description: Not Found if the authenticated user does not have access to\n            the project\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          description: Forbidden\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: string\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    delete:\n      summary: Delete a project\n      description: Deletes a project board. Returns a `404 Not Found` status if projects\n        are disabled.\n      operationId: projects/delete\n      tags:\n      - projects\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#delete-a-project\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      responses:\n        '204':\n          description: Delete Success\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          description: Forbidden\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n                  errors:\n                    type: array\n                    items:\n                      type: string\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/{project_id}/collaborators\":\n    get:\n      summary: List project collaborators\n      description: Lists the collaborators for an organization project. For a project,\n        the list of collaborators includes outside collaborators, organization members\n        that are direct collaborators, organization members with access through team\n        memberships, organization members with access through default organization\n        permissions, and organization owners. You must be an organization owner or\n        a project `admin` to list collaborators.\n      tags:\n      - projects\n      operationId: projects/list-collaborators\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-project-collaborators\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      - name: affiliation\n        description: \"Filters the collaborators by their affiliation. Can be one of:\n          \\ \\n\\\\* `outside`: Outside collaborators of a project that are not a member\n          of the project's organization.  \\n\\\\* `direct`: Collaborators with permissions\n          to a project, regardless of organization membership status.  \\n\\\\* `all`:\n          All collaborators the authenticated user can see.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - outside\n          - direct\n          - all\n          default: all\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: collaborators\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/{project_id}/collaborators/{username}\":\n    put:\n      summary: Add project collaborator\n      description: Adds a collaborator to an organization project and sets their permission\n        level. You must be an organization owner or a project `admin` to add a collaborator.\n      tags:\n      - projects\n      operationId: projects/add-collaborator\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#add-project-collaborator\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                permission:\n                  description: The permission to grant the collaborator.\n                  enum:\n                  - read\n                  - write\n                  - admin\n                  default: write\n                  type: string\n                  examples:\n                  - write\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: collaborators\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    delete:\n      summary: Remove user as a collaborator\n      description: Removes a collaborator from an organization project. You must be\n        an organization owner or a project `admin` to remove a collaborator.\n      tags:\n      - projects\n      operationId: projects/remove-collaborator\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#remove-project-collaborator\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: collaborators\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/{project_id}/collaborators/{username}/permission\":\n    get:\n      summary: Get project permission for a user\n      description: 'Returns the collaborator''s permission level for an organization\n        project. Possible values for the `permission` key: `admin`, `write`, `read`,\n        `none`. You must be an organization owner or a project `admin` to review a\n        user''s permission level.'\n      tags:\n      - projects\n      operationId: projects/get-permission-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#get-project-permission-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project-collaborator-permission\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-collaborator-permission\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: collaborators\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/projects/{project_id}/columns\":\n    get:\n      summary: List project columns\n      description: ''\n      tags:\n      - projects\n      operationId: projects/list-columns\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-project-columns\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/project-column\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-column-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: columns\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    post:\n      summary: Create a project column\n      description: ''\n      tags:\n      - projects\n      operationId: projects/create-column\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-a-project-column\n      parameters:\n      - \"$ref\": \"#/components/parameters/project-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                name:\n                  description: Name of the project column\n                  type: string\n                  examples:\n                  - Remaining tasks\n              required:\n              - name\n              type: object\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project-column\"\n              example:\n                url: https://api.github.com/projects/columns/367\n                project_url: https://api.github.com/projects/120\n                cards_url: https://api.github.com/projects/columns/367/cards\n                id: 367\n                node_id: MDEzOlByb2plY3RDb2x1bW4zNjc=\n                name: To Do\n                created_at: '2016-09-05T14:18:44Z'\n                updated_at: '2016-09-05T14:22:28Z'\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        subcategory: columns\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/rate_limit\":\n    get:\n      summary: Get rate limit status for the authenticated user\n      description: |-\n        **Note:** Accessing this endpoint does not count against your REST API rate limit.\n\n        **Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object.\n      tags:\n      - rate-limit\n      operationId: rate-limit/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/rate-limit#get-rate-limit-status-for-the-authenticated-user\n      parameters: []\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/rate-limit-overview\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/rate-limit-overview\"\n          headers:\n            X-RateLimit-Limit:\n              \"$ref\": \"#/components/headers/x-rate-limit-limit\"\n            X-RateLimit-Remaining:\n              \"$ref\": \"#/components/headers/x-rate-limit-remaining\"\n            X-RateLimit-Reset:\n              \"$ref\": \"#/components/headers/x-rate-limit-reset\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: rate-limit\n        subcategory: \n  \"/reactions/{reaction_id}\":\n    delete:\n      summary: Delete a reaction (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/).\n\n        OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments).\n      tags:\n      - reactions\n      operationId: reactions/delete-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#delete-a-reaction-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/reaction-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-21'\n        deprecationDate: '2020-02-26'\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n  \"/repos/{owner}/{repo}\":\n    get:\n      summary: Get a repository\n      description: |-\n        When you pass the `scarlet-witch-preview` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file.\n\n        The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.\n      tags:\n      - repos\n      operationId: repos/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/full-repository\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/full-repository-default-response\"\n                response-with-scarlet-witch-preview-media-type:\n                  \"$ref\": \"#/components/examples/full-repository-response-with-scarlet-witch-preview-media-type\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '301':\n          \"$ref\": \"#/components/responses/moved_permanently\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        previews:\n        - required: false\n          name: nebula\n          note: |-\n            You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\n            To access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.nebula-preview+json\n            ```\n        - required: false\n          name: scarlet-witch\n          note: |-\n            The Codes of Conduct API is currently available for developers to preview.\n\n            To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.scarlet-witch-preview+json\n            ```\n    patch:\n      summary: Update a repository\n      description: \"**Note**: To edit a repository's topics, use the [Replace all\n        repository topics](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#replace-all-repository-topics)\n        endpoint.\"\n      tags:\n      - repos\n      operationId: repos/update\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos/#update-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the repository.\n                description:\n                  type: string\n                  description: A short description of the repository.\n                homepage:\n                  type: string\n                  description: A URL with more information about the repository.\n                private:\n                  type: boolean\n                  description: \"Either `true` to make the repository private or `false`\n                    to make it public. Default: `false`.  \\n**Note**: You will get\n                    a `422` error if the organization restricts [changing repository\n                    visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories)\n                    to organization owners and a non-owner tries to change the value\n                    of private. **Note**: You will get a `422` error if the organization\n                    restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories)\n                    to organization owners and a non-owner tries to change the value\n                    of private.\"\n                  default: false\n                visibility:\n                  type: string\n                  description: Can be `public` or `private`. If your organization\n                    is associated with an enterprise account using GitHub Enterprise\n                    Cloud or GitHub Enterprise Server 2.20+, `visibility` can also\n                    be `internal`.\"\n                  enum:\n                  - public\n                  - private\n                  - internal\n                has_issues:\n                  type: boolean\n                  description: Either `true` to enable issues for this repository\n                    or `false` to disable them.\n                  default: true\n                has_projects:\n                  type: boolean\n                  description: Either `true` to enable projects for this repository\n                    or `false` to disable them. **Note:** If you're creating a repository\n                    in an organization that has disabled repository projects, the\n                    default is `false`, and if you pass `true`, the API returns an\n                    error.\n                  default: true\n                has_wiki:\n                  type: boolean\n                  description: Either `true` to enable the wiki for this repository\n                    or `false` to disable it.\n                  default: true\n                is_template:\n                  type: boolean\n                  description: Either `true` to make this repo available as a template\n                    repository or `false` to prevent it.\n                  default: false\n                default_branch:\n                  type: string\n                  description: Updates the default branch for this repository.\n                allow_squash_merge:\n                  type: boolean\n                  description: Either `true` to allow squash-merging pull requests,\n                    or `false` to prevent squash-merging.\n                  default: true\n                allow_merge_commit:\n                  type: boolean\n                  description: Either `true` to allow merging pull requests with a\n                    merge commit, or `false` to prevent merging pull requests with\n                    merge commits.\n                  default: true\n                allow_rebase_merge:\n                  type: boolean\n                  description: Either `true` to allow rebase-merging pull requests,\n                    or `false` to prevent rebase-merging.\n                  default: true\n                delete_branch_on_merge:\n                  type: boolean\n                  description: Either `true` to allow automatically deleting head\n                    branches when pull requests are merged, or `false` to prevent\n                    automatic deletion.\n                  default: false\n                archived:\n                  type: boolean\n                  description: \"`true` to archive this repository. **Note**: You cannot\n                    unarchive repositories through the API.\"\n                  default: false\n                allow_forking:\n                  type: boolean\n                  description: Either `true` to allow private forks, or `false` to\n                    prevent private forks.\n                  default: false\n            example:\n              name: Hello-World\n              description: This is your first repository\n              homepage: https://github.com\n              private: true\n              has_issues: true\n              has_projects: true\n              has_wiki: true\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/full-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/full-repository\"\n        '307':\n          \"$ref\": \"#/components/responses/temporary_redirect\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        previews:\n        - required: false\n          name: nebula\n          note: |-\n            You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\n            To access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.nebula-preview+json\n            ```\n        - required: false\n          name: baptiste\n          note: |-\n            The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.baptiste-preview+json\n            ```\n    delete:\n      summary: Delete a repository\n      description: |-\n        Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.\n\n        If an organization owner has configured the organization to prevent members from deleting organization-owned\n        repositories, you will get a `403 Forbidden` response.\n      tags:\n      - repos\n      operationId: repos/delete\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          description: 'If an organization owner has configured the organization to\n            prevent members from deleting organization-owned repositories, a member\n            will get this response:'\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n              example:\n                message: Organization members cannot delete repositories.\n                documentation_url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-repository\n        '307':\n          \"$ref\": \"#/components/responses/temporary_redirect\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: \n  \"/repos/{owner}/{repo}/actions/artifacts\":\n    get:\n      summary: List artifacts for a repository\n      description: Lists all artifacts for a repository. Anyone with read access to\n        the repository can use this endpoint. If the repository is private you must\n        use an access token with the `repo` scope. GitHub Apps must have the `actions:read`\n        permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-artifacts-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-artifacts-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - artifacts\n                properties:\n                  total_count:\n                    type: integer\n                  artifacts:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/artifact\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/artifact-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: artifacts\n  \"/repos/{owner}/{repo}/actions/artifacts/{artifact_id}\":\n    get:\n      summary: Get an artifact\n      description: Gets a specific artifact for a workflow run. Anyone with read access\n        to the repository can use this endpoint. If the repository is private you\n        must use an access token with the `repo` scope. GitHub Apps must have the\n        `actions:read` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-artifact\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-an-artifact\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/artifact-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/artifact\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/artifact\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: artifacts\n    delete:\n      summary: Delete an artifact\n      description: Deletes an artifact for a workflow run. You must authenticate using\n        an access token with the `repo` scope to use this endpoint. GitHub Apps must\n        have the `actions:write` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/delete-artifact\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-an-artifact\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/artifact-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: artifacts\n  \"/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\":\n    get:\n      summary: Download an artifact\n      description: |-\n        Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in\n        the response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to\n        the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.\n        GitHub Apps must have the `actions:read` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/download-artifact\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#download-an-artifact\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/artifact-id\"\n      - name: archive_format\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '302':\n          description: Response\n          headers:\n            Location:\n              \"$ref\": \"#/components/headers/location\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: artifacts\n  \"/repos/{owner}/{repo}/actions/jobs/{job_id}\":\n    get:\n      summary: Get a job for a workflow run\n      description: Gets a specific job in a workflow run. Anyone with read access\n        to the repository can use this endpoint. If the repository is private you\n        must use an access token with the `repo` scope. GitHub Apps must have the\n        `actions:read` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-job-for-workflow-run\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-job-for-a-workflow-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/job-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/job\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/job\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-jobs\n  \"/repos/{owner}/{repo}/actions/jobs/{job_id}/logs\":\n    get:\n      summary: Download job logs for a workflow run\n      description: |-\n        Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look\n        for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can\n        use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must\n        have the `actions:read` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/download-job-logs-for-workflow-run\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#download-job-logs-for-a-workflow-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/job-id\"\n      responses:\n        '302':\n          description: Response\n          headers:\n            Location:\n              example: https://pipelines.actions.githubusercontent.com/ab1f3cCFPB34Nd6imvFxpGZH5hNlDp2wijMwl2gDoO0bcrrlJj/_apis/pipelines/1/jobs/19/signedlogcontent?urlExpires=2020-01-22T22%3A44%3A54.1389777Z&urlSigningMethod=HMACV1&urlSignature=2TUDfIg4fm36OJmfPy6km5QD5DLCOkBVzvhWZM8B%2BUY%3D\n              schema:\n                type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-jobs\n  \"/repos/{owner}/{repo}/actions/permissions\":\n    get:\n      summary: Get GitHub Actions permissions for a repository\n      description: |-\n        Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.\n\n        You must authenticate using an access token with the `repo` scope to use this\n        endpoint. GitHub Apps must have the `administration` repository permission to use this API.\n      operationId: actions/get-github-actions-permissions-repository\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-github-actions-permissions-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/actions-repository-permissions\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/actions-repository-permissions\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    put:\n      summary: Set GitHub Actions permissions for a repository\n      description: |-\n        Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository.\n\n        If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository.\n\n        You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.\n      operationId: actions/set-github-actions-permissions-repository\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-github-actions-permissions-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                enabled:\n                  \"$ref\": \"#/components/schemas/actions-enabled\"\n                allowed_actions:\n                  \"$ref\": \"#/components/schemas/allowed-actions\"\n              required:\n              - enabled\n            example:\n              enabled: true\n              allowed_actions: selected\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/repos/{owner}/{repo}/actions/permissions/selected-actions\":\n    get:\n      summary: Get allowed actions for a repository\n      description: |-\n        Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository).\"\n\n        You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.\n      operationId: actions/get-allowed-actions-repository\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-allowed-actions-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/selected-actions\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/selected-actions\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n    put:\n      summary: Set allowed actions for a repository\n      description: |-\n        Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository).\"\n\n        If the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings.\n\n        To use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories.\n\n        You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.\n      operationId: actions/set-allowed-actions-repository\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-allowed-actions-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              \"$ref\": \"#/components/schemas/selected-actions\"\n            examples:\n              selected_actions:\n                \"$ref\": \"#/components/examples/selected-actions\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: actions\n        subcategory: permissions\n  \"/repos/{owner}/{repo}/actions/runners\":\n    get:\n      summary: List self-hosted runners for a repository\n      description: Lists all self-hosted runners configured in a repository. You must\n        authenticate using an access token with the `repo` scope to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-self-hosted-runners-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-self-hosted-runners-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - runners\n                properties:\n                  total_count:\n                    type: integer\n                  runners:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/runner\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/repos/{owner}/{repo}/actions/runners/downloads\":\n    get:\n      summary: List runner applications for a repository\n      description: |-\n        Lists binaries for the runner application that you can download and run.\n\n        You must authenticate using an access token with the `repo` scope to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-runner-applications-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-runner-applications-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/runner-application\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner-application-items\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/repos/{owner}/{repo}/actions/runners/registration-token\":\n    post:\n      summary: Create a registration token for a repository\n      description: \"Returns a token that you can pass to the `config` script. The\n        token expires after one hour. You must authenticate\\nusing an access token\n        with the `repo` scope to use this endpoint.\\n\\n#### Example using registration\n        token\\n \\nConfigure your self-hosted runner, replacing `TOKEN` with the registration\n        token provided by this endpoint.\\n\\n```\\n./config.sh --url https://github.com/octo-org/octo-repo-artifacts\n        --token TOKEN\\n```\"\n      tags:\n      - actions\n      operationId: actions/create-registration-token-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-registration-token-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authentication-token\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authentication-token\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/repos/{owner}/{repo}/actions/runners/remove-token\":\n    post:\n      summary: Create a remove token for a repository\n      description: \"Returns a token that you can pass to remove a self-hosted runner\n        from a repository. The token expires after one hour.\\nYou must authenticate\n        using an access token with the `repo` scope to use this endpoint.\\n\\n####\n        Example using remove token\\n \\nTo remove your self-hosted runner from a repository,\n        replace TOKEN with the remove token provided by this endpoint.\\n\\n```\\n./config.sh\n        remove --token TOKEN\\n```\"\n      tags:\n      - actions\n      operationId: actions/create-remove-token-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-remove-token-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/authentication-token\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/authentication-token-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/repos/{owner}/{repo}/actions/runners/{runner_id}\":\n    get:\n      summary: Get a self-hosted runner for a repository\n      description: |-\n        Gets a specific self-hosted runner configured in a repository.\n\n        You must authenticate using an access token with the `repo` scope to use this\n        endpoint.\n      tags:\n      - actions\n      operationId: actions/get-self-hosted-runner-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-self-hosted-runner-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/runner\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/runner\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n    delete:\n      summary: Delete a self-hosted runner from a repository\n      description: |-\n        Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\n\n        You must authenticate using an access token with the `repo`\n        scope to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/delete-self-hosted-runner-from-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/runner-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: self-hosted-runners\n  \"/repos/{owner}/{repo}/actions/runs\":\n    get:\n      summary: List workflow runs for a repository\n      description: |-\n        Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#parameters).\n\n        Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-workflow-runs-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-workflow-runs-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/actor\"\n      - \"$ref\": \"#/components/parameters/workflow-run-branch\"\n      - \"$ref\": \"#/components/parameters/event\"\n      - \"$ref\": \"#/components/parameters/workflow-run-status\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/created\"\n      - \"$ref\": \"#/components/parameters/exclude-pull-requests\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - workflow_runs\n                properties:\n                  total_count:\n                    type: integer\n                  workflow_runs:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/workflow-run\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/workflow-run-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-runs\n  \"/repos/{owner}/{repo}/actions/runs/{run_id}\":\n    get:\n      summary: Get a workflow run\n      description: Gets a specific workflow run. Anyone with read access to the repository\n        can use this endpoint. If the repository is private you must use an access\n        token with the `repo` scope. GitHub Apps must have the `actions:read` permission\n        to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-workflow-run\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-workflow-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/run-id\"\n      - \"$ref\": \"#/components/parameters/exclude-pull-requests\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/workflow-run\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/workflow-run\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-runs\n    delete:\n      summary: Delete a workflow run\n      description: |-\n        Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is\n        private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use\n        this endpoint.\n      operationId: actions/delete-workflow-run\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-workflow-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/run-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-runs\n  \"/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\":\n    get:\n      summary: List workflow run artifacts\n      description: Lists artifacts for a workflow run. Anyone with read access to\n        the repository can use this endpoint. If the repository is private you must\n        use an access token with the `repo` scope. GitHub Apps must have the `actions:read`\n        permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-workflow-run-artifacts\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-workflow-run-artifacts\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/run-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - artifacts\n                properties:\n                  total_count:\n                    type: integer\n                  artifacts:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/artifact\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/artifact-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: artifacts\n  \"/repos/{owner}/{repo}/actions/runs/{run_id}/cancel\":\n    post:\n      summary: Cancel a workflow run\n      description: Cancels a workflow run using its `id`. You must authenticate using\n        an access token with the `repo` scope to use this endpoint. GitHub Apps must\n        have the `actions:write` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/cancel-workflow-run\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#cancel-a-workflow-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/run-id\"\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties: {}\n                additionalProperties: false\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-runs\n  \"/repos/{owner}/{repo}/actions/runs/{run_id}/jobs\":\n    get:\n      summary: List jobs for a workflow run\n      description: Lists jobs for a workflow run. Anyone with read access to the repository\n        can use this endpoint. If the repository is private you must use an access\n        token with the `repo` scope. GitHub Apps must have the `actions:read` permission\n        to use this endpoint. You can use parameters to narrow the list of results.\n        For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#parameters).\n      tags:\n      - actions\n      operationId: actions/list-jobs-for-workflow-run\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-jobs-for-a-workflow-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/run-id\"\n      - name: filter\n        description: \"Filters jobs by their `completed_at` timestamp. Can be one of:\n          \\ \\n\\\\* `latest`: Returns jobs from the most recent execution of the workflow\n          run.  \\n\\\\* `all`: Returns all jobs for a workflow run, including from old\n          executions of the workflow run.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - latest\n          - all\n          default: latest\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - jobs\n                properties:\n                  total_count:\n                    type: integer\n                  jobs:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/job\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/job-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-jobs\n  \"/repos/{owner}/{repo}/actions/runs/{run_id}/logs\":\n    get:\n      summary: Download workflow run logs\n      description: |-\n        Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for\n        `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use\n        this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have\n        the `actions:read` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/download-workflow-run-logs\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#download-workflow-run-logs\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/run-id\"\n      responses:\n        '302':\n          description: Response\n          headers:\n            Location:\n              example: https://pipelines.actions.githubusercontent.com/ab1f3cCFPB34Nd6imvFxpGZH5hNlDp2wijMwl2gDoO0bcrrlJj/_apis/pipelines/1/runs/19/signedlogcontent?urlExpires=2020-01-22T22%3A44%3A54.1389777Z&urlSigningMethod=HMACV1&urlSignature=2TUDfIg4fm36OJmfPy6km5QD5DLCOkBVzvhWZM8B%2BUY%3D\n              schema:\n                type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-runs\n    delete:\n      summary: Delete workflow run logs\n      description: Deletes all logs for a workflow run. You must authenticate using\n        an access token with the `repo` scope to use this endpoint. GitHub Apps must\n        have the `actions:write` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/delete-workflow-run-logs\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-workflow-run-logs\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/run-id\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '500':\n          \"$ref\": \"#/components/responses/internal_error\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-runs\n  \"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun\":\n    post:\n      summary: Re-run a workflow\n      description: Re-runs your workflow run using its `id`. You must authenticate\n        using an access token with the `repo` scope to use this endpoint. GitHub Apps\n        must have the `actions:write` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/re-run-workflow\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#re-run-a-workflow\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/run-id\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties: {}\n                additionalProperties: false\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        deprecationDate: '2021-09-14'\n        category: actions\n        subcategory: workflow-runs\n      deprecated: true\n  \"/repos/{owner}/{repo}/actions/secrets\":\n    get:\n      summary: List repository secrets\n      description: Lists all secrets available in a repository without revealing their\n        encrypted values. You must authenticate using an access token with the `repo`\n        scope to use this endpoint. GitHub Apps must have the `secrets` repository\n        permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-repo-secrets\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-repository-secrets\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - secrets\n                properties:\n                  total_count:\n                    type: integer\n                  secrets:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/actions-secret\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/actions-secret-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n  \"/repos/{owner}/{repo}/actions/secrets/public-key\":\n    get:\n      summary: Get a repository public key\n      description: Gets your public key, which you need to encrypt secrets. You need\n        to encrypt a secret before you can create or update secrets. Anyone with read\n        access to the repository can use this endpoint. If the repository is private\n        you must use an access token with the `repo` scope. GitHub Apps must have\n        the `secrets` repository permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-repo-public-key\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-repository-public-key\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/actions-public-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/actions-public-key\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n  \"/repos/{owner}/{repo}/actions/secrets/{secret_name}\":\n    get:\n      summary: Get a repository secret\n      description: Gets a single repository secret without revealing its encrypted\n        value. You must authenticate using an access token with the `repo` scope to\n        use this endpoint. GitHub Apps must have the `secrets` repository permission\n        to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-repo-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-repository-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/actions-secret\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/actions-secret\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n    put:\n      summary: Create or update a repository secret\n      description: |-\n        Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n        [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\n        token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use\n        this endpoint.\n\n        #### Example encrypting a secret using Node.js\n\n        Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\n\n        ```\n        const sodium = require('tweetsodium');\n\n        const key = \"base64-encoded-public-key\";\n        const value = \"plain-text-secret\";\n\n        // Convert the message and key to Uint8Array's (Buffer implements that interface)\n        const messageBytes = Buffer.from(value);\n        const keyBytes = Buffer.from(key, 'base64');\n\n        // Encrypt using LibSodium.\n        const encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n        // Base64 the encrypted secret\n        const encrypted = Buffer.from(encryptedBytes).toString('base64');\n\n        console.log(encrypted);\n        ```\n\n\n        #### Example encrypting a secret using Python\n\n        Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n        ```\n        from base64 import b64encode\n        from nacl import encoding, public\n\n        def encrypt(public_key: str, secret_value: str) -> str:\n          \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n          public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n          sealed_box = public.SealedBox(public_key)\n          encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n          return b64encode(encrypted).decode(\"utf-8\")\n        ```\n\n        #### Example encrypting a secret using C#\n\n        Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n        ```\n        var secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\n        var publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\n        var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\n        Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n        ```\n\n        #### Example encrypting a secret using Ruby\n\n        Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n        ```ruby\n        require \"rbnacl\"\n        require \"base64\"\n\n        key = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\n        public_key = RbNaCl::PublicKey.new(key)\n\n        box = RbNaCl::Boxes::Sealed.from_public_key(public_key)\n        encrypted_secret = box.encrypt(\"my_secret\")\n\n        # Print the base64 encoded secret\n        puts Base64.strict_encode64(encrypted_secret)\n        ```\n      tags:\n      - actions\n      operationId: actions/create-or-update-repo-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-a-repository-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                encrypted_value:\n                  type: string\n                  description: Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages)\n                    using the public key retrieved from the [Get a repository public\n                    key](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-repository-public-key)\n                    endpoint.\n                  pattern: \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$\"\n                key_id:\n                  type: string\n                  description: ID of the key you used to encrypt the secret.\n            example:\n              encrypted_value: c2VjcmV0\n              key_id: '012345678912345678'\n      responses:\n        '201':\n          description: Response when creating a secret\n          content:\n            application/json:\n              schema:\n                type: object\n                properties: {}\n                additionalProperties: false\n        '204':\n          description: Response when updating a secret\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n    delete:\n      summary: Delete a repository secret\n      description: Deletes a secret in a repository using the secret name. You must\n        authenticate using an access token with the `repo` scope to use this endpoint.\n        GitHub Apps must have the `secrets` repository permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/delete-repo-secret\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#delete-a-repository-secret\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/secret-name\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: secrets\n  \"/repos/{owner}/{repo}/actions/workflows\":\n    get:\n      summary: List repository workflows\n      description: Lists the workflows in a repository. Anyone with read access to\n        the repository can use this endpoint. If the repository is private you must\n        use an access token with the `repo` scope. GitHub Apps must have the `actions:read`\n        permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/list-repo-workflows\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-repository-workflows\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - workflows\n                properties:\n                  total_count:\n                    type: integer\n                  workflows:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/workflow\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/workflow-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflows\n  \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}\":\n    get:\n      summary: Get a workflow\n      description: Gets a specific workflow. You can replace `workflow_id` with the\n        workflow file name. For example, you could use `main.yaml`. Anyone with read\n        access to the repository can use this endpoint. If the repository is private\n        you must use an access token with the `repo` scope. GitHub Apps must have\n        the `actions:read` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/get-workflow\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#get-a-workflow\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/workflow-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/workflow\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/workflow\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflows\n  \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\":\n    put:\n      summary: Disable a workflow\n      description: |-\n        Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\n        You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/disable-workflow\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#disable-a-workflow\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/workflow-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflows\n  \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\":\n    post:\n      summary: Create a workflow dispatch event\n      description: |-\n        You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\n        You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see \"[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch).\"\n\n        You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see \"[Creating a personal access token for the command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line).\"\n      operationId: actions/create-workflow-dispatch\n      tags:\n      - actions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-a-workflow-dispatch-event\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/workflow-id\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                ref:\n                  type: string\n                  description: The git reference for the workflow. The reference can\n                    be a branch or tag name.\n                inputs:\n                  type: object\n                  description: Input keys and values configured in the workflow file.\n                    The maximum number of properties is 10. Any default properties\n                    configured in the workflow file will be used when `inputs` are\n                    omitted.\n                  additionalProperties:\n                    type: string\n                  maxProperties: 10\n              required:\n              - ref\n            example:\n              ref: topic-branch\n              inputs:\n                name: Mona the Octocat\n                home: San Francisco, CA\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflows\n  \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\":\n    put:\n      summary: Enable a workflow\n      description: |-\n        Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\n        You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.\n      tags:\n      - actions\n      operationId: actions/enable-workflow\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#enable-a-workflow\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/workflow-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflows\n  \"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\":\n    get:\n      summary: List workflow runs\n      description: |-\n        List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#parameters).\n\n        Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.\n      tags:\n      - actions\n      operationId: actions/list-workflow-runs\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/actions#list-workflow-runs\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/workflow-id\"\n      - \"$ref\": \"#/components/parameters/actor\"\n      - \"$ref\": \"#/components/parameters/workflow-run-branch\"\n      - \"$ref\": \"#/components/parameters/event\"\n      - \"$ref\": \"#/components/parameters/workflow-run-status\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/created\"\n      - \"$ref\": \"#/components/parameters/exclude-pull-requests\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - workflow_runs\n                properties:\n                  total_count:\n                    type: integer\n                  workflow_runs:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/workflow-run\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/workflow-run-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: actions\n        subcategory: workflow-runs\n  \"/repos/{owner}/{repo}/assignees\":\n    get:\n      summary: List assignees\n      description: Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/)\n        for issues in a repository.\n      tags:\n      - issues\n      operationId: issues/list-assignees\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-assignees\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: assignees\n  \"/repos/{owner}/{repo}/assignees/{assignee}\":\n    get:\n      summary: Check if a user can be assigned\n      description: |-\n        Checks if a user has permission to be assigned to an issue in this repository.\n\n        If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.\n\n        Otherwise a `404` status code is returned.\n      tags:\n      - issues\n      operationId: issues/check-user-can-be-assigned\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#check-if-a-user-can-be-assigned\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: assignee\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '204':\n          description: If the `assignee` can be assigned to issues in the repository,\n            a `204` header with no content is returned.\n        '404':\n          description: Otherwise a `404` status code is returned.\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/basic-error\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: assignees\n  \"/repos/{owner}/{repo}/branches\":\n    get:\n      summary: List branches\n      description: ''\n      tags:\n      - repos\n      operationId: repos/list-branches\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-branches\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: protected\n        description: Setting to `true` returns only protected branches. When set to\n          `false`, only unprotected branches are returned. Omitting this parameter\n          returns all branches.\n        in: query\n        required: false\n        schema:\n          type: boolean\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/short-branch\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/short-branch-with-protection-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}\":\n    get:\n      summary: Get a branch\n      description: ''\n      tags:\n      - repos\n      operationId: repos/get-branch\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-branch\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/branch-with-protection\"\n        '301':\n          \"$ref\": \"#/components/responses/moved_permanently\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection\":\n    get:\n      summary: Get branch protection\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/get-branch-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-branch-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/branch-protection\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/branch-protection\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n        previews:\n        - required: false\n          name: luke-cage\n          note: |-\n            The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.luke-cage-preview+json\n            ```\n    put:\n      summary: Update branch protection\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Protecting a branch requires admin or owner permissions to the repository.\n\n        **Note**: Passing new arrays of `users` and `teams` replaces their previous values.\n\n        **Note**: The list of users, apps, and teams in total is limited to 100 items.\n      tags:\n      - repos\n      operationId: repos/update-branch-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-branch-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                required_status_checks:\n                  type:\n                  - object\n                  - 'null'\n                  description: Require status checks to pass before merging. Set to\n                    `null` to disable.\n                  properties:\n                    strict:\n                      type: boolean\n                      description: Require branches to be up to date before merging.\n                    contexts:\n                      type: array\n                      deprecated: true\n                      description: \"**Deprecated**: The list of status checks to require\n                        in order to merge into this branch. If any of these checks\n                        have recently been set by a particular GitHub App, they will\n                        be required to come from that app in future for the branch\n                        to merge. Use `checks` instead of `contexts` for more fine-grained\n                        control.\\n\"\n                      items:\n                        type: string\n                    checks:\n                      type: array\n                      description: The list of status checks to require in order to\n                        merge into this branch.\n                      items:\n                        type: object\n                        required:\n                        - context\n                        properties:\n                          context:\n                            type: string\n                            description: The name of the required check\n                          app_id:\n                            type: integer\n                            description: The ID of the GitHub App that must provide\n                              this check. Omit this field to automatically select\n                              the GitHub App that has recently provided this check,\n                              or any app if it was not set by a GitHub App. Pass -1\n                              to explicitly allow any app to set the status.\n                  required:\n                  - strict\n                  - contexts\n                enforce_admins:\n                  type:\n                  - boolean\n                  - 'null'\n                  description: Enforce all configured restrictions for administrators.\n                    Set to `true` to enforce required status checks for repository\n                    administrators. Set to `null` to disable.\n                required_pull_request_reviews:\n                  type:\n                  - object\n                  - 'null'\n                  description: Require at least one approving review on a pull request,\n                    before merging. Set to `null` to disable.\n                  properties:\n                    dismissal_restrictions:\n                      type: object\n                      description: Specify which users and teams can dismiss pull\n                        request reviews. Pass an empty `dismissal_restrictions` object\n                        to disable. User and team `dismissal_restrictions` are only\n                        available for organization-owned repositories. Omit this parameter\n                        for personal repositories.\n                      properties:\n                        users:\n                          type: array\n                          description: The list of user `login`s with dismissal access\n                          items:\n                            type: string\n                        teams:\n                          type: array\n                          description: The list of team `slug`s with dismissal access\n                          items:\n                            type: string\n                    dismiss_stale_reviews:\n                      type: boolean\n                      description: Set to `true` if you want to automatically dismiss\n                        approving reviews when someone pushes a new commit.\n                    require_code_owner_reviews:\n                      type: boolean\n                      description: Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/)\n                        review them.\n                    required_approving_review_count:\n                      type: integer\n                      description: Specify the number of reviewers required to approve\n                        pull requests. Use a number between 1 and 6.\n                restrictions:\n                  type:\n                  - object\n                  - 'null'\n                  description: Restrict who can push to the protected branch. User,\n                    app, and team `restrictions` are only available for organization-owned\n                    repositories. Set to `null` to disable.\n                  properties:\n                    users:\n                      type: array\n                      description: The list of user `login`s with push access\n                      items:\n                        type: string\n                    teams:\n                      type: array\n                      description: The list of team `slug`s with push access\n                      items:\n                        type: string\n                    apps:\n                      type: array\n                      description: The list of app `slug`s with push access\n                      items:\n                        type: string\n                  required:\n                  - users\n                  - teams\n                required_linear_history:\n                  type: boolean\n                  description: 'Enforces a linear commit Git history, which prevents\n                    anyone from pushing merge commits to a branch. Set to `true` to\n                    enforce a linear commit history. Set to `false` to disable a linear\n                    commit Git history. Your repository must allow squash merging\n                    or rebase merging before you can enable a linear commit history.\n                    Default: `false`. For more information, see \"[Requiring a linear\n                    commit history](https://docs.github.com/github/administering-a-repository/requiring-a-linear-commit-history)\"\n                    in the GitHub Help documentation.'\n                allow_force_pushes:\n                  type:\n                  - boolean\n                  - 'null'\n                  description: 'Permits force pushes to the protected branch by anyone\n                    with write access to the repository. Set to `true` to allow force\n                    pushes. Set to `false` or `null` to block force pushes. Default:\n                    `false`. For more information, see \"[Enabling force pushes to\n                    a protected branch](https://docs.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)\"\n                    in the GitHub Help documentation.\"'\n                allow_deletions:\n                  type: boolean\n                  description: 'Allows deletion of the protected branch by anyone\n                    with write access to the repository. Set to `false` to prevent\n                    deletion of the protected branch. Default: `false`. For more information,\n                    see \"[Enabling force pushes to a protected branch](https://docs.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)\"\n                    in the GitHub Help documentation.'\n                required_conversation_resolution:\n                  type: boolean\n                  description: 'Requires all conversations on code to be resolved\n                    before a pull request can be merged into a branch that matches\n                    this rule. Set to `false` to disable. Default: `false`.'\n                contexts:\n                  type: array\n                  description: The list of status checks to require in order to merge\n                    into this branch.\n                  items:\n                    type: string\n              required:\n              - required_status_checks\n              - enforce_admins\n              - required_pull_request_reviews\n              - restrictions\n            example:\n              required_status_checks:\n                strict: true\n                contexts:\n                - continuous-integration/travis-ci\n              enforce_admins: true\n              required_pull_request_reviews:\n                dismissal_restrictions:\n                  users:\n                  - octocat\n                  teams:\n                  - justice-league\n                dismiss_stale_reviews: true\n                require_code_owner_reviews: true\n                required_approving_review_count: 2\n                bypass_pull_request_allowances:\n                  users:\n                  - octocat\n                  teams:\n                  - justice-league\n              restrictions:\n                users:\n                - octocat\n                teams:\n                - justice-league\n                apps:\n                - super-ci\n              required_linear_history: true\n              allow_force_pushes: true\n              allow_deletions: true\n              required_conversation_resolution: true\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/protected-branch\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n        previews:\n        - required: false\n          name: luke-cage\n          note: |-\n            The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.luke-cage-preview+json\n            ```\n    delete:\n      summary: Delete branch protection\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/delete-branch-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-branch-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\":\n    get:\n      summary: Get admin branch protection\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/get-admin-branch-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-admin-branch-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/protected-branch-admin-enforced-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    post:\n      summary: Set admin branch protection\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.\n      tags:\n      - repos\n      operationId: repos/set-admin-branch-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-admin-branch-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/protected-branch-admin-enforced-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    delete:\n      summary: Delete admin branch protection\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.\n      tags:\n      - repos\n      operationId: repos/delete-admin-branch-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-admin-branch-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\":\n    get:\n      summary: Get pull request review protection\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/get-pull-request-review-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-pull-request-review-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/protected-branch-pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/protected-branch-pull-request-review\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n        previews:\n        - required: false\n          name: luke-cage\n          note: |-\n            The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.luke-cage-preview+json\n            ```\n    patch:\n      summary: Update pull request review protection\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.\n\n        **Note**: Passing new arrays of `users` and `teams` replaces their previous values.\n      tags:\n      - repos\n      operationId: repos/update-pull-request-review-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-pull-request-review-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                dismissal_restrictions:\n                  type: object\n                  description: Specify which users and teams can dismiss pull request\n                    reviews. Pass an empty `dismissal_restrictions` object to disable.\n                    User and team `dismissal_restrictions` are only available for\n                    organization-owned repositories. Omit this parameter for personal\n                    repositories.\n                  properties:\n                    users:\n                      type: array\n                      description: The list of user `login`s with dismissal access\n                      items:\n                        type: string\n                    teams:\n                      type: array\n                      description: The list of team `slug`s with dismissal access\n                      items:\n                        type: string\n                dismiss_stale_reviews:\n                  type: boolean\n                  description: Set to `true` if you want to automatically dismiss\n                    approving reviews when someone pushes a new commit.\n                require_code_owner_reviews:\n                  type: boolean\n                  description: Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/)\n                    have reviewed.\n                required_approving_review_count:\n                  type: integer\n                  description: Specifies the number of reviewers required to approve\n                    pull requests. Use a number between 1 and 6.\n            example:\n              dismissal_restrictions:\n                users:\n                - octocat\n                teams:\n                - justice-league\n              bypass_pull_request_allowances:\n                users:\n                - octocat\n                teams:\n                - justice-league\n              dismiss_stale_reviews: true\n              require_code_owner_reviews: true\n              required_approving_review_count: 2\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/protected-branch-pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/protected-branch-pull-request-review\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n        previews:\n        - required: false\n          name: luke-cage\n          note: |-\n            The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.luke-cage-preview+json\n            ```\n    delete:\n      summary: Delete pull request review protection\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/delete-pull-request-review-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-pull-request-review-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\":\n    get:\n      summary: Get commit signature protection\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.\n\n        **Note**: You must enable branch protection to require signed commits.\n      tags:\n      - repos\n      operationId: repos/get-commit-signature-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-commit-signature-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/protected-branch-admin-enforced\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n        previews:\n        - required: true\n          name: zzzax\n          note: |-\n            Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.zzzax-preview+json\n            ```\n    post:\n      summary: Create commit signature protection\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.\n      tags:\n      - repos\n      operationId: repos/create-commit-signature-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-commit-signature-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/protected-branch-admin-enforced\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n        previews:\n        - required: true\n          name: zzzax\n          note: |-\n            Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.zzzax-preview+json\n            ```\n    delete:\n      summary: Delete commit signature protection\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.\n      tags:\n      - repos\n      operationId: repos/delete-commit-signature-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-commit-signature-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n        previews:\n        - required: true\n          name: zzzax\n          note: |-\n            Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.zzzax-preview+json\n            ```\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\":\n    get:\n      summary: Get status checks protection\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/get-status-checks-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-status-checks-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/status-check-policy\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/status-check-policy\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    patch:\n      summary: Update status check protection\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.\n      tags:\n      - repos\n      operationId: repos/update-status-check-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-status-check-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                strict:\n                  type: boolean\n                  description: Require branches to be up to date before merging.\n                contexts:\n                  type: array\n                  deprecated: true\n                  description: The list of status checks to require in order to merge\n                    into this branch\n                  items:\n                    type: string\n            example:\n              strict: true\n              contexts:\n              - continuous-integration/travis-ci\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/status-check-policy\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/status-check-policy\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    delete:\n      summary: Remove status check protection\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/remove-status-check-protection\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-status-check-protection\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\":\n    get:\n      summary: Get all status check contexts\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/get-all-status-check-contexts\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-all-status-check-contexts\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  type: string\n              example:\n              - continuous-integration/travis-ci\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    post:\n      summary: Add status check contexts\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/add-status-check-contexts\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-status-check-contexts\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  contexts:\n                    type: array\n                    description: contexts parameter\n                    items:\n                      type: string\n                required:\n                - contexts\n                example:\n                  contexts:\n                  - contexts\n              - type: array\n                description: contexts parameter\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  type: string\n              example:\n              - continuous-integration/travis-ci\n              - continuous-integration/jenkins\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: contexts\n        category: repos\n        subcategory: branches\n    put:\n      summary: Set status check contexts\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/set-status-check-contexts\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-status-check-contexts\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  contexts:\n                    type: array\n                    description: contexts parameter\n                    items:\n                      type: string\n                required:\n                - contexts\n                example:\n                  contexts:\n                  - contexts\n              - type: array\n                description: contexts parameter\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  type: string\n              example:\n              - continuous-integration/travis-ci\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: contexts\n        category: repos\n        subcategory: branches\n    delete:\n      summary: Remove status check contexts\n      description: Protected branches are available in public repositories with GitHub\n        Free and GitHub Free for organizations, and in public and private repositories\n        with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise\n        Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - repos\n      operationId: repos/remove-status-check-contexts\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-status-check-contexts\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  contexts:\n                    type: array\n                    description: contexts parameter\n                    items:\n                      type: string\n                required:\n                - contexts\n                example:\n                  contexts:\n                  - contexts\n              - type: array\n                description: contexts parameter\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  type: string\n              example:\n              - continuous-integration/travis-ci\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: contexts\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions\":\n    get:\n      summary: Get access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Lists who has access to this protected branch.\n\n        **Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories.\n      tags:\n      - repos\n      operationId: repos/get-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/branch-restriction-policy\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/branch-restriction-policy\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    delete:\n      summary: Delete access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Disables the ability to restrict who can push to this branch.\n      tags:\n      - repos\n      operationId: repos/delete-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\":\n    get:\n      summary: Get apps with access to the protected branch\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\n      tags:\n      - repos\n      operationId: repos/get-apps-with-access-to-protected-branch\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-apps-with-access-to-the-protected-branch\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/integration\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/integration-items\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    post:\n      summary: Add app access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Grants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\n\n        | Type    | Description                                                                                                                                                |\n        | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n        | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/add-app-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-app-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  apps:\n                    type: array\n                    description: apps parameter\n                    items:\n                      type: string\n                required:\n                - apps\n                example:\n                  apps:\n                  - my-app\n              - type: array\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/integration\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/integration-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: apps\n        category: repos\n        subcategory: branches\n    put:\n      summary: Set app access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\n\n        | Type    | Description                                                                                                                                                |\n        | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n        | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/set-app-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-app-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  apps:\n                    type: array\n                    description: apps parameter\n                    items:\n                      type: string\n                required:\n                - apps\n                example:\n                  apps:\n                  - my-app\n              - type: array\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/integration\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/integration-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: apps\n        category: repos\n        subcategory: branches\n    delete:\n      summary: Remove app access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Removes the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\n\n        | Type    | Description                                                                                                                                                |\n        | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n        | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/remove-app-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-app-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  apps:\n                    type: array\n                    description: apps parameter\n                    items:\n                      type: string\n                required:\n                - apps\n                example:\n                  apps:\n                  - my-app\n              - type: array\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/integration\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/integration-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: apps\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\":\n    get:\n      summary: Get teams with access to the protected branch\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Lists the teams who have push access to this branch. The list includes child teams.\n      tags:\n      - repos\n      operationId: repos/get-teams-with-access-to-protected-branch\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-teams-with-access-to-the-protected-branch\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-items\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    post:\n      summary: Add team access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Grants the specified teams push access for this branch. You can also give push access to child teams.\n\n        | Type    | Description                                                                                                                                |\n        | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n        | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/add-team-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-team-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  teams:\n                    type: array\n                    description: teams parameter\n                    items:\n                      type: string\n                required:\n                - teams\n                example:\n                  teams:\n                  - my-team\n              - type: array\n                description: teams parameter\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: teams\n        category: repos\n        subcategory: branches\n    put:\n      summary: Set team access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.\n\n        | Type    | Description                                                                                                                                |\n        | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n        | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/set-team-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-team-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  teams:\n                    type: array\n                    description: teams parameter\n                    items:\n                      type: string\n                required:\n                - teams\n                example:\n                  teams:\n                  - my-team\n              - type: array\n                description: teams parameter\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: teams\n        category: repos\n        subcategory: branches\n    delete:\n      summary: Remove team access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Removes the ability of a team to push to this branch. You can also remove push access for child teams.\n\n        | Type    | Description                                                                                                                                         |\n        | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |\n        | `array` | Teams that should no longer have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/remove-team-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-team-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  teams:\n                    type: array\n                    description: teams parameter\n                    items:\n                      type: string\n                required:\n                - teams\n                example:\n                  teams:\n                  - my-team\n              - type: array\n                description: teams parameter\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: teams\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\":\n    get:\n      summary: Get users with access to the protected branch\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Lists the people who have push access to this branch.\n      tags:\n      - repos\n      operationId: repos/get-users-with-access-to-protected-branch\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-users-with-access-to-the-protected-branch\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: branches\n    post:\n      summary: Add user access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Grants the specified people push access for this branch.\n\n        | Type    | Description                                                                                                                   |\n        | ------- | ----------------------------------------------------------------------------------------------------------------------------- |\n        | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/add-user-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-user-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  users:\n                    type: array\n                    description: users parameter\n                    items:\n                      type: string\n                required:\n                - users\n                example:\n                  users:\n                  - mona\n              - type: array\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: users\n        category: repos\n        subcategory: branches\n    put:\n      summary: Set user access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.\n\n        | Type    | Description                                                                                                                   |\n        | ------- | ----------------------------------------------------------------------------------------------------------------------------- |\n        | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/set-user-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#set-user-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  users:\n                    type: array\n                    description: users parameter\n                    items:\n                      type: string\n                required:\n                - users\n                example:\n                  users:\n                  - mona\n              - type: array\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: users\n        category: repos\n        subcategory: branches\n    delete:\n      summary: Remove user access restrictions\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Removes the ability of a user to push to this branch.\n\n        | Type    | Description                                                                                                                                   |\n        | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n        | `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |\n      tags:\n      - repos\n      operationId: repos/remove-user-access-restrictions\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-user-access-restrictions\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/branch\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  users:\n                    type: array\n                    description: users parameter\n                    items:\n                      type: string\n                required:\n                - users\n                example:\n                  users:\n                  - mona\n              - type: array\n                items:\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        requestBodyParameterName: users\n        category: repos\n        subcategory: branches\n  \"/repos/{owner}/{repo}/check-runs\":\n    post:\n      summary: Create a check run\n      description: |-\n        **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\n        Creates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs.\n\n        In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.\n      tags:\n      - checks\n      operationId: checks/create\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#create-a-check-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the check. For example, \"code-coverage\".\n                head_sha:\n                  type: string\n                  description: The SHA of the commit.\n                details_url:\n                  type: string\n                  description: The URL of the integrator's site that has the full\n                    details of the check. If the integrator does not provide this,\n                    then the homepage of the GitHub app is used.\n                external_id:\n                  type: string\n                  description: A reference for the run on the integrator's system.\n                status:\n                  type: string\n                  description: The current status. Can be one of `queued`, `in_progress`,\n                    or `completed`.\n                  enum:\n                  - queued\n                  - in_progress\n                  - completed\n                  default: queued\n                started_at:\n                  type: string\n                  format: date-time\n                  description: 'The time that the check run began. This is a timestamp\n                    in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format:\n                    `YYYY-MM-DDTHH:MM:SSZ`.'\n                conclusion:\n                  type: string\n                  description: \"**Required if you provide `completed_at` or a `status`\n                    of `completed`**. The final conclusion of the check. Can be one\n                    of `action_required`, `cancelled`, `failure`, `neutral`, `success`,\n                    `skipped`, `stale`, or `timed_out`. When the conclusion is `action_required`,\n                    additional details should be provided on the site specified by\n                    `details_url`.  \\n**Note:** Providing `conclusion` will automatically\n                    set the `status` parameter to `completed`. You cannot change a\n                    check run conclusion to `stale`, only GitHub can set this.\"\n                  enum:\n                  - action_required\n                  - cancelled\n                  - failure\n                  - neutral\n                  - success\n                  - skipped\n                  - stale\n                  - timed_out\n                completed_at:\n                  type: string\n                  format: date-time\n                  description: 'The time the check completed. This is a timestamp\n                    in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format:\n                    `YYYY-MM-DDTHH:MM:SSZ`.'\n                output:\n                  type: object\n                  description: Check runs can accept a variety of data in the `output`\n                    object, including a `title` and `summary` and can optionally provide\n                    descriptive details about the run. See the [`output` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#output-object)\n                    description.\n                  properties:\n                    title:\n                      type: string\n                      description: The title of the check run.\n                    summary:\n                      type: string\n                      maxLength: 65535\n                      description: The summary of the check run. This parameter supports\n                        Markdown.\n                    text:\n                      type: string\n                      maxLength: 65535\n                      description: The details of the check run. This parameter supports\n                        Markdown.\n                    annotations:\n                      type: array\n                      description: Adds information from your analysis to specific\n                        lines of code. Annotations are visible on GitHub in the **Checks**\n                        and **Files changed** tab of the pull request. The Checks\n                        API limits the number of annotations to a maximum of 50 per\n                        API request. To create more than 50 annotations, you have\n                        to make multiple requests to the [Update a check run](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-a-check-run)\n                        endpoint. Each time you update the check run, annotations\n                        are appended to the list of annotations that already exist\n                        for the check run. For details about how you can view annotations\n                        on GitHub, see \"[About status checks](https://docs.github.com/articles/about-status-checks#checks)\".\n                        See the [`annotations` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#annotations-object)\n                        description for details about how to use this parameter.\n                      maxItems: 50\n                      items:\n                        type: object\n                        properties:\n                          path:\n                            type: string\n                            description: The path of the file to add an annotation\n                              to. For example, `assets/css/main.css`.\n                          start_line:\n                            type: integer\n                            description: The start line of the annotation.\n                          end_line:\n                            type: integer\n                            description: The end line of the annotation.\n                          start_column:\n                            type: integer\n                            description: The start column of the annotation. Annotations\n                              only support `start_column` and `end_column` on the\n                              same line. Omit this parameter if `start_line` and `end_line`\n                              have different values.\n                          end_column:\n                            type: integer\n                            description: The end column of the annotation. Annotations\n                              only support `start_column` and `end_column` on the\n                              same line. Omit this parameter if `start_line` and `end_line`\n                              have different values.\n                          annotation_level:\n                            type: string\n                            description: The level of the annotation. Can be one of\n                              `notice`, `warning`, or `failure`.\n                            enum:\n                            - notice\n                            - warning\n                            - failure\n                          message:\n                            type: string\n                            description: A short description of the feedback for these\n                              lines of code. The maximum size is 64 KB.\n                          title:\n                            type: string\n                            description: The title that represents the annotation.\n                              The maximum size is 255 characters.\n                          raw_details:\n                            type: string\n                            description: Details about this annotation. The maximum\n                              size is 64 KB.\n                        required:\n                        - path\n                        - start_line\n                        - end_line\n                        - annotation_level\n                        - message\n                    images:\n                      type: array\n                      description: Adds images to the output displayed in the GitHub\n                        pull request UI. See the [`images` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#images-object)\n                        description for details.\n                      items:\n                        type: object\n                        properties:\n                          alt:\n                            type: string\n                            description: The alternative text for the image.\n                          image_url:\n                            type: string\n                            description: The full URL of the image.\n                          caption:\n                            type: string\n                            description: A short image description.\n                        required:\n                        - alt\n                        - image_url\n                  required:\n                  - title\n                  - summary\n                actions:\n                  type: array\n                  description: Displays a button on GitHub that can be clicked to\n                    alert your app to do additional tasks. For example, a code linting\n                    app can display a button that automatically fixes detected errors.\n                    The button created in this object is displayed after the check\n                    run completes. When a user clicks the button, GitHub sends the\n                    [`check_run.requested_action` webhook](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#check_run)\n                    to your app. Each action includes a `label`, `identifier` and\n                    `description`. A maximum of three actions are accepted. See the\n                    [`actions` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#actions-object)\n                    description. To learn more about check runs and requested actions,\n                    see \"[Check runs and requested actions](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#check-runs-and-requested-actions).\"\n                  maxItems: 3\n                  items:\n                    type: object\n                    properties:\n                      label:\n                        type: string\n                        maxLength: 20\n                        description: The text to be displayed on a button in the web\n                          UI. The maximum size is 20 characters.\n                      description:\n                        type: string\n                        maxLength: 40\n                        description: A short explanation of what this action would\n                          do. The maximum size is 40 characters.\n                      identifier:\n                        type: string\n                        maxLength: 20\n                        description: A reference for the action on the integrator's\n                          system. The maximum size is 20 characters.\n                    required:\n                    - label\n                    - description\n                    - identifier\n              required:\n              - name\n              - head_sha\n              oneOf:\n              - properties:\n                  status:\n                    enum:\n                    - completed\n                required:\n                - status\n                - conclusion\n                additionalProperties: true\n              - properties:\n                  status:\n                    enum:\n                    - queued\n                    - in_progress\n                additionalProperties: true\n            examples:\n              example-of-in-progress-conclusion:\n                summary: Response for in_progress conclusion\n                value:\n                  name: mighty_readme\n                  head_sha: ce587453ced02b1526dfb4cb910479d431683101\n                  status: in_progress\n                  external_id: '42'\n                  started_at: '2018-05-04T01:14:52Z'\n                  output:\n                    title: Mighty Readme report\n                    summary: ''\n                    text: ''\n              example-of-completed-conclusion:\n                summary: Response for completed conclusion\n                value:\n                  name: mighty_readme\n                  head_sha: ce587453ced02b1526dfb4cb910479d431683101\n                  status: completed\n                  started_at: '2017-11-30T19:39:10Z'\n                  conclusion: success\n                  completed_at: '2017-11-30T19:49:10Z'\n                  output:\n                    title: Mighty Readme report\n                    summary: There are 0 failures, 2 warnings, and 1 notices.\n                    text: You may have some misspelled words on lines 2 and 4. You\n                      also may want to add a section in your README about how to install\n                      your app.\n                    annotations:\n                    - path: README.md\n                      annotation_level: warning\n                      title: Spell Checker\n                      message: Check your spelling for 'banaas'.\n                      raw_details: Do you mean 'bananas' or 'banana'?\n                      start_line: 2\n                      end_line: 2\n                    - path: README.md\n                      annotation_level: warning\n                      title: Spell Checker\n                      message: Check your spelling for 'aples'\n                      raw_details: Do you mean 'apples' or 'Naples'\n                      start_line: 4\n                      end_line: 4\n                    images:\n                    - alt: Super bananas\n                      image_url: http://example.com/images/42\n                  actions:\n                  - label: Fix\n                    identifier: fix_errors\n                    description: Allow us to fix these errors for you\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/check-run\"\n              examples:\n                example-of-completed-conclusion:\n                  \"$ref\": \"#/components/examples/check-run-example-of-completed-conclusion\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: runs\n  \"/repos/{owner}/{repo}/check-runs/{check_run_id}\":\n    get:\n      summary: Get a check run\n      description: |-\n        **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\n        Gets a single check run using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.\n      tags:\n      - checks\n      operationId: checks/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#get-a-check-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/check-run-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/check-run\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-run\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: runs\n    patch:\n      summary: Update a check run\n      description: |-\n        **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\n        Updates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs.\n      tags:\n      - checks\n      operationId: checks/update\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-a-check-run\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/check-run-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the check. For example, \"code-coverage\".\n                details_url:\n                  type: string\n                  description: The URL of the integrator's site that has the full\n                    details of the check.\n                external_id:\n                  type: string\n                  description: A reference for the run on the integrator's system.\n                started_at:\n                  type: string\n                  format: date-time\n                  description: 'This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)\n                    format: `YYYY-MM-DDTHH:MM:SSZ`.'\n                status:\n                  type: string\n                  description: The current status. Can be one of `queued`, `in_progress`,\n                    or `completed`.\n                  enum:\n                  - queued\n                  - in_progress\n                  - completed\n                conclusion:\n                  type: string\n                  description: \"**Required if you provide `completed_at` or a `status`\n                    of `completed`**. The final conclusion of the check. Can be one\n                    of `action_required`, `cancelled`, `failure`, `neutral`, `success`,\n                    `skipped`, `stale`, or `timed_out`.  \\n**Note:** Providing `conclusion`\n                    will automatically set the `status` parameter to `completed`.\n                    You cannot change a check run conclusion to `stale`, only GitHub\n                    can set this.\"\n                  enum:\n                  - action_required\n                  - cancelled\n                  - failure\n                  - neutral\n                  - success\n                  - skipped\n                  - stale\n                  - timed_out\n                completed_at:\n                  type: string\n                  format: date-time\n                  description: 'The time the check completed. This is a timestamp\n                    in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format:\n                    `YYYY-MM-DDTHH:MM:SSZ`.'\n                output:\n                  type: object\n                  description: Check runs can accept a variety of data in the `output`\n                    object, including a `title` and `summary` and can optionally provide\n                    descriptive details about the run. See the [`output` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#output-object-1)\n                    description.\n                  properties:\n                    title:\n                      type: string\n                      description: \"**Required**.\"\n                    summary:\n                      type: string\n                      description: Can contain Markdown.\n                      maxLength: 65535\n                    text:\n                      type: string\n                      description: Can contain Markdown.\n                      maxLength: 65535\n                    annotations:\n                      type: array\n                      description: Adds information from your analysis to specific\n                        lines of code. Annotations are visible in GitHub's pull request\n                        UI. Annotations are visible in GitHub's pull request UI. The\n                        Checks API limits the number of annotations to a maximum of\n                        50 per API request. To create more than 50 annotations, you\n                        have to make multiple requests to the [Update a check run](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-a-check-run)\n                        endpoint. Each time you update the check run, annotations\n                        are appended to the list of annotations that already exist\n                        for the check run. For details about annotations in the UI,\n                        see \"[About status checks](https://docs.github.com/articles/about-status-checks#checks)\".\n                        See the [`annotations` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#annotations-object-1)\n                        description for details.\n                      maxItems: 50\n                      items:\n                        type: object\n                        properties:\n                          path:\n                            type: string\n                            description: The path of the file to add an annotation\n                              to. For example, `assets/css/main.css`.\n                          start_line:\n                            type: integer\n                            description: The start line of the annotation.\n                          end_line:\n                            type: integer\n                            description: The end line of the annotation.\n                          start_column:\n                            type: integer\n                            description: The start column of the annotation. Annotations\n                              only support `start_column` and `end_column` on the\n                              same line. Omit this parameter if `start_line` and `end_line`\n                              have different values.\n                          end_column:\n                            type: integer\n                            description: The end column of the annotation. Annotations\n                              only support `start_column` and `end_column` on the\n                              same line. Omit this parameter if `start_line` and `end_line`\n                              have different values.\n                          annotation_level:\n                            type: string\n                            description: The level of the annotation. Can be one of\n                              `notice`, `warning`, or `failure`.\n                            enum:\n                            - notice\n                            - warning\n                            - failure\n                          message:\n                            type: string\n                            description: A short description of the feedback for these\n                              lines of code. The maximum size is 64 KB.\n                          title:\n                            type: string\n                            description: The title that represents the annotation.\n                              The maximum size is 255 characters.\n                          raw_details:\n                            type: string\n                            description: Details about this annotation. The maximum\n                              size is 64 KB.\n                        required:\n                        - path\n                        - start_line\n                        - end_line\n                        - annotation_level\n                        - message\n                    images:\n                      type: array\n                      description: Adds images to the output displayed in the GitHub\n                        pull request UI. See the [`images` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#annotations-object-1)\n                        description for details.\n                      items:\n                        type: object\n                        properties:\n                          alt:\n                            type: string\n                            description: The alternative text for the image.\n                          image_url:\n                            type: string\n                            description: The full URL of the image.\n                          caption:\n                            type: string\n                            description: A short image description.\n                        required:\n                        - alt\n                        - image_url\n                  required:\n                  - summary\n                actions:\n                  type: array\n                  description: Possible further actions the integrator can perform,\n                    which a user may trigger. Each action includes a `label`, `identifier`\n                    and `description`. A maximum of three actions are accepted. See\n                    the [`actions` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#actions-object)\n                    description. To learn more about check runs and requested actions,\n                    see \"[Check runs and requested actions](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#check-runs-and-requested-actions).\"\n                  maxItems: 3\n                  items:\n                    type: object\n                    properties:\n                      label:\n                        type: string\n                        maxLength: 20\n                        description: The text to be displayed on a button in the web\n                          UI. The maximum size is 20 characters.\n                      description:\n                        type: string\n                        maxLength: 40\n                        description: A short explanation of what this action would\n                          do. The maximum size is 40 characters.\n                      identifier:\n                        type: string\n                        maxLength: 20\n                        description: A reference for the action on the integrator's\n                          system. The maximum size is 20 characters.\n                    required:\n                    - label\n                    - description\n                    - identifier\n              anyOf:\n              - properties:\n                  status:\n                    enum:\n                    - completed\n                required:\n                - conclusion\n                additionalProperties: true\n              - properties:\n                  status:\n                    enum:\n                    - queued\n                    - in_progress\n                additionalProperties: true\n            example:\n              name: mighty_readme\n              started_at: '2018-05-04T01:14:52Z'\n              status: completed\n              conclusion: success\n              completed_at: '2018-05-04T01:14:52Z'\n              output:\n                title: Mighty Readme report\n                summary: There are 0 failures, 2 warnings, and 1 notices.\n                text: You may have some misspelled words on lines 2 and 4. You also\n                  may want to add a section in your README about how to install your\n                  app.\n                annotations:\n                - path: README.md\n                  annotation_level: warning\n                  title: Spell Checker\n                  message: Check your spelling for 'banaas'.\n                  raw_details: Do you mean 'bananas' or 'banana'?\n                  start_line: 2\n                  end_line: 2\n                - path: README.md\n                  annotation_level: warning\n                  title: Spell Checker\n                  message: Check your spelling for 'aples'\n                  raw_details: Do you mean 'apples' or 'Naples'\n                  start_line: 4\n                  end_line: 4\n                images:\n                - alt: Super bananas\n                  image_url: http://example.com/images/42\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/check-run\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-run\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: runs\n  \"/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\":\n    get:\n      summary: List check run annotations\n      description: Lists annotations for a check run using the annotation `id`. GitHub\n        Apps must have the `checks:read` permission on a private repository or pull\n        access to a public repository to get annotations for a check run. OAuth Apps\n        and authenticated users must have the `repo` scope to get annotations for\n        a check run in a private repository.\n      tags:\n      - checks\n      operationId: checks/list-annotations\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#list-check-run-annotations\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/check-run-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/check-annotation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-annotation-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: runs\n  \"/repos/{owner}/{repo}/check-suites\":\n    post:\n      summary: Create a check suite\n      description: |-\n        **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\n\n        By default, check suites are automatically created when you create a [check run](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using \"[Update repository preferences for check suites](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-repository-preferences-for-check-suites)\". Your GitHub App must have the `checks:write` permission to create check suites.\n      tags:\n      - checks\n      operationId: checks/create-suite\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#create-a-check-suite\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                head_sha:\n                  type: string\n                  description: The sha of the head commit.\n              required:\n              - head_sha\n            example:\n              head_sha: d6fde92930d4715a2b49857d24b940956b26d2d3\n      responses:\n        '200':\n          description: when the suite already existed\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/check-suite\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-suite\"\n        '201':\n          description: Response when the suite was created\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/check-suite\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-suite\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: suites\n  \"/repos/{owner}/{repo}/check-suites/preferences\":\n    patch:\n      summary: Update repository preferences for check suites\n      description: Changes the default automatic flow when creating check suites.\n        By default, a check suite is automatically created each time code is pushed\n        to a repository. When you disable the automatic creation of check suites,\n        you can manually [Create a check suite](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#create-a-check-suite).\n        You must have admin permissions in the repository to set preferences for check\n        suites.\n      tags:\n      - checks\n      operationId: checks/set-suites-preferences\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#update-repository-preferences-for-check-suites\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                auto_trigger_checks:\n                  type: array\n                  description: Enables or disables automatic creation of CheckSuite\n                    events upon pushes to the repository. Enabled by default. See\n                    the [`auto_trigger_checks` object](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#auto_trigger_checks-object)\n                    description for details.\n                  items:\n                    type: object\n                    properties:\n                      app_id:\n                        type: integer\n                        description: The `id` of the GitHub App.\n                      setting:\n                        type: boolean\n                        description: Set to `true` to enable automatic creation of\n                          CheckSuite events upon pushes to the repository, or `false`\n                          to disable them.\n                        default: true\n                    required:\n                    - app_id\n                    - setting\n            example:\n              auto_trigger_checks:\n              - app_id: 4\n                setting: false\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/check-suite-preference\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-suite-preference\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: suites\n  \"/repos/{owner}/{repo}/check-suites/{check_suite_id}\":\n    get:\n      summary: Get a check suite\n      description: |-\n        **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\n\n        Gets a single check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository.\n      tags:\n      - checks\n      operationId: checks/get-suite\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#get-a-check-suite\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/check-suite-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/check-suite\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-suite\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: suites\n  \"/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\":\n    get:\n      summary: List check runs in a check suite\n      description: |-\n        **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\n        Lists check runs for a check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.\n      tags:\n      - checks\n      operationId: checks/list-for-suite\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#list-check-runs-in-a-check-suite\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/check-suite-id\"\n      - \"$ref\": \"#/components/parameters/check-name\"\n      - \"$ref\": \"#/components/parameters/status\"\n      - name: filter\n        description: Filters check runs by their `completed_at` timestamp. Can be\n          one of `latest` (returning the most recent check runs) or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - latest\n          - all\n          default: latest\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - check_runs\n                properties:\n                  total_count:\n                    type: integer\n                  check_runs:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/check-run\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-run-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: runs\n  \"/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\":\n    post:\n      summary: Rerequest a check suite\n      description: |-\n        Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.\n\n        To rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository.\n      tags:\n      - checks\n      operationId: checks/rerequest-suite\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#rerequest-a-check-suite\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/check-suite-id\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties: {}\n                additionalProperties: false\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: suites\n  \"/repos/{owner}/{repo}/code-scanning/alerts\":\n    get:\n      summary: List code scanning alerts for a repository\n      description: |-\n        Lists all open code scanning alerts for the default branch (usually `main`\n        or `master`). You must use an access token with the `security_events` scope to use\n        this endpoint. GitHub Apps must have the `security_events` read permission to use\n        this endpoint.\n\n        The response includes a `most_recent_instance` object.\n        This provides details of the most recent instance of this alert\n        for the default branch or for the specified Git reference\n        (if you used `ref` in the request).\n      tags:\n      - code-scanning\n      operationId: code-scanning/list-alerts-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/tool-name\"\n      - \"$ref\": \"#/components/parameters/tool-guid\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/git-ref\"\n      - name: state\n        description: Set to `open`, `fixed`, or `dismissed` to list code scanning\n          alerts in a specific state.\n        in: query\n        required: false\n        schema:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-state\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/code-scanning-alert-items\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-scanning-alert-items\"\n        '403':\n          \"$ref\": \"#/components/responses/code_scanning_forbidden_read\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: code-scanning\n        subcategory: \n  \"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\":\n    get:\n      summary: Get a code scanning alert\n      description: |-\n        Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.\n\n        **Deprecation notice**:\n        The instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by `instances_url`.\n      tags:\n      - code-scanning\n      operationId: code-scanning/get-alert\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#get-a-code-scanning-alert\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/alert-number\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/code-scanning-alert\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-scanning-alert\"\n        '403':\n          \"$ref\": \"#/components/responses/code_scanning_forbidden_read\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: code-scanning\n        subcategory: \n    patch:\n      summary: Update a code scanning alert\n      description: Updates the status of a single code scanning alert. You must use\n        an access token with the `security_events` scope to use this endpoint. GitHub\n        Apps must have the `security_events` write permission to use this endpoint.\n      operationId: code-scanning/update-alert\n      tags:\n      - code-scanning\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#update-a-code-scanning-alert\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/alert-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                state:\n                  \"$ref\": \"#/components/schemas/code-scanning-alert-set-state\"\n                dismissed_reason:\n                  \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-reason\"\n              required:\n              - state\n            example:\n              state: dismissed\n              dismissed_reason: false positive\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/code-scanning-alert\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-scanning-alert-dismissed\"\n        '403':\n          \"$ref\": \"#/components/responses/code_scanning_forbidden_write\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: code-scanning\n  \"/repos/{owner}/{repo}/code-scanning/analyses\":\n    get:\n      summary: List code scanning analyses for a repository\n      description: |-\n        Lists the details of all code scanning analyses for a repository,\n        starting with the most recent.\n        The response is paginated and you can use the `page` and `per_page` parameters\n        to list the analyses you're interested in.\n        By default 30 analyses are listed per page.\n\n        The `rules_count` field in the response give the number of rules\n        that were run in the analysis.\n        For very old analyses this data is not available,\n        and `0` is returned in this field.\n\n        You must use an access token with the `security_events` scope to use this endpoint.\n        GitHub Apps must have the `security_events` read permission to use this endpoint.\n\n        **Deprecation notice**:\n        The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.\n      operationId: code-scanning/list-recent-analyses\n      tags:\n      - code-scanning\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/tool-name\"\n      - \"$ref\": \"#/components/parameters/tool-guid\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - name: ref\n        in: query\n        description: The Git reference for the analyses you want to list. The `ref`\n          for a branch can be formatted either as `refs/heads/<branch name>` or simply\n          `<branch name>`. To reference a pull request use `refs/pull/<number>/merge`.\n        required: false\n        schema:\n          \"$ref\": \"#/components/schemas/code-scanning-ref\"\n      - name: sarif_id\n        in: query\n        description: Filter analyses belonging to the same SARIF upload.\n        required: false\n        schema:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-sarif-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/code-scanning-analysis\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-scanning-analysis-items\"\n        '403':\n          \"$ref\": \"#/components/responses/code_scanning_forbidden_read\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: code-scanning\n  \"/repos/{owner}/{repo}/code-scanning/sarifs\":\n    post:\n      summary: Upload an analysis as SARIF data\n      description: |-\n        Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.\n\n        There are two places where you can upload code scanning results.\n         - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see \"[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests).\"\n         - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see \"[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository).\"\n\n        You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:\n\n        ```\n        gzip -c analysis-data.sarif | base64 -w0\n        ```\n\n        SARIF upload supports a maximum of 1000 results per analysis run. Any results over this limit are ignored. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.\n\n        The `202 Accepted`, response includes an `id` value.\n        You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.\n        For more information, see \"[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload).\"\n      operationId: code-scanning/upload-sarif\n      tags:\n      - code-scanning\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/code-scanning#upload-a-sarif-file\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                commit_sha:\n                  \"$ref\": \"#/components/schemas/code-scanning-analysis-commit-sha\"\n                ref:\n                  \"$ref\": \"#/components/schemas/code-scanning-ref\"\n                sarif:\n                  \"$ref\": \"#/components/schemas/code-scanning-analysis-sarif-file\"\n                checkout_uri:\n                  description: |-\n                    The base directory used in the analysis, as it appears in the SARIF file.\n                    This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository.\n                  type: string\n                  format: uri\n                  examples:\n                  - file:///github/workspace/\n                started_at:\n                  description: 'The time that the analysis run began. This is a timestamp\n                    in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format:\n                    `YYYY-MM-DDTHH:MM:SSZ`.'\n                  format: date-time\n                  type: string\n                tool_name:\n                  description: The name of the tool used to generate the code scanning\n                    analysis. If this parameter is not used, the tool name defaults\n                    to \"API\". If the uploaded SARIF contains a tool GUID, this will\n                    be available for filtering using the `tool_guid` parameter of\n                    operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`.\n                  type: string\n              required:\n              - commit_sha\n              - ref\n              - sarif\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/code-scanning-sarifs-receipt\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-scanning-sarif-upload\"\n        '400':\n          description: Bad Request if the sarif field is invalid\n        '403':\n          \"$ref\": \"#/components/responses/code_scanning_forbidden_write\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '413':\n          description: Payload Too Large if the sarif field is too large\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n      x-github:\n        enabledForGitHubApps: true\n        githubCloudOnly: false\n        category: code-scanning\n  \"/repos/{owner}/{repo}/collaborators\":\n    get:\n      summary: List repository collaborators\n      description: |-\n        For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.\n\n        Team members will include the members of child teams.\n\n        You must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this\n        endpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this\n        endpoint.\n      tags:\n      - repos\n      operationId: repos/list-collaborators\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-collaborators\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: affiliation\n        description: \"Filter collaborators returned by their affiliation. Can be one\n          of:  \\n\\\\* `outside`: All outside collaborators of an organization-owned\n          repository.  \\n\\\\* `direct`: All collaborators with permissions to an organization-owned\n          repository, regardless of organization membership status.  \\n\\\\* `all`:\n          All collaborators the authenticated user can see.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - outside\n          - direct\n          - all\n          default: all\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/collaborator\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/collaborator-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: collaborators\n  \"/repos/{owner}/{repo}/collaborators/{username}\":\n    get:\n      summary: Check if a user is a repository collaborator\n      description: |-\n        For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.\n\n        Team members will include the members of child teams.\n\n        You must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this\n        endpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this\n        endpoint.\n      tags:\n      - repos\n      operationId: repos/check-collaborator\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#check-if-a-user-is-a-repository-collaborator\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response if user is a collaborator\n        '404':\n          description: Not Found if user is not a collaborator\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: collaborators\n    put:\n      summary: Add a repository collaborator\n      description: |-\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n\n        For more information on permission levels, see \"[Repository permission levels for an organization](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)\". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:\n\n        ```\n        Cannot assign {member} permission of {role name}\n        ```\n\n        Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n\n        The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#invitations).\n\n        **Rate limits**\n\n        You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.\n      tags:\n      - repos\n      operationId: repos/add-collaborator\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#add-a-repository-collaborator\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/username\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                permission:\n                  type: string\n                  description: \"The permission to grant the collaborator. **Only valid\n                    on organization-owned repositories.** Can be one of:  \\n\\\\* `pull`\n                    - can pull, but not push to or administer this repository.  \\n\\\\*\n                    `push` - can pull and push, but not administer this repository.\n                    \\ \\n\\\\* `admin` - can pull, push and administer this repository.\n                    \\ \\n\\\\* `maintain` - Recommended for project managers who need\n                    to manage the repository without access to sensitive or destructive\n                    actions.  \\n\\\\* `triage` - Recommended for contributors who need\n                    to proactively manage issues and pull requests without write access.\"\n                  enum:\n                  - pull\n                  - push\n                  - admin\n                  - maintain\n                  - triage\n                  default: push\n                permissions:\n                  type: string\n                  examples:\n                  - '\"push\"'\n      responses:\n        '201':\n          description: Response when a new invitation is created\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository-invitation\"\n              examples:\n                response-when-a-new-invitation-is-created:\n                  \"$ref\": \"#/components/examples/repository-invitation-response-when-a-new-invitation-is-created\"\n        '204':\n          description: Response when person is already a collaborator\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: collaborators\n    delete:\n      summary: Remove a repository collaborator\n      description: ''\n      tags:\n      - repos\n      operationId: repos/remove-collaborator\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#remove-a-repository-collaborator\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: collaborators\n  \"/repos/{owner}/{repo}/collaborators/{username}/permission\":\n    get:\n      summary: Get repository permissions for a user\n      description: Checks the repository permission of a collaborator. The possible\n        repository permissions are `admin`, `write`, `read`, and `none`.\n      tags:\n      - repos\n      operationId: repos/get-collaborator-permission-level\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-repository-permissions-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '200':\n          description: if user has admin permissions\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository-collaborator-permission\"\n              examples:\n                response-if-user-has-admin-permissions:\n                  \"$ref\": \"#/components/examples/repository-collaborator-permission-response-if-user-has-admin-permissions\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: collaborators\n  \"/repos/{owner}/{repo}/comments\":\n    get:\n      summary: List commit comments for a repository\n      description: |-\n        Commit Comments use [these custom media types](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/).\n\n        Comments are ordered by ascending ID.\n      tags:\n      - repos\n      operationId: repos/list-commit-comments-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commit-comments-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/commit-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/comments/{comment_id}\":\n    get:\n      summary: Get a commit comment\n      description: ''\n      tags:\n      - repos\n      operationId: repos/get-commit-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-commit-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/commit-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-comment\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    patch:\n      summary: Update a commit comment\n      description: ''\n      tags:\n      - repos\n      operationId: repos/update-commit-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-commit-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The contents of the comment\n              required:\n              - body\n            example:\n              body: Nice change\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/commit-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-comment-2\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: comments\n    delete:\n      summary: Delete a commit comment\n      description: ''\n      tags:\n      - repos\n      operationId: repos/delete-commit-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-commit-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: comments\n  \"/repos/{owner}/{repo}/comments/{comment_id}/reactions\":\n    get:\n      summary: List reactions for a commit comment\n      description: List the reactions to a [commit comment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#comments).\n      tags:\n      - reactions\n      operationId: reactions/list-for-commit-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-commit-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      - name: content\n        description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types).\n          Omit this parameter to list all reactions to a commit comment.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create reaction for a commit comment\n      description: Create a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#comments).\n        A response with an HTTP `200` status means that you already added the reaction\n        type to this commit comment.\n      tags:\n      - reactions\n      operationId: reactions/create-for-commit-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-commit-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types)\n                    to add to the commit comment.\n                  enum:\n                  - \"+1\"\n                  - \"-1\"\n                  - laugh\n                  - confused\n                  - heart\n                  - hooray\n                  - rocket\n                  - eyes\n              required:\n              - content\n            example:\n              content: heart\n      responses:\n        '200':\n          description: Reaction exists\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '201':\n          description: Reaction created\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\":\n    delete:\n      summary: Delete a commit comment reaction\n      description: |-\n        **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.\n\n        Delete a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#comments).\n      tags:\n      - reactions\n      operationId: reactions/delete-for-commit-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-a-commit-comment-reaction\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      - \"$ref\": \"#/components/parameters/reaction-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/commits\":\n    get:\n      summary: List commits\n      description: |-\n        **Signature verification object**\n\n        The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n        | Name | Type | Description |\n        | ---- | ---- | ----------- |\n        | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n        | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n        | `signature` | `string` | The signature that was extracted from the commit. |\n        | `payload` | `string` | The value that was signed. |\n\n        These are the possible values for `reason` in the `verification` object:\n\n        | Value | Description |\n        | ----- | ----------- |\n        | `expired_key` | The key that made the signature is expired. |\n        | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n        | `gpgverify_error` | There was an error communicating with the signature verification service. |\n        | `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n        | `unsigned` | The object does not include a signature. |\n        | `unknown_signature_type` | A non-PGP signature was found in the commit. |\n        | `no_user` | No user was associated with the `committer` email address in the commit. |\n        | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n        | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n        | `unknown_key` | The key that made the signature has not been registered with any user's account. |\n        | `malformed_signature` | There was an error parsing the signature. |\n        | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n        | `valid` | None of the above errors applied, so the signature is considered to be verified. |\n      tags:\n      - repos\n      operationId: repos/list-commits\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commits\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: sha\n        description: 'SHA or branch to start listing commits from. Default: the repository’s\n          default branch (usually `master`).'\n        in: query\n        required: false\n        schema:\n          type: string\n      - name: path\n        description: Only commits containing this file path will be returned.\n        in: query\n        required: false\n        schema:\n          type: string\n      - name: author\n        description: GitHub login or email address by which to filter by commit author.\n        in: query\n        required: false\n        schema:\n          type: string\n      - \"$ref\": \"#/components/parameters/since\"\n      - name: until\n        description: 'Only commits before this date will be returned. This is a timestamp\n          in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.'\n        in: query\n        required: false\n        schema:\n          type: string\n          format: date-time\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/commit\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '500':\n          \"$ref\": \"#/components/responses/internal_error\"\n        '400':\n          \"$ref\": \"#/components/responses/bad_request\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '409':\n          \"$ref\": \"#/components/responses/conflict\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: commits\n  \"/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\":\n    get:\n      summary: List branches for HEAD commit\n      description: |-\n        Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.\n      tags:\n      - repos\n      operationId: repos/list-branches-for-head-commit\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-branches-for-head-commit\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/commit-sha\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/branch-short\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/branch-short-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: commits\n        previews:\n        - required: true\n          name: groot\n          note: |-\n            Listing branches or pull requests for a commit in the Commits API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/) for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.groot-preview+json\n            ```\n  \"/repos/{owner}/{repo}/commits/{commit_sha}/comments\":\n    get:\n      summary: List commit comments\n      description: Use the `:commit_sha` to specify the commit that will have its\n        comments listed.\n      tags:\n      - repos\n      operationId: repos/list-comments-for-commit\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commit-comments\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/commit-sha\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/commit-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create a commit comment\n      description: |-\n        Create a comment for a commit using its `:commit_sha`.\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n      tags:\n      - repos\n      operationId: repos/create-commit-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-commit-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/commit-sha\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The contents of the comment.\n                path:\n                  type: string\n                  description: Relative path of the file to comment on.\n                position:\n                  type: integer\n                  description: Line index in the diff to comment on.\n                line:\n                  type: integer\n                  description: \"**Deprecated**. Use **position** parameter instead.\n                    Line number in the file to comment on.\"\n              required:\n              - body\n            example:\n              body: Great stuff\n              path: file1.txt\n              position: 4\n              line: 1\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/commit-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-comment\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/comments/1\n              schema:\n                type: string\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: comments\n  \"/repos/{owner}/{repo}/commits/{commit_sha}/pulls\":\n    get:\n      summary: List pull requests associated with a commit\n      description: Lists the merged pull request that introduced the commit to the\n        repository. If the commit is not present in the default branch, additionally\n        returns open pull requests associated with the commit. The results may include\n        open and closed pull requests. Additional preview headers may be required\n        to see certain details for associated pull requests, such as whether a pull\n        request is in a draft state. For more information about previews that might\n        affect this endpoint, see the [List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\n        endpoint.\n      tags:\n      - repos\n      operationId: repos/list-pull-requests-associated-with-commit\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-pull-requests-associated-with-a-commit\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/commit-sha\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/pull-request-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-simple-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: commits\n        previews:\n        - required: true\n          name: groot\n          note: |-\n            Listing branches or pull requests for a commit in the Commits API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/) for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.groot-preview+json\n            ```\n  \"/repos/{owner}/{repo}/commits/{ref}\":\n    get:\n      summary: Get a commit\n      description: |-\n        Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.\n\n        **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.\n\n        You can pass the appropriate [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to  fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property.\n\n        To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.\n\n        **Signature verification object**\n\n        The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n        | Name | Type | Description |\n        | ---- | ---- | ----------- |\n        | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n        | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n        | `signature` | `string` | The signature that was extracted from the commit. |\n        | `payload` | `string` | The value that was signed. |\n\n        These are the possible values for `reason` in the `verification` object:\n\n        | Value | Description |\n        | ----- | ----------- |\n        | `expired_key` | The key that made the signature is expired. |\n        | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n        | `gpgverify_error` | There was an error communicating with the signature verification service. |\n        | `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n        | `unsigned` | The object does not include a signature. |\n        | `unknown_signature_type` | A non-PGP signature was found in the commit. |\n        | `no_user` | No user was associated with the `committer` email address in the commit. |\n        | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n        | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n        | `unknown_key` | The key that made the signature has not been registered with any user's account. |\n        | `malformed_signature` | There was an error parsing the signature. |\n        | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n        | `valid` | None of the above errors applied, so the signature is considered to be verified. |\n      tags:\n      - repos\n      operationId: repos/get-commit\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-commit\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/commit\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '500':\n          \"$ref\": \"#/components/responses/internal_error\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: commits\n  \"/repos/{owner}/{repo}/commits/{ref}/check-runs\":\n    get:\n      summary: List check runs for a Git reference\n      description: |-\n        **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\n        Lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.\n      tags:\n      - checks\n      operationId: checks/list-for-ref\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#list-check-runs-for-a-git-reference\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      - \"$ref\": \"#/components/parameters/check-name\"\n      - \"$ref\": \"#/components/parameters/status\"\n      - name: filter\n        description: Filters check runs by their `completed_at` timestamp. Can be\n          one of `latest` (returning the most recent check runs) or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - latest\n          - all\n          default: latest\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - name: app_id\n        in: query\n        required: false\n        schema:\n          type: integer\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - check_runs\n                properties:\n                  total_count:\n                    type: integer\n                  check_runs:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/check-run\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-run-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: runs\n  \"/repos/{owner}/{repo}/commits/{ref}/check-suites\":\n    get:\n      summary: List check suites for a Git reference\n      description: |-\n        **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\n\n        Lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository.\n      tags:\n      - checks\n      operationId: checks/list-suites-for-ref\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/checks#list-check-suites-for-a-git-reference\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      - name: app_id\n        description: Filters check suites by GitHub App `id`.\n        in: query\n        required: false\n        schema:\n          type: integer\n        example: 1\n      - \"$ref\": \"#/components/parameters/check-name\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - check_suites\n                properties:\n                  total_count:\n                    type: integer\n                  check_suites:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/check-suite\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/check-suite-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: checks\n        subcategory: suites\n  \"/repos/{owner}/{repo}/commits/{ref}/status\":\n    get:\n      summary: Get the combined status for a specific reference\n      description: |-\n        Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.\n\n\n        Additionally, a combined `state` is returned. The `state` is one of:\n\n        *   **failure** if any of the contexts report as `error` or `failure`\n        *   **pending** if there are no statuses or a context is `pending`\n        *   **success** if the latest status for all contexts is `success`\n      tags:\n      - repos\n      operationId: repos/get-combined-status-for-ref\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-combined-status-for-a-specific-reference\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/combined-commit-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/combined-commit-status\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: statuses\n  \"/repos/{owner}/{repo}/commits/{ref}/statuses\":\n    get:\n      summary: List commit statuses for a reference\n      description: |-\n        Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.\n\n        This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`.\n      tags:\n      - repos\n      operationId: repos/list-commit-statuses-for-ref\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commit-statuses-for-a-reference\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/status-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '301':\n          \"$ref\": \"#/components/responses/moved_permanently\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: statuses\n  \"/repos/{owner}/{repo}/compare/{basehead}\":\n    get:\n      summary: Compare two commits\n      description: |-\n        The `basehead` param is comprised of two parts: `base` and `head`. Both must be branch names in `repo`. To compare branches across other repositories in the same network as `repo`, use the format `<USERNAME>:branch`.\n\n        The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.\n\n        The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.\n\n        **Working with large comparisons**\n\n        The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commits) to enumerate all commits in the range.\n\n        For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long\n        to generate. You can typically resolve this error by using a smaller commit range.\n\n        **Signature verification object**\n\n        The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n        | Name | Type | Description |\n        | ---- | ---- | ----------- |\n        | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n        | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n        | `signature` | `string` | The signature that was extracted from the commit. |\n        | `payload` | `string` | The value that was signed. |\n\n        These are the possible values for `reason` in the `verification` object:\n\n        | Value | Description |\n        | ----- | ----------- |\n        | `expired_key` | The key that made the signature is expired. |\n        | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n        | `gpgverify_error` | There was an error communicating with the signature verification service. |\n        | `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n        | `unsigned` | The object does not include a signature. |\n        | `unknown_signature_type` | A non-PGP signature was found in the commit. |\n        | `no_user` | No user was associated with the `committer` email address in the commit. |\n        | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n        | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n        | `unknown_key` | The key that made the signature has not been registered with any user's account. |\n        | `malformed_signature` | There was an error parsing the signature. |\n        | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n        | `valid` | None of the above errors applied, so the signature is considered to be verified. |\n      tags:\n      - repos\n      operationId: repos/compare-commits\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#compare-two-commits\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: basehead\n        description: The base branch and head branch to compare. This parameter expects\n          the format `{base}...{head}`.\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/commit-comparison\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-comparison\"\n        '500':\n          \"$ref\": \"#/components/responses/internal_error\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: commits\n  \"/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\":\n    post:\n      summary: Create a content attachment\n      description: |-\n        Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#content_reference) to create an attachment.\n\n        The app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.0/apps/using-content-attachments/)\" for details about content attachments.\n\n        You must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/create-content-attachment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-content-attachment\n      parameters:\n      - name: owner\n        description: The owner of the repository. Determined from the `repository`\n          `full_name` of the `content_reference` event.\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: repo\n        description: The name of the repository. Determined from the `repository`\n          `full_name` of the `content_reference` event.\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: content_reference_id\n        description: The `id` of the `content_reference` event.\n        in: path\n        required: true\n        schema:\n          type: integer\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                title:\n                  description: The title of the attachment\n                  type: string\n                  maxLength: 1024\n                  examples:\n                  - Title of the attachment\n                body:\n                  description: The body of the attachment\n                  type: string\n                  maxLength: 262144\n                  examples:\n                  - Body of the attachment\n              required:\n              - title\n              - body\n              type: object\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/content-reference-attachment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/content-reference-attachment\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        previews:\n        - required: true\n          name: corsair\n          note: |-\n            To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.corsair-preview+json\n            ```\n        category: apps\n        subcategory: installations\n  \"/repos/{owner}/{repo}/contents/{path}\":\n    get:\n      summary: Get repository content\n      description: \"Gets the contents of a file or directory in a repository. Specify\n        the file path or directory in `:path`. If you omit\\n`:path`, you will receive\n        the contents of the repository's root directory. See the description below\n        regarding what the API response includes for directories. \\n\\nFiles and symlinks\n        support [a custom media type](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types)\n        for\\nretrieving the raw content or rendered HTML (when supported). All content\n        types support [a custom media\\ntype](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types)\n        to ensure the content is returned in a consistent\\nobject format.\\n\\n**Note**:\\n*\n        \\  To get a repository's contents recursively, you can [recursively get the\n        tree](https://docs.github.com/enterprise-server@3.0/rest/reference/git#trees).\\n*\n        \\  This API has an upper limit of 1,000 files for a directory. If you need\n        to retrieve more files, use the [Git Trees\\nAPI](https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-tree).\\n*\n        \\  This API supports files up to 1 megabyte in size.\\n\\n#### If the content\n        is a directory\\nThe response will be an array of objects, one object for each\n        item in the directory.\\nWhen listing the contents of a directory, submodules\n        have their \\\"type\\\" specified as \\\"file\\\". Logically, the value\\n_should_\n        be \\\"submodule\\\". This behavior exists in API v3 [for backwards compatibility\n        purposes](https://git.io/v1YCW).\\nIn the next major version of the API, the\n        type will be returned as \\\"submodule\\\".\\n\\n#### If the content is a symlink\n        \\nIf the requested `:path` points to a symlink, and the symlink's target is\n        a normal file in the repository, then the\\nAPI responds with the content of\n        the file (in the format shown in the example. Otherwise, the API responds\n        with an object \\ndescribing the symlink itself.\\n\\n#### If the content is\n        a submodule\\nThe `submodule_git_url` identifies the location of the submodule\n        repository, and the `sha` identifies a specific\\ncommit within the submodule\n        repository. Git uses the given URL when cloning the submodule repository,\n        and checks out\\nthe submodule at that specific commit.\\n\\nIf the submodule\n        repository is not hosted on github.com, the Git URLs (`git_url` and `_links[\\\"git\\\"]`)\n        and the\\ngithub.com URLs (`html_url` and `_links[\\\"html\\\"]`) will have null\n        values.\"\n      tags:\n      - repos\n      operationId: repos/get-content\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-repository-content\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: path\n        description: path parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      - name: ref\n        description: 'The name of the commit/branch/tag. Default: the repository’s\n          default branch (usually `master`)'\n        in: query\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/vnd.github.v3.object:\n              schema:\n                \"$ref\": \"#/components/schemas/content-tree\"\n            application/json:\n              schema:\n                oneOf:\n                - \"$ref\": \"#/components/schemas/content-directory\"\n                - \"$ref\": \"#/components/schemas/content-file\"\n                - \"$ref\": \"#/components/schemas/content-symlink\"\n                - \"$ref\": \"#/components/schemas/content-submodule\"\n              examples:\n                response-if-content-is-a-file:\n                  \"$ref\": \"#/components/examples/content-file-response-if-content-is-a-file\"\n                response-if-content-is-a-directory:\n                  \"$ref\": \"#/components/examples/content-file-response-if-content-is-a-directory\"\n                response-if-content-is-a-symlink:\n                  \"$ref\": \"#/components/examples/content-file-response-if-content-is-a-symlink\"\n                response-if-content-is-a-submodule:\n                  \"$ref\": \"#/components/examples/content-file-response-if-content-is-a-submodule\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '302':\n          \"$ref\": \"#/components/responses/found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: contents\n    put:\n      summary: Create or update file contents\n      description: Creates a new file or replaces an existing file in a repository.\n      tags:\n      - repos\n      operationId: repos/create-or-update-file-contents\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-or-update-file-contents\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: path\n        description: path parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                message:\n                  type: string\n                  description: The commit message.\n                content:\n                  type: string\n                  description: The new file content, using Base64 encoding.\n                sha:\n                  type: string\n                  description: \"**Required if you are updating a file**. The blob\n                    SHA of the file being replaced.\"\n                branch:\n                  type: string\n                  description: 'The branch name. Default: the repository’s default\n                    branch (usually `master`)'\n                committer:\n                  type: object\n                  description: 'The person that committed the file. Default: the authenticated\n                    user.'\n                  properties:\n                    name:\n                      type: string\n                      description: The name of the author or committer of the commit.\n                        You'll receive a `422` status code if `name` is omitted.\n                    email:\n                      type: string\n                      description: The email of the author or committer of the commit.\n                        You'll receive a `422` status code if `email` is omitted.\n                    date:\n                      type: string\n                      examples:\n                      - '\"2013-01-05T13:13:22+05:00\"'\n                  required:\n                  - name\n                  - email\n                author:\n                  type: object\n                  description: 'The author of the file. Default: The `committer` or\n                    the authenticated user if you omit `committer`.'\n                  properties:\n                    name:\n                      type: string\n                      description: The name of the author or committer of the commit.\n                        You'll receive a `422` status code if `name` is omitted.\n                    email:\n                      type: string\n                      description: The email of the author or committer of the commit.\n                        You'll receive a `422` status code if `email` is omitted.\n                    date:\n                      type: string\n                      examples:\n                      - '\"2013-01-15T17:13:22+05:00\"'\n                  required:\n                  - name\n                  - email\n              required:\n              - message\n              - content\n            examples:\n              example-for-creating-a-file:\n                summary: Example for creating a file\n                value:\n                  message: my commit message\n                  committer:\n                    name: Monalisa Octocat\n                    email: octocat@github.com\n                  content: bXkgbmV3IGZpbGUgY29udGVudHM=\n              example-for-updating-a-file:\n                summary: Example for updating a file\n                value:\n                  message: a new commit message\n                  committer:\n                    name: Monalisa Octocat\n                    email: octocat@github.com\n                  content: bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz\n                  sha: 95b966ae1c166bd92f8ae7d1c313e738c731dfc3\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/file-commit\"\n              examples:\n                example-for-updating-a-file:\n                  \"$ref\": \"#/components/examples/file-commit-example-for-updating-a-file\"\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/file-commit\"\n              examples:\n                example-for-creating-a-file:\n                  \"$ref\": \"#/components/examples/file-commit-example-for-creating-a-file\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '409':\n          \"$ref\": \"#/components/responses/conflict\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: contents\n    delete:\n      summary: Delete a file\n      description: |-\n        Deletes a file in a repository.\n\n        You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.\n\n        The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.\n\n        You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.\n      tags:\n      - repos\n      operationId: repos/delete-file\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-file\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: path\n        description: path parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                message:\n                  type: string\n                  description: The commit message.\n                sha:\n                  type: string\n                  description: The blob SHA of the file being replaced.\n                branch:\n                  type: string\n                  description: 'The branch name. Default: the repository’s default\n                    branch (usually `master`)'\n                committer:\n                  type: object\n                  description: object containing information about the committer.\n                  properties:\n                    name:\n                      type: string\n                      description: The name of the author (or committer) of the commit\n                    email:\n                      type: string\n                      description: The email of the author (or committer) of the commit\n                author:\n                  type: object\n                  description: object containing information about the author.\n                  properties:\n                    name:\n                      type: string\n                      description: The name of the author (or committer) of the commit\n                    email:\n                      type: string\n                      description: The email of the author (or committer) of the commit\n              required:\n              - message\n              - sha\n            example:\n              message: my commit message\n              committer:\n                name: Monalisa Octocat\n                email: octocat@github.com\n              sha: 329688480d39049927147c162b9d2deaf885005f\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/file-commit\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/file-commit\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '409':\n          \"$ref\": \"#/components/responses/conflict\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: contents\n  \"/repos/{owner}/{repo}/contributors\":\n    get:\n      summary: List repository contributors\n      description: |-\n        Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance.\n\n        GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.\n      tags:\n      - repos\n      operationId: repos/list-contributors\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-contributors\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: anon\n        description: Set to `1` or `true` to include anonymous contributors in results.\n        in: query\n        required: false\n        schema:\n          type: string\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: if repository contains content\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/contributor\"\n              examples:\n                response-if-repository-contains-content:\n                  \"$ref\": \"#/components/examples/contributor-items-response-if-repository-contains-content\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '204':\n          description: Response if repository is empty\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: \n  \"/repos/{owner}/{repo}/deployments\":\n    get:\n      summary: List deployments\n      description: 'Simple filtering of deployments is available via query parameters:'\n      tags:\n      - repos\n      operationId: repos/list-deployments\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-deployments\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: sha\n        description: The SHA recorded at creation time.\n        in: query\n        required: false\n        schema:\n          type: string\n          default: none\n      - name: ref\n        description: The name of the ref. This can be a branch, tag, or SHA.\n        in: query\n        required: false\n        schema:\n          type: string\n          default: none\n      - name: task\n        description: The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).\n        in: query\n        required: false\n        schema:\n          type: string\n          default: none\n      - name: environment\n        description: The name of the environment that was deployed to (e.g., `staging`\n          or `production`).\n        in: query\n        required: false\n        schema:\n          type:\n          - string\n          - 'null'\n          default: none\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/deployment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/deployment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: deployments\n        previews:\n        - required: false\n          name: ant-man\n          note: |-\n            The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\n\n            To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.ant-man-preview+json\n            ```\n    post:\n      summary: Create a deployment\n      description: |-\n        Deployments offer a few configurable parameters with certain defaults.\n\n        The `ref` parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\n        before we merge a pull request.\n\n        The `environment` parameter allows deployments to be issued to different runtime environments. Teams often have\n        multiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter\n        makes it easier to track which environments have requested deployments. The default environment is `production`.\n\n        The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If\n        the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\n        the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\n        return a failure response.\n\n        By default, [commit statuses](https://docs.github.com/enterprise-server@3.0/rest/reference/commits#commit-statuses) for every submitted context must be in a `success`\n        state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to\n        specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\n        not require any contexts or create any commit statuses, the deployment will always succeed.\n\n        The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text\n        field that will be passed on when a deployment event is dispatched.\n\n        The `task` parameter is used by the deployment system to allow different execution paths. In the web world this might\n        be `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an\n        application with debugging enabled.\n\n        Users with `repo` or `repo_deployment` scopes can create a deployment for a given ref.\n\n        #### Merged branch response\n        You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\n        a deployment. This auto-merge happens when:\n        *   Auto-merge option is enabled in the repository\n        *   Topic branch does not include the latest changes on the base branch, which is `master` in the response example\n        *   There are no merge conflicts\n\n        If there are no new commits in the base branch, a new request to create a deployment should give a successful\n        response.\n\n        #### Merge conflict response\n        This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't\n        be merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts.\n\n        #### Failed commit status checks\n        This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success`\n        status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`.\n      tags:\n      - repos\n      operationId: repos/create-deployment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-deployment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                ref:\n                  type: string\n                  description: The ref to deploy. This can be a branch, tag, or SHA.\n                task:\n                  type: string\n                  description: Specifies a task to execute (e.g., `deploy` or `deploy:migrations`).\n                  default: deploy\n                auto_merge:\n                  type: boolean\n                  description: Attempts to automatically merge the default branch\n                    into the requested ref, if it's behind the default branch.\n                  default: true\n                required_contexts:\n                  type: array\n                  description: The [status](https://docs.github.com/enterprise-server@3.0/rest/reference/commits#commit-statuses)\n                    contexts to verify against commit status checks. If you omit this\n                    parameter, GitHub verifies all unique contexts before creating\n                    a deployment. To bypass checking entirely, pass an empty array.\n                    Defaults to all unique contexts.\n                  items:\n                    type: string\n                payload:\n                  oneOf:\n                  - type: object\n                    additionalProperties: true\n                  - type: string\n                    description: JSON payload with extra information about the deployment.\n                    default: ''\n                environment:\n                  type: string\n                  description: Name for the target deployment environment (e.g., `production`,\n                    `staging`, `qa`).\n                  default: production\n                description:\n                  type:\n                  - string\n                  - 'null'\n                  description: Short description of the deployment.\n                  default: ''\n                transient_environment:\n                  type: boolean\n                  description: \"Specifies if the given environment is specific to\n                    the deployment and will no longer exist at some point in the future.\n                    Default: `false`  \\n**Note:** This parameter requires you to use\n                    the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments)\n                    custom media type.\"\n                  default: false\n                production_environment:\n                  type: boolean\n                  description: \"Specifies if the given environment is one that end-users\n                    directly interact with. Default: `true` when `environment` is\n                    `production` and `false` otherwise.  \\n**Note:** This parameter\n                    requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments)\n                    custom media type.\"\n              required:\n              - ref\n            examples:\n              simple-example:\n                summary: Simple example\n                value:\n                  ref: topic-branch\n                  payload: '{ \"deploy\": \"migrate\" }'\n                  description: Deploy request from hubot\n              advanced-example:\n                summary: Advanced example\n                value:\n                  ref: topic-branch\n                  auto_merge: false\n                  payload: '{ \"deploy\": \"migrate\" }'\n                  description: Deploy request from hubot\n                  required_contexts:\n                  - ci/janky\n                  - security/brakeman\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/deployment\"\n              examples:\n                simple-example:\n                  \"$ref\": \"#/components/examples/deployment-simple-example\"\n        '202':\n          description: Merged branch response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n              examples:\n                merged-branch-response:\n                  value:\n                    message: Auto-merged master into topic-branch on deployment.\n        '409':\n          description: Conflict when there is a merge conflict or the commit's status\n            checks failed\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: deployments\n        previews:\n        - required: false\n          name: ant-man\n          note: |-\n            The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\n\n            To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.ant-man-preview+json\n            ```\n  \"/repos/{owner}/{repo}/deployments/{deployment_id}\":\n    get:\n      summary: Get a deployment\n      description: ''\n      tags:\n      - repos\n      operationId: repos/get-deployment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-deployment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/deployment-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/deployment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/deployment\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: deployments\n        previews:\n        - required: false\n          name: flash\n          note: |-\n            New features in the Deployments API on GitHub are currently available during a public beta. Please see the [blog post](https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/) for full details.\n\n            To access the new `environment` parameter, the two new values for the `state` parameter (`in_progress` and `queued`), and use `auto_inactive` on production deployments during the public beta period, you must provide the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.flash-preview+json\n            ```\n        - required: false\n          name: ant-man\n          note: |-\n            The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\n\n            To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.ant-man-preview+json\n            ```\n    delete:\n      summary: Delete a deployment\n      description: |-\n        If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with `repo` or `repo_deployment` scopes can delete a deployment.\n\n        To set a deployment as inactive, you must:\n\n        *   Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.\n        *   Mark the active deployment as inactive by adding any non-successful deployment status.\n\n        For more information, see \"[Create a deployment](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/#create-a-deployment)\" and \"[Create a deployment status](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-deployment-status).\"\n      tags:\n      - repos\n      operationId: repos/delete-deployment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-deployment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/deployment-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: deployments\n  \"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses\":\n    get:\n      summary: List deployment statuses\n      description: 'Users with pull access can view deployment statuses for a deployment:'\n      tags:\n      - repos\n      operationId: repos/list-deployment-statuses\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-deployment-statuses\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/deployment-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/deployment-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/deployment-status-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: deployments\n        previews:\n        - required: false\n          name: flash\n          note: |-\n            New features in the Deployments API on GitHub are currently available during a public beta. Please see the [blog post](https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/) for full details.\n\n            To access the new `environment` parameter, the two new values for the `state` parameter (`in_progress` and `queued`), and use `auto_inactive` on production deployments during the public beta period, you must provide the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.flash-preview+json\n            ```\n        - required: false\n          name: ant-man\n          note: |-\n            The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\n\n            To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.ant-man-preview+json\n            ```\n    post:\n      summary: Create a deployment status\n      description: |-\n        Users with `push` access can create deployment statuses for a given deployment.\n\n        GitHub Apps require `read & write` access to \"Deployments\" and `read-only` access to \"Repo contents\" (for private repos). OAuth Apps require the `repo_deployment` scope.\n      tags:\n      - repos\n      operationId: repos/create-deployment-status\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-deployment-status\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/deployment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                state:\n                  type: string\n                  description: The state of the status. Can be one of `error`, `failure`,\n                    `inactive`, `in_progress`, `queued`, `pending`, or `success`.\n                    **Note:** To use the `inactive` state, you must provide the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments)\n                    custom media type. When you set a transient deployment to `inactive`,\n                    the deployment will be shown as `destroyed` in GitHub.\n                  enum:\n                  - error\n                  - failure\n                  - inactive\n                  - in_progress\n                  - queued\n                  - pending\n                  - success\n                target_url:\n                  type: string\n                  description: The target URL to associate with this status. This\n                    URL should contain output to keep the user updated while the task\n                    is running or serve as historical information for what happened\n                    in the deployment. **Note:** It's recommended to use the `log_url`\n                    parameter, which replaces `target_url`.\n                  default: ''\n                log_url:\n                  type: string\n                  description: \"The full URL of the deployment's output. This parameter\n                    replaces `target_url`. We will continue to accept `target_url`\n                    to support legacy uses, but we recommend replacing `target_url`\n                    with `log_url`. Setting `log_url` will automatically set `target_url`\n                    to the same value. Default: `\\\"\\\"`  \\n**Note:** This parameter\n                    requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments)\n                    custom media type.\"\n                  default: ''\n                description:\n                  type: string\n                  description: A short description of the status. The maximum description\n                    length is 140 characters.\n                  default: ''\n                environment:\n                  type: string\n                  description: Name for the target deployment environment, which can\n                    be changed when setting a deploy status. For example, `production`,\n                    `staging`, or `qa`.\n                  enum:\n                  - production\n                  - staging\n                  - qa\n                environment_url:\n                  type: string\n                  description: \"Sets the URL for accessing your environment. Default:\n                    `\\\"\\\"`  \\n**Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments)\n                    custom media type.\"\n                  default: ''\n                auto_inactive:\n                  type: boolean\n                  description: \"Adds a new `inactive` status to all prior non-transient,\n                    non-production environment deployments with the same repository\n                    and `environment` name as the created status's deployment. An\n                    `inactive` status is only added to deployments that had a `success`\n                    state. Default: `true` \\n**Note:** This parameter requires you\n                    to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/enterprise-server@3.0/rest/overview/api-previews#enhanced-deployments)\n                    custom media type.\"\n              required:\n              - state\n            example:\n              environment: production\n              state: success\n              log_url: https://example.com/deployment/42/output\n              description: Deployment finished successfully.\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/deployment-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/deployment-status\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/example/deployments/42/statuses/1\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: deployments\n        previews:\n        - required: false\n          name: flash\n          note: |-\n            New features in the Deployments API on GitHub are currently available during a public beta. Please see the [blog post](https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/) for full details.\n\n            To access the new `environment` parameter, the two new values for the `state` parameter (`in_progress` and `queued`), and use `auto_inactive` on production deployments during the public beta period, you must provide the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.flash-preview+json\n            ```\n        - required: false\n          name: ant-man\n          note: |-\n            The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\n\n            To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.ant-man-preview+json\n            ```\n  \"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\":\n    get:\n      summary: Get a deployment status\n      description: 'Users with pull access can view a deployment status for a deployment:'\n      tags:\n      - repos\n      operationId: repos/get-deployment-status\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-deployment-status\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/deployment-id\"\n      - name: status_id\n        in: path\n        required: true\n        schema:\n          type: integer\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/deployment-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/deployment-status\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: deployments\n        previews:\n        - required: false\n          name: flash\n          note: |-\n            New features in the Deployments API on GitHub are currently available during a public beta. Please see the [blog post](https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/) for full details.\n\n            To access the new `environment` parameter, the two new values for the `state` parameter (`in_progress` and `queued`), and use `auto_inactive` on production deployments during the public beta period, you must provide the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.flash-preview+json\n            ```\n        - required: false\n          name: ant-man\n          note: |-\n            The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\n\n            To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.ant-man-preview+json\n            ```\n  \"/repos/{owner}/{repo}/dispatches\":\n    post:\n      summary: Create a repository dispatch event\n      description: |-\n        You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub Enterprise Server to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see \"[RepositoryDispatchEvent](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#repository_dispatch).\"\n\n        The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow.\n\n        This endpoint requires write access to the repository by providing either:\n\n          - Personal access tokens with `repo` scope. For more information, see \"[Creating a personal access token for the command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line)\" in the GitHub Help documentation.\n          - GitHub Apps with both `metadata:read` and `contents:read&write` permissions.\n\n        This input example shows how you can use the `client_payload` as a test to debug your workflow.\n      tags:\n      - repos\n      operationId: repos/create-dispatch-event\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-dispatch-event\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              required:\n              - event_type\n              properties:\n                event_type:\n                  type: string\n                  description: A custom webhook event name.\n                  minLength: 1\n                  maxLength: 100\n                client_payload:\n                  type: object\n                  description: JSON payload with extra information about the webhook\n                    event that your action or worklow may use.\n                  additionalProperties: true\n                  maxProperties: 10\n            example:\n              event_type: on-demand-test\n              client_payload:\n                unit: false\n                integration: true\n      responses:\n        '204':\n          description: Response\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: \n  \"/repos/{owner}/{repo}/events\":\n    get:\n      summary: List repository events\n      description: ''\n      tags:\n      - activity\n      operationId: activity/list-repo-events\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repository-events\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: events\n  \"/repos/{owner}/{repo}/forks\":\n    get:\n      summary: List forks\n      description: ''\n      tags:\n      - repos\n      operationId: repos/list-forks\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-forks\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: sort\n        description: The sort order. Can be either `newest`, `oldest`, or `stargazers`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - newest\n          - oldest\n          - stargazers\n          - watchers\n          default: newest\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository-items-2\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '400':\n          \"$ref\": \"#/components/responses/bad_request\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: forks\n    post:\n      summary: Create a fork\n      description: |-\n        Create a fork for the authenticated user.\n\n        **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).\n      tags:\n      - repos\n      operationId: repos/create-fork\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-fork\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                organization:\n                  type: string\n                  description: Optional parameter to specify the organization name\n                    if forking into an organization.\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/full-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/full-repository\"\n        '400':\n          \"$ref\": \"#/components/responses/bad_request\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: forks\n  \"/repos/{owner}/{repo}/git/blobs\":\n    post:\n      summary: Create a blob\n      description: ''\n      tags:\n      - git\n      operationId: git/create-blob\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-blob\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The new blob's content.\n                encoding:\n                  type: string\n                  description: The encoding used for `content`. Currently, `\"utf-8\"`\n                    and `\"base64\"` are supported.\n                  default: utf-8\n              required:\n              - content\n            example:\n              content: Content of the blob\n              encoding: utf-8\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/short-blob\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/short-blob\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/example/git/blobs/3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\n              schema:\n                type: string\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '409':\n          \"$ref\": \"#/components/responses/conflict\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: blobs\n  \"/repos/{owner}/{repo}/git/blobs/{file_sha}\":\n    get:\n      summary: Get a blob\n      description: |-\n        The `content` in the response will always be Base64 encoded.\n\n        _Note_: This API supports blobs up to 100 megabytes in size.\n      tags:\n      - git\n      operationId: git/get-blob\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-blob\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: file_sha\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/blob\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/blob\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: blobs\n  \"/repos/{owner}/{repo}/git/commits\":\n    post:\n      summary: Create a commit\n      description: |-\n        Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects).\n\n        **Signature verification object**\n\n        The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n        | Name | Type | Description |\n        | ---- | ---- | ----------- |\n        | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n        | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n        | `signature` | `string` | The signature that was extracted from the commit. |\n        | `payload` | `string` | The value that was signed. |\n\n        These are the possible values for `reason` in the `verification` object:\n\n        | Value | Description |\n        | ----- | ----------- |\n        | `expired_key` | The key that made the signature is expired. |\n        | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n        | `gpgverify_error` | There was an error communicating with the signature verification service. |\n        | `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n        | `unsigned` | The object does not include a signature. |\n        | `unknown_signature_type` | A non-PGP signature was found in the commit. |\n        | `no_user` | No user was associated with the `committer` email address in the commit. |\n        | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n        | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n        | `unknown_key` | The key that made the signature has not been registered with any user's account. |\n        | `malformed_signature` | There was an error parsing the signature. |\n        | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n        | `valid` | None of the above errors applied, so the signature is considered to be verified. |\n      tags:\n      - git\n      operationId: git/create-commit\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-commit\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                message:\n                  type: string\n                  description: The commit message\n                tree:\n                  type: string\n                  description: The SHA of the tree object this commit points to\n                parents:\n                  type: array\n                  description: The SHAs of the commits that were the parents of this\n                    commit. If omitted or empty, the commit will be written as a root\n                    commit. For a single parent, an array of one SHA should be provided;\n                    for a merge commit, an array of more than one should be provided.\n                  items:\n                    type: string\n                author:\n                  type: object\n                  description: Information about the author of the commit. By default,\n                    the `author` will be the authenticated user and the current date.\n                    See the `author` and `committer` object below for details.\n                  properties:\n                    name:\n                      type: string\n                      description: The name of the author (or committer) of the commit\n                    email:\n                      type: string\n                      description: The email of the author (or committer) of the commit\n                    date:\n                      type: string\n                      format: date-time\n                      description: 'Indicates when this commit was authored (or committed).\n                        This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)\n                        format: `YYYY-MM-DDTHH:MM:SSZ`.'\n                  required:\n                  - name\n                  - email\n                committer:\n                  type: object\n                  description: Information about the person who is making the commit.\n                    By default, `committer` will use the information set in `author`.\n                    See the `author` and `committer` object below for details.\n                  properties:\n                    name:\n                      type: string\n                      description: The name of the author (or committer) of the commit\n                    email:\n                      type: string\n                      description: The email of the author (or committer) of the commit\n                    date:\n                      type: string\n                      format: date-time\n                      description: 'Indicates when this commit was authored (or committed).\n                        This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)\n                        format: `YYYY-MM-DDTHH:MM:SSZ`.'\n                signature:\n                  type: string\n                  description: The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy)\n                    of the commit. GitHub adds the signature to the `gpgsig` header\n                    of the created commit. For a commit signature to be verifiable\n                    by Git or GitHub, it must be an ASCII-armored detached PGP signature\n                    over the string commit as it would be written to the object database.\n                    To pass a `signature` parameter, you need to first manually create\n                    a valid PGP signature, which can be complicated. You may find\n                    it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work)\n                    to create signed commits.\n              required:\n              - message\n              - tree\n            example:\n              message: my commit message\n              author:\n                name: Mona Octocat\n                email: octocat@github.com\n                date: '2008-07-09T16:13:30+12:00'\n              parents:\n              - 7d1b31e74ee336d15cbd21741bc88a537ed063a0\n              tree: 827efc6d56897b048c772eb4087f854f46256132\n              signature: |\n                -----BEGIN PGP SIGNATURE-----\n\n                iQIzBAABAQAdFiEESn/54jMNIrGSE6Tp6cQjvhfv7nAFAlnT71cACgkQ6cQjvhfv\n                7nCWwA//XVqBKWO0zF+bZl6pggvky3Oc2j1pNFuRWZ29LXpNuD5WUGXGG209B0hI\n                DkmcGk19ZKUTnEUJV2Xd0R7AW01S/YSub7OYcgBkI7qUE13FVHN5ln1KvH2all2n\n                2+JCV1HcJLEoTjqIFZSSu/sMdhkLQ9/NsmMAzpf/iIM0nQOyU4YRex9eD1bYj6nA\n                OQPIDdAuaTQj1gFPHYLzM4zJnCqGdRlg0sOM/zC5apBNzIwlgREatOYQSCfCKV7k\n                nrU34X8b9BzQaUx48Qa+Dmfn5KQ8dl27RNeWAqlkuWyv3pUauH9UeYW+KyuJeMkU\n                +NyHgAsWFaCFl23kCHThbLStMZOYEnGagrd0hnm1TPS4GJkV4wfYMwnI4KuSlHKB\n                jHl3Js9vNzEUQipQJbgCgTiWvRJoK3ENwBTMVkKHaqT4x9U4Jk/XZB6Q8MA09ezJ\n                3QgiTjTAGcum9E9QiJqMYdWQPWkaBIRRz5cET6HPB48YNXAAUsfmuYsGrnVLYbG+\n                UpC6I97VybYHTy2O9XSGoaLeMI9CsFn38ycAxxbWagk5mhclNTP5mezIq6wKSwmr\n                X11FW3n1J23fWZn5HJMBsRnUCgzqzX3871IqLYHqRJ/bpZ4h20RhTyPj5c/z7QXp\n                eSakNQMfbbMcljkha+ZMuVQX1K9aRlVqbmv3ZMWh+OijLYVU2bc=\n                =5Io4\n                -----END PGP SIGNATURE-----\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-commit\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-commit\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: commits\n  \"/repos/{owner}/{repo}/git/commits/{commit_sha}\":\n    get:\n      summary: Get a commit\n      description: |-\n        Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects).\n\n        **Signature verification object**\n\n        The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n        | Name | Type | Description |\n        | ---- | ---- | ----------- |\n        | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n        | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n        | `signature` | `string` | The signature that was extracted from the commit. |\n        | `payload` | `string` | The value that was signed. |\n\n        These are the possible values for `reason` in the `verification` object:\n\n        | Value | Description |\n        | ----- | ----------- |\n        | `expired_key` | The key that made the signature is expired. |\n        | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n        | `gpgverify_error` | There was an error communicating with the signature verification service. |\n        | `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n        | `unsigned` | The object does not include a signature. |\n        | `unknown_signature_type` | A non-PGP signature was found in the commit. |\n        | `no_user` | No user was associated with the `committer` email address in the commit. |\n        | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n        | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n        | `unknown_key` | The key that made the signature has not been registered with any user's account. |\n        | `malformed_signature` | There was an error parsing the signature. |\n        | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n        | `valid` | None of the above errors applied, so the signature is considered to be verified. |\n      tags:\n      - git\n      operationId: git/get-commit\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-commit\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/commit-sha\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-commit\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-commit-2\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: commits\n  \"/repos/{owner}/{repo}/git/matching-refs/{ref}\":\n    get:\n      summary: List matching references\n      description: |-\n        Returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/<branch name>` for branches and `tags/<tag name>` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array.\n\n        When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`.\n\n        **Note:** You need to explicitly [request a pull request](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see \"[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.0/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)\".\n\n        If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`.\n      tags:\n      - git\n      operationId: git/list-matching-refs\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#list-matching-references\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/git-ref\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-ref-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: refs\n  \"/repos/{owner}/{repo}/git/ref/{ref}\":\n    get:\n      summary: Get a reference\n      description: |-\n        Returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/<branch name>` for branches and `tags/<tag name>` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned.\n\n        **Note:** You need to explicitly [request a pull request](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see \"[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.0/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)\".\n      tags:\n      - git\n      operationId: git/get-ref\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-reference\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-ref\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-ref\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: refs\n  \"/repos/{owner}/{repo}/git/refs\":\n    post:\n      summary: Create a reference\n      description: Creates a reference for your repository. You are unable to create\n        new references for empty repositories, even if the commit SHA-1 hash used\n        exists. Empty repositories are repositories without branches.\n      tags:\n      - git\n      operationId: git/create-ref\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-reference\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                ref:\n                  type: string\n                  description: 'The name of the fully qualified reference (ie: `refs/heads/master`).\n                    If it doesn''t start with ''refs'' and have at least two slashes,\n                    it will be rejected.'\n                sha:\n                  type: string\n                  description: The SHA1 value for this reference.\n                key:\n                  type: string\n                  examples:\n                  - '\"refs/heads/newbranch\"'\n              required:\n              - ref\n              - sha\n            example:\n              ref: refs/heads/featureA\n              sha: aa218f56b14c9653891f9e74264a383fa43fefbd\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-ref\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-ref\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/git/refs/heads/featureA\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: refs\n  \"/repos/{owner}/{repo}/git/refs/{ref}\":\n    patch:\n      summary: Update a reference\n      description: ''\n      tags:\n      - git\n      operationId: git/update-ref\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#update-a-reference\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                sha:\n                  type: string\n                  description: The SHA1 value to set this reference to\n                force:\n                  type: boolean\n                  description: Indicates whether to force the update or to make sure\n                    the update is a fast-forward update. Leaving this out or setting\n                    it to `false` will make sure you're not overwriting work.\n                  default: false\n              required:\n              - sha\n            example:\n              sha: aa218f56b14c9653891f9e74264a383fa43fefbd\n              force: true\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-ref\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-ref\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: refs\n    delete:\n      summary: Delete a reference\n      description: ''\n      tags:\n      - git\n      operationId: git/delete-ref\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#delete-a-reference\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: ref parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      responses:\n        '204':\n          description: Response\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: refs\n  \"/repos/{owner}/{repo}/git/tags\":\n    post:\n      summary: Create a tag object\n      description: |-\n        Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary.\n\n        **Signature verification object**\n\n        The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n        | Name | Type | Description |\n        | ---- | ---- | ----------- |\n        | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n        | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n        | `signature` | `string` | The signature that was extracted from the commit. |\n        | `payload` | `string` | The value that was signed. |\n\n        These are the possible values for `reason` in the `verification` object:\n\n        | Value | Description |\n        | ----- | ----------- |\n        | `expired_key` | The key that made the signature is expired. |\n        | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n        | `gpgverify_error` | There was an error communicating with the signature verification service. |\n        | `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n        | `unsigned` | The object does not include a signature. |\n        | `unknown_signature_type` | A non-PGP signature was found in the commit. |\n        | `no_user` | No user was associated with the `committer` email address in the commit. |\n        | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n        | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n        | `unknown_key` | The key that made the signature has not been registered with any user's account. |\n        | `malformed_signature` | There was an error parsing the signature. |\n        | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n        | `valid` | None of the above errors applied, so the signature is considered to be verified. |\n      tags:\n      - git\n      operationId: git/create-tag\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-tag-object\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                tag:\n                  type: string\n                  description: The tag's name. This is typically a version (e.g.,\n                    \"v0.0.1\").\n                message:\n                  type: string\n                  description: The tag message.\n                object:\n                  type: string\n                  description: The SHA of the git object this is tagging.\n                type:\n                  type: string\n                  description: The type of the object we're tagging. Normally this\n                    is a `commit` but it can also be a `tree` or a `blob`.\n                  enum:\n                  - commit\n                  - tree\n                  - blob\n                tagger:\n                  type: object\n                  description: An object with information about the individual creating\n                    the tag.\n                  properties:\n                    name:\n                      type: string\n                      description: The name of the author of the tag\n                    email:\n                      type: string\n                      description: The email of the author of the tag\n                    date:\n                      type: string\n                      format: date-time\n                      description: 'When this object was tagged. This is a timestamp\n                        in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format:\n                        `YYYY-MM-DDTHH:MM:SSZ`.'\n                  required:\n                  - name\n                  - email\n              required:\n              - tag\n              - message\n              - object\n              - type\n            example:\n              tag: v0.0.1\n              message: initial version\n              object: c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c\n              type: commit\n              tagger:\n                name: Monalisa Octocat\n                email: octocat@github.com\n                date: '2011-06-17T14:53:35-07:00'\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-tag\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-tag\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: tags\n  \"/repos/{owner}/{repo}/git/tags/{tag_sha}\":\n    get:\n      summary: Get a tag\n      description: |-\n        **Signature verification object**\n\n        The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n        | Name | Type | Description |\n        | ---- | ---- | ----------- |\n        | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n        | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n        | `signature` | `string` | The signature that was extracted from the commit. |\n        | `payload` | `string` | The value that was signed. |\n\n        These are the possible values for `reason` in the `verification` object:\n\n        | Value | Description |\n        | ----- | ----------- |\n        | `expired_key` | The key that made the signature is expired. |\n        | `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n        | `gpgverify_error` | There was an error communicating with the signature verification service. |\n        | `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n        | `unsigned` | The object does not include a signature. |\n        | `unknown_signature_type` | A non-PGP signature was found in the commit. |\n        | `no_user` | No user was associated with the `committer` email address in the commit. |\n        | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n        | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n        | `unknown_key` | The key that made the signature has not been registered with any user's account. |\n        | `malformed_signature` | There was an error parsing the signature. |\n        | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n        | `valid` | None of the above errors applied, so the signature is considered to be verified. |\n      tags:\n      - git\n      operationId: git/get-tag\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-tag\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: tag_sha\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-tag\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-tag\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: tags\n  \"/repos/{owner}/{repo}/git/trees\":\n    post:\n      summary: Create a tree\n      description: |-\n        The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.\n\n        If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see \"[Create a commit](https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-commit)\" and \"[Update a reference](https://docs.github.com/enterprise-server@3.0/rest/reference/git#update-a-reference).\"\n      tags:\n      - git\n      operationId: git/create-tree\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#create-a-tree\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                tree:\n                  type: array\n                  description: Objects (of `path`, `mode`, `type`, and `sha`) specifying\n                    a tree structure.\n                  items:\n                    type: object\n                    properties:\n                      path:\n                        type: string\n                        description: The file referenced in the tree.\n                      mode:\n                        type: string\n                        description: The file mode; one of `100644` for file (blob),\n                          `100755` for executable (blob), `040000` for subdirectory\n                          (tree), `160000` for submodule (commit), or `120000` for\n                          a blob that specifies the path of a symlink.\n                        enum:\n                        - '100644'\n                        - '100755'\n                        - '040000'\n                        - '160000'\n                        - '120000'\n                      type:\n                        type: string\n                        description: Either `blob`, `tree`, or `commit`.\n                        enum:\n                        - blob\n                        - tree\n                        - commit\n                      sha:\n                        type:\n                        - string\n                        - 'null'\n                        description: \"The SHA1 checksum ID of the object in the tree.\n                          Also called `tree.sha`. If the value is `null` then the\n                          file will be deleted.  \\n  \\n**Note:** Use either `tree.sha`\n                          or `content` to specify the contents of the entry. Using\n                          both `tree.sha` and `content` will return an error.\"\n                      content:\n                        type: string\n                        description: \"The content you want this file to have. GitHub\n                          will write this blob out and use that SHA for this entry.\n                          Use either this, or `tree.sha`.  \\n  \\n**Note:** Use either\n                          `tree.sha` or `content` to specify the contents of the entry.\n                          Using both `tree.sha` and `content` will return an error.\"\n                base_tree:\n                  type: string\n                  description: |\n                    The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.\n                    If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit.\n              required:\n              - tree\n            example:\n              base_tree: 9fb037999f264ba9a7fc6274d15fa3ae2ab98312\n              tree:\n              - path: file.rb\n                mode: '100644'\n                type: blob\n                sha: 44b4fc6d56897b048c772eb4087f854f46256132\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-tree\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/git-tree\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/trees/cd8274d15fa3ae2ab983129fb037999f264ba9a7\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: trees\n  \"/repos/{owner}/{repo}/git/trees/{tree_sha}\":\n    get:\n      summary: Get a tree\n      description: |-\n        Returns a single tree using the SHA1 value for that tree.\n\n        If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.\n      tags:\n      - git\n      operationId: git/get-tree\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/git#get-a-tree\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: tree_sha\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      - name: recursive\n        description: 'Setting this parameter to any value returns the objects or subtrees\n          referenced by the tree specified in `:tree_sha`. For example, setting `recursive`\n          to any of the following will enable returning objects or subtrees: `0`,\n          `1`, `\"true\"`, and `\"false\"`. Omit this parameter to prevent recursively\n          returning objects or subtrees.'\n        in: query\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/git-tree\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/git-tree-default-response\"\n                response-recursively-retrieving-a-tree:\n                  \"$ref\": \"#/components/examples/git-tree-response-recursively-retrieving-a-tree\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: git\n        subcategory: trees\n  \"/repos/{owner}/{repo}/hooks\":\n    get:\n      summary: List repository webhooks\n      description: ''\n      tags:\n      - repos\n      operationId: repos/list-webhooks\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-webhooks\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/hook-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n    post:\n      summary: Create a repository webhook\n      description: |-\n        Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can\n        share the same `config` as long as those webhooks do not have any `events` that overlap.\n      tags:\n      - repos\n      operationId: repos/create-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                name:\n                  type: string\n                  description: 'Use `web` to create a webhook. Default: `web`. This\n                    parameter only accepts the value `web`.'\n                config:\n                  type: object\n                  description: Key/value pairs to provide settings for this webhook.\n                    [These are defined below](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-hook-config-params).\n                  properties:\n                    url:\n                      \"$ref\": \"#/components/schemas/webhook-config-url\"\n                    content_type:\n                      \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                    secret:\n                      \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                    insecure_ssl:\n                      \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                    token:\n                      type: string\n                      examples:\n                      - '\"abc\"'\n                    digest:\n                      type: string\n                      examples:\n                      - '\"sha256\"'\n                events:\n                  type: array\n                  description: Determines what [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads)\n                    the hook is triggered for.\n                  default:\n                  - push\n                  items:\n                    type: string\n                active:\n                  type: boolean\n                  description: Determines if notifications are sent when the webhook\n                    is triggered. Set to `true` to send notifications.\n                  default: true\n              additionalProperties: false\n            example:\n              name: web\n              active: true\n              events:\n              - push\n              - pull_request\n              config:\n                url: https://example.com/webhook\n                content_type: json\n                insecure_ssl: '0'\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/hook\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/hooks/12345678\n              schema:\n                type: string\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n  \"/repos/{owner}/{repo}/hooks/{hook_id}\":\n    get:\n      summary: Get a repository webhook\n      description: Returns a webhook configured in a repository. To get only the webhook\n        `config` properties, see \"[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository).\"\n      tags:\n      - repos\n      operationId: repos/get-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/hook\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n    patch:\n      summary: Update a repository webhook\n      description: Updates a webhook configured in a repository. If you previously\n        had a `secret` set, you must provide the same `secret` or set a new `secret`\n        or the secret will be removed. If you are only updating individual webhook\n        `config` properties, use \"[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository).\"\n      tags:\n      - repos\n      operationId: repos/update-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-repository-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                config:\n                  type: object\n                  description: Key/value pairs to provide settings for this webhook.\n                    [These are defined below](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-hook-config-params).\n                  properties:\n                    url:\n                      \"$ref\": \"#/components/schemas/webhook-config-url\"\n                    content_type:\n                      \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                    secret:\n                      \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                    insecure_ssl:\n                      \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n                    address:\n                      type: string\n                      examples:\n                      - '\"bar@example.com\"'\n                    room:\n                      type: string\n                      examples:\n                      - '\"The Serious Room\"'\n                  required:\n                  - url\n                events:\n                  type: array\n                  description: Determines what [events](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads)\n                    the hook is triggered for. This replaces the entire array of events.\n                  default:\n                  - push\n                  items:\n                    type: string\n                add_events:\n                  type: array\n                  description: Determines a list of events to be added to the list\n                    of events that the Hook triggers for.\n                  items:\n                    type: string\n                remove_events:\n                  type: array\n                  description: Determines a list of events to be removed from the\n                    list of events that the Hook triggers for.\n                  items:\n                    type: string\n                active:\n                  type: boolean\n                  description: Determines if notifications are sent when the webhook\n                    is triggered. Set to `true` to send notifications.\n                  default: true\n            example:\n              active: true\n              add_events:\n              - pull_request\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/hook\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n    delete:\n      summary: Delete a repository webhook\n      description: ''\n      tags:\n      - repos\n      operationId: repos/delete-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-repository-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n  \"/repos/{owner}/{repo}/hooks/{hook_id}/config\":\n    get:\n      summary: Get a webhook configuration for a repository\n      description: |-\n        Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use \"[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook).\"\n\n        Access tokens must have the `read:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:read` permission.\n      tags:\n      - repos\n      operationId: repos/get-webhook-config-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-webhook-configuration-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/webhook-config\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/webhook-config\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n    patch:\n      summary: Update a webhook configuration for a repository\n      description: |-\n        Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use \"[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook).\"\n\n        Access tokens must have the `write:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:write` permission.\n      tags:\n      - repos\n      operationId: repos/update-webhook-config-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-webhook-configuration-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              additionalProperties: false\n              properties:\n                url:\n                  \"$ref\": \"#/components/schemas/webhook-config-url\"\n                content_type:\n                  \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n                secret:\n                  \"$ref\": \"#/components/schemas/webhook-config-secret\"\n                insecure_ssl:\n                  \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n              example:\n                content_type: json\n                insecure_ssl: '0'\n                secret: \"********\"\n                url: https://example.com/webhook\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/webhook-config\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/webhook-config\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n  \"/repos/{owner}/{repo}/hooks/{hook_id}/pings\":\n    post:\n      summary: Ping a repository webhook\n      description: This will trigger a [ping event](https://docs.github.com/enterprise-server@3.0/webhooks/#ping-event)\n        to be sent to the hook.\n      tags:\n      - repos\n      operationId: repos/ping-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#ping-a-repository-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n  \"/repos/{owner}/{repo}/hooks/{hook_id}/tests\":\n    post:\n      summary: Test the push repository webhook\n      description: |-\n        This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.\n\n        **Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test`\n      tags:\n      - repos\n      operationId: repos/test-push-webhook\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#test-the-push-repository-webhook\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/hook-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: webhooks\n  \"/repos/{owner}/{repo}/installation\":\n    get:\n      summary: Get a repository installation for the authenticated app\n      description: |-\n        Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/get-repo-installation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-a-repository-installation-for-the-authenticated-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/installation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/installation\"\n        '301':\n          \"$ref\": \"#/components/responses/moved_permanently\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: \n  \"/repos/{owner}/{repo}/invitations\":\n    get:\n      summary: List repository invitations\n      description: When authenticating as a user with admin rights to a repository,\n        this endpoint will list all currently open repository invitations.\n      tags:\n      - repos\n      operationId: repos/list-invitations\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-invitations\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/repository-invitation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-invitation-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: invitations\n  \"/repos/{owner}/{repo}/invitations/{invitation_id}\":\n    patch:\n      summary: Update a repository invitation\n      description: ''\n      tags:\n      - repos\n      operationId: repos/update-invitation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-repository-invitation\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/invitation-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                permissions:\n                  type: string\n                  description: The permissions that the associated user will have\n                    on the repository. Valid values are `read`, `write`, `maintain`,\n                    `triage`, and `admin`.\n                  enum:\n                  - read\n                  - write\n                  - maintain\n                  - triage\n                  - admin\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository-invitation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-invitation\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: invitations\n    delete:\n      summary: Delete a repository invitation\n      description: ''\n      tags:\n      - repos\n      operationId: repos/delete-invitation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-repository-invitation\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/invitation-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: invitations\n  \"/repos/{owner}/{repo}/issues\":\n    get:\n      summary: List repository issues\n      description: |-\n        List issues in a repository.\n\n        **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\n        reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\n        the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\n        request id, use the \"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\" endpoint.\n      tags:\n      - issues\n      operationId: issues/list-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-repository-issues\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: milestone\n        description: If an `integer` is passed, it should refer to a milestone by\n          its `number` field. If the string `*` is passed, issues with any milestone\n          are accepted. If the string `none` is passed, issues without milestones\n          are returned.\n        in: query\n        required: false\n        schema:\n          type: string\n      - name: state\n        description: Indicates the state of the issues to return. Can be either `open`,\n          `closed`, or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - name: assignee\n        description: Can be the name of a user. Pass in `none` for issues with no\n          assigned user, and `*` for issues assigned to any user.\n        in: query\n        required: false\n        schema:\n          type: string\n      - name: creator\n        description: The user that created the issue.\n        in: query\n        required: false\n        schema:\n          type: string\n      - name: mentioned\n        description: A user that's mentioned in the issue.\n        in: query\n        required: false\n        schema:\n          type: string\n      - \"$ref\": \"#/components/parameters/labels\"\n      - name: sort\n        description: What to sort results by. Can be either `created`, `updated`,\n          `comments`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - comments\n          default: created\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '301':\n          \"$ref\": \"#/components/responses/moved_permanently\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        previews:\n        - required: false\n          name: machine-man\n          note: \"If an issue event is created via a GitHub App, the response will\n            include the `performed_via_github_app` object with\\tinformation about\n            the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo\n            receive the `performed_via_github_app` object in the response, you must\n            provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types)\n            in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create an issue\n      description: |-\n        Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status.\n\n        This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n      tags:\n      - issues\n      operationId: issues/create\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  oneOf:\n                  - type: string\n                  - type: integer\n                  description: The title of the issue.\n                body:\n                  type: string\n                  description: The contents of the issue.\n                assignee:\n                  type:\n                  - string\n                  - 'null'\n                  description: 'Login for the user that this issue should be assigned\n                    to. _NOTE: Only users with push access can set the assignee for\n                    new issues. The assignee is silently dropped otherwise. **This\n                    field is deprecated.**_'\n                milestone:\n                  oneOf:\n                  - type: string\n                  - type: integer\n                    description: 'The `number` of the milestone to associate this\n                      issue with. _NOTE: Only users with push access can set the milestone\n                      for new issues. The milestone is silently dropped otherwise._'\n                  type:\n                  - 'null'\n                  - string\n                  - integer\n                labels:\n                  type: array\n                  description: 'Labels to associate with this issue. _NOTE: Only users\n                    with push access can set labels for new issues. Labels are silently\n                    dropped otherwise._'\n                  items:\n                    oneOf:\n                    - type: string\n                    - type: object\n                      properties:\n                        id:\n                          type: integer\n                        name:\n                          type: string\n                        description:\n                          type:\n                          - string\n                          - 'null'\n                        color:\n                          type:\n                          - string\n                          - 'null'\n                assignees:\n                  type: array\n                  description: 'Logins for Users to assign to this issue. _NOTE: Only\n                    users with push access can set assignees for new issues. Assignees\n                    are silently dropped otherwise._'\n                  items:\n                    type: string\n              required:\n              - title\n            example:\n              title: Found a bug\n              body: I'm having a problem with this.\n              assignees:\n              - octocat\n              milestone: 1\n              labels:\n              - bug\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/issues/1347\n              schema:\n                type: string\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: \n  \"/repos/{owner}/{repo}/issues/comments\":\n    get:\n      summary: List issue comments for a repository\n      description: By default, Issue Comments are ordered by ascending ID.\n      tags:\n      - issues\n      operationId: issues/list-comments-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issue-comments-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/sort\"\n      - name: direction\n        description: Either `asc` or `desc`. Ignored without the `sort` parameter.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - asc\n          - desc\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/issue-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/issues/comments/{comment_id}\":\n    get:\n      summary: Get an issue comment\n      description: ''\n      tags:\n      - issues\n      operationId: issues/get-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-an-issue-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-comment\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: comments\n        previews:\n        - required: false\n          name: machine-man\n          note: \"If an issue event is created via a GitHub App, the response will\n            include the `performed_via_github_app` object with\\tinformation about\n            the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo\n            receive the `performed_via_github_app` object in the response, you must\n            provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types)\n            in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    patch:\n      summary: Update an issue comment\n      description: ''\n      tags:\n      - issues\n      operationId: issues/update-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#update-an-issue-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The contents of the comment.\n              required:\n              - body\n            example:\n              body: Me too\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-comment\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: comments\n    delete:\n      summary: Delete an issue comment\n      description: ''\n      tags:\n      - issues\n      operationId: issues/delete-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#delete-an-issue-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: comments\n  \"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\":\n    get:\n      summary: List reactions for an issue comment\n      description: List the reactions to an [issue comment](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#comments).\n      tags:\n      - reactions\n      operationId: reactions/list-for-issue-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-an-issue-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      - name: content\n        description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types).\n          Omit this parameter to list all reactions to an issue comment.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create reaction for an issue comment\n      description: Create a reaction to an [issue comment](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#comments).\n        A response with an HTTP `200` status means that you already added the reaction\n        type to this issue comment.\n      tags:\n      - reactions\n      operationId: reactions/create-for-issue-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-an-issue-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types)\n                    to add to the issue comment.\n                  enum:\n                  - \"+1\"\n                  - \"-1\"\n                  - laugh\n                  - confused\n                  - heart\n                  - hooray\n                  - rocket\n                  - eyes\n              required:\n              - content\n            example:\n              content: heart\n      responses:\n        '200':\n          description: Reaction exists\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '201':\n          description: Reaction created\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\":\n    delete:\n      summary: Delete an issue comment reaction\n      description: |-\n        **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.\n\n        Delete a reaction to an [issue comment](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#comments).\n      tags:\n      - reactions\n      operationId: reactions/delete-for-issue-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-an-issue-comment-reaction\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      - \"$ref\": \"#/components/parameters/reaction-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/issues/events\":\n    get:\n      summary: List issue events for a repository\n      description: ''\n      tags:\n      - issues\n      operationId: issues/list-events-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issue-events-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/issue-event\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-event-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: events\n        previews:\n        - required: false\n          name: starfox\n          note: |-\n            Project card details are now shown in REST API v3 responses for project-related issue and timeline events. This feature is now available for developers to preview. For details, see the [blog post](https://developer.github.com/changes/2018-09-05-project-card-events).\n\n            To receive the `project_card` attribute, project boards must be [enabled](https://docs.github.com/articles/disabling-project-boards-in-a-repository) for a repository, and you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.starfox-preview+json\n            ```\n  \"/repos/{owner}/{repo}/issues/events/{event_id}\":\n    get:\n      summary: Get an issue event\n      description: ''\n      tags:\n      - issues\n      operationId: issues/get-event\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-an-issue-event\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: event_id\n        in: path\n        required: true\n        schema:\n          type: integer\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue-event\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-event\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: events\n        previews:\n        - required: false\n          name: starfox\n          note: |-\n            Project card details are now shown in REST API v3 responses for project-related issue and timeline events. This feature is now available for developers to preview. For details, see the [blog post](https://developer.github.com/changes/2018-09-05-project-card-events).\n\n            To receive the `project_card` attribute, project boards must be [enabled](https://docs.github.com/articles/disabling-project-boards-in-a-repository) for a repository, and you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.starfox-preview+json\n            ```\n  \"/repos/{owner}/{repo}/issues/{issue_number}\":\n    get:\n      summary: Get an issue\n      description: |-\n        The API returns a [`301 Moved Permanently` status](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was\n        [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If\n        the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API\n        returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read\n        access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe\n        to the [`issues`](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#issues) webhook.\n\n        **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\n        reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\n        the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\n        request id, use the \"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\" endpoint.\n      tags:\n      - issues\n      operationId: issues/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue\"\n        '301':\n          \"$ref\": \"#/components/responses/moved_permanently\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    patch:\n      summary: Update an issue\n      description: Issue owners and users with push access can edit an issue.\n      tags:\n      - issues\n      operationId: issues/update\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues/#update-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  oneOf:\n                  - type: string\n                  - type: integer\n                  description: The title of the issue.\n                  type:\n                  - 'null'\n                  - string\n                  - integer\n                body:\n                  type:\n                  - string\n                  - 'null'\n                  description: The contents of the issue.\n                assignee:\n                  type:\n                  - string\n                  - 'null'\n                  description: Login for the user that this issue should be assigned\n                    to. **This field is deprecated.**\n                state:\n                  type: string\n                  description: State of the issue. Either `open` or `closed`.\n                  enum:\n                  - open\n                  - closed\n                milestone:\n                  oneOf:\n                  - type: string\n                  - type: integer\n                    description: 'The `number` of the milestone to associate this\n                      issue with or `null` to remove current. _NOTE: Only users with\n                      push access can set the milestone for issues. The milestone\n                      is silently dropped otherwise._'\n                  type:\n                  - 'null'\n                  - string\n                  - integer\n                labels:\n                  type: array\n                  description: 'Labels to associate with this issue. Pass one or more\n                    Labels to _replace_ the set of Labels on this Issue. Send an empty\n                    array (`[]`) to clear all Labels from the Issue. _NOTE: Only users\n                    with push access can set labels for issues. Labels are silently\n                    dropped otherwise._'\n                  items:\n                    oneOf:\n                    - type: string\n                    - type: object\n                      properties:\n                        id:\n                          type: integer\n                        name:\n                          type: string\n                        description:\n                          type:\n                          - string\n                          - 'null'\n                        color:\n                          type:\n                          - string\n                          - 'null'\n                assignees:\n                  type: array\n                  description: 'Logins for Users to assign to this issue. Pass one\n                    or more user logins to _replace_ the set of assignees on this\n                    Issue. Send an empty array (`[]`) to clear all assignees from\n                    the Issue. _NOTE: Only users with push access can set assignees\n                    for new issues. Assignees are silently dropped otherwise._'\n                  items:\n                    type: string\n            example:\n              title: Found a bug\n              body: I'm having a problem with this.\n              assignees:\n              - octocat\n              milestone: 1\n              state: open\n              labels:\n              - bug\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '301':\n          \"$ref\": \"#/components/responses/moved_permanently\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: \n  \"/repos/{owner}/{repo}/issues/{issue_number}/assignees\":\n    post:\n      summary: Add assignees to an issue\n      description: Adds up to 10 assignees to an issue. Users already assigned to\n        an issue are not replaced.\n      tags:\n      - issues\n      operationId: issues/add-assignees\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#add-assignees-to-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                assignees:\n                  type: array\n                  description: 'Usernames of people to assign this issue to. _NOTE:\n                    Only users with push access can add assignees to an issue. Assignees\n                    are silently ignored otherwise._'\n                  items:\n                    type: string\n            example:\n              assignees:\n              - hubot\n              - other_user\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: assignees\n    delete:\n      summary: Remove assignees from an issue\n      description: Removes one or more assignees from an issue.\n      tags:\n      - issues\n      operationId: issues/remove-assignees\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#remove-assignees-from-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                assignees:\n                  type: array\n                  description: 'Usernames of assignees to remove from an issue. _NOTE:\n                    Only users with push access can remove assignees from an issue.\n                    Assignees are silently ignored otherwise._'\n                  items:\n                    type: string\n            example:\n              assignees:\n              - hubot\n              - other_user\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: assignees\n  \"/repos/{owner}/{repo}/issues/{issue_number}/comments\":\n    get:\n      summary: List issue comments\n      description: Issue Comments are ordered by ascending ID.\n      tags:\n      - issues\n      operationId: issues/list-comments\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issue-comments\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/issue-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create an issue comment\n      description: This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/github/managing-subscriptions-and-notifications-on-github/about-notifications).\n        Creating content too quickly using this endpoint may result in secondary rate\n        limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\"\n        and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\"\n        for details.\n      tags:\n      - issues\n      operationId: issues/create-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-an-issue-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The contents of the comment.\n              required:\n              - body\n            example:\n              body: Me too\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/issue-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-comment\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/issues/comments/1\n              schema:\n                type: string\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: comments\n  \"/repos/{owner}/{repo}/issues/{issue_number}/events\":\n    get:\n      summary: List issue events\n      description: ''\n      tags:\n      - issues\n      operationId: issues/list-events\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-issue-events\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/issue-event-for-issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-event-for-issue-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: events\n        previews:\n        - required: false\n          name: starfox\n          note: |-\n            Project card details are now shown in REST API v3 responses for project-related issue and timeline events. This feature is now available for developers to preview. For details, see the [blog post](https://developer.github.com/changes/2018-09-05-project-card-events).\n\n            To receive the `project_card` attribute, project boards must be [enabled](https://docs.github.com/articles/disabling-project-boards-in-a-repository) for a repository, and you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.starfox-preview+json\n            ```\n  \"/repos/{owner}/{repo}/issues/{issue_number}/labels\":\n    get:\n      summary: List labels for an issue\n      description: ''\n      tags:\n      - issues\n      operationId: issues/list-labels-on-issue\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-labels-for-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n    post:\n      summary: Add labels to an issue\n      description: ''\n      tags:\n      - issues\n      operationId: issues/add-labels\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#add-labels-to-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  labels:\n                    type: array\n                    minItems: 1\n                    description: The names of the labels to add to the issue's existing\n                      labels. You can pass an empty array to remove all labels. Alternatively,\n                      you can pass a single label as a `string` or an `array` of labels\n                      directly, but GitHub recommends passing an object with the `labels`\n                      key. You can also replace all of the labels for an issue. For\n                      more information, see \"[Set labels for an issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#set-labels-for-an-issue).\"\n                    items:\n                      type: string\n              - type: array\n                minItems: 1\n                items:\n                  type: string\n              - type: object\n                properties:\n                  labels:\n                    type: array\n                    minItems: 1\n                    items:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n                      required:\n                      - name\n              - type: array\n                minItems: 1\n                items:\n                  type: object\n                  properties:\n                    name:\n                      type: string\n                  required:\n                  - name\n              - type: string\n            example:\n              labels:\n              - bug\n              - enhancement\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label-items\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n    put:\n      summary: Set labels for an issue\n      description: Removes any previous labels and sets the new labels for an issue.\n      tags:\n      - issues\n      operationId: issues/set-labels\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#set-labels-for-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  labels:\n                    type: array\n                    minItems: 1\n                    description: The names of the labels to set for the issue. The\n                      labels you set replace any existing labels. You can pass an\n                      empty array to remove all labels. Alternatively, you can pass\n                      a single label as a `string` or an `array` of labels directly,\n                      but GitHub recommends passing an object with the `labels` key.\n                      You can also add labels to the existing labels for an issue.\n                      For more information, see \"[Add labels to an issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#add-labels-to-an-issue).\"\n                    items:\n                      type: string\n              - type: array\n                minItems: 1\n                items:\n                  type: string\n              - type: object\n                properties:\n                  labels:\n                    type: array\n                    minItems: 1\n                    items:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n                      required:\n                      - name\n              - type: array\n                minItems: 1\n                items:\n                  type: object\n                  properties:\n                    name:\n                      type: string\n                  required:\n                  - name\n              - type: string\n            example:\n              labels:\n              - bug\n              - enhancement\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label-items\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n    delete:\n      summary: Remove all labels from an issue\n      description: ''\n      tags:\n      - issues\n      operationId: issues/remove-all-labels\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#remove-all-labels-from-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      responses:\n        '204':\n          description: Response\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n  \"/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\":\n    delete:\n      summary: Remove a label from an issue\n      description: Removes the specified label from the issue, and returns the remaining\n        labels on the issue. This endpoint returns a `404 Not Found` status if the\n        label does not exist.\n      tags:\n      - issues\n      operationId: issues/remove-label\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#remove-a-label-from-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      - name: name\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label-items-2\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n  \"/repos/{owner}/{repo}/issues/{issue_number}/lock\":\n    put:\n      summary: Lock an issue\n      description: |-\n        Users with push access can lock an issue or pull request's conversation.\n\n        Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n      tags:\n      - issues\n      operationId: issues/lock\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#lock-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                lock_reason:\n                  type: string\n                  description: \"The reason for locking the issue or pull request conversation.\n                    Lock will fail if you don't use one of these reasons:  \\n\\\\* `off-topic`\n                    \\ \\n\\\\* `too heated`  \\n\\\\* `resolved`  \\n\\\\* `spam`\"\n                  enum:\n                  - off-topic\n                  - too heated\n                  - resolved\n                  - spam\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: \n    delete:\n      summary: Unlock an issue\n      description: Users with push access can unlock an issue's conversation.\n      tags:\n      - issues\n      operationId: issues/unlock\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#unlock-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: \n  \"/repos/{owner}/{repo}/issues/{issue_number}/reactions\":\n    get:\n      summary: List reactions for an issue\n      description: List the reactions to an [issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues).\n      tags:\n      - reactions\n      operationId: reactions/list-for-issue\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      - name: content\n        description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types).\n          Omit this parameter to list all reactions to an issue.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create reaction for an issue\n      description: Create a reaction to an [issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues/).\n        A response with an HTTP `200` status means that you already added the reaction\n        type to this issue.\n      tags:\n      - reactions\n      operationId: reactions/create-for-issue\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types)\n                    to add to the issue.\n                  enum:\n                  - \"+1\"\n                  - \"-1\"\n                  - laugh\n                  - confused\n                  - heart\n                  - hooray\n                  - rocket\n                  - eyes\n              required:\n              - content\n            example:\n              content: heart\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\":\n    delete:\n      summary: Delete an issue reaction\n      description: |-\n        **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.\n\n        Delete a reaction to an [issue](https://docs.github.com/enterprise-server@3.0/rest/reference/issues/).\n      tags:\n      - reactions\n      operationId: reactions/delete-for-issue\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-an-issue-reaction\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      - \"$ref\": \"#/components/parameters/reaction-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/issues/{issue_number}/timeline\":\n    get:\n      summary: List timeline events for an issue\n      description: ''\n      tags:\n      - issues\n      operationId: issues/list-events-for-timeline\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-timeline-events-for-an-issue\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/issue-number\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/timeline-issue-events\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: timeline\n        previews:\n        - required: true\n          name: mockingbird\n          note: |-\n            The API to get issue timeline events is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-23-timeline-preview-api/) for full details. To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.mockingbird-preview\n            ```\n        - required: false\n          name: starfox\n          note: |-\n            Project card details are now shown in REST API v3 responses for project-related issue and timeline events. This feature is now available for developers to preview. For details, see the [blog post](https://developer.github.com/changes/2018-09-05-project-card-events).\n\n            To receive the `project_card` attribute, project boards must be [enabled](https://docs.github.com/articles/disabling-project-boards-in-a-repository) for a repository, and you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.starfox-preview+json\n            ```\n  \"/repos/{owner}/{repo}/keys\":\n    get:\n      summary: List deploy keys\n      description: ''\n      tags:\n      - repos\n      operationId: repos/list-deploy-keys\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-deploy-keys\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/deploy-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/deploy-key-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: keys\n    post:\n      summary: Create a deploy key\n      description: You can create a read-only deploy key.\n      tags:\n      - repos\n      operationId: repos/create-deploy-key\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-deploy-key\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: A name for the key.\n                key:\n                  type: string\n                  description: The contents of the key.\n                read_only:\n                  type: boolean\n                  description: \"If `true`, the key will only be able to read repository\n                    contents. Otherwise, the key will be able to read and write.  \\n\n                    \\ \\nDeploy keys with write access can perform the same actions\n                    as an organization member with admin access, or a collaborator\n                    on a personal repository. For more information, see \\\"[Repository\n                    permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\\\"\n                    and \\\"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\\\"\"\n              required:\n              - key\n            example:\n              title: octocat@octomac\n              key: ssh-rsa AAA...\n              read_only: true\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/deploy-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/deploy-key\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/keys/1\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: keys\n  \"/repos/{owner}/{repo}/keys/{key_id}\":\n    get:\n      summary: Get a deploy key\n      description: ''\n      tags:\n      - repos\n      operationId: repos/get-deploy-key\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-deploy-key\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/key-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/deploy-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/deploy-key\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: keys\n    delete:\n      summary: Delete a deploy key\n      description: Deploy keys are immutable. If you need to update a key, remove\n        the key and create a new one instead.\n      tags:\n      - repos\n      operationId: repos/delete-deploy-key\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-deploy-key\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/key-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: keys\n  \"/repos/{owner}/{repo}/labels\":\n    get:\n      summary: List labels for a repository\n      description: ''\n      tags:\n      - issues\n      operationId: issues/list-labels-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-labels-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n    post:\n      summary: Create a label\n      description: ''\n      tags:\n      - issues\n      operationId: issues/create-label\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-a-label\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the label. Emoji can be added to label\n                    names, using either native emoji or colon-style markup. For example,\n                    typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png\n                    \":strawberry:\"). For a full list of available emoji and codes,\n                    see \"[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet).\"\n                color:\n                  type: string\n                  description: The [hexadecimal color code](http://www.color-hex.com/)\n                    for the label, without the leading `#`.\n                description:\n                  type: string\n                  description: A short description of the label. Must be 100 characters\n                    or fewer.\n              required:\n              - name\n            example:\n              name: bug\n              description: Something isn't working\n              color: f29513\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/labels/bug\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n  \"/repos/{owner}/{repo}/labels/{name}\":\n    get:\n      summary: Get a label\n      description: ''\n      tags:\n      - issues\n      operationId: issues/get-label\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-a-label\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: name\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n    patch:\n      summary: Update a label\n      description: ''\n      tags:\n      - issues\n      operationId: issues/update-label\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#update-a-label\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: name\n        in: path\n        required: true\n        schema:\n          type: string\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                new_name:\n                  type: string\n                  description: The new name of the label. Emoji can be added to label\n                    names, using either native emoji or colon-style markup. For example,\n                    typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png\n                    \":strawberry:\"). For a full list of available emoji and codes,\n                    see \"[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet).\"\n                color:\n                  type: string\n                  description: The [hexadecimal color code](http://www.color-hex.com/)\n                    for the label, without the leading `#`.\n                description:\n                  type: string\n                  description: A short description of the label. Must be 100 characters\n                    or fewer.\n            example:\n              new_name: 'bug :bug:'\n              description: Small bug fix required\n              color: b01f26\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n    delete:\n      summary: Delete a label\n      description: ''\n      tags:\n      - issues\n      operationId: issues/delete-label\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#delete-a-label\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: name\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n  \"/repos/{owner}/{repo}/languages\":\n    get:\n      summary: List repository languages\n      description: Lists languages for the specified repository. The value shown for\n        each language is the number of bytes of code written in that language.\n      tags:\n      - repos\n      operationId: repos/list-languages\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-languages\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/language\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/language\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: \n  \"/repos/{owner}/{repo}/license\":\n    get:\n      summary: Get the license for a repository\n      description: |-\n        This method returns the contents of the repository's license file, if one is detected.\n\n        Similar to [Get repository content](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) for retrieving the raw license content or rendered license HTML.\n      tags:\n      - licenses\n      operationId: licenses/get-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/licenses/#get-the-license-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/license-content\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/license-content\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: licenses\n        subcategory: \n  \"/repos/{owner}/{repo}/merges\":\n    post:\n      summary: Merge a branch\n      description: ''\n      tags:\n      - repos\n      operationId: repos/merge\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#merge-a-branch\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                base:\n                  type: string\n                  description: The name of the base branch that the head will be merged\n                    into.\n                head:\n                  type: string\n                  description: The head to merge. This can be a branch name or a commit\n                    SHA1.\n                commit_message:\n                  type: string\n                  description: Commit message to use for the merge commit. If omitted,\n                    a default message will be used.\n              required:\n              - base\n              - head\n            example:\n              base: master\n              head: cool_feature\n              commit_message: Shipped cool_feature!\n      responses:\n        '201':\n          description: Successful Response (The resulting merge commit)\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/commit\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit\"\n        '204':\n          description: Response when already merged\n        '404':\n          description: Not Found when the base or head does not exist\n        '409':\n          description: Conflict when there is a merge conflict\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: merging\n  \"/repos/{owner}/{repo}/milestones\":\n    get:\n      summary: List milestones\n      description: ''\n      tags:\n      - issues\n      operationId: issues/list-milestones\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-milestones\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: state\n        description: The state of the milestone. Either `open`, `closed`, or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - name: sort\n        description: What to sort results by. Either `due_on` or `completeness`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - due_on\n          - completeness\n          default: due_on\n      - name: direction\n        description: The direction of the sort. Either `asc` or `desc`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - asc\n          - desc\n          default: asc\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/milestone\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/milestone-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: milestones\n    post:\n      summary: Create a milestone\n      description: ''\n      tags:\n      - issues\n      operationId: issues/create-milestone\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-a-milestone\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: The title of the milestone.\n                state:\n                  type: string\n                  description: The state of the milestone. Either `open` or `closed`.\n                  enum:\n                  - open\n                  - closed\n                  default: open\n                description:\n                  type: string\n                  description: A description of the milestone.\n                due_on:\n                  type: string\n                  format: date-time\n                  description: 'The milestone due date. This is a timestamp in [ISO\n                    8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.'\n              required:\n              - title\n            example:\n              title: v1.0\n              state: open\n              description: Tracking milestone for version 1.0\n              due_on: '2012-10-09T23:39:01Z'\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/milestone\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/milestone\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/milestones/1\n              schema:\n                type: string\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: milestones\n  \"/repos/{owner}/{repo}/milestones/{milestone_number}\":\n    get:\n      summary: Get a milestone\n      description: ''\n      tags:\n      - issues\n      operationId: issues/get-milestone\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#get-a-milestone\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/milestone-number\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/milestone\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/milestone\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: milestones\n    patch:\n      summary: Update a milestone\n      description: ''\n      tags:\n      - issues\n      operationId: issues/update-milestone\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#update-a-milestone\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/milestone-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: The title of the milestone.\n                state:\n                  type: string\n                  description: The state of the milestone. Either `open` or `closed`.\n                  enum:\n                  - open\n                  - closed\n                  default: open\n                description:\n                  type: string\n                  description: A description of the milestone.\n                due_on:\n                  type: string\n                  format: date-time\n                  description: 'The milestone due date. This is a timestamp in [ISO\n                    8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.'\n            example:\n              title: v1.0\n              state: open\n              description: Tracking milestone for version 1.0\n              due_on: '2012-10-09T23:39:01Z'\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/milestone\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/milestone\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: milestones\n    delete:\n      summary: Delete a milestone\n      description: ''\n      tags:\n      - issues\n      operationId: issues/delete-milestone\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#delete-a-milestone\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/milestone-number\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: milestones\n  \"/repos/{owner}/{repo}/milestones/{milestone_number}/labels\":\n    get:\n      summary: List labels for issues in a milestone\n      description: ''\n      tags:\n      - issues\n      operationId: issues/list-labels-for-milestone\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-labels-for-issues-in-a-milestone\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/milestone-number\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/label\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: issues\n        subcategory: labels\n  \"/repos/{owner}/{repo}/notifications\":\n    get:\n      summary: List repository notifications for the authenticated user\n      description: List all notifications for the current user.\n      tags:\n      - activity\n      operationId: activity/list-repo-notifications-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repository-notifications-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/all\"\n      - \"$ref\": \"#/components/parameters/participating\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/before\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/thread\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/thread-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n    put:\n      summary: Mark repository notifications as read\n      description: Marks all notifications in a repository as \"read\" removes them\n        from the [default view on GitHub Enterprise Server](https://github.com/notifications).\n        If the number of notifications is too large to complete in one request, you\n        will receive a `202 Accepted` status and GitHub Enterprise Server will run\n        an asynchronous process to mark notifications as \"read.\" To check whether\n        any \"unread\" notifications remain, you can use the [List repository notifications\n        for the authenticated user](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repository-notifications-for-the-authenticated-user)\n        endpoint and pass the query parameter `all=false`.\n      tags:\n      - activity\n      operationId: activity/mark-repo-notifications-as-read\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#mark-repository-notifications-as-read\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                last_read_at:\n                  type: string\n                  format: date-time\n                  description: 'Describes the last point that notifications were checked.\n                    Anything updated since this time will not be marked as read. If\n                    you omit this parameter, all notifications are marked as read.\n                    This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)\n                    format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp.'\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  url:\n                    type: string\n        '205':\n          description: Reset Content\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: notifications\n  \"/repos/{owner}/{repo}/pages\":\n    get:\n      summary: Get a GitHub Enterprise Server Pages site\n      description: ''\n      tags:\n      - repos\n      operationId: repos/get-pages\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-github-pages-site\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/page\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/page\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: pages\n    post:\n      summary: Create a GitHub Enterprise Server Pages site\n      description: Configures a GitHub Enterprise Server Pages site. For more information,\n        see \"[About GitHub Pages](/github/working-with-github-pages/about-github-pages).\"\n      tags:\n      - repos\n      operationId: repos/create-pages-site\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-github-pages-site\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              description: The source branch and directory used to publish your Pages\n                site.\n              properties:\n                source:\n                  type: object\n                  description: The source branch and directory used to publish your\n                    Pages site.\n                  properties:\n                    branch:\n                      type: string\n                      description: The repository branch used to publish your site's\n                        source files.\n                    path:\n                      type: string\n                      description: 'The repository directory that includes the source\n                        files for the Pages site. Allowed paths are `/` or `/docs`.\n                        Default: `/`'\n                      enum:\n                      - \"/\"\n                      - \"/docs\"\n                      default: \"/\"\n                  required:\n                  - branch\n              required:\n              - source\n            example:\n              source:\n                branch: main\n                path: \"/docs\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/page\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/page\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '409':\n          \"$ref\": \"#/components/responses/conflict\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: pages\n        previews:\n        - required: true\n          name: switcheroo\n          note: |-\n            Enabling and disabling Pages in the Pages API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-03-14-enabling-disabling-pages/) preview for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.switcheroo-preview+json\n            ```\n    put:\n      summary: Update information about a GitHub Enterprise Server Pages site\n      description: Updates information for a GitHub Enterprise Server Pages site.\n        For more information, see \"[About GitHub Pages](/github/working-with-github-pages/about-github-pages).\n      tags:\n      - repos\n      operationId: repos/update-information-about-pages-site\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-information-about-a-github-pages-site\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                cname:\n                  type:\n                  - string\n                  - 'null'\n                  description: Specify a custom domain for the repository. Sending\n                    a `null` value will remove the custom domain. For more about custom\n                    domains, see \"[Using a custom domain with GitHub Pages](https://docs.github.com/articles/using-a-custom-domain-with-github-pages/).\"\n                https_enforced:\n                  type: boolean\n                  description: Specify whether HTTPS should be enforced for the repository.\n                public:\n                  type: boolean\n                  description: Configures access controls for the GitHub Pages site.\n                    If public is set to `true`, the site is accessible to anyone on\n                    the internet. If set to `false`, the site will only be accessible\n                    to users who have at least `read` access to the repository that\n                    published the site. This includes anyone in your Enterprise if\n                    the repository is set to `internal` visibility. This feature is\n                    only available to repositories in an organization on an Enterprise\n                    plan.\n                source:\n                  anyOf:\n                  - type: string\n                    description: Update the source for the repository. Must include\n                      the branch name, and may optionally specify the subdirectory\n                      `/docs`. Possible values are `\"gh-pages\"`, `\"master\"`, and `\"master\n                      /docs\"`.\n                    enum:\n                    - gh-pages\n                    - master\n                    - master /docs\n                  - type: object\n                    description: Update the source for the repository. Must include\n                      the branch name and path.\n                    properties:\n                      branch:\n                        type: string\n                        description: The repository branch used to publish your site's\n                          source files.\n                      path:\n                        type: string\n                        description: The repository directory that includes the source\n                          files for the Pages site. Allowed paths are `/` or `/docs`.\n                        enum:\n                        - \"/\"\n                        - \"/docs\"\n                    required:\n                    - branch\n                    - path\n              anyOf:\n              - required:\n                - source\n              - required:\n                - cname\n              - required:\n                - public\n              - required:\n                - https_enforced\n            example:\n              cname: octocatblog.com\n              source:\n                branch: main\n                path: \"/\"\n      responses:\n        '204':\n          description: Response\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '400':\n          \"$ref\": \"#/components/responses/bad_request\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: pages\n    delete:\n      summary: Delete a GitHub Enterprise Server Pages site\n      description: ''\n      tags:\n      - repos\n      operationId: repos/delete-pages-site\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-github-pages-site\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: pages\n        previews:\n        - required: true\n          name: switcheroo\n          note: |-\n            Enabling and disabling Pages in the Pages API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-03-14-enabling-disabling-pages/) preview for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.switcheroo-preview+json\n            ```\n  \"/repos/{owner}/{repo}/pages/builds\":\n    get:\n      summary: List GitHub Enterprise Server Pages builds\n      description: ''\n      tags:\n      - repos\n      operationId: repos/list-pages-builds\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-github-pages-builds\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/page-build\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/page-build-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: pages\n    post:\n      summary: Request a GitHub Enterprise Server Pages build\n      description: |-\n        You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.\n\n        Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.\n      tags:\n      - repos\n      operationId: repos/request-pages-build\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#request-a-github-pages-build\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/page-build-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/page-build-status\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: pages\n  \"/repos/{owner}/{repo}/pages/builds/latest\":\n    get:\n      summary: Get latest Pages build\n      description: ''\n      tags:\n      - repos\n      operationId: repos/get-latest-pages-build\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-latest-pages-build\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/page-build\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/page-build\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: pages\n  \"/repos/{owner}/{repo}/pages/builds/{build_id}\":\n    get:\n      summary: Get GitHub Enterprise Server Pages build\n      description: ''\n      tags:\n      - repos\n      operationId: repos/get-pages-build\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-github-pages-build\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: build_id\n        in: path\n        required: true\n        schema:\n          type: integer\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/page-build\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/page-build\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: pages\n  \"/repos/{owner}/{repo}/pre-receive-hooks\":\n    get:\n      summary: List pre-receive hooks for a repository\n      description: List all pre-receive hooks that are enabled or testing for this\n        repository as well as any disabled hooks that are allowed to be enabled at\n        the repository level. Pre-receive hooks that are disabled at a higher level\n        and are not configurable will not be listed.\n      operationId: enterprise-admin/list-pre-receive-hooks-for-repo\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#list-pre-receive-hooks-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - name: sort\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - name\n          default: created\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/repository-pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-pre-receive-hook-items\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: enterprise-admin\n        subcategory: repo-pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}\":\n    get:\n      summary: Get a pre-receive hook for a repository\n      description: ''\n      operationId: enterprise-admin/get-pre-receive-hook-for-repo\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-a-pre-receive-hook-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository-pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-pre-receive-hook\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: enterprise-admin\n        subcategory: repo-pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    patch:\n      summary: Update pre-receive hook enforcement for a repository\n      description: For pre-receive hooks which are allowed to be configured at the\n        repo level, you can set `enforcement`\n      operationId: enterprise-admin/update-pre-receive-hook-enforcement-for-repo\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#update-pre-receive-hook-enforcement-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository-pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-pre-receive-hook-2\"\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                enforcement:\n                  description: The state of enforcement for the hook on this repository.\n                  type: string\n                  enum:\n                  - enabled\n                  - disabled\n                  - testing\n            example:\n              enforcement: enabled\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: enterprise-admin\n        subcategory: repo-pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n    delete:\n      summary: Remove pre-receive hook enforcement for a repository\n      description: |-\n        Deletes any overridden enforcement on this repository for the specified hook.\n\n        Responds with effective values inherited from owner and/or global level.\n      operationId: enterprise-admin/remove-pre-receive-hook-enforcement-for-repo\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#remove-pre-receive-hook-enforcement-for-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pre-receive-hook-id\"\n      responses:\n        '200':\n          description: Responds with effective values inherited from owner and/or\n            global level.\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository-pre-receive-hook\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-pre-receive-hook\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: enterprise-admin\n        subcategory: repo-pre-receive-hooks\n        previews:\n        - required: true\n          name: eye-scream\n          note: |-\n            APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\n            To access the API you must provide a custom [media type](/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.eye-scream-preview\n            ```\n  \"/repos/{owner}/{repo}/projects\":\n    get:\n      summary: List repository projects\n      description: Lists the projects in a repository. Returns a `404 Not Found` status\n        if projects are disabled in the repository. If you do not have sufficient\n        privileges to perform this action, a `401 Unauthorized` or `410 Gone` status\n        is returned.\n      tags:\n      - projects\n      operationId: projects/list-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-repository-projects\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: state\n        description: Indicates the state of the projects to return. Can be either\n          `open`, `closed`, or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-items-2\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n    post:\n      summary: Create a repository project\n      description: Creates a repository project board. Returns a `404 Not Found` status\n        if projects are disabled in the repository. If you do not have sufficient\n        privileges to perform this action, a `401 Unauthorized` or `410 Gone` status\n        is returned.\n      tags:\n      - projects\n      operationId: projects/create-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-a-repository-project\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the project.\n                body:\n                  type: string\n                  description: The description of the project.\n              required:\n              - name\n            example:\n              name: Projects Documentation\n              body: Developer documentation project for the developer site.\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-3\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '410':\n          \"$ref\": \"#/components/responses/gone\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/repos/{owner}/{repo}/pulls\":\n    get:\n      summary: List pull requests\n      description: Draft pull requests are available in public repositories with GitHub\n        Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository\n        billing plans, and in public and private repositories with GitHub Team and\n        GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)\n        in the GitHub Help documentation.\n      tags:\n      - pulls\n      operationId: pulls/list\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: state\n        description: Either `open`, `closed`, or `all` to filter by state.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - name: head\n        description: 'Filter pulls by head user or head organization and branch name\n          in the format of `user:ref-name` or `organization:ref-name`. For example:\n          `github:new-script-format` or `octocat:test-branch`.'\n        in: query\n        required: false\n        schema:\n          type: string\n      - name: base\n        description: 'Filter pulls by base branch name. Example: `gh-pages`.'\n        in: query\n        required: false\n        schema:\n          type: string\n      - name: sort\n        description: What to sort results by. Can be either `created`, `updated`,\n          `popularity` (comment count) or `long-running` (age, filtering by pulls\n          updated in the last month).\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - popularity\n          - long-running\n          default: created\n      - name: direction\n        description: 'The direction of the sort. Can be either `asc` or `desc`. Default:\n          `desc` when sort is `created` or sort is not specified, otherwise `asc`.'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - asc\n          - desc\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/pull-request-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-simple-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: \n    post:\n      summary: Create a pull request\n      description: |-\n        Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.\n\n        You can create a new pull request.\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)\" for details.\n      tags:\n      - pulls\n      operationId: pulls/create\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: The title of the new pull request.\n                head:\n                  type: string\n                  description: 'The name of the branch where your changes are implemented.\n                    For cross-repository pull requests in the same network, namespace\n                    `head` with a user like this: `username:branch`.'\n                base:\n                  type: string\n                  description: The name of the branch you want the changes pulled\n                    into. This should be an existing branch on the current repository.\n                    You cannot submit a pull request to one repository that requests\n                    a merge to a base of another repository.\n                body:\n                  type: string\n                  description: The contents of the pull request.\n                maintainer_can_modify:\n                  type: boolean\n                  description: Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/)\n                    the pull request.\n                draft:\n                  type: boolean\n                  description: Indicates whether the pull request is a draft. See\n                    \"[Draft Pull Requests](https://docs.github.com/en/articles/about-pull-requests#draft-pull-requests)\"\n                    in the GitHub Help documentation to learn more.\n                issue:\n                  type: integer\n                  examples:\n                  - 1\n              required:\n              - head\n              - base\n            example:\n              title: Amazing new feature\n              body: Please pull these awesome changes in!\n              head: octocat:new-feature\n              base: master\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n              schema:\n                type: string\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: \n  \"/repos/{owner}/{repo}/pulls/comments\":\n    get:\n      summary: List review comments in a repository\n      description: Lists review comments for all pull requests in a repository. By\n        default, review comments are in ascending order by ID.\n      tags:\n      - pulls\n      operationId: pulls/list-review-comments-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-review-comments-in-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: sort\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - created_at\n      - name: direction\n        description: Can be either `asc` or `desc`. Ignored without `sort` parameter.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - asc\n          - desc\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n        - required: false\n          name: comfort-fade\n          note: |-\n            Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\n            To create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.comfort-fade-preview+json\n            ```\n\n            To show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\n            If you use the `comfort-fade` preview header, your response will show:\n\n            *   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n            *   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\n            If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n            *   For multi-line comments, the last line of the comment range for the `position` attribute.\n            *   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\n  \"/repos/{owner}/{repo}/pulls/comments/{comment_id}\":\n    get:\n      summary: Get a review comment for a pull request\n      description: Provides details for a review comment.\n      tags:\n      - pulls\n      operationId: pulls/get-review-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-review-comment-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-comment-2\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n        - required: false\n          name: comfort-fade\n          note: |-\n            Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\n            To create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.comfort-fade-preview+json\n            ```\n\n            To show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\n            If you use the `comfort-fade` preview header, your response will show:\n\n            *   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n            *   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\n            If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n            *   For multi-line comments, the last line of the comment range for the `position` attribute.\n            *   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\n    patch:\n      summary: Update a review comment for a pull request\n      description: Enables you to edit a review comment.\n      tags:\n      - pulls\n      operationId: pulls/update-review-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#update-a-review-comment-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The text of the reply to the review comment.\n              required:\n              - body\n            example:\n              body: I like this too!\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-comment-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: comments\n        previews:\n        - required: false\n          name: comfort-fade\n          note: |-\n            Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\n            To create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.comfort-fade-preview+json\n            ```\n\n            To show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\n            If you use the `comfort-fade` preview header, your response will show:\n\n            *   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n            *   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\n            If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n            *   For multi-line comments, the last line of the comment range for the `position` attribute.\n            *   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\n    delete:\n      summary: Delete a review comment for a pull request\n      description: Deletes a review comment.\n      tags:\n      - pulls\n      operationId: pulls/delete-review-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#delete-a-review-comment-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: comments\n  \"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\":\n    get:\n      summary: List reactions for a pull request review comment\n      description: List the reactions to a [pull request review comment](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#review-comments).\n      tags:\n      - reactions\n      operationId: reactions/list-for-pull-request-review-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-pull-request-review-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      - name: content\n        description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types).\n          Omit this parameter to list all reactions to a pull request review comment.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n    post:\n      summary: Create reaction for a pull request review comment\n      description: Create a reaction to a [pull request review comment](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#comments).\n        A response with an HTTP `200` status means that you already added the reaction\n        type to this pull request review comment.\n      tags:\n      - reactions\n      operationId: reactions/create-for-pull-request-review-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-pull-request-review-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types)\n                    to add to the pull request review comment.\n                  enum:\n                  - \"+1\"\n                  - \"-1\"\n                  - laugh\n                  - confused\n                  - heart\n                  - hooray\n                  - rocket\n                  - eyes\n              required:\n              - content\n            example:\n              content: heart\n      responses:\n        '200':\n          description: Reaction exists\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '201':\n          description: Reaction created\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\":\n    delete:\n      summary: Delete a pull request comment reaction\n      description: |-\n        **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`\n\n        Delete a reaction to a [pull request review comment](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#review-comments).\n      tags:\n      - reactions\n      operationId: reactions/delete-for-pull-request-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#delete-a-pull-request-comment-reaction\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      - \"$ref\": \"#/components/parameters/reaction-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/repos/{owner}/{repo}/pulls/{pull_number}\":\n    get:\n      summary: Get a pull request\n      description: |-\n        Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        Lists details of a pull request by providing its number.\n\n        When you get, [create](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#update-a-pull-request) a pull request, GitHub Enterprise Server creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see \"[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.0/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)\".\n\n        The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub Enterprise Server has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit.\n\n        The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:\n\n        *   If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit.\n        *   If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch.\n        *   If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.\n\n        Pass the appropriate [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.\n      tags:\n      - pulls\n      operationId: pulls/get\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      responses:\n        '200':\n          description: Pass the appropriate [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/#commits-commit-comparison-and-pull-requests)\n            to fetch diff and patch formats.\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '500':\n          \"$ref\": \"#/components/responses/internal_error\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: \n    patch:\n      summary: Update a pull request\n      description: |-\n        Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.\n      tags:\n      - pulls\n      operationId: pulls/update\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls/#update-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: The title of the pull request.\n                body:\n                  type: string\n                  description: The contents of the pull request.\n                state:\n                  type: string\n                  description: State of this Pull Request. Either `open` or `closed`.\n                  enum:\n                  - open\n                  - closed\n                base:\n                  type: string\n                  description: The name of the branch you want your changes pulled\n                    into. This should be an existing branch on the current repository.\n                    You cannot update the base branch on a pull request to point to\n                    another repository.\n                maintainer_can_modify:\n                  type: boolean\n                  description: Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/)\n                    the pull request.\n            example:\n              title: new title\n              body: updated body\n              state: open\n              base: master\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: \n  \"/repos/{owner}/{repo}/pulls/{pull_number}/comments\":\n    get:\n      summary: List review comments on a pull request\n      description: Lists all review comments for a pull request. By default, review\n        comments are in ascending order by ID.\n      tags:\n      - pulls\n      operationId: pulls/list-review-comments\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-review-comments-on-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/sort\"\n      - name: direction\n        description: Can be either `asc` or `desc`. Ignored without `sort` parameter.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - asc\n          - desc\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n        - required: false\n          name: comfort-fade\n          note: |-\n            Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\n            To create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.comfort-fade-preview+json\n            ```\n\n            To show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\n            If you use the `comfort-fade` preview header, your response will show:\n\n            *   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n            *   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\n            If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n            *   For multi-line comments, the last line of the comment range for the `position` attribute.\n            *   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\n    post:\n      summary: Create a review comment for a pull request\n      description: |2-\n\n        Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see \"[Create an issue comment](https://docs.github.com/enterprise-server@3.0/rest/reference/issues#create-an-issue-comment).\" We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff.\n\n        You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices).\n\n        **Note:** The position value equals the number of lines down from the first \"@@\" hunk header in the file you want to add a comment. The line just below the \"@@\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n      tags:\n      - pulls\n      operationId: pulls/create-review-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-review-comment-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The text of the review comment.\n                commit_id:\n                  type: string\n                  description: The SHA of the commit needing a comment. Not using\n                    the latest commit SHA may render your comment outdated if a subsequent\n                    commit modifies the line you specify as the `position`.\n                path:\n                  type: string\n                  description: The relative path to the file that necessitates a comment.\n                position:\n                  type: integer\n                  description: \"**Required without `comfort-fade` preview**. The position\n                    in the diff where you want to add a review comment. Note this\n                    value is not the same as the line number in the file. For help\n                    finding the position value, read the note above.\"\n                side:\n                  type: string\n                  description: '**Required with `comfort-fade` preview**. In a split\n                    diff view, the side of the diff that the pull request''s changes\n                    appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions\n                    that appear in red. Use `RIGHT` for additions that appear in green\n                    or unchanged lines that appear in white and are shown for context.\n                    For a multi-line comment, side represents whether the last line\n                    of the comment range is a deletion or addition. For more information,\n                    see \"[Diff view options](https://docs.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)\"\n                    in the GitHub Help documentation.'\n                  enum:\n                  - LEFT\n                  - RIGHT\n                line:\n                  type: integer\n                  description: \"**Required with `comfort-fade` preview**. The line\n                    of the blob in the pull request diff that the comment applies\n                    to. For a multi-line comment, the last line of the range that\n                    your comment applies to.\"\n                start_line:\n                  type: integer\n                  description: '**Required when using multi-line comments**. To create\n                    multi-line comments, you must use the `comfort-fade` preview header.\n                    The `start_line` is the first line in the pull request diff that\n                    your multi-line comment applies to. To learn more about multi-line\n                    comments, see \"[Commenting on a pull request](https://docs.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)\"\n                    in the GitHub Help documentation.'\n                start_side:\n                  type: string\n                  description: '**Required when using multi-line comments**. To create\n                    multi-line comments, you must use the `comfort-fade` preview header.\n                    The `start_side` is the starting side of the diff that the comment\n                    applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line\n                    comments, see \"[Commenting on a pull request](https://docs.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)\"\n                    in the GitHub Help documentation. See `side` in this table for\n                    additional context.'\n                  enum:\n                  - LEFT\n                  - RIGHT\n                  - side\n                in_reply_to:\n                  type: integer\n                  description: The ID of the review comment to reply to. To find the\n                    ID of a review comment with [\"List review comments on a pull request\"](#list-review-comments-on-a-pull-request).\n                    When specified, all parameters other than `body` in the request\n                    body are ignored.\n                  examples:\n                  - 2\n              required:\n              - body\n            examples:\n              example-for-a-single-line-comment:\n                summary: Example for a single-line comment\n                value:\n                  body: Let's add this deleted line back.\n                  commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n                  path: file1.txt\n                  line: 5\n                  side: LEFT\n              example-for-a-multi-line-comment:\n                summary: Example for a multi-line comment\n                value:\n                  body: Great stuff!\n                  commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n                  path: file1.txt\n                  start_line: 1\n                  start_side: RIGHT\n                  line: 2\n                  side: RIGHT\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n              examples:\n                example-for-a-multi-line-comment:\n                  \"$ref\": \"#/components/examples/pull-request-review-comment-example-for-a-multi-line-comment\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: comments\n        previews:\n        - required: false\n          name: comfort-fade\n          note: |-\n            Multi-line comments in a pull request diff is currently available for developers to preview. During the preview period, these response fields may change without advance notice. See the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for more information.\n\n            To create multi-line comments or see multi-line comments with the new supported fields during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.comfort-fade-preview+json\n            ```\n\n            To show multi-line comment-supported fields in the response, use the `comfort-fade` preview header and the `line` parameter.\n\n            If you use the `comfort-fade` preview header, your response will show:\n\n            *   For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`.\n            *   For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`.\n\n            If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show:\n\n            *   For multi-line comments, the last line of the comment range for the `position` attribute.\n            *   For single-line comments, the diff-positioned way of referencing comments for the `position` attribute.\n  \"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\":\n    post:\n      summary: Create a reply for a review comment\n      description: |-\n        Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n      tags:\n      - pulls\n      operationId: pulls/create-reply-for-review-comment\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-reply-for-a-review-comment\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/comment-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The text of the review comment.\n              required:\n              - body\n            example:\n              body: Great stuff!\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-comment\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n              schema:\n                type: string\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: pulls\n        subcategory: comments\n  \"/repos/{owner}/{repo}/pulls/{pull_number}/commits\":\n    get:\n      summary: List commits on a pull request\n      description: Lists a maximum of 250 commits for a pull request. To receive a\n        complete commit list for pull requests with more than 250 commits, use the\n        [List commits](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commits)\n        endpoint.\n      tags:\n      - pulls\n      operationId: pulls/list-commits\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-commits-on-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/commit\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: \n  \"/repos/{owner}/{repo}/pulls/{pull_number}/files\":\n    get:\n      summary: List pull requests files\n      description: \"**Note:** Responses include a maximum of 3000 files. The paginated\n        response returns 30 files per page by default.\"\n      tags:\n      - pulls\n      operationId: pulls/list-files\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests-files\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/diff-entry\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/diff-entry-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '500':\n          \"$ref\": \"#/components/responses/internal_error\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: \n  \"/repos/{owner}/{repo}/pulls/{pull_number}/merge\":\n    get:\n      summary: Check if a pull request has been merged\n      description: ''\n      tags:\n      - pulls\n      operationId: pulls/check-if-merged\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#check-if-a-pull-request-has-been-merged\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      responses:\n        '204':\n          description: Response if pull request has been merged\n        '404':\n          description: Not Found if pull request has not been merged\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: \n    put:\n      summary: Merge a pull request\n      description: This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/github/managing-subscriptions-and-notifications-on-github/about-notifications).\n        Creating content too quickly using this endpoint may result in secondary rate\n        limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\"\n        and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\"\n        for details.\n      tags:\n      - pulls\n      operationId: pulls/merge\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#merge-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                commit_title:\n                  type: string\n                  description: Title for the automatic commit message.\n                commit_message:\n                  type: string\n                  description: Extra detail to append to automatic commit message.\n                sha:\n                  type: string\n                  description: SHA that pull request head must match to allow merge.\n                merge_method:\n                  type: string\n                  description: Merge method to use. Possible values are `merge`, `squash`\n                    or `rebase`. Default is `merge`.\n                  enum:\n                  - merge\n                  - squash\n                  - rebase\n      responses:\n        '200':\n          description: if merge was successful\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-merge-result\"\n              examples:\n                response-if-merge-was-successful:\n                  \"$ref\": \"#/components/examples/pull-request-merge-result-response-if-merge-was-successful\"\n        '405':\n          description: Method Not Allowed if merge cannot be performed\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n              examples:\n                response-if-merge-cannot-be-performed:\n                  value:\n                    message: Pull Request is not mergeable\n        '409':\n          description: Conflict if sha was provided and pull request head did not\n            match\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n              examples:\n                response-if-sha-was-provided-and-pull-request-head-did-not-match:\n                  value:\n                    message: Head branch was modified. Review and try the merge again.\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: \n  \"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\":\n    get:\n      summary: List requested reviewers for a pull request\n      description: ''\n      tags:\n      - pulls\n      operationId: pulls/list-requested-reviewers\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-requested-reviewers-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review-request\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-pull-request-review-request\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: review-requests\n    post:\n      summary: Request reviewers for a pull request\n      description: This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.0/github/managing-subscriptions-and-notifications-on-github/about-notifications).\n        Creating content too quickly using this endpoint may result in secondary rate\n        limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\"\n        and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\"\n        for details.\n      tags:\n      - pulls\n      operationId: pulls/request-reviewers\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#request-reviewers-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                reviewers:\n                  type: array\n                  description: An array of user `login`s that will be requested.\n                  items:\n                    type: string\n                team_reviewers:\n                  type: array\n                  description: An array of team `slug`s that will be requested.\n                  items:\n                    type: string\n              anyOf:\n              - required:\n                - reviewers\n              - required:\n                - team_reviewers\n            example:\n              reviewers:\n              - octocat\n              - hubot\n              - other_user\n              team_reviewers:\n              - justice-league\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-request\"\n        '422':\n          description: Unprocessable Entity if user is not a collaborator\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: review-requests\n    delete:\n      summary: Remove requested reviewers from a pull request\n      description: ''\n      tags:\n      - pulls\n      operationId: pulls/remove-requested-reviewers\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#remove-requested-reviewers-from-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                reviewers:\n                  type: array\n                  description: An array of user `login`s that will be removed.\n                  items:\n                    type: string\n                team_reviewers:\n                  type: array\n                  description: An array of team `slug`s that will be removed.\n                  items:\n                    type: string\n              required:\n              - reviewers\n            example:\n              reviewers:\n              - octocat\n              - hubot\n              - other_user\n              team_reviewers:\n              - justice-league\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-simple\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: review-requests\n  \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews\":\n    get:\n      summary: List reviews for a pull request\n      description: The list of reviews returns in chronological order.\n      tags:\n      - pulls\n      operationId: pulls/list-reviews\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-reviews-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: The list of reviews returns in chronological order.\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: reviews\n    post:\n      summary: Create a review for a pull request\n      description: |-\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n\n        Pull request reviews created in the `PENDING` state do not include the `submitted_at` property in the response.\n\n        **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the `application/vnd.github.v3.diff` [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the `Accept` header of a call to the [single pull request](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-pull-request) endpoint.\n\n        The `position` value equals the number of lines down from the first \"@@\" hunk header in the file you want to add a comment. The line just below the \"@@\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.\n      tags:\n      - pulls\n      operationId: pulls/create-review\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#create-a-review-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                commit_id:\n                  type: string\n                  description: The SHA of the commit that needs a review. Not using\n                    the latest commit SHA may render your review comment outdated\n                    if a subsequent commit modifies the line you specify as the `position`.\n                    Defaults to the most recent commit in the pull request when you\n                    do not specify a value.\n                body:\n                  type: string\n                  description: \"**Required** when using `REQUEST_CHANGES` or `COMMENT`\n                    for the `event` parameter. The body text of the pull request review.\"\n                event:\n                  type: string\n                  description: 'The review action you want to perform. The review\n                    actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By\n                    leaving this blank, you set the review action state to `PENDING`,\n                    which means you will need to [submit the pull request review](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#submit-a-review-for-a-pull-request)\n                    when you are ready.'\n                  enum:\n                  - APPROVE\n                  - REQUEST_CHANGES\n                  - COMMENT\n                comments:\n                  type: array\n                  description: Use the following table to specify the location, destination,\n                    and contents of the draft review comment.\n                  items:\n                    type: object\n                    properties:\n                      path:\n                        type: string\n                        description: The relative path to the file that necessitates\n                          a review comment.\n                      position:\n                        type: integer\n                        description: The position in the diff where you want to add\n                          a review comment. Note this value is not the same as the\n                          line number in the file. For help finding the position value,\n                          read the note below.\n                      body:\n                        type: string\n                        description: Text of the review comment.\n                      line:\n                        type: integer\n                        examples:\n                        - 28\n                      side:\n                        type: string\n                        examples:\n                        - RIGHT\n                      start_line:\n                        type: integer\n                        examples:\n                        - 26\n                      start_side:\n                        type: string\n                        examples:\n                        - LEFT\n                    required:\n                    - path\n                    - body\n            example:\n              commit_id: ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\n              body: This is close to perfect! Please address the suggested inline\n                change.\n              event: REQUEST_CHANGES\n              comments:\n              - path: file.md\n                position: 6\n                body: Please add more information here, and fix this typo.\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: reviews\n  \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\":\n    get:\n      summary: Get a review for a pull request\n      description: ''\n      tags:\n      - pulls\n      operationId: pulls/get-review\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#get-a-review-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/review-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-4\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: reviews\n    put:\n      summary: Update a review for a pull request\n      description: Update the review summary comment with new text.\n      tags:\n      - pulls\n      operationId: pulls/update-review\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#update-a-review-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/review-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The body text of the pull request review.\n              required:\n              - body\n            example:\n              body: This is close to perfect! Please address the suggested inline\n                change. And add more about this.\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-5\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: reviews\n    delete:\n      summary: Delete a pending review for a pull request\n      description: ''\n      tags:\n      - pulls\n      operationId: pulls/delete-pending-review\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#delete-a-pending-review-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/review-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: reviews\n  \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\":\n    get:\n      summary: List comments for a pull request review\n      description: List comments for a specific pull request review.\n      tags:\n      - pulls\n      operationId: pulls/list-comments-for-review\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-comments-for-a-pull-request-review\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/review-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/review-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/review-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: reviews\n  \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\":\n    put:\n      summary: Dismiss a review for a pull request\n      description: \"**Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#branches),\n        you must be a repository administrator or be included in the list of people\n        or teams who can dismiss pull request reviews.\"\n      tags:\n      - pulls\n      operationId: pulls/dismiss-review\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#dismiss-a-review-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/review-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                message:\n                  type: string\n                  description: The message for the pull request review dismissal\n                event:\n                  type: string\n                  examples:\n                  - '\"APPROVE\"'\n              required:\n              - message\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-3\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: reviews\n  \"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\":\n    post:\n      summary: Submit a review for a pull request\n      description: ''\n      tags:\n      - pulls\n      operationId: pulls/submit-review\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#submit-a-review-for-a-pull-request\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      - \"$ref\": \"#/components/parameters/review-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The body text of the pull request review\n                event:\n                  type: string\n                  description: 'The review action you want to perform. The review\n                    actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When\n                    you leave this blank, the API returns _HTTP 422 (Unrecognizable\n                    entity)_ and sets the review action state to `PENDING`, which\n                    means you will need to re-submit the pull request review using\n                    a review action.'\n                  enum:\n                  - APPROVE\n                  - REQUEST_CHANGES\n                  - COMMENT\n              required:\n              - event\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/pull-request-review\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/pull-request-review-4\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: pulls\n        subcategory: reviews\n  \"/repos/{owner}/{repo}/pulls/{pull_number}/update-branch\":\n    put:\n      summary: Update a pull request branch\n      description: Updates the pull request branch with the latest upstream changes\n        by merging HEAD from the base branch into the pull request branch.\n      tags:\n      - pulls\n      operationId: pulls/update-branch\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#update-a-pull-request-branch\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/pull-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                expected_head_sha:\n                  type: string\n                  description: 'The expected SHA of the pull request''s HEAD ref.\n                    This is the most recent commit on the pull request''s branch.\n                    If the expected SHA does not match the pull request''s HEAD, you\n                    will receive a `422 Unprocessable Entity` status. You can use\n                    the \"[List commits](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-commits)\"\n                    endpoint to find the most recent commit SHA. Default: SHA of the\n                    pull request''s current HEAD ref.'\n            example:\n              expected_head_sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  url:\n                    type: string\n              example:\n                message: Updating pull request branch.\n                url: https://github.com/repos/octocat/Hello-World/pulls/53\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: pulls\n        previews:\n        - required: true\n          name: lydian\n          note: |-\n            Updating the pull request branch with latest upstream changes is currently available for developers to preview. To access this new endpoint during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.lydian-preview+json\n            ```\n  \"/repos/{owner}/{repo}/readme\":\n    get:\n      summary: Get a repository README\n      description: |-\n        Gets the preferred README for a repository.\n\n        READMEs support [custom media types](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML.\n      tags:\n      - repos\n      operationId: repos/get-readme\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository-readme\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        description: 'The name of the commit/branch/tag. Default: the repository’s\n          default branch (usually `master`)'\n        in: query\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/content-file\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/content-file\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: contents\n  \"/repos/{owner}/{repo}/readme/{dir}\":\n    get:\n      summary: Get a repository README for a directory\n      description: |-\n        Gets the README from a repository directory.\n\n        READMEs support [custom media types](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML.\n      tags:\n      - repos\n      operationId: repos/get-readme-in-directory\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository-directory-readme\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: dir\n        description: The alternate path to look for a README file\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      - name: ref\n        description: 'The name of the commit/branch/tag. Default: the repository’s\n          default branch (usually `master`)'\n        in: query\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/content-file\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/content-file\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: contents\n  \"/repos/{owner}/{repo}/releases\":\n    get:\n      summary: List releases\n      description: |-\n        This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-tags).\n\n        Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.\n      tags:\n      - repos\n      operationId: repos/list-releases\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-releases\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/release\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n    post:\n      summary: Create a release\n      description: |-\n        Users with push access to the repository can create a release.\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n      tags:\n      - repos\n      operationId: repos/create-release\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-release\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                tag_name:\n                  type: string\n                  description: The name of the tag.\n                target_commitish:\n                  type: string\n                  description: 'Specifies the commitish value that determines where\n                    the Git tag is created from. Can be any branch or commit SHA.\n                    Unused if the Git tag already exists. Default: the repository''s\n                    default branch (usually `master`).'\n                name:\n                  type: string\n                  description: The name of the release.\n                body:\n                  type: string\n                  description: Text describing the contents of the tag.\n                draft:\n                  type: boolean\n                  description: \"`true` to create a draft (unpublished) release, `false`\n                    to create a published one.\"\n                  default: false\n                prerelease:\n                  type: boolean\n                  description: \"`true` to identify the release as a prerelease. `false`\n                    to identify the release as a full release.\"\n                  default: false\n              required:\n              - tag_name\n            example:\n              tag_name: v1.0.0\n              target_commitish: master\n              name: v1.0.0\n              body: Description of the release\n              draft: false\n              prerelease: false\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/release\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/releases/1\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n  \"/repos/{owner}/{repo}/releases/assets/{asset_id}\":\n    get:\n      summary: Get a release asset\n      description: To download the asset's binary content, set the `Accept` header\n        of the request to [`application/octet-stream`](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types).\n        The API will either redirect the client to the location, or stream it directly\n        if possible. API clients should handle both a `200` or `302` response.\n      tags:\n      - repos\n      operationId: repos/get-release-asset\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-release-asset\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/asset-id\"\n      responses:\n        '200':\n          description: To download the asset's binary content, set the `Accept` header\n            of the request to [`application/octet-stream`](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types).\n            The API will either redirect the client to the location, or stream it\n            directly if possible. API clients should handle both a `200` or `302`\n            response.\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/release-asset\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release-asset\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n        '302':\n          \"$ref\": \"#/components/responses/found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n    patch:\n      summary: Update a release asset\n      description: Users with push access to the repository can edit a release asset.\n      tags:\n      - repos\n      operationId: repos/update-release-asset\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-release-asset\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/asset-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The file name of the asset.\n                label:\n                  type: string\n                  description: An alternate short description of the asset. Used in\n                    place of the filename.\n                state:\n                  type: string\n                  examples:\n                  - '\"uploaded\"'\n            example:\n              name: foo-1.0.0-osx.zip\n              label: Mac binary\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/release-asset\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release-asset\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n    delete:\n      summary: Delete a release asset\n      description: ''\n      tags:\n      - repos\n      operationId: repos/delete-release-asset\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-release-asset\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/asset-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n  \"/repos/{owner}/{repo}/releases/latest\":\n    get:\n      summary: Get the latest release\n      description: |-\n        View the latest published full release for the repository.\n\n        The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published.\n      tags:\n      - repos\n      operationId: repos/get-latest-release\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-latest-release\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/release\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n  \"/repos/{owner}/{repo}/releases/tags/{tag}\":\n    get:\n      summary: Get a release by tag name\n      description: Get a published release with the specified tag.\n      tags:\n      - repos\n      operationId: repos/get-release-by-tag\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-release-by-tag-name\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: tag\n        description: tag parameter\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/release\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n  \"/repos/{owner}/{repo}/releases/{release_id}\":\n    get:\n      summary: Get a release\n      description: \"**Note:** This returns an `upload_url` key corresponding to the\n        endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#hypermedia).\"\n      tags:\n      - repos\n      operationId: repos/get-release\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-release\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/release-id\"\n      responses:\n        '200':\n          description: \"**Note:** This returns an `upload_url` key corresponding to\n            the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#hypermedia).\"\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/release\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n    patch:\n      summary: Update a release\n      description: Users with push access to the repository can edit a release.\n      tags:\n      - repos\n      operationId: repos/update-release\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#update-a-release\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/release-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                tag_name:\n                  type: string\n                  description: The name of the tag.\n                target_commitish:\n                  type: string\n                  description: 'Specifies the commitish value that determines where\n                    the Git tag is created from. Can be any branch or commit SHA.\n                    Unused if the Git tag already exists. Default: the repository''s\n                    default branch (usually `master`).'\n                name:\n                  type: string\n                  description: The name of the release.\n                body:\n                  type: string\n                  description: Text describing the contents of the tag.\n                draft:\n                  type: boolean\n                  description: \"`true` makes the release a draft, and `false` publishes\n                    the release.\"\n                prerelease:\n                  type: boolean\n                  description: \"`true` to identify the release as a prerelease, `false`\n                    to identify the release as a full release.\"\n            example:\n              tag_name: v1.0.0\n              target_commitish: master\n              name: v1.0.0\n              body: Description of the release\n              draft: false\n              prerelease: false\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/release\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n    delete:\n      summary: Delete a release\n      description: Users with push access to the repository can delete a release.\n      tags:\n      - repos\n      operationId: repos/delete-release\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#delete-a-release\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/release-id\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n  \"/repos/{owner}/{repo}/releases/{release_id}/assets\":\n    get:\n      summary: List release assets\n      description: ''\n      tags:\n      - repos\n      operationId: repos/list-release-assets\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-release-assets\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/release-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/release-asset\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/release-asset-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n    post:\n      summary: Upload a release asset\n      description: \"This endpoint makes use of [a Hypermedia relation](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#hypermedia)\n        to determine which URL to access. The endpoint you call to upload release\n        assets is specific to your release. Use the `upload_url` returned in\\nthe\n        response of the [Create a release endpoint](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-release)\n        to upload a release asset.\\n\\nYou need to use an HTTP client which supports\n        [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to\n        this endpoint.\\n\\nMost libraries will set the required `Content-Length` header\n        automatically. Use the required `Content-Type` header to provide the media\n        type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml).\n        For example: \\n\\n`application/zip`\\n\\nGitHub Enterprise Server expects the\n        asset data in its raw binary form, rather than JSON. You will send the raw\n        binary content of the asset as the request body. Everything else about the\n        endpoint is the same as the rest of the API. For example,\\nyou'll still need\n        to pass your authentication to be able to upload an asset.\\n\\nWhen an upstream\n        failure occurs, you will receive a `502 Bad Gateway` status. This may leave\n        an empty asset with a state of `starter`. It can be safely deleted.\\n\\n**Notes:**\\n*\n        \\  GitHub Enterprise Server renames asset filenames that have special characters,\n        non-alphanumeric characters, and leading or trailing periods. The \\\"[List\n        assets for a release](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-assets-for-a-release)\\\"\\nendpoint\n        lists the renamed filenames. For more information and help, contact [GitHub\n        Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).\\n*\n        \\  If you upload an asset with the same filename as another uploaded asset,\n        you'll receive an error and must delete the old file before you can re-upload\n        the new asset.\"\n      tags:\n      - repos\n      operationId: repos/upload-release-asset\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#upload-a-release-asset\n      servers:\n      - url: \"{origin}\"\n        variables:\n          origin:\n            default: https://uploads.github.com\n            description: The URL origin (protocol + host name + port) is included\n              in `upload_url` returned in the response of the \"Create a release\" endpoint\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/release-id\"\n      - name: name\n        in: query\n        required: true\n        schema:\n          type: string\n      - name: label\n        in: query\n        schema:\n          type: string\n      requestBody:\n        required: false\n        content:\n          \"*/*\":\n            schema:\n              type: string\n              description: The raw file data\n      responses:\n        '201':\n          description: Response for successful upload\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/release-asset\"\n              examples:\n                response-for-successful-upload:\n                  \"$ref\": \"#/components/examples/release-asset-response-for-successful-upload\"\n        '422':\n          description: Response if you upload an asset with the same filename as another\n            uploaded asset\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: releases\n  \"/repos/{owner}/{repo}/stargazers\":\n    get:\n      summary: List stargazers\n      description: |-\n        Lists the people that have starred the repository.\n\n        You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `Accept` header:\n      tags:\n      - activity\n      operationId: activity/list-stargazers-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-stargazers\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                anyOf:\n                - type: array\n                  items:\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                - type: array\n                  items:\n                    \"$ref\": \"#/components/schemas/stargazer\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/simple-user-items-default-response\"\n                alternative-response-with-star-creation-timestamps:\n                  \"$ref\": \"#/components/examples/stargazer-items-alternative-response-with-star-creation-timestamps\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: starring\n  \"/repos/{owner}/{repo}/stats/code_frequency\":\n    get:\n      summary: Get the weekly commit activity\n      description: Returns a weekly aggregate of the number of additions and deletions\n        pushed to a repository.\n      tags:\n      - repos\n      operationId: repos/get-code-frequency-stats\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-weekly-commit-activity\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Returns a weekly aggregate of the number of additions and deletions\n            pushed to a repository.\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/code-frequency-stat\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-frequency-stat-items\"\n        '202':\n          \"$ref\": \"#/components/responses/accepted\"\n        '204':\n          \"$ref\": \"#/components/responses/no_content\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: statistics\n  \"/repos/{owner}/{repo}/stats/commit_activity\":\n    get:\n      summary: Get the last year of commit activity\n      description: Returns the last year of commit activity grouped by week. The `days`\n        array is a group of commits per day, starting on `Sunday`.\n      tags:\n      - repos\n      operationId: repos/get-commit-activity-stats\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-last-year-of-commit-activity\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/commit-activity\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-activity-items\"\n        '202':\n          \"$ref\": \"#/components/responses/accepted\"\n        '204':\n          \"$ref\": \"#/components/responses/no_content\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: statistics\n  \"/repos/{owner}/{repo}/stats/contributors\":\n    get:\n      summary: Get all contributor commit activity\n      description: |2-\n\n        Returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information:\n\n        *   `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time).\n        *   `a` - Number of additions\n        *   `d` - Number of deletions\n        *   `c` - Number of commits\n      tags:\n      - repos\n      operationId: repos/get-contributors-stats\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-all-contributor-commit-activity\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: |-\n            *   `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time).\n            *   `a` - Number of additions\n            *   `d` - Number of deletions\n            *   `c` - Number of commits\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/contributor-activity\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/contributor-activity-items\"\n        '202':\n          \"$ref\": \"#/components/responses/accepted\"\n        '204':\n          \"$ref\": \"#/components/responses/no_content\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: statistics\n  \"/repos/{owner}/{repo}/stats/participation\":\n    get:\n      summary: Get the weekly commit count\n      description: |-\n        Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.\n\n        The array order is oldest week (index 0) to most recent week.\n      tags:\n      - repos\n      operationId: repos/get-participation-stats\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-weekly-commit-count\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: The array order is oldest week (index 0) to most recent week.\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/participation-stats\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/participation-stats\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: statistics\n  \"/repos/{owner}/{repo}/stats/punch_card\":\n    get:\n      summary: Get the hourly commit count for each day\n      description: |-\n        Each array contains the day number, hour number, and number of commits:\n\n        *   `0-6`: Sunday - Saturday\n        *   `0-23`: Hour of day\n        *   Number of commits\n\n        For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.\n      tags:\n      - repos\n      operationId: repos/get-punch-card-stats\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-the-hourly-commit-count-for-each-day\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: For example, `[2, 14, 25]` indicates that there were 25 total\n            commits, during the 2:00pm hour on Tuesdays. All times are based on the\n            time zone of individual commits.\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/code-frequency-stat\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-frequency-stat-items-2\"\n        '204':\n          \"$ref\": \"#/components/responses/no_content\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: statistics\n  \"/repos/{owner}/{repo}/statuses/{sha}\":\n    post:\n      summary: Create a commit status\n      description: |-\n        Users with push access in a repository can create commit statuses for a given SHA.\n\n        Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error.\n      tags:\n      - repos\n      operationId: repos/create-commit-status\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-commit-status\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: sha\n        in: path\n        required: true\n        schema:\n          type: string\n        x-multi-segment: true\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                state:\n                  type: string\n                  description: The state of the status. Can be one of `error`, `failure`,\n                    `pending`, or `success`.\n                  enum:\n                  - error\n                  - failure\n                  - pending\n                  - success\n                target_url:\n                  type: string\n                  description: \"The target URL to associate with this status. This\n                    URL will be linked from the GitHub UI to allow users to easily\n                    see the source of the status.  \\nFor example, if your continuous\n                    integration system is posting build status, you would want to\n                    provide the deep link for the build output for this specific SHA:\n                    \\ \\n`http://ci.example.com/user/repo/build/sha`\"\n                description:\n                  type: string\n                  description: A short description of the status.\n                context:\n                  type: string\n                  description: A string label to differentiate this status from the\n                    status of other systems. This field is case-insensitive.\n                  default: default\n              required:\n              - state\n            example:\n              state: success\n              target_url: https://example.com/build/status\n              description: The build succeeded!\n              context: continuous-integration/jenkins\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/status\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n              schema:\n                type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: statuses\n  \"/repos/{owner}/{repo}/subscribers\":\n    get:\n      summary: List watchers\n      description: Lists the people watching the specified repository.\n      tags:\n      - activity\n      operationId: activity/list-watchers-for-repo\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-watchers\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: watching\n  \"/repos/{owner}/{repo}/subscription\":\n    get:\n      summary: Get a repository subscription\n      description: ''\n      tags:\n      - activity\n      operationId: activity/get-repo-subscription\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#get-a-repository-subscription\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: if you subscribe to the repository\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository-subscription\"\n              examples:\n                response-if-you-subscribe-to-the-repository:\n                  \"$ref\": \"#/components/examples/repository-subscription-response-if-you-subscribe-to-the-repository\"\n        '404':\n          description: Not Found if you don't subscribe to the repository\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: watching\n    put:\n      summary: Set a repository subscription\n      description: If you would like to watch a repository, set `subscribed` to `true`.\n        If you would like to ignore notifications made within a repository, set `ignored`\n        to `true`. If you would like to stop watching a repository, [delete the repository's\n        subscription](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-repository-subscription)\n        completely.\n      tags:\n      - activity\n      operationId: activity/set-repo-subscription\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#set-a-repository-subscription\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                subscribed:\n                  type: boolean\n                  description: Determines if notifications should be received from\n                    this repository.\n                ignored:\n                  type: boolean\n                  description: Determines if all notifications should be blocked from\n                    this repository.\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository-subscription\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-subscription\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: watching\n    delete:\n      summary: Delete a repository subscription\n      description: This endpoint should only be used to stop watching a repository.\n        To control whether or not you wish to receive notifications from a repository,\n        [set the repository's subscription manually](https://docs.github.com/enterprise-server@3.0/rest/reference/activity#set-a-repository-subscription).\n      tags:\n      - activity\n      operationId: activity/delete-repo-subscription\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#delete-a-repository-subscription\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: watching\n  \"/repos/{owner}/{repo}/tags\":\n    get:\n      summary: List repository tags\n      description: ''\n      tags:\n      - repos\n      operationId: repos/list-tags\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-tags\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/tag\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/tag-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: \n  \"/repos/{owner}/{repo}/tarball/{ref}\":\n    get:\n      summary: Download a repository archive (tar)\n      description: |-\n        Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually\n        `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use\n        the `Location` header to make a second `GET` request.\n        **Note**: For private repositories, these links are temporary and expire after five minutes.\n      tags:\n      - repos\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#download-a-repository-archive\n      operationId: repos/download-tarball-archive\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '302':\n          description: Response\n          headers:\n            Location:\n              example: https://codeload.github.com/me/myprivate/legacy.zip/master?login=me&token=thistokenexpires\n              schema:\n                type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: contents\n  \"/repos/{owner}/{repo}/teams\":\n    get:\n      summary: List repository teams\n      description: ''\n      tags:\n      - repos\n      operationId: repos/list-teams\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-teams\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: \n  \"/repos/{owner}/{repo}/topics\":\n    get:\n      summary: Get all repository topics\n      description: ''\n      tags:\n      - repos\n      operationId: repos/get-all-topics\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-all-repository-topics\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/topic\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/topic\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        previews:\n        - required: true\n          name: mercy\n          note: |-\n            The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.mercy-preview+json\n            ```\n    put:\n      summary: Replace all repository topics\n      description: ''\n      tags:\n      - repos\n      operationId: repos/replace-all-topics\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#replace-all-repository-topics\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                names:\n                  type: array\n                  description: An array of topics to add to the repository. Pass one\n                    or more topics to _replace_ the set of existing topics. Send an\n                    empty array (`[]`) to clear all topics from the repository. **Note:**\n                    Topic `names` cannot contain uppercase letters.\n                  items:\n                    type: string\n              required:\n              - names\n            example:\n              names:\n              - octocat\n              - atom\n              - electron\n              - api\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/topic\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/topic\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        previews:\n        - required: true\n          name: mercy\n          note: |-\n            The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.mercy-preview+json\n            ```\n  \"/repos/{owner}/{repo}/transfer\":\n    post:\n      summary: Transfer a repository\n      description: A transfer request will need to be accepted by the new owner when\n        transferring a personal repository to another user. The response will contain\n        the original `owner`, and the transfer will continue asynchronously. For more\n        details on the requirements to transfer personal and organization-owned repositories,\n        see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/).\n      tags:\n      - repos\n      operationId: repos/transfer\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#transfer-a-repository\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                new_owner:\n                  type: string\n                  description: The username or organization name the repository will\n                    be transferred to.\n                team_ids:\n                  type: array\n                  description: ID of the team or teams to add to the repository. Teams\n                    can only be added to organization-owned repositories.\n                  items:\n                    type: integer\n              required:\n              - new_owner\n            example:\n              new_owner: github\n              team_ids:\n              - 12\n              - 345\n      responses:\n        '202':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: \n  \"/repos/{owner}/{repo}/zipball/{ref}\":\n    get:\n      summary: Download a repository archive (zip)\n      description: |-\n        Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually\n        `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use\n        the `Location` header to make a second `GET` request.\n        **Note**: For private repositories, these links are temporary and expire after five minutes.\n      tags:\n      - repos\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#download-a-repository-archive\n      operationId: repos/download-zipball-archive\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      - name: ref\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '302':\n          description: Response\n          headers:\n            Location:\n              example: https://codeload.github.com/me/myprivate/legacy.zip/master?login=me&token=thistokenexpires\n              schema:\n                type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: contents\n  \"/repos/{template_owner}/{template_repo}/generate\":\n    post:\n      summary: Create a repository using a template\n      description: |-\n        Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.\n\n        **OAuth scope requirements**\n\n        When using [OAuth](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n        *   `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n        *   `repo` scope to create a private repository\n      tags:\n      - repos\n      operationId: repos/create-using-template\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template\n      parameters:\n      - name: template_owner\n        in: path\n        required: true\n        schema:\n          type: string\n      - name: template_repo\n        in: path\n        required: true\n        schema:\n          type: string\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                owner:\n                  type: string\n                  description: The organization or person who will own the new repository.\n                    To create a new repository in an organization, the authenticated\n                    user must be a member of the specified organization.\n                name:\n                  type: string\n                  description: The name of the new repository.\n                description:\n                  type: string\n                  description: A short description of the new repository.\n                include_all_branches:\n                  type: boolean\n                  description: 'Set to `true` to include the directory structure and\n                    files from all branches in the template repository, and not just\n                    the default branch. Default: `false`.'\n                  default: false\n                private:\n                  type: boolean\n                  description: Either `true` to create a new private repository or\n                    `false` to create a new public one.\n                  default: false\n              required:\n              - name\n            example:\n              owner: octocat\n              name: Hello-World\n              description: This is your first repository\n              include_all_branches: false\n              private: false\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-3\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World\n              schema:\n                type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: repos\n        previews:\n        - required: true\n          name: baptiste\n          note: |-\n            Creating and using repository templates is currently available for developers to preview. To access this new endpoint during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.baptiste-preview+json\n            ```\n  \"/repositories\":\n    get:\n      summary: List public repositories\n      description: |-\n        Lists all public repositories in the order that they were created.\n\n        Note:\n        - For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.\n        - Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories.\n      tags:\n      - repos\n      operationId: repos/list-public\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-public-repositories\n      parameters:\n      - \"$ref\": \"#/components/parameters/since-repo\"\n      - name: visibility\n        description: 'Specifies the types of repositories to return. Can be one of\n          `all` or `public`. Default: `public`. Note: For GitHub Enterprise Server\n          and GitHub AE, this endpoint will only list repositories available to all\n          users on the enterprise.'\n        in: query\n        required: false\n        schema:\n          type: string\n          default: public\n          enum:\n          - all\n          - public\n          examples:\n          - all\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/public-repository-items\"\n          headers:\n            Link:\n              example: <https://api.github.com/repositories?since=364>; rel=\"next\"\n              schema:\n                type: string\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        subcategory: \n  \"/search/code\":\n    get:\n      summary: Search code\n      description: |-\n        Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\n\n        When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\n\n        For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:\n\n        `q=addClass+in:file+language:js+repo:jquery/jquery`\n\n        This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.\n\n        #### Considerations for code search\n\n        Due to the complexity of searching code, there are a few restrictions on how searches are performed:\n\n        *   Only the _default branch_ is considered. In most cases, this will be the `master` branch.\n        *   Only files smaller than 384 KB are searchable.\n        *   You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing\n        language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is.\n      tags:\n      - search\n      operationId: search/code\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-code\n      parameters:\n      - name: q\n        description: The query contains one or more search keywords and qualifiers.\n          Qualifiers allow you to limit your search to specific areas of GitHub. The\n          REST API supports the same qualifiers as GitHub.com. To learn more about\n          the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\n          See \"[Searching code](https://docs.github.com/articles/searching-code/)\"\n          for a detailed list of qualifiers.\n        in: query\n        required: true\n        schema:\n          type: string\n      - name: sort\n        description: 'Sorts the results of your query. Can only be `indexed`, which\n          indicates how recently a file has been indexed by the GitHub Enterprise\n          Server search infrastructure. Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - indexed\n      - \"$ref\": \"#/components/parameters/order\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - incomplete_results\n                - items\n                properties:\n                  total_count:\n                    type: integer\n                  incomplete_results:\n                    type: boolean\n                  items:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/code-search-result-item\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/code-search-result-item-paginated\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: search\n        subcategory: \n  \"/search/commits\":\n    get:\n      summary: Search commits\n      description: |-\n        Find commits via various criteria on the default branch (usually `master`). This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\n\n        When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match\n        metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\n\n        For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:\n\n        `q=repo:octocat/Spoon-Knife+css`\n      tags:\n      - search\n      operationId: search/commits\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-commits\n      parameters:\n      - name: q\n        description: The query contains one or more search keywords and qualifiers.\n          Qualifiers allow you to limit your search to specific areas of GitHub. The\n          REST API supports the same qualifiers as GitHub.com. To learn more about\n          the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\n          See \"[Searching commits](https://docs.github.com/articles/searching-commits/)\"\n          for a detailed list of qualifiers.\n        in: query\n        required: true\n        schema:\n          type: string\n      - name: sort\n        description: 'Sorts the results of your query by `author-date` or `committer-date`.\n          Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - author-date\n          - committer-date\n      - \"$ref\": \"#/components/parameters/order\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - incomplete_results\n                - items\n                properties:\n                  total_count:\n                    type: integer\n                  incomplete_results:\n                    type: boolean\n                  items:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/commit-search-result-item\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/commit-search-result-item-paginated\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: search\n        previews:\n        - required: true\n          name: cloak\n          note: |-\n            The Commit Search API is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2017-01-05-commit-search-api/) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.cloak-preview\n            ```\n  \"/search/issues\":\n    get:\n      summary: Search issues and pull requests\n      description: |-\n        Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\n\n        When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted\n        search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\n\n        For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.\n\n        `q=windows+label:bug+language:python+state:open&sort=created&order=asc`\n\n        This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.\n\n        **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see \"[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests).\"\n      tags:\n      - search\n      operationId: search/issues-and-pull-requests\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-issues-and-pull-requests\n      parameters:\n      - name: q\n        description: The query contains one or more search keywords and qualifiers.\n          Qualifiers allow you to limit your search to specific areas of GitHub. The\n          REST API supports the same qualifiers as GitHub.com. To learn more about\n          the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\n          See \"[Searching issues and pull requests](https://docs.github.com/articles/searching-issues-and-pull-requests/)\"\n          for a detailed list of qualifiers.\n        in: query\n        required: true\n        schema:\n          type: string\n      - name: sort\n        description: 'Sorts the results of your query by the number of `comments`,\n          `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`,\n          `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort\n          results by how recently the items were `created` or `updated`, Default:\n          [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - comments\n          - reactions\n          - reactions-+1\n          - reactions--1\n          - reactions-smile\n          - reactions-thinking_face\n          - reactions-heart\n          - reactions-tada\n          - interactions\n          - created\n          - updated\n      - \"$ref\": \"#/components/parameters/order\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - incomplete_results\n                - items\n                properties:\n                  total_count:\n                    type: integer\n                  incomplete_results:\n                    type: boolean\n                  items:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/issue-search-result-item\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-search-result-item-paginated\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: search\n        subcategory: \n  \"/search/labels\":\n    get:\n      summary: Search labels\n      description: |-\n        Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\n\n        When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\n\n        For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:\n\n        `q=bug+defect+enhancement&repository_id=64778136`\n\n        The labels that best match the query appear first in the search results.\n      tags:\n      - search\n      operationId: search/labels\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-labels\n      parameters:\n      - name: repository_id\n        description: The id of the repository.\n        in: query\n        required: true\n        schema:\n          type: integer\n      - name: q\n        description: The search keywords. This endpoint does not accept qualifiers\n          in the query. To learn more about the format of the query, see [Constructing\n          a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\n        in: query\n        required: true\n        schema:\n          type: string\n      - name: sort\n        description: 'Sorts the results of your query by when the label was `created`\n          or `updated`. Default: [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n      - \"$ref\": \"#/components/parameters/order\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - incomplete_results\n                - items\n                properties:\n                  total_count:\n                    type: integer\n                  incomplete_results:\n                    type: boolean\n                  items:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/label-search-result-item\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/label-search-result-item-paginated\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: search\n        subcategory: \n  \"/search/repositories\":\n    get:\n      summary: Search repositories\n      description: |-\n        Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\n\n        When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\n\n        For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:\n\n        `q=tetris+language:assembly&sort=stars&order=desc`\n\n        This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results.\n\n        When you include the `mercy` preview header, you can also search for multiple topics by adding more `topic:` instances. For example, your query might look like this:\n\n        `q=topic:ruby+topic:rails`\n      tags:\n      - search\n      operationId: search/repos\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-repositories\n      parameters:\n      - name: q\n        description: The query contains one or more search keywords and qualifiers.\n          Qualifiers allow you to limit your search to specific areas of GitHub. The\n          REST API supports the same qualifiers as GitHub.com. To learn more about\n          the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\n          See \"[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)\"\n          for a detailed list of qualifiers.\n        in: query\n        required: true\n        schema:\n          type: string\n      - name: sort\n        description: 'Sorts the results of your query by number of `stars`, `forks`,\n          or `help-wanted-issues` or how recently the items were `updated`. Default:\n          [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - stars\n          - forks\n          - help-wanted-issues\n          - updated\n      - \"$ref\": \"#/components/parameters/order\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - incomplete_results\n                - items\n                properties:\n                  total_count:\n                    type: integer\n                  incomplete_results:\n                    type: boolean\n                  items:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/repo-search-result-item\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repo-search-result-item-paginated\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: search\n        previews:\n        - required: false\n          name: mercy\n          note: |-\n            The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.mercy-preview+json\n            ```\n  \"/search/topics\":\n    get:\n      summary: Search topics\n      description: |-\n        Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination). See \"[Searching topics](https://docs.github.com/articles/searching-topics/)\" for a detailed list of qualifiers.\n\n        When searching for topics, you can get text match metadata for the topic's **short\\_description**, **description**, **name**, or **display\\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\n\n        For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:\n\n        `q=ruby+is:featured`\n\n        This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results.\n      tags:\n      - search\n      operationId: search/topics\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-topics\n      parameters:\n      - name: q\n        description: The query contains one or more search keywords and qualifiers.\n          Qualifiers allow you to limit your search to specific areas of GitHub. The\n          REST API supports the same qualifiers as GitHub.com. To learn more about\n          the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\n        in: query\n        required: true\n        schema:\n          type: string\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - incomplete_results\n                - items\n                properties:\n                  total_count:\n                    type: integer\n                  incomplete_results:\n                    type: boolean\n                  items:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/topic-search-result-item\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/topic-search-result-item-paginated\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: search\n        previews:\n        - required: true\n          name: mercy\n          note: |-\n            The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.mercy-preview+json\n            ```\n  \"/search/users\":\n    get:\n      summary: Search users\n      description: |-\n        Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#pagination).\n\n        When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.0/rest/reference/search#text-match-metadata).\n\n        For example, if you're looking for a list of popular users, you might try this query:\n\n        `q=tom+repos:%3E42+followers:%3E1000`\n\n        This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.\n      tags:\n      - search\n      operationId: search/users\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/search#search-users\n      parameters:\n      - name: q\n        description: The query contains one or more search keywords and qualifiers.\n          Qualifiers allow you to limit your search to specific areas of GitHub. The\n          REST API supports the same qualifiers as GitHub.com. To learn more about\n          the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.0/rest/reference/search#constructing-a-search-query).\n          See \"[Searching users](https://docs.github.com/articles/searching-users/)\"\n          for a detailed list of qualifiers.\n        in: query\n        required: true\n        schema:\n          type: string\n      - name: sort\n        description: 'Sorts the results of your query by number of `followers` or\n          `repositories`, or when the person `joined` GitHub Enterprise Server. Default:\n          [best match](https://docs.github.com/enterprise-server@3.0/rest/reference/search#ranking-search-results)'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - followers\n          - repositories\n          - joined\n      - \"$ref\": \"#/components/parameters/order\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - incomplete_results\n                - items\n                properties:\n                  total_count:\n                    type: integer\n                  incomplete_results:\n                    type: boolean\n                  items:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/user-search-result-item\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/user-search-result-item-paginated\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '503':\n          \"$ref\": \"#/components/responses/service_unavailable\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: search\n        subcategory: \n  \"/setup/api/configcheck\":\n    get:\n      summary: Get the configuration status\n      description: |-\n        This endpoint allows you to check the status of the most recent configuration process:\n\n        Note that you may need to wait several seconds after you start a process before you can check its status.\n\n        The different statuses are:\n\n        | Status        | Description                       |\n        | ------------- | --------------------------------- |\n        | `PENDING`     | The job has not started yet       |\n        | `CONFIGURING` | The job is running                |\n        | `DONE`        | The job has finished correctly    |\n        | `FAILED`      | The job has finished unexpectedly |\n      operationId: enterprise-admin/get-configuration-status\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-the-configuration-status\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/configuration-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/configuration-status\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n  \"/setup/api/configure\":\n    post:\n      summary: Start a configuration process\n      description: 'This endpoint allows you to start a configuration process at any\n        time for your updated settings to take effect:'\n      operationId: enterprise-admin/start-configuration-process\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#start-a-configuration-process\n      responses:\n        '202':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n  \"/setup/api/maintenance\":\n    get:\n      summary: Get the maintenance status\n      description: 'Check your installation''s maintenance status:'\n      operationId: enterprise-admin/get-maintenance-status\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-the-maintenance-status\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/maintenance-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/maintenance-status\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n    post:\n      summary: Enable or disable maintenance mode\n      description: \"**Note:** The request body for this operation must be submitted\n        as `application/x-www-form-urlencoded` data. You can submit a parameter value\n        as a string, or you can use a tool such as `curl` to submit a parameter value\n        as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\"\n      operationId: enterprise-admin/enable-or-disable-maintenance-mode\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#enable-or-disable-maintenance-mode\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/maintenance-status\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/maintenance-status\"\n      requestBody:\n        required: true\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                maintenance:\n                  type: string\n                  description: |-\n                    A JSON string with the attributes `enabled` and `when`.\n\n                    The possible values for `enabled` are `true` and `false`. When it's `false`, the attribute `when` is ignored and the maintenance mode is turned off. `when` defines the time period when the maintenance was enabled.\n\n                    The possible values for `when` are `now` or any date parseable by [mojombo/chronic](https://github.com/mojombo/chronic).\n              required:\n              - maintenance\n            example:\n              maintenance: '{\"enabled\":true, \"when\":\"now\"}'\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n  \"/setup/api/settings\":\n    get:\n      summary: Get settings\n      description: ''\n      operationId: enterprise-admin/get-settings\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-settings\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/enterprise-settings\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/enterprise-settings\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n    put:\n      summary: Set settings\n      description: |-\n        For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-settings).\n\n        **Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\n      operationId: enterprise-admin/set-settings\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#set-settings\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                settings:\n                  type: string\n                  description: A JSON string with the new settings. Note that you\n                    only need to pass the specific settings you want to modify. For\n                    a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-settings).\n              required:\n              - settings\n            example:\n              settings: '{ \"enterprise\": { \"public_pages\": true }}'\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n  \"/setup/api/settings/authorized-keys\":\n    get:\n      summary: Get all authorized SSH keys\n      description: ''\n      operationId: enterprise-admin/get-all-authorized-ssh-keys\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-all-authorized-ssh-keys\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/ssh-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/ssh-key-items\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n    post:\n      summary: Add an authorized SSH key\n      description: \"**Note:** The request body for this operation must be submitted\n        as `application/x-www-form-urlencoded` data. You can submit a parameter value\n        as a string, or you can use a tool such as `curl` to submit a parameter value\n        as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\"\n      operationId: enterprise-admin/add-authorized-ssh-key\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#add-an-authorized-ssh-key\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/ssh-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/ssh-key-items\"\n      requestBody:\n        required: true\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                authorized_key:\n                  type: string\n                  description: The public SSH key.\n              required:\n              - authorized_key\n            example:\n              authorized_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCssTL/Vtu/ODLTj0VtZoRAbvf7uiv5997GyDq0MoAZUjb5jmA5wYe2/wF6sFuhiZTnZoF1ZtCHunPp0hM/GHrn6VySBhNncx14YO8FPt1CIhEeRMSEjUK9cY3xAbS365oXY8vnUHJsS9+1tr/2bx/+4NJfcUt/Ezf1OR/0LStQXw==\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n    delete:\n      summary: Remove an authorized SSH key\n      description: \"**Note:** The request body for this operation must be submitted\n        as `application/x-www-form-urlencoded` data. You can submit a parameter value\n        as a string, or you can use a tool such as `curl` to submit a parameter value\n        as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\"\n      operationId: enterprise-admin/remove-authorized-ssh-key\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#remove-an-authorized-ssh-key\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/ssh-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/ssh-key-items\"\n      requestBody:\n        required: true\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                authorized_key:\n                  type: string\n                  description: The public SSH key.\n              required:\n              - authorized_key\n            example:\n              authorized_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCssTL/Vtu/ODLTj0VtZoRAbvf7uiv5997GyDq0MoAZUjb5jmA5wYe2/wF6sFuhiZTnZoF1ZtCHunPp0hM/GHrn6VySBhNncx14YO8FPt1CIhEeRMSEjUK9cY3xAbS365oXY8vnUHJsS9+1tr/2bx/+4NJfcUt/Ezf1OR/0LStQXw==\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n  \"/setup/api/start\":\n    post:\n      summary: Create a GitHub license\n      description: |-\n        When you boot a GitHub instance for the first time, you can use the following endpoint to upload a license.\n\n        Note that you need to `POST` to [`/setup/api/configure`](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#start-a-configuration-process) to start the actual configuration process.\n\n        When using this endpoint, your GitHub instance must have a password set. This can be accomplished two ways:\n\n        1.  If you're working directly with the API before accessing the web interface, you must pass in the password parameter to set your password.\n        2.  If you set up your instance via the web interface before accessing the API, your calls to this endpoint do not need the password parameter.\n\n        **Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\n      operationId: enterprise-admin/create-enterprise-server-license\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#create-a-github-enterprise-server-license\n      responses:\n        '202':\n          description: Response\n      requestBody:\n        required: true\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                license:\n                  type: string\n                  description: The content of your _.ghl_ license file.\n                password:\n                  type: string\n                  description: You **must** provide a password _only if_ you are uploading\n                    your license for the first time. If you previously set a password\n                    through the web interface, you don't need this parameter.\n                settings:\n                  type: string\n                  description: An optional JSON string containing the installation\n                    settings. For a list of the available settings, see the [Get settings\n                    endpoint](https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#get-settings).\n              required:\n              - license\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n  \"/setup/api/upgrade\":\n    post:\n      summary: Upgrade a license\n      description: |-\n        This API upgrades your license and also triggers the configuration process.\n\n        **Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).\n      operationId: enterprise-admin/upgrade-license\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#upgrade-a-license\n      responses:\n        '202':\n          description: Response\n      requestBody:\n        content:\n          application/x-www-form-urlencoded:\n            schema:\n              type: object\n              properties:\n                license:\n                  type: string\n                  description: The content of your new _.ghl_ license file.\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: management-console\n  \"/teams/{team_id}\":\n    get:\n      summary: Get a team (Legacy)\n      description: \"**Deprecation Notice:** This endpoint route is deprecated and\n        will be removed from the Teams API. We recommend migrating your existing code\n        to use the [Get a team by name](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-team-by-name)\n        endpoint.\"\n      tags:\n      - teams\n      operationId: teams/get-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#get-a-team-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-full\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n    patch:\n      summary: Update a team (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-team) endpoint.\n\n        To edit a team, the authenticated user must either be an organization owner or a team maintainer.\n\n        **Note:** With nested teams, the `privacy` for parent teams cannot be `secret`.\n      tags:\n      - teams\n      operationId: teams/update-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#update-a-team-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  type: string\n                  description: The name of the team.\n                description:\n                  type: string\n                  description: The description of the team.\n                privacy:\n                  type: string\n                  description: \"The level of privacy this team should have. Editing\n                    teams without specifying this parameter leaves `privacy` intact.\n                    The options are:  \\n**For a non-nested team:**  \\n\\\\* `secret`\n                    - only visible to organization owners and members of this team.\n                    \\ \\n\\\\* `closed` - visible to all members of this organization.\n                    \\ \\n**For a parent or child team:**  \\n\\\\* `closed` - visible\n                    to all members of this organization.\"\n                  enum:\n                  - secret\n                  - closed\n                permission:\n                  type: string\n                  description: \"**Deprecated**. The permission that new repositories\n                    will be added to the team with when none is specified. Can be\n                    one of:  \\n\\\\* `pull` - team members can pull, but not push to\n                    or administer newly-added repositories.  \\n\\\\* `push` - team members\n                    can pull and push, but not administer newly-added repositories.\n                    \\ \\n\\\\* `admin` - team members can pull, push and administer newly-added\n                    repositories.\"\n                  enum:\n                  - pull\n                  - push\n                  - admin\n                  default: pull\n                parent_team_id:\n                  type:\n                  - integer\n                  - 'null'\n                  description: The ID of a team to set as the parent team.\n              required:\n              - name\n            example:\n              name: new team name\n              description: new team description\n              privacy: closed\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-full\"\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-full\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n    delete:\n      summary: Delete a team (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-team) endpoint.\n\n        To delete a team, the authenticated user must be an organization owner or team maintainer.\n\n        If you are an organization owner, deleting a parent team will delete all of its child teams as well.\n      tags:\n      - teams\n      operationId: teams/delete-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#delete-a-team-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n  \"/teams/{team_id}/discussions\":\n    get:\n      summary: List discussions (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussions) endpoint.\n\n        List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/list-discussions-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussions-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team-discussion\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussions\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n    post:\n      summary: Create a discussion (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion) endpoint.\n\n        Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n      tags:\n      - teams\n      operationId: teams/create-discussion-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: The discussion post's title.\n                body:\n                  type: string\n                  description: The discussion post's body text.\n                private:\n                  type: boolean\n                  description: Private posts are only visible to team members, organization\n                    owners, and team maintainers. Public posts are visible to all\n                    members of the organization. Set to `true` to create a private\n                    post.\n                  default: false\n              required:\n              - title\n              - body\n            example:\n              title: Our first team post\n              body: Hi! This is an area for us to collaborate as a team.\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussions\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n  \"/teams/{team_id}/discussions/{discussion_number}\":\n    get:\n      summary: Get a discussion (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion) endpoint.\n\n        Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/get-discussion-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussions\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n    patch:\n      summary: Update a discussion (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion) endpoint.\n\n        Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/update-discussion-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                title:\n                  type: string\n                  description: The discussion post's title.\n                body:\n                  type: string\n                  description: The discussion post's body text.\n            example:\n              title: Welcome to our first team post\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussions\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n    delete:\n      summary: Delete a discussion (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion) endpoint.\n\n        Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/delete-discussion-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussions\n      deprecated: true\n  \"/teams/{team_id}/discussions/{discussion_number}/comments\":\n    get:\n      summary: List discussion comments (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussion-comments) endpoint.\n\n        List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/list-discussion-comments-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-discussion-comments-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team-discussion-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-comment-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussion-comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n    post:\n      summary: Create a discussion comment (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-comment) endpoint.\n\n        Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n        This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.0/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n      tags:\n      - teams\n      operationId: teams/create-discussion-comment-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-discussion-comment-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The discussion comment's body text.\n              required:\n              - body\n            example:\n              body: Do you like apples?\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-comment\"\n      x-github:\n        triggersNotification: true\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussion-comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n  \"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}\":\n    get:\n      summary: Get a discussion comment (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion-comment) endpoint.\n\n        Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/get-discussion-comment-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-a-discussion-comment-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-comment\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussion-comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n    patch:\n      summary: Update a discussion comment (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion-comment) endpoint.\n\n        Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/update-discussion-comment-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#update-a-discussion-comment-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                body:\n                  type: string\n                  description: The discussion comment's body text.\n              required:\n              - body\n            example:\n              body: Do you like pineapples?\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-discussion-comment\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-discussion-comment-2\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussion-comments\n        previews:\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n    delete:\n      summary: Delete a discussion comment (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion-comment) endpoint.\n\n        Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/delete-discussion-comment-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#delete-a-discussion-comment-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: discussion-comments\n      deprecated: true\n  \"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\":\n    get:\n      summary: List reactions for a team discussion comment (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint.\n\n        List the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - reactions\n      operationId: reactions/list-for-team-discussion-comment-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#list-reactions-for-a-team-discussion-comment-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      - name: content\n        description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types).\n          Omit this parameter to list all reactions to a team discussion comment.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-21'\n        deprecationDate: '2020-02-26'\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n    post:\n      summary: Create reaction for a team discussion comment (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new \"[Create reaction for a team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)\" endpoint.\n\n        Create a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.\n      tags:\n      - reactions\n      operationId: reactions/create-for-team-discussion-comment-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#create-reaction-for-a-team-discussion-comment-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - \"$ref\": \"#/components/parameters/comment-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types)\n                    to add to the team discussion comment.\n                  enum:\n                  - \"+1\"\n                  - \"-1\"\n                  - laugh\n                  - confused\n                  - heart\n                  - hooray\n                  - rocket\n                  - eyes\n              required:\n              - content\n            example:\n              content: heart\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-21'\n        deprecationDate: '2020-02-26'\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n  \"/teams/{team_id}/discussions/{discussion_number}/reactions\":\n    get:\n      summary: List reactions for a team discussion (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint.\n\n        List the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - reactions\n      operationId: reactions/list-for-team-discussion-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#list-reactions-for-a-team-discussion-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      - name: content\n        description: Returns a single [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types).\n          Omit this parameter to list all reactions to a team discussion.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-21'\n        deprecationDate: '2020-02-26'\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n    post:\n      summary: Create reaction for a team discussion (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint.\n\n        Create a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion.\n      tags:\n      - reactions\n      operationId: reactions/create-for-team-discussion-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/reactions/#create-reaction-for-a-team-discussion-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/discussion-number\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                content:\n                  type: string\n                  description: The [reaction type](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions#reaction-types)\n                    to add to the team discussion.\n                  enum:\n                  - \"+1\"\n                  - \"-1\"\n                  - laugh\n                  - confused\n                  - heart\n                  - hooray\n                  - rocket\n                  - eyes\n              required:\n              - content\n            example:\n              content: heart\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/reaction\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/reaction\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        removalDate: '2021-02-21'\n        deprecationDate: '2020-02-26'\n        category: reactions\n        previews:\n        - required: true\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n      deprecated: true\n  \"/teams/{team_id}/members\":\n    get:\n      summary: List team members (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-members) endpoint.\n\n        Team members will include the members of child teams.\n      tags:\n      - teams\n      operationId: teams/list-members-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-members-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - name: role\n        description: \"Filters members returned by their role in the team. Can be one\n          of:  \\n\\\\* `member` - normal members of the team.  \\n\\\\* `maintainer` -\n          team maintainers.  \\n\\\\* `all` - all members of the team.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - member\n          - maintainer\n          - all\n          default: all\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: members\n      deprecated: true\n  \"/teams/{team_id}/members/{username}\":\n    get:\n      summary: Get team member (Legacy)\n      description: |-\n        The \"Get team member\" endpoint (described below) is deprecated.\n\n        We recommend using the [Get team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.\n\n        To list members in a team, the team must be visible to the authenticated user.\n      tags:\n      - teams\n      operationId: teams/get-member-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-member-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: if user is a member\n        '404':\n          description: if user is not a member\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: members\n      deprecated: true\n    put:\n      summary: Add team member (Legacy)\n      description: |-\n        The \"Add team member\" endpoint (described below) is deprecated.\n\n        We recommend using the [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.\n\n        Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.\n\n        **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\"\n\n        Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n      tags:\n      - teams\n      operationId: teams/add-member-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-team-member-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          description: Not Found if team synchronization is set up\n        '422':\n          description: Unprocessable Entity if you attempt to add an organization\n            to a team or you attempt to add a user to a team when they are not a member\n            of at least one other team in the same organization\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: members\n      deprecated: true\n    delete:\n      summary: Remove team member (Legacy)\n      description: |-\n        The \"Remove team member\" endpoint (described below) is deprecated.\n\n        We recommend using the [Remove team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.\n\n        Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.\n\n        **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\"\n      tags:\n      - teams\n      operationId: teams/remove-member-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-member-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          description: Not Found if team synchronization is setup\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: members\n      deprecated: true\n  \"/teams/{team_id}/memberships/{username}\":\n    get:\n      summary: Get team membership for a user (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-membership-for-a-user) endpoint.\n\n        Team members will include the members of child teams.\n\n        To get a user's membership with a team, the team must be visible to the authenticated user.\n\n        **Note:**\n        The response contains the `state` of the membership and the member's `role`.\n\n        The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#create-a-team).\n      tags:\n      - teams\n      operationId: teams/get-membership-for-user-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#get-team-membership-for-a-user-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-membership\"\n              examples:\n                response-if-user-is-a-team-maintainer:\n                  \"$ref\": \"#/components/examples/team-membership-response-if-user-is-a-team-maintainer\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: members\n      deprecated: true\n    put:\n      summary: Add or update team membership for a user (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint.\n\n        Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.\n\n        **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\"\n\n        If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the \"pending\" state until the user accepts the invitation, at which point the membership will transition to the \"active\" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.\n\n        If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.\n      tags:\n      - teams\n      operationId: teams/add-or-update-membership-for-user-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-membership-for-a-user-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                role:\n                  type: string\n                  description: \"The role that this user should have in the team. Can\n                    be one of:  \\n\\\\* `member` - a normal member of the team.  \\n\\\\*\n                    `maintainer` - a team maintainer. Able to add/remove other team\n                    members, promote other team members to team maintainer, and edit\n                    the team's name and description.\"\n                  enum:\n                  - member\n                  - maintainer\n                  default: member\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-membership\"\n              examples:\n                response-if-users-membership-with-team-is-now-pending:\n                  \"$ref\": \"#/components/examples/team-membership-response-if-users-membership-with-team-is-now-pending\"\n        '403':\n          description: Forbidden if team synchronization is set up\n        '422':\n          description: Unprocessable Entity if you attempt to add an organization\n            to a team\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: members\n      deprecated: true\n    delete:\n      summary: Remove team membership for a user (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-membership-for-a-user) endpoint.\n\n        Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n        To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.\n\n        **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\"\n      tags:\n      - teams\n      operationId: teams/remove-membership-for-user-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-team-membership-for-a-user-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          description: if team synchronization is set up\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: members\n      deprecated: true\n  \"/teams/{team_id}/projects\":\n    get:\n      summary: List team projects (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-projects) endpoint.\n\n        Lists the organization projects for a team.\n      tags:\n      - teams\n      operationId: teams/list-projects-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#list-team-projects-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team-project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-project-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n      deprecated: true\n  \"/teams/{team_id}/projects/{project_id}\":\n    get:\n      summary: Check team permissions for a project (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#check-team-permissions-for-a-project) endpoint.\n\n        Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.\n      tags:\n      - teams\n      operationId: teams/check-permissions-for-project-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#check-team-permissions-for-a-project-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/project-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-project\"\n        '404':\n          description: Not Found if project is not managed by this team\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n      deprecated: true\n    put:\n      summary: Add or update team project permissions (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-project-permissions) endpoint.\n\n        Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.\n      tags:\n      - teams\n      operationId: teams/add-or-update-project-permissions-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#add-or-update-team-project-permissions-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/project-id\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                permission:\n                  type: string\n                  description: \"The permission to grant to the team for this project.\n                    Can be one of:  \\n\\\\* `read` - team members can read, but not\n                    write to or administer this project.  \\n\\\\* `write` - team members\n                    can read and write, but not administer this project.  \\n\\\\* `admin`\n                    - team members can read, write and administer this project.  \\nDefault:\n                    the team's `permission` attribute will be used to determine what\n                    permission to grant the team on this project. Note that, if you\n                    choose not to pass any parameters, you'll need to set `Content-Length`\n                    to zero when calling out to this endpoint. For more information,\n                    see \\\"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\\\"\"\n                  enum:\n                  - read\n                  - write\n                  - admin\n      responses:\n        '204':\n          description: Response\n        '403':\n          description: Forbidden if the project is not owned by the organization\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  message:\n                    type: string\n                  documentation_url:\n                    type: string\n              examples:\n                response-if-the-project-is-not-owned-by-the-organization:\n                  value:\n                    message: Must have admin rights to Repository.\n                    documentation_url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-project-permissions\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n      deprecated: true\n    delete:\n      summary: Remove a project from a team (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-a-project-from-a-team) endpoint.\n\n        Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it.\n      tags:\n      - teams\n      operationId: teams/remove-project-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#remove-a-project-from-a-team-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/project-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n  \"/teams/{team_id}/repos\":\n    get:\n      summary: List team repositories (Legacy)\n      description: \"**Deprecation Notice:** This endpoint route is deprecated and\n        will be removed from the Teams API. We recommend migrating your existing code\n        to use the new [List team repositories](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-team-repositories)\n        endpoint.\"\n      tags:\n      - teams\n      operationId: teams/list-repos-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#list-team-repositories-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n  \"/teams/{team_id}/repos/{owner}/{repo}\":\n    get:\n      summary: Check team permissions for a repository (Legacy)\n      description: |-\n        **Note**: Repositories inherited through a parent team will also be checked.\n\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#check-team-permissions-for-a-repository) endpoint.\n\n        You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `Accept` header:\n      tags:\n      - teams\n      operationId: teams/check-permissions-for-repo-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#check-team-permissions-for-a-repository-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '200':\n          description: Alternative response with extra repository information\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/team-repository\"\n              examples:\n                alternative-response-with-extra-repository-information:\n                  \"$ref\": \"#/components/examples/team-repository-alternative-response-with-extra-repository-information\"\n        '204':\n          description: Response if repository is managed by this team\n        '404':\n          description: Not Found if repository is not managed by this team\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n    put:\n      summary: Add or update team repository permissions (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new \"[Add or update team repository permissions](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#add-or-update-team-repository-permissions)\" endpoint.\n\n        To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization.\n\n        Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n      tags:\n      - teams\n      operationId: teams/add-or-update-repo-permissions-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#add-or-update-team-repository-permissions-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                permission:\n                  type: string\n                  description: \"The permission to grant the team on this repository.\n                    Can be one of:  \\n\\\\* `pull` - team members can pull, but not\n                    push to or administer this repository.  \\n\\\\* `push` - team members\n                    can pull and push, but not administer this repository.  \\n\\\\*\n                    `admin` - team members can pull, push and administer this repository.\n                    \\ \\n  \\nIf no permission is specified, the team's `permission`\n                    attribute will be used to determine what permission to grant the\n                    team on this repository.\"\n                  enum:\n                  - pull\n                  - push\n                  - admin\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n    delete:\n      summary: Remove a repository from a team (Legacy)\n      description: |-\n        **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#remove-a-repository-from-a-team) endpoint.\n\n        If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team.\n      tags:\n      - teams\n      operationId: teams/remove-repo-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#remove-a-repository-from-a-team-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n  \"/teams/{team_id}/teams\":\n    get:\n      summary: List child teams (Legacy)\n      description: \"**Deprecation Notice:** This endpoint route is deprecated and\n        will be removed from the Teams API. We recommend migrating your existing code\n        to use the new [`List child teams`](https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-child-teams)\n        endpoint.\"\n      tags:\n      - teams\n      operationId: teams/list-child-legacy\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams/#list-child-teams-legacy\n      parameters:\n      - \"$ref\": \"#/components/parameters/team-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: if child teams exist\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team\"\n              examples:\n                response-if-child-teams-exist:\n                  \"$ref\": \"#/components/examples/team-items-response-if-child-teams-exist\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        removalDate: '2021-02-01'\n        deprecationDate: '2020-01-21'\n        category: teams\n        subcategory: \n      deprecated: true\n  \"/user\":\n    get:\n      summary: Get the authenticated user\n      description: |-\n        If the authenticated user is authenticated through basic authentication or OAuth with the `user` scope, then the response lists public and private profile information.\n\n        If the authenticated user is authenticated through OAuth without the `user` scope, then the response lists only public profile information.\n      tags:\n      - users\n      operationId: users/get-authenticated\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-the-authenticated-user\n      parameters: []\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                oneOf:\n                - \"$ref\": \"#/components/schemas/private-user\"\n                - \"$ref\": \"#/components/schemas/public-user\"\n              examples:\n                response-with-public-and-private-profile-information:\n                  \"$ref\": \"#/components/examples/private-user-response-with-public-and-private-profile-information\"\n                response-with-public-profile-information:\n                  \"$ref\": \"#/components/examples/private-user-response-with-public-profile-information\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: \n    patch:\n      summary: Update the authenticated user\n      description: \"**Note:** If your email is set to private and you send an `email`\n        parameter as part of this request to update your profile, your privacy settings\n        are still enforced: the email address will not be displayed on your public\n        profile or via the API.\"\n      tags:\n      - users\n      operationId: users/update-authenticated\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users/#update-the-authenticated-user\n      parameters: []\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                name:\n                  description: The new name of the user.\n                  type: string\n                  examples:\n                  - Omar Jahandar\n                email:\n                  description: The publicly visible email address of the user.\n                  type: string\n                  examples:\n                  - omar@example.com\n                blog:\n                  description: The new blog URL of the user.\n                  type: string\n                  examples:\n                  - blog.example.com\n                twitter_username:\n                  description: The new Twitter username of the user.\n                  type:\n                  - string\n                  - 'null'\n                  examples:\n                  - therealomarj\n                company:\n                  description: The new company of the user.\n                  type: string\n                  examples:\n                  - Acme corporation\n                location:\n                  description: The new location of the user.\n                  type: string\n                  examples:\n                  - Berlin, Germany\n                hireable:\n                  description: The new hiring availability of the user.\n                  type: boolean\n                bio:\n                  description: The new short biography of the user.\n                  type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/private-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/private-user\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: \n  \"/user/emails\":\n    get:\n      summary: List email addresses for the authenticated user\n      description: Lists all of your email addresses, and specifies which one is visible\n        to the public. This endpoint is accessible with the `user:email` scope.\n      tags:\n      - users\n      operationId: users/list-emails-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-email-addresses-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/email\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/email-items-2\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: emails\n    post:\n      summary: Add an email address for the authenticated user\n      description: This endpoint is accessible with the `user` scope.\n      tags:\n      - users\n      operationId: users/add-email-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#add-an-email-address-for-the-authenticated-user\n      parameters: []\n      requestBody:\n        required: false\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                properties:\n                  emails:\n                    description: Adds one or more email addresses to your GitHub account.\n                      Must contain at least one email address. **Note:** Alternatively,\n                      you can pass a single email address or an `array` of emails\n                      addresses directly, but we recommend that you pass an object\n                      using the `emails` key.\n                    type: array\n                    items:\n                      type: string\n                      minItems: 1\n                      examples:\n                      - username@example.com\n                    examples: []\n                required:\n                - emails\n                example:\n                  emails:\n                  - octocat@github.com\n                  - mona@github.com\n              - type: array\n                items:\n                  type: string\n                  minItems: 1\n                  examples:\n                  - username@example.com\n              - type: string\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/email\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/email-items\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: emails\n    delete:\n      summary: Delete an email address for the authenticated user\n      description: This endpoint is accessible with the `user` scope.\n      tags:\n      - users\n      operationId: users/delete-email-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#delete-an-email-address-for-the-authenticated-user\n      parameters: []\n      requestBody:\n        content:\n          application/json:\n            schema:\n              oneOf:\n              - type: object\n                description: Deletes one or more email addresses from your GitHub\n                  account. Must contain at least one email address. **Note:** Alternatively,\n                  you can pass a single email address or an `array` of emails addresses\n                  directly, but we recommend that you pass an object using the `emails`\n                  key.\n                properties:\n                  emails:\n                    description: Email addresses associated with the GitHub user account.\n                    type: array\n                    items:\n                      type: string\n                      minItems: 1\n                      examples:\n                      - username@example.com\n                example:\n                  emails:\n                  - octocat@github.com\n                  - mona@github.com\n                required:\n                - emails\n              - type: array\n                items:\n                  type: string\n                  minItems: 1\n                  examples:\n                  - username@example.com\n              - type: string\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: emails\n  \"/user/followers\":\n    get:\n      summary: List followers of the authenticated user\n      description: Lists the people following the authenticated user.\n      tags:\n      - users\n      operationId: users/list-followers-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-followers-of-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: followers\n  \"/user/following\":\n    get:\n      summary: List the people the authenticated user follows\n      description: Lists the people who the authenticated user follows.\n      tags:\n      - users\n      operationId: users/list-followed-by-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-the-people-the-authenticated-user-follows\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: followers\n  \"/user/following/{username}\":\n    get:\n      summary: Check if a person is followed by the authenticated user\n      description: ''\n      tags:\n      - users\n      operationId: users/check-person-is-followed-by-authenticated\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#check-if-a-person-is-followed-by-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: if the person is followed by the authenticated user\n        '404':\n          description: if the person is not followed by the authenticated user\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/basic-error\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: followers\n    put:\n      summary: Follow a user\n      description: |-\n        Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n\n        Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope.\n      tags:\n      - users\n      operationId: users/follow\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#follow-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: followers\n    delete:\n      summary: Unfollow a user\n      description: Unfollowing a user requires the user to be logged in and authenticated\n        with basic auth or OAuth with the `user:follow` scope.\n      tags:\n      - users\n      operationId: users/unfollow\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#unfollow-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: followers\n  \"/user/gpg_keys\":\n    get:\n      summary: List GPG keys for the authenticated user\n      description: Lists the current user's GPG keys. Requires that you are authenticated\n        via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - users\n      operationId: users/list-gpg-keys-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-gpg-keys-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/gpg-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gpg-key-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: gpg-keys\n    post:\n      summary: Create a GPG key for the authenticated user\n      description: Adds a GPG key to the authenticated user's GitHub account. Requires\n        that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key`\n        [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      operationId: users/create-gpg-key-for-authenticated-user\n      tags:\n      - users\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#create-a-gpg-key-for-the-authenticated-user\n      parameters: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                armored_public_key:\n                  description: A GPG key in ASCII-armored format.\n                  type: string\n              type: object\n              required:\n              - armored_public_key\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gpg-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gpg-key\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: gpg-keys\n  \"/user/gpg_keys/{gpg_key_id}\":\n    get:\n      summary: Get a GPG key for the authenticated user\n      description: View extended details for a single GPG key. Requires that you are\n        authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - users\n      operationId: users/get-gpg-key-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-a-gpg-key-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/gpg-key-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/gpg-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gpg-key\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: gpg-keys\n    delete:\n      summary: Delete a GPG key for the authenticated user\n      description: Removes a GPG key from the authenticated user's GitHub account.\n        Requires that you are authenticated via Basic Auth or via OAuth with at least\n        `admin:gpg_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - users\n      operationId: users/delete-gpg-key-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#delete-a-gpg-key-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/gpg-key-id\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: gpg-keys\n  \"/user/installations\":\n    get:\n      summary: List app installations accessible to the user access token\n      description: |-\n        Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.\n\n        You must use a [user-to-server OAuth access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint.\n\n        The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.\n\n        You can find the permissions for the installation under the `permissions` key.\n      tags:\n      - apps\n      operationId: apps/list-installations-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-app-installations-accessible-to-the-user-access-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: You can find the permissions for the installation under the\n            `permissions` key.\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - installations\n                properties:\n                  total_count:\n                    type: integer\n                  installations:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/installation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/base-installation-for-auth-user-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: installations\n  \"/user/installations/{installation_id}/repositories\":\n    get:\n      summary: List repositories accessible to the user access token\n      description: |-\n        List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.\n\n        The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.\n\n        You must use a [user-to-server OAuth access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint.\n\n        The access the user has to each repository is included in the hash under the `permissions` key.\n      tags:\n      - apps\n      operationId: apps/list-installation-repos-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#list-repositories-accessible-to-the-user-access-token\n      parameters:\n      - \"$ref\": \"#/components/parameters/installation-id\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: The access the user has to each repository is included in the\n            hash under the `permissions` key.\n          content:\n            application/json:\n              schema:\n                type: object\n                required:\n                - total_count\n                - repositories\n                properties:\n                  total_count:\n                    type: integer\n                  repository_selection:\n                    type: string\n                  repositories:\n                    type: array\n                    items:\n                      \"$ref\": \"#/components/schemas/repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-paginated\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: installations\n        previews:\n        - required: false\n          name: mercy\n          note: |-\n            The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.mercy-preview+json\n            ```\n  \"/user/installations/{installation_id}/repositories/{repository_id}\":\n    put:\n      summary: Add a repository to an app installation\n      description: |-\n        Add a single repository to an installation. The authenticated user must have admin access to the repository.\n\n        You must use a personal access token (which you can create via the [command line](https://docs.github.com/enterprise-server@3.0/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/add-repo-to-installation-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#add-a-repository-to-an-app-installation\n      parameters:\n      - \"$ref\": \"#/components/parameters/installation-id\"\n      - \"$ref\": \"#/components/parameters/repository-id\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: installations\n    delete:\n      summary: Remove a repository from an app installation\n      description: |-\n        Remove a single repository from an installation. The authenticated user must have admin access to the repository.\n\n        You must use a personal access token (which you can create via the [command line](https://docs.github.com/enterprise-server@3.0/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/remove-repo-from-installation-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#remove-a-repository-from-an-app-installation\n      parameters:\n      - \"$ref\": \"#/components/parameters/installation-id\"\n      - \"$ref\": \"#/components/parameters/repository-id\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: installations\n  \"/user/issues\":\n    get:\n      summary: List user account issues assigned to the authenticated user\n      description: |-\n        List issues across owned and member repositories assigned to the authenticated user.\n\n        **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\n        reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\n        the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\n        request id, use the \"[List pull requests](https://docs.github.com/enterprise-server@3.0/rest/reference/pulls#list-pull-requests)\" endpoint.\n      tags:\n      - issues\n      operationId: issues/list-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/issues#list-user-account-issues-assigned-to-the-authenticated-user\n      parameters:\n      - name: filter\n        description: \"Indicates which sorts of issues to return. Can be one of:  \\n\\\\*\n          `assigned`: Issues assigned to you  \\n\\\\* `created`: Issues created by you\n          \\ \\n\\\\* `mentioned`: Issues mentioning you  \\n\\\\* `subscribed`: Issues you're\n          subscribed to updates for  \\n\\\\* `all` or `repos`: All issues the authenticated\n          user can see, regardless of participation or creation\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - assigned\n          - created\n          - mentioned\n          - subscribed\n          - repos\n          - all\n          default: assigned\n      - name: state\n        description: Indicates the state of the issues to return. Can be either `open`,\n          `closed`, or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - \"$ref\": \"#/components/parameters/labels\"\n      - name: sort\n        description: What to sort results by. Can be either `created`, `updated`,\n          `comments`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - comments\n          default: created\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/issue\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/issue-with-repo-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: issues\n        previews:\n        - required: false\n          name: machine-man\n          note: \"If an issue event is created via a GitHub App, the response will\n            include the `performed_via_github_app` object with\\tinformation about\n            the GitHub App. For more information, see the [related blog\\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\\nTo\n            receive the `performed_via_github_app` object in the response, you must\n            provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types)\n            in the `Accept` header:\\n```shell\\napplication/vnd.github.machine-man-preview\\n```\"\n        - required: false\n          name: squirrel-girl\n          note: |-\n            An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\n            To access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.squirrel-girl-preview\n            ```\n            The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.0/rest/reference/reactions) reactions.\n  \"/user/keys\":\n    get:\n      summary: List public SSH keys for the authenticated user\n      description: Lists the public SSH keys for the authenticated user's GitHub account.\n        Requires that you are authenticated via Basic Auth or via OAuth with at least\n        `read:public_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - users\n      operationId: users/list-public-ssh-keys-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-public-ssh-keys-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/key-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: keys\n    post:\n      summary: Create a public SSH key for the authenticated user\n      description: Adds a public SSH key to the authenticated user's GitHub account.\n        Requires that you are authenticated via Basic Auth, or OAuth with at least\n        `write:public_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      operationId: users/create-public-ssh-key-for-authenticated-user\n      tags:\n      - users\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#create-a-public-ssh-key-for-the-authenticated-user\n      parameters: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                title:\n                  description: A descriptive name for the new key.\n                  type: string\n                  examples:\n                  - Personal MacBook Air\n                key:\n                  description: The public SSH key to add to your GitHub account.\n                  type: string\n                  pattern: \"^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) \"\n              required:\n              - key\n              type: object\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/key\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: keys\n  \"/user/keys/{key_id}\":\n    get:\n      summary: Get a public SSH key for the authenticated user\n      description: View extended details for a single public SSH key. Requires that\n        you are authenticated via Basic Auth or via OAuth with at least `read:public_key`\n        [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - users\n      operationId: users/get-public-ssh-key-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-a-public-ssh-key-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/key-id\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/key\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: keys\n    delete:\n      summary: Delete a public SSH key for the authenticated user\n      description: Removes a public SSH key from the authenticated user's GitHub account.\n        Requires that you are authenticated via Basic Auth or via OAuth with at least\n        `admin:public_key` [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n      tags:\n      - users\n      operationId: users/delete-public-ssh-key-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#delete-a-public-ssh-key-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/key-id\"\n      responses:\n        '204':\n          description: Response\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: keys\n  \"/user/memberships/orgs\":\n    get:\n      summary: List organization memberships for the authenticated user\n      description: ''\n      tags:\n      - orgs\n      operationId: orgs/list-memberships-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organization-memberships-for-the-authenticated-user\n      parameters:\n      - name: state\n        description: Indicates the state of the memberships to return. Can be either\n          `active` or `pending`. If not specified, the API returns both active and\n          pending memberships.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - active\n          - pending\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/org-membership\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-membership-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: orgs\n        subcategory: members\n  \"/user/memberships/orgs/{org}\":\n    get:\n      summary: Get an organization membership for the authenticated user\n      description: ''\n      tags:\n      - orgs\n      operationId: orgs/get-membership-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#get-an-organization-membership-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-membership\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-membership\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: orgs\n        subcategory: members\n    patch:\n      summary: Update an organization membership for the authenticated user\n      description: ''\n      tags:\n      - orgs\n      operationId: orgs/update-membership-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#update-an-organization-membership-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/org\"\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                state:\n                  type: string\n                  description: The state that the membership should be in. Only `\"active\"`\n                    will be accepted.\n                  enum:\n                  - active\n              required:\n              - state\n            example:\n              state: active\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/org-membership\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/org-membership-2\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: orgs\n        subcategory: members\n  \"/user/orgs\":\n    get:\n      summary: List organizations for the authenticated user\n      description: |-\n        List organizations for the authenticated user.\n\n        **OAuth scope requirements**\n\n        This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope. OAuth requests with insufficient scope receive a `403 Forbidden` response.\n      tags:\n      - orgs\n      operationId: orgs/list-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organizations-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/organization-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-simple-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: orgs\n        subcategory: \n  \"/user/projects\":\n    post:\n      summary: Create a user project\n      description: ''\n      tags:\n      - projects\n      operationId: projects/create-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#create-a-user-project\n      parameters: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                name:\n                  description: Name of the project\n                  type: string\n                  examples:\n                  - Week One Sprint\n                body:\n                  description: Body of the project\n                  type:\n                  - string\n                  - 'null'\n                  examples:\n                  - This project represents the sprint of the first week in January\n              required:\n              - name\n              type: object\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '415':\n          \"$ref\": \"#/components/responses/preview_header_missing\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed_simple\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/user/public_emails\":\n    get:\n      summary: List public email addresses for the authenticated user\n      description: Lists your publicly visible email address, which you can set with\n        the [Set primary email visibility for the authenticated user](https://docs.github.com/enterprise-server@3.0/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user)\n        endpoint. This endpoint is accessible with the `user:email` scope.\n      tags:\n      - users\n      operationId: users/list-public-emails-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-public-email-addresses-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/email\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/email-items-2\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: emails\n  \"/user/repos\":\n    get:\n      summary: List repositories for the authenticated user\n      description: |-\n        Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.\n\n        The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.\n      tags:\n      - repos\n      operationId: repos/list-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repositories-for-the-authenticated-user\n      parameters:\n      - name: visibility\n        description: 'Can be one of `all`, `public`, or `private`. Note: For GitHub\n          AE, can be one of `all`, `internal`, or `private`.'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - all\n          - public\n          - private\n          default: all\n      - name: affiliation\n        description: \"Comma-separated list of values. Can include:  \\n\\\\* `owner`:\n          Repositories that are owned by the authenticated user.  \\n\\\\* `collaborator`:\n          Repositories that the user has been added to as a collaborator.  \\n\\\\* `organization_member`:\n          Repositories that the user has access to through being a member of an organization.\n          This includes every repository on every team that the user is on.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          default: owner,collaborator,organization_member\n      - name: type\n        description: \"Can be one of `all`, `owner`, `public`, `private`, `member`.\n          Note: For GitHub AE, can be one of `all`, `owner`, `internal`, `private`,\n          `member`. Default: `all`  \\n  \\nWill cause a `422` error if used in the\n          same request as **visibility** or **affiliation**. Will cause a `422` error\n          if used in the same request as **visibility** or **affiliation**.\"\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - all\n          - owner\n          - public\n          - private\n          - member\n          default: all\n      - name: sort\n        description: Can be one of `created`, `updated`, `pushed`, `full_name`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - pushed\n          - full_name\n          default: full_name\n      - name: direction\n        description: 'Can be one of `asc` or `desc`. Default: `asc` when using `full_name`,\n          otherwise `desc`'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - asc\n          - desc\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/before\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-items-default-response\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: repos\n        subcategory: \n    post:\n      summary: Create a repository for the authenticated user\n      description: |-\n        Creates a new repository for the authenticated user.\n\n        **OAuth scope requirements**\n\n        When using [OAuth](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n        *   `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n        *   `repo` scope to create a private repository.\n      tags:\n      - repos\n      operationId: repos/create-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-for-the-authenticated-user\n      parameters: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              properties:\n                name:\n                  description: The name of the repository.\n                  type: string\n                  examples:\n                  - Team Environment\n                description:\n                  description: A short description of the repository.\n                  type: string\n                homepage:\n                  description: A URL with more information about the repository.\n                  type: string\n                private:\n                  description: Whether the repository is private.\n                  default: false\n                  type: boolean\n                has_issues:\n                  description: Whether issues are enabled.\n                  default: true\n                  type: boolean\n                  examples:\n                  - true\n                has_projects:\n                  description: Whether projects are enabled.\n                  default: true\n                  type: boolean\n                  examples:\n                  - true\n                has_wiki:\n                  description: Whether the wiki is enabled.\n                  default: true\n                  type: boolean\n                  examples:\n                  - true\n                team_id:\n                  description: The id of the team that will be granted access to this\n                    repository. This is only valid when creating a repository in an\n                    organization.\n                  type: integer\n                auto_init:\n                  description: Whether the repository is initialized with a minimal\n                    README.\n                  default: false\n                  type: boolean\n                gitignore_template:\n                  description: The desired language or platform to apply to the .gitignore.\n                  type: string\n                  examples:\n                  - Haskell\n                license_template:\n                  description: The license keyword of the open source license for\n                    this repository.\n                  type: string\n                  examples:\n                  - mit\n                allow_squash_merge:\n                  description: Whether to allow squash merges for pull requests.\n                  default: true\n                  type: boolean\n                  examples:\n                  - true\n                allow_merge_commit:\n                  description: Whether to allow merge commits for pull requests.\n                  default: true\n                  type: boolean\n                  examples:\n                  - true\n                allow_rebase_merge:\n                  description: Whether to allow rebase merges for pull requests.\n                  default: true\n                  type: boolean\n                  examples:\n                  - true\n                delete_branch_on_merge:\n                  description: Whether to delete head branches when pull requests\n                    are merged\n                  default: false\n                  type: boolean\n                  examples:\n                  - false\n                has_downloads:\n                  description: Whether downloads are enabled.\n                  default: true\n                  type: boolean\n                  examples:\n                  - true\n                is_template:\n                  description: Whether this repository acts as a template that can\n                    be used to generate new repositories.\n                  default: false\n                  type: boolean\n                  examples:\n                  - true\n              required:\n              - name\n              type: object\n      responses:\n        '201':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository\"\n          headers:\n            Location:\n              example: https://api.github.com/repos/octocat/Hello-World\n              schema:\n                type: string\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n        '400':\n          \"$ref\": \"#/components/responses/bad_request\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: repos\n        previews:\n        - required: false\n          name: nebula\n          note: |-\n            You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\n            To access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.nebula-preview+json\n            ```\n        - required: false\n          name: baptiste\n          note: |-\n            The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.0/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n\n            ```shell\n            application/vnd.github.baptiste-preview+json\n            ```\n  \"/user/repository_invitations\":\n    get:\n      summary: List repository invitations for the authenticated user\n      description: When authenticating as a user, this endpoint will list all currently\n        open repository invitations for that user.\n      tags:\n      - repos\n      operationId: repos/list-invitations-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repository-invitations-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/repository-invitation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/repository-invitation-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: repos\n        subcategory: invitations\n  \"/user/repository_invitations/{invitation_id}\":\n    patch:\n      summary: Accept a repository invitation\n      description: ''\n      tags:\n      - repos\n      operationId: repos/accept-invitation-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#accept-a-repository-invitation\n      parameters:\n      - \"$ref\": \"#/components/parameters/invitation-id\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '409':\n          \"$ref\": \"#/components/responses/conflict\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: repos\n        subcategory: invitations\n    delete:\n      summary: Decline a repository invitation\n      description: ''\n      tags:\n      - repos\n      operationId: repos/decline-invitation-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#decline-a-repository-invitation\n      parameters:\n      - \"$ref\": \"#/components/parameters/invitation-id\"\n      responses:\n        '204':\n          description: Response\n        '409':\n          \"$ref\": \"#/components/responses/conflict\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: repos\n        subcategory: invitations\n  \"/user/starred\":\n    get:\n      summary: List repositories starred by the authenticated user\n      description: |-\n        Lists repositories the authenticated user has starred.\n\n        You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `Accept` header:\n      tags:\n      - activity\n      operationId: activity/list-repos-starred-by-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repositories-starred-by-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/sort\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/repository\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/repository-items-default-response\"\n            application/vnd.github.v3.star+json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/starred-repository\"\n              examples:\n                alternative-response-with-star-creation-timestamps:\n                  \"$ref\": \"#/components/examples/starred-repository-items-alternative-response-with-star-creation-timestamps\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: starring\n  \"/user/starred/{owner}/{repo}\":\n    get:\n      summary: Check if a repository is starred by the authenticated user\n      description: ''\n      tags:\n      - activity\n      operationId: activity/check-repo-is-starred-by-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#check-if-a-repository-is-starred-by-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response if this repository is starred by you\n        '404':\n          description: Not Found if this repository is not starred by you\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/basic-error\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: starring\n    put:\n      summary: Star a repository for the authenticated user\n      description: Note that you'll need to set `Content-Length` to zero when calling\n        out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n      tags:\n      - activity\n      operationId: activity/star-repo-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#star-a-repository-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: starring\n    delete:\n      summary: Unstar a repository for the authenticated user\n      description: ''\n      tags:\n      - activity\n      operationId: activity/unstar-repo-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#unstar-a-repository-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/owner\"\n      - \"$ref\": \"#/components/parameters/repo\"\n      responses:\n        '204':\n          description: Response\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: starring\n  \"/user/subscriptions\":\n    get:\n      summary: List repositories watched by the authenticated user\n      description: Lists repositories the authenticated user is watching.\n      tags:\n      - activity\n      operationId: activity/list-watched-repos-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repositories-watched-by-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n        '401':\n          \"$ref\": \"#/components/responses/requires_authentication\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: watching\n  \"/user/teams\":\n    get:\n      summary: List teams for the authenticated user\n      description: List all of the teams across all of the organizations to which\n        the authenticated user belongs. This method requires `user`, `repo`, or `read:org`\n        [scope](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)\n        when authenticating via [OAuth](https://docs.github.com/enterprise-server@3.0/apps/building-oauth-apps/).\n      tags:\n      - teams\n      operationId: teams/list-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/teams#list-teams-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/team-full\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/team-full-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '403':\n          \"$ref\": \"#/components/responses/forbidden\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: teams\n        subcategory: \n  \"/users\":\n    get:\n      summary: List users\n      description: |-\n        Lists all users, in the order that they signed up on GitHub Enterprise Server. This list includes personal user accounts and organization accounts.\n\n        Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users.\n      tags:\n      - users\n      operationId: users/list\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-users\n      parameters:\n      - \"$ref\": \"#/components/parameters/since-user\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              example: <https://api.github.com/users?since=135>; rel=\"next\"\n              schema:\n                type: string\n        '304':\n          \"$ref\": \"#/components/responses/not_modified\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: users\n        subcategory: \n  \"/users/{username}\":\n    get:\n      summary: Get a user\n      description: |-\n        Provides publicly available information about someone with a GitHub account.\n\n        GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub Enterprise Server plan. The GitHub App must be authenticated as a user. See \"[Identifying and authorizing users for GitHub Apps](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)\" for details about authentication. For an example response, see 'Response with GitHub Enterprise Server plan information' below\"\n\n        The `email` key in the following response is the publicly visible email address from your GitHub Enterprise Server [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub Enterprise Server. For more information, see [Authentication](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#authentication).\n\n        The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see \"[Emails API](https://docs.github.com/enterprise-server@3.0/rest/reference/users#emails)\".\n      tags:\n      - users\n      operationId: users/get-by-username\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                oneOf:\n                - \"$ref\": \"#/components/schemas/private-user\"\n                - \"$ref\": \"#/components/schemas/public-user\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/public-user-default-response\"\n                response-with-git-hub-plan-information:\n                  \"$ref\": \"#/components/examples/public-user-response-with-git-hub-plan-information\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: users\n        subcategory: \n  \"/users/{username}/events\":\n    get:\n      summary: List events for the authenticated user\n      description: If you are authenticated as the given user, you will see your private\n        events. Otherwise, you'll only see public events.\n      tags:\n      - activity\n      operationId: activity/list-events-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-events-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: events\n  \"/users/{username}/events/orgs/{org}\":\n    get:\n      summary: List organization events for the authenticated user\n      description: This is the user's organization dashboard. You must be authenticated\n        as the user to view this.\n      tags:\n      - activity\n      operationId: activity/list-org-events-for-authenticated-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-organization-events-for-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/org\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: activity\n        subcategory: events\n  \"/users/{username}/events/public\":\n    get:\n      summary: List public events for a user\n      description: ''\n      tags:\n      - activity\n      operationId: activity/list-public-events-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-events-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: events\n  \"/users/{username}/followers\":\n    get:\n      summary: List followers of a user\n      description: Lists the people following the specified user.\n      tags:\n      - users\n      operationId: users/list-followers-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-followers-of-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: users\n        subcategory: followers\n  \"/users/{username}/following\":\n    get:\n      summary: List the people a user follows\n      description: Lists the people who the specified user follows.\n      tags:\n      - users\n      operationId: users/list-following-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-the-people-a-user-follows\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/simple-user\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/simple-user-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: users\n        subcategory: followers\n  \"/users/{username}/following/{target_user}\":\n    get:\n      summary: Check if a user follows another user\n      description: ''\n      tags:\n      - users\n      operationId: users/check-following-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#check-if-a-user-follows-another-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - name: target_user\n        in: path\n        required: true\n        schema:\n          type: string\n      responses:\n        '204':\n          description: if the user follows the target user\n        '404':\n          description: if the user does not follow the target user\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: users\n        subcategory: followers\n  \"/users/{username}/gists\":\n    get:\n      summary: List gists for a user\n      description: 'Lists public gists for the specified user:'\n      tags:\n      - gists\n      operationId: gists/list-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/gists#list-gists-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/since\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/base-gist\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/base-gist-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: gists\n        subcategory: \n  \"/users/{username}/gpg_keys\":\n    get:\n      summary: List GPG keys for a user\n      description: Lists the GPG keys for a user. This information is accessible by\n        anyone.\n      tags:\n      - users\n      operationId: users/list-gpg-keys-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-gpg-keys-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/gpg-key\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/gpg-key-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: users\n        subcategory: gpg-keys\n  \"/users/{username}/hovercard\":\n    get:\n      summary: Get contextual information for a user\n      description: |-\n        Provides hovercard information when authenticated through basic auth or OAuth with the `repo` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.\n\n        The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository via cURL, it would look like this:\n\n        ```shell\n         curl -u username:token\n          https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192\n        ```\n      tags:\n      - users\n      operationId: users/get-context-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#get-contextual-information-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - name: subject_type\n        description: Identifies which additional information you'd like to receive\n          about the person's hovercard. Can be `organization`, `repository`, `issue`,\n          `pull_request`. **Required** when using `subject_id`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - organization\n          - repository\n          - issue\n          - pull_request\n      - name: subject_id\n        description: Uses the ID for the `subject_type` you specified. **Required**\n          when using `subject_type`.\n        in: query\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/hovercard\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/hovercard\"\n        '404':\n          \"$ref\": \"#/components/responses/not_found\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: users\n        subcategory: \n  \"/users/{username}/installation\":\n    get:\n      summary: Get a user installation for the authenticated app\n      description: |-\n        Enables an authenticated GitHub App to find the user’s installation information.\n\n        You must use a [JWT](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n      tags:\n      - apps\n      operationId: apps/get-user-installation\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/apps#get-a-user-installation-for-the-authenticated-app\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                \"$ref\": \"#/components/schemas/installation\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/installation\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: apps\n        subcategory: \n  \"/users/{username}/keys\":\n    get:\n      summary: List public keys for a user\n      description: Lists the _verified_ public SSH keys for a user. This is accessible\n        by anyone.\n      tags:\n      - users\n      operationId: users/list-public-keys-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/users#list-public-keys-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/key-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/key-simple-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: users\n        subcategory: keys\n  \"/users/{username}/orgs\":\n    get:\n      summary: List organizations for a user\n      description: |-\n        List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.\n\n        This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead.\n      tags:\n      - orgs\n      operationId: orgs/list-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/orgs#list-organizations-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/organization-simple\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/organization-simple-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: orgs\n        subcategory: \n  \"/users/{username}/projects\":\n    get:\n      summary: List user projects\n      description: ''\n      tags:\n      - projects\n      operationId: projects/list-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/projects#list-user-projects\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - name: state\n        description: Indicates the state of the projects to return. Can be either\n          `open`, `closed`, or `all`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - open\n          - closed\n          - all\n          default: open\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/project\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/project-items-3\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n        '422':\n          \"$ref\": \"#/components/responses/validation_failed\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: projects\n        previews:\n        - required: true\n          name: inertia\n          note: |-\n            The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.inertia-preview+json\n            ```\n  \"/users/{username}/received_events\":\n    get:\n      summary: List events received by the authenticated user\n      description: These are events that you've received by watching repos and following\n        users. If you are authenticated as the given user, you will see private events.\n        Otherwise, you'll only see public events.\n      tags:\n      - activity\n      operationId: activity/list-received-events-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-events-received-by-the-authenticated-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: events\n  \"/users/{username}/received_events/public\":\n    get:\n      summary: List public events received by a user\n      description: ''\n      tags:\n      - activity\n      operationId: activity/list-received-public-events-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-public-events-received-by-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/event\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: events\n  \"/users/{username}/repos\":\n    get:\n      summary: List repositories for a user\n      description: 'Lists public repositories for the specified user. Note: For GitHub\n        AE, this endpoint will list internal repositories for the specified user.'\n      tags:\n      - repos\n      operationId: repos/list-for-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/repos#list-repositories-for-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - name: type\n        description: Can be one of `all`, `owner`, `member`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - all\n          - owner\n          - member\n          default: owner\n      - name: sort\n        description: Can be one of `created`, `updated`, `pushed`, `full_name`.\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - created\n          - updated\n          - pushed\n          - full_name\n          default: full_name\n      - name: direction\n        description: 'Can be one of `asc` or `desc`. Default: `asc` when using `full_name`,\n          otherwise `desc`'\n        in: query\n        required: false\n        schema:\n          type: string\n          enum:\n          - asc\n          - desc\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: repos\n        previews:\n        - required: false\n          name: nebula\n          note: |-\n            You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.0/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\n            To access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n            ```shell\n            application/vnd.github.nebula-preview+json\n            ```\n  \"/users/{username}/site_admin\":\n    put:\n      summary: Promote a user to be a site administrator\n      description: Note that you'll need to set `Content-Length` to zero when calling\n        out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n      operationId: enterprise-admin/promote-user-to-be-site-administrator\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#promote-a-user-to-be-a-site-administrator\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n    delete:\n      summary: Demote a site administrator\n      description: You can demote any user account except your own.\n      operationId: enterprise-admin/demote-site-administrator\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#demote-a-site-administrator\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/users/{username}/starred\":\n    get:\n      summary: List repositories starred by a user\n      description: |-\n        Lists repositories a user has starred.\n\n        You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) via the `Accept` header:\n      tags:\n      - activity\n      operationId: activity/list-repos-starred-by-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repositories-starred-by-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/sort\"\n      - \"$ref\": \"#/components/parameters/direction\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                anyOf:\n                - type: array\n                  items:\n                    \"$ref\": \"#/components/schemas/starred-repository\"\n                - type: array\n                  items:\n                    \"$ref\": \"#/components/schemas/repository\"\n              examples:\n                default-response:\n                  \"$ref\": \"#/components/examples/repository-items-default-response\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: starring\n  \"/users/{username}/subscriptions\":\n    get:\n      summary: List repositories watched by a user\n      description: Lists repositories a user is watching.\n      tags:\n      - activity\n      operationId: activity/list-repos-watched-by-user\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/activity#list-repositories-watched-by-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      - \"$ref\": \"#/components/parameters/per-page\"\n      - \"$ref\": \"#/components/parameters/page\"\n      responses:\n        '200':\n          description: Response\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  \"$ref\": \"#/components/schemas/minimal-repository\"\n              examples:\n                default:\n                  \"$ref\": \"#/components/examples/minimal-repository-items\"\n          headers:\n            Link:\n              \"$ref\": \"#/components/headers/link\"\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: activity\n        subcategory: watching\n  \"/users/{username}/suspended\":\n    put:\n      summary: Suspend a user\n      description: |-\n        If your GitHub instance uses [LDAP Sync with Active Directory LDAP servers](https://docs.github.com/enterprise/admin/guides/user-management/using-ldap), Active Directory LDAP-authenticated users cannot be suspended through this API. If you attempt to suspend an Active Directory LDAP-authenticated user through this API, it will return a `403` response.\n\n        You can suspend any user account except your own.\n\n        Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.0/rest/overview/resources-in-the-rest-api#http-verbs).\"\n      operationId: enterprise-admin/suspend-user\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#suspend-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                reason:\n                  type: string\n                  description: The reason the user is being suspended. This message\n                    will be logged in the [audit log](https://docs.github.com/enterprise/admin/articles/audit-logging/).\n                    If you don't provide a `reason`, it will default to \"Suspended\n                    via API by _SITE\\_ADMINISTRATOR_\", where _SITE\\_ADMINISTRATOR_\n                    is the person who performed the action.\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n    delete:\n      summary: Unsuspend a user\n      description: If your GitHub instance uses [LDAP Sync with Active Directory LDAP\n        servers](https://docs.github.com/enterprise/admin/guides/user-management/using-ldap),\n        this API is disabled and will return a `403` response. Active Directory LDAP-authenticated\n        users cannot be unsuspended using the API.\n      operationId: enterprise-admin/unsuspend-user\n      tags:\n      - enterprise-admin\n      externalDocs:\n        description: API method documentation\n        url: https://docs.github.com/enterprise-server@3.0/rest/reference/enterprise-admin#unsuspend-a-user\n      parameters:\n      - \"$ref\": \"#/components/parameters/username\"\n      responses:\n        '204':\n          description: Response\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type:\n              - object\n              - 'null'\n              properties:\n                reason:\n                  type: string\n                  description: The reason the user is being unsuspended. This message\n                    will be logged in the [audit log](https://docs.github.com/enterprise/admin/articles/audit-logging/).\n                    If you don't provide a `reason`, it will default to \"Unsuspended\n                    via API by _SITE\\_ADMINISTRATOR_\", where _SITE\\_ADMINISTRATOR_\n                    is the person who performed the action.\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: false\n        category: enterprise-admin\n        subcategory: users\n  \"/zen\":\n    get:\n      summary: Get the Zen of GitHub\n      description: Get a random sentence from the Zen of GitHub\n      tags:\n      - meta\n      operationId: meta/get-zen\n      responses:\n        '200':\n          description: Response\n          content:\n            text/plain:\n              schema:\n                type: string\n      x-github:\n        githubCloudOnly: false\n        enabledForGitHubApps: true\n        category: meta\ncomponents:\n  parameters:\n    per-page:\n      name: per_page\n      description: Results per page (max 100)\n      in: query\n      schema:\n        type: integer\n        default: 30\n    page:\n      name: page\n      description: Page number of the results to fetch.\n      in: query\n      schema:\n        type: integer\n        default: 1\n    hook-id:\n      name: hook_id\n      in: path\n      required: true\n      schema:\n        type: integer\n    direction:\n      name: direction\n      description: One of `asc` (ascending) or `desc` (descending).\n      in: query\n      required: false\n      schema:\n        type: string\n        enum:\n        - asc\n        - desc\n        default: desc\n    key-ids:\n      name: key_ids\n      in: path\n      required: true\n      schema:\n        type: string\n    team-id:\n      name: team_id\n      in: path\n      required: true\n      schema:\n        type: integer\n    username:\n      name: username\n      in: path\n      required: true\n      schema:\n        type: string\n    org:\n      name: org\n      in: path\n      required: true\n      schema:\n        type: string\n    pre-receive-environment-id:\n      name: pre_receive_environment_id\n      in: path\n      required: true\n      schema:\n        type: integer\n    pre-receive-hook-id:\n      name: pre_receive_hook_id\n      description: pre_receive_hook_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    token-id:\n      name: token_id\n      in: path\n      required: true\n      schema:\n        type: integer\n    since:\n      name: since\n      description: 'Only show notifications updated after the given time. This is\n        a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format:\n        `YYYY-MM-DDTHH:MM:SSZ`.'\n      in: query\n      required: false\n      schema:\n        type: string\n        format: date-time\n    installation-id:\n      name: installation_id\n      description: installation_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    grant-id:\n      name: grant_id\n      description: grant_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    client-id:\n      name: client_id\n      in: path\n      required: true\n      description: The client ID of your GitHub app.\n      schema:\n        type: string\n    access-token:\n      name: access_token\n      in: path\n      required: true\n      schema:\n        type: string\n    app-slug:\n      name: app_slug\n      in: path\n      required: true\n      schema:\n        type: string\n    authorization-id:\n      name: authorization_id\n      description: authorization_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    enterprise:\n      name: enterprise\n      description: The slug version of the enterprise name. You can also substitute\n        this value with the enterprise id.\n      in: path\n      required: true\n      schema:\n        type: string\n    org-id:\n      name: org_id\n      description: Unique identifier of an organization.\n      in: path\n      required: true\n      schema:\n        type: integer\n    runner-group-id:\n      name: runner_group_id\n      description: Unique identifier of the self-hosted runner group.\n      in: path\n      required: true\n      schema:\n        type: integer\n    runner-id:\n      name: runner_id\n      description: Unique identifier of the self-hosted runner.\n      in: path\n      required: true\n      schema:\n        type: integer\n    gist-id:\n      name: gist_id\n      description: gist_id parameter\n      in: path\n      required: true\n      schema:\n        type: string\n    comment-id:\n      name: comment_id\n      description: comment_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    labels:\n      name: labels\n      description: 'A list of comma separated label names. Example: `bug,ui,@high`'\n      in: query\n      required: false\n      schema:\n        type: string\n    owner:\n      name: owner\n      in: path\n      required: true\n      schema:\n        type: string\n    repo:\n      name: repo\n      in: path\n      required: true\n      schema:\n        type: string\n    all:\n      name: all\n      description: If `true`, show notifications marked as read.\n      in: query\n      required: false\n      schema:\n        type: boolean\n        default: false\n    participating:\n      name: participating\n      description: If `true`, only shows notifications in which the user is directly\n        participating or mentioned.\n      in: query\n      required: false\n      schema:\n        type: boolean\n        default: false\n    before:\n      name: before\n      description: 'Only show notifications updated before the given time. This is\n        a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format:\n        `YYYY-MM-DDTHH:MM:SSZ`.'\n      in: query\n      required: false\n      schema:\n        type: string\n        format: date-time\n    thread-id:\n      name: thread_id\n      description: thread_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    since-org:\n      name: since\n      description: An organization ID. Only return organizations with an ID greater\n        than this ID.\n      in: query\n      required: false\n      schema:\n        type: integer\n    repository-id:\n      name: repository_id\n      in: path\n      required: true\n      schema:\n        type: integer\n    secret-name:\n      name: secret_name\n      description: secret_name parameter\n      in: path\n      required: true\n      schema:\n        type: string\n    team-slug:\n      name: team_slug\n      description: team_slug parameter\n      in: path\n      required: true\n      schema:\n        type: string\n    discussion-number:\n      name: discussion_number\n      in: path\n      required: true\n      schema:\n        type: integer\n    comment-number:\n      name: comment_number\n      in: path\n      required: true\n      schema:\n        type: integer\n    reaction-id:\n      name: reaction_id\n      in: path\n      required: true\n      schema:\n        type: integer\n    project-id:\n      name: project_id\n      in: path\n      required: true\n      schema:\n        type: integer\n    card-id:\n      name: card_id\n      description: card_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    column-id:\n      name: column_id\n      description: column_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    artifact-id:\n      name: artifact_id\n      description: artifact_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    job-id:\n      name: job_id\n      description: job_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    actor:\n      name: actor\n      description: Returns someone's workflow runs. Use the login for the user who\n        created the `push` associated with the check suite or workflow run.\n      in: query\n      required: false\n      schema:\n        type: string\n    workflow-run-branch:\n      name: branch\n      description: Returns workflow runs associated with a branch. Use the name of\n        the branch of the `push`.\n      in: query\n      required: false\n      schema:\n        type: string\n    event:\n      name: event\n      description: Returns workflow run triggered by the event you specify. For example,\n        `push`, `pull_request` or `issue`. For more information, see \"[Events that\n        trigger workflows](https://docs.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows).\"\n      in: query\n      required: false\n      schema:\n        type: string\n    workflow-run-status:\n      name: status\n      description: Returns workflow runs with the check run `status` or `conclusion`\n        that you specify. For example, a conclusion can be `success` or a status can\n        be `in_progress`. Only GitHub can set a status of `waiting` or `requested`.\n        For a list of the possible `status` and `conclusion` options, see \"[Create\n        a check run](https://docs.github.com/enterprise-server@3.0/rest/reference/checks#create-a-check-run).\"\n      in: query\n      required: false\n      schema:\n        type: string\n        enum:\n        - completed\n        - action_required\n        - cancelled\n        - failure\n        - neutral\n        - skipped\n        - stale\n        - success\n        - timed_out\n        - in_progress\n        - queued\n        - requested\n        - waiting\n    created:\n      name: created\n      description: Returns workflow runs created within the given date-time range.\n        For more information on the syntax, see \"[Understanding the search syntax](https://docs.github.com/enterprise-server@3.0/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates).\"\n      in: query\n      required: false\n      schema:\n        type: string\n        format: date-time\n    exclude-pull-requests:\n      name: exclude_pull_requests\n      description: If `true` pull requests are omitted from the response (empty array).\n      in: query\n      required: false\n      schema:\n        type: boolean\n        default: false\n    run-id:\n      name: run_id\n      description: The id of the workflow run.\n      in: path\n      required: true\n      schema:\n        type: integer\n    workflow-id:\n      name: workflow_id\n      in: path\n      description: The ID of the workflow. You can also pass the workflow file name\n        as a string.\n      required: true\n      schema:\n        oneOf:\n        - type: integer\n        - type: string\n    branch:\n      name: branch\n      description: The name of the branch.\n      in: path\n      required: true\n      schema:\n        type: string\n      x-multi-segment: true\n    check-run-id:\n      name: check_run_id\n      description: check_run_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    check-suite-id:\n      name: check_suite_id\n      description: check_suite_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    check-name:\n      name: check_name\n      description: Returns check runs with the specified `name`.\n      in: query\n      required: false\n      schema:\n        type: string\n    status:\n      name: status\n      description: Returns check runs with the specified `status`. Can be one of `queued`,\n        `in_progress`, or `completed`.\n      in: query\n      required: false\n      schema:\n        type: string\n        enum:\n        - queued\n        - in_progress\n        - completed\n    tool-name:\n      name: tool_name\n      description: The name of a code scanning tool. Only results by this tool will\n        be listed. You can specify the tool by using either `tool_name` or `tool_guid`,\n        but not both.\n      in: query\n      required: false\n      schema:\n        \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-name\"\n    tool-guid:\n      name: tool_guid\n      description: The GUID of a code scanning tool. Only results by this tool will\n        be listed. Note that some code scanning tools may not include a GUID in their\n        analysis data. You can specify the tool by using either `tool_guid` or `tool_name`,\n        but not both.\n      in: query\n      required: false\n      schema:\n        \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-guid\"\n    git-ref:\n      name: ref\n      description: The Git reference for the results you want to list. The `ref` for\n        a branch can be formatted either as `refs/heads/<branch name>` or simply `<branch\n        name>`. To reference a pull request use `refs/pull/<number>/merge`.\n      in: query\n      required: false\n      schema:\n        \"$ref\": \"#/components/schemas/code-scanning-ref\"\n    alert-number:\n      name: alert_number\n      in: path\n      description: The number that identifies an alert. You can find this at the end\n        of the URL for a code scanning alert within GitHub, and in the `number` field\n        in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts`\n        operation.\n      required: true\n      schema:\n        \"$ref\": \"#/components/schemas/alert-number\"\n    commit-sha:\n      name: commit_sha\n      description: commit_sha parameter\n      in: path\n      required: true\n      schema:\n        type: string\n      x-multi-segment: true\n    deployment-id:\n      name: deployment_id\n      description: deployment_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    invitation-id:\n      name: invitation_id\n      description: invitation_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    sort:\n      name: sort\n      description: One of `created` (when the repository was starred) or `updated`\n        (when it was last pushed to).\n      in: query\n      required: false\n      schema:\n        type: string\n        enum:\n        - created\n        - updated\n        default: created\n    issue-number:\n      name: issue_number\n      description: issue_number parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    key-id:\n      name: key_id\n      description: key_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    milestone-number:\n      name: milestone_number\n      description: milestone_number parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    pull-number:\n      name: pull_number\n      in: path\n      required: true\n      schema:\n        type: integer\n    review-id:\n      name: review_id\n      description: review_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    asset-id:\n      name: asset_id\n      description: asset_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    release-id:\n      name: release_id\n      description: release_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    since-repo:\n      name: since\n      description: A repository ID. Only return repositories with an ID greater than\n        this ID.\n      in: query\n      required: false\n      schema:\n        type: integer\n    order:\n      name: order\n      description: Determines whether the first search result returned is the highest\n        number of matches (`desc`) or lowest number of matches (`asc`). This parameter\n        is ignored unless you provide `sort`.\n      in: query\n      required: false\n      schema:\n        type: string\n        enum:\n        - desc\n        - asc\n        default: desc\n    gpg-key-id:\n      name: gpg_key_id\n      description: gpg_key_id parameter\n      in: path\n      required: true\n      schema:\n        type: integer\n    since-user:\n      name: since\n      description: A user ID. Only return users with an ID greater than this ID.\n      in: query\n      required: false\n      schema:\n        type: integer\n  schemas:\n    global-hook:\n      type: object\n      properties:\n        type:\n          type: string\n        id:\n          type: integer\n        name:\n          type: string\n        active:\n          type: boolean\n        events:\n          type: array\n          items:\n            type: string\n        config:\n          type: object\n          properties:\n            url:\n              type: string\n            content_type:\n              type: string\n            insecure_ssl:\n              type: string\n            secret:\n              type: string\n        updated_at:\n          type: string\n        created_at:\n          type: string\n        url:\n          type: string\n        ping_url:\n          type: string\n    global-hook-2:\n      type: object\n      properties:\n        type:\n          type: string\n        id:\n          type: integer\n        name:\n          type: string\n        active:\n          type: boolean\n        events:\n          type: array\n          items:\n            type: string\n        config:\n          type: object\n          properties:\n            url:\n              type: string\n            content_type:\n              type: string\n            insecure_ssl:\n              type: string\n        updated_at:\n          type: string\n        created_at:\n          type: string\n        url:\n          type: string\n        ping_url:\n          type: string\n    public-key-full:\n      type: object\n      properties:\n        id:\n          type: integer\n        key:\n          type: string\n        user_id:\n          type:\n          - integer\n          - 'null'\n        repository_id:\n          type:\n          - integer\n          - 'null'\n        url:\n          type: string\n        title:\n          type: string\n        read_only:\n          type: boolean\n        verified:\n          type: boolean\n        created_at:\n          type: string\n          format: date-time\n        last_used:\n          type:\n          - string\n          - 'null'\n          format: date-time\n      required:\n      - id\n      - key\n      - url\n      - title\n      - verified\n      - created_at\n      - read_only\n      - last_used\n      - user_id\n      - repository_id\n    ldap-mapping-team:\n      type: object\n      properties:\n        ldap_dn:\n          type: string\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        html_url:\n          type: string\n        name:\n          type: string\n        slug:\n          type: string\n        description:\n          type:\n          - string\n          - 'null'\n        privacy:\n          type: string\n        permission:\n          type: string\n        members_url:\n          type: string\n        repositories_url:\n          type: string\n        parent:\n          type:\n          - 'null'\n    ldap-mapping-user:\n      title: Ldap Private User\n      description: Ldap Private User\n      type: object\n      properties:\n        ldap_dn:\n          type: string\n        login:\n          type: string\n          examples:\n          - octocat\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDQ6VXNlcjE=\n        avatar_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/images/error/octocat_happy.gif\n        gravatar_id:\n          type:\n          - string\n          - 'null'\n          examples:\n          - 41d064eb2195891e12d0413f63227ea7\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat\n        followers_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/followers\n        following_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/following{/other_user}\n        gists_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/subscriptions\n        organizations_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/orgs\n        repos_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/repos\n        events_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/events{/privacy}\n        received_events_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/received_events\n        type:\n          type: string\n          examples:\n          - User\n        site_admin:\n          type: boolean\n        name:\n          type:\n          - string\n          - 'null'\n          examples:\n          - monalisa octocat\n        company:\n          type:\n          - string\n          - 'null'\n          examples:\n          - GitHub\n        blog:\n          type:\n          - string\n          - 'null'\n          examples:\n          - https://github.com/blog\n        location:\n          type:\n          - string\n          - 'null'\n          examples:\n          - San Francisco\n        email:\n          type:\n          - string\n          - 'null'\n          format: email\n          examples:\n          - octocat@github.com\n        hireable:\n          type:\n          - boolean\n          - 'null'\n        bio:\n          type:\n          - string\n          - 'null'\n          examples:\n          - There once was...\n        twitter_username:\n          type:\n          - string\n          - 'null'\n          examples:\n          - monalisa\n        public_repos:\n          type: integer\n          examples:\n          - 2\n        public_gists:\n          type: integer\n          examples:\n          - 1\n        followers:\n          type: integer\n          examples:\n          - 20\n        following:\n          type: integer\n          examples:\n          - 0\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2008-01-14T04:33:35Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2008-01-14T04:33:35Z'\n        private_gists:\n          type: integer\n          examples:\n          - 81\n        total_private_repos:\n          type: integer\n          examples:\n          - 100\n        owned_private_repos:\n          type: integer\n          examples:\n          - 100\n        disk_usage:\n          type: integer\n          examples:\n          - 10000\n        collaborators:\n          type: integer\n          examples:\n          - 8\n        two_factor_authentication:\n          type: boolean\n          examples:\n          - true\n        plan:\n          type: object\n          properties:\n            collaborators:\n              type: integer\n            name:\n              type: string\n            space:\n              type: integer\n            private_repos:\n              type: integer\n          required:\n          - collaborators\n          - name\n          - space\n          - private_repos\n        suspended_at:\n          type: string\n          format: date-time\n        business_plus:\n          type: boolean\n      required:\n      - avatar_url\n      - events_url\n      - followers_url\n      - following_url\n      - gists_url\n      - gravatar_id\n      - html_url\n      - id\n      - node_id\n      - login\n      - organizations_url\n      - received_events_url\n      - repos_url\n      - site_admin\n      - starred_url\n      - subscriptions_url\n      - type\n      - url\n      - bio\n      - blog\n      - company\n      - email\n      - followers\n      - following\n      - hireable\n      - location\n      - name\n      - public_gists\n      - public_repos\n      - created_at\n      - updated_at\n      - collaborators\n      - disk_usage\n      - owned_private_repos\n      - private_gists\n      - total_private_repos\n      - two_factor_authentication\n    organization-simple:\n      title: Organization Simple\n      description: Organization Simple\n      type: object\n      properties:\n        login:\n          type: string\n          examples:\n          - github\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDEyOk9yZ2FuaXphdGlvbjE=\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/github\n        repos_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/github/repos\n        events_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/github/events\n        hooks_url:\n          type: string\n          examples:\n          - https://api.github.com/orgs/github/hooks\n        issues_url:\n          type: string\n          examples:\n          - https://api.github.com/orgs/github/issues\n        members_url:\n          type: string\n          examples:\n          - https://api.github.com/orgs/github/members{/member}\n        public_members_url:\n          type: string\n          examples:\n          - https://api.github.com/orgs/github/public_members{/member}\n        avatar_url:\n          type: string\n          examples:\n          - https://github.com/images/error/octocat_happy.gif\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - A great organization\n      required:\n      - login\n      - url\n      - id\n      - node_id\n      - repos_url\n      - events_url\n      - hooks_url\n      - issues_url\n      - members_url\n      - public_members_url\n      - avatar_url\n      - description\n    pre-receive-environment:\n      type: object\n      properties:\n        id:\n          type: integer\n        name:\n          type: string\n        image_url:\n          type: string\n        url:\n          type: string\n        html_url:\n          type: string\n        default_environment:\n          type: boolean\n        created_at:\n          type: string\n        hooks_count:\n          type: integer\n        download:\n          type: object\n          properties:\n            url:\n              type: string\n            state:\n              type: string\n            downloaded_at:\n              type:\n              - string\n              - 'null'\n            message:\n              type:\n              - string\n              - 'null'\n    pre-receive-environment-download-status:\n      type: object\n      properties:\n        url:\n          type: string\n        state:\n          type: string\n        downloaded_at:\n          type:\n          - string\n          - 'null'\n        message:\n          type:\n          - string\n          - 'null'\n    pre-receive-hook:\n      type: object\n      properties:\n        id:\n          type: integer\n        name:\n          type: string\n        enforcement:\n          type: string\n        script:\n          type: string\n        script_repository:\n          type: object\n          properties:\n            id:\n              type: integer\n            full_name:\n              type: string\n            url:\n              type: string\n            html_url:\n              type: string\n        environment:\n          type: object\n          properties:\n            id:\n              type: integer\n            name:\n              type: string\n            image_url:\n              type: string\n            url:\n              type: string\n            html_url:\n              type: string\n            default_environment:\n              type: boolean\n            created_at:\n              type: string\n            hooks_count:\n              type: integer\n            download:\n              type: object\n              properties:\n                url:\n                  type: string\n                state:\n                  type: string\n                downloaded_at:\n                  type:\n                  - string\n                  - 'null'\n                message:\n                  type:\n                  - string\n                  - 'null'\n        allow_downstream_configuration:\n          type: boolean\n    simple-user:\n      title: Simple User\n      description: Simple User\n      type: object\n      properties:\n        name:\n          type:\n          - string\n          - 'null'\n        email:\n          type:\n          - string\n          - 'null'\n        login:\n          type: string\n          examples:\n          - octocat\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDQ6VXNlcjE=\n        avatar_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/images/error/octocat_happy.gif\n        gravatar_id:\n          type:\n          - string\n          - 'null'\n          examples:\n          - 41d064eb2195891e12d0413f63227ea7\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat\n        followers_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/followers\n        following_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/following{/other_user}\n        gists_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/subscriptions\n        organizations_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/orgs\n        repos_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/repos\n        events_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/events{/privacy}\n        received_events_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/received_events\n        type:\n          type: string\n          examples:\n          - User\n        site_admin:\n          type: boolean\n        starred_at:\n          type: string\n          examples:\n          - '\"2020-07-09T00:17:55Z\"'\n      required:\n      - avatar_url\n      - events_url\n      - followers_url\n      - following_url\n      - gists_url\n      - gravatar_id\n      - html_url\n      - id\n      - node_id\n      - login\n      - organizations_url\n      - received_events_url\n      - repos_url\n      - site_admin\n      - starred_url\n      - subscriptions_url\n      - type\n      - url\n    app-permissions:\n      title: App Permissions\n      type: object\n      description: The permissions granted to the user-to-server access token.\n      properties:\n        actions:\n          type: string\n          description: 'The level of permission to grant the access token for GitHub\n            Actions workflows, workflow runs, and artifacts. Can be one of: `read`\n            or `write`.'\n          enum:\n          - read\n          - write\n        administration:\n          type: string\n          description: 'The level of permission to grant the access token for repository\n            creation, deletion, settings, teams, and collaborators creation. Can be\n            one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        checks:\n          type: string\n          description: 'The level of permission to grant the access token for checks\n            on code. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        contents:\n          type: string\n          description: 'The level of permission to grant the access token for repository\n            contents, commits, branches, downloads, releases, and merges. Can be one\n            of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        deployments:\n          type: string\n          description: 'The level of permission to grant the access token for deployments\n            and deployment statuses. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        environments:\n          type: string\n          description: 'The level of permission to grant the access token for managing\n            repository environments. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        issues:\n          type: string\n          description: 'The level of permission to grant the access token for issues\n            and related comments, assignees, labels, and milestones. Can be one of:\n            `read` or `write`.'\n          enum:\n          - read\n          - write\n        metadata:\n          type: string\n          description: 'The level of permission to grant the access token to search\n            repositories, list collaborators, and access repository metadata. Can\n            be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        packages:\n          type: string\n          description: 'The level of permission to grant the access token for packages\n            published to GitHub Packages. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        pages:\n          type: string\n          description: 'The level of permission to grant the access token to retrieve\n            Pages statuses, configuration, and builds, as well as create new builds.\n            Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        pull_requests:\n          type: string\n          description: 'The level of permission to grant the access token for pull\n            requests and related comments, assignees, labels, milestones, and merges.\n            Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        repository_hooks:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            the post-receive hooks for a repository. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        repository_projects:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            repository projects, columns, and cards. Can be one of: `read`, `write`,\n            or `admin`.'\n          enum:\n          - read\n          - write\n          - admin\n        secret_scanning_alerts:\n          type: string\n          description: 'The level of permission to grant the access token to view\n            and manage secret scanning alerts. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        secrets:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            repository secrets. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        security_events:\n          type: string\n          description: 'The level of permission to grant the access token to view\n            and manage security events like code scanning alerts. Can be one of: `read`\n            or `write`.'\n          enum:\n          - read\n          - write\n        single_file:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            just a single file. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        statuses:\n          type: string\n          description: 'The level of permission to grant the access token for commit\n            statuses. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        vulnerability_alerts:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            Dependabot alerts. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        workflows:\n          type: string\n          description: 'The level of permission to grant the access token to update\n            GitHub Actions workflow files. Can be one of: `write`.'\n          enum:\n          - write\n        members:\n          type: string\n          description: 'The level of permission to grant the access token for organization\n            teams and members. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        organization_administration:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            access to an organization. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        organization_hooks:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            the post-receive hooks for an organization. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        organization_plan:\n          type: string\n          description: 'The level of permission to grant the access token for viewing\n            an organization''s plan. Can be one of: `read`.'\n          enum:\n          - read\n        organization_projects:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            organization projects and projects beta (where available). Can be one\n            of: `read`, `write`, or `admin`.'\n          enum:\n          - read\n          - write\n          - admin\n        organization_packages:\n          type: string\n          description: 'The level of permission to grant the access token for organization\n            packages published to GitHub Packages. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        organization_secrets:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            organization secrets. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        organization_self_hosted_runners:\n          type: string\n          description: 'The level of permission to grant the access token to view\n            and manage GitHub Actions self-hosted runners available to an organization.\n            Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        organization_user_blocking:\n          type: string\n          description: 'The level of permission to grant the access token to view\n            and manage users blocked by the organization. Can be one of: `read` or\n            `write`.'\n          enum:\n          - read\n          - write\n        team_discussions:\n          type: string\n          description: 'The level of permission to grant the access token to manage\n            team discussions and related comments. Can be one of: `read` or `write`.'\n          enum:\n          - read\n          - write\n        content_references:\n          type: string\n          description: 'The level of permission to grant the access token for notification\n            of content references and creation content attachments. Can be one of:\n            `read` or `write`.'\n          enum:\n          - read\n          - write\n      example:\n        contents: read\n        issues: read\n        deployments: write\n        single_file: read\n    scoped-installation:\n      title: Scoped Installation\n      type: object\n      properties:\n        permissions:\n          \"$ref\": \"#/components/schemas/app-permissions\"\n        repository_selection:\n          description: Describe whether all repositories have been selected or there's\n            a selection involved\n          type: string\n          enum:\n          - all\n          - selected\n        single_file_name:\n          type:\n          - string\n          - 'null'\n          examples:\n          - config.yaml\n        has_multiple_single_files:\n          type: boolean\n          examples:\n          - true\n        single_file_paths:\n          type: array\n          items:\n            type: string\n          examples:\n          - config.yml\n          - \".github/issue_TEMPLATE.md\"\n        repositories_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/repos\n        account:\n          \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - permissions\n      - repository_selection\n      - single_file_name\n      - repositories_url\n      - account\n    authorization:\n      title: Authorization\n      description: The authorization for an OAuth app, GitHub App, or a Personal Access\n        Token.\n      type: object\n      properties:\n        id:\n          type: integer\n        url:\n          type: string\n          format: uri\n        scopes:\n          description: A list of scopes that this authorization is in.\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        token:\n          type: string\n        token_last_eight:\n          type:\n          - string\n          - 'null'\n        hashed_token:\n          type:\n          - string\n          - 'null'\n        app:\n          type: object\n          properties:\n            client_id:\n              type: string\n            name:\n              type: string\n            url:\n              type: string\n              format: uri\n          required:\n          - client_id\n          - name\n          - url\n        note:\n          type:\n          - string\n          - 'null'\n        note_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        updated_at:\n          type: string\n          format: date-time\n        created_at:\n          type: string\n          format: date-time\n        fingerprint:\n          type:\n          - string\n          - 'null'\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        installation:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/scoped-installation\"\n      required:\n      - app\n      - id\n      - note\n      - note_url\n      - scopes\n      - token\n      - hashed_token\n      - token_last_eight\n      - fingerprint\n      - url\n      - created_at\n      - updated_at\n      - expires_at\n    integration:\n      title: GitHub app\n      description: GitHub apps are a new way to extend GitHub. They can be installed\n        directly on organizations and user accounts and granted access to specific\n        repositories. They come with granular permissions and built-in webhooks. GitHub\n        apps are first class actors within GitHub.\n      type: object\n      properties:\n        id:\n          description: Unique identifier of the GitHub app\n          type: integer\n          examples:\n          - 37\n        slug:\n          description: The slug name of the GitHub app\n          type: string\n          examples:\n          - probot-owners\n        node_id:\n          type: string\n          examples:\n          - MDExOkludGVncmF0aW9uMQ==\n        owner:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        name:\n          description: The name of the GitHub app\n          type: string\n          examples:\n          - Probot Owners\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - The description of the app.\n        external_url:\n          type: string\n          format: uri\n          examples:\n          - https://example.com\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/apps/super-ci\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2017-07-08T16:18:44-04:00'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2017-07-08T16:18:44-04:00'\n        permissions:\n          description: The set of permissions for the GitHub app\n          type: object\n          properties:\n            issues:\n              type: string\n            checks:\n              type: string\n            metadata:\n              type: string\n            contents:\n              type: string\n            deployments:\n              type: string\n          additionalProperties:\n            type: string\n          example:\n            issues: read\n            deployments: write\n        events:\n          description: The list of events for the GitHub app\n          type: array\n          items:\n            type: string\n          examples:\n          - label\n          - deployment\n        installations_count:\n          description: The number of installations associated with the GitHub app\n          type: integer\n          examples:\n          - 5\n        client_id:\n          type: string\n          examples:\n          - '\"Iv1.25b5d1e65ffc4022\"'\n        client_secret:\n          type: string\n          examples:\n          - '\"1d4b2097ac622ba702d19de498f005747a8b21d3\"'\n        webhook_secret:\n          type:\n          - string\n          - 'null'\n          examples:\n          - '\"6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b\"'\n        pem:\n          type: string\n          examples:\n          - '\"-----BEGIN RSA PRIVATE KEY-----\\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\\n-----END\n            RSA PRIVATE KEY-----\\n\"'\n      required:\n      - id\n      - node_id\n      - owner\n      - name\n      - description\n      - external_url\n      - html_url\n      - created_at\n      - updated_at\n      - permissions\n      - events\n    basic-error:\n      title: Basic Error\n      description: Basic Error\n      type: object\n      properties:\n        message:\n          type: string\n        documentation_url:\n          type: string\n        url:\n          type: string\n        status:\n          type: string\n    validation-error-simple:\n      title: Validation Error Simple\n      description: Validation Error Simple\n      type: object\n      required:\n      - message\n      - documentation_url\n      properties:\n        message:\n          type: string\n        documentation_url:\n          type: string\n        errors:\n          type: array\n          items:\n            type: string\n    webhook-config-url:\n      type: string\n      description: The URL to which the payloads will be delivered.\n      format: uri\n      examples:\n      - https://example.com/webhook\n    webhook-config-content-type:\n      type: string\n      description: The media type used to serialize the payloads. Supported values\n        include `json` and `form`. The default is `form`.\n      examples:\n      - '\"json\"'\n    webhook-config-secret:\n      type: string\n      description: If provided, the `secret` will be used as the `key` to generate\n        the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#delivery-headers).\n      examples:\n      - '\"********\"'\n    webhook-config-insecure-ssl:\n      oneOf:\n      - type: string\n        description: Determines whether the SSL certificate of the host for `url`\n          will be verified when delivering payloads. Supported values include `0`\n          (verification is performed) and `1` (verification is not performed). The\n          default is `0`. **We strongly recommend not setting this to `1` as you are\n          subject to man-in-the-middle and other attacks.**\n        examples:\n        - '\"0\"'\n      - type: number\n    webhook-config:\n      title: Webhook Configuration\n      description: Configuration object of the webhook\n      type: object\n      properties:\n        url:\n          \"$ref\": \"#/components/schemas/webhook-config-url\"\n        content_type:\n          \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n        secret:\n          \"$ref\": \"#/components/schemas/webhook-config-secret\"\n        insecure_ssl:\n          \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n    enterprise:\n      title: Enterprise\n      description: An enterprise account\n      type: object\n      properties:\n        description:\n          description: A short description of the enterprise.\n          type:\n          - string\n          - 'null'\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/enterprises/octo-business\n        website_url:\n          description: The enterprise's website URL.\n          type:\n          - string\n          - 'null'\n          format: uri\n        id:\n          description: Unique identifier of the enterprise\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name:\n          description: The name of the enterprise.\n          type: string\n          examples:\n          - Octo Business\n        slug:\n          description: The slug url identifier for the enterprise.\n          type: string\n          examples:\n          - octo-business\n        created_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2019-01-26T19:01:12Z'\n        updated_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2019-01-26T19:14:43Z'\n        avatar_url:\n          type: string\n          format: uri\n      required:\n      - id\n      - node_id\n      - name\n      - slug\n      - html_url\n      - created_at\n      - updated_at\n      - avatar_url\n    installation:\n      title: Installation\n      description: Installation\n      type: object\n      properties:\n        id:\n          description: The ID of the installation.\n          type: integer\n          examples:\n          - 1\n        account:\n          anyOf:\n          - \"$ref\": \"#/components/schemas/simple-user\"\n          - \"$ref\": \"#/components/schemas/enterprise\"\n          type:\n          - 'null'\n          - object\n        repository_selection:\n          description: Describe whether all repositories have been selected or there's\n            a selection involved\n          type: string\n          enum:\n          - all\n          - selected\n        access_tokens_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/installations/1/access_tokens\n        repositories_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/installation/repositories\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/organizations/github/settings/installations/1\n        app_id:\n          type: integer\n          examples:\n          - 1\n        target_id:\n          description: The ID of the user or organization this token is being scoped\n            to.\n          type: integer\n        target_type:\n          type: string\n          examples:\n          - Organization\n        permissions:\n          \"$ref\": \"#/components/schemas/app-permissions\"\n        events:\n          type: array\n          items:\n            type: string\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        single_file_name:\n          type:\n          - string\n          - 'null'\n          examples:\n          - config.yaml\n        has_multiple_single_files:\n          type: boolean\n          examples:\n          - true\n        single_file_paths:\n          type: array\n          items:\n            type: string\n          examples:\n          - config.yml\n          - \".github/issue_TEMPLATE.md\"\n        app_slug:\n          type: string\n          examples:\n          - github-actions\n        suspended_by:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        suspended_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        contact_email:\n          type:\n          - string\n          - 'null'\n          examples:\n          - '\"test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com\"'\n      required:\n      - id\n      - app_id\n      - app_slug\n      - target_id\n      - target_type\n      - single_file_name\n      - repository_selection\n      - access_tokens_url\n      - html_url\n      - repositories_url\n      - events\n      - account\n      - permissions\n      - created_at\n      - updated_at\n      - suspended_by\n      - suspended_at\n    license-simple:\n      title: License Simple\n      description: License Simple\n      type: object\n      properties:\n        key:\n          type: string\n          examples:\n          - mit\n        name:\n          type: string\n          examples:\n          - MIT License\n        url:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - https://api.github.com/licenses/mit\n        spdx_id:\n          type:\n          - string\n          - 'null'\n          examples:\n          - MIT\n        node_id:\n          type: string\n          examples:\n          - MDc6TGljZW5zZW1pdA==\n        html_url:\n          type: string\n          format: uri\n      required:\n      - key\n      - name\n      - url\n      - spdx_id\n      - node_id\n    repository:\n      title: Repository\n      description: A git repository\n      type: object\n      properties:\n        id:\n          description: Unique identifier of the repository\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name:\n          description: The name of the repository.\n          type: string\n          examples:\n          - Team Environment\n        full_name:\n          type: string\n          examples:\n          - octocat/Hello-World\n        license:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/license-simple\"\n        organization:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        forks:\n          type: integer\n        permissions:\n          type: object\n          properties:\n            admin:\n              type: boolean\n            pull:\n              type: boolean\n            triage:\n              type: boolean\n            push:\n              type: boolean\n            maintain:\n              type: boolean\n          required:\n          - admin\n          - pull\n          - push\n        owner:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        private:\n          description: Whether the repository is private or public.\n          default: false\n          type: boolean\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - This your first repo!\n        fork:\n          type: boolean\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World\n        archive_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/downloads\n        events_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/events\n        forks_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url:\n          type: string\n          examples:\n          - git:github.com/octocat/Hello-World.git\n        issue_comment_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/languages\n        merges_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url:\n          type: string\n          examples:\n          - git@github.com:octocat/Hello-World.git\n        stargazers_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/tags\n        teams_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/teams\n        trees_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url:\n          type: string\n          examples:\n          - https://github.com/octocat/Hello-World.git\n        mirror_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - git:git.example.com/octocat/Hello-World\n        hooks_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url:\n          type: string\n          format: uri\n          examples:\n          - https://svn.github.com/octocat/Hello-World\n        homepage:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - https://github.com\n        language:\n          type:\n          - string\n          - 'null'\n        forks_count:\n          type: integer\n          examples:\n          - 9\n        stargazers_count:\n          type: integer\n          examples:\n          - 80\n        watchers_count:\n          type: integer\n          examples:\n          - 80\n        size:\n          type: integer\n          examples:\n          - 108\n        default_branch:\n          description: The default branch of the repository.\n          type: string\n          examples:\n          - master\n        open_issues_count:\n          type: integer\n          examples:\n          - 0\n        is_template:\n          description: Whether this repository acts as a template that can be used\n            to generate new repositories.\n          default: false\n          type: boolean\n          examples:\n          - true\n        topics:\n          type: array\n          items:\n            type: string\n        has_issues:\n          description: Whether issues are enabled.\n          default: true\n          type: boolean\n          examples:\n          - true\n        has_projects:\n          description: Whether projects are enabled.\n          default: true\n          type: boolean\n          examples:\n          - true\n        has_wiki:\n          description: Whether the wiki is enabled.\n          default: true\n          type: boolean\n          examples:\n          - true\n        has_pages:\n          type: boolean\n        has_downloads:\n          description: Whether downloads are enabled.\n          default: true\n          type: boolean\n          examples:\n          - true\n        archived:\n          description: Whether the repository is archived.\n          default: false\n          type: boolean\n        disabled:\n          type: boolean\n          description: Returns whether or not this repository disabled.\n        visibility:\n          description: 'The repository visibility: public, private, or internal.'\n          default: public\n          type: string\n        pushed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:06:43Z'\n        created_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        updated_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:14:43Z'\n        allow_rebase_merge:\n          description: Whether to allow rebase merges for pull requests.\n          default: true\n          type: boolean\n          examples:\n          - true\n        template_repository:\n          type:\n          - object\n          - 'null'\n          properties:\n            id:\n              type: integer\n            node_id:\n              type: string\n            name:\n              type: string\n            full_name:\n              type: string\n            owner:\n              type: object\n              properties:\n                login:\n                  type: string\n                id:\n                  type: integer\n                node_id:\n                  type: string\n                avatar_url:\n                  type: string\n                gravatar_id:\n                  type: string\n                url:\n                  type: string\n                html_url:\n                  type: string\n                followers_url:\n                  type: string\n                following_url:\n                  type: string\n                gists_url:\n                  type: string\n                starred_url:\n                  type: string\n                subscriptions_url:\n                  type: string\n                organizations_url:\n                  type: string\n                repos_url:\n                  type: string\n                events_url:\n                  type: string\n                received_events_url:\n                  type: string\n                type:\n                  type: string\n                site_admin:\n                  type: boolean\n            private:\n              type: boolean\n            html_url:\n              type: string\n            description:\n              type: string\n            fork:\n              type: boolean\n            url:\n              type: string\n            archive_url:\n              type: string\n            assignees_url:\n              type: string\n            blobs_url:\n              type: string\n            branches_url:\n              type: string\n            collaborators_url:\n              type: string\n            comments_url:\n              type: string\n            commits_url:\n              type: string\n            compare_url:\n              type: string\n            contents_url:\n              type: string\n            contributors_url:\n              type: string\n            deployments_url:\n              type: string\n            downloads_url:\n              type: string\n            events_url:\n              type: string\n            forks_url:\n              type: string\n            git_commits_url:\n              type: string\n            git_refs_url:\n              type: string\n            git_tags_url:\n              type: string\n            git_url:\n              type: string\n            issue_comment_url:\n              type: string\n            issue_events_url:\n              type: string\n            issues_url:\n              type: string\n            keys_url:\n              type: string\n            labels_url:\n              type: string\n            languages_url:\n              type: string\n            merges_url:\n              type: string\n            milestones_url:\n              type: string\n            notifications_url:\n              type: string\n            pulls_url:\n              type: string\n            releases_url:\n              type: string\n            ssh_url:\n              type: string\n            stargazers_url:\n              type: string\n            statuses_url:\n              type: string\n            subscribers_url:\n              type: string\n            subscription_url:\n              type: string\n            tags_url:\n              type: string\n            teams_url:\n              type: string\n            trees_url:\n              type: string\n            clone_url:\n              type: string\n            mirror_url:\n              type: string\n            hooks_url:\n              type: string\n            svn_url:\n              type: string\n            homepage:\n              type: string\n            language:\n              type: string\n            forks_count:\n              type: integer\n            stargazers_count:\n              type: integer\n            watchers_count:\n              type: integer\n            size:\n              type: integer\n            default_branch:\n              type: string\n            open_issues_count:\n              type: integer\n            is_template:\n              type: boolean\n            topics:\n              type: array\n              items:\n                type: string\n            has_issues:\n              type: boolean\n            has_projects:\n              type: boolean\n            has_wiki:\n              type: boolean\n            has_pages:\n              type: boolean\n            has_downloads:\n              type: boolean\n            archived:\n              type: boolean\n            disabled:\n              type: boolean\n            visibility:\n              type: string\n            pushed_at:\n              type: string\n            created_at:\n              type: string\n            updated_at:\n              type: string\n            permissions:\n              type: object\n              properties:\n                admin:\n                  type: boolean\n                maintain:\n                  type: boolean\n                push:\n                  type: boolean\n                triage:\n                  type: boolean\n                pull:\n                  type: boolean\n            allow_rebase_merge:\n              type: boolean\n            temp_clone_token:\n              type: string\n            allow_squash_merge:\n              type: boolean\n            delete_branch_on_merge:\n              type: boolean\n            allow_update_branch:\n              type: boolean\n            allow_merge_commit:\n              type: boolean\n            subscribers_count:\n              type: integer\n            network_count:\n              type: integer\n        temp_clone_token:\n          type: string\n        allow_squash_merge:\n          description: Whether to allow squash merges for pull requests.\n          default: true\n          type: boolean\n          examples:\n          - true\n        delete_branch_on_merge:\n          description: Whether to delete head branches when pull requests are merged\n          default: false\n          type: boolean\n          examples:\n          - false\n        allow_merge_commit:\n          description: Whether to allow merge commits for pull requests.\n          default: true\n          type: boolean\n          examples:\n          - true\n        allow_forking:\n          description: Whether to allow forking this repo\n          type: boolean\n        subscribers_count:\n          type: integer\n        network_count:\n          type: integer\n        open_issues:\n          type: integer\n        watchers:\n          type: integer\n        master_branch:\n          type: string\n        starred_at:\n          type: string\n          examples:\n          - '\"2020-07-09T00:17:42Z\"'\n      required:\n      - archive_url\n      - assignees_url\n      - blobs_url\n      - branches_url\n      - collaborators_url\n      - comments_url\n      - commits_url\n      - compare_url\n      - contents_url\n      - contributors_url\n      - deployments_url\n      - description\n      - downloads_url\n      - events_url\n      - fork\n      - forks_url\n      - full_name\n      - git_commits_url\n      - git_refs_url\n      - git_tags_url\n      - hooks_url\n      - html_url\n      - id\n      - node_id\n      - issue_comment_url\n      - issue_events_url\n      - issues_url\n      - keys_url\n      - labels_url\n      - languages_url\n      - merges_url\n      - milestones_url\n      - name\n      - notifications_url\n      - owner\n      - private\n      - pulls_url\n      - releases_url\n      - stargazers_url\n      - statuses_url\n      - subscribers_url\n      - subscription_url\n      - tags_url\n      - teams_url\n      - trees_url\n      - url\n      - clone_url\n      - default_branch\n      - forks\n      - forks_count\n      - git_url\n      - has_downloads\n      - has_issues\n      - has_projects\n      - has_wiki\n      - has_pages\n      - homepage\n      - language\n      - archived\n      - disabled\n      - mirror_url\n      - open_issues\n      - open_issues_count\n      - license\n      - pushed_at\n      - size\n      - ssh_url\n      - stargazers_count\n      - svn_url\n      - watchers\n      - watchers_count\n      - created_at\n      - updated_at\n    installation-token:\n      title: Installation Token\n      description: Authentication token for a GitHub App installed on a user or org.\n      type: object\n      properties:\n        token:\n          type: string\n        expires_at:\n          type: string\n        permissions:\n          \"$ref\": \"#/components/schemas/app-permissions\"\n        repository_selection:\n          type: string\n          enum:\n          - all\n          - selected\n        repositories:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/repository\"\n        single_file:\n          type: string\n          examples:\n          - README.md\n        has_multiple_single_files:\n          type: boolean\n          examples:\n          - true\n        single_file_paths:\n          type: array\n          items:\n            type: string\n          examples:\n          - config.yml\n          - \".github/issue_TEMPLATE.md\"\n      required:\n      - token\n      - expires_at\n    validation-error:\n      title: Validation Error\n      description: Validation Error\n      type: object\n      required:\n      - message\n      - documentation_url\n      properties:\n        message:\n          type: string\n        documentation_url:\n          type: string\n        errors:\n          type: array\n          items:\n            type: object\n            required:\n            - code\n            properties:\n              resource:\n                type: string\n              field:\n                type: string\n              message:\n                type: string\n              code:\n                type: string\n              index:\n                type: integer\n              value:\n                oneOf:\n                - type:\n                  - string\n                  - 'null'\n                - type:\n                  - integer\n                  - 'null'\n                - type:\n                  - array\n                  - 'null'\n                  items:\n                    type: string\n    application-grant:\n      title: Application Grant\n      description: The authorization associated with an OAuth Access.\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 1\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/applications/grants/1\n        app:\n          type: object\n          properties:\n            client_id:\n              type: string\n            name:\n              type: string\n            url:\n              type: string\n              format: uri\n          required:\n          - client_id\n          - name\n          - url\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-09-06T17:26:27Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-09-06T20:39:23Z'\n        scopes:\n          type: array\n          items:\n            type: string\n          examples:\n          - public_repo\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - app\n      - id\n      - scopes\n      - url\n      - created_at\n      - updated_at\n    code-of-conduct:\n      title: Code Of Conduct\n      description: Code Of Conduct\n      type: object\n      properties:\n        key:\n          type: string\n          examples:\n          - contributor_covenant\n        name:\n          type: string\n          examples:\n          - Contributor Covenant\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/codes_of_conduct/contributor_covenant\n        body:\n          type: string\n          examples:\n          - |\n            # Contributor Covenant Code of Conduct\n\n            ## Our Pledge\n\n            In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n            ## Our Standards\n\n            Examples of behavior that contributes to creating a positive environment include:\n\n            * Using welcoming and inclusive language\n            * Being respectful of differing viewpoints and experiences\n            * Gracefully accepting constructive criticism\n            * Focusing on what is best for the community\n            * Showing empathy towards other community members\n\n            Examples of unacceptable behavior by participants include:\n\n            * The use of sexualized language or imagery and unwelcome sexual attention or advances\n            * Trolling, insulting/derogatory comments, and personal or political attacks\n            * Public or private harassment\n            * Publishing others' private information, such as a physical or electronic address, without explicit permission\n            * Other conduct which could reasonably be considered inappropriate in a professional setting\n\n            ## Our Responsibilities\n\n            Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\n                              to any instances of unacceptable behavior.\n\n            Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n            ## Scope\n\n            This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\n                              posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n            ## Enforcement\n\n            Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\n            Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n            ## Attribution\n\n            This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n            [homepage]: http://contributor-covenant.org\n            [version]: http://contributor-covenant.org/version/1/4/\n        html_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n      required:\n      - url\n      - html_url\n      - key\n      - name\n    announcement-message:\n      type: string\n      description: The announcement text in GitHub Flavored Markdown. For more information\n        about GitHub Flavored Markdown, see \"[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.0/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax).\"\n      examples:\n      - Very **important** announcement about _nothing_.\n    announcement-expiration:\n      type:\n      - string\n      - 'null'\n      format: date-time\n      description: 'The time at which the announcement expires. This is a timestamp\n        in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.\n        To set an announcement that never expires, omit this parameter, set it to\n        `null`, or set it to an empty string.'\n      examples:\n      - '\"2021-01-01T00:00:00.000-07:00\"'\n    announcement:\n      title: Enterprise Announcement\n      description: Enterprise global announcement\n      type: object\n      properties:\n        announcement:\n          \"$ref\": \"#/components/schemas/announcement-message\"\n        expires_at:\n          \"$ref\": \"#/components/schemas/announcement-expiration\"\n      required:\n      - announcement\n    license-info:\n      type: object\n      properties:\n        seats:\n          oneOf:\n          - type: string\n          - type: integer\n        seats_used:\n          type: integer\n        seats_available:\n          oneOf:\n          - type: string\n          - type: integer\n        kind:\n          type: string\n        days_until_expiration:\n          type: integer\n        expire_at:\n          type: string\n    enterprise-repository-overview:\n      title: Repository Enterprise Stats\n      type: object\n      properties:\n        total_repos:\n          type: integer\n        root_repos:\n          type: integer\n        fork_repos:\n          type: integer\n        org_repos:\n          type: integer\n        total_pushes:\n          type: integer\n        total_wikis:\n          type: integer\n      required:\n      - total_repos\n      - root_repos\n      - fork_repos\n      - org_repos\n      - total_pushes\n      - total_wikis\n    enterprise-hook-overview:\n      title: Hooks Enterprise Stats\n      type: object\n      properties:\n        total_hooks:\n          type: integer\n        active_hooks:\n          type: integer\n        inactive_hooks:\n          type: integer\n      required:\n      - total_hooks\n      - active_hooks\n      - inactive_hooks\n    enterprise-page-overview:\n      title: Enterprise Pages Stats\n      type: object\n      properties:\n        total_pages:\n          type: integer\n      required:\n      - total_pages\n    enterprise-organization-overview:\n      title: Enterprise Organization Stats\n      type: object\n      properties:\n        total_orgs:\n          type: integer\n        disabled_orgs:\n          type: integer\n        total_teams:\n          type: integer\n        total_team_members:\n          type: integer\n      required:\n      - total_orgs\n      - disabled_orgs\n      - total_teams\n      - total_team_members\n    enterprise-user-overview:\n      title: Enterprise User Stats\n      type: object\n      properties:\n        total_users:\n          type: integer\n        admin_users:\n          type: integer\n        suspended_users:\n          type: integer\n      required:\n      - total_users\n      - admin_users\n      - suspended_users\n    enterprise-pull-request-overview:\n      title: Enterprise Pull Request Stats\n      type: object\n      properties:\n        total_pulls:\n          type: integer\n        merged_pulls:\n          type: integer\n        mergeable_pulls:\n          type: integer\n        unmergeable_pulls:\n          type: integer\n      required:\n      - total_pulls\n      - merged_pulls\n      - mergeable_pulls\n      - unmergeable_pulls\n    enterprise-issue-overview:\n      title: Enterprise Issue Stats\n      type: object\n      properties:\n        total_issues:\n          type: integer\n        open_issues:\n          type: integer\n        closed_issues:\n          type: integer\n      required:\n      - total_issues\n      - open_issues\n      - closed_issues\n    enterprise-milestone-overview:\n      title: Enterprise Milestone Stats\n      type: object\n      properties:\n        total_milestones:\n          type: integer\n        open_milestones:\n          type: integer\n        closed_milestones:\n          type: integer\n      required:\n      - total_milestones\n      - open_milestones\n      - closed_milestones\n    enterprise-gist-overview:\n      title: Enterprise Gist Stats\n      type: object\n      properties:\n        total_gists:\n          type: integer\n        private_gists:\n          type: integer\n        public_gists:\n          type: integer\n      required:\n      - total_gists\n      - private_gists\n      - public_gists\n    enterprise-comment-overview:\n      title: Enterprise Comment Stats\n      type: object\n      properties:\n        total_commit_comments:\n          type: integer\n        total_gist_comments:\n          type: integer\n        total_issue_comments:\n          type: integer\n        total_pull_request_comments:\n          type: integer\n      required:\n      - total_commit_comments\n      - total_gist_comments\n      - total_issue_comments\n      - total_pull_request_comments\n    enterprise-overview:\n      type: object\n      properties:\n        repos:\n          \"$ref\": \"#/components/schemas/enterprise-repository-overview\"\n        hooks:\n          \"$ref\": \"#/components/schemas/enterprise-hook-overview\"\n        pages:\n          \"$ref\": \"#/components/schemas/enterprise-page-overview\"\n        orgs:\n          \"$ref\": \"#/components/schemas/enterprise-organization-overview\"\n        users:\n          \"$ref\": \"#/components/schemas/enterprise-user-overview\"\n        pulls:\n          \"$ref\": \"#/components/schemas/enterprise-pull-request-overview\"\n        issues:\n          \"$ref\": \"#/components/schemas/enterprise-issue-overview\"\n        milestones:\n          \"$ref\": \"#/components/schemas/enterprise-milestone-overview\"\n        gists:\n          \"$ref\": \"#/components/schemas/enterprise-gist-overview\"\n        comments:\n          \"$ref\": \"#/components/schemas/enterprise-comment-overview\"\n    enabled-organizations:\n      type: string\n      description: 'The policy that controls the organizations in the enterprise that\n        are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`.'\n      enum:\n      - all\n      - none\n      - selected\n    allowed-actions:\n      type: string\n      description: 'The permissions policy that controls the actions that are allowed\n        to run. Can be one of: `all`, `local_only`, or `selected`.'\n      enum:\n      - all\n      - local_only\n      - selected\n    selected-actions-url:\n      type: string\n      description: The API URL to use to get or set the actions that are allowed to\n        run, when `allowed_actions` is set to `selected`.\n    actions-enterprise-permissions:\n      type: object\n      properties:\n        enabled_organizations:\n          \"$ref\": \"#/components/schemas/enabled-organizations\"\n        selected_organizations_url:\n          type: string\n          description: The API URL to use to get or set the selected organizations\n            that are allowed to run GitHub Actions, when `enabled_organizations` is\n            set to `selected`.\n        allowed_actions:\n          \"$ref\": \"#/components/schemas/allowed-actions\"\n        selected_actions_url:\n          \"$ref\": \"#/components/schemas/selected-actions-url\"\n      required:\n      - enabled_organizations\n    selected-actions:\n      type: object\n      properties:\n        github_owned_allowed:\n          type: boolean\n          description: Whether GitHub-owned actions are allowed. For example, this\n            includes the actions in the `actions` organization.\n        patterns_allowed:\n          type: array\n          description: Specifies a list of string-matching patterns to allow specific\n            action(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`,\n            `monalisa/octocat@v2`, `monalisa/*`.\"\n          items:\n            type: string\n      required:\n      - github_owned_allowed\n      - patterns_allowed\n    runner-groups-enterprise:\n      type: object\n      properties:\n        id:\n          type: number\n        name:\n          type: string\n        visibility:\n          type: string\n        default:\n          type: boolean\n        selected_organizations_url:\n          type: string\n        runners_url:\n          type: string\n        allows_public_repositories:\n          type: boolean\n      required:\n      - id\n      - name\n      - visibility\n      - allows_public_repositories\n      - default\n      - runners_url\n    runner-label:\n      title: Self hosted runner label\n      description: A label for a self hosted runner\n      type: object\n      properties:\n        id:\n          type: integer\n          description: Unique identifier of the label.\n        name:\n          type: string\n          description: Name of the label.\n        type:\n          type: string\n          description: The type of label. Read-only labels are applied automatically\n            when the runner is configured.\n          enum:\n          - read-only\n          - custom\n      required:\n      - name\n    runner:\n      title: Self hosted runners\n      description: A self hosted runner\n      type: object\n      properties:\n        id:\n          description: The id of the runner.\n          type: integer\n          examples:\n          - 5\n        name:\n          description: The name of the runner.\n          type: string\n          examples:\n          - iMac\n        os:\n          description: The Operating System of the runner.\n          type: string\n          examples:\n          - macos\n        status:\n          description: The status of the runner.\n          type: string\n          examples:\n          - online\n        busy:\n          type: boolean\n        labels:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/runner-label\"\n      required:\n      - id\n      - name\n      - os\n      - status\n      - busy\n      - labels\n    runner-application:\n      title: Runner Application\n      description: Runner Application\n      type: object\n      properties:\n        os:\n          type: string\n        architecture:\n          type: string\n        download_url:\n          type: string\n        filename:\n          type: string\n        temp_download_token:\n          description: A short lived bearer token used to download the runner, if\n            needed.\n          type: string\n        sha256_checksum:\n          type: string\n      required:\n      - os\n      - architecture\n      - download_url\n      - filename\n    authentication-token:\n      title: Authentication Token\n      description: Authentication Token\n      type: object\n      properties:\n        token:\n          description: The token used for authentication\n          type: string\n          examples:\n          - v1.1f699f1069f60xxx\n        expires_at:\n          description: The time this token expires\n          type: string\n          format: date-time\n          examples:\n          - '2016-07-11T22:14:10Z'\n        permissions:\n          type: object\n          examples:\n          - issues: read\n            deployments: write\n        repositories:\n          description: The repositories this token has access to\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/repository\"\n        single_file:\n          type:\n          - string\n          - 'null'\n          examples:\n          - config.yaml\n        repository_selection:\n          description: Describe whether all repositories have been selected or there's\n            a selection involved\n          type: string\n          enum:\n          - all\n          - selected\n      required:\n      - token\n      - expires_at\n    actor:\n      title: Actor\n      description: Actor\n      type: object\n      properties:\n        id:\n          type: integer\n        login:\n          type: string\n        display_login:\n          type: string\n        gravatar_id:\n          type:\n          - string\n          - 'null'\n        url:\n          type: string\n          format: uri\n        avatar_url:\n          type: string\n          format: uri\n      required:\n      - id\n      - login\n      - gravatar_id\n      - url\n      - avatar_url\n    milestone:\n      title: Milestone\n      description: A collection of related issues and pull requests.\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/milestones/1\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/milestones/v1.0\n        labels_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n        id:\n          type: integer\n          examples:\n          - 1002604\n        node_id:\n          type: string\n          examples:\n          - MDk6TWlsZXN0b25lMTAwMjYwNA==\n        number:\n          description: The number of the milestone.\n          type: integer\n          examples:\n          - 42\n        state:\n          description: The state of the milestone.\n          type: string\n          enum:\n          - open\n          - closed\n          default: open\n          examples:\n          - open\n        title:\n          description: The title of the milestone.\n          type: string\n          examples:\n          - v1.0\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Tracking milestone for version 1.0\n        creator:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        open_issues:\n          type: integer\n          examples:\n          - 4\n        closed_issues:\n          type: integer\n          examples:\n          - 8\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-10T20:09:31Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2014-03-03T18:58:10Z'\n        closed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2013-02-12T13:22:01Z'\n        due_on:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2012-10-09T23:39:01Z'\n      required:\n      - closed_issues\n      - creator\n      - description\n      - due_on\n      - closed_at\n      - id\n      - node_id\n      - labels_url\n      - html_url\n      - number\n      - open_issues\n      - state\n      - title\n      - url\n      - created_at\n      - updated_at\n    author_association:\n      title: author_association\n      type: string\n      description: How the author is associated with the repository.\n      enum:\n      - COLLABORATOR\n      - CONTRIBUTOR\n      - FIRST_TIMER\n      - FIRST_TIME_CONTRIBUTOR\n      - MANNEQUIN\n      - MEMBER\n      - NONE\n      - OWNER\n      examples:\n      - OWNER\n    reaction-rollup:\n      title: Reaction Rollup\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        total_count:\n          type: integer\n        \"+1\":\n          type: integer\n        \"-1\":\n          type: integer\n        laugh:\n          type: integer\n        confused:\n          type: integer\n        heart:\n          type: integer\n        hooray:\n          type: integer\n        eyes:\n          type: integer\n        rocket:\n          type: integer\n      required:\n      - url\n      - total_count\n      - \"+1\"\n      - \"-1\"\n      - laugh\n      - confused\n      - heart\n      - hooray\n      - eyes\n      - rocket\n    issue:\n      title: Issue\n      description: Issues are a great way to keep track of tasks, enhancements, and\n        bugs for your projects.\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          description: URL for the issue\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repositories/42/issues/1\n        repository_url:\n          type: string\n          format: uri\n        labels_url:\n          type: string\n        comments_url:\n          type: string\n          format: uri\n        events_url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n        number:\n          description: Number uniquely identifying the issue within its repository\n          type: integer\n          examples:\n          - 42\n        state:\n          description: State of the issue; either 'open' or 'closed'\n          type: string\n          examples:\n          - open\n        title:\n          description: Title of the issue\n          type: string\n          examples:\n          - Widget creation fails in Safari on OS X 10.8\n        body:\n          description: Contents of the issue\n          type:\n          - string\n          - 'null'\n          examples:\n          - It looks like the new widget form is broken on Safari. When I try and\n            create the widget, Safari crashes. This is reproducible on 10.8, but not\n            10.9. Maybe a browser bug?\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        labels:\n          description: Labels to associate with this issue; pass one or more label\n            names to replace the set of labels on this issue; send an empty array\n            to clear all labels from the issue; note that the labels are silently\n            dropped for users without push access to the repository\n          type: array\n          items:\n            oneOf:\n            - type: string\n            - type: object\n              properties:\n                id:\n                  type: integer\n                  format: int64\n                node_id:\n                  type: string\n                url:\n                  type: string\n                  format: uri\n                name:\n                  type: string\n                description:\n                  type:\n                  - string\n                  - 'null'\n                color:\n                  type:\n                  - string\n                  - 'null'\n                default:\n                  type: boolean\n          examples:\n          - bug\n          - registration\n        assignee:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        assignees:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/simple-user\"\n        milestone:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/milestone\"\n        locked:\n          type: boolean\n        active_lock_reason:\n          type:\n          - string\n          - 'null'\n        comments:\n          type: integer\n        pull_request:\n          type: object\n          properties:\n            merged_at:\n              type:\n              - string\n              - 'null'\n              format: date-time\n            diff_url:\n              type:\n              - string\n              - 'null'\n              format: uri\n            html_url:\n              type:\n              - string\n              - 'null'\n              format: uri\n            patch_url:\n              type:\n              - string\n              - 'null'\n              format: uri\n            url:\n              type:\n              - string\n              - 'null'\n              format: uri\n          required:\n          - diff_url\n          - html_url\n          - patch_url\n          - url\n        closed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        draft:\n          type: boolean\n        closed_by:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        body_html:\n          type: string\n        body_text:\n          type: string\n        timeline_url:\n          type: string\n          format: uri\n        repository:\n          \"$ref\": \"#/components/schemas/repository\"\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n      required:\n      - assignee\n      - closed_at\n      - comments\n      - comments_url\n      - events_url\n      - html_url\n      - id\n      - node_id\n      - labels\n      - labels_url\n      - milestone\n      - number\n      - repository_url\n      - state\n      - locked\n      - title\n      - url\n      - user\n      - author_association\n      - created_at\n      - updated_at\n    issue-comment:\n      title: Issue Comment\n      description: Comments provide a way for people to collaborate on an issue.\n      type: object\n      properties:\n        id:\n          description: Unique identifier of the issue comment\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n        url:\n          description: URL for the issue comment\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repositories/42/issues/comments/1\n        body:\n          description: Contents of the issue comment\n          type: string\n          examples:\n          - What version of Safari were you using when you observed this bug?\n        body_text:\n          type: string\n        body_html:\n          type: string\n        html_url:\n          type: string\n          format: uri\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        issue_url:\n          type: string\n          format: uri\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n      required:\n      - id\n      - node_id\n      - html_url\n      - issue_url\n      - author_association\n      - user\n      - url\n      - created_at\n      - updated_at\n    event:\n      title: Event\n      description: Event\n      type: object\n      properties:\n        id:\n          type: string\n        type:\n          type:\n          - string\n          - 'null'\n        actor:\n          \"$ref\": \"#/components/schemas/actor\"\n        repo:\n          type: object\n          properties:\n            id:\n              type: integer\n            name:\n              type: string\n            url:\n              type: string\n              format: uri\n          required:\n          - id\n          - name\n          - url\n        org:\n          \"$ref\": \"#/components/schemas/actor\"\n        payload:\n          type: object\n          properties:\n            action:\n              type: string\n            issue:\n              \"$ref\": \"#/components/schemas/issue\"\n            comment:\n              \"$ref\": \"#/components/schemas/issue-comment\"\n            pages:\n              type: array\n              items:\n                type: object\n                properties:\n                  page_name:\n                    type: string\n                  title:\n                    type: string\n                  summary:\n                    type:\n                    - string\n                    - 'null'\n                  action:\n                    type: string\n                  sha:\n                    type: string\n                  html_url:\n                    type: string\n        public:\n          type: boolean\n        created_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n      required:\n      - id\n      - type\n      - actor\n      - repo\n      - payload\n      - public\n      - created_at\n    link-with-type:\n      title: Link With Type\n      description: Hypermedia Link with Type\n      type: object\n      properties:\n        href:\n          type: string\n        type:\n          type: string\n      required:\n      - href\n      - type\n    feed:\n      title: Feed\n      description: Feed\n      type: object\n      properties:\n        timeline_url:\n          type: string\n          examples:\n          - https://github.com/timeline\n        user_url:\n          type: string\n          examples:\n          - https://github.com/{user}\n        current_user_public_url:\n          type: string\n          examples:\n          - https://github.com/octocat\n        current_user_url:\n          type: string\n          examples:\n          - https://github.com/octocat.private?token=abc123\n        current_user_actor_url:\n          type: string\n          examples:\n          - https://github.com/octocat.private.actor?token=abc123\n        current_user_organization_url:\n          type: string\n          examples:\n          - https://github.com/octocat-org\n        current_user_organization_urls:\n          type: array\n          items:\n            type: string\n            format: uri\n          examples:\n          - https://github.com/organizations/github/octocat.private.atom?token=abc123\n        _links:\n          type: object\n          properties:\n            timeline:\n              \"$ref\": \"#/components/schemas/link-with-type\"\n            user:\n              \"$ref\": \"#/components/schemas/link-with-type\"\n            security_advisories:\n              \"$ref\": \"#/components/schemas/link-with-type\"\n            current_user:\n              \"$ref\": \"#/components/schemas/link-with-type\"\n            current_user_public:\n              \"$ref\": \"#/components/schemas/link-with-type\"\n            current_user_actor:\n              \"$ref\": \"#/components/schemas/link-with-type\"\n            current_user_organization:\n              \"$ref\": \"#/components/schemas/link-with-type\"\n            current_user_organizations:\n              type: array\n              items:\n                \"$ref\": \"#/components/schemas/link-with-type\"\n          required:\n          - timeline\n          - user\n      required:\n      - _links\n      - timeline_url\n      - user_url\n    base-gist:\n      title: Base Gist\n      description: Base Gist\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        forks_url:\n          type: string\n          format: uri\n        commits_url:\n          type: string\n          format: uri\n        id:\n          type: string\n        node_id:\n          type: string\n        git_pull_url:\n          type: string\n          format: uri\n        git_push_url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n        files:\n          type: object\n          additionalProperties:\n            type: object\n            properties:\n              filename:\n                type: string\n              type:\n                type: string\n              language:\n                type: string\n              raw_url:\n                type: string\n              size:\n                type: integer\n        public:\n          type: boolean\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        description:\n          type:\n          - string\n          - 'null'\n        comments:\n          type: integer\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        comments_url:\n          type: string\n          format: uri\n        owner:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        truncated:\n          type: boolean\n        forks:\n          type: array\n          items: {}\n        history:\n          type: array\n          items: {}\n      required:\n      - id\n      - node_id\n      - url\n      - forks_url\n      - commits_url\n      - git_pull_url\n      - git_push_url\n      - html_url\n      - comments_url\n      - public\n      - description\n      - comments\n      - user\n      - files\n      - created_at\n      - updated_at\n    public-user:\n      title: Public User\n      description: Public User\n      type: object\n      properties:\n        login:\n          type: string\n        id:\n          type: integer\n        node_id:\n          type: string\n        avatar_url:\n          type: string\n          format: uri\n        gravatar_id:\n          type:\n          - string\n          - 'null'\n        url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n        followers_url:\n          type: string\n          format: uri\n        following_url:\n          type: string\n        gists_url:\n          type: string\n        starred_url:\n          type: string\n        subscriptions_url:\n          type: string\n          format: uri\n        organizations_url:\n          type: string\n          format: uri\n        repos_url:\n          type: string\n          format: uri\n        events_url:\n          type: string\n        received_events_url:\n          type: string\n          format: uri\n        type:\n          type: string\n        site_admin:\n          type: boolean\n        name:\n          type:\n          - string\n          - 'null'\n        company:\n          type:\n          - string\n          - 'null'\n        blog:\n          type:\n          - string\n          - 'null'\n        location:\n          type:\n          - string\n          - 'null'\n        email:\n          type:\n          - string\n          - 'null'\n          format: email\n        hireable:\n          type:\n          - boolean\n          - 'null'\n        bio:\n          type:\n          - string\n          - 'null'\n        public_repos:\n          type: integer\n        public_gists:\n          type: integer\n        followers:\n          type: integer\n        following:\n          type: integer\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        plan:\n          type: object\n          properties:\n            collaborators:\n              type: integer\n            name:\n              type: string\n            space:\n              type: integer\n            private_repos:\n              type: integer\n          required:\n          - collaborators\n          - name\n          - space\n          - private_repos\n        suspended_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        private_gists:\n          type: integer\n          examples:\n          - 1\n        total_private_repos:\n          type: integer\n          examples:\n          - 2\n        owned_private_repos:\n          type: integer\n          examples:\n          - 2\n        disk_usage:\n          type: integer\n          examples:\n          - 1\n        collaborators:\n          type: integer\n          examples:\n          - 3\n      required:\n      - avatar_url\n      - events_url\n      - followers_url\n      - following_url\n      - gists_url\n      - gravatar_id\n      - html_url\n      - id\n      - node_id\n      - login\n      - organizations_url\n      - received_events_url\n      - repos_url\n      - site_admin\n      - starred_url\n      - subscriptions_url\n      - type\n      - url\n      - bio\n      - blog\n      - company\n      - email\n      - followers\n      - following\n      - hireable\n      - location\n      - name\n      - public_gists\n      - public_repos\n      - created_at\n      - updated_at\n      additionalProperties: false\n    gist-history:\n      title: Gist History\n      description: Gist History\n      type: object\n      properties:\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        version:\n          type: string\n        committed_at:\n          type: string\n          format: date-time\n        change_status:\n          type: object\n          properties:\n            total:\n              type: integer\n            additions:\n              type: integer\n            deletions:\n              type: integer\n        url:\n          type: string\n          format: uri\n    gist-simple:\n      title: Gist Simple\n      description: Gist Simple\n      type: object\n      properties:\n        forks:\n          deprecated: true\n          type:\n          - array\n          - 'null'\n          items:\n            type: object\n            properties:\n              id:\n                type: string\n              url:\n                type: string\n                format: uri\n              user:\n                \"$ref\": \"#/components/schemas/public-user\"\n              created_at:\n                type: string\n                format: date-time\n              updated_at:\n                type: string\n                format: date-time\n        history:\n          deprecated: true\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/gist-history\"\n        fork_of:\n          title: Gist\n          description: Gist\n          type:\n          - object\n          - 'null'\n          properties:\n            url:\n              type: string\n              format: uri\n            forks_url:\n              type: string\n              format: uri\n            commits_url:\n              type: string\n              format: uri\n            id:\n              type: string\n            node_id:\n              type: string\n            git_pull_url:\n              type: string\n              format: uri\n            git_push_url:\n              type: string\n              format: uri\n            html_url:\n              type: string\n              format: uri\n            files:\n              type: object\n              additionalProperties:\n                type: object\n                properties:\n                  filename:\n                    type: string\n                  type:\n                    type: string\n                  language:\n                    type: string\n                  raw_url:\n                    type: string\n                  size:\n                    type: integer\n            public:\n              type: boolean\n            created_at:\n              type: string\n              format: date-time\n            updated_at:\n              type: string\n              format: date-time\n            description:\n              type:\n              - string\n              - 'null'\n            comments:\n              type: integer\n            user:\n              anyOf:\n              - type: 'null'\n              - \"$ref\": \"#/components/schemas/simple-user\"\n            comments_url:\n              type: string\n              format: uri\n            owner:\n              anyOf:\n              - type: 'null'\n              - \"$ref\": \"#/components/schemas/simple-user\"\n            truncated:\n              type: boolean\n            forks:\n              type: array\n              items: {}\n            history:\n              type: array\n              items: {}\n          required:\n          - id\n          - node_id\n          - url\n          - forks_url\n          - commits_url\n          - git_pull_url\n          - git_push_url\n          - html_url\n          - comments_url\n          - public\n          - description\n          - comments\n          - user\n          - files\n          - created_at\n          - updated_at\n        url:\n          type: string\n        forks_url:\n          type: string\n        commits_url:\n          type: string\n        id:\n          type: string\n        node_id:\n          type: string\n        git_pull_url:\n          type: string\n        git_push_url:\n          type: string\n        html_url:\n          type: string\n        files:\n          type: object\n          additionalProperties:\n            type:\n            - object\n            - 'null'\n            properties:\n              filename:\n                type: string\n              type:\n                type: string\n              language:\n                type: string\n              raw_url:\n                type: string\n              size:\n                type: integer\n              truncated:\n                type: boolean\n              content:\n                type: string\n        public:\n          type: boolean\n        created_at:\n          type: string\n        updated_at:\n          type: string\n        description:\n          type:\n          - string\n          - 'null'\n        comments:\n          type: integer\n        user:\n          type:\n          - string\n          - 'null'\n        comments_url:\n          type: string\n        owner:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        truncated:\n          type: boolean\n    gist-comment:\n      title: Gist Comment\n      description: A comment made to a gist.\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDExOkdpc3RDb21tZW50MQ==\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/gists/a6db0bec360bb87e9418/comments/1\n        body:\n          description: The comment text.\n          type: string\n          maxLength: 65535\n          examples:\n          - Body of the attachment\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-18T23:23:56Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-18T23:23:56Z'\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n      required:\n      - url\n      - id\n      - node_id\n      - user\n      - body\n      - author_association\n      - created_at\n      - updated_at\n    gist-commit:\n      title: Gist Commit\n      description: Gist Commit\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f\n        version:\n          type: string\n          examples:\n          - 57a7f021a713b1c5a6a199b54cc514735d2d462f\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        change_status:\n          type: object\n          properties:\n            total:\n              type: integer\n            additions:\n              type: integer\n            deletions:\n              type: integer\n        committed_at:\n          type: string\n          format: date-time\n          examples:\n          - '2010-04-14T02:15:15Z'\n      required:\n      - url\n      - user\n      - version\n      - committed_at\n      - change_status\n    gitignore-template:\n      title: Gitignore Template\n      description: Gitignore Template\n      type: object\n      properties:\n        name:\n          type: string\n          examples:\n          - C\n        source:\n          type: string\n          examples:\n          - |\n            # Object files\n            *.o\n\n            # Libraries\n            *.lib\n            *.a\n\n            # Shared objects (inc. Windows DLLs)\n            *.dll\n            *.so\n            *.so.*\n            *.dylib\n\n            # Executables\n            *.exe\n            *.out\n            *.app\n      required:\n      - name\n      - source\n    license:\n      title: License\n      description: License\n      type: object\n      properties:\n        key:\n          type: string\n          examples:\n          - mit\n        name:\n          type: string\n          examples:\n          - MIT License\n        spdx_id:\n          type:\n          - string\n          - 'null'\n          examples:\n          - MIT\n        url:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - https://api.github.com/licenses/mit\n        node_id:\n          type: string\n          examples:\n          - MDc6TGljZW5zZW1pdA==\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - http://choosealicense.com/licenses/mit/\n        description:\n          type: string\n          examples:\n          - A permissive license that is short and to the point. It lets people do\n            anything with your code with proper attribution and without warranty.\n        implementation:\n          type: string\n          examples:\n          - Create a text file (typically named LICENSE or LICENSE.txt) in the root\n            of your source code and copy the text of the license into the file. Replace\n            [year] with the current year and [fullname] with the name (or names) of\n            the copyright holders.\n        permissions:\n          type: array\n          items:\n            type: string\n          examples:\n          - commercial-use\n          - modifications\n          - distribution\n          - sublicense\n          - private-use\n        conditions:\n          type: array\n          items:\n            type: string\n          examples:\n          - include-copyright\n        limitations:\n          type: array\n          items:\n            type: string\n          examples:\n          - no-liability\n        body:\n          type: string\n          examples:\n          - |2\n\n\n            The MIT License (MIT)\n\n            Copyright (c) [year] [fullname]\n\n            Permission is hereby granted, free of charge, to any person obtaining a copy\n            of this software and associated documentation files (the \"Software\"), to deal\n            in the Software without restriction, including without limitation the rights\n            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n            copies of the Software, and to permit persons to whom the Software is\n            furnished to do so, subject to the following conditions:\n\n            The above copyright notice and this permission notice shall be included in all\n            copies or substantial portions of the Software.\n\n            THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n            SOFTWARE.\n        featured:\n          type: boolean\n          examples:\n          - true\n      required:\n      - key\n      - name\n      - url\n      - spdx_id\n      - node_id\n      - html_url\n      - description\n      - implementation\n      - permissions\n      - conditions\n      - limitations\n      - body\n      - featured\n    api-overview:\n      title: Api Overview\n      description: Api Overview\n      type: object\n      properties:\n        verifiable_password_authentication:\n          type: boolean\n          examples:\n          - true\n        packages:\n          type: array\n          items:\n            type: string\n          examples:\n          - 13.65.0.0/16\n          - 157.55.204.33/32\n          - 2a01:111:f403:f90c::/62\n        dependabot:\n          type: array\n          items:\n            type: string\n          examples:\n          - 192.168.7.15/32\n          - 192.168.7.16/32\n        installed_version:\n          type: string\n          examples:\n          - 3.0.0\n      required:\n      - verifiable_password_authentication\n    minimal-repository:\n      title: Minimal Repository\n      description: Minimal Repository\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 1296269\n        node_id:\n          type: string\n          examples:\n          - MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name:\n          type: string\n          examples:\n          - Hello-World\n        full_name:\n          type: string\n          examples:\n          - octocat/Hello-World\n        owner:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        private:\n          type: boolean\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - This your first repo!\n        fork:\n          type: boolean\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World\n        archive_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/downloads\n        events_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/events\n        forks_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url:\n          type: string\n        issue_comment_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/languages\n        merges_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url:\n          type: string\n        stargazers_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/tags\n        teams_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/teams\n        trees_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url:\n          type: string\n        mirror_url:\n          type:\n          - string\n          - 'null'\n        hooks_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url:\n          type: string\n        homepage:\n          type:\n          - string\n          - 'null'\n        language:\n          type:\n          - string\n          - 'null'\n        forks_count:\n          type: integer\n        stargazers_count:\n          type: integer\n        watchers_count:\n          type: integer\n        size:\n          type: integer\n        default_branch:\n          type: string\n        open_issues_count:\n          type: integer\n        is_template:\n          type: boolean\n        topics:\n          type: array\n          items:\n            type: string\n        has_issues:\n          type: boolean\n        has_projects:\n          type: boolean\n        has_wiki:\n          type: boolean\n        has_pages:\n          type: boolean\n        has_downloads:\n          type: boolean\n        archived:\n          type: boolean\n        disabled:\n          type: boolean\n        visibility:\n          type: string\n        pushed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:06:43Z'\n        created_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        updated_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:14:43Z'\n        permissions:\n          type: object\n          properties:\n            admin:\n              type: boolean\n            maintain:\n              type: boolean\n            push:\n              type: boolean\n            triage:\n              type: boolean\n            pull:\n              type: boolean\n        template_repository:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/repository\"\n        temp_clone_token:\n          type: string\n        delete_branch_on_merge:\n          type: boolean\n        subscribers_count:\n          type: integer\n        network_count:\n          type: integer\n        code_of_conduct:\n          \"$ref\": \"#/components/schemas/code-of-conduct\"\n        license:\n          type:\n          - object\n          - 'null'\n          properties:\n            key:\n              type: string\n            name:\n              type: string\n            spdx_id:\n              type: string\n            url:\n              type: string\n            node_id:\n              type: string\n        forks:\n          type: integer\n          examples:\n          - 0\n        open_issues:\n          type: integer\n          examples:\n          - 0\n        watchers:\n          type: integer\n          examples:\n          - 0\n        allow_forking:\n          type: boolean\n      required:\n      - archive_url\n      - assignees_url\n      - blobs_url\n      - branches_url\n      - collaborators_url\n      - comments_url\n      - commits_url\n      - compare_url\n      - contents_url\n      - contributors_url\n      - deployments_url\n      - description\n      - downloads_url\n      - events_url\n      - fork\n      - forks_url\n      - full_name\n      - git_commits_url\n      - git_refs_url\n      - git_tags_url\n      - hooks_url\n      - html_url\n      - id\n      - node_id\n      - issue_comment_url\n      - issue_events_url\n      - issues_url\n      - keys_url\n      - labels_url\n      - languages_url\n      - merges_url\n      - milestones_url\n      - name\n      - notifications_url\n      - owner\n      - private\n      - pulls_url\n      - releases_url\n      - stargazers_url\n      - statuses_url\n      - subscribers_url\n      - subscription_url\n      - tags_url\n      - teams_url\n      - trees_url\n      - url\n    thread:\n      title: Thread\n      description: Thread\n      type: object\n      properties:\n        id:\n          type: string\n        repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n        subject:\n          type: object\n          properties:\n            title:\n              type: string\n            url:\n              type: string\n            latest_comment_url:\n              type: string\n            type:\n              type: string\n          required:\n          - title\n          - url\n          - latest_comment_url\n          - type\n        reason:\n          type: string\n        unread:\n          type: boolean\n        updated_at:\n          type: string\n        last_read_at:\n          type:\n          - string\n          - 'null'\n        url:\n          type: string\n        subscription_url:\n          type: string\n          examples:\n          - https://api.github.com/notifications/threads/2/subscription\n      required:\n      - id\n      - unread\n      - reason\n      - updated_at\n      - last_read_at\n      - subject\n      - repository\n      - url\n      - subscription_url\n    thread-subscription:\n      title: Thread Subscription\n      description: Thread Subscription\n      type: object\n      properties:\n        subscribed:\n          type: boolean\n          examples:\n          - true\n        ignored:\n          type: boolean\n        reason:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2012-10-06T21:34:12Z'\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/notifications/threads/1/subscription\n        thread_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/notifications/threads/1\n        repository_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/1\n      required:\n      - created_at\n      - ignored\n      - reason\n      - url\n      - subscribed\n    organization-full:\n      title: Organization Full\n      description: Organization Full\n      type: object\n      properties:\n        login:\n          type: string\n          examples:\n          - github\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDEyOk9yZ2FuaXphdGlvbjE=\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/github\n        repos_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/github/repos\n        events_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/github/events\n        hooks_url:\n          type: string\n          examples:\n          - https://api.github.com/orgs/github/hooks\n        issues_url:\n          type: string\n          examples:\n          - https://api.github.com/orgs/github/issues\n        members_url:\n          type: string\n          examples:\n          - https://api.github.com/orgs/github/members{/member}\n        public_members_url:\n          type: string\n          examples:\n          - https://api.github.com/orgs/github/public_members{/member}\n        avatar_url:\n          type: string\n          examples:\n          - https://github.com/images/error/octocat_happy.gif\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - A great organization\n        name:\n          type: string\n          examples:\n          - github\n        company:\n          type: string\n          examples:\n          - GitHub\n        blog:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/blog\n        location:\n          type: string\n          examples:\n          - San Francisco\n        email:\n          type: string\n          format: email\n          examples:\n          - octocat@github.com\n        twitter_username:\n          type:\n          - string\n          - 'null'\n          examples:\n          - github\n        is_verified:\n          type: boolean\n          examples:\n          - true\n        has_organization_projects:\n          type: boolean\n          examples:\n          - true\n        has_repository_projects:\n          type: boolean\n          examples:\n          - true\n        public_repos:\n          type: integer\n          examples:\n          - 2\n        public_gists:\n          type: integer\n          examples:\n          - 1\n        followers:\n          type: integer\n          examples:\n          - 20\n        following:\n          type: integer\n          examples:\n          - 0\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2008-01-14T04:33:35Z'\n        type:\n          type: string\n          examples:\n          - Organization\n        total_private_repos:\n          type: integer\n          examples:\n          - 100\n        owned_private_repos:\n          type: integer\n          examples:\n          - 100\n        private_gists:\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 81\n        disk_usage:\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 10000\n        collaborators:\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 8\n        billing_email:\n          type:\n          - string\n          - 'null'\n          format: email\n          examples:\n          - org@example.com\n        plan:\n          type: object\n          properties:\n            name:\n              type: string\n            space:\n              type: integer\n            private_repos:\n              type: integer\n            filled_seats:\n              type: integer\n            seats:\n              type: integer\n          required:\n          - name\n          - space\n          - private_repos\n        default_repository_permission:\n          type:\n          - string\n          - 'null'\n        members_can_create_repositories:\n          type:\n          - boolean\n          - 'null'\n          examples:\n          - true\n        two_factor_requirement_enabled:\n          type:\n          - boolean\n          - 'null'\n          examples:\n          - true\n        members_allowed_repository_creation_type:\n          type: string\n          examples:\n          - all\n        members_can_create_public_repositories:\n          type: boolean\n          examples:\n          - true\n        members_can_create_private_repositories:\n          type: boolean\n          examples:\n          - true\n        members_can_create_internal_repositories:\n          type: boolean\n          examples:\n          - true\n        members_can_create_pages:\n          type: boolean\n          examples:\n          - true\n        members_can_create_public_pages:\n          type: boolean\n          examples:\n          - true\n        members_can_create_private_pages:\n          type: boolean\n          examples:\n          - true\n        members_can_fork_private_repositories:\n          type:\n          - boolean\n          - 'null'\n          examples:\n          - false\n        updated_at:\n          type: string\n          format: date-time\n      required:\n      - login\n      - url\n      - id\n      - node_id\n      - repos_url\n      - events_url\n      - hooks_url\n      - issues_url\n      - members_url\n      - public_members_url\n      - avatar_url\n      - description\n      - html_url\n      - has_organization_projects\n      - has_repository_projects\n      - public_repos\n      - public_gists\n      - followers\n      - following\n      - type\n      - created_at\n      - updated_at\n    enabled-repositories:\n      type: string\n      description: 'The policy that controls the repositories in the organization\n        that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`.'\n      enum:\n      - all\n      - none\n      - selected\n    actions-organization-permissions:\n      type: object\n      properties:\n        enabled_repositories:\n          \"$ref\": \"#/components/schemas/enabled-repositories\"\n        selected_repositories_url:\n          type: string\n          description: The API URL to use to get or set the selected repositories\n            that are allowed to run GitHub Actions, when `enabled_repositories` is\n            set to `selected`.\n        allowed_actions:\n          \"$ref\": \"#/components/schemas/allowed-actions\"\n        selected_actions_url:\n          \"$ref\": \"#/components/schemas/selected-actions-url\"\n      required:\n      - enabled_repositories\n    runner-groups-org:\n      type: object\n      properties:\n        id:\n          type: number\n        name:\n          type: string\n        visibility:\n          type: string\n        default:\n          type: boolean\n        selected_repositories_url:\n          description: Link to the selected repositories resource for this runner\n            group. Not present unless visibility was set to `selected`\n          type: string\n        runners_url:\n          type: string\n        inherited:\n          type: boolean\n        inherited_allows_public_repositories:\n          type: boolean\n        allows_public_repositories:\n          type: boolean\n      required:\n      - id\n      - name\n      - visibility\n      - default\n      - runners_url\n      - inherited\n      - allows_public_repositories\n    organization-actions-secret:\n      title: Actions Secret for an Organization\n      description: Secrets for GitHub Actions for an organization.\n      type: object\n      properties:\n        name:\n          description: The name of the secret.\n          type: string\n          examples:\n          - SECRET_TOKEN\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        visibility:\n          description: Visibility of a secret\n          enum:\n          - all\n          - private\n          - selected\n          type: string\n        selected_repositories_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/org/secrets/my_secret/repositories\n      required:\n      - name\n      - created_at\n      - updated_at\n      - visibility\n    actions-public-key:\n      title: ActionsPublicKey\n      description: The public key used for setting Actions Secrets.\n      type: object\n      properties:\n        key_id:\n          description: The identifier for the key.\n          type: string\n          examples:\n          - '1234567'\n        key:\n          description: The Base64 encoded public key.\n          type: string\n          examples:\n          - hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=\n        id:\n          type: integer\n          examples:\n          - 2\n        url:\n          type: string\n          examples:\n          - https://api.github.com/user/keys/2\n        title:\n          type: string\n          examples:\n          - ssh-rsa AAAAB3NzaC1yc2EAAA\n        created_at:\n          type: string\n          examples:\n          - '2011-01-26T19:01:12Z'\n      required:\n      - key_id\n      - key\n    empty-object:\n      title: Empty Object\n      description: An object without any properties.\n      type: object\n      properties: {}\n      additionalProperties: false\n    org-hook:\n      title: Org Hook\n      description: Org Hook\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 1\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/octocat/hooks/1\n        ping_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/octocat/hooks/1/pings\n        name:\n          type: string\n          examples:\n          - web\n        events:\n          type: array\n          items:\n            type: string\n          examples:\n          - push\n          - pull_request\n        active:\n          type: boolean\n          examples:\n          - true\n        config:\n          type: object\n          properties:\n            url:\n              type: string\n              examples:\n              - '\"http://example.com/2\"'\n            insecure_ssl:\n              type: string\n              examples:\n              - '\"0\"'\n            content_type:\n              type: string\n              examples:\n              - '\"form\"'\n            secret:\n              type: string\n              examples:\n              - '\"********\"'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-09-06T20:39:23Z'\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-09-06T17:26:27Z'\n        type:\n          type: string\n      required:\n      - id\n      - url\n      - type\n      - name\n      - active\n      - events\n      - config\n      - ping_url\n      - created_at\n      - updated_at\n    org-membership:\n      title: Org Membership\n      description: Org Membership\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/octocat/memberships/defunkt\n        state:\n          type: string\n          description: The state of the member in the organization. The `pending`\n            state indicates the user has not yet accepted an invitation.\n          enum:\n          - active\n          - pending\n          examples:\n          - active\n        role:\n          type: string\n          description: The user's membership type in the organization.\n          enum:\n          - admin\n          - member\n          - billing_manager\n          examples:\n          - admin\n        organization_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/orgs/octocat\n        organization:\n          \"$ref\": \"#/components/schemas/organization-simple\"\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        permissions:\n          type: object\n          properties:\n            can_create_repository:\n              type: boolean\n          required:\n          - can_create_repository\n      required:\n      - state\n      - role\n      - organization_url\n      - url\n      - organization\n      - user\n    org-pre-receive-hook:\n      type: object\n      properties:\n        id:\n          type: integer\n        name:\n          type: string\n        enforcement:\n          type: string\n        configuration_url:\n          type: string\n        allow_downstream_configuration:\n          type: boolean\n    project:\n      title: Project\n      description: Projects are a way to organize columns and cards of work.\n      type: object\n      properties:\n        owner_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/api-playground/projects-test\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/projects/1002604\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/api-playground/projects-test/projects/12\n        columns_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/projects/1002604/columns\n        id:\n          type: integer\n          examples:\n          - 1002604\n        node_id:\n          type: string\n          examples:\n          - MDc6UHJvamVjdDEwMDI2MDQ=\n        name:\n          description: Name of the project\n          type: string\n          examples:\n          - Week One Sprint\n        body:\n          description: Body of the project\n          type:\n          - string\n          - 'null'\n          examples:\n          - This project represents the sprint of the first week in January\n        number:\n          type: integer\n          examples:\n          - 1\n        state:\n          description: State of the project; either 'open' or 'closed'\n          type: string\n          examples:\n          - open\n        creator:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-10T20:09:31Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2014-03-03T18:58:10Z'\n        organization_permission:\n          description: The baseline permission that all organization members have\n            on this project. Only present if owner is an organization.\n          type: string\n          enum:\n          - read\n          - write\n          - admin\n          - none\n        private:\n          description: Whether or not this project can be seen by everyone. Only present\n            if owner is an organization.\n          type: boolean\n      required:\n      - id\n      - node_id\n      - number\n      - name\n      - body\n      - state\n      - url\n      - html_url\n      - owner_url\n      - creator\n      - columns_url\n      - created_at\n      - updated_at\n    team-simple:\n      title: Team Simple\n      description: Groups of organization members that gives permissions on specified\n        repositories.\n      type: object\n      properties:\n        id:\n          description: Unique identifier of the team\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDQ6VGVhbTE=\n        url:\n          description: URL for the team\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/1\n        members_url:\n          type: string\n          examples:\n          - https://api.github.com/organizations/1/team/1/members{/member}\n        name:\n          description: Name of the team\n          type: string\n          examples:\n          - Justice League\n        description:\n          description: Description of the team\n          type:\n          - string\n          - 'null'\n          examples:\n          - A great team.\n        permission:\n          description: Permission that the team will have for its repositories\n          type: string\n          examples:\n          - admin\n        privacy:\n          description: The level of privacy this team should have\n          type: string\n          examples:\n          - closed\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/orgs/rails/teams/core\n        repositories_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/1/repos\n        slug:\n          type: string\n          examples:\n          - justice-league\n        ldap_dn:\n          description: Distinguished Name (DN) that team maps to within LDAP environment\n          type: string\n          examples:\n          - uid=example,ou=users,dc=github,dc=com\n      required:\n      - id\n      - node_id\n      - url\n      - members_url\n      - name\n      - description\n      - permission\n      - html_url\n      - repositories_url\n      - slug\n    team:\n      title: Team\n      description: Groups of organization members that gives permissions on specified\n        repositories.\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        name:\n          type: string\n        slug:\n          type: string\n        description:\n          type:\n          - string\n          - 'null'\n        privacy:\n          type: string\n        permission:\n          type: string\n        permissions:\n          type: object\n          properties:\n            pull:\n              type: boolean\n            triage:\n              type: boolean\n            push:\n              type: boolean\n            maintain:\n              type: boolean\n            admin:\n              type: boolean\n          required:\n          - pull\n          - triage\n          - push\n          - maintain\n          - admin\n        url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/orgs/rails/teams/core\n        members_url:\n          type: string\n        repositories_url:\n          type: string\n          format: uri\n        parent:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/team-simple\"\n      required:\n      - id\n      - node_id\n      - url\n      - members_url\n      - name\n      - description\n      - permission\n      - html_url\n      - repositories_url\n      - slug\n      - parent\n    team-full:\n      title: Full Team\n      description: Groups of organization members that gives permissions on specified\n        repositories.\n      type: object\n      properties:\n        id:\n          description: Unique identifier of the team\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDQ6VGVhbTE=\n        url:\n          description: URL for the team\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/1\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/orgs/rails/teams/core\n        name:\n          description: Name of the team\n          type: string\n          examples:\n          - Developers\n        slug:\n          type: string\n          examples:\n          - justice-league\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - A great team.\n        privacy:\n          description: The level of privacy this team should have\n          type: string\n          enum:\n          - closed\n          - secret\n          examples:\n          - closed\n        permission:\n          description: Permission that the team will have for its repositories\n          type: string\n          examples:\n          - push\n        members_url:\n          type: string\n          examples:\n          - https://api.github.com/organizations/1/team/1/members{/member}\n        repositories_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/1/repos\n        parent:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/team-simple\"\n        members_count:\n          type: integer\n          examples:\n          - 3\n        repos_count:\n          type: integer\n          examples:\n          - 10\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2017-07-14T16:53:42Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2017-08-17T12:37:15Z'\n        organization:\n          \"$ref\": \"#/components/schemas/organization-full\"\n        ldap_dn:\n          description: Distinguished Name (DN) that team maps to within LDAP environment\n          type: string\n          examples:\n          - uid=example,ou=users,dc=github,dc=com\n      required:\n      - id\n      - node_id\n      - url\n      - members_url\n      - name\n      - description\n      - permission\n      - html_url\n      - repositories_url\n      - slug\n      - created_at\n      - updated_at\n      - members_count\n      - repos_count\n      - organization\n    team-discussion:\n      title: Team Discussion\n      description: A team discussion is a persistent record of a free-form conversation\n        within a team.\n      type: object\n      properties:\n        author:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        body:\n          description: The main text of the discussion.\n          type: string\n          examples:\n          - Please suggest improvements to our workflow in comments.\n        body_html:\n          type: string\n          examples:\n          - \"<p>Hi! This is an area for us to collaborate as a team</p>\"\n        body_version:\n          description: The current version of the body content. If provided, this\n            update operation will be rejected if the given version does not match\n            the latest version on the server.\n          type: string\n          examples:\n          - 0307116bbf7ced493b8d8a346c650b71\n        comments_count:\n          type: integer\n          examples:\n          - 0\n        comments_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/2343027/discussions/1/comments\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2018-01-25T18:56:31Z'\n        last_edited_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/orgs/github/teams/justice-league/discussions/1\n        node_id:\n          type: string\n          examples:\n          - MDE0OlRlYW1EaXNjdXNzaW9uMQ==\n        number:\n          description: The unique sequence number of a team discussion.\n          type: integer\n          examples:\n          - 42\n        pinned:\n          description: Whether or not this discussion should be pinned for easy retrieval.\n          type: boolean\n          examples:\n          - true\n        private:\n          description: Whether or not this discussion should be restricted to team\n            members and organization administrators.\n          type: boolean\n          examples:\n          - true\n        team_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/2343027\n        title:\n          description: The title of the discussion.\n          type: string\n          examples:\n          - How can we improve our workflow?\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2018-01-25T18:56:31Z'\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/2343027/discussions/1\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n      required:\n      - author\n      - body\n      - body_html\n      - body_version\n      - comments_count\n      - comments_url\n      - created_at\n      - last_edited_at\n      - html_url\n      - pinned\n      - private\n      - node_id\n      - number\n      - team_url\n      - title\n      - updated_at\n      - url\n    team-discussion-comment:\n      title: Team Discussion Comment\n      description: A reply to a discussion within a team.\n      type: object\n      properties:\n        author:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        body:\n          description: The main text of the comment.\n          type: string\n          examples:\n          - I agree with this suggestion.\n        body_html:\n          type: string\n          examples:\n          - \"<p>Do you like apples?</p>\"\n        body_version:\n          description: The current version of the body content. If provided, this\n            update operation will be rejected if the given version does not match\n            the latest version on the server.\n          type: string\n          examples:\n          - 0307116bbf7ced493b8d8a346c650b71\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2018-01-15T23:53:58Z'\n        last_edited_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        discussion_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/2403582/discussions/1\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1\n        node_id:\n          type: string\n          examples:\n          - MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=\n        number:\n          description: The unique sequence number of a team discussion comment.\n          type: integer\n          examples:\n          - 42\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2018-01-15T23:53:58Z'\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n      required:\n      - author\n      - body\n      - body_html\n      - body_version\n      - created_at\n      - last_edited_at\n      - discussion_url\n      - html_url\n      - node_id\n      - number\n      - updated_at\n      - url\n    reaction:\n      title: Reaction\n      description: Reactions to conversations provide a way to help people express\n        their feelings more simply and effectively.\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDg6UmVhY3Rpb24x\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        content:\n          description: The reaction to use\n          type: string\n          enum:\n          - \"+1\"\n          - \"-1\"\n          - laugh\n          - confused\n          - heart\n          - hooray\n          - rocket\n          - eyes\n          examples:\n          - heart\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2016-05-20T20:09:31Z'\n      required:\n      - id\n      - node_id\n      - user\n      - content\n      - created_at\n    team-membership:\n      title: Team Membership\n      description: Team Membership\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        role:\n          description: The role of the user in the team.\n          enum:\n          - member\n          - maintainer\n          default: member\n          type: string\n          examples:\n          - member\n        state:\n          description: The state of the user's membership in the team.\n          type: string\n          enum:\n          - active\n          - pending\n      required:\n      - role\n      - state\n      - url\n    team-project:\n      title: Team Project\n      description: A team's access to a project.\n      type: object\n      properties:\n        owner_url:\n          type: string\n        url:\n          type: string\n        html_url:\n          type: string\n        columns_url:\n          type: string\n        id:\n          type: integer\n        node_id:\n          type: string\n        name:\n          type: string\n        body:\n          type:\n          - string\n          - 'null'\n        number:\n          type: integer\n        state:\n          type: string\n        creator:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n        updated_at:\n          type: string\n        organization_permission:\n          description: The organization permission for this project. Only present\n            when owner is an organization.\n          type: string\n        private:\n          description: Whether the project is private or not. Only present when owner\n            is an organization.\n          type: boolean\n        permissions:\n          type: object\n          properties:\n            read:\n              type: boolean\n            write:\n              type: boolean\n            admin:\n              type: boolean\n          required:\n          - read\n          - write\n          - admin\n      required:\n      - owner_url\n      - url\n      - html_url\n      - columns_url\n      - id\n      - node_id\n      - name\n      - body\n      - number\n      - state\n      - creator\n      - created_at\n      - updated_at\n      - permissions\n    team-repository:\n      title: Team Repository\n      description: A team's access to a repository.\n      type: object\n      properties:\n        id:\n          description: Unique identifier of the repository\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name:\n          description: The name of the repository.\n          type: string\n          examples:\n          - Team Environment\n        full_name:\n          type: string\n          examples:\n          - octocat/Hello-World\n        license:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/license-simple\"\n        forks:\n          type: integer\n        permissions:\n          type: object\n          properties:\n            admin:\n              type: boolean\n            pull:\n              type: boolean\n            triage:\n              type: boolean\n            push:\n              type: boolean\n            maintain:\n              type: boolean\n          required:\n          - admin\n          - pull\n          - push\n        owner:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        private:\n          description: Whether the repository is private or public.\n          default: false\n          type: boolean\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - This your first repo!\n        fork:\n          type: boolean\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World\n        archive_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/downloads\n        events_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/events\n        forks_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url:\n          type: string\n          examples:\n          - git:github.com/octocat/Hello-World.git\n        issue_comment_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/languages\n        merges_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url:\n          type: string\n          examples:\n          - git@github.com:octocat/Hello-World.git\n        stargazers_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/tags\n        teams_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/teams\n        trees_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url:\n          type: string\n          examples:\n          - https://github.com/octocat/Hello-World.git\n        mirror_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - git:git.example.com/octocat/Hello-World\n        hooks_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url:\n          type: string\n          format: uri\n          examples:\n          - https://svn.github.com/octocat/Hello-World\n        homepage:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - https://github.com\n        language:\n          type:\n          - string\n          - 'null'\n        forks_count:\n          type: integer\n          examples:\n          - 9\n        stargazers_count:\n          type: integer\n          examples:\n          - 80\n        watchers_count:\n          type: integer\n          examples:\n          - 80\n        size:\n          type: integer\n          examples:\n          - 108\n        default_branch:\n          description: The default branch of the repository.\n          type: string\n          examples:\n          - master\n        open_issues_count:\n          type: integer\n          examples:\n          - 0\n        is_template:\n          description: Whether this repository acts as a template that can be used\n            to generate new repositories.\n          default: false\n          type: boolean\n          examples:\n          - true\n        topics:\n          type: array\n          items:\n            type: string\n        has_issues:\n          description: Whether issues are enabled.\n          default: true\n          type: boolean\n          examples:\n          - true\n        has_projects:\n          description: Whether projects are enabled.\n          default: true\n          type: boolean\n          examples:\n          - true\n        has_wiki:\n          description: Whether the wiki is enabled.\n          default: true\n          type: boolean\n          examples:\n          - true\n        has_pages:\n          type: boolean\n        has_downloads:\n          description: Whether downloads are enabled.\n          default: true\n          type: boolean\n          examples:\n          - true\n        archived:\n          description: Whether the repository is archived.\n          default: false\n          type: boolean\n        disabled:\n          type: boolean\n          description: Returns whether or not this repository disabled.\n        visibility:\n          description: 'The repository visibility: public, private, or internal.'\n          default: public\n          type: string\n        pushed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:06:43Z'\n        created_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        updated_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:14:43Z'\n        allow_rebase_merge:\n          description: Whether to allow rebase merges for pull requests.\n          default: true\n          type: boolean\n          examples:\n          - true\n        template_repository:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/repository\"\n        temp_clone_token:\n          type: string\n        allow_squash_merge:\n          description: Whether to allow squash merges for pull requests.\n          default: true\n          type: boolean\n          examples:\n          - true\n        delete_branch_on_merge:\n          description: Whether to delete head branches when pull requests are merged\n          default: false\n          type: boolean\n          examples:\n          - false\n        allow_merge_commit:\n          description: Whether to allow merge commits for pull requests.\n          default: true\n          type: boolean\n          examples:\n          - true\n        allow_forking:\n          description: Whether to allow forking this repo\n          default: false\n          type: boolean\n          examples:\n          - false\n        subscribers_count:\n          type: integer\n        network_count:\n          type: integer\n        open_issues:\n          type: integer\n        watchers:\n          type: integer\n        master_branch:\n          type: string\n      required:\n      - archive_url\n      - assignees_url\n      - blobs_url\n      - branches_url\n      - collaborators_url\n      - comments_url\n      - commits_url\n      - compare_url\n      - contents_url\n      - contributors_url\n      - deployments_url\n      - description\n      - downloads_url\n      - events_url\n      - fork\n      - forks_url\n      - full_name\n      - git_commits_url\n      - git_refs_url\n      - git_tags_url\n      - hooks_url\n      - html_url\n      - id\n      - node_id\n      - issue_comment_url\n      - issue_events_url\n      - issues_url\n      - keys_url\n      - labels_url\n      - languages_url\n      - merges_url\n      - milestones_url\n      - name\n      - notifications_url\n      - owner\n      - private\n      - pulls_url\n      - releases_url\n      - stargazers_url\n      - statuses_url\n      - subscribers_url\n      - subscription_url\n      - tags_url\n      - teams_url\n      - trees_url\n      - url\n      - clone_url\n      - default_branch\n      - forks\n      - forks_count\n      - git_url\n      - has_downloads\n      - has_issues\n      - has_projects\n      - has_wiki\n      - has_pages\n      - homepage\n      - language\n      - archived\n      - disabled\n      - mirror_url\n      - open_issues\n      - open_issues_count\n      - license\n      - pushed_at\n      - size\n      - ssh_url\n      - stargazers_count\n      - svn_url\n      - watchers\n      - watchers_count\n      - created_at\n      - updated_at\n    project-card:\n      title: Project Card\n      description: Project cards represent a scope of work.\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/projects/columns/cards/1478\n        id:\n          description: The project card's ID\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDExOlByb2plY3RDYXJkMTQ3OA==\n        note:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Add payload for delete Project column\n        creator:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2016-09-05T14:21:06Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2016-09-05T14:20:22Z'\n        archived:\n          description: Whether or not the card is archived\n          type: boolean\n          examples:\n          - false\n        column_name:\n          type: string\n        project_id:\n          type: string\n        column_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/projects/columns/367\n        content_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/api-playground/projects-test/issues/3\n        project_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/projects/120\n      required:\n      - id\n      - node_id\n      - note\n      - url\n      - column_url\n      - project_url\n      - creator\n      - created_at\n      - updated_at\n    project-column:\n      title: Project Column\n      description: Project columns contain cards of work.\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/projects/columns/367\n        project_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/projects/120\n        cards_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/projects/columns/367/cards\n        id:\n          description: The unique identifier of the project column\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDEzOlByb2plY3RDb2x1bW4zNjc=\n        name:\n          description: Name of the project column\n          type: string\n          examples:\n          - Remaining tasks\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2016-09-05T14:18:44Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2016-09-05T14:22:28Z'\n      required:\n      - id\n      - node_id\n      - url\n      - project_url\n      - cards_url\n      - name\n      - created_at\n      - updated_at\n    project-collaborator-permission:\n      title: Project Collaborator Permission\n      description: Project Collaborator Permission\n      type: object\n      properties:\n        permission:\n          type: string\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - permission\n      - user\n    rate-limit:\n      title: Rate Limit\n      type: object\n      properties:\n        limit:\n          type: integer\n        remaining:\n          type: integer\n        reset:\n          type: integer\n        used:\n          type: integer\n      required:\n      - limit\n      - remaining\n      - reset\n      - used\n    rate-limit-overview:\n      title: Rate Limit Overview\n      description: Rate Limit Overview\n      type: object\n      properties:\n        resources:\n          type: object\n          properties:\n            core:\n              \"$ref\": \"#/components/schemas/rate-limit\"\n            graphql:\n              \"$ref\": \"#/components/schemas/rate-limit\"\n            search:\n              \"$ref\": \"#/components/schemas/rate-limit\"\n            source_import:\n              \"$ref\": \"#/components/schemas/rate-limit\"\n            integration_manifest:\n              \"$ref\": \"#/components/schemas/rate-limit\"\n            code_scanning_upload:\n              \"$ref\": \"#/components/schemas/rate-limit\"\n            actions_runner_registration:\n              \"$ref\": \"#/components/schemas/rate-limit\"\n            scim:\n              \"$ref\": \"#/components/schemas/rate-limit\"\n          required:\n          - core\n          - search\n        rate:\n          \"$ref\": \"#/components/schemas/rate-limit\"\n      required:\n      - rate\n      - resources\n    code-of-conduct-simple:\n      title: Code Of Conduct Simple\n      description: Code of Conduct Simple\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/github/docs/community/code_of_conduct\n        key:\n          type: string\n          examples:\n          - citizen_code_of_conduct\n        name:\n          type: string\n          examples:\n          - Citizen Code of Conduct\n        html_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md\n      required:\n      - url\n      - key\n      - name\n      - html_url\n    full-repository:\n      title: Full Repository\n      description: Full Repository\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 1296269\n        node_id:\n          type: string\n          examples:\n          - MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name:\n          type: string\n          examples:\n          - Hello-World\n        full_name:\n          type: string\n          examples:\n          - octocat/Hello-World\n        owner:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        private:\n          type: boolean\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - This your first repo!\n        fork:\n          type: boolean\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World\n        archive_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/downloads\n        events_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/events\n        forks_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url:\n          type: string\n          examples:\n          - git:github.com/octocat/Hello-World.git\n        issue_comment_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/languages\n        merges_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url:\n          type: string\n          examples:\n          - git@github.com:octocat/Hello-World.git\n        stargazers_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/tags\n        teams_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/teams\n        trees_url:\n          type: string\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url:\n          type: string\n          examples:\n          - https://github.com/octocat/Hello-World.git\n        mirror_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - git:git.example.com/octocat/Hello-World\n        hooks_url:\n          type: string\n          format: uri\n          examples:\n          - http://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url:\n          type: string\n          format: uri\n          examples:\n          - https://svn.github.com/octocat/Hello-World\n        homepage:\n          type:\n          - string\n          - 'null'\n          format: uri\n          examples:\n          - https://github.com\n        language:\n          type:\n          - string\n          - 'null'\n        forks_count:\n          type: integer\n          examples:\n          - 9\n        stargazers_count:\n          type: integer\n          examples:\n          - 80\n        watchers_count:\n          type: integer\n          examples:\n          - 80\n        size:\n          type: integer\n          examples:\n          - 108\n        default_branch:\n          type: string\n          examples:\n          - master\n        open_issues_count:\n          type: integer\n          examples:\n          - 0\n        is_template:\n          type: boolean\n          examples:\n          - true\n        topics:\n          type: array\n          items:\n            type: string\n          examples:\n          - octocat\n          - atom\n          - electron\n          - API\n        has_issues:\n          type: boolean\n          examples:\n          - true\n        has_projects:\n          type: boolean\n          examples:\n          - true\n        has_wiki:\n          type: boolean\n          examples:\n          - true\n        has_pages:\n          type: boolean\n        has_downloads:\n          type: boolean\n          examples:\n          - true\n        archived:\n          type: boolean\n        disabled:\n          type: boolean\n          description: Returns whether or not this repository disabled.\n        visibility:\n          description: 'The repository visibility: public, private, or internal.'\n          type: string\n          examples:\n          - public\n        pushed_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-01-26T19:06:43Z'\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-01-26T19:14:43Z'\n        permissions:\n          type: object\n          properties:\n            admin:\n              type: boolean\n            maintain:\n              type: boolean\n            push:\n              type: boolean\n            triage:\n              type: boolean\n            pull:\n              type: boolean\n          required:\n          - admin\n          - pull\n          - push\n        allow_rebase_merge:\n          type: boolean\n          examples:\n          - true\n        template_repository:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/repository\"\n        temp_clone_token:\n          type:\n          - string\n          - 'null'\n        allow_squash_merge:\n          type: boolean\n          examples:\n          - true\n        delete_branch_on_merge:\n          type: boolean\n          examples:\n          - false\n        allow_merge_commit:\n          type: boolean\n          examples:\n          - true\n        allow_forking:\n          type: boolean\n          examples:\n          - true\n        subscribers_count:\n          type: integer\n          examples:\n          - 42\n        network_count:\n          type: integer\n          examples:\n          - 0\n        license:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/license-simple\"\n        organization:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        parent:\n          \"$ref\": \"#/components/schemas/repository\"\n        source:\n          \"$ref\": \"#/components/schemas/repository\"\n        forks:\n          type: integer\n        master_branch:\n          type: string\n        open_issues:\n          type: integer\n        watchers:\n          type: integer\n        anonymous_access_enabled:\n          description: Whether anonymous git access is allowed.\n          default: true\n          type: boolean\n        code_of_conduct:\n          \"$ref\": \"#/components/schemas/code-of-conduct-simple\"\n      required:\n      - archive_url\n      - assignees_url\n      - blobs_url\n      - branches_url\n      - collaborators_url\n      - comments_url\n      - commits_url\n      - compare_url\n      - contents_url\n      - contributors_url\n      - deployments_url\n      - description\n      - downloads_url\n      - events_url\n      - fork\n      - forks_url\n      - full_name\n      - git_commits_url\n      - git_refs_url\n      - git_tags_url\n      - hooks_url\n      - html_url\n      - id\n      - node_id\n      - issue_comment_url\n      - issue_events_url\n      - issues_url\n      - keys_url\n      - labels_url\n      - languages_url\n      - merges_url\n      - milestones_url\n      - name\n      - notifications_url\n      - owner\n      - private\n      - pulls_url\n      - releases_url\n      - stargazers_url\n      - statuses_url\n      - subscribers_url\n      - subscription_url\n      - tags_url\n      - teams_url\n      - trees_url\n      - url\n      - clone_url\n      - default_branch\n      - forks\n      - forks_count\n      - git_url\n      - has_downloads\n      - has_issues\n      - has_projects\n      - has_wiki\n      - has_pages\n      - homepage\n      - language\n      - archived\n      - disabled\n      - mirror_url\n      - open_issues\n      - open_issues_count\n      - license\n      - pushed_at\n      - size\n      - ssh_url\n      - stargazers_count\n      - svn_url\n      - watchers\n      - watchers_count\n      - created_at\n      - updated_at\n      - network_count\n      - subscribers_count\n    artifact:\n      title: Artifact\n      description: An artifact\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 5\n        node_id:\n          type: string\n          examples:\n          - MDEwOkNoZWNrU3VpdGU1\n        name:\n          description: The name of the artifact.\n          type: string\n          examples:\n          - AdventureWorks.Framework\n        size_in_bytes:\n          description: The size in bytes of the artifact.\n          type: integer\n          examples:\n          - 12345\n        url:\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/artifacts/5\n        archive_download_url:\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip\n        expired:\n          description: Whether or not the artifact has expired.\n          type: boolean\n        created_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        expires_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        updated_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n      required:\n      - id\n      - node_id\n      - name\n      - size_in_bytes\n      - url\n      - archive_download_url\n      - expired\n      - created_at\n      - expires_at\n      - updated_at\n    job:\n      title: Job\n      description: Information of a job execution in a workflow run\n      type: object\n      properties:\n        id:\n          description: The id of the job.\n          type: integer\n          examples:\n          - 21\n        run_id:\n          description: The id of the associated workflow run.\n          type: integer\n          examples:\n          - 5\n        run_url:\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/runs/5\n        run_attempt:\n          type: integer\n          description: Attempt number of the associated workflow run, 1 for first\n            attempt and higher if the workflow was re-run.\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDg6Q2hlY2tSdW40\n        head_sha:\n          description: The SHA of the commit that is being run.\n          type: string\n          examples:\n          - '009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d'\n        url:\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/jobs/21\n        html_url:\n          type:\n          - string\n          - 'null'\n          examples:\n          - https://github.com/github/hello-world/runs/4\n        status:\n          description: The phase of the lifecycle that the job is currently in.\n          type: string\n          enum:\n          - queued\n          - in_progress\n          - completed\n          examples:\n          - queued\n        conclusion:\n          description: The outcome of the job.\n          type:\n          - string\n          - 'null'\n          examples:\n          - success\n        started_at:\n          description: The time that the job started, in ISO 8601 format.\n          format: date-time\n          type: string\n          examples:\n          - '2019-08-08T08:00:00-07:00'\n        completed_at:\n          description: The time that the job finished, in ISO 8601 format.\n          format: date-time\n          type:\n          - string\n          - 'null'\n          examples:\n          - '2019-08-08T08:00:00-07:00'\n        name:\n          description: The name of the job.\n          type: string\n          examples:\n          - test-coverage\n        steps:\n          description: Steps in this job.\n          type: array\n          items:\n            type: object\n            required:\n            - name\n            - status\n            - conclusion\n            - number\n            properties:\n              status:\n                description: The phase of the lifecycle that the job is currently\n                  in.\n                type: string\n                enum:\n                - queued\n                - in_progress\n                - completed\n                examples:\n                - queued\n              conclusion:\n                description: The outcome of the job.\n                type:\n                - string\n                - 'null'\n                examples:\n                - success\n              name:\n                description: The name of the job.\n                type: string\n                examples:\n                - test-coverage\n              number:\n                type: integer\n                examples:\n                - 1\n              started_at:\n                description: The time that the step started, in ISO 8601 format.\n                format: date-time\n                type:\n                - string\n                - 'null'\n                examples:\n                - '2019-08-08T08:00:00-07:00'\n              completed_at:\n                description: The time that the job finished, in ISO 8601 format.\n                format: date-time\n                type:\n                - string\n                - 'null'\n                examples:\n                - '2019-08-08T08:00:00-07:00'\n        check_run_url:\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/check-runs/4\n      required:\n      - id\n      - node_id\n      - run_id\n      - run_url\n      - head_sha\n      - name\n      - url\n      - html_url\n      - status\n      - conclusion\n      - started_at\n      - completed_at\n      - check_run_url\n    actions-enabled:\n      type: boolean\n      description: Whether GitHub Actions is enabled on the repository.\n    actions-repository-permissions:\n      type: object\n      properties:\n        enabled:\n          \"$ref\": \"#/components/schemas/actions-enabled\"\n        allowed_actions:\n          \"$ref\": \"#/components/schemas/allowed-actions\"\n        selected_actions_url:\n          \"$ref\": \"#/components/schemas/selected-actions-url\"\n      required:\n      - enabled\n    pull-request-minimal:\n      title: Pull Request Minimal\n      type: object\n      properties:\n        id:\n          type: integer\n        number:\n          type: integer\n        url:\n          type: string\n        head:\n          type: object\n          properties:\n            ref:\n              type: string\n            sha:\n              type: string\n            repo:\n              type: object\n              properties:\n                id:\n                  type: integer\n                url:\n                  type: string\n                name:\n                  type: string\n              required:\n              - id\n              - url\n              - name\n          required:\n          - ref\n          - sha\n          - repo\n        base:\n          type: object\n          properties:\n            ref:\n              type: string\n            sha:\n              type: string\n            repo:\n              type: object\n              properties:\n                id:\n                  type: integer\n                url:\n                  type: string\n                name:\n                  type: string\n              required:\n              - id\n              - url\n              - name\n          required:\n          - ref\n          - sha\n          - repo\n      required:\n      - id\n      - number\n      - url\n      - head\n      - base\n    simple-commit:\n      title: Simple Commit\n      description: Simple Commit\n      type: object\n      properties:\n        id:\n          type: string\n        tree_id:\n          type: string\n        message:\n          type: string\n        timestamp:\n          type: string\n          format: date-time\n        author:\n          type:\n          - object\n          - 'null'\n          properties:\n            name:\n              type: string\n            email:\n              type: string\n          required:\n          - name\n          - email\n        committer:\n          type:\n          - object\n          - 'null'\n          properties:\n            name:\n              type: string\n            email:\n              type: string\n          required:\n          - name\n          - email\n      required:\n      - id\n      - tree_id\n      - message\n      - timestamp\n      - author\n      - committer\n    workflow-run:\n      title: Workflow Run\n      description: An invocation of a workflow\n      type: object\n      properties:\n        id:\n          type: integer\n          description: The ID of the workflow run.\n          examples:\n          - 5\n        name:\n          type:\n          - string\n          - 'null'\n          description: The name of the workflow run.\n          examples:\n          - Build\n        node_id:\n          type: string\n          examples:\n          - MDEwOkNoZWNrU3VpdGU1\n        check_suite_id:\n          type: integer\n          description: The ID of the associated check suite.\n          examples:\n          - 42\n        check_suite_node_id:\n          type: string\n          description: The node ID of the associated check suite.\n          examples:\n          - MDEwOkNoZWNrU3VpdGU0Mg==\n        head_branch:\n          type:\n          - string\n          - 'null'\n          examples:\n          - master\n        head_sha:\n          description: The SHA of the head commit that points to the version of the\n            workflow being run.\n          type: string\n          examples:\n          - '009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d'\n        run_number:\n          type: integer\n          description: The auto incrementing run number for the workflow run.\n          examples:\n          - 106\n        run_attempt:\n          type: integer\n          description: Attempt number of the run, 1 for first attempt and higher if\n            the workflow was re-run.\n          examples:\n          - 1\n        event:\n          type: string\n          examples:\n          - push\n        status:\n          type:\n          - string\n          - 'null'\n          examples:\n          - completed\n        conclusion:\n          type:\n          - string\n          - 'null'\n          examples:\n          - neutral\n        workflow_id:\n          type: integer\n          description: The ID of the parent workflow.\n          examples:\n          - 5\n        url:\n          type: string\n          description: The URL to the workflow run.\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/runs/5\n        html_url:\n          type: string\n          examples:\n          - https://github.com/github/hello-world/suites/4\n        pull_requests:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/pull-request-minimal\"\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        run_started_at:\n          type: string\n          format: date-time\n          description: The start time of the latest run. Resets on re-run.\n        jobs_url:\n          description: The URL to the jobs for the workflow run.\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/runs/5/jobs\n        logs_url:\n          description: The URL to download the logs for the workflow run.\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/runs/5/logs\n        check_suite_url:\n          description: The URL to the associated check suite.\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/check-suites/12\n        artifacts_url:\n          description: The URL to the artifacts for the workflow run.\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts\n        cancel_url:\n          description: The URL to cancel the workflow run.\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/runs/5/cancel\n        rerun_url:\n          description: The URL to rerun the workflow run.\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/runs/5/rerun\n        previous_attempt_url:\n          description: The URL to the previous attempted run of this workflow, if\n            one exists.\n          type:\n          - string\n          - 'null'\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/runs/5/attempts/3\n        workflow_url:\n          description: The URL to the workflow.\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml\n        head_commit:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-commit\"\n        repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n        head_repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n        head_repository_id:\n          type: integer\n          examples:\n          - 5\n      required:\n      - id\n      - node_id\n      - head_branch\n      - run_number\n      - event\n      - status\n      - conclusion\n      - head_sha\n      - workflow_id\n      - url\n      - html_url\n      - created_at\n      - updated_at\n      - head_commit\n      - head_repository\n      - repository\n      - jobs_url\n      - logs_url\n      - check_suite_url\n      - cancel_url\n      - rerun_url\n      - artifacts_url\n      - workflow_url\n      - pull_requests\n    actions-secret:\n      title: Actions Secret\n      description: Set secrets for GitHub Actions.\n      type: object\n      properties:\n        name:\n          description: The name of the secret.\n          type: string\n          examples:\n          - SECRET_TOKEN\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n      required:\n      - name\n      - created_at\n      - updated_at\n    workflow:\n      title: Workflow\n      description: A GitHub Actions workflow\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 5\n        node_id:\n          type: string\n          examples:\n          - MDg6V29ya2Zsb3cxMg==\n        name:\n          type: string\n          examples:\n          - CI\n        path:\n          type: string\n          examples:\n          - ruby.yaml\n        state:\n          type: string\n          enum:\n          - active\n          - deleted\n          - disabled_fork\n          - disabled_inactivity\n          - disabled_manually\n          examples:\n          - active\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2019-12-06T14:20:20.000Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2019-12-06T14:20:20.000Z'\n        url:\n          type: string\n          examples:\n          - https://api.github.com/repos/actions/setup-ruby/workflows/5\n        html_url:\n          type: string\n          examples:\n          - https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml\n        badge_url:\n          type: string\n          examples:\n          - https://github.com/actions/setup-ruby/workflows/CI/badge.svg\n        deleted_at:\n          type: string\n          format: date-time\n          examples:\n          - '2019-12-06T14:20:20.000Z'\n      required:\n      - id\n      - node_id\n      - name\n      - path\n      - state\n      - url\n      - html_url\n      - badge_url\n      - created_at\n      - updated_at\n    protected-branch-required-status-check:\n      title: Protected Branch Required Status Check\n      description: Protected Branch Required Status Check\n      type: object\n      properties:\n        url:\n          type: string\n        enforcement_level:\n          type: string\n        contexts:\n          type: array\n          items:\n            type: string\n        contexts_url:\n          type: string\n        strict:\n          type: boolean\n      required:\n      - contexts\n    protected-branch-admin-enforced:\n      title: Protected Branch Admin Enforced\n      description: Protected Branch Admin Enforced\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins\n        enabled:\n          type: boolean\n          examples:\n          - true\n      required:\n      - url\n      - enabled\n    protected-branch-pull-request-review:\n      title: Protected Branch Pull Request Review\n      description: Protected Branch Pull Request Review\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions\n        dismissal_restrictions:\n          type: object\n          properties:\n            users:\n              description: The list of users with review dismissal access.\n              type: array\n              items:\n                \"$ref\": \"#/components/schemas/simple-user\"\n            teams:\n              description: The list of teams with review dismissal access.\n              type: array\n              items:\n                \"$ref\": \"#/components/schemas/team\"\n            url:\n              type: string\n              examples:\n              - '\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions\"'\n            users_url:\n              type: string\n              examples:\n              - '\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users\"'\n            teams_url:\n              type: string\n              examples:\n              - '\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams\"'\n        dismiss_stale_reviews:\n          type: boolean\n          examples:\n          - true\n        require_code_owner_reviews:\n          type: boolean\n          examples:\n          - true\n        required_approving_review_count:\n          type: integer\n          minimum: 1\n          maximum: 6\n          examples:\n          - 2\n      required:\n      - dismiss_stale_reviews\n      - require_code_owner_reviews\n    branch-restriction-policy:\n      title: Branch Restriction Policy\n      description: Branch Restriction Policy\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        users_url:\n          type: string\n          format: uri\n        teams_url:\n          type: string\n          format: uri\n        apps_url:\n          type: string\n          format: uri\n        users:\n          type: array\n          items:\n            type: object\n            properties:\n              login:\n                type: string\n              id:\n                type: integer\n              node_id:\n                type: string\n              avatar_url:\n                type: string\n              gravatar_id:\n                type: string\n              url:\n                type: string\n              html_url:\n                type: string\n              followers_url:\n                type: string\n              following_url:\n                type: string\n              gists_url:\n                type: string\n              starred_url:\n                type: string\n              subscriptions_url:\n                type: string\n              organizations_url:\n                type: string\n              repos_url:\n                type: string\n              events_url:\n                type: string\n              received_events_url:\n                type: string\n              type:\n                type: string\n              site_admin:\n                type: boolean\n        teams:\n          type: array\n          items:\n            type: object\n            properties:\n              id:\n                type: integer\n              node_id:\n                type: string\n              url:\n                type: string\n              html_url:\n                type: string\n              name:\n                type: string\n              slug:\n                type: string\n              description:\n                type:\n                - string\n                - 'null'\n              privacy:\n                type: string\n              permission:\n                type: string\n              members_url:\n                type: string\n              repositories_url:\n                type: string\n              parent:\n                type:\n                - string\n                - 'null'\n        apps:\n          type: array\n          items:\n            type: object\n            properties:\n              id:\n                type: integer\n              slug:\n                type: string\n              node_id:\n                type: string\n              owner:\n                type: object\n                properties:\n                  login:\n                    type: string\n                  id:\n                    type: integer\n                  node_id:\n                    type: string\n                  url:\n                    type: string\n                  repos_url:\n                    type: string\n                  events_url:\n                    type: string\n                  hooks_url:\n                    type: string\n                  issues_url:\n                    type: string\n                  members_url:\n                    type: string\n                  public_members_url:\n                    type: string\n                  avatar_url:\n                    type: string\n                  description:\n                    type: string\n                  gravatar_id:\n                    type: string\n                    examples:\n                    - '\"\"'\n                  html_url:\n                    type: string\n                    examples:\n                    - '\"https://github.com/testorg-ea8ec76d71c3af4b\"'\n                  followers_url:\n                    type: string\n                    examples:\n                    - '\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers\"'\n                  following_url:\n                    type: string\n                    examples:\n                    - '\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}\"'\n                  gists_url:\n                    type: string\n                    examples:\n                    - '\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}\"'\n                  starred_url:\n                    type: string\n                    examples:\n                    - '\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}\"'\n                  subscriptions_url:\n                    type: string\n                    examples:\n                    - '\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions\"'\n                  organizations_url:\n                    type: string\n                    examples:\n                    - '\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs\"'\n                  received_events_url:\n                    type: string\n                    examples:\n                    - '\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events\"'\n                  type:\n                    type: string\n                    examples:\n                    - '\"Organization\"'\n                  site_admin:\n                    type: boolean\n                    examples:\n                    - false\n              name:\n                type: string\n              description:\n                type: string\n              external_url:\n                type: string\n              html_url:\n                type: string\n              created_at:\n                type: string\n              updated_at:\n                type: string\n              permissions:\n                type: object\n                properties:\n                  metadata:\n                    type: string\n                  contents:\n                    type: string\n                  issues:\n                    type: string\n                  single_file:\n                    type: string\n              events:\n                type: array\n                items:\n                  type: string\n      required:\n      - url\n      - users_url\n      - teams_url\n      - apps_url\n      - users\n      - teams\n      - apps\n    branch-protection:\n      title: Branch Protection\n      description: Branch Protection\n      type: object\n      properties:\n        url:\n          type: string\n        enabled:\n          type: boolean\n        required_status_checks:\n          \"$ref\": \"#/components/schemas/protected-branch-required-status-check\"\n        enforce_admins:\n          \"$ref\": \"#/components/schemas/protected-branch-admin-enforced\"\n        required_pull_request_reviews:\n          \"$ref\": \"#/components/schemas/protected-branch-pull-request-review\"\n        restrictions:\n          \"$ref\": \"#/components/schemas/branch-restriction-policy\"\n        required_linear_history:\n          type: object\n          properties:\n            enabled:\n              type: boolean\n        allow_force_pushes:\n          type: object\n          properties:\n            enabled:\n              type: boolean\n        allow_deletions:\n          type: object\n          properties:\n            enabled:\n              type: boolean\n        required_conversation_resolution:\n          type: object\n          properties:\n            enabled:\n              type: boolean\n        name:\n          type: string\n          examples:\n          - '\"branch/with/protection\"'\n        protection_url:\n          type: string\n          examples:\n          - '\"https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection\"'\n        required_signatures:\n          type: object\n          properties:\n            url:\n              type: string\n              format: uri\n              examples:\n              - https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures\n            enabled:\n              type: boolean\n              examples:\n              - true\n          required:\n          - url\n          - enabled\n    short-branch:\n      title: Short Branch\n      description: Short Branch\n      type: object\n      properties:\n        name:\n          type: string\n        commit:\n          type: object\n          properties:\n            sha:\n              type: string\n            url:\n              type: string\n              format: uri\n          required:\n          - sha\n          - url\n        protected:\n          type: boolean\n        protection:\n          \"$ref\": \"#/components/schemas/branch-protection\"\n        protection_url:\n          type: string\n          format: uri\n      required:\n      - name\n      - commit\n      - protected\n    git-user:\n      title: Git User\n      description: Metaproperties for Git author/committer information.\n      type: object\n      properties:\n        name:\n          type: string\n          examples:\n          - '\"Chris Wanstrath\"'\n        email:\n          type: string\n          examples:\n          - '\"chris@ozmm.org\"'\n        date:\n          type: string\n          examples:\n          - '\"2007-10-29T02:42:39.000-07:00\"'\n    verification:\n      title: Verification\n      type: object\n      properties:\n        verified:\n          type: boolean\n        reason:\n          type: string\n        payload:\n          type:\n          - string\n          - 'null'\n        signature:\n          type:\n          - string\n          - 'null'\n      required:\n      - verified\n      - reason\n      - payload\n      - signature\n    diff-entry:\n      title: Diff Entry\n      description: Diff Entry\n      type: object\n      properties:\n        sha:\n          type: string\n          examples:\n          - bbcd538c8e72b8c175046e27cc8f907076331401\n        filename:\n          type: string\n          examples:\n          - file1.txt\n        status:\n          type: string\n          enum:\n          - added\n          - removed\n          - modified\n          - renamed\n          - copied\n          - changed\n          - unchanged\n          examples:\n          - added\n        additions:\n          type: integer\n          examples:\n          - 103\n        deletions:\n          type: integer\n          examples:\n          - 21\n        changes:\n          type: integer\n          examples:\n          - 124\n        blob_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\n        raw_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\n        contents_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e\n        patch:\n          type: string\n          examples:\n          - \"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"\n        previous_filename:\n          type: string\n          examples:\n          - file.txt\n      required:\n      - additions\n      - blob_url\n      - changes\n      - contents_url\n      - deletions\n      - filename\n      - raw_url\n      - sha\n      - status\n    commit:\n      title: Commit\n      description: Commit\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        sha:\n          type: string\n          examples:\n          - 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        node_id:\n          type: string\n          examples:\n          - MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        comments_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\n        commit:\n          type: object\n          properties:\n            url:\n              type: string\n              format: uri\n              examples:\n              - https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            author:\n              anyOf:\n              - type: 'null'\n              - \"$ref\": \"#/components/schemas/git-user\"\n            committer:\n              anyOf:\n              - type: 'null'\n              - \"$ref\": \"#/components/schemas/git-user\"\n            message:\n              type: string\n              examples:\n              - Fix all the bugs\n            comment_count:\n              type: integer\n              examples:\n              - 0\n            tree:\n              type: object\n              properties:\n                sha:\n                  type: string\n                  examples:\n                  - 827efc6d56897b048c772eb4087f854f46256132\n                url:\n                  type: string\n                  format: uri\n                  examples:\n                  - https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132\n              required:\n              - sha\n              - url\n            verification:\n              \"$ref\": \"#/components/schemas/verification\"\n          required:\n          - author\n          - committer\n          - comment_count\n          - message\n          - tree\n          - url\n        author:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        committer:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        parents:\n          type: array\n          items:\n            type: object\n            properties:\n              sha:\n                type: string\n                examples:\n                - 7638417db6d59f3c431d3e1f261cc637155684cd\n              url:\n                type: string\n                format: uri\n                examples:\n                - https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd\n              html_url:\n                type: string\n                format: uri\n                examples:\n                - https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd\n            required:\n            - sha\n            - url\n        stats:\n          type: object\n          properties:\n            additions:\n              type: integer\n            deletions:\n              type: integer\n            total:\n              type: integer\n        files:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/diff-entry\"\n      required:\n      - url\n      - sha\n      - node_id\n      - html_url\n      - comments_url\n      - commit\n      - author\n      - committer\n      - parents\n    branch-with-protection:\n      title: Branch With Protection\n      description: Branch With Protection\n      type: object\n      properties:\n        name:\n          type: string\n        commit:\n          \"$ref\": \"#/components/schemas/commit\"\n        _links:\n          type: object\n          properties:\n            html:\n              type: string\n            self:\n              type: string\n              format: uri\n          required:\n          - html\n          - self\n        protected:\n          type: boolean\n        protection:\n          \"$ref\": \"#/components/schemas/branch-protection\"\n        protection_url:\n          type: string\n          format: uri\n        pattern:\n          type: string\n          examples:\n          - '\"mas*\"'\n        required_approving_review_count:\n          type: integer\n          examples:\n          - 1\n      required:\n      - name\n      - commit\n      - _links\n      - protection\n      - protected\n      - protection_url\n    status-check-policy:\n      title: Status Check Policy\n      description: Status Check Policy\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks\n        strict:\n          type: boolean\n          examples:\n          - true\n        contexts:\n          type: array\n          items:\n            type: string\n          examples:\n          - continuous-integration/travis-ci\n        contexts_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts\n      required:\n      - url\n      - contexts_url\n      - strict\n      - contexts\n    protected-branch:\n      title: Protected Branch\n      description: Branch protections protect branches\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        required_status_checks:\n          \"$ref\": \"#/components/schemas/status-check-policy\"\n        required_pull_request_reviews:\n          type: object\n          properties:\n            url:\n              type: string\n              format: uri\n            dismiss_stale_reviews:\n              type: boolean\n            require_code_owner_reviews:\n              type: boolean\n            required_approving_review_count:\n              type: integer\n            dismissal_restrictions:\n              type: object\n              properties:\n                url:\n                  type: string\n                  format: uri\n                users_url:\n                  type: string\n                  format: uri\n                teams_url:\n                  type: string\n                  format: uri\n                users:\n                  type: array\n                  items:\n                    \"$ref\": \"#/components/schemas/simple-user\"\n                teams:\n                  type: array\n                  items:\n                    \"$ref\": \"#/components/schemas/team\"\n              required:\n              - url\n              - users_url\n              - teams_url\n              - users\n              - teams\n          required:\n          - url\n        required_signatures:\n          type: object\n          properties:\n            url:\n              type: string\n              format: uri\n              examples:\n              - https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures\n            enabled:\n              type: boolean\n              examples:\n              - true\n          required:\n          - url\n          - enabled\n        enforce_admins:\n          type: object\n          properties:\n            url:\n              type: string\n              format: uri\n            enabled:\n              type: boolean\n          additionalProperties: false\n          required:\n          - url\n          - enabled\n        required_linear_history:\n          type: object\n          properties:\n            enabled:\n              type: boolean\n          additionalProperties: false\n          required:\n          - enabled\n        allow_force_pushes:\n          type: object\n          properties:\n            enabled:\n              type: boolean\n          additionalProperties: false\n          required:\n          - enabled\n        allow_deletions:\n          type: object\n          properties:\n            enabled:\n              type: boolean\n          additionalProperties: false\n          required:\n          - enabled\n        restrictions:\n          \"$ref\": \"#/components/schemas/branch-restriction-policy\"\n        required_conversation_resolution:\n          type: object\n          properties:\n            enabled:\n              type: boolean\n          additionalProperties: false\n      required:\n      - url\n    deployment-simple:\n      title: Deployment\n      description: A deployment created as the result of an Actions check run from\n        a workflow that references an environment\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example/deployments/1\n        id:\n          description: Unique identifier of the deployment\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDEwOkRlcGxveW1lbnQx\n        task:\n          description: Parameter to specify a task to execute\n          type: string\n          examples:\n          - deploy\n        original_environment:\n          type: string\n          examples:\n          - staging\n        environment:\n          description: Name for the target deployment environment.\n          type: string\n          examples:\n          - production\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Deploy request from hubot\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2012-07-20T01:19:13Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2012-07-20T01:19:13Z'\n        statuses_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example/deployments/1/statuses\n        repository_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example\n        transient_environment:\n          description: 'Specifies if the given environment is will no longer exist\n            at some point in the future. Default: false.'\n          type: boolean\n          examples:\n          - true\n        production_environment:\n          description: 'Specifies if the given environment is one that end-users directly\n            interact with. Default: false.'\n          type: boolean\n          examples:\n          - true\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n      required:\n      - id\n      - node_id\n      - task\n      - environment\n      - description\n      - statuses_url\n      - repository_url\n      - url\n      - created_at\n      - updated_at\n    check-run:\n      title: CheckRun\n      description: A check performed on the code of a given code change\n      type: object\n      properties:\n        id:\n          description: The id of the check.\n          type: integer\n          examples:\n          - 21\n        head_sha:\n          description: The SHA of the commit that is being checked.\n          type: string\n          examples:\n          - '009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d'\n        node_id:\n          type: string\n          examples:\n          - MDg6Q2hlY2tSdW40\n        external_id:\n          type:\n          - string\n          - 'null'\n          examples:\n          - '42'\n        url:\n          type: string\n          examples:\n          - https://api.github.com/repos/github/hello-world/check-runs/4\n        html_url:\n          type:\n          - string\n          - 'null'\n          examples:\n          - https://github.com/github/hello-world/runs/4\n        details_url:\n          type:\n          - string\n          - 'null'\n          examples:\n          - https://example.com\n        status:\n          description: The phase of the lifecycle that the check is currently in.\n          type: string\n          enum:\n          - queued\n          - in_progress\n          - completed\n          examples:\n          - queued\n        conclusion:\n          type:\n          - string\n          - 'null'\n          enum:\n          - success\n          - failure\n          - neutral\n          - cancelled\n          - skipped\n          - timed_out\n          - action_required\n          - \n          examples:\n          - neutral\n        started_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2018-05-04T01:14:52Z'\n        completed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2018-05-04T01:14:52Z'\n        output:\n          type: object\n          properties:\n            title:\n              type:\n              - string\n              - 'null'\n            summary:\n              type:\n              - string\n              - 'null'\n            text:\n              type:\n              - string\n              - 'null'\n            annotations_count:\n              type: integer\n            annotations_url:\n              type: string\n              format: uri\n          required:\n          - title\n          - summary\n          - text\n          - annotations_count\n          - annotations_url\n        name:\n          description: The name of the check.\n          type: string\n          examples:\n          - test-coverage\n        check_suite:\n          type:\n          - object\n          - 'null'\n          properties:\n            id:\n              type: integer\n          required:\n          - id\n        app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        pull_requests:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/pull-request-minimal\"\n        deployment:\n          \"$ref\": \"#/components/schemas/deployment-simple\"\n      required:\n      - id\n      - node_id\n      - head_sha\n      - name\n      - url\n      - html_url\n      - details_url\n      - status\n      - conclusion\n      - started_at\n      - completed_at\n      - external_id\n      - check_suite\n      - output\n      - app\n      - pull_requests\n    check-annotation:\n      title: Check Annotation\n      description: Check Annotation\n      type: object\n      properties:\n        path:\n          type: string\n          examples:\n          - README.md\n        start_line:\n          type: integer\n          examples:\n          - 2\n        end_line:\n          type: integer\n          examples:\n          - 2\n        start_column:\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 5\n        end_column:\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 10\n        annotation_level:\n          type:\n          - string\n          - 'null'\n          examples:\n          - warning\n        title:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Spell Checker\n        message:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Check your spelling for 'banaas'.\n        raw_details:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Do you mean 'bananas' or 'banana'?\n        blob_href:\n          type: string\n      required:\n      - path\n      - blob_href\n      - start_line\n      - end_line\n      - start_column\n      - end_column\n      - annotation_level\n      - title\n      - message\n      - raw_details\n    check-suite:\n      title: CheckSuite\n      description: A suite of checks performed on the code of a given code change\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 5\n        node_id:\n          type: string\n          examples:\n          - MDEwOkNoZWNrU3VpdGU1\n        head_branch:\n          type:\n          - string\n          - 'null'\n          examples:\n          - master\n        head_sha:\n          description: The SHA of the head commit that is being checked.\n          type: string\n          examples:\n          - '009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d'\n        status:\n          type:\n          - string\n          - 'null'\n          enum:\n          - queued\n          - in_progress\n          - completed\n          - \n          examples:\n          - completed\n        conclusion:\n          type:\n          - string\n          - 'null'\n          enum:\n          - success\n          - failure\n          - neutral\n          - cancelled\n          - skipped\n          - timed_out\n          - action_required\n          - \n          examples:\n          - neutral\n        url:\n          type:\n          - string\n          - 'null'\n          examples:\n          - https://api.github.com/repos/github/hello-world/check-suites/5\n        before:\n          type:\n          - string\n          - 'null'\n          examples:\n          - 146e867f55c26428e5f9fade55a9bbf5e95a7912\n        after:\n          type:\n          - string\n          - 'null'\n          examples:\n          - d6fde92930d4715a2b49857d24b940956b26d2d3\n        pull_requests:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/pull-request-minimal\"\n        app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n        created_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        updated_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        head_commit:\n          \"$ref\": \"#/components/schemas/simple-commit\"\n        latest_check_runs_count:\n          type: integer\n        check_runs_url:\n          type: string\n        rerequestable:\n          type: boolean\n        runs_rerequestable:\n          type: boolean\n      required:\n      - id\n      - node_id\n      - head_branch\n      - status\n      - conclusion\n      - head_sha\n      - url\n      - before\n      - after\n      - created_at\n      - updated_at\n      - app\n      - head_commit\n      - repository\n      - latest_check_runs_count\n      - check_runs_url\n      - pull_requests\n    check-suite-preference:\n      title: Check Suite Preference\n      description: Check suite configuration preferences for a repository.\n      type: object\n      required:\n      - preferences\n      - repository\n      properties:\n        preferences:\n          type: object\n          properties:\n            auto_trigger_checks:\n              type: array\n              items:\n                type: object\n                properties:\n                  app_id:\n                    type: integer\n                  setting:\n                    type: boolean\n                required:\n                - app_id\n                - setting\n        repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n    code-scanning-analysis-tool-name:\n      type: string\n      description: The name of the tool used to generate the code scanning analysis.\n    code-scanning-analysis-tool-guid:\n      type:\n      - string\n      - 'null'\n      description: The GUID of the tool used to generate the code scanning analysis,\n        if provided in the uploaded SARIF data.\n    code-scanning-ref:\n      type: string\n      description: |-\n        The full Git reference, formatted as `refs/heads/<branch name>`,\n        `refs/pull/<number>/merge`, or `refs/pull/<number>/head`.\n    code-scanning-alert-state:\n      type: string\n      description: State of a code scanning alert.\n      enum:\n      - open\n      - closed\n      - dismissed\n      - fixed\n    alert-number:\n      type: integer\n      description: The security alert number.\n      readOnly: true\n    alert-created-at:\n      type: string\n      description: 'The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.'\n      format: date-time\n      readOnly: true\n    alert-url:\n      type: string\n      description: The REST API URL of the alert resource.\n      format: uri\n      readOnly: true\n    alert-html-url:\n      type: string\n      description: The GitHub URL of the alert resource.\n      format: uri\n      readOnly: true\n    alert-instances-url:\n      type: string\n      description: The REST API URL for fetching the list of instances for an alert.\n      format: uri\n      readOnly: true\n    code-scanning-alert-dismissed-at:\n      type:\n      - string\n      - 'null'\n      description: 'The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.'\n      format: date-time\n      readOnly: true\n    code-scanning-alert-dismissed-reason:\n      type:\n      - string\n      - 'null'\n      description: \"**Required when the state is dismissed.** The reason for dismissing\n        or closing the alert. Can be one of: `false positive`, `won't fix`, and `used\n        in tests`.\"\n      enum:\n      - \n      - false positive\n      - won't fix\n      - used in tests\n    code-scanning-alert-rule-summary:\n      type: object\n      properties:\n        id:\n          type:\n          - string\n          - 'null'\n          description: A unique identifier for the rule used to detect the alert.\n        name:\n          type: string\n          description: The name of the rule used to detect the alert.\n        severity:\n          type:\n          - string\n          - 'null'\n          description: The severity of the alert.\n          enum:\n          - none\n          - note\n          - warning\n          - error\n          - \n        description:\n          type: string\n          description: A short description of the rule used to detect the alert.\n    code-scanning-analysis-tool-version:\n      type:\n      - string\n      - 'null'\n      description: The version of the tool used to generate the code scanning analysis.\n    code-scanning-analysis-tool:\n      type: object\n      properties:\n        name:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-name\"\n        version:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-version\"\n        guid:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-tool-guid\"\n    code-scanning-analysis-analysis-key:\n      type: string\n      description: Identifies the configuration under which the analysis was executed.\n        For example, in GitHub Actions this includes the workflow filename and job\n        name.\n    code-scanning-alert-environment:\n      type: string\n      description: Identifies the variable values associated with the environment\n        in which the analysis that generated this alert instance was performed, such\n        as the language that was analyzed.\n    code-scanning-analysis-category:\n      type: string\n      description: Identifies the configuration under which the analysis was executed.\n        Used to distinguish between multiple analyses for the same tool and commit,\n        but performed on different languages or different parts of the code.\n    code-scanning-alert-location:\n      type: object\n      description: Describe a region within a file for the alert.\n      properties:\n        path:\n          type: string\n        start_line:\n          type: integer\n        end_line:\n          type: integer\n        start_column:\n          type: integer\n        end_column:\n          type: integer\n    code-scanning-alert-classification:\n      type:\n      - string\n      - 'null'\n      description: A classification of the file. For example to identify it as generated.\n      enum:\n      - source\n      - generated\n      - test\n      - library\n      - \n    code-scanning-alert-instance:\n      type: object\n      properties:\n        ref:\n          \"$ref\": \"#/components/schemas/code-scanning-ref\"\n        analysis_key:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-analysis-key\"\n        environment:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-environment\"\n        category:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-category\"\n        state:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-state\"\n        commit_sha:\n          type: string\n        message:\n          type: object\n          properties:\n            text:\n              type: string\n        location:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-location\"\n        html_url:\n          type: string\n        classifications:\n          type: array\n          description: |-\n            Classifications that have been applied to the file that triggered the alert.\n            For example identifying it as documentation, or a generated file.\n          items:\n            \"$ref\": \"#/components/schemas/code-scanning-alert-classification\"\n    code-scanning-alert-items:\n      type: object\n      properties:\n        number:\n          \"$ref\": \"#/components/schemas/alert-number\"\n        created_at:\n          \"$ref\": \"#/components/schemas/alert-created-at\"\n        url:\n          \"$ref\": \"#/components/schemas/alert-url\"\n        html_url:\n          \"$ref\": \"#/components/schemas/alert-html-url\"\n        instances_url:\n          \"$ref\": \"#/components/schemas/alert-instances-url\"\n        state:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-state\"\n        dismissed_by:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        dismissed_at:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-at\"\n        dismissed_reason:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-reason\"\n        rule:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-rule-summary\"\n        tool:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-tool\"\n        most_recent_instance:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-instance\"\n      required:\n      - number\n      - created_at\n      - url\n      - html_url\n      - instances_url\n      - state\n      - dismissed_by\n      - dismissed_at\n      - dismissed_reason\n      - rule\n      - tool\n      - most_recent_instance\n    code-scanning-alert-rule:\n      type: object\n      properties:\n        id:\n          type:\n          - string\n          - 'null'\n          description: A unique identifier for the rule used to detect the alert.\n        name:\n          type: string\n          description: The name of the rule used to detect the alert.\n        severity:\n          type:\n          - string\n          - 'null'\n          description: The severity of the alert.\n          enum:\n          - none\n          - note\n          - warning\n          - error\n          - \n        description:\n          type: string\n          description: A short description of the rule used to detect the alert.\n        full_description:\n          type: string\n          description: description of the rule used to detect the alert.\n        tags:\n          type:\n          - array\n          - 'null'\n          description: A set of tags applicable for the rule.\n          items:\n            type: string\n        help:\n          type:\n          - string\n          - 'null'\n          description: Detailed documentation for the rule as GitHub Flavored Markdown.\n    code-scanning-alert:\n      type: object\n      properties:\n        number:\n          \"$ref\": \"#/components/schemas/alert-number\"\n        created_at:\n          \"$ref\": \"#/components/schemas/alert-created-at\"\n        url:\n          \"$ref\": \"#/components/schemas/alert-url\"\n        html_url:\n          \"$ref\": \"#/components/schemas/alert-html-url\"\n        instances_url:\n          \"$ref\": \"#/components/schemas/alert-instances-url\"\n        state:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-state\"\n        dismissed_by:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        dismissed_at:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-at\"\n        dismissed_reason:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-dismissed-reason\"\n        rule:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-rule\"\n        tool:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-tool\"\n        most_recent_instance:\n          \"$ref\": \"#/components/schemas/code-scanning-alert-instance\"\n        instances:\n          deprecated: true\n      required:\n      - number\n      - created_at\n      - url\n      - html_url\n      - instances_url\n      - state\n      - dismissed_by\n      - dismissed_at\n      - dismissed_reason\n      - rule\n      - tool\n      - most_recent_instance\n    code-scanning-alert-set-state:\n      description: Sets the state of the code scanning alert. Can be one of `open`\n        or `dismissed`. You must provide `dismissed_reason` when you set the state\n        to `dismissed`.\n      type: string\n      enum:\n      - open\n      - dismissed\n    code-scanning-analysis-sarif-id:\n      type: string\n      description: An identifier for the upload.\n      examples:\n      - 6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53\n    code-scanning-analysis-commit-sha:\n      description: The SHA of the commit to which the analysis you are uploading relates.\n      type: string\n      minLength: 40\n      maxLength: 40\n      pattern: \"^[0-9a-fA-F]+$\"\n    code-scanning-analysis-environment:\n      type: string\n      description: Identifies the variable values associated with the environment\n        in which this analysis was performed.\n    code-scanning-analysis-created-at:\n      type: string\n      description: 'The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.'\n      format: date-time\n      readOnly: true\n    code-scanning-analysis-url:\n      type: string\n      description: The REST API URL of the analysis resource.\n      format: uri\n      readOnly: true\n    code-scanning-analysis:\n      type: object\n      properties:\n        ref:\n          \"$ref\": \"#/components/schemas/code-scanning-ref\"\n        commit_sha:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-commit-sha\"\n        analysis_key:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-analysis-key\"\n        environment:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-environment\"\n        category:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-category\"\n        error:\n          type: string\n          examples:\n          - error reading field xyz\n        created_at:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-created-at\"\n        results_count:\n          type: integer\n          description: The total number of results in the analysis.\n        rules_count:\n          type: integer\n          description: The total number of rules used in the analysis.\n        id:\n          type: integer\n          description: Unique identifier for this analysis.\n        url:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-url\"\n        sarif_id:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-sarif-id\"\n        tool:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-tool\"\n        deletable:\n          type: boolean\n        warning:\n          type: string\n          description: Warning generated when processing the analysis\n          examples:\n          - 123 results were ignored\n        tool_name:\n          type: string\n      required:\n      - ref\n      - commit_sha\n      - analysis_key\n      - environment\n      - error\n      - created_at\n      - results_count\n      - rules_count\n      - id\n      - url\n      - sarif_id\n      - tool\n      - deletable\n      - warning\n    code-scanning-analysis-sarif-file:\n      description: A Base64 string representing the SARIF file to upload. You must\n        first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html)\n        and then translate the contents of the file into a Base64 encoding string.\n        For more information, see \"[SARIF support for code scanning](https://docs.github.com/enterprise-server@3.0/code-security/secure-coding/sarif-support-for-code-scanning).\"\n      type: string\n    code-scanning-sarifs-receipt:\n      type: object\n      properties:\n        id:\n          \"$ref\": \"#/components/schemas/code-scanning-analysis-sarif-id\"\n        url:\n          type: string\n          description: The REST API URL for checking the status of the upload.\n          format: uri\n          readOnly: true\n    collaborator:\n      title: Collaborator\n      description: Collaborator\n      type: object\n      properties:\n        login:\n          type: string\n          examples:\n          - octocat\n        id:\n          type: integer\n          examples:\n          - 1\n        email:\n          type:\n          - string\n          - 'null'\n        name:\n          type:\n          - string\n          - 'null'\n        node_id:\n          type: string\n          examples:\n          - MDQ6VXNlcjE=\n        avatar_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/images/error/octocat_happy.gif\n        gravatar_id:\n          type:\n          - string\n          - 'null'\n          examples:\n          - 41d064eb2195891e12d0413f63227ea7\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat\n        followers_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/followers\n        following_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/following{/other_user}\n        gists_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/subscriptions\n        organizations_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/orgs\n        repos_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/repos\n        events_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/events{/privacy}\n        received_events_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/received_events\n        type:\n          type: string\n          examples:\n          - User\n        site_admin:\n          type: boolean\n        permissions:\n          type: object\n          properties:\n            pull:\n              type: boolean\n            triage:\n              type: boolean\n            push:\n              type: boolean\n            maintain:\n              type: boolean\n            admin:\n              type: boolean\n          required:\n          - pull\n          - push\n          - admin\n      required:\n      - avatar_url\n      - events_url\n      - followers_url\n      - following_url\n      - gists_url\n      - gravatar_id\n      - html_url\n      - id\n      - node_id\n      - login\n      - organizations_url\n      - received_events_url\n      - repos_url\n      - site_admin\n      - starred_url\n      - subscriptions_url\n      - type\n      - url\n    repository-invitation:\n      title: Repository Invitation\n      description: Repository invitations let you manage who you collaborate with.\n      type: object\n      properties:\n        id:\n          description: Unique identifier of the repository invitation.\n          type: integer\n          examples:\n          - 42\n        repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n        invitee:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        inviter:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        permissions:\n          description: The permission associated with the invitation.\n          type: string\n          enum:\n          - read\n          - write\n          - admin\n          - triage\n          - maintain\n          examples:\n          - read\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2016-06-13T14:52:50-05:00'\n        expired:\n          description: Whether or not the invitation has expired\n          type: boolean\n        url:\n          description: URL for the repository invitation\n          type: string\n          examples:\n          - https://api.github.com/user/repository-invitations/1\n        html_url:\n          type: string\n          examples:\n          - https://github.com/octocat/Hello-World/invitations\n        node_id:\n          type: string\n      required:\n      - id\n      - node_id\n      - permissions\n      - inviter\n      - invitee\n      - repository\n      - url\n      - html_url\n      - created_at\n    repository-collaborator-permission:\n      title: Repository Collaborator Permission\n      description: Repository Collaborator Permission\n      type: object\n      properties:\n        permission:\n          type: string\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/collaborator\"\n      required:\n      - permission\n      - user\n    commit-comment:\n      title: Commit Comment\n      description: Commit Comment\n      type: object\n      properties:\n        html_url:\n          type: string\n          format: uri\n        url:\n          type: string\n          format: uri\n        id:\n          type: integer\n        node_id:\n          type: string\n        body:\n          type: string\n        path:\n          type:\n          - string\n          - 'null'\n        position:\n          type:\n          - integer\n          - 'null'\n        line:\n          type:\n          - integer\n          - 'null'\n        commit_id:\n          type: string\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n      required:\n      - url\n      - html_url\n      - id\n      - node_id\n      - user\n      - position\n      - line\n      - path\n      - commit_id\n      - body\n      - author_association\n      - created_at\n      - updated_at\n    scim-error:\n      title: Scim Error\n      description: Scim Error\n      type: object\n      properties:\n        message:\n          type:\n          - string\n          - 'null'\n        documentation_url:\n          type:\n          - string\n          - 'null'\n        detail:\n          type:\n          - string\n          - 'null'\n        status:\n          type: integer\n        scimType:\n          type:\n          - string\n          - 'null'\n        schemas:\n          type: array\n          items:\n            type: string\n    branch-short:\n      title: Branch Short\n      description: Branch Short\n      type: object\n      properties:\n        name:\n          type: string\n        commit:\n          type: object\n          properties:\n            sha:\n              type: string\n            url:\n              type: string\n          required:\n          - sha\n          - url\n        protected:\n          type: boolean\n      required:\n      - name\n      - commit\n      - protected\n    link:\n      title: Link\n      description: Hypermedia Link\n      type: object\n      properties:\n        href:\n          type: string\n      required:\n      - href\n    pull-request-simple:\n      title: Pull Request Simple\n      description: Pull Request Simple\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/1347\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDExOlB1bGxSZXF1ZXN0MQ==\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/1347\n        diff_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/1347.diff\n        patch_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/1347.patch\n        issue_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/issues/1347\n        commits_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\n        review_comments_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\n        review_comment_url:\n          type: string\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\n        comments_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n        statuses_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        number:\n          type: integer\n          examples:\n          - 1347\n        state:\n          type: string\n          examples:\n          - open\n        locked:\n          type: boolean\n          examples:\n          - true\n        title:\n          type: string\n          examples:\n          - new-feature\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        body:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Please pull these awesome changes\n        labels:\n          type: array\n          items:\n            type: object\n            properties:\n              id:\n                type: integer\n                format: int64\n              node_id:\n                type: string\n              url:\n                type: string\n              name:\n                type: string\n              description:\n                type: string\n              color:\n                type: string\n              default:\n                type: boolean\n            required:\n            - id\n            - node_id\n            - url\n            - name\n            - description\n            - color\n            - default\n        milestone:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/milestone\"\n        active_lock_reason:\n          type:\n          - string\n          - 'null'\n          examples:\n          - too heated\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        closed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        merged_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        merge_commit_sha:\n          type:\n          - string\n          - 'null'\n          examples:\n          - e5bd3914e2e596debea16f433f57875b5b90bcd6\n        assignee:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        assignees:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/simple-user\"\n        requested_reviewers:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/simple-user\"\n        requested_teams:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/team\"\n        head:\n          type: object\n          properties:\n            label:\n              type: string\n            ref:\n              type: string\n            repo:\n              \"$ref\": \"#/components/schemas/repository\"\n            sha:\n              type: string\n            user:\n              anyOf:\n              - type: 'null'\n              - \"$ref\": \"#/components/schemas/simple-user\"\n          required:\n          - label\n          - ref\n          - repo\n          - sha\n          - user\n        base:\n          type: object\n          properties:\n            label:\n              type: string\n            ref:\n              type: string\n            repo:\n              \"$ref\": \"#/components/schemas/repository\"\n            sha:\n              type: string\n            user:\n              anyOf:\n              - type: 'null'\n              - \"$ref\": \"#/components/schemas/simple-user\"\n          required:\n          - label\n          - ref\n          - repo\n          - sha\n          - user\n        _links:\n          type: object\n          properties:\n            comments:\n              \"$ref\": \"#/components/schemas/link\"\n            commits:\n              \"$ref\": \"#/components/schemas/link\"\n            statuses:\n              \"$ref\": \"#/components/schemas/link\"\n            html:\n              \"$ref\": \"#/components/schemas/link\"\n            issue:\n              \"$ref\": \"#/components/schemas/link\"\n            review_comments:\n              \"$ref\": \"#/components/schemas/link\"\n            review_comment:\n              \"$ref\": \"#/components/schemas/link\"\n            self:\n              \"$ref\": \"#/components/schemas/link\"\n          required:\n          - comments\n          - commits\n          - statuses\n          - html\n          - issue\n          - review_comments\n          - review_comment\n          - self\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        draft:\n          description: Indicates whether or not the pull request is a draft.\n          type: boolean\n          examples:\n          - false\n      required:\n      - _links\n      - assignee\n      - labels\n      - base\n      - body\n      - closed_at\n      - comments_url\n      - commits_url\n      - created_at\n      - diff_url\n      - head\n      - html_url\n      - id\n      - node_id\n      - issue_url\n      - merge_commit_sha\n      - merged_at\n      - milestone\n      - number\n      - patch_url\n      - review_comment_url\n      - review_comments_url\n      - statuses_url\n      - state\n      - locked\n      - title\n      - updated_at\n      - url\n      - user\n      - author_association\n    simple-commit-status:\n      title: Simple Commit Status\n      type: object\n      properties:\n        description:\n          type:\n          - string\n          - 'null'\n        id:\n          type: integer\n        node_id:\n          type: string\n        state:\n          type: string\n        context:\n          type: string\n        target_url:\n          type: string\n          format: uri\n        required:\n          type:\n          - boolean\n          - 'null'\n        avatar_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        url:\n          type: string\n          format: uri\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n      required:\n      - description\n      - id\n      - node_id\n      - state\n      - context\n      - target_url\n      - avatar_url\n      - url\n      - created_at\n      - updated_at\n    combined-commit-status:\n      title: Combined Commit Status\n      description: Combined Commit Status\n      type: object\n      properties:\n        state:\n          type: string\n        statuses:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/simple-commit-status\"\n        sha:\n          type: string\n        total_count:\n          type: integer\n        repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n        commit_url:\n          type: string\n          format: uri\n        url:\n          type: string\n          format: uri\n      required:\n      - state\n      - sha\n      - total_count\n      - statuses\n      - repository\n      - commit_url\n      - url\n    status:\n      title: Status\n      description: The status of a commit.\n      type: object\n      properties:\n        url:\n          type: string\n        avatar_url:\n          type:\n          - string\n          - 'null'\n        id:\n          type: integer\n        node_id:\n          type: string\n        state:\n          type: string\n        description:\n          type: string\n        target_url:\n          type: string\n        context:\n          type: string\n        created_at:\n          type: string\n        updated_at:\n          type: string\n        creator:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - url\n      - avatar_url\n      - id\n      - node_id\n      - state\n      - description\n      - target_url\n      - context\n      - created_at\n      - updated_at\n      - creator\n    commit-comparison:\n      title: Commit Comparison\n      description: Commit Comparison\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/compare/master...topic\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/compare/master...topic\n        permalink_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17\n        diff_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/compare/master...topic.diff\n        patch_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/compare/master...topic.patch\n        base_commit:\n          \"$ref\": \"#/components/schemas/commit\"\n        merge_base_commit:\n          \"$ref\": \"#/components/schemas/commit\"\n        status:\n          type: string\n          enum:\n          - diverged\n          - ahead\n          - behind\n          - identical\n          examples:\n          - ahead\n        ahead_by:\n          type: integer\n          examples:\n          - 4\n        behind_by:\n          type: integer\n          examples:\n          - 5\n        total_commits:\n          type: integer\n          examples:\n          - 6\n        commits:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/commit\"\n        files:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/diff-entry\"\n      required:\n      - url\n      - html_url\n      - permalink_url\n      - diff_url\n      - patch_url\n      - base_commit\n      - merge_base_commit\n      - status\n      - ahead_by\n      - behind_by\n      - total_commits\n      - commits\n    content-reference-attachment:\n      title: ContentReferenceAttachment\n      description: Content Reference attachments allow you to provide context around\n        URLs posted in comments\n      type: object\n      properties:\n        id:\n          description: The ID of the attachment\n          type: integer\n          examples:\n          - 21\n        title:\n          description: The title of the attachment\n          type: string\n          maxLength: 1024\n          examples:\n          - Title of the attachment\n        body:\n          description: The body of the attachment\n          type: string\n          maxLength: 262144\n          examples:\n          - Body of the attachment\n        node_id:\n          description: The node_id of the content attachment\n          type: string\n          examples:\n          - MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=\n      required:\n      - id\n      - title\n      - body\n    content-tree:\n      title: Content Tree\n      description: Content Tree\n      type: object\n      properties:\n        type:\n          type: string\n        size:\n          type: integer\n        name:\n          type: string\n        path:\n          type: string\n        sha:\n          type: string\n        url:\n          type: string\n          format: uri\n        git_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        html_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        download_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        entries:\n          type: array\n          items:\n            type: object\n            properties:\n              type:\n                type: string\n              size:\n                type: integer\n              name:\n                type: string\n              path:\n                type: string\n              content:\n                type: string\n              sha:\n                type: string\n              url:\n                type: string\n                format: uri\n              git_url:\n                type:\n                - string\n                - 'null'\n                format: uri\n              html_url:\n                type:\n                - string\n                - 'null'\n                format: uri\n              download_url:\n                type:\n                - string\n                - 'null'\n                format: uri\n              _links:\n                type: object\n                properties:\n                  git:\n                    type:\n                    - string\n                    - 'null'\n                    format: uri\n                  html:\n                    type:\n                    - string\n                    - 'null'\n                    format: uri\n                  self:\n                    type: string\n                    format: uri\n                required:\n                - git\n                - html\n                - self\n            required:\n            - _links\n            - git_url\n            - html_url\n            - download_url\n            - name\n            - path\n            - sha\n            - size\n            - type\n            - url\n        _links:\n          type: object\n          properties:\n            git:\n              type:\n              - string\n              - 'null'\n              format: uri\n            html:\n              type:\n              - string\n              - 'null'\n              format: uri\n            self:\n              type: string\n              format: uri\n          required:\n          - git\n          - html\n          - self\n      required:\n      - _links\n      - git_url\n      - html_url\n      - download_url\n      - name\n      - path\n      - sha\n      - size\n      - type\n      - url\n      - content\n      - encoding\n    content-directory:\n      title: Content Directory\n      description: A list of directory items\n      type: array\n      items:\n        type: object\n        properties:\n          type:\n            type: string\n          size:\n            type: integer\n          name:\n            type: string\n          path:\n            type: string\n          content:\n            type: string\n          sha:\n            type: string\n          url:\n            type: string\n            format: uri\n          git_url:\n            type:\n            - string\n            - 'null'\n            format: uri\n          html_url:\n            type:\n            - string\n            - 'null'\n            format: uri\n          download_url:\n            type:\n            - string\n            - 'null'\n            format: uri\n          _links:\n            type: object\n            properties:\n              git:\n                type:\n                - string\n                - 'null'\n                format: uri\n              html:\n                type:\n                - string\n                - 'null'\n                format: uri\n              self:\n                type: string\n                format: uri\n            required:\n            - git\n            - html\n            - self\n        required:\n        - _links\n        - git_url\n        - html_url\n        - download_url\n        - name\n        - path\n        - sha\n        - size\n        - type\n        - url\n    content-file:\n      title: Content File\n      description: Content File\n      type: object\n      properties:\n        type:\n          type: string\n        encoding:\n          type: string\n        size:\n          type: integer\n        name:\n          type: string\n        path:\n          type: string\n        content:\n          type: string\n        sha:\n          type: string\n        url:\n          type: string\n          format: uri\n        git_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        html_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        download_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        _links:\n          type: object\n          properties:\n            git:\n              type:\n              - string\n              - 'null'\n              format: uri\n            html:\n              type:\n              - string\n              - 'null'\n              format: uri\n            self:\n              type: string\n              format: uri\n          required:\n          - git\n          - html\n          - self\n        target:\n          type: string\n          examples:\n          - '\"actual/actual.md\"'\n        submodule_git_url:\n          type: string\n          examples:\n          - '\"git://example.com/defunkt/dotjs.git\"'\n      required:\n      - _links\n      - git_url\n      - html_url\n      - download_url\n      - name\n      - path\n      - sha\n      - size\n      - type\n      - url\n      - content\n      - encoding\n    content-symlink:\n      title: Symlink Content\n      description: An object describing a symlink\n      type: object\n      properties:\n        type:\n          type: string\n        target:\n          type: string\n        size:\n          type: integer\n        name:\n          type: string\n        path:\n          type: string\n        sha:\n          type: string\n        url:\n          type: string\n          format: uri\n        git_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        html_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        download_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        _links:\n          type: object\n          properties:\n            git:\n              type:\n              - string\n              - 'null'\n              format: uri\n            html:\n              type:\n              - string\n              - 'null'\n              format: uri\n            self:\n              type: string\n              format: uri\n          required:\n          - git\n          - html\n          - self\n      required:\n      - _links\n      - git_url\n      - html_url\n      - download_url\n      - name\n      - path\n      - sha\n      - size\n      - type\n      - url\n      - target\n    content-submodule:\n      title: Symlink Content\n      description: An object describing a symlink\n      type: object\n      properties:\n        type:\n          type: string\n        submodule_git_url:\n          type: string\n          format: uri\n        size:\n          type: integer\n        name:\n          type: string\n        path:\n          type: string\n        sha:\n          type: string\n        url:\n          type: string\n          format: uri\n        git_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        html_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        download_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        _links:\n          type: object\n          properties:\n            git:\n              type:\n              - string\n              - 'null'\n              format: uri\n            html:\n              type:\n              - string\n              - 'null'\n              format: uri\n            self:\n              type: string\n              format: uri\n          required:\n          - git\n          - html\n          - self\n      required:\n      - _links\n      - git_url\n      - html_url\n      - download_url\n      - name\n      - path\n      - sha\n      - size\n      - type\n      - url\n      - submodule_git_url\n    file-commit:\n      title: File Commit\n      description: File Commit\n      type: object\n      required:\n      - content\n      - commit\n      properties:\n        content:\n          type:\n          - object\n          - 'null'\n          properties:\n            name:\n              type: string\n            path:\n              type: string\n            sha:\n              type: string\n            size:\n              type: integer\n            url:\n              type: string\n            html_url:\n              type: string\n            git_url:\n              type: string\n            download_url:\n              type: string\n            type:\n              type: string\n            _links:\n              type: object\n              properties:\n                self:\n                  type: string\n                git:\n                  type: string\n                html:\n                  type: string\n        commit:\n          type: object\n          properties:\n            sha:\n              type: string\n            node_id:\n              type: string\n            url:\n              type: string\n            html_url:\n              type: string\n            author:\n              type: object\n              properties:\n                date:\n                  type: string\n                name:\n                  type: string\n                email:\n                  type: string\n            committer:\n              type: object\n              properties:\n                date:\n                  type: string\n                name:\n                  type: string\n                email:\n                  type: string\n            message:\n              type: string\n            tree:\n              type: object\n              properties:\n                url:\n                  type: string\n                sha:\n                  type: string\n            parents:\n              type: array\n              items:\n                type: object\n                properties:\n                  url:\n                    type: string\n                  html_url:\n                    type: string\n                  sha:\n                    type: string\n            verification:\n              type: object\n              properties:\n                verified:\n                  type: boolean\n                reason:\n                  type: string\n                signature:\n                  type:\n                  - string\n                  - 'null'\n                payload:\n                  type:\n                  - string\n                  - 'null'\n    contributor:\n      title: Contributor\n      description: Contributor\n      type: object\n      properties:\n        login:\n          type: string\n        id:\n          type: integer\n        node_id:\n          type: string\n        avatar_url:\n          type: string\n          format: uri\n        gravatar_id:\n          type:\n          - string\n          - 'null'\n        url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n        followers_url:\n          type: string\n          format: uri\n        following_url:\n          type: string\n        gists_url:\n          type: string\n        starred_url:\n          type: string\n        subscriptions_url:\n          type: string\n          format: uri\n        organizations_url:\n          type: string\n          format: uri\n        repos_url:\n          type: string\n          format: uri\n        events_url:\n          type: string\n        received_events_url:\n          type: string\n          format: uri\n        type:\n          type: string\n        site_admin:\n          type: boolean\n        contributions:\n          type: integer\n        email:\n          type: string\n        name:\n          type: string\n      required:\n      - contributions\n      - type\n    deployment:\n      title: Deployment\n      description: A request for a specific ref(branch,sha,tag) to be deployed\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example/deployments/1\n        id:\n          description: Unique identifier of the deployment\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDEwOkRlcGxveW1lbnQx\n        sha:\n          type: string\n          examples:\n          - a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\n        ref:\n          description: The ref to deploy. This can be a branch, tag, or sha.\n          type: string\n          examples:\n          - topic-branch\n        task:\n          description: Parameter to specify a task to execute\n          type: string\n          examples:\n          - deploy\n        payload:\n          oneOf:\n          - type: object\n            additionalProperties: true\n          - type: string\n        original_environment:\n          type: string\n          examples:\n          - staging\n        environment:\n          description: Name for the target deployment environment.\n          type: string\n          examples:\n          - production\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Deploy request from hubot\n        creator:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2012-07-20T01:19:13Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2012-07-20T01:19:13Z'\n        statuses_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example/deployments/1/statuses\n        repository_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example\n        transient_environment:\n          description: 'Specifies if the given environment is will no longer exist\n            at some point in the future. Default: false.'\n          type: boolean\n          examples:\n          - true\n        production_environment:\n          description: 'Specifies if the given environment is one that end-users directly\n            interact with. Default: false.'\n          type: boolean\n          examples:\n          - true\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n      required:\n      - id\n      - node_id\n      - sha\n      - ref\n      - task\n      - environment\n      - creator\n      - payload\n      - description\n      - statuses_url\n      - repository_url\n      - url\n      - created_at\n      - updated_at\n    deployment-status:\n      title: Deployment Status\n      description: The status of a deployment.\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example/deployments/42/statuses/1\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDE2OkRlcGxveW1lbnRTdGF0dXMx\n        state:\n          description: The state of the status.\n          enum:\n          - error\n          - failure\n          - inactive\n          - pending\n          - success\n          - queued\n          - in_progress\n          type: string\n          examples:\n          - success\n        creator:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        description:\n          description: A short description of the status.\n          default: ''\n          type: string\n          maxLength: 140\n          examples:\n          - Deployment finished successfully.\n        environment:\n          description: The environment of the deployment that the status is for.\n          default: ''\n          type: string\n          examples:\n          - production\n        target_url:\n          description: 'Deprecated: the URL to associate with this status.'\n          default: ''\n          type: string\n          format: uri\n          examples:\n          - https://example.com/deployment/42/output\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2012-07-20T01:19:13Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2012-07-20T01:19:13Z'\n        deployment_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example/deployments/42\n        repository_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example\n        environment_url:\n          description: The URL for accessing your environment.\n          default: ''\n          type: string\n          format: uri\n          examples:\n          - https://staging.example.com/\n        log_url:\n          description: The URL to associate with this status.\n          default: ''\n          type: string\n          format: uri\n          examples:\n          - https://example.com/deployment/42/output\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n      required:\n      - id\n      - node_id\n      - state\n      - creator\n      - description\n      - deployment_url\n      - target_url\n      - repository_url\n      - url\n      - created_at\n      - updated_at\n    short-blob:\n      title: Short Blob\n      description: Short Blob\n      type: object\n      properties:\n        url:\n          type: string\n        sha:\n          type: string\n      required:\n      - url\n      - sha\n    blob:\n      title: Blob\n      description: Blob\n      type: object\n      properties:\n        content:\n          type: string\n        encoding:\n          type: string\n        url:\n          type: string\n          format: uri\n        sha:\n          type: string\n        size:\n          type:\n          - integer\n          - 'null'\n        node_id:\n          type: string\n        highlighted_content:\n          type: string\n      required:\n      - sha\n      - url\n      - node_id\n      - size\n      - content\n      - encoding\n    git-commit:\n      title: Git Commit\n      description: Low-level Git commit operations within a repository\n      type: object\n      properties:\n        sha:\n          description: SHA for the commit\n          type: string\n          examples:\n          - 7638417db6d59f3c431d3e1f261cc637155684cd\n        node_id:\n          type: string\n        url:\n          type: string\n          format: uri\n        author:\n          description: Identifying information for the git-user\n          type: object\n          properties:\n            date:\n              description: Timestamp of the commit\n              format: date-time\n              type: string\n              examples:\n              - '2014-08-09T08:02:04+12:00'\n            email:\n              type: string\n              description: Git email address of the user\n              examples:\n              - monalisa.octocat@example.com\n            name:\n              description: Name of the git user\n              type: string\n              examples:\n              - Monalisa Octocat\n          required:\n          - email\n          - name\n          - date\n        committer:\n          description: Identifying information for the git-user\n          type: object\n          properties:\n            date:\n              description: Timestamp of the commit\n              format: date-time\n              type: string\n              examples:\n              - '2014-08-09T08:02:04+12:00'\n            email:\n              type: string\n              description: Git email address of the user\n              examples:\n              - monalisa.octocat@example.com\n            name:\n              description: Name of the git user\n              type: string\n              examples:\n              - Monalisa Octocat\n          required:\n          - email\n          - name\n          - date\n        message:\n          description: Message describing the purpose of the commit\n          type: string\n          examples:\n          - 'Fix #42'\n        tree:\n          type: object\n          properties:\n            sha:\n              description: SHA for the commit\n              type: string\n              examples:\n              - 7638417db6d59f3c431d3e1f261cc637155684cd\n            url:\n              type: string\n              format: uri\n          required:\n          - sha\n          - url\n        parents:\n          type: array\n          items:\n            type: object\n            properties:\n              sha:\n                description: SHA for the commit\n                type: string\n                examples:\n                - 7638417db6d59f3c431d3e1f261cc637155684cd\n              url:\n                type: string\n                format: uri\n              html_url:\n                type: string\n                format: uri\n            required:\n            - sha\n            - url\n            - html_url\n        verification:\n          type: object\n          properties:\n            verified:\n              type: boolean\n            reason:\n              type: string\n            signature:\n              type:\n              - string\n              - 'null'\n            payload:\n              type:\n              - string\n              - 'null'\n          required:\n          - verified\n          - reason\n          - signature\n          - payload\n        html_url:\n          type: string\n          format: uri\n      required:\n      - sha\n      - node_id\n      - url\n      - html_url\n      - author\n      - committer\n      - tree\n      - message\n      - parents\n      - verification\n    git-ref:\n      title: Git Reference\n      description: Git references within a repository\n      type: object\n      properties:\n        ref:\n          type: string\n        node_id:\n          type: string\n        url:\n          type: string\n          format: uri\n        object:\n          type: object\n          properties:\n            type:\n              type: string\n            sha:\n              description: SHA for the reference\n              type: string\n              minLength: 40\n              maxLength: 40\n              examples:\n              - 7638417db6d59f3c431d3e1f261cc637155684cd\n            url:\n              type: string\n              format: uri\n          required:\n          - type\n          - sha\n          - url\n      required:\n      - ref\n      - node_id\n      - url\n      - object\n    git-tag:\n      title: Git Tag\n      description: Metadata for a Git tag\n      type: object\n      properties:\n        node_id:\n          type: string\n          examples:\n          - MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==\n        tag:\n          description: Name of the tag\n          type: string\n          examples:\n          - v0.0.1\n        sha:\n          type: string\n          examples:\n          - 940bd336248efae0f9ee5bc7b2d5c985887b16ac\n        url:\n          description: URL for the tag\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repositories/42/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac\n        message:\n          description: Message describing the purpose of the tag\n          type: string\n          examples:\n          - Initial public release\n        tagger:\n          type: object\n          properties:\n            date:\n              type: string\n            email:\n              type: string\n            name:\n              type: string\n          required:\n          - date\n          - email\n          - name\n        object:\n          type: object\n          properties:\n            sha:\n              type: string\n            type:\n              type: string\n            url:\n              type: string\n              format: uri\n          required:\n          - sha\n          - type\n          - url\n        verification:\n          \"$ref\": \"#/components/schemas/verification\"\n      required:\n      - sha\n      - url\n      - node_id\n      - tagger\n      - object\n      - tag\n      - message\n    git-tree:\n      title: Git Tree\n      description: The hierarchy between files in a Git repository.\n      type: object\n      properties:\n        sha:\n          type: string\n        url:\n          type: string\n          format: uri\n        truncated:\n          type: boolean\n        tree:\n          description: Objects specifying a tree structure\n          type: array\n          items:\n            type: object\n            properties:\n              path:\n                type: string\n                examples:\n                - test/file.rb\n              mode:\n                type: string\n                examples:\n                - '040000'\n              type:\n                type: string\n                examples:\n                - tree\n              sha:\n                type: string\n                examples:\n                - 23f6827669e43831def8a7ad935069c8bd418261\n              size:\n                type: integer\n                examples:\n                - 12\n              url:\n                type: string\n                examples:\n                - https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261\n          examples:\n          - path: file.rb\n            mode: '100644'\n            type: blob\n            size: 30\n            sha: 44b4fc6d56897b048c772eb4087f854f46256132\n            url: https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132\n            properties:\n              path:\n                type: string\n              mode:\n                type: string\n              type:\n                type: string\n              size:\n                type: integer\n              sha:\n                type: string\n              url:\n                type: string\n            required:\n            - path\n            - mode\n            - type\n            - sha\n            - url\n            - size\n      required:\n      - sha\n      - url\n      - tree\n      - truncated\n    hook-response:\n      title: Hook Response\n      type: object\n      properties:\n        code:\n          type:\n          - integer\n          - 'null'\n        status:\n          type:\n          - string\n          - 'null'\n        message:\n          type:\n          - string\n          - 'null'\n      required:\n      - code\n      - status\n      - message\n    hook:\n      title: Webhook\n      description: Webhooks for repositories.\n      type: object\n      properties:\n        type:\n          type: string\n        id:\n          description: Unique identifier of the webhook.\n          type: integer\n          examples:\n          - 42\n        name:\n          description: The name of a valid service, use 'web' for a webhook.\n          type: string\n          examples:\n          - web\n        active:\n          description: Determines whether the hook is actually triggered on pushes.\n          type: boolean\n          examples:\n          - true\n        events:\n          description: 'Determines what events the hook is triggered for. Default:\n            [''push''].'\n          type: array\n          items:\n            type: string\n          examples:\n          - push\n          - pull_request\n        config:\n          type: object\n          properties:\n            email:\n              type: string\n              examples:\n              - '\"foo@bar.com\"'\n            password:\n              type: string\n              examples:\n              - '\"foo\"'\n            room:\n              type: string\n              examples:\n              - '\"roomer\"'\n            subdomain:\n              type: string\n              examples:\n              - '\"foo\"'\n            url:\n              \"$ref\": \"#/components/schemas/webhook-config-url\"\n            insecure_ssl:\n              \"$ref\": \"#/components/schemas/webhook-config-insecure-ssl\"\n            content_type:\n              \"$ref\": \"#/components/schemas/webhook-config-content-type\"\n            digest:\n              type: string\n              examples:\n              - '\"sha256\"'\n            secret:\n              \"$ref\": \"#/components/schemas/webhook-config-secret\"\n            token:\n              type: string\n              examples:\n              - '\"abc\"'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-09-06T20:39:23Z'\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-09-06T17:26:27Z'\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/hooks/1\n        test_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/hooks/1/test\n        ping_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/hooks/1/pings\n        last_response:\n          \"$ref\": \"#/components/schemas/hook-response\"\n      required:\n      - id\n      - url\n      - type\n      - name\n      - active\n      - events\n      - config\n      - ping_url\n      - created_at\n      - updated_at\n      - last_response\n      - test_url\n    issue-event-label:\n      title: Issue Event Label\n      description: Issue Event Label\n      type: object\n      properties:\n        name:\n          type:\n          - string\n          - 'null'\n        color:\n          type:\n          - string\n          - 'null'\n      required:\n      - name\n      - color\n    issue-event-dismissed-review:\n      title: Issue Event Dismissed Review\n      type: object\n      properties:\n        state:\n          type: string\n        review_id:\n          type: integer\n        dismissal_message:\n          type:\n          - string\n          - 'null'\n        dismissal_commit_id:\n          type:\n          - string\n          - 'null'\n      required:\n      - state\n      - review_id\n      - dismissal_message\n    issue-event-milestone:\n      title: Issue Event Milestone\n      description: Issue Event Milestone\n      type: object\n      properties:\n        title:\n          type: string\n      required:\n      - title\n    issue-event-project-card:\n      title: Issue Event Project Card\n      description: Issue Event Project Card\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        id:\n          type: integer\n        project_url:\n          type: string\n          format: uri\n        project_id:\n          type: integer\n        column_name:\n          type: string\n        previous_column_name:\n          type: string\n      required:\n      - url\n      - id\n      - project_url\n      - project_id\n      - column_name\n    issue-event-rename:\n      title: Issue Event Rename\n      description: Issue Event Rename\n      type: object\n      properties:\n        from:\n          type: string\n        to:\n          type: string\n      required:\n      - from\n      - to\n    issue-event:\n      title: Issue Event\n      description: Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDEwOklzc3VlRXZlbnQx\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/issues/events/1\n        actor:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n          examples:\n          - closed\n        commit_id:\n          type:\n          - string\n          - 'null'\n          examples:\n          - 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        commit_url:\n          type:\n          - string\n          - 'null'\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        issue:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/issue\"\n        label:\n          \"$ref\": \"#/components/schemas/issue-event-label\"\n        assignee:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        assigner:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        review_requester:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        requested_reviewer:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        requested_team:\n          \"$ref\": \"#/components/schemas/team\"\n        dismissed_review:\n          \"$ref\": \"#/components/schemas/issue-event-dismissed-review\"\n        milestone:\n          \"$ref\": \"#/components/schemas/issue-event-milestone\"\n        project_card:\n          \"$ref\": \"#/components/schemas/issue-event-project-card\"\n        rename:\n          \"$ref\": \"#/components/schemas/issue-event-rename\"\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        lock_reason:\n          type:\n          - string\n          - 'null'\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n    labeled-issue-event:\n      title: Labeled Issue Event\n      description: Labeled Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        label:\n          type: object\n          properties:\n            name:\n              type: string\n            color:\n              type: string\n          required:\n          - name\n          - color\n      required:\n      - label\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    unlabeled-issue-event:\n      title: Unlabeled Issue Event\n      description: Unlabeled Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        label:\n          type: object\n          properties:\n            name:\n              type: string\n            color:\n              type: string\n          required:\n          - name\n          - color\n      required:\n      - label\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    assigned-issue-event:\n      title: Assigned Issue Event\n      description: Assigned Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          \"$ref\": \"#/components/schemas/integration\"\n        assignee:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        assigner:\n          \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n      - assignee\n      - assigner\n    unassigned-issue-event:\n      title: Unassigned Issue Event\n      description: Unassigned Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        assignee:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        assigner:\n          \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n      - assignee\n      - assigner\n    milestoned-issue-event:\n      title: Milestoned Issue Event\n      description: Milestoned Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        milestone:\n          type: object\n          properties:\n            title:\n              type: string\n          required:\n          - title\n      required:\n      - milestone\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    demilestoned-issue-event:\n      title: Demilestoned Issue Event\n      description: Demilestoned Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        milestone:\n          type: object\n          properties:\n            title:\n              type: string\n          required:\n          - title\n      required:\n      - milestone\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    renamed-issue-event:\n      title: Renamed Issue Event\n      description: Renamed Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        rename:\n          type: object\n          properties:\n            from:\n              type: string\n            to:\n              type: string\n          required:\n          - from\n          - to\n      required:\n      - rename\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    review-requested-issue-event:\n      title: Review Requested Issue Event\n      description: Review Requested Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        review_requester:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        requested_team:\n          \"$ref\": \"#/components/schemas/team\"\n        requested_reviewer:\n          \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - review_requester\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    review-request-removed-issue-event:\n      title: Review Request Removed Issue Event\n      description: Review Request Removed Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        review_requester:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        requested_team:\n          \"$ref\": \"#/components/schemas/team\"\n        requested_reviewer:\n          \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - review_requester\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    review-dismissed-issue-event:\n      title: Review Dismissed Issue Event\n      description: Review Dismissed Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        dismissed_review:\n          type: object\n          properties:\n            state:\n              type: string\n            review_id:\n              type: integer\n            dismissal_message:\n              type:\n              - string\n              - 'null'\n            dismissal_commit_id:\n              type: string\n          required:\n          - state\n          - review_id\n          - dismissal_message\n      required:\n      - dismissed_review\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    locked-issue-event:\n      title: Locked Issue Event\n      description: Locked Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        lock_reason:\n          type:\n          - string\n          - 'null'\n          examples:\n          - '\"off-topic\"'\n      required:\n      - lock_reason\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    added-to-project-issue-event:\n      title: Added to Project Issue Event\n      description: Added to Project Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        project_card:\n          type: object\n          properties:\n            id:\n              type: integer\n            url:\n              type: string\n              format: uri\n            project_id:\n              type: integer\n            project_url:\n              type: string\n              format: uri\n            column_name:\n              type: string\n            previous_column_name:\n              type: string\n          required:\n          - id\n          - url\n          - project_id\n          - project_url\n          - column_name\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    moved-column-in-project-issue-event:\n      title: Moved Column in Project Issue Event\n      description: Moved Column in Project Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        project_card:\n          type: object\n          properties:\n            id:\n              type: integer\n            url:\n              type: string\n              format: uri\n            project_id:\n              type: integer\n            project_url:\n              type: string\n              format: uri\n            column_name:\n              type: string\n            previous_column_name:\n              type: string\n          required:\n          - id\n          - url\n          - project_id\n          - project_url\n          - column_name\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    removed-from-project-issue-event:\n      title: Removed from Project Issue Event\n      description: Removed from Project Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        project_card:\n          type: object\n          properties:\n            id:\n              type: integer\n            url:\n              type: string\n              format: uri\n            project_id:\n              type: integer\n            project_url:\n              type: string\n              format: uri\n            column_name:\n              type: string\n            previous_column_name:\n              type: string\n          required:\n          - id\n          - url\n          - project_id\n          - project_url\n          - column_name\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    converted-note-to-issue-issue-event:\n      title: Converted Note to Issue Issue Event\n      description: Converted Note to Issue Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          \"$ref\": \"#/components/schemas/integration\"\n        project_card:\n          type: object\n          properties:\n            id:\n              type: integer\n            url:\n              type: string\n              format: uri\n            project_id:\n              type: integer\n            project_url:\n              type: string\n              format: uri\n            column_name:\n              type: string\n            previous_column_name:\n              type: string\n          required:\n          - id\n          - url\n          - project_id\n          - project_url\n          - column_name\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    issue-event-for-issue:\n      title: Issue Event for Issue\n      description: Issue Event for Issue\n      anyOf:\n      - \"$ref\": \"#/components/schemas/labeled-issue-event\"\n      - \"$ref\": \"#/components/schemas/unlabeled-issue-event\"\n      - \"$ref\": \"#/components/schemas/assigned-issue-event\"\n      - \"$ref\": \"#/components/schemas/unassigned-issue-event\"\n      - \"$ref\": \"#/components/schemas/milestoned-issue-event\"\n      - \"$ref\": \"#/components/schemas/demilestoned-issue-event\"\n      - \"$ref\": \"#/components/schemas/renamed-issue-event\"\n      - \"$ref\": \"#/components/schemas/review-requested-issue-event\"\n      - \"$ref\": \"#/components/schemas/review-request-removed-issue-event\"\n      - \"$ref\": \"#/components/schemas/review-dismissed-issue-event\"\n      - \"$ref\": \"#/components/schemas/locked-issue-event\"\n      - \"$ref\": \"#/components/schemas/added-to-project-issue-event\"\n      - \"$ref\": \"#/components/schemas/moved-column-in-project-issue-event\"\n      - \"$ref\": \"#/components/schemas/removed-from-project-issue-event\"\n      - \"$ref\": \"#/components/schemas/converted-note-to-issue-issue-event\"\n    label:\n      title: Label\n      description: Color-coded labels help you categorize and filter your issues (just\n        like labels in Gmail).\n      type: object\n      properties:\n        id:\n          type: integer\n          format: int64\n          examples:\n          - 208045946\n        node_id:\n          type: string\n          examples:\n          - MDU6TGFiZWwyMDgwNDU5NDY=\n        url:\n          description: URL for the label\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repositories/42/labels/bug\n        name:\n          description: The name of the label.\n          type: string\n          examples:\n          - bug\n        description:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Something isn't working\n        color:\n          description: '6-character hex code, without the leading #, identifying the\n            color'\n          type: string\n          examples:\n          - FFFFFF\n        default:\n          type: boolean\n          examples:\n          - true\n      required:\n      - id\n      - node_id\n      - url\n      - name\n      - description\n      - color\n      - default\n    timeline-comment-event:\n      title: Timeline Comment Event\n      description: Timeline Comment Event\n      type: object\n      properties:\n        event:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        id:\n          description: Unique identifier of the issue comment\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n        url:\n          description: URL for the issue comment\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repositories/42/issues/comments/1\n        body:\n          description: Contents of the issue comment\n          type: string\n          examples:\n          - What version of Safari were you using when you observed this bug?\n        body_text:\n          type: string\n        body_html:\n          type: string\n        html_url:\n          type: string\n          format: uri\n        user:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        issue_url:\n          type: string\n          format: uri\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n      required:\n      - event\n      - actor\n      - id\n      - node_id\n      - html_url\n      - issue_url\n      - author_association\n      - user\n      - url\n      - created_at\n      - updated_at\n    timeline-cross-referenced-event:\n      title: Timeline Cross Referenced Event\n      description: Timeline Cross Referenced Event\n      type: object\n      properties:\n        event:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        source:\n          type: object\n          properties:\n            type:\n              type: string\n            issue:\n              \"$ref\": \"#/components/schemas/issue\"\n      required:\n      - event\n      - created_at\n      - updated_at\n      - source\n    timeline-committed-event:\n      title: Timeline Committed Event\n      description: Timeline Committed Event\n      type: object\n      properties:\n        event:\n          type: string\n        sha:\n          description: SHA for the commit\n          type: string\n          examples:\n          - 7638417db6d59f3c431d3e1f261cc637155684cd\n        node_id:\n          type: string\n        url:\n          type: string\n          format: uri\n        author:\n          description: Identifying information for the git-user\n          type: object\n          properties:\n            date:\n              description: Timestamp of the commit\n              format: date-time\n              type: string\n              examples:\n              - '2014-08-09T08:02:04+12:00'\n            email:\n              type: string\n              description: Git email address of the user\n              examples:\n              - monalisa.octocat@example.com\n            name:\n              description: Name of the git user\n              type: string\n              examples:\n              - Monalisa Octocat\n          required:\n          - email\n          - name\n          - date\n        committer:\n          description: Identifying information for the git-user\n          type: object\n          properties:\n            date:\n              description: Timestamp of the commit\n              format: date-time\n              type: string\n              examples:\n              - '2014-08-09T08:02:04+12:00'\n            email:\n              type: string\n              description: Git email address of the user\n              examples:\n              - monalisa.octocat@example.com\n            name:\n              description: Name of the git user\n              type: string\n              examples:\n              - Monalisa Octocat\n          required:\n          - email\n          - name\n          - date\n        message:\n          description: Message describing the purpose of the commit\n          type: string\n          examples:\n          - 'Fix #42'\n        tree:\n          type: object\n          properties:\n            sha:\n              description: SHA for the commit\n              type: string\n              examples:\n              - 7638417db6d59f3c431d3e1f261cc637155684cd\n            url:\n              type: string\n              format: uri\n          required:\n          - sha\n          - url\n        parents:\n          type: array\n          items:\n            type: object\n            properties:\n              sha:\n                description: SHA for the commit\n                type: string\n                examples:\n                - 7638417db6d59f3c431d3e1f261cc637155684cd\n              url:\n                type: string\n                format: uri\n              html_url:\n                type: string\n                format: uri\n            required:\n            - sha\n            - url\n            - html_url\n        verification:\n          type: object\n          properties:\n            verified:\n              type: boolean\n            reason:\n              type: string\n            signature:\n              type:\n              - string\n              - 'null'\n            payload:\n              type:\n              - string\n              - 'null'\n          required:\n          - verified\n          - reason\n          - signature\n          - payload\n        html_url:\n          type: string\n          format: uri\n      required:\n      - sha\n      - node_id\n      - url\n      - html_url\n      - author\n      - committer\n      - tree\n      - message\n      - parents\n      - verification\n    timeline-reviewed-event:\n      title: Timeline Reviewed Event\n      description: Timeline Reviewed Event\n      type: object\n      properties:\n        event:\n          type: string\n        id:\n          description: Unique identifier of the review\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\n        user:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        body:\n          description: The text of the review.\n          type:\n          - string\n          - 'null'\n          examples:\n          - This looks great.\n        state:\n          type: string\n          examples:\n          - CHANGES_REQUESTED\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n        pull_request_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/12\n        _links:\n          type: object\n          properties:\n            html:\n              type: object\n              properties:\n                href:\n                  type: string\n              required:\n              - href\n            pull_request:\n              type: object\n              properties:\n                href:\n                  type: string\n              required:\n              - href\n          required:\n          - html\n          - pull_request\n        submitted_at:\n          type: string\n          format: date-time\n        commit_id:\n          description: A commit SHA for the review.\n          type: string\n          examples:\n          - 54bb654c9e6025347f57900a4a5c2313a96b8035\n        body_html:\n          type: string\n        body_text:\n          type: string\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n      required:\n      - event\n      - id\n      - node_id\n      - user\n      - body\n      - state\n      - commit_id\n      - html_url\n      - pull_request_url\n      - _links\n      - author_association\n    pull-request-review-comment:\n      title: Pull Request Review Comment\n      description: Pull Request Review Comments are comments on a portion of the Pull\n        Request's diff.\n      type: object\n      properties:\n        url:\n          description: URL for the pull request review comment\n          type: string\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n        pull_request_review_id:\n          description: The ID of the pull request review to which the comment belongs.\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 42\n        id:\n          description: The ID of the pull request review comment.\n          type: integer\n          examples:\n          - 1\n        node_id:\n          description: The node ID of the pull request review comment.\n          type: string\n          examples:\n          - MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\n        diff_hunk:\n          description: The diff of the line that the comment refers to.\n          type: string\n          examples:\n          - \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n        path:\n          description: The relative path of the file to which the comment applies.\n          type: string\n          examples:\n          - config/database.yaml\n        position:\n          description: The line index in the diff to which the comment applies.\n          type: integer\n          examples:\n          - 1\n        original_position:\n          description: The index of the original line in the diff to which the comment\n            applies.\n          type: integer\n          examples:\n          - 4\n        commit_id:\n          description: The SHA of the commit to which the comment applies.\n          type: string\n          examples:\n          - 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        original_commit_id:\n          description: The SHA of the original commit to which the comment applies.\n          type: string\n          examples:\n          - 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\n        in_reply_to_id:\n          description: The comment ID to reply to.\n          type: integer\n          examples:\n          - 8\n        user:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        body:\n          description: The text of the comment.\n          type: string\n          examples:\n          - We should probably include a check for null values here.\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        html_url:\n          description: HTML URL for the pull request review comment.\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n        pull_request_url:\n          description: URL for the pull request that the review comment belongs to.\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/1\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        _links:\n          type: object\n          properties:\n            self:\n              type: object\n              properties:\n                href:\n                  type: string\n                  format: uri\n                  examples:\n                  - https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n              required:\n              - href\n            html:\n              type: object\n              properties:\n                href:\n                  type: string\n                  format: uri\n                  examples:\n                  - https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n              required:\n              - href\n            pull_request:\n              type: object\n              properties:\n                href:\n                  type: string\n                  format: uri\n                  examples:\n                  - https://api.github.com/repos/octocat/Hello-World/pulls/1\n              required:\n              - href\n          required:\n          - self\n          - html\n          - pull_request\n        start_line:\n          type:\n          - integer\n          - 'null'\n          description: The first line of the range for a multi-line comment.\n          examples:\n          - 2\n        original_start_line:\n          type:\n          - integer\n          - 'null'\n          description: The first line of the range for a multi-line comment.\n          examples:\n          - 2\n        start_side:\n          type:\n          - string\n          - 'null'\n          description: The side of the first line of the range for a multi-line comment.\n          enum:\n          - LEFT\n          - RIGHT\n          - \n          default: RIGHT\n        line:\n          description: The line of the blob to which the comment applies. The last\n            line of the range for a multi-line comment\n          type: integer\n          examples:\n          - 2\n        original_line:\n          description: The line of the blob to which the comment applies. The last\n            line of the range for a multi-line comment\n          type: integer\n          examples:\n          - 2\n        side:\n          description: The side of the diff to which the comment applies. The side\n            of the last line of the range for a multi-line comment\n          enum:\n          - LEFT\n          - RIGHT\n          default: RIGHT\n          type: string\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n        body_html:\n          type: string\n          examples:\n          - '\"<p>comment body</p>\"'\n        body_text:\n          type: string\n          examples:\n          - '\"comment body\"'\n      required:\n      - url\n      - id\n      - node_id\n      - pull_request_review_id\n      - diff_hunk\n      - path\n      - position\n      - original_position\n      - commit_id\n      - original_commit_id\n      - user\n      - body\n      - created_at\n      - updated_at\n      - html_url\n      - pull_request_url\n      - author_association\n      - _links\n    timeline-line-commented-event:\n      title: Timeline Line Commented Event\n      description: Timeline Line Commented Event\n      type: object\n      properties:\n        event:\n          type: string\n        node_id:\n          type: string\n        comments:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/pull-request-review-comment\"\n    timeline-commit-commented-event:\n      title: Timeline Commit Commented Event\n      description: Timeline Commit Commented Event\n      type: object\n      properties:\n        event:\n          type: string\n        node_id:\n          type: string\n        commit_id:\n          type: string\n        comments:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/commit-comment\"\n    timeline-assigned-issue-event:\n      title: Timeline Assigned Issue Event\n      description: Timeline Assigned Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        assignee:\n          \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n      - assignee\n    timeline-unassigned-issue-event:\n      title: Timeline Unassigned Issue Event\n      description: Timeline Unassigned Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        assignee:\n          \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n      - assignee\n    state-change-issue-event:\n      title: State Change Issue Event\n      description: State Change Issue Event\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n        actor:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        event:\n          type: string\n        commit_id:\n          type:\n          - string\n          - 'null'\n        commit_url:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n      required:\n      - id\n      - node_id\n      - url\n      - actor\n      - event\n      - commit_id\n      - commit_url\n      - created_at\n      - performed_via_github_app\n    timeline-issue-events:\n      title: Timeline Event\n      description: Timeline Event\n      type: object\n      anyOf:\n      - \"$ref\": \"#/components/schemas/labeled-issue-event\"\n      - \"$ref\": \"#/components/schemas/unlabeled-issue-event\"\n      - \"$ref\": \"#/components/schemas/milestoned-issue-event\"\n      - \"$ref\": \"#/components/schemas/demilestoned-issue-event\"\n      - \"$ref\": \"#/components/schemas/renamed-issue-event\"\n      - \"$ref\": \"#/components/schemas/review-requested-issue-event\"\n      - \"$ref\": \"#/components/schemas/review-request-removed-issue-event\"\n      - \"$ref\": \"#/components/schemas/review-dismissed-issue-event\"\n      - \"$ref\": \"#/components/schemas/locked-issue-event\"\n      - \"$ref\": \"#/components/schemas/added-to-project-issue-event\"\n      - \"$ref\": \"#/components/schemas/moved-column-in-project-issue-event\"\n      - \"$ref\": \"#/components/schemas/removed-from-project-issue-event\"\n      - \"$ref\": \"#/components/schemas/converted-note-to-issue-issue-event\"\n      - \"$ref\": \"#/components/schemas/timeline-comment-event\"\n      - \"$ref\": \"#/components/schemas/timeline-cross-referenced-event\"\n      - \"$ref\": \"#/components/schemas/timeline-committed-event\"\n      - \"$ref\": \"#/components/schemas/timeline-reviewed-event\"\n      - \"$ref\": \"#/components/schemas/timeline-line-commented-event\"\n      - \"$ref\": \"#/components/schemas/timeline-commit-commented-event\"\n      - \"$ref\": \"#/components/schemas/timeline-assigned-issue-event\"\n      - \"$ref\": \"#/components/schemas/timeline-unassigned-issue-event\"\n      - \"$ref\": \"#/components/schemas/state-change-issue-event\"\n    deploy-key:\n      title: Deploy Key\n      description: An SSH key granting access to a single repository.\n      type: object\n      properties:\n        id:\n          type: integer\n        key:\n          type: string\n        url:\n          type: string\n        title:\n          type: string\n        verified:\n          type: boolean\n        created_at:\n          type: string\n        read_only:\n          type: boolean\n      required:\n      - id\n      - key\n      - url\n      - title\n      - verified\n      - created_at\n      - read_only\n    language:\n      title: Language\n      description: Language\n      type: object\n      additionalProperties:\n        type: integer\n    license-content:\n      title: License Content\n      description: License Content\n      type: object\n      properties:\n        name:\n          type: string\n        path:\n          type: string\n        sha:\n          type: string\n        size:\n          type: integer\n        url:\n          type: string\n          format: uri\n        html_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        git_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        download_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        type:\n          type: string\n        content:\n          type: string\n        encoding:\n          type: string\n        _links:\n          type: object\n          properties:\n            git:\n              type:\n              - string\n              - 'null'\n              format: uri\n            html:\n              type:\n              - string\n              - 'null'\n              format: uri\n            self:\n              type: string\n              format: uri\n          required:\n          - git\n          - html\n          - self\n        license:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/license-simple\"\n      required:\n      - _links\n      - git_url\n      - html_url\n      - download_url\n      - name\n      - path\n      - sha\n      - size\n      - type\n      - url\n      - content\n      - encoding\n      - license\n    pages-source-hash:\n      title: Pages Source Hash\n      type: object\n      properties:\n        branch:\n          type: string\n        path:\n          type: string\n      required:\n      - branch\n      - path\n    pages-https-certificate:\n      title: Pages Https Certificate\n      type: object\n      properties:\n        state:\n          type: string\n          enum:\n          - new\n          - authorization_created\n          - authorization_pending\n          - authorized\n          - authorization_revoked\n          - issued\n          - uploaded\n          - approved\n          - errored\n          - bad_authz\n          - destroy_pending\n          - dns_changed\n          examples:\n          - approved\n        description:\n          type: string\n          examples:\n          - Certificate is approved\n        domains:\n          type: array\n          items:\n            type: string\n          description: Array of the domain set and its alternate name (if it is configured)\n          examples:\n          - example.com\n          - www.example.com\n        expires_at:\n          type: string\n          format: date\n      required:\n      - state\n      - description\n      - domains\n    page:\n      title: GitHub Pages\n      description: The configuration for GitHub Pages for a repository.\n      type: object\n      properties:\n        url:\n          type: string\n          description: The API address for accessing this Page resource.\n          format: uri\n          examples:\n          - https://api.github.com/repos/github/hello-world/pages\n        status:\n          type:\n          - string\n          - 'null'\n          description: The status of the most recent build of the Page.\n          enum:\n          - built\n          - building\n          - errored\n          - \n          examples:\n          - built\n        cname:\n          description: The Pages site's custom domain\n          type:\n          - string\n          - 'null'\n          examples:\n          - example.com\n        protected_domain_state:\n          type:\n          - string\n          - 'null'\n          description: The state if the domain is verified\n          enum:\n          - pending\n          - verified\n          - unverified\n          - \n          examples:\n          - pending\n        pending_domain_unverified_at:\n          type:\n          - string\n          - 'null'\n          description: The timestamp when a pending domain becomes unverified.\n          format: date-time\n        custom_404:\n          type: boolean\n          description: Whether the Page has a custom 404 page.\n          default: false\n          examples:\n          - false\n        html_url:\n          type: string\n          description: The web address the Page can be accessed from.\n          format: uri\n          examples:\n          - https://example.com\n        source:\n          \"$ref\": \"#/components/schemas/pages-source-hash\"\n        public:\n          type: boolean\n          description: Whether the GitHub Pages site is publicly visible. If set to\n            `true`, the site is accessible to anyone on the internet. If set to `false`,\n            the site will only be accessible to users who have at least `read` access\n            to the repository that published the site.\n          examples:\n          - true\n        https_certificate:\n          \"$ref\": \"#/components/schemas/pages-https-certificate\"\n        https_enforced:\n          type: boolean\n          description: Whether https is enabled on the domain\n          examples:\n          - true\n      required:\n      - url\n      - status\n      - cname\n      - custom_404\n      - public\n    page-build:\n      title: Page Build\n      description: Page Build\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        status:\n          type: string\n        error:\n          type: object\n          properties:\n            message:\n              type:\n              - string\n              - 'null'\n          required:\n          - message\n        pusher:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        commit:\n          type: string\n        duration:\n          type: integer\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n      required:\n      - url\n      - status\n      - error\n      - pusher\n      - commit\n      - duration\n      - created_at\n      - updated_at\n    page-build-status:\n      title: Page Build Status\n      description: Page Build Status\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/github/hello-world/pages/builds/latest\n        status:\n          type: string\n          examples:\n          - queued\n      required:\n      - url\n      - status\n    repository-pre-receive-hook:\n      type: object\n      properties:\n        id:\n          type: integer\n        name:\n          type: string\n        enforcement:\n          type: string\n        configuration_url:\n          type: string\n    pull-request:\n      type: object\n      title: Pull Request\n      description: Pull requests let you tell others about changes you've pushed to\n        a repository on GitHub. Once a pull request is sent, interested parties can\n        review the set of changes, discuss potential modifications, and even push\n        follow-up commits if necessary.\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/1347\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDExOlB1bGxSZXF1ZXN0MQ==\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/1347\n        diff_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/1347.diff\n        patch_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/1347.patch\n        issue_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/issues/1347\n        commits_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\n        review_comments_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\n        review_comment_url:\n          type: string\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\n        comments_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n        statuses_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        number:\n          description: Number uniquely identifying the pull request within its repository.\n          type: integer\n          examples:\n          - 42\n        state:\n          description: State of this Pull Request. Either `open` or `closed`.\n          enum:\n          - open\n          - closed\n          type: string\n          examples:\n          - open\n        locked:\n          type: boolean\n          examples:\n          - true\n        title:\n          description: The title of the pull request.\n          type: string\n          examples:\n          - Amazing new feature\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        body:\n          type:\n          - string\n          - 'null'\n          examples:\n          - Please pull these awesome changes\n        labels:\n          type: array\n          items:\n            type: object\n            properties:\n              id:\n                type: integer\n                format: int64\n              node_id:\n                type: string\n              url:\n                type: string\n              name:\n                type: string\n              description:\n                type:\n                - string\n                - 'null'\n              color:\n                type: string\n              default:\n                type: boolean\n            required:\n            - id\n            - node_id\n            - url\n            - name\n            - description\n            - color\n            - default\n        milestone:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/milestone\"\n        active_lock_reason:\n          type:\n          - string\n          - 'null'\n          examples:\n          - too heated\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        closed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        merged_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n          examples:\n          - '2011-01-26T19:01:12Z'\n        merge_commit_sha:\n          type:\n          - string\n          - 'null'\n          examples:\n          - e5bd3914e2e596debea16f433f57875b5b90bcd6\n        assignee:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        assignees:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/simple-user\"\n        requested_reviewers:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/simple-user\"\n        requested_teams:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/team-simple\"\n        head:\n          type: object\n          properties:\n            label:\n              type: string\n            ref:\n              type: string\n            repo:\n              type:\n              - object\n              - 'null'\n              properties:\n                archive_url:\n                  type: string\n                assignees_url:\n                  type: string\n                blobs_url:\n                  type: string\n                branches_url:\n                  type: string\n                collaborators_url:\n                  type: string\n                comments_url:\n                  type: string\n                commits_url:\n                  type: string\n                compare_url:\n                  type: string\n                contents_url:\n                  type: string\n                contributors_url:\n                  type: string\n                  format: uri\n                deployments_url:\n                  type: string\n                  format: uri\n                description:\n                  type:\n                  - string\n                  - 'null'\n                downloads_url:\n                  type: string\n                  format: uri\n                events_url:\n                  type: string\n                  format: uri\n                fork:\n                  type: boolean\n                forks_url:\n                  type: string\n                  format: uri\n                full_name:\n                  type: string\n                git_commits_url:\n                  type: string\n                git_refs_url:\n                  type: string\n                git_tags_url:\n                  type: string\n                hooks_url:\n                  type: string\n                  format: uri\n                html_url:\n                  type: string\n                  format: uri\n                id:\n                  type: integer\n                node_id:\n                  type: string\n                issue_comment_url:\n                  type: string\n                issue_events_url:\n                  type: string\n                issues_url:\n                  type: string\n                keys_url:\n                  type: string\n                labels_url:\n                  type: string\n                languages_url:\n                  type: string\n                  format: uri\n                merges_url:\n                  type: string\n                  format: uri\n                milestones_url:\n                  type: string\n                name:\n                  type: string\n                notifications_url:\n                  type: string\n                owner:\n                  type: object\n                  properties:\n                    avatar_url:\n                      type: string\n                      format: uri\n                    events_url:\n                      type: string\n                    followers_url:\n                      type: string\n                      format: uri\n                    following_url:\n                      type: string\n                    gists_url:\n                      type: string\n                    gravatar_id:\n                      type:\n                      - string\n                      - 'null'\n                    html_url:\n                      type: string\n                      format: uri\n                    id:\n                      type: integer\n                    node_id:\n                      type: string\n                    login:\n                      type: string\n                    organizations_url:\n                      type: string\n                      format: uri\n                    received_events_url:\n                      type: string\n                      format: uri\n                    repos_url:\n                      type: string\n                      format: uri\n                    site_admin:\n                      type: boolean\n                    starred_url:\n                      type: string\n                    subscriptions_url:\n                      type: string\n                      format: uri\n                    type:\n                      type: string\n                    url:\n                      type: string\n                      format: uri\n                  required:\n                  - avatar_url\n                  - events_url\n                  - followers_url\n                  - following_url\n                  - gists_url\n                  - gravatar_id\n                  - html_url\n                  - id\n                  - node_id\n                  - login\n                  - organizations_url\n                  - received_events_url\n                  - repos_url\n                  - site_admin\n                  - starred_url\n                  - subscriptions_url\n                  - type\n                  - url\n                private:\n                  type: boolean\n                pulls_url:\n                  type: string\n                releases_url:\n                  type: string\n                stargazers_url:\n                  type: string\n                  format: uri\n                statuses_url:\n                  type: string\n                subscribers_url:\n                  type: string\n                  format: uri\n                subscription_url:\n                  type: string\n                  format: uri\n                tags_url:\n                  type: string\n                  format: uri\n                teams_url:\n                  type: string\n                  format: uri\n                trees_url:\n                  type: string\n                url:\n                  type: string\n                  format: uri\n                clone_url:\n                  type: string\n                default_branch:\n                  type: string\n                forks:\n                  type: integer\n                forks_count:\n                  type: integer\n                git_url:\n                  type: string\n                has_downloads:\n                  type: boolean\n                has_issues:\n                  type: boolean\n                has_projects:\n                  type: boolean\n                has_wiki:\n                  type: boolean\n                has_pages:\n                  type: boolean\n                homepage:\n                  type:\n                  - string\n                  - 'null'\n                  format: uri\n                language:\n                  type:\n                  - string\n                  - 'null'\n                master_branch:\n                  type: string\n                archived:\n                  type: boolean\n                disabled:\n                  type: boolean\n                visibility:\n                  description: 'The repository visibility: public, private, or internal.'\n                  type: string\n                mirror_url:\n                  type:\n                  - string\n                  - 'null'\n                  format: uri\n                open_issues:\n                  type: integer\n                open_issues_count:\n                  type: integer\n                permissions:\n                  type: object\n                  properties:\n                    admin:\n                      type: boolean\n                    maintain:\n                      type: boolean\n                    push:\n                      type: boolean\n                    triage:\n                      type: boolean\n                    pull:\n                      type: boolean\n                  required:\n                  - admin\n                  - pull\n                  - push\n                temp_clone_token:\n                  type: string\n                allow_merge_commit:\n                  type: boolean\n                allow_squash_merge:\n                  type: boolean\n                allow_rebase_merge:\n                  type: boolean\n                license:\n                  type:\n                  - object\n                  - 'null'\n                  properties:\n                    key:\n                      type: string\n                    name:\n                      type: string\n                    url:\n                      type:\n                      - string\n                      - 'null'\n                      format: uri\n                    spdx_id:\n                      type:\n                      - string\n                      - 'null'\n                    node_id:\n                      type: string\n                  required:\n                  - key\n                  - name\n                  - url\n                  - spdx_id\n                  - node_id\n                pushed_at:\n                  type: string\n                  format: date-time\n                size:\n                  type: integer\n                ssh_url:\n                  type: string\n                stargazers_count:\n                  type: integer\n                svn_url:\n                  type: string\n                  format: uri\n                topics:\n                  type: array\n                  items:\n                    type: string\n                watchers:\n                  type: integer\n                watchers_count:\n                  type: integer\n                created_at:\n                  type: string\n                  format: date-time\n                updated_at:\n                  type: string\n                  format: date-time\n                allow_forking:\n                  type: boolean\n                is_template:\n                  type: boolean\n              required:\n              - archive_url\n              - assignees_url\n              - blobs_url\n              - branches_url\n              - collaborators_url\n              - comments_url\n              - commits_url\n              - compare_url\n              - contents_url\n              - contributors_url\n              - deployments_url\n              - description\n              - downloads_url\n              - events_url\n              - fork\n              - forks_url\n              - full_name\n              - git_commits_url\n              - git_refs_url\n              - git_tags_url\n              - hooks_url\n              - html_url\n              - id\n              - node_id\n              - issue_comment_url\n              - issue_events_url\n              - issues_url\n              - keys_url\n              - labels_url\n              - languages_url\n              - merges_url\n              - milestones_url\n              - name\n              - notifications_url\n              - owner\n              - private\n              - pulls_url\n              - releases_url\n              - stargazers_url\n              - statuses_url\n              - subscribers_url\n              - subscription_url\n              - tags_url\n              - teams_url\n              - trees_url\n              - url\n              - clone_url\n              - default_branch\n              - forks\n              - forks_count\n              - git_url\n              - has_downloads\n              - has_issues\n              - has_projects\n              - has_wiki\n              - has_pages\n              - homepage\n              - language\n              - archived\n              - disabled\n              - mirror_url\n              - open_issues\n              - open_issues_count\n              - license\n              - pushed_at\n              - size\n              - ssh_url\n              - stargazers_count\n              - svn_url\n              - watchers\n              - watchers_count\n              - created_at\n              - updated_at\n            sha:\n              type: string\n            user:\n              type: object\n              properties:\n                avatar_url:\n                  type: string\n                  format: uri\n                events_url:\n                  type: string\n                followers_url:\n                  type: string\n                  format: uri\n                following_url:\n                  type: string\n                gists_url:\n                  type: string\n                gravatar_id:\n                  type:\n                  - string\n                  - 'null'\n                html_url:\n                  type: string\n                  format: uri\n                id:\n                  type: integer\n                node_id:\n                  type: string\n                login:\n                  type: string\n                organizations_url:\n                  type: string\n                  format: uri\n                received_events_url:\n                  type: string\n                  format: uri\n                repos_url:\n                  type: string\n                  format: uri\n                site_admin:\n                  type: boolean\n                starred_url:\n                  type: string\n                subscriptions_url:\n                  type: string\n                  format: uri\n                type:\n                  type: string\n                url:\n                  type: string\n                  format: uri\n              required:\n              - avatar_url\n              - events_url\n              - followers_url\n              - following_url\n              - gists_url\n              - gravatar_id\n              - html_url\n              - id\n              - node_id\n              - login\n              - organizations_url\n              - received_events_url\n              - repos_url\n              - site_admin\n              - starred_url\n              - subscriptions_url\n              - type\n              - url\n          required:\n          - label\n          - ref\n          - repo\n          - sha\n          - user\n        base:\n          type: object\n          properties:\n            label:\n              type: string\n            ref:\n              type: string\n            repo:\n              type: object\n              properties:\n                archive_url:\n                  type: string\n                assignees_url:\n                  type: string\n                blobs_url:\n                  type: string\n                branches_url:\n                  type: string\n                collaborators_url:\n                  type: string\n                comments_url:\n                  type: string\n                commits_url:\n                  type: string\n                compare_url:\n                  type: string\n                contents_url:\n                  type: string\n                contributors_url:\n                  type: string\n                  format: uri\n                deployments_url:\n                  type: string\n                  format: uri\n                description:\n                  type:\n                  - string\n                  - 'null'\n                downloads_url:\n                  type: string\n                  format: uri\n                events_url:\n                  type: string\n                  format: uri\n                fork:\n                  type: boolean\n                forks_url:\n                  type: string\n                  format: uri\n                full_name:\n                  type: string\n                git_commits_url:\n                  type: string\n                git_refs_url:\n                  type: string\n                git_tags_url:\n                  type: string\n                hooks_url:\n                  type: string\n                  format: uri\n                html_url:\n                  type: string\n                  format: uri\n                id:\n                  type: integer\n                is_template:\n                  type: boolean\n                node_id:\n                  type: string\n                issue_comment_url:\n                  type: string\n                issue_events_url:\n                  type: string\n                issues_url:\n                  type: string\n                keys_url:\n                  type: string\n                labels_url:\n                  type: string\n                languages_url:\n                  type: string\n                  format: uri\n                merges_url:\n                  type: string\n                  format: uri\n                milestones_url:\n                  type: string\n                name:\n                  type: string\n                notifications_url:\n                  type: string\n                owner:\n                  type: object\n                  properties:\n                    avatar_url:\n                      type: string\n                      format: uri\n                    events_url:\n                      type: string\n                    followers_url:\n                      type: string\n                      format: uri\n                    following_url:\n                      type: string\n                    gists_url:\n                      type: string\n                    gravatar_id:\n                      type:\n                      - string\n                      - 'null'\n                    html_url:\n                      type: string\n                      format: uri\n                    id:\n                      type: integer\n                    node_id:\n                      type: string\n                    login:\n                      type: string\n                    organizations_url:\n                      type: string\n                      format: uri\n                    received_events_url:\n                      type: string\n                      format: uri\n                    repos_url:\n                      type: string\n                      format: uri\n                    site_admin:\n                      type: boolean\n                    starred_url:\n                      type: string\n                    subscriptions_url:\n                      type: string\n                      format: uri\n                    type:\n                      type: string\n                    url:\n                      type: string\n                      format: uri\n                  required:\n                  - avatar_url\n                  - events_url\n                  - followers_url\n                  - following_url\n                  - gists_url\n                  - gravatar_id\n                  - html_url\n                  - id\n                  - node_id\n                  - login\n                  - organizations_url\n                  - received_events_url\n                  - repos_url\n                  - site_admin\n                  - starred_url\n                  - subscriptions_url\n                  - type\n                  - url\n                private:\n                  type: boolean\n                pulls_url:\n                  type: string\n                releases_url:\n                  type: string\n                stargazers_url:\n                  type: string\n                  format: uri\n                statuses_url:\n                  type: string\n                subscribers_url:\n                  type: string\n                  format: uri\n                subscription_url:\n                  type: string\n                  format: uri\n                tags_url:\n                  type: string\n                  format: uri\n                teams_url:\n                  type: string\n                  format: uri\n                trees_url:\n                  type: string\n                url:\n                  type: string\n                  format: uri\n                clone_url:\n                  type: string\n                default_branch:\n                  type: string\n                forks:\n                  type: integer\n                forks_count:\n                  type: integer\n                git_url:\n                  type: string\n                has_downloads:\n                  type: boolean\n                has_issues:\n                  type: boolean\n                has_projects:\n                  type: boolean\n                has_wiki:\n                  type: boolean\n                has_pages:\n                  type: boolean\n                homepage:\n                  type:\n                  - string\n                  - 'null'\n                  format: uri\n                language:\n                  type:\n                  - string\n                  - 'null'\n                master_branch:\n                  type: string\n                archived:\n                  type: boolean\n                disabled:\n                  type: boolean\n                visibility:\n                  description: 'The repository visibility: public, private, or internal.'\n                  type: string\n                mirror_url:\n                  type:\n                  - string\n                  - 'null'\n                  format: uri\n                open_issues:\n                  type: integer\n                open_issues_count:\n                  type: integer\n                permissions:\n                  type: object\n                  properties:\n                    admin:\n                      type: boolean\n                    maintain:\n                      type: boolean\n                    push:\n                      type: boolean\n                    triage:\n                      type: boolean\n                    pull:\n                      type: boolean\n                  required:\n                  - admin\n                  - pull\n                  - push\n                temp_clone_token:\n                  type: string\n                allow_merge_commit:\n                  type: boolean\n                allow_squash_merge:\n                  type: boolean\n                allow_rebase_merge:\n                  type: boolean\n                license:\n                  anyOf:\n                  - type: 'null'\n                  - \"$ref\": \"#/components/schemas/license-simple\"\n                pushed_at:\n                  type: string\n                  format: date-time\n                size:\n                  type: integer\n                ssh_url:\n                  type: string\n                stargazers_count:\n                  type: integer\n                svn_url:\n                  type: string\n                  format: uri\n                topics:\n                  type: array\n                  items:\n                    type: string\n                watchers:\n                  type: integer\n                watchers_count:\n                  type: integer\n                created_at:\n                  type: string\n                  format: date-time\n                updated_at:\n                  type: string\n                  format: date-time\n                allow_forking:\n                  type: boolean\n              required:\n              - archive_url\n              - assignees_url\n              - blobs_url\n              - branches_url\n              - collaborators_url\n              - comments_url\n              - commits_url\n              - compare_url\n              - contents_url\n              - contributors_url\n              - deployments_url\n              - description\n              - downloads_url\n              - events_url\n              - fork\n              - forks_url\n              - full_name\n              - git_commits_url\n              - git_refs_url\n              - git_tags_url\n              - hooks_url\n              - html_url\n              - id\n              - node_id\n              - issue_comment_url\n              - issue_events_url\n              - issues_url\n              - keys_url\n              - labels_url\n              - languages_url\n              - merges_url\n              - milestones_url\n              - name\n              - notifications_url\n              - owner\n              - private\n              - pulls_url\n              - releases_url\n              - stargazers_url\n              - statuses_url\n              - subscribers_url\n              - subscription_url\n              - tags_url\n              - teams_url\n              - trees_url\n              - url\n              - clone_url\n              - default_branch\n              - forks\n              - forks_count\n              - git_url\n              - has_downloads\n              - has_issues\n              - has_projects\n              - has_wiki\n              - has_pages\n              - homepage\n              - language\n              - archived\n              - disabled\n              - mirror_url\n              - open_issues\n              - open_issues_count\n              - license\n              - pushed_at\n              - size\n              - ssh_url\n              - stargazers_count\n              - svn_url\n              - watchers\n              - watchers_count\n              - created_at\n              - updated_at\n            sha:\n              type: string\n            user:\n              type: object\n              properties:\n                avatar_url:\n                  type: string\n                  format: uri\n                events_url:\n                  type: string\n                followers_url:\n                  type: string\n                  format: uri\n                following_url:\n                  type: string\n                gists_url:\n                  type: string\n                gravatar_id:\n                  type:\n                  - string\n                  - 'null'\n                html_url:\n                  type: string\n                  format: uri\n                id:\n                  type: integer\n                node_id:\n                  type: string\n                login:\n                  type: string\n                organizations_url:\n                  type: string\n                  format: uri\n                received_events_url:\n                  type: string\n                  format: uri\n                repos_url:\n                  type: string\n                  format: uri\n                site_admin:\n                  type: boolean\n                starred_url:\n                  type: string\n                subscriptions_url:\n                  type: string\n                  format: uri\n                type:\n                  type: string\n                url:\n                  type: string\n                  format: uri\n              required:\n              - avatar_url\n              - events_url\n              - followers_url\n              - following_url\n              - gists_url\n              - gravatar_id\n              - html_url\n              - id\n              - node_id\n              - login\n              - organizations_url\n              - received_events_url\n              - repos_url\n              - site_admin\n              - starred_url\n              - subscriptions_url\n              - type\n              - url\n          required:\n          - label\n          - ref\n          - repo\n          - sha\n          - user\n        _links:\n          type: object\n          properties:\n            comments:\n              \"$ref\": \"#/components/schemas/link\"\n            commits:\n              \"$ref\": \"#/components/schemas/link\"\n            statuses:\n              \"$ref\": \"#/components/schemas/link\"\n            html:\n              \"$ref\": \"#/components/schemas/link\"\n            issue:\n              \"$ref\": \"#/components/schemas/link\"\n            review_comments:\n              \"$ref\": \"#/components/schemas/link\"\n            review_comment:\n              \"$ref\": \"#/components/schemas/link\"\n            self:\n              \"$ref\": \"#/components/schemas/link\"\n          required:\n          - comments\n          - commits\n          - statuses\n          - html\n          - issue\n          - review_comments\n          - review_comment\n          - self\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        draft:\n          description: Indicates whether or not the pull request is a draft.\n          type: boolean\n          examples:\n          - false\n        merged:\n          type: boolean\n        mergeable:\n          type:\n          - boolean\n          - 'null'\n          examples:\n          - true\n        rebaseable:\n          type:\n          - boolean\n          - 'null'\n          examples:\n          - true\n        mergeable_state:\n          type: string\n          examples:\n          - clean\n        merged_by:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        comments:\n          type: integer\n          examples:\n          - 10\n        review_comments:\n          type: integer\n          examples:\n          - 0\n        maintainer_can_modify:\n          description: Indicates whether maintainers can modify the pull request.\n          type: boolean\n          examples:\n          - true\n        commits:\n          type: integer\n          examples:\n          - 3\n        additions:\n          type: integer\n          examples:\n          - 100\n        deletions:\n          type: integer\n          examples:\n          - 3\n        changed_files:\n          type: integer\n          examples:\n          - 5\n      required:\n      - _links\n      - assignee\n      - labels\n      - base\n      - body\n      - closed_at\n      - comments_url\n      - commits_url\n      - created_at\n      - diff_url\n      - head\n      - html_url\n      - id\n      - node_id\n      - issue_url\n      - merge_commit_sha\n      - merged_at\n      - milestone\n      - number\n      - patch_url\n      - review_comment_url\n      - review_comments_url\n      - statuses_url\n      - state\n      - locked\n      - title\n      - updated_at\n      - url\n      - user\n      - author_association\n      - additions\n      - changed_files\n      - comments\n      - commits\n      - deletions\n      - mergeable\n      - mergeable_state\n      - merged\n      - maintainer_can_modify\n      - merged_by\n      - review_comments\n    pull-request-merge-result:\n      title: Pull Request Merge Result\n      description: Pull Request Merge Result\n      type: object\n      properties:\n        sha:\n          type: string\n        merged:\n          type: boolean\n        message:\n          type: string\n      required:\n      - merged\n      - message\n      - sha\n    pull-request-review-request:\n      title: Pull Request Review Request\n      description: Pull Request Review Request\n      type: object\n      properties:\n        users:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/simple-user\"\n        teams:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/team\"\n      required:\n      - users\n      - teams\n    pull-request-review:\n      title: Pull Request Review\n      description: Pull Request Reviews are reviews on pull requests.\n      type: object\n      properties:\n        id:\n          description: Unique identifier of the review\n          type: integer\n          examples:\n          - 42\n        node_id:\n          type: string\n          examples:\n          - MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        body:\n          description: The text of the review.\n          type: string\n          examples:\n          - This looks great.\n        state:\n          type: string\n          examples:\n          - CHANGES_REQUESTED\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n        pull_request_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/12\n        _links:\n          type: object\n          properties:\n            html:\n              type: object\n              properties:\n                href:\n                  type: string\n              required:\n              - href\n            pull_request:\n              type: object\n              properties:\n                href:\n                  type: string\n              required:\n              - href\n          required:\n          - html\n          - pull_request\n        submitted_at:\n          type: string\n          format: date-time\n        commit_id:\n          description: A commit SHA for the review.\n          type: string\n          examples:\n          - 54bb654c9e6025347f57900a4a5c2313a96b8035\n        body_html:\n          type: string\n        body_text:\n          type: string\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n      required:\n      - id\n      - node_id\n      - user\n      - body\n      - state\n      - commit_id\n      - html_url\n      - pull_request_url\n      - _links\n      - author_association\n    review-comment:\n      title: Legacy Review Comment\n      description: Legacy Review Comment\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n        pull_request_review_id:\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 42\n        id:\n          type: integer\n          examples:\n          - 10\n        node_id:\n          type: string\n          examples:\n          - MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\n        diff_hunk:\n          type: string\n          examples:\n          - \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n        path:\n          type: string\n          examples:\n          - file1.txt\n        position:\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 1\n        original_position:\n          type: integer\n          examples:\n          - 4\n        commit_id:\n          type: string\n          examples:\n          - 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        original_commit_id:\n          type: string\n          examples:\n          - 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\n        in_reply_to_id:\n          type: integer\n          examples:\n          - 8\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        body:\n          type: string\n          examples:\n          - Great stuff\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2011-04-14T16:00:49Z'\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n        pull_request_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/Hello-World/pulls/1\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        _links:\n          type: object\n          properties:\n            self:\n              \"$ref\": \"#/components/schemas/link\"\n            html:\n              \"$ref\": \"#/components/schemas/link\"\n            pull_request:\n              \"$ref\": \"#/components/schemas/link\"\n          required:\n          - self\n          - html\n          - pull_request\n        body_text:\n          type: string\n        body_html:\n          type: string\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n        side:\n          description: The side of the first line of the range for a multi-line comment.\n          enum:\n          - LEFT\n          - RIGHT\n          default: RIGHT\n          type: string\n        start_side:\n          type:\n          - string\n          - 'null'\n          description: The side of the first line of the range for a multi-line comment.\n          enum:\n          - LEFT\n          - RIGHT\n          - \n          default: RIGHT\n        line:\n          description: The line of the blob to which the comment applies. The last\n            line of the range for a multi-line comment\n          type: integer\n          examples:\n          - 2\n        original_line:\n          description: The original line of the blob to which the comment applies.\n            The last line of the range for a multi-line comment\n          type: integer\n          examples:\n          - 2\n        start_line:\n          description: The first line of the range for a multi-line comment.\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 2\n        original_start_line:\n          description: The original first line of the range for a multi-line comment.\n          type:\n          - integer\n          - 'null'\n          examples:\n          - 2\n      required:\n      - id\n      - node_id\n      - url\n      - body\n      - diff_hunk\n      - path\n      - position\n      - original_position\n      - commit_id\n      - original_commit_id\n      - user\n      - pull_request_review_id\n      - html_url\n      - pull_request_url\n      - _links\n      - author_association\n      - created_at\n      - updated_at\n    release-asset:\n      title: Release Asset\n      description: Data related to a release.\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        browser_download_url:\n          type: string\n          format: uri\n        id:\n          type: integer\n        node_id:\n          type: string\n        name:\n          description: The file name of the asset.\n          type: string\n          examples:\n          - Team Environment\n        label:\n          type:\n          - string\n          - 'null'\n        state:\n          description: State of the release asset.\n          type: string\n          enum:\n          - uploaded\n          - open\n        content_type:\n          type: string\n        size:\n          type: integer\n        download_count:\n          type: integer\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        uploader:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - id\n      - name\n      - content_type\n      - size\n      - state\n      - url\n      - node_id\n      - download_count\n      - label\n      - uploader\n      - browser_download_url\n      - created_at\n      - updated_at\n    release:\n      title: Release\n      description: A release.\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n        assets_url:\n          type: string\n          format: uri\n        upload_url:\n          type: string\n        tarball_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        zipball_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        id:\n          type: integer\n        node_id:\n          type: string\n        tag_name:\n          description: The name of the tag.\n          type: string\n          examples:\n          - v1.0.0\n        target_commitish:\n          description: Specifies the commitish value that determines where the Git\n            tag is created from.\n          type: string\n          examples:\n          - master\n        name:\n          type:\n          - string\n          - 'null'\n        body:\n          type:\n          - string\n          - 'null'\n        draft:\n          description: true to create a draft (unpublished) release, false to create\n            a published one.\n          type: boolean\n          examples:\n          - false\n        prerelease:\n          description: Whether to identify the release as a prerelease or a full release.\n          type: boolean\n          examples:\n          - false\n        created_at:\n          type: string\n          format: date-time\n        published_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        author:\n          \"$ref\": \"#/components/schemas/simple-user\"\n        assets:\n          type: array\n          items:\n            \"$ref\": \"#/components/schemas/release-asset\"\n        body_html:\n          type: string\n        body_text:\n          type: string\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n      required:\n      - assets_url\n      - upload_url\n      - tarball_url\n      - zipball_url\n      - created_at\n      - published_at\n      - draft\n      - id\n      - node_id\n      - author\n      - html_url\n      - name\n      - prerelease\n      - tag_name\n      - target_commitish\n      - assets\n      - url\n    stargazer:\n      title: Stargazer\n      description: Stargazer\n      type: object\n      properties:\n        starred_at:\n          type: string\n          format: date-time\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n      required:\n      - starred_at\n      - user\n    code-frequency-stat:\n      title: Code Frequency Stat\n      description: Code Frequency Stat\n      type: array\n      items:\n        type: integer\n    commit-activity:\n      title: Commit Activity\n      description: Commit Activity\n      type: object\n      properties:\n        days:\n          type: array\n          items:\n            type: integer\n          examples:\n          - 0\n          - 3\n          - 26\n          - 20\n          - 39\n          - 1\n          - 0\n        total:\n          type: integer\n          examples:\n          - 89\n        week:\n          type: integer\n          examples:\n          - 1336280400\n      required:\n      - days\n      - total\n      - week\n    contributor-activity:\n      title: Contributor Activity\n      description: Contributor Activity\n      type: object\n      properties:\n        author:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        total:\n          type: integer\n          examples:\n          - 135\n        weeks:\n          type: array\n          items:\n            type: object\n            properties:\n              w:\n                type: integer\n              a:\n                type: integer\n              d:\n                type: integer\n              c:\n                type: integer\n          examples:\n          - w: '1367712000'\n            a: 6898\n            d: 77\n            c: 10\n      required:\n      - author\n      - total\n      - weeks\n    participation-stats:\n      title: Participation Stats\n      type: object\n      properties:\n        all:\n          type: array\n          items:\n            type: integer\n        owner:\n          type: array\n          items:\n            type: integer\n      required:\n      - all\n      - owner\n    repository-subscription:\n      title: Repository Invitation\n      description: Repository invitations let you manage who you collaborate with.\n      type: object\n      properties:\n        subscribed:\n          description: Determines if notifications should be received from this repository.\n          type: boolean\n          examples:\n          - true\n        ignored:\n          description: Determines if all notifications should be blocked from this\n            repository.\n          type: boolean\n        reason:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2012-10-06T21:34:12Z'\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example/subscription\n        repository_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/repos/octocat/example\n      required:\n      - created_at\n      - ignored\n      - reason\n      - subscribed\n      - url\n      - repository_url\n    tag:\n      title: Tag\n      description: Tag\n      type: object\n      properties:\n        name:\n          type: string\n          examples:\n          - v0.1\n        commit:\n          type: object\n          properties:\n            sha:\n              type: string\n            url:\n              type: string\n              format: uri\n          required:\n          - sha\n          - url\n        zipball_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/zipball/v0.1\n        tarball_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat/Hello-World/tarball/v0.1\n        node_id:\n          type: string\n      required:\n      - name\n      - node_id\n      - commit\n      - zipball_url\n      - tarball_url\n    topic:\n      title: Topic\n      description: A topic aggregates entities that are related to a subject.\n      type: object\n      properties:\n        names:\n          type: array\n          items:\n            type: string\n      required:\n      - names\n    search-result-text-matches:\n      title: Search Result Text Matches\n      type: array\n      items:\n        type: object\n        properties:\n          object_url:\n            type: string\n          object_type:\n            type:\n            - string\n            - 'null'\n          property:\n            type: string\n          fragment:\n            type: string\n          matches:\n            type: array\n            items:\n              type: object\n              properties:\n                text:\n                  type: string\n                indices:\n                  type: array\n                  items:\n                    type: integer\n    code-search-result-item:\n      title: Code Search Result Item\n      description: Code Search Result Item\n      type: object\n      properties:\n        name:\n          type: string\n        path:\n          type: string\n        sha:\n          type: string\n        url:\n          type: string\n          format: uri\n        git_url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n        repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n        score:\n          type: number\n        file_size:\n          type: integer\n        language:\n          type:\n          - string\n          - 'null'\n        last_modified_at:\n          type: string\n          format: date-time\n        line_numbers:\n          type: array\n          items:\n            type: string\n          examples:\n          - 73..77\n          - 77..78\n        text_matches:\n          \"$ref\": \"#/components/schemas/search-result-text-matches\"\n      required:\n      - score\n      - name\n      - path\n      - sha\n      - git_url\n      - html_url\n      - url\n      - repository\n    commit-search-result-item:\n      title: Commit Search Result Item\n      description: Commit Search Result Item\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        sha:\n          type: string\n        html_url:\n          type: string\n          format: uri\n        comments_url:\n          type: string\n          format: uri\n        commit:\n          type: object\n          properties:\n            author:\n              type: object\n              properties:\n                name:\n                  type: string\n                email:\n                  type: string\n                date:\n                  type: string\n                  format: date-time\n              required:\n              - name\n              - email\n              - date\n            committer:\n              anyOf:\n              - type: 'null'\n              - \"$ref\": \"#/components/schemas/git-user\"\n            comment_count:\n              type: integer\n            message:\n              type: string\n            tree:\n              type: object\n              properties:\n                sha:\n                  type: string\n                url:\n                  type: string\n                  format: uri\n              required:\n              - sha\n              - url\n            url:\n              type: string\n              format: uri\n            verification:\n              \"$ref\": \"#/components/schemas/verification\"\n          required:\n          - author\n          - committer\n          - comment_count\n          - message\n          - tree\n          - url\n        author:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        committer:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/git-user\"\n        parents:\n          type: array\n          items:\n            type: object\n            properties:\n              url:\n                type: string\n              html_url:\n                type: string\n              sha:\n                type: string\n        repository:\n          \"$ref\": \"#/components/schemas/minimal-repository\"\n        score:\n          type: number\n        node_id:\n          type: string\n        text_matches:\n          \"$ref\": \"#/components/schemas/search-result-text-matches\"\n      required:\n      - sha\n      - node_id\n      - url\n      - html_url\n      - author\n      - committer\n      - parents\n      - comments_url\n      - commit\n      - repository\n      - score\n    issue-search-result-item:\n      title: Issue Search Result Item\n      description: Issue Search Result Item\n      type: object\n      properties:\n        url:\n          type: string\n          format: uri\n        repository_url:\n          type: string\n          format: uri\n        labels_url:\n          type: string\n        comments_url:\n          type: string\n          format: uri\n        events_url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n        id:\n          type: integer\n        node_id:\n          type: string\n        number:\n          type: integer\n        title:\n          type: string\n        locked:\n          type: boolean\n        active_lock_reason:\n          type:\n          - string\n          - 'null'\n        assignees:\n          type:\n          - array\n          - 'null'\n          items:\n            \"$ref\": \"#/components/schemas/simple-user\"\n        user:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        labels:\n          type: array\n          items:\n            type: object\n            properties:\n              id:\n                type: integer\n                format: int64\n              node_id:\n                type: string\n              url:\n                type: string\n              name:\n                type: string\n              color:\n                type: string\n              default:\n                type: boolean\n              description:\n                type:\n                - string\n                - 'null'\n        state:\n          type: string\n        assignee:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        milestone:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/milestone\"\n        comments:\n          type: integer\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        closed_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        text_matches:\n          \"$ref\": \"#/components/schemas/search-result-text-matches\"\n        pull_request:\n          type: object\n          properties:\n            merged_at:\n              type:\n              - string\n              - 'null'\n              format: date-time\n            diff_url:\n              type:\n              - string\n              - 'null'\n              format: uri\n            html_url:\n              type:\n              - string\n              - 'null'\n              format: uri\n            patch_url:\n              type:\n              - string\n              - 'null'\n              format: uri\n            url:\n              type:\n              - string\n              - 'null'\n              format: uri\n          required:\n          - diff_url\n          - html_url\n          - patch_url\n          - url\n        body:\n          type: string\n        score:\n          type: number\n        author_association:\n          \"$ref\": \"#/components/schemas/author_association\"\n        draft:\n          type: boolean\n        repository:\n          \"$ref\": \"#/components/schemas/repository\"\n        body_html:\n          type: string\n        body_text:\n          type: string\n        timeline_url:\n          type: string\n          format: uri\n        performed_via_github_app:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/integration\"\n        reactions:\n          \"$ref\": \"#/components/schemas/reaction-rollup\"\n      required:\n      - assignee\n      - closed_at\n      - comments\n      - comments_url\n      - events_url\n      - html_url\n      - id\n      - node_id\n      - labels\n      - labels_url\n      - milestone\n      - number\n      - repository_url\n      - state\n      - locked\n      - title\n      - url\n      - user\n      - author_association\n      - created_at\n      - updated_at\n      - score\n    label-search-result-item:\n      title: Label Search Result Item\n      description: Label Search Result Item\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        url:\n          type: string\n          format: uri\n        name:\n          type: string\n        color:\n          type: string\n        default:\n          type: boolean\n        description:\n          type:\n          - string\n          - 'null'\n        score:\n          type: number\n        text_matches:\n          \"$ref\": \"#/components/schemas/search-result-text-matches\"\n      required:\n      - id\n      - node_id\n      - url\n      - name\n      - color\n      - default\n      - description\n      - score\n    repo-search-result-item:\n      title: Repo Search Result Item\n      description: Repo Search Result Item\n      type: object\n      properties:\n        id:\n          type: integer\n        node_id:\n          type: string\n        name:\n          type: string\n        full_name:\n          type: string\n        owner:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/simple-user\"\n        private:\n          type: boolean\n        html_url:\n          type: string\n          format: uri\n        description:\n          type:\n          - string\n          - 'null'\n        fork:\n          type: boolean\n        url:\n          type: string\n          format: uri\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        pushed_at:\n          type: string\n          format: date-time\n        homepage:\n          type:\n          - string\n          - 'null'\n          format: uri\n        size:\n          type: integer\n        stargazers_count:\n          type: integer\n        watchers_count:\n          type: integer\n        language:\n          type:\n          - string\n          - 'null'\n        forks_count:\n          type: integer\n        open_issues_count:\n          type: integer\n        master_branch:\n          type: string\n        default_branch:\n          type: string\n        score:\n          type: number\n        forks_url:\n          type: string\n          format: uri\n        keys_url:\n          type: string\n        collaborators_url:\n          type: string\n        teams_url:\n          type: string\n          format: uri\n        hooks_url:\n          type: string\n          format: uri\n        issue_events_url:\n          type: string\n        events_url:\n          type: string\n          format: uri\n        assignees_url:\n          type: string\n        branches_url:\n          type: string\n        tags_url:\n          type: string\n          format: uri\n        blobs_url:\n          type: string\n        git_tags_url:\n          type: string\n        git_refs_url:\n          type: string\n        trees_url:\n          type: string\n        statuses_url:\n          type: string\n        languages_url:\n          type: string\n          format: uri\n        stargazers_url:\n          type: string\n          format: uri\n        contributors_url:\n          type: string\n          format: uri\n        subscribers_url:\n          type: string\n          format: uri\n        subscription_url:\n          type: string\n          format: uri\n        commits_url:\n          type: string\n        git_commits_url:\n          type: string\n        comments_url:\n          type: string\n        issue_comment_url:\n          type: string\n        contents_url:\n          type: string\n        compare_url:\n          type: string\n        merges_url:\n          type: string\n          format: uri\n        archive_url:\n          type: string\n        downloads_url:\n          type: string\n          format: uri\n        issues_url:\n          type: string\n        pulls_url:\n          type: string\n        milestones_url:\n          type: string\n        notifications_url:\n          type: string\n        labels_url:\n          type: string\n        releases_url:\n          type: string\n        deployments_url:\n          type: string\n          format: uri\n        git_url:\n          type: string\n        ssh_url:\n          type: string\n        clone_url:\n          type: string\n        svn_url:\n          type: string\n          format: uri\n        forks:\n          type: integer\n        open_issues:\n          type: integer\n        watchers:\n          type: integer\n        topics:\n          type: array\n          items:\n            type: string\n        mirror_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        has_issues:\n          type: boolean\n        has_projects:\n          type: boolean\n        has_pages:\n          type: boolean\n        has_wiki:\n          type: boolean\n        has_downloads:\n          type: boolean\n        archived:\n          type: boolean\n        disabled:\n          type: boolean\n          description: Returns whether or not this repository disabled.\n        visibility:\n          description: 'The repository visibility: public, private, or internal.'\n          type: string\n        license:\n          anyOf:\n          - type: 'null'\n          - \"$ref\": \"#/components/schemas/license-simple\"\n        permissions:\n          type: object\n          properties:\n            admin:\n              type: boolean\n            maintain:\n              type: boolean\n            push:\n              type: boolean\n            triage:\n              type: boolean\n            pull:\n              type: boolean\n          required:\n          - admin\n          - pull\n          - push\n        text_matches:\n          \"$ref\": \"#/components/schemas/search-result-text-matches\"\n        temp_clone_token:\n          type: string\n        allow_merge_commit:\n          type: boolean\n        allow_squash_merge:\n          type: boolean\n        allow_rebase_merge:\n          type: boolean\n        delete_branch_on_merge:\n          type: boolean\n        allow_forking:\n          type: boolean\n        is_template:\n          type: boolean\n      required:\n      - archive_url\n      - assignees_url\n      - blobs_url\n      - branches_url\n      - collaborators_url\n      - comments_url\n      - commits_url\n      - compare_url\n      - contents_url\n      - contributors_url\n      - deployments_url\n      - description\n      - downloads_url\n      - events_url\n      - fork\n      - forks_url\n      - full_name\n      - git_commits_url\n      - git_refs_url\n      - git_tags_url\n      - hooks_url\n      - html_url\n      - id\n      - node_id\n      - issue_comment_url\n      - issue_events_url\n      - issues_url\n      - keys_url\n      - labels_url\n      - languages_url\n      - merges_url\n      - milestones_url\n      - name\n      - notifications_url\n      - owner\n      - private\n      - pulls_url\n      - releases_url\n      - stargazers_url\n      - statuses_url\n      - subscribers_url\n      - subscription_url\n      - tags_url\n      - teams_url\n      - trees_url\n      - url\n      - clone_url\n      - default_branch\n      - forks\n      - forks_count\n      - git_url\n      - has_downloads\n      - has_issues\n      - has_projects\n      - has_wiki\n      - has_pages\n      - homepage\n      - language\n      - archived\n      - disabled\n      - mirror_url\n      - open_issues\n      - open_issues_count\n      - license\n      - pushed_at\n      - size\n      - ssh_url\n      - stargazers_count\n      - svn_url\n      - watchers\n      - watchers_count\n      - created_at\n      - updated_at\n      - score\n    topic-search-result-item:\n      title: Topic Search Result Item\n      description: Topic Search Result Item\n      type: object\n      properties:\n        name:\n          type: string\n        display_name:\n          type:\n          - string\n          - 'null'\n        short_description:\n          type:\n          - string\n          - 'null'\n        description:\n          type:\n          - string\n          - 'null'\n        created_by:\n          type:\n          - string\n          - 'null'\n        released:\n          type:\n          - string\n          - 'null'\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        featured:\n          type: boolean\n        curated:\n          type: boolean\n        score:\n          type: number\n        repository_count:\n          type:\n          - integer\n          - 'null'\n        logo_url:\n          type:\n          - string\n          - 'null'\n          format: uri\n        text_matches:\n          \"$ref\": \"#/components/schemas/search-result-text-matches\"\n        related:\n          type:\n          - array\n          - 'null'\n          items:\n            type: object\n            properties:\n              topic_relation:\n                type: object\n                properties:\n                  id:\n                    type: integer\n                  name:\n                    type: string\n                  topic_id:\n                    type: integer\n                  relation_type:\n                    type: string\n        aliases:\n          type:\n          - array\n          - 'null'\n          items:\n            type: object\n            properties:\n              topic_relation:\n                type: object\n                properties:\n                  id:\n                    type: integer\n                  name:\n                    type: string\n                  topic_id:\n                    type: integer\n                  relation_type:\n                    type: string\n      required:\n      - name\n      - display_name\n      - short_description\n      - description\n      - created_by\n      - released\n      - created_at\n      - updated_at\n      - featured\n      - curated\n      - score\n    user-search-result-item:\n      title: User Search Result Item\n      description: User Search Result Item\n      type: object\n      properties:\n        login:\n          type: string\n        id:\n          type: integer\n        node_id:\n          type: string\n        avatar_url:\n          type: string\n          format: uri\n        gravatar_id:\n          type:\n          - string\n          - 'null'\n        url:\n          type: string\n          format: uri\n        html_url:\n          type: string\n          format: uri\n        followers_url:\n          type: string\n          format: uri\n        subscriptions_url:\n          type: string\n          format: uri\n        organizations_url:\n          type: string\n          format: uri\n        repos_url:\n          type: string\n          format: uri\n        received_events_url:\n          type: string\n          format: uri\n        type:\n          type: string\n        score:\n          type: number\n        following_url:\n          type: string\n        gists_url:\n          type: string\n        starred_url:\n          type: string\n        events_url:\n          type: string\n        public_repos:\n          type: integer\n        public_gists:\n          type: integer\n        followers:\n          type: integer\n        following:\n          type: integer\n        created_at:\n          type: string\n          format: date-time\n        updated_at:\n          type: string\n          format: date-time\n        name:\n          type:\n          - string\n          - 'null'\n        bio:\n          type:\n          - string\n          - 'null'\n        email:\n          type:\n          - string\n          - 'null'\n          format: email\n        location:\n          type:\n          - string\n          - 'null'\n        site_admin:\n          type: boolean\n        hireable:\n          type:\n          - boolean\n          - 'null'\n        text_matches:\n          \"$ref\": \"#/components/schemas/search-result-text-matches\"\n        blog:\n          type:\n          - string\n          - 'null'\n        company:\n          type:\n          - string\n          - 'null'\n        suspended_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n      required:\n      - avatar_url\n      - events_url\n      - followers_url\n      - following_url\n      - gists_url\n      - gravatar_id\n      - html_url\n      - id\n      - node_id\n      - login\n      - organizations_url\n      - received_events_url\n      - repos_url\n      - site_admin\n      - starred_url\n      - subscriptions_url\n      - type\n      - url\n      - score\n    configuration-status:\n      type: object\n      properties:\n        status:\n          type: string\n        progress:\n          type: array\n          items:\n            type: object\n            properties:\n              status:\n                type: string\n              key:\n                type: string\n            required:\n            - status\n            - key\n    maintenance-status:\n      type: object\n      properties:\n        status:\n          type: string\n        scheduled_time:\n          type: string\n        connection_services:\n          type: array\n          items:\n            type: object\n            properties:\n              name:\n                type: string\n              number:\n                type: integer\n            required:\n            - name\n            - number\n    enterprise-settings:\n      type: object\n      properties:\n        enterprise:\n          type: object\n          properties:\n            private_mode:\n              type: boolean\n            public_pages:\n              type: boolean\n            subdomain_isolation:\n              type: boolean\n            signup_enabled:\n              type: boolean\n            github_hostname:\n              type: string\n            identicons_host:\n              type: string\n            http_proxy:\n              type:\n              - string\n              - 'null'\n            auth_mode:\n              type: string\n            expire_sessions:\n              type: boolean\n            admin_password:\n              type:\n              - string\n              - 'null'\n            configuration_id:\n              type: integer\n            configuration_run_count:\n              type: integer\n            avatar:\n              type: object\n              properties:\n                enabled:\n                  type: boolean\n                uri:\n                  type: string\n            customer:\n              type: object\n              properties:\n                name:\n                  type: string\n                email:\n                  type: string\n                uuid:\n                  type: string\n                secret_key_data:\n                  type: string\n                public_key_data:\n                  type: string\n            license:\n              type: object\n              properties:\n                seats:\n                  type: integer\n                evaluation:\n                  type: boolean\n                perpetual:\n                  type: boolean\n                unlimited_seating:\n                  type: boolean\n                support_key:\n                  type: string\n                ssh_allowed:\n                  type: boolean\n                cluster_support:\n                  type: boolean\n                expire_at:\n                  type: string\n            github_ssl:\n              type: object\n              properties:\n                enabled:\n                  type: boolean\n                cert:\n                  type:\n                  - string\n                  - 'null'\n                key:\n                  type:\n                  - string\n                  - 'null'\n            ldap:\n              type: object\n              properties:\n                host:\n                  type:\n                  - string\n                  - 'null'\n                port:\n                  type: integer\n                base:\n                  type: array\n                  items: {}\n                uid:\n                  type:\n                  - string\n                  - 'null'\n                bind_dn:\n                  type:\n                  - string\n                  - 'null'\n                password:\n                  type:\n                  - string\n                  - 'null'\n                method:\n                  type: string\n                search_strategy:\n                  type: string\n                user_groups:\n                  type: array\n                  items: {}\n                admin_group:\n                  type:\n                  - string\n                  - 'null'\n                virtual_attribute_enabled:\n                  type: boolean\n                recursive_group_search:\n                  type: boolean\n                posix_support:\n                  type: boolean\n                user_sync_emails:\n                  type: boolean\n                user_sync_keys:\n                  type: boolean\n                user_sync_interval:\n                  type: integer\n                team_sync_interval:\n                  type: integer\n                sync_enabled:\n                  type: boolean\n                reconciliation:\n                  type: object\n                  properties:\n                    user:\n                      type:\n                      - string\n                      - 'null'\n                    org:\n                      type:\n                      - string\n                      - 'null'\n                profile:\n                  type: object\n                  properties:\n                    uid:\n                      type: string\n                    name:\n                      type:\n                      - string\n                      - 'null'\n                    mail:\n                      type:\n                      - string\n                      - 'null'\n                    key:\n                      type:\n                      - string\n                      - 'null'\n            cas:\n              type: object\n              properties:\n                url:\n                  type:\n                  - string\n                  - 'null'\n            saml:\n              type: object\n              properties:\n                sso_url:\n                  type:\n                  - string\n                  - 'null'\n                certificate:\n                  type:\n                  - string\n                  - 'null'\n                certificate_path:\n                  type:\n                  - string\n                  - 'null'\n                issuer:\n                  type:\n                  - string\n                  - 'null'\n                idp_initiated_sso:\n                  type: boolean\n                disable_admin_demote:\n                  type: boolean\n            github_oauth:\n              type: object\n              properties:\n                client_id:\n                  type: string\n                client_secret:\n                  type: string\n                organization_name:\n                  type: string\n                organization_team:\n                  type: string\n            smtp:\n              type: object\n              properties:\n                enabled:\n                  type: boolean\n                address:\n                  type: string\n                authentication:\n                  type: string\n                port:\n                  type: string\n                domain:\n                  type: string\n                username:\n                  type: string\n                user_name:\n                  type: string\n                enable_starttls_auto:\n                  type: boolean\n                password:\n                  type: string\n                discard-to-noreply-address:\n                  type: boolean\n                support_address:\n                  type: string\n                support_address_type:\n                  type: string\n                noreply_address:\n                  type: string\n            ntp:\n              type: object\n              properties:\n                primary_server:\n                  type: string\n                secondary_server:\n                  type: string\n            timezone:\n              type:\n              - string\n              - 'null'\n            snmp:\n              type: object\n              properties:\n                enabled:\n                  type: boolean\n                community:\n                  type: string\n            syslog:\n              type: object\n              properties:\n                enabled:\n                  type: boolean\n                server:\n                  type:\n                  - string\n                  - 'null'\n                protocol_name:\n                  type: string\n            assets:\n              type:\n              - string\n              - 'null'\n            pages:\n              type: object\n              properties:\n                enabled:\n                  type: boolean\n            collectd:\n              type: object\n              properties:\n                enabled:\n                  type: boolean\n                server:\n                  type:\n                  - string\n                  - 'null'\n                port:\n                  type: integer\n                encryption:\n                  type:\n                  - string\n                  - 'null'\n                username:\n                  type:\n                  - string\n                  - 'null'\n                password:\n                  type:\n                  - string\n                  - 'null'\n            mapping:\n              type: object\n              properties:\n                enabled:\n                  type: boolean\n                tileserver:\n                  type:\n                  - string\n                  - 'null'\n                basemap:\n                  type: string\n                token:\n                  type:\n                  - string\n                  - 'null'\n            load_balancer:\n              type:\n              - string\n              - 'null'\n        run_list:\n          type: array\n          items:\n            type: string\n    ssh-key:\n      type: object\n      properties:\n        key:\n          type: string\n        pretty-print:\n          type: string\n    private-user:\n      title: Private User\n      description: Private User\n      type: object\n      properties:\n        login:\n          type: string\n          examples:\n          - octocat\n        id:\n          type: integer\n          examples:\n          - 1\n        node_id:\n          type: string\n          examples:\n          - MDQ6VXNlcjE=\n        avatar_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/images/error/octocat_happy.gif\n        gravatar_id:\n          type:\n          - string\n          - 'null'\n          examples:\n          - 41d064eb2195891e12d0413f63227ea7\n        url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat\n        html_url:\n          type: string\n          format: uri\n          examples:\n          - https://github.com/octocat\n        followers_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/followers\n        following_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/following{/other_user}\n        gists_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/subscriptions\n        organizations_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/orgs\n        repos_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/repos\n        events_url:\n          type: string\n          examples:\n          - https://api.github.com/users/octocat/events{/privacy}\n        received_events_url:\n          type: string\n          format: uri\n          examples:\n          - https://api.github.com/users/octocat/received_events\n        type:\n          type: string\n          examples:\n          - User\n        site_admin:\n          type: boolean\n        name:\n          type:\n          - string\n          - 'null'\n          examples:\n          - monalisa octocat\n        company:\n          type:\n          - string\n          - 'null'\n          examples:\n          - GitHub\n        blog:\n          type:\n          - string\n          - 'null'\n          examples:\n          - https://github.com/blog\n        location:\n          type:\n          - string\n          - 'null'\n          examples:\n          - San Francisco\n        email:\n          type:\n          - string\n          - 'null'\n          format: email\n          examples:\n          - octocat@github.com\n        hireable:\n          type:\n          - boolean\n          - 'null'\n        bio:\n          type:\n          - string\n          - 'null'\n          examples:\n          - There once was...\n        public_repos:\n          type: integer\n          examples:\n          - 2\n        public_gists:\n          type: integer\n          examples:\n          - 1\n        followers:\n          type: integer\n          examples:\n          - 20\n        following:\n          type: integer\n          examples:\n          - 0\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2008-01-14T04:33:35Z'\n        updated_at:\n          type: string\n          format: date-time\n          examples:\n          - '2008-01-14T04:33:35Z'\n        private_gists:\n          type: integer\n          examples:\n          - 81\n        total_private_repos:\n          type: integer\n          examples:\n          - 100\n        owned_private_repos:\n          type: integer\n          examples:\n          - 100\n        disk_usage:\n          type: integer\n          examples:\n          - 10000\n        collaborators:\n          type: integer\n          examples:\n          - 8\n        two_factor_authentication:\n          type: boolean\n          examples:\n          - true\n        plan:\n          type: object\n          properties:\n            collaborators:\n              type: integer\n            name:\n              type: string\n            space:\n              type: integer\n            private_repos:\n              type: integer\n          required:\n          - collaborators\n          - name\n          - space\n          - private_repos\n        suspended_at:\n          type: string\n          format: date-time\n        business_plus:\n          type: boolean\n        ldap_dn:\n          type: string\n      required:\n      - avatar_url\n      - events_url\n      - followers_url\n      - following_url\n      - gists_url\n      - gravatar_id\n      - html_url\n      - id\n      - node_id\n      - login\n      - organizations_url\n      - received_events_url\n      - repos_url\n      - site_admin\n      - starred_url\n      - subscriptions_url\n      - type\n      - url\n      - bio\n      - blog\n      - company\n      - email\n      - followers\n      - following\n      - hireable\n      - location\n      - name\n      - public_gists\n      - public_repos\n      - created_at\n      - updated_at\n      - collaborators\n      - disk_usage\n      - owned_private_repos\n      - private_gists\n      - total_private_repos\n      - two_factor_authentication\n    email:\n      title: Email\n      description: Email\n      type: object\n      properties:\n        email:\n          type: string\n          format: email\n          examples:\n          - octocat@github.com\n        primary:\n          type: boolean\n          examples:\n          - true\n        verified:\n          type: boolean\n          examples:\n          - true\n        visibility:\n          type:\n          - string\n          - 'null'\n          examples:\n          - public\n      required:\n      - email\n      - primary\n      - verified\n      - visibility\n    gpg-key:\n      title: GPG Key\n      description: A unique encryption key\n      type: object\n      properties:\n        id:\n          type: integer\n          examples:\n          - 3\n        primary_key_id:\n          type:\n          - integer\n          - 'null'\n        key_id:\n          type: string\n          examples:\n          - 3262EFF25BA0D270\n        public_key:\n          type: string\n          examples:\n          - xsBNBFayYZ...\n        emails:\n          type: array\n          items:\n            type: object\n            properties:\n              email:\n                type: string\n              verified:\n                type: boolean\n          examples:\n          - email: mastahyeti@users.noreply.github.com\n            verified: true\n        subkeys:\n          type: array\n          items:\n            type: object\n            properties:\n              id:\n                type: integer\n              primary_key_id:\n                type: integer\n              key_id:\n                type: string\n              public_key:\n                type: string\n              emails:\n                type: array\n                items: {}\n              subkeys:\n                type: array\n                items: {}\n              can_sign:\n                type: boolean\n              can_encrypt_comms:\n                type: boolean\n              can_encrypt_storage:\n                type: boolean\n              can_certify:\n                type: boolean\n              created_at:\n                type: string\n              expires_at:\n                type:\n                - string\n                - 'null'\n              raw_key:\n                type:\n                - string\n                - 'null'\n          examples:\n          - id: 4\n            primary_key_id: 3\n            key_id: 4A595D4C72EE49C7\n            public_key: zsBNBFayYZ...\n            emails: []\n            subkeys: []\n            can_sign: false\n            can_encrypt_comms: true\n            can_encrypt_storage: true\n            can_certify: false\n            created_at: '2016-03-24T11:31:04-06:00'\n            expires_at: \n        can_sign:\n          type: boolean\n          examples:\n          - true\n        can_encrypt_comms:\n          type: boolean\n        can_encrypt_storage:\n          type: boolean\n        can_certify:\n          type: boolean\n          examples:\n          - true\n        created_at:\n          type: string\n          format: date-time\n          examples:\n          - '2016-03-24T11:31:04-06:00'\n        expires_at:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        raw_key:\n          type:\n          - string\n          - 'null'\n      required:\n      - id\n      - primary_key_id\n      - key_id\n      - raw_key\n      - public_key\n      - created_at\n      - expires_at\n      - can_sign\n      - can_encrypt_comms\n      - can_encrypt_storage\n      - can_certify\n      - emails\n      - subkeys\n    key:\n      title: Key\n      description: Key\n      type: object\n      properties:\n        key:\n          type: string\n        id:\n          type: integer\n        url:\n          type: string\n        title:\n          type: string\n        created_at:\n          type: string\n          format: date-time\n        verified:\n          type: boolean\n        read_only:\n          type: boolean\n      required:\n      - key\n      - id\n      - url\n      - title\n      - created_at\n      - verified\n      - read_only\n    starred-repository:\n      title: Starred Repository\n      description: Starred Repository\n      type: object\n      properties:\n        starred_at:\n          type: string\n          format: date-time\n        repo:\n          \"$ref\": \"#/components/schemas/repository\"\n      required:\n      - starred_at\n      - repo\n    hovercard:\n      title: Hovercard\n      description: Hovercard\n      type: object\n      properties:\n        contexts:\n          type: array\n          items:\n            type: object\n            properties:\n              message:\n                type: string\n              octicon:\n                type: string\n            required:\n            - message\n            - octicon\n      required:\n      - contexts\n    key-simple:\n      title: Key Simple\n      description: Key Simple\n      type: object\n      properties:\n        id:\n          type: integer\n        key:\n          type: string\n      required:\n      - key\n      - id\n  examples:\n    global-hook-items:\n      value:\n      - type: Global\n        id: 1\n        name: web\n        active: true\n        events:\n        - organization\n        - user\n        config:\n          url: https://example.com\n          content_type: json\n          insecure_ssl: '0'\n          secret: \"********\"\n        updated_at: '2017-12-07T00:14:59Z'\n        created_at: '2017-12-07T00:14:59Z'\n        url: https://api.github.com/admin/hooks/1\n        ping_url: https://api.github.com/admin/hooks/1/pings\n    global-hook:\n      value:\n        type: Global\n        id: 1\n        name: web\n        active: true\n        events:\n        - organization\n        - user\n        config:\n          url: https://example.com\n          content_type: json\n          insecure_ssl: '0'\n          secret: \"********\"\n        updated_at: '2017-12-07T00:14:59Z'\n        created_at: '2017-12-07T00:14:59Z'\n        url: https://api.github.com/admin/hooks/1\n        ping_url: https://api.github.com/admin/hooks/1/pings\n    global-hook-2:\n      value:\n        type: Global\n        id: 1\n        name: web\n        active: true\n        events:\n        - organization\n        config:\n          url: https://example.com\n          content_type: form\n          insecure_ssl: '0'\n        updated_at: '2017-12-07T00:14:59Z'\n        created_at: '2017-12-07T00:14:59Z'\n        url: https://api.github.com/admin/hooks/1\n        ping_url: https://api.github.com/admin/hooks/1/pings\n    enterprise-public-key-items:\n      value:\n      - key: 2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\n        id: 2\n        url: https://api.github.com/user/keys/2\n        title: ssh-rsa AAAAB3NzaC1yc2EAAA\n        created_at: '2020-06-11T21:31:57Z'\n        verified: false\n        read_only: false\n        last_used: '2020-06-11T22:31:57Z'\n        user_id: 1\n        repository_id: 2\n      - key: 9Og8iYjAyymI9LvABpJerYrMxURPc8r+dB7TJyvv1234\n        id: 3\n        url: https://api.github.com/user/keys/2\n        title: ssh-rsa AAAAB3NzaC1yc2EAAA\n        created_at: '2020-06-11T21:31:57Z'\n        verified: false\n        read_only: false\n        last_used: '2020-06-11T22:31:57Z'\n        user_id: 1\n        repository_id: 2\n    ldap-mapping-team:\n      value:\n        ldap_dn: cn=Enterprise Ops,ou=teams,dc=github,dc=com\n        id: 1\n        node_id: MDQ6VGVhbTE=\n        url: https://api.github.com/teams/1\n        html_url: https://github.com/orgs/github/teams/justice-league\n        name: Justice League\n        slug: justice-league\n        description: A great team.\n        privacy: closed\n        permission: admin\n        members_url: https://api.github.com/teams/1/members{/member}\n        repositories_url: https://api.github.com/teams/1/repos\n        parent: \n    ldap-mapping-user:\n      value:\n        ldap_dn: uid=asdf,ou=users,dc=github,dc=com\n        login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n        name: monalisa octocat\n        company: GitHub\n        blog: https://github.com/blog\n        location: San Francisco\n        email: octocat@github.com\n        hireable: false\n        bio: There once was...\n        twitter_username: monatheoctocat\n        public_repos: 2\n        public_gists: 1\n        followers: 20\n        following: 0\n        created_at: '2008-01-14T04:33:35Z'\n        updated_at: '2008-01-14T04:33:35Z'\n        private_gists: 81\n        total_private_repos: 100\n        owned_private_repos: 100\n        disk_usage: 10000\n        collaborators: 8\n        two_factor_authentication: true\n        plan:\n          name: Medium\n          space: 400\n          private_repos: 20\n          collaborators: 0\n    organization-simple:\n      value:\n        login: github\n        id: 1\n        node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n        url: https://api.github.com/orgs/github\n        repos_url: https://api.github.com/orgs/github/repos\n        events_url: https://api.github.com/orgs/github/events\n        hooks_url: https://api.github.com/orgs/github/hooks\n        issues_url: https://api.github.com/orgs/github/issues\n        members_url: https://api.github.com/orgs/github/members{/member}\n        public_members_url: https://api.github.com/orgs/github/public_members{/member}\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        description: A great organization\n    pre-receive-environment-items:\n      value:\n      - id: 1\n        name: Default\n        image_url: githubenterprise://internal\n        url: https://github.example.com/api/v3/admin/pre-receive-environments/1\n        html_url: https://github.example.com/admin/pre-receive-environments/1\n        default_environment: true\n        created_at: '2016-05-20T11:35:45-05:00'\n        hooks_count: 14\n        download:\n          url: https://github.example.com/api/v3/admin/pre-receive-environments/1/downloads/latest\n          state: not_started\n          downloaded_at: '2016-05-26T07:42:53-05:00'\n          message: \n      - id: 2\n        name: DevTools Hook Env\n        image_url: https://my_file_server/path/to/devtools_env.tar.gz\n        url: https://github.example.com/api/v3/admin/pre-receive-environments/2\n        html_url: https://github.example.com/admin/pre-receive-environments/2\n        default_environment: false\n        created_at: '2016-05-20T11:35:45-05:00'\n        hooks_count: 1\n        download:\n          url: https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\n          state: success\n          downloaded_at: '2016-05-26T07:42:53-05:00'\n          message: \n    pre-receive-environment:\n      value:\n        id: 2\n        name: DevTools Hook Env\n        image_url: https://my_file_server/path/to/devtools_env.tar.gz\n        url: https://github.example.com/api/v3/admin/pre-receive-environments/2\n        html_url: https://github.example.com/admin/pre-receive-environments/2\n        default_environment: false\n        created_at: '2016-05-20T11:35:45-05:00'\n        hooks_count: 1\n        download:\n          url: https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\n          state: not_started\n          downloaded_at: \n          message: \n    pre-receive-environment-default-response:\n      value:\n        id: 2\n        name: DevTools Hook Env\n        image_url: https://my_file_server/path/to/devtools_env.tar.gz\n        url: https://github.example.com/api/v3/admin/pre-receive-environments/2\n        html_url: https://github.example.com/admin/pre-receive-environments/2\n        default_environment: false\n        created_at: '2016-05-20T11:35:45-05:00'\n        hooks_count: 1\n        download:\n          url: https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\n          state: success\n          downloaded_at: '2016-05-26T07:42:53-05:00'\n          message: \n    pre-receive-environment-download-status-default-response:\n      value:\n        url: https://github.example.com/api/v3/admin/pre-receive-environments/3/downloads/latest\n        state: not_started\n        downloaded_at: \n        message: \n    pre-receive-environment-download-status:\n      value:\n        url: https://github.example.com/api/v3/admin/pre-receive-environments/3/downloads/latest\n        state: success\n        downloaded_at: '2016-05-26T07:42:53-05:00'\n        message: \n    pre-receive-hook-items:\n      value:\n      - id: 1\n        name: Check Commits\n        enforcement: disabled\n        script: scripts/commmit_check.sh\n        script_repository:\n          id: 595\n          full_name: DevIT/hooks\n          url: https://github.example.com/api/v3/repos/DevIT/hooks\n          html_url: https://github.example.com/DevIT/hooks\n        environment:\n          id: 2\n          name: DevTools Hook Env\n          image_url: https://my_file_server/path/to/devtools_env.tar.gz\n          url: https://github.example.com/api/v3/admin/pre-receive-environments/2\n          html_url: https://github.example.com/admin/pre-receive-environments/2\n          default_environment: false\n          created_at: '2016-05-20T11:35:45-05:00'\n          hooks_count: 1\n          download:\n            url: https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\n            state: success\n            downloaded_at: '2016-05-26T07:42:53-05:00'\n            message: \n        allow_downstream_configuration: false\n    pre-receive-hook:\n      value:\n        id: 1\n        name: Check Commits\n        enforcement: disabled\n        script: scripts/commmit_check.sh\n        script_repository:\n          id: 595\n          full_name: DevIT/hooks\n          url: https://github.example.com/api/v3/repos/DevIT/hooks\n          html_url: https://github.example.com/DevIT/hooks\n        environment:\n          id: 2\n          name: DevTools Hook Env\n          image_url: https://my_file_server/path/to/devtools_env.tar.gz\n          url: https://github.example.com/api/v3/admin/pre-receive-environments/2\n          html_url: https://github.example.com/admin/pre-receive-environments/2\n          default_environment: false\n          created_at: '2016-05-20T11:35:45-05:00'\n          hooks_count: 1\n          download:\n            url: https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\n            state: success\n            downloaded_at: '2016-05-26T07:42:53-05:00'\n            message: \n        allow_downstream_configuration: false\n    pre-receive-hook-2:\n      value:\n        id: 1\n        name: Check Commits\n        enforcement: disabled\n        script: scripts/commmit_check.sh\n        script_repository:\n          id: 595\n          full_name: DevIT/hooks\n          url: https://github.example.com/api/v3/repos/DevIT/hooks\n          html_url: https://github.example.com/DevIT/hooks\n        environment:\n          id: 1\n          name: Default\n          image_url: githubenterprise://internal\n          url: https://github.example.com/api/v3/admin/pre-receive-environments/1\n          html_url: https://github.example.com/admin/pre-receive-environments/1\n          default_environment: true\n          created_at: '2016-05-20T11:35:45-05:00'\n          hooks_count: 1\n          download:\n            url: https://github.example.com/api/v3/admin/pre-receive-environments/1/downloads/latest\n            state: success\n            downloaded_at: '2016-05-26T07:42:53-05:00'\n            message: \n        allow_downstream_configuration: true\n    authorization-items:\n      value:\n      - id: 2\n        url: https://enterprise.octocat.com/api/v3/authorizations/2\n        app:\n          name: My personal access token\n          url: https://docs.github.com/enterprise/rest/reference/enterprise-admin#list-personal-access-tokens\n          client_id: '00000000000000000000'\n        token: ghp_16C7e42F292c6912E7710c838347Ae178B4a\n        hashed_token: 23cffb2fab1b0a62747863eba88cb9327e561f2f7a0c8661c0d9b83146cb8d45\n        token_last_eight: Ae178B4a\n        note: My personal access token\n        note_url: \n        created_at: '2019-04-24T21:49:02Z'\n        updated_at: '2019-04-24T21:49:02Z'\n        scopes:\n        - admin:business\n        - admin:gpg_key\n        - admin:org\n        - admin:org_hook\n        - admin:pre_receive_hook\n        - admin:public_key\n        - admin:repo_hook\n        - delete_repo\n        - gist\n        - notifications\n        - repo\n        - user\n        - write:discussion\n        fingerprint: \n    simple-user:\n      value:\n        login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n    authorization:\n      value:\n        id: 1\n        url: https://api.github.com/authorizations/1\n        scopes:\n        - public_repo\n        token: ghu_16C7e42F292c6912E7710c838347Ae178B4a\n        token_last_eight: Ae178B4a\n        hashed_token: 25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        note: optional note\n        note_url: http://optional/note/url\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        fingerprint: jklmnop12345678\n    integration:\n      value:\n        id: 1\n        slug: octoapp\n        node_id: MDExOkludGVncmF0aW9uMQ==\n        owner:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: true\n        name: Octocat App\n        description: ''\n        external_url: https://example.com\n        html_url: https://github.com/apps/octoapp\n        created_at: '2017-07-08T16:18:44-04:00'\n        updated_at: '2017-07-08T16:18:44-04:00'\n        permissions:\n          metadata: read\n          contents: read\n          issues: write\n          single_file: write\n        events:\n        - push\n        - pull_request\n    integration-from-manifest:\n      value:\n        id: 1\n        slug: octoapp\n        node_id: MDxOkludGVncmF0aW9uMQ==\n        owner:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: true\n        name: Octocat App\n        description: ''\n        external_url: https://example.com\n        html_url: https://github.com/apps/octoapp\n        created_at: '2017-07-08T16:18:44-04:00'\n        updated_at: '2017-07-08T16:18:44-04:00'\n        permissions:\n          metadata: read\n          contents: read\n          issues: write\n          single_file: write\n        events:\n        - push\n        - pull_request\n        client_id: Iv1.8a61f9b3a7aba766\n        client_secret: 1726be1638095a19edd134c77bde3aa2ece1e5d8\n        webhook_secret: e340154128314309424b7c8e90325147d99fdafa\n        pem: |\n          -----BEGIN RSA PRIVATE KEY-----\n          MIIEowIBAAKCAQEAuEPzOUE+kiEH1WLiMeBytTEF856j0hOVcSUSUkZxKvqczkWM\n          9vo1gDyC7ZXhdH9fKh32aapba3RSsp4ke+giSmYTk2mGR538ShSDxh0OgpJmjiKP\n          X0Bj4j5sFqfXuCtl9SkH4iueivv4R53ktqM+n6hk98l6hRwC39GVIblAh2lEM4L/\n          6WvYwuQXPMM5OG2Ryh2tDZ1WS5RKfgq+9ksNJ5Q9UtqtqHkO+E63N5OK9sbzpUUm\n          oNaOl3udTlZD3A8iqwMPVxH4SxgATBPAc+bmjk6BMJ0qIzDcVGTrqrzUiywCTLma\n          szdk8GjzXtPDmuBgNn+o6s02qVGpyydgEuqmTQIDAQABAoIBACL6AvkjQVVLn8kJ\n          dBYznJJ4M8ECo+YEgaFwgAHODT0zRQCCgzd+Vxl4YwHmKV2Lr+y2s0drZt8GvYva\n          KOK8NYYZyi15IlwFyRXmvvykF1UBpSXluYFDH7KaVroWMgRreHcIys5LqVSIb6Bo\n          gDmK0yBLPp8qR29s2b7ScZRtLaqGJiX+j55rNzrZwxHkxFHyG9OG+u9IsBElcKCP\n          kYCVE8ZdYexfnKOZbgn2kZB9qu0T/Mdvki8yk3I2bI6xYO24oQmhnT36qnqWoCBX\n          NuCNsBQgpYZeZET8mEAUmo9d+ABmIHIvSs005agK8xRaP4+6jYgy6WwoejJRF5yd\n          NBuF7aECgYEA50nZ4FiZYV0vcJDxFYeY3kYOvVuKn8OyW+2rg7JIQTremIjv8FkE\n          ZnwuF9ZRxgqLxUIfKKfzp/5l5LrycNoj2YKfHKnRejxRWXqG+ZETfxxlmlRns0QG\n          J4+BYL0CoanDSeA4fuyn4Bv7cy/03TDhfg/Uq0Aeg+hhcPE/vx3ebPsCgYEAy/Pv\n          eDLssOSdeyIxf0Brtocg6aPXIVaLdus+bXmLg77rJIFytAZmTTW8SkkSczWtucI3\n          FI1I6sei/8FdPzAl62/JDdlf7Wd9K7JIotY4TzT7Tm7QU7xpfLLYIP1bOFjN81rk\n          77oOD4LsXcosB/U6s1blPJMZ6AlO2EKs10UuR1cCgYBipzuJ2ADEaOz9RLWwi0AH\n          Pza2Sj+c2epQD9ZivD7Zo/Sid3ZwvGeGF13JyR7kLEdmAkgsHUdu1rI7mAolXMaB\n          1pdrsHureeLxGbRM6za3tzMXWv1Il7FQWoPC8ZwXvMOR1VQDv4nzq7vbbA8z8c+c\n          57+8tALQHOTDOgQIzwK61QKBgERGVc0EJy4Uag+VY8J4m1ZQKBluqo7TfP6DQ7O8\n          M5MX73maB/7yAX8pVO39RjrhJlYACRZNMbK+v/ckEQYdJSSKmGCVe0JrGYDuPtic\n          I9+IGfSorf7KHPoMmMN6bPYQ7Gjh7a++tgRFTMEc8956Hnt4xGahy9NcglNtBpVN\n          6G8jAoGBAMCh028pdzJa/xeBHLLaVB2sc0Fe7993WlsPmnVE779dAz7qMscOtXJK\n          fgtriltLSSD6rTA9hUAsL/X62rY0wdXuNdijjBb/qvrx7CAV6i37NK1CjABNjsfG\n          ZM372Ac6zc1EqSrid2IjET1YqyIW2KGLI1R2xbQc98UGlt48OdWu\n          -----END RSA PRIVATE KEY-----\n    webhook-config:\n      value:\n        content_type: json\n        insecure_ssl: '0'\n        secret: \"********\"\n        url: https://example.com/webhook\n    base-installation-items:\n      value:\n      - id: 1\n        account:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        access_tokens_url: https://api.github.com/installations/1/access_tokens\n        repositories_url: https://api.github.com/installation/repositories\n        html_url: https://github.com/organizations/github/settings/installations/1\n        app_id: 1\n        target_id: 1\n        target_type: Organization\n        permissions:\n          checks: write\n          metadata: read\n          contents: read\n        events:\n        - push\n        - pull_request\n        single_file_name: config.yaml\n        has_multiple_single_files: true\n        single_file_paths:\n        - config.yml\n        - \".github/issue_TEMPLATE.md\"\n        repository_selection: selected\n        created_at: '2017-07-08T16:18:44-04:00'\n        updated_at: '2017-07-08T16:18:44-04:00'\n        app_slug: github-actions\n        suspended_at: \n        suspended_by: \n    base-installation:\n      value:\n        id: 1\n        account:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        access_tokens_url: https://api.github.com/installations/1/access_tokens\n        repositories_url: https://api.github.com/installation/repositories\n        html_url: https://github.com/organizations/github/settings/installations/1\n        app_id: 1\n        target_id: 1\n        target_type: Organization\n        permissions:\n          checks: write\n          metadata: read\n          contents: read\n        events:\n        - push\n        - pull_request\n        single_file_name: config.yaml\n        has_multiple_single_files: true\n        single_file_paths:\n        - config.yml\n        - \".github/issue_TEMPLATE.md\"\n        repository_selection: selected\n        created_at: '2017-07-08T16:18:44-04:00'\n        updated_at: '2017-07-08T16:18:44-04:00'\n        app_slug: github-actions\n        suspended_at: \n        suspended_by: \n    installation-token:\n      value:\n        token: ghs_16C7e42F292c6912E7710c838347Ae178B4a\n        expires_at: '2016-07-11T22:14:10Z'\n        permissions:\n          issues: write\n          contents: read\n        repository_selection: selected\n        repositories:\n        - id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          language: \n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          template_repository: \n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n    application-grant-items:\n      value:\n      - id: 1\n        url: https://api.github.com/applications/grants/1\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        created_at: '2011-09-06T17:26:27Z'\n        updated_at: '2011-09-06T20:39:23Z'\n        scopes:\n        - public_repo\n    application-grant:\n      value:\n        id: 1\n        url: https://api.github.com/applications/grants/1\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        created_at: '2011-09-06T17:26:27Z'\n        updated_at: '2011-09-06T20:39:23Z'\n        scopes:\n        - public_repo\n    authorization-with-user:\n      value:\n        id: 1\n        url: https://api.github.com/authorizations/1\n        scopes:\n        - public_repo\n        - user\n        token: ghu_16C7e42F292c6912E7710c838347Ae178B4a\n        token_last_eight: Ae178B4a\n        hashed_token: 25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        note: optional note\n        note_url: http://optional/note/url\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        fingerprint: jklmnop12345678\n        expires_at: '2011-09-08T17:26:27Z'\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    scope-token:\n      value:\n        id: 1\n        url: https://api.github.com/authorizations/1\n        scopes: []\n        token: ghu_16C7e42F292c6912E7710c838347Ae178B4a\n        token_last_eight: Ae178B4a\n        hashed_token: 25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        note: optional note\n        note_url: http://optional/note/url\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        fingerprint: jklmnop12345678\n        expires_at: '2011-09-08T17:26:27Z'\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        installation:\n          permissions:\n            metadata: read\n            issues: write\n            contents: read\n          repository_selection: selected\n          single_file_name: \".github/workflow.yml\"\n          repositories_url: https://api.github.com/user/repos\n          account:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          has_multiple_single_files: false\n          single_file_paths: []\n    authorization-response-if-returning-an-existing-token-2:\n      value:\n        id: 1\n        url: https://api.github.com/authorizations/1\n        scopes:\n        - public_repo\n        token: ghu_16C7e42F292c6912E7710c838347Ae178B4a\n        token_last_eight: Ae178B4a\n        hashed_token: 25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        note: optional note\n        note_url: http://optional/note/url\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        fingerprint: ''\n    authorization-response-if-returning-an-existing-token:\n      value:\n        id: 1\n        url: https://api.github.com/authorizations/1\n        scopes:\n        - public_repo\n        token: ghu_16C7e42F292c6912E7710c838347Ae178B4a\n        token_last_eight: Ae178B4a\n        hashed_token: 25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        note: optional note\n        note_url: http://optional/note/url\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        fingerprint: jklmnop12345678\n    authorization-3:\n      value:\n        id: 1\n        url: https://api.github.com/authorizations/1\n        scopes:\n        - public_repo\n        token: ghu_16C7e42F292c6912E7710c838347Ae178B4a\n        token_last_eight: Ae178B4a\n        hashed_token: 25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        note: optional note\n        note_url: http://optional/note/url\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        fingerprint: jklmnop12345678\n    authorization-2:\n      value:\n        id: 1\n        url: https://api.github.com/authorizations/1\n        scopes:\n        - public_repo\n        token: ghu_16C7e42F292c6912E7710c838347Ae178B4a\n        token_last_eight: Ae178B4a\n        hashed_token: 25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8\n        app:\n          url: http://my-github-app.com\n          name: my github app\n          client_id: abcde12345fghij67890\n        note: optional note\n        note_url: http://optional/note/url\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        fingerprint: jklmnop12345678\n    code-of-conduct-simple-items:\n      value:\n      - key: citizen_code_of_conduct\n        name: Citizen Code of Conduct\n        url: https://api.github.com/codes_of_conduct/citizen_code_of_conduct\n        html_url: http://citizencodeofconduct.org/\n      - key: contributor_covenant\n        name: Contributor Covenant\n        url: https://api.github.com/codes_of_conduct/contributor_covenant\n        html_url: https://www.contributor-covenant.org/version/2/0/code_of_conduct/\n    code-of-conduct:\n      value:\n        key: contributor_covenant\n        name: Contributor Covenant\n        url: https://api.github.com/codes_of_conduct/contributor_covenant\n        body: |\n          # Contributor Covenant Code of Conduct\n\n          ## Our Pledge\n\n          In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n          ## Our Standards\n\n          Examples of behavior that contributes to creating a positive environment include:\n\n          * Using welcoming and inclusive language\n          * Being respectful of differing viewpoints and experiences\n          * Gracefully accepting constructive criticism\n          * Focusing on what is best for the community\n          * Showing empathy towards other community members\n\n          Examples of unacceptable behavior by participants include:\n\n          * The use of sexualized language or imagery and unwelcome sexual attention or advances\n          * Trolling, insulting/derogatory comments, and personal or political attacks\n          * Public or private harassment\n          * Publishing others' private information, such as a physical or electronic address, without explicit permission\n          * Other conduct which could reasonably be considered inappropriate in a professional setting\n\n          ## Our Responsibilities\n\n          Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\n                            to any instances of unacceptable behavior.\n\n          Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n          ## Scope\n\n          This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\n                            posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n          ## Enforcement\n\n          Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\n          Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n          ## Attribution\n\n          This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n          [homepage]: http://contributor-covenant.org\n          [version]: http://contributor-covenant.org/version/1/4/\n        html_url: http://contributor-covenant.org/version/1/4/\n    announcement:\n      summary: Default response\n      value:\n        announcement: Very **important** announcement about _nothing_.\n        expires_at: '2021-01-01T00:00:00.000+00:00'\n    license-info:\n      value:\n        seats: 1400\n        seats_used: 1316\n        seats_available: 84\n        kind: standard\n        days_until_expiration: 365\n        expire_at: 2016/02/06 12:41:52 -0600\n    enterprise-overview:\n      value:\n        repos:\n          total_repos: 212\n          root_repos: 194\n          fork_repos: 18\n          org_repos: 51\n          total_pushes: 3082\n          total_wikis: 15\n        hooks:\n          total_hooks: 27\n          active_hooks: 23\n          inactive_hooks: 4\n        pages:\n          total_pages: 36\n        orgs:\n          total_orgs: 33\n          disabled_orgs: 0\n          total_teams: 60\n          total_team_members: 314\n        users:\n          total_users: 254\n          admin_users: 45\n          suspended_users: 21\n        pulls:\n          total_pulls: 86\n          merged_pulls: 60\n          mergeable_pulls: 21\n          unmergeable_pulls: 3\n        issues:\n          total_issues: 179\n          open_issues: 83\n          closed_issues: 96\n        milestones:\n          total_milestones: 7\n          open_milestones: 6\n          closed_milestones: 1\n        gists:\n          total_gists: 178\n          private_gists: 151\n          public_gists: 25\n        comments:\n          total_commit_comments: 6\n          total_gist_comments: 28\n          total_issue_comments: 366\n          total_pull_request_comments: 30\n    actions-enterprise-permissions:\n      value:\n        enabled_organizations: all\n        allowed_actions: selected\n        selected_actions_url: https://api.github.com/enterprises/2/actions/permissions/selected-actions\n    organization-targets:\n      value:\n        total_count: 1\n        organizations:\n        - login: octocat\n          id: 161335\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          url: https://api.github.com/orgs/octo-org\n          repos_url: https://api.github.com/orgs/octo-org/repos\n          events_url: https://api.github.com/orgs/octo-org/events\n          hooks_url: https://api.github.com/orgs/octo-org/hooks\n          issues_url: https://api.github.com/orgs/octo-org/issues\n          members_url: https://api.github.com/orgs/octo-org/members{/member}\n          public_members_url: https://api.github.com/orgs/octo-org/public_members{/member}\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          description: A great organization\n    selected-actions:\n      value:\n        github_owned_allowed: true\n        verified_allowed: false\n        patterns_allowed:\n        - monalisa/octocat@*\n        - docker/*\n    runner-groups-enterprise:\n      value:\n        total_count: 3\n        runner_groups:\n        - id: 1\n          name: Default\n          visibility: all\n          default: true\n          runners_url: https://api.github.com/enterprises/octo-corp/actions/runner_groups/1/runners\n          allows_public_repositories: false\n        - id: 2\n          name: octo-runner-group\n          visibility: selected\n          default: false\n          selected_organizations_url: https://api.github.com/enterprises/octo-corp/actions/runner_groups/2/organizations\n          runners_url: https://api.github.com/enterprises/octo-corp/actions/runner_groups/2/runners\n          allows_public_repositories: true\n        - id: 3\n          name: expensive-hardware\n          visibility: private\n          default: false\n          runners_url: https://api.github.com/enterprises/octo-corp/actions/runner_groups/3/runners\n          allows_public_repositories: true\n    runner-group-enterprise:\n      value:\n        id: 2\n        name: octo-runner-group\n        visibility: selected\n        default: false\n        selected_organizations_url: https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/organizations\n        runners_url: https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/runners\n        allows_public_repositories: false\n    runner-group-update-enterprise:\n      value:\n        id: 2\n        name: Expensive hardware runners\n        visibility: selected\n        default: false\n        selected_organizations_url: https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/organizations\n        runners_url: https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/runners\n        allows_public_repositories: true\n    runner-paginated:\n      value:\n        total_count: 2\n        runners:\n        - id: 23\n          name: linux_runner\n          os: linux\n          status: online\n          busy: true\n          labels:\n          - id: 5\n            name: self-hosted\n            type: read-only\n          - id: 7\n            name: X64\n            type: read-only\n          - id: 11\n            name: Linux\n            type: read-only\n        - id: 24\n          name: mac_runner\n          os: macos\n          status: offline\n          busy: false\n          labels:\n          - id: 5\n            name: self-hosted\n            type: read-only\n          - id: 7\n            name: X64\n            type: read-only\n          - id: 20\n            name: macOS\n            type: read-only\n          - id: 21\n            name: no-gpu\n            type: custom\n    runner-application-items:\n      value:\n      - os: osx\n        architecture: x64\n        download_url: https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz\n        filename: actions-runner-osx-x64-2.164.0.tar.gz\n      - os: linux\n        architecture: x64\n        download_url: https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz\n        filename: actions-runner-linux-x64-2.164.0.tar.gz\n      - os: linux\n        architecture: arm\n        download_url: https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz\n        filename: actions-runner-linux-arm-2.164.0.tar.gz\n      - os: win\n        architecture: x64\n        download_url: https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip\n        filename: actions-runner-win-x64-2.164.0.zip\n      - os: linux\n        architecture: arm64\n        download_url: https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz\n        filename: actions-runner-linux-arm64-2.164.0.tar.gz\n    authentication-token:\n      value:\n        token: LLBF3JGZDX3P5PMEXLND6TS6FCWO6\n        expires_at: '2020-01-22T12:13:35.123-08:00'\n    authentication-token-2:\n      value:\n        token: AABF3JGZDX3P5PMEXLND6TS6FCWO6\n        expires_at: '2020-01-29T12:13:35.123-08:00'\n    runner:\n      value:\n        id: 23\n        name: MBP\n        os: macos\n        status: online\n        busy: true\n        labels:\n        - id: 5\n          name: self-hosted\n          type: read-only\n        - id: 7\n          name: X64\n          type: read-only\n        - id: 20\n          name: macOS\n          type: read-only\n        - id: 21\n          name: no-gpu\n          type: custom\n    feed:\n      value:\n        timeline_url: https://github.com/timeline\n        user_url: https://github.com/{user}\n        current_user_public_url: https://github.com/octocat\n        current_user_url: https://github.com/octocat.private?token=abc123\n        current_user_actor_url: https://github.com/octocat.private.actor?token=abc123\n        current_user_organization_url: ''\n        current_user_organization_urls:\n        - https://github.com/organizations/github/octocat.private.atom?token=abc123\n        _links:\n          timeline:\n            href: https://github.com/timeline\n            type: application/atom+xml\n          user:\n            href: https://github.com/{user}\n            type: application/atom+xml\n          current_user_public:\n            href: https://github.com/octocat\n            type: application/atom+xml\n          current_user:\n            href: https://github.com/octocat.private?token=abc123\n            type: application/atom+xml\n          current_user_actor:\n            href: https://github.com/octocat.private.actor?token=abc123\n            type: application/atom+xml\n          current_user_organization:\n            href: ''\n            type: ''\n          current_user_organizations:\n          - href: https://github.com/organizations/github/octocat.private.atom?token=abc123\n            type: application/atom+xml\n    base-gist-items:\n      value:\n      - url: https://api.github.com/gists/aa5a315d61ae9438b18d\n        forks_url: https://api.github.com/gists/aa5a315d61ae9438b18d/forks\n        commits_url: https://api.github.com/gists/aa5a315d61ae9438b18d/commits\n        id: aa5a315d61ae9438b18d\n        node_id: MDQ6R2lzdGFhNWEzMTVkNjFhZTk0MzhiMThk\n        git_pull_url: https://gist.github.com/aa5a315d61ae9438b18d.git\n        git_push_url: https://gist.github.com/aa5a315d61ae9438b18d.git\n        html_url: https://gist.github.com/aa5a315d61ae9438b18d\n        files:\n          hello_world.rb:\n            filename: hello_world.rb\n            type: application/x-ruby\n            language: Ruby\n            raw_url: https://gist.githubusercontent.com/octocat/6cad326836d38bd3a7ae/raw/db9c55113504e46fa076e7df3a04ce592e2e86d8/hello_world.rb\n            size: 167\n        public: true\n        created_at: '2010-04-14T02:15:15Z'\n        updated_at: '2011-06-20T11:34:15Z'\n        description: Hello World Examples\n        comments: 0\n        user: \n        comments_url: https://api.github.com/gists/aa5a315d61ae9438b18d/comments/\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        truncated: false\n    gist:\n      value:\n        url: https://api.github.com/gists/aa5a315d61ae9438b18d\n        forks_url: https://api.github.com/gists/aa5a315d61ae9438b18d/forks\n        commits_url: https://api.github.com/gists/aa5a315d61ae9438b18d/commits\n        id: aa5a315d61ae9438b18d\n        node_id: MDQ6R2lzdGFhNWEzMTVkNjFhZTk0MzhiMThk\n        git_pull_url: https://gist.github.com/aa5a315d61ae9438b18d.git\n        git_push_url: https://gist.github.com/aa5a315d61ae9438b18d.git\n        html_url: https://gist.github.com/aa5a315d61ae9438b18d\n        created_at: '2010-04-14T02:15:15Z'\n        updated_at: '2011-06-20T11:34:15Z'\n        description: Hello World Examples\n        comments: 0\n        comments_url: https://api.github.com/gists/aa5a315d61ae9438b18d/comments/\n    gist-comment-items:\n      value:\n      - id: 1\n        node_id: MDExOkdpc3RDb21tZW50MQ==\n        url: https://api.github.com/gists/a6db0bec360bb87e9418/comments/1\n        body: Just commenting for the sake of commenting\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-18T23:23:56Z'\n        updated_at: '2011-04-18T23:23:56Z'\n        author_association: COLLABORATOR\n    gist-comment:\n      value:\n        id: 1\n        node_id: MDExOkdpc3RDb21tZW50MQ==\n        url: https://api.github.com/gists/a6db0bec360bb87e9418/comments/1\n        body: Just commenting for the sake of commenting\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-18T23:23:56Z'\n        updated_at: '2011-04-18T23:23:56Z'\n        author_association: COLLABORATOR\n    gist-commit-items:\n      value:\n      - url: https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f\n        version: 57a7f021a713b1c5a6a199b54cc514735d2d462f\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        change_status:\n          deletions: 0\n          additions: 180\n          total: 180\n        committed_at: '2010-04-14T02:15:15Z'\n    gist-fork-items:\n      value:\n      - url: https://api.github.com/gists/aa5a315d61ae9438b18d\n        forks_url: https://api.github.com/gists/aa5a315d61ae9438b18d/forks\n        commits_url: https://api.github.com/gists/aa5a315d61ae9438b18d/commits\n        id: aa5a315d61ae9438b18d\n        node_id: MDQ6R2lzdGFhNWEzMTVkNjFhZTk0MzhiMThk\n        git_pull_url: https://gist.github.com/aa5a315d61ae9438b18d.git\n        git_push_url: https://gist.github.com/aa5a315d61ae9438b18d.git\n        html_url: https://gist.github.com/aa5a315d61ae9438b18d\n        files:\n          hello_world.rb:\n            filename: hello_world.rb\n            type: application/x-ruby\n            language: Ruby\n            raw_url: https://gist.githubusercontent.com/octocat/6cad326836d38bd3a7ae/raw/db9c55113504e46fa076e7df3a04ce592e2e86d8/hello_world.rb\n            size: 167\n        public: true\n        created_at: '2010-04-14T02:15:15Z'\n        updated_at: '2011-06-20T11:34:15Z'\n        description: Hello World Examples\n        comments: 1\n        user: \n        comments_url: https://api.github.com/gists/aa5a315d61ae9438b18d/comments/\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    base-gist:\n      value:\n        url: https://api.github.com/gists/aa5a315d61ae9438b18d\n        forks_url: https://api.github.com/gists/aa5a315d61ae9438b18d/forks\n        commits_url: https://api.github.com/gists/aa5a315d61ae9438b18d/commits\n        id: aa5a315d61ae9438b18d\n        node_id: MDQ6R2lzdGFhNWEzMTVkNjFhZTk0MzhiMThk\n        git_pull_url: https://gist.github.com/aa5a315d61ae9438b18d.git\n        git_push_url: https://gist.github.com/aa5a315d61ae9438b18d.git\n        html_url: https://gist.github.com/aa5a315d61ae9438b18d\n        files:\n          hello_world.rb:\n            filename: hello_world.rb\n            type: application/x-ruby\n            language: Ruby\n            raw_url: https://gist.githubusercontent.com/octocat/6cad326836d38bd3a7ae/raw/db9c55113504e46fa076e7df3a04ce592e2e86d8/hello_world.rb\n            size: 167\n        public: true\n        created_at: '2010-04-14T02:15:15Z'\n        updated_at: '2011-06-20T11:34:15Z'\n        description: Hello World Examples\n        comments: 0\n        user: \n        comments_url: https://api.github.com/gists/aa5a315d61ae9438b18d/comments/\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        truncated: false\n    gitignore-template:\n      value:\n        name: C\n        source: |\n          # Object files\n          *.o\n\n          # Libraries\n          *.lib\n          *.a\n\n          # Shared objects (inc. Windows DLLs)\n          *.dll\n          *.so\n          *.so.*\n          *.dylib\n\n          # Executables\n          *.exe\n          *.out\n          *.app\n    repository-paginated-2:\n      value:\n        total_count: 1\n        repositories:\n        - id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          language: \n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          allow_rebase_merge: true\n          template_repository: \n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n    issue-with-repo-items:\n      value:\n      - id: 1\n        node_id: MDU6SXNzdWUx\n        url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n        repository_url: https://api.github.com/repos/octocat/Hello-World\n        labels_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n        events_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/events\n        html_url: https://github.com/octocat/Hello-World/issues/1347\n        number: 1347\n        state: open\n        title: Found a bug\n        body: I'm having a problem with this.\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        labels:\n        - id: 208045946\n          node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n          url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n          name: bug\n          description: Something isn't working\n          color: f29513\n          default: true\n        assignee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        assignees:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        milestone:\n          url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n          html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n          labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n          id: 1002604\n          node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n          number: 1\n          state: open\n          title: v1.0\n          description: Tracking milestone for version 1.0\n          creator:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          open_issues: 4\n          closed_issues: 8\n          created_at: '2011-04-10T20:09:31Z'\n          updated_at: '2014-03-03T18:58:10Z'\n          closed_at: '2013-02-12T13:22:01Z'\n          due_on: '2012-10-09T23:39:01Z'\n        locked: true\n        active_lock_reason: too heated\n        comments: 0\n        pull_request:\n          url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n          html_url: https://github.com/octocat/Hello-World/pull/1347\n          diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n          patch_url: https://github.com/octocat/Hello-World/pull/1347.patch\n        closed_at: \n        created_at: '2011-04-22T13:33:48Z'\n        updated_at: '2011-04-22T13:33:48Z'\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          language: \n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          template_repository: \n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n        author_association: COLLABORATOR\n    license-simple-items:\n      value:\n      - key: mit\n        name: MIT License\n        spdx_id: MIT\n        url: https://api.github.com/licenses/mit\n        node_id: MDc6TGljZW5zZW1pdA==\n      - key: lgpl-3.0\n        name: GNU Lesser General Public License v3.0\n        spdx_id: LGPL-3.0\n        url: https://api.github.com/licenses/lgpl-3.0\n        node_id: MDc6TGljZW5zZW1pdA==\n      - key: mpl-2.0\n        name: Mozilla Public License 2.0\n        spdx_id: MPL-2.0\n        url: https://api.github.com/licenses/mpl-2.0\n        node_id: MDc6TGljZW5zZW1pdA==\n      - key: agpl-3.0\n        name: GNU Affero General Public License v3.0\n        spdx_id: AGPL-3.0\n        url: https://api.github.com/licenses/agpl-3.0\n        node_id: MDc6TGljZW5zZW1pdA==\n      - key: unlicense\n        name: The Unlicense\n        spdx_id: Unlicense\n        url: https://api.github.com/licenses/unlicense\n        node_id: MDc6TGljZW5zZW1pdA==\n      - key: apache-2.0\n        name: Apache License 2.0\n        spdx_id: Apache-2.0\n        url: https://api.github.com/licenses/apache-2.0\n        node_id: MDc6TGljZW5zZW1pdA==\n      - key: gpl-3.0\n        name: GNU General Public License v3.0\n        spdx_id: GPL-3.0\n        url: https://api.github.com/licenses/gpl-3.0\n        node_id: MDc6TGljZW5zZW1pdA==\n    license:\n      value:\n        key: mit\n        name: MIT License\n        spdx_id: MIT\n        url: https://api.github.com/licenses/mit\n        node_id: MDc6TGljZW5zZW1pdA==\n        html_url: http://choosealicense.com/licenses/mit/\n        description: A permissive license that is short and to the point. It lets\n          people do anything with your code with proper attribution and without warranty.\n        implementation: Create a text file (typically named LICENSE or LICENSE.txt)\n          in the root of your source code and copy the text of the license into the\n          file. Replace [year] with the current year and [fullname] with the name\n          (or names) of the copyright holders.\n        permissions:\n        - commercial-use\n        - modifications\n        - distribution\n        - sublicense\n        - private-use\n        conditions:\n        - include-copyright\n        limitations:\n        - no-liability\n        body: |2\n\n\n          The MIT License (MIT)\n\n          Copyright (c) [year] [fullname]\n\n          Permission is hereby granted, free of charge, to any person obtaining a copy\n          of this software and associated documentation files (the \"Software\"), to deal\n          in the Software without restriction, including without limitation the rights\n          to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n          copies of the Software, and to permit persons to whom the Software is\n          furnished to do so, subject to the following conditions:\n\n          The above copyright notice and this permission notice shall be included in all\n          copies or substantial portions of the Software.\n\n          THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n          IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n          FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n          AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n          LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n          OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n          SOFTWARE.\n        featured: true\n    api-overview:\n      value:\n        verifiable_password_authentication: true\n        packages:\n        - 192.30.252.0/22\n        dependabot:\n        - 54.158.161.132\n        installed_version: 3.0.0\n    thread-items:\n      value:\n      - id: '1'\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n        subject:\n          title: Greetings\n          url: https://api.github.com/repos/octokit/octokit.rb/issues/123\n          latest_comment_url: https://api.github.com/repos/octokit/octokit.rb/issues/comments/123\n          type: Issue\n        reason: subscribed\n        unread: true\n        updated_at: '2014-11-07T22:01:45Z'\n        last_read_at: '2014-11-07T22:01:45Z'\n        url: https://api.github.com/notifications/threads/1\n        subscription_url: https://api.github.com/notifications/threads/1/subscription\n    thread:\n      value:\n        id: '1'\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n        subject:\n          title: Greetings\n          url: https://api.github.com/repos/octokit/octokit.rb/issues/123\n          latest_comment_url: https://api.github.com/repos/octokit/octokit.rb/issues/comments/123\n          type: Issue\n        reason: subscribed\n        unread: true\n        updated_at: '2014-11-07T22:01:45Z'\n        last_read_at: '2014-11-07T22:01:45Z'\n        url: https://api.github.com/notifications/threads/1\n        subscription_url: https://api.github.com/notifications/threads/1/subscription\n    thread-subscription:\n      value:\n        subscribed: true\n        ignored: false\n        reason: \n        created_at: '2012-10-06T21:34:12Z'\n        url: https://api.github.com/notifications/threads/1/subscription\n        thread_url: https://api.github.com/notifications/threads/1\n    organization-simple-items:\n      value:\n      - login: github\n        id: 1\n        node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n        url: https://api.github.com/orgs/github\n        repos_url: https://api.github.com/orgs/github/repos\n        events_url: https://api.github.com/orgs/github/events\n        hooks_url: https://api.github.com/orgs/github/hooks\n        issues_url: https://api.github.com/orgs/github/issues\n        members_url: https://api.github.com/orgs/github/members{/member}\n        public_members_url: https://api.github.com/orgs/github/public_members{/member}\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        description: A great organization\n    organization-full-default-response:\n      summary: Default response\n      value:\n        login: github\n        id: 1\n        node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n        url: https://api.github.com/orgs/github\n        repos_url: https://api.github.com/orgs/github/repos\n        events_url: https://api.github.com/orgs/github/events\n        hooks_url: https://api.github.com/orgs/github/hooks\n        issues_url: https://api.github.com/orgs/github/issues\n        members_url: https://api.github.com/orgs/github/members{/member}\n        public_members_url: https://api.github.com/orgs/github/public_members{/member}\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        description: A great organization\n        name: github\n        company: GitHub\n        blog: https://github.com/blog\n        location: San Francisco\n        email: octocat@github.com\n        twitter_username: github\n        is_verified: true\n        has_organization_projects: true\n        has_repository_projects: true\n        public_repos: 2\n        public_gists: 1\n        followers: 20\n        following: 0\n        html_url: https://github.com/octocat\n        created_at: '2008-01-14T04:33:35Z'\n        updated_at: '2014-03-03T18:58:10Z'\n        type: Organization\n        total_private_repos: 100\n        owned_private_repos: 100\n        private_gists: 81\n        disk_usage: 10000\n        collaborators: 8\n        billing_email: mona@github.com\n        plan:\n          name: Medium\n          space: 400\n          private_repos: 20\n          filled_seats: 4\n          seats: 5\n        default_repository_permission: read\n        members_can_create_repositories: true\n        two_factor_requirement_enabled: true\n        members_allowed_repository_creation_type: all\n        members_can_create_public_repositories: false\n        members_can_create_private_repositories: false\n        members_can_create_internal_repositories: false\n        members_can_create_pages: true\n        members_can_fork_private_repositories: false\n    organization-full:\n      value:\n        login: github\n        id: 1\n        node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n        url: https://api.github.com/orgs/github\n        repos_url: https://api.github.com/orgs/github/repos\n        events_url: https://api.github.com/orgs/github/events\n        hooks_url: https://api.github.com/orgs/github/hooks\n        issues_url: https://api.github.com/orgs/github/issues\n        members_url: https://api.github.com/orgs/github/members{/member}\n        public_members_url: https://api.github.com/orgs/github/public_members{/member}\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        description: A great organization\n        name: github\n        company: GitHub\n        blog: https://github.com/blog\n        location: San Francisco\n        email: octocat@github.com\n        twitter_username: github\n        is_verified: true\n        has_organization_projects: true\n        has_repository_projects: true\n        public_repos: 2\n        public_gists: 1\n        followers: 20\n        following: 0\n        html_url: https://github.com/octocat\n        created_at: '2008-01-14T04:33:35Z'\n        type: Organization\n        total_private_repos: 100\n        owned_private_repos: 100\n        private_gists: 81\n        disk_usage: 10000\n        collaborators: 8\n        billing_email: mona@github.com\n        plan:\n          name: Medium\n          space: 400\n          private_repos: 20\n        default_repository_permission: read\n        members_can_create_repositories: true\n        two_factor_requirement_enabled: true\n        members_allowed_repository_creation_type: all\n        members_can_create_public_repositories: false\n        members_can_create_private_repositories: false\n        members_can_create_internal_repositories: false\n        members_can_create_pages: true\n        members_can_create_public_pages: true\n        members_can_create_private_pages: true\n        members_can_fork_private_repositories: false\n        updated_at: '2014-03-03T18:58:10Z'\n    actions-organization-permissions:\n      value:\n        enabled_repositories: all\n        allowed_actions: selected\n        selected_actions_url: https://api.github.com/organizations/42/actions/permissions/selected-actions\n    repository-paginated:\n      value:\n        total_count: 1\n        repositories:\n        - id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          language: \n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          template_repository: \n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n    runner-groups-org:\n      value:\n        total_count: 3\n        runner_groups:\n        - id: 1\n          name: Default\n          visibility: all\n          default: true\n          runners_url: https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners\n          inherited: false\n          allows_public_repositories: true\n        - id: 2\n          name: octo-runner-group\n          visibility: selected\n          default: false\n          selected_repositories_url: https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\n          runners_url: https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\n          inherited: true\n          allows_public_repositories: true\n        - id: 3\n          name: expensive-hardware\n          visibility: private\n          default: false\n          runners_url: https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners\n          inherited: false\n          allows_public_repositories: true\n    runner-group:\n      value:\n        id: 2\n        name: octo-runner-group\n        visibility: selected\n        default: false\n        selected_repositories_url: https://api.github.com/orgs/octo-org/actions/runner-groups/2/repositories\n        runners_url: https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\n        inherited: false\n        allows_public_repositories: true\n    runner-group-item:\n      value:\n        id: 2\n        name: octo-runner-group\n        visibility: selected\n        default: false\n        selected_repositories_url: https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\n        runners_url: https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\n        inherited: false\n        allows_public_repositories: true\n    minimal-repository-paginated:\n      value:\n        total_count: 1\n        repositories:\n        - id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          language: \n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          template_repository:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World.git\n            mirror_url: git:git.example.com/octocat/Hello-World\n            hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World\n            homepage: https://github.com\n            organization: \n            language: \n            forks: 9\n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            watchers: 80\n            size: 108\n            default_branch: master\n            open_issues: 0\n            open_issues_count: 0\n            is_template: true\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n              html_url: https://api.github.com/licenses/mit\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            visibility: public\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            template_repository: \n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            delete_branch_on_merge: true\n            allow_merge_commit: true\n            subscribers_count: 42\n            network_count: 0\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          delete_branch_on_merge: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n          forks: 1\n          open_issues: 1\n          watchers: 1\n    organization-actions-secret-paginated:\n      value:\n        total_count: 3\n        secrets:\n        - name: GIST_ID\n          created_at: '2019-08-10T14:59:22Z'\n          updated_at: '2020-01-10T14:59:22Z'\n          visibility: private\n        - name: DEPLOY_TOKEN\n          created_at: '2019-08-10T14:59:22Z'\n          updated_at: '2020-01-10T14:59:22Z'\n          visibility: all\n        - name: GH_TOKEN\n          created_at: '2019-08-10T14:59:22Z'\n          updated_at: '2020-01-10T14:59:22Z'\n          visibility: selected\n          selected_repositories_url: https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories\n    actions-public-key:\n      value:\n        key_id: '012345678912345678'\n        key: 2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\n    organization-actions-secret:\n      value:\n        name: GH_TOKEN\n        created_at: '2019-08-10T14:59:22Z'\n        updated_at: '2020-01-10T14:59:22Z'\n        visibility: selected\n        selected_repositories_url: https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories\n    public-repository-paginated:\n      value:\n        total_count: 1\n        repositories:\n        - id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n    org-hook-items:\n      value:\n      - id: 1\n        url: https://api.github.com/orgs/octocat/hooks/1\n        ping_url: https://api.github.com/orgs/octocat/hooks/1/pings\n        name: web\n        events:\n        - push\n        - pull_request\n        active: true\n        config:\n          url: http://example.com\n          content_type: json\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        type: Organization\n    org-hook:\n      value:\n        id: 1\n        url: https://api.github.com/orgs/octocat/hooks/1\n        ping_url: https://api.github.com/orgs/octocat/hooks/1/pings\n        name: web\n        events:\n        - push\n        - pull_request\n        active: true\n        config:\n          url: http://example.com\n          content_type: json\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        type: Organization\n    org-hook-2:\n      value:\n        id: 1\n        url: https://api.github.com/orgs/octocat/hooks/1\n        ping_url: https://api.github.com/orgs/octocat/hooks/1/pings\n        name: web\n        events:\n        - pull_request\n        active: true\n        config:\n          url: http://example.com\n          content_type: json\n        updated_at: '2011-09-06T20:39:23Z'\n        created_at: '2011-09-06T17:26:27Z'\n        type: Organization\n    installation:\n      value:\n        id: 1\n        account:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          avatar_url: https://github.com/images/error/hubot_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/orgs/github\n          html_url: https://github.com/github\n          followers_url: https://api.github.com/users/github/followers\n          following_url: https://api.github.com/users/github/following{/other_user}\n          gists_url: https://api.github.com/users/github/gists{/gist_id}\n          starred_url: https://api.github.com/users/github/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/github/subscriptions\n          organizations_url: https://api.github.com/users/github/orgs\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          received_events_url: https://api.github.com/users/github/received_events\n          type: Organization\n          site_admin: false\n        repository_selection: all\n        access_tokens_url: https://api.github.com/installations/1/access_tokens\n        repositories_url: https://api.github.com/installation/repositories\n        html_url: https://github.com/organizations/github/settings/installations/1\n        app_id: 1\n        target_id: 1\n        target_type: Organization\n        permissions:\n          checks: write\n          metadata: read\n          contents: read\n        events:\n        - push\n        - pull_request\n        created_at: '2018-02-09T20:51:14Z'\n        updated_at: '2018-02-09T20:51:14Z'\n        single_file_name: config.yml\n        has_multiple_single_files: true\n        single_file_paths:\n        - config.yml\n        - \".github/issue_TEMPLATE.md\"\n        app_slug: github-actions\n        suspended_at: \n        suspended_by: \n    installation-paginated:\n      value:\n        total_count: 1\n        installations:\n        - id: 25381\n          account:\n            login: octo-org\n            id: 6811672\n            node_id: MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=\n            avatar_url: https://avatars3.githubusercontent.com/u/6811672?v=4\n            gravatar_id: ''\n            url: https://api.github.com/users/octo-org\n            html_url: https://github.com/octo-org\n            followers_url: https://api.github.com/users/octo-org/followers\n            following_url: https://api.github.com/users/octo-org/following{/other_user}\n            gists_url: https://api.github.com/users/octo-org/gists{/gist_id}\n            starred_url: https://api.github.com/users/octo-org/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octo-org/subscriptions\n            organizations_url: https://api.github.com/users/octo-org/orgs\n            repos_url: https://api.github.com/users/octo-org/repos\n            events_url: https://api.github.com/users/octo-org/events{/privacy}\n            received_events_url: https://api.github.com/users/octo-org/received_events\n            type: Organization\n            site_admin: false\n          repository_selection: selected\n          access_tokens_url: https://api.github.com/app/installations/25381/access_tokens\n          repositories_url: https://api.github.com/installation/repositories\n          html_url: https://github.com/organizations/octo-org/settings/installations/25381\n          app_id: 2218\n          target_id: 6811672\n          target_type: Organization\n          permissions:\n            deployments: write\n            metadata: read\n            pull_requests: read\n            statuses: read\n          events:\n          - deployment\n          - deployment_status\n          created_at: '2017-05-16T08:47:09.000-07:00'\n          updated_at: '2017-06-06T11:23:23.000-07:00'\n          single_file_name: config.yml\n          has_multiple_single_files: true\n          single_file_paths:\n          - config.yml\n          - \".github/issue_TEMPLATE.md\"\n          app_slug: github-actions\n          suspended_at: \n          suspended_by: \n    simple-user-items:\n      value:\n      - login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n    org-membership-response-if-user-has-an-active-admin-membership-with-organization:\n      summary: Response if user has an active admin membership with organization\n      value:\n        url: https://api.github.com/orgs/octocat/memberships/defunkt\n        state: active\n        role: admin\n        organization_url: https://api.github.com/orgs/octocat\n        organization:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          hooks_url: https://api.github.com/orgs/github/hooks\n          issues_url: https://api.github.com/orgs/github/issues\n          members_url: https://api.github.com/orgs/github/members{/member}\n          public_members_url: https://api.github.com/orgs/github/public_members{/member}\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          description: A great organization\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    org-pre-receive-hook-items:\n      value:\n      - id: 42\n        name: Check Commits\n        enforcement: disabled\n        configuration_url: https://github.example.com/api/v3/admin/pre-receive-hooks/42\n        allow_downstream_configuration: true\n    org-pre-receive-hook:\n      value:\n        id: 42\n        name: Check Commits\n        enforcement: disabled\n        configuration_url: https://github.example.com/api/v3/admin/pre-receive-hooks/42\n        allow_downstream_configuration: true\n    org-pre-receive-hook-2:\n      value:\n        id: 42\n        name: Check Commits\n        enforcement: enabled\n        configuration_url: https://github.example.com/api/v3/orgs/octocat/pre-receive-hooks/42\n        allow_downstream_configuration: false\n    project-items:\n      value:\n      - owner_url: https://api.github.com/orgs/octocat\n        url: https://api.github.com/projects/1002605\n        html_url: https://github.com/orgs/api-playground/projects/1\n        columns_url: https://api.github.com/projects/1002605/columns\n        id: 1002605\n        node_id: MDc6UHJvamVjdDEwMDI2MDU=\n        name: Organization Roadmap\n        body: High-level roadmap for the upcoming year.\n        number: 1\n        state: open\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-11T20:09:31Z'\n        updated_at: '2014-03-04T18:58:10Z'\n    project-2:\n      value:\n        owner_url: https://api.github.com/orgs/octocat\n        url: https://api.github.com/projects/1002605\n        html_url: https://github.com/orgs/api-playground/projects/1\n        columns_url: https://api.github.com/projects/1002605/columns\n        id: 1002605\n        node_id: MDc6UHJvamVjdDEwMDI2MDU=\n        name: Organization Roadmap\n        body: High-level roadmap for the upcoming year.\n        number: 1\n        state: open\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-11T20:09:31Z'\n        updated_at: '2014-03-04T18:58:10Z'\n    minimal-repository-items:\n      value:\n      - id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        language: \n        forks_count: 9\n        stargazers_count: 80\n        watchers_count: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        is_template: false\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          admin: false\n          push: false\n          pull: true\n        template_repository: \n    repository:\n      value:\n        id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        forks: 9\n        forks_count: 9\n        stargazers_count: 80\n        watchers_count: 80\n        watchers: 80\n        size: 108\n        default_branch: master\n        open_issues: 0\n        open_issues_count: 0\n        is_template: true\n        license:\n          key: mit\n          name: MIT License\n          url: https://api.github.com/licenses/mit\n          spdx_id: MIT\n          node_id: MDc6TGljZW5zZW1pdA==\n          html_url: https://api.github.com/licenses/mit\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          admin: false\n          push: false\n          pull: true\n        allow_rebase_merge: true\n        temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n        allow_squash_merge: true\n        delete_branch_on_merge: true\n        allow_merge_commit: true\n        subscribers_count: 42\n        network_count: 0\n    team-items:\n      value:\n      - id: 1\n        node_id: MDQ6VGVhbTE=\n        url: https://api.github.com/teams/1\n        html_url: https://github.com/orgs/github/teams/justice-league\n        name: Justice League\n        slug: justice-league\n        description: A great team.\n        privacy: closed\n        permission: admin\n        members_url: https://api.github.com/teams/1/members{/member}\n        repositories_url: https://api.github.com/teams/1/repos\n        parent: \n    team-full:\n      value:\n        id: 1\n        node_id: MDQ6VGVhbTE=\n        url: https://api.github.com/teams/1\n        html_url: https://github.com/orgs/github/teams/justice-league\n        name: Justice League\n        slug: justice-league\n        description: A great team.\n        privacy: closed\n        permission: admin\n        members_url: https://api.github.com/teams/1/members{/member}\n        repositories_url: https://api.github.com/teams/1/repos\n        members_count: 3\n        repos_count: 10\n        created_at: '2017-07-14T16:53:42Z'\n        updated_at: '2017-08-17T12:37:15Z'\n        organization:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          hooks_url: https://api.github.com/orgs/github/hooks\n          issues_url: https://api.github.com/orgs/github/issues\n          members_url: https://api.github.com/orgs/github/members{/member}\n          public_members_url: https://api.github.com/orgs/github/public_members{/member}\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          description: A great organization\n          name: github\n          company: GitHub\n          blog: https://github.com/blog\n          location: San Francisco\n          email: octocat@github.com\n          has_organization_projects: true\n          has_repository_projects: true\n          public_repos: 2\n          public_gists: 1\n          followers: 20\n          following: 0\n          html_url: https://github.com/octocat\n          created_at: '2008-01-14T04:33:35Z'\n          updated_at: '2017-08-17T12:37:15Z'\n          type: Organization\n        ldap_dn: uid=asdf,ou=users,dc=github,dc=com\n    team-discussion-items:\n      value:\n      - author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Hi! This is an area for us to collaborate as a team.\n        body_html: \"<p>Hi! This is an area for us to collaborate as a team</p>\"\n        body_version: 0d495416a700fb06133c612575d92bfb\n        comments_count: 0\n        comments_url: https://api.github.com/teams/2343027/discussions/1/comments\n        created_at: '2018-01-25T18:56:31Z'\n        last_edited_at: \n        html_url: https://github.com/orgs/github/teams/justice-league/discussions/1\n        node_id: MDE0OlRlYW1EaXNjdXNzaW9uMQ==\n        number: 1\n        pinned: false\n        private: false\n        team_url: https://api.github.com/teams/2343027\n        title: Our first team post\n        updated_at: '2018-01-25T18:56:31Z'\n        url: https://api.github.com/teams/2343027/discussions/1\n        reactions:\n          url: https://api.github.com/teams/2343027/discussions/1/reactions\n          total_count: 5\n          \"+1\": 3\n          \"-1\": 1\n          laugh: 0\n          confused: 0\n          heart: 1\n          hooray: 0\n          eyes: 1\n          rocket: 1\n    team-discussion:\n      value:\n        author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Hi! This is an area for us to collaborate as a team.\n        body_html: \"<p>Hi! This is an area for us to collaborate as a team</p>\"\n        body_version: 0d495416a700fb06133c612575d92bfb\n        comments_count: 0\n        comments_url: https://api.github.com/teams/2343027/discussions/1/comments\n        created_at: '2018-01-25T18:56:31Z'\n        last_edited_at: \n        html_url: https://github.com/orgs/github/teams/justice-league/discussions/1\n        node_id: MDE0OlRlYW1EaXNjdXNzaW9uMQ==\n        number: 1\n        pinned: false\n        private: false\n        team_url: https://api.github.com/teams/2343027\n        title: Our first team post\n        updated_at: '2018-01-25T18:56:31Z'\n        url: https://api.github.com/teams/2343027/discussions/1\n        reactions:\n          url: https://api.github.com/teams/2343027/discussions/1/reactions\n          total_count: 5\n          \"+1\": 3\n          \"-1\": 1\n          laugh: 0\n          confused: 0\n          heart: 1\n          hooray: 0\n          eyes: 1\n          rocket: 1\n    team-discussion-2:\n      value:\n        author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Hi! This is an area for us to collaborate as a team.\n        body_html: \"<p>Hi! This is an area for us to collaborate as a team</p>\"\n        body_version: 0d495416a700fb06133c612575d92bfb\n        comments_count: 1\n        comments_url: https://api.github.com/teams/2343027/discussions/1/comments\n        created_at: '2018-01-25T18:56:31Z'\n        last_edited_at: '2018-01-26T18:22:20Z'\n        html_url: https://github.com/orgs/github/teams/justice-league/discussions/1\n        node_id: MDE0OlRlYW1EaXNjdXNzaW9uMQ==\n        number: 1\n        pinned: false\n        private: false\n        team_url: https://api.github.com/teams/2343027\n        title: Welcome to our first team post\n        updated_at: '2018-01-26T18:22:20Z'\n        url: https://api.github.com/teams/2343027/discussions/1\n        reactions:\n          url: https://api.github.com/teams/2343027/discussions/1/reactions\n          total_count: 5\n          \"+1\": 3\n          \"-1\": 1\n          laugh: 0\n          confused: 0\n          heart: 1\n          hooray: 0\n          eyes: 1\n          rocket: 1\n    team-discussion-comment-items:\n      value:\n      - author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Do you like apples?\n        body_html: \"<p>Do you like apples?</p>\"\n        body_version: 5eb32b219cdc6a5a9b29ba5d6caa9c51\n        created_at: '2018-01-15T23:53:58Z'\n        last_edited_at: \n        discussion_url: https://api.github.com/teams/2403582/discussions/1\n        html_url: https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1\n        node_id: MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=\n        number: 1\n        updated_at: '2018-01-15T23:53:58Z'\n        url: https://api.github.com/teams/2403582/discussions/1/comments/1\n        reactions:\n          url: https://api.github.com/teams/2403582/discussions/1/reactions\n          total_count: 5\n          \"+1\": 3\n          \"-1\": 1\n          laugh: 0\n          confused: 0\n          heart: 1\n          hooray: 0\n          eyes: 1\n          rocket: 1\n    team-discussion-comment:\n      value:\n        author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Do you like apples?\n        body_html: \"<p>Do you like apples?</p>\"\n        body_version: 5eb32b219cdc6a5a9b29ba5d6caa9c51\n        created_at: '2018-01-15T23:53:58Z'\n        last_edited_at: \n        discussion_url: https://api.github.com/teams/2403582/discussions/1\n        html_url: https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1\n        node_id: MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=\n        number: 1\n        updated_at: '2018-01-15T23:53:58Z'\n        url: https://api.github.com/teams/2403582/discussions/1/comments/1\n        reactions:\n          url: https://api.github.com/teams/2403582/discussions/1/reactions\n          total_count: 5\n          \"+1\": 3\n          \"-1\": 1\n          laugh: 0\n          confused: 0\n          heart: 1\n          hooray: 0\n          eyes: 1\n          rocket: 1\n    team-discussion-comment-2:\n      value:\n        author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Do you like pineapples?\n        body_html: \"<p>Do you like pineapples?</p>\"\n        body_version: e6907b24d9c93cc0c5024a7af5888116\n        created_at: '2018-01-15T23:53:58Z'\n        last_edited_at: '2018-01-26T18:22:20Z'\n        discussion_url: https://api.github.com/teams/2403582/discussions/1\n        html_url: https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1\n        node_id: MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=\n        number: 1\n        updated_at: '2018-01-26T18:22:20Z'\n        url: https://api.github.com/teams/2403582/discussions/1/comments/1\n        reactions:\n          url: https://api.github.com/teams/2403582/discussions/1/reactions\n          total_count: 5\n          \"+1\": 3\n          \"-1\": 1\n          laugh: 0\n          confused: 0\n          heart: 1\n          hooray: 0\n          eyes: 1\n          rocket: 1\n    reaction-items:\n      value:\n      - id: 1\n        node_id: MDg6UmVhY3Rpb24x\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        content: heart\n        created_at: '2016-05-20T20:09:31Z'\n    reaction:\n      value:\n        id: 1\n        node_id: MDg6UmVhY3Rpb24x\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        content: heart\n        created_at: '2016-05-20T20:09:31Z'\n    team-membership-response-if-user-is-a-team-maintainer:\n      summary: Response if user is a team maintainer\n      value:\n        url: https://api.github.com/teams/1/memberships/octocat\n        role: maintainer\n        state: active\n    team-membership-response-if-users-membership-with-team-is-now-pending:\n      summary: Response if user's membership with team is now pending\n      value:\n        url: https://api.github.com/teams/1/memberships/octocat\n        role: member\n        state: pending\n    team-project-items:\n      value:\n      - owner_url: https://api.github.com/orgs/octocat\n        url: https://api.github.com/projects/1002605\n        html_url: https://github.com/orgs/api-playground/projects/1\n        columns_url: https://api.github.com/projects/1002605/columns\n        id: 1002605\n        node_id: MDc6UHJvamVjdDEwMDI2MDU=\n        name: Organization Roadmap\n        body: High-level roadmap for the upcoming year.\n        number: 1\n        state: open\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-11T20:09:31Z'\n        updated_at: '2014-03-04T18:58:10Z'\n        organization_permission: write\n        private: false\n        permissions:\n          read: true\n          write: true\n          admin: false\n    team-project:\n      value:\n        owner_url: https://api.github.com/orgs/octocat\n        url: https://api.github.com/projects/1002605\n        html_url: https://github.com/orgs/api-playground/projects/1\n        columns_url: https://api.github.com/projects/1002605/columns\n        id: 1002605\n        node_id: MDc6UHJvamVjdDEwMDI2MDU=\n        name: Organization Roadmap\n        body: High-level roadmap for the upcoming year.\n        number: 1\n        state: open\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-11T20:09:31Z'\n        updated_at: '2014-03-04T18:58:10Z'\n        organization_permission: write\n        private: false\n        permissions:\n          read: true\n          write: true\n          admin: false\n    team-repository-alternative-response-with-repository-permissions:\n      value:\n        id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        forks_count: 9\n        stargazers_count: 80\n        watchers_count: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        is_template: false\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          admin: false\n          maintain: false\n          push: false\n          triage: false\n          pull: true\n        allow_rebase_merge: true\n        template_repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World-Template\n          full_name: octocat/Hello-World-Template\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World-Template\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World-Template\n          archive_url: https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World-Template/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World-Template/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World-Template/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World-Template/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World-Template/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World-Template.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World-Template/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World-Template/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World-Template.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World-Template/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World-Template/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World-Template/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World-Template/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World-Template/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World-Template.git\n          mirror_url: git:git.example.com/octocat/Hello-World-Template\n          hooks_url: https://api.github.com/repos/octocat/Hello-World-Template/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World-Template\n          homepage: https://github.com\n          forks: 9\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          watchers: 80\n          size: 108\n          default_branch: master\n          open_issues: 0\n          open_issues_count: 0\n          is_template: true\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            pull: true\n            triage: false\n            push: false\n            maintain: false\n            admin: false\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n        temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n        allow_squash_merge: true\n        delete_branch_on_merge: true\n        allow_merge_commit: true\n        subscribers_count: 42\n        network_count: 0\n        license:\n          key: mit\n          name: MIT License\n          url: https://api.github.com/licenses/mit\n          spdx_id: MIT\n          node_id: MDc6TGljZW5zZW1pdA==\n          html_url: https://api.github.com/licenses/mit\n        forks: 1\n        open_issues: 1\n        watchers: 1\n    team-items-response-if-child-teams-exist:\n      value:\n      - id: 2\n        node_id: MDQ6VGVhbTI=\n        url: https://api.github.com/teams/2\n        name: Original Roster\n        slug: original-roster\n        description: Started it all.\n        privacy: closed\n        permission: admin\n        members_url: https://api.github.com/teams/2/members{/member}\n        repositories_url: https://api.github.com/teams/2/repos\n        parent:\n          id: 1\n          node_id: MDQ6VGVhbTE=\n          url: https://api.github.com/teams/1\n          html_url: https://github.com/orgs/github/teams/justice-league\n          name: Justice League\n          slug: justice-league\n          description: A great team.\n          privacy: closed\n          permission: admin\n          members_url: https://api.github.com/teams/1/members{/member}\n          repositories_url: https://api.github.com/teams/1/repos\n        html_url: https://github.com/orgs/rails/teams/core\n    project-card:\n      value:\n        url: https://api.github.com/projects/columns/cards/1478\n        id: 1478\n        node_id: MDExOlByb2plY3RDYXJkMTQ3OA==\n        note: Add payload for delete Project column\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2016-09-05T14:21:06Z'\n        updated_at: '2016-09-05T14:20:22Z'\n        archived: false\n        column_url: https://api.github.com/projects/columns/367\n        content_url: https://api.github.com/repos/api-playground/projects-test/issues/3\n        project_url: https://api.github.com/projects/120\n    project-column:\n      value:\n        url: https://api.github.com/projects/columns/367\n        project_url: https://api.github.com/projects/120\n        cards_url: https://api.github.com/projects/columns/367/cards\n        id: 367\n        node_id: MDEzOlByb2plY3RDb2x1bW4zNjc=\n        name: To Do\n        created_at: '2016-09-05T14:18:44Z'\n        updated_at: '2016-09-05T14:22:28Z'\n    project-card-items:\n      value:\n      - url: https://api.github.com/projects/columns/cards/1478\n        id: 1478\n        node_id: MDExOlByb2plY3RDYXJkMTQ3OA==\n        note: Add payload for delete Project column\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2016-09-05T14:21:06Z'\n        updated_at: '2016-09-05T14:20:22Z'\n        archived: false\n        column_url: https://api.github.com/projects/columns/367\n        content_url: https://api.github.com/repos/api-playground/projects-test/issues/3\n        project_url: https://api.github.com/projects/120\n    project-3:\n      value:\n        owner_url: https://api.github.com/repos/api-playground/projects-test\n        url: https://api.github.com/projects/1002604\n        html_url: https://github.com/api-playground/projects-test/projects/1\n        columns_url: https://api.github.com/projects/1002604/columns\n        id: 1002604\n        node_id: MDc6UHJvamVjdDEwMDI2MDQ=\n        name: Projects Documentation\n        body: Developer documentation project for the developer site.\n        number: 1\n        state: open\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-10T20:09:31Z'\n        updated_at: '2014-03-03T18:58:10Z'\n    project-collaborator-permission:\n      value:\n        permission: admin\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    project-column-items:\n      value:\n      - url: https://api.github.com/projects/columns/367\n        project_url: https://api.github.com/projects/120\n        cards_url: https://api.github.com/projects/columns/367/cards\n        id: 367\n        node_id: MDEzOlByb2plY3RDb2x1bW4zNjc=\n        name: To Do\n        created_at: '2016-09-05T14:18:44Z'\n        updated_at: '2016-09-05T14:22:28Z'\n    rate-limit-overview:\n      value:\n        resources:\n          core:\n            limit: 5000\n            remaining: 4999\n            reset: 1372700873\n            used: 1\n          search:\n            limit: 30\n            remaining: 18\n            reset: 1372697452\n            used: 12\n          graphql:\n            limit: 5000\n            remaining: 4993\n            reset: 1372700389\n            used: 7\n          integration_manifest:\n            limit: 5000\n            remaining: 4999\n            reset: 1551806725\n            used: 1\n          code_scanning_upload:\n            limit: 500\n            remaining: 499\n            reset: 1551806725\n            used: 1\n        rate:\n          limit: 5000\n          remaining: 4999\n          reset: 1372700873\n          used: 1\n    full-repository-default-response:\n      summary: Default response\n      value:\n        id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        forks_count: 9\n        forks: 9\n        stargazers_count: 80\n        watchers_count: 80\n        watchers: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        open_issues: 0\n        is_template: false\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          pull: true\n          push: false\n          admin: false\n        allow_rebase_merge: true\n        template_repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World-Template\n          full_name: octocat/Hello-World-Template\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World-Template\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World-Template\n          archive_url: https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World-Template/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World-Template/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World-Template/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World-Template/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World-Template/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World-Template.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World-Template/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World-Template/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World-Template.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World-Template/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World-Template/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World-Template/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World-Template/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World-Template/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World-Template.git\n          mirror_url: git:git.example.com/octocat/Hello-World-Template\n          hooks_url: https://api.github.com/repos/octocat/Hello-World-Template/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World-Template\n          homepage: https://github.com\n          forks: 9\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          watchers: 80\n          size: 108\n          default_branch: master\n          open_issues: 0\n          open_issues_count: 0\n          is_template: true\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n        temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n        allow_squash_merge: true\n        delete_branch_on_merge: true\n        allow_merge_commit: true\n        subscribers_count: 42\n        network_count: 0\n        license:\n          key: mit\n          name: MIT License\n          spdx_id: MIT\n          url: https://api.github.com/licenses/mit\n          node_id: MDc6TGljZW5zZW1pdA==\n        organization:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: Organization\n          site_admin: false\n        parent:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n        source:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n    full-repository-response-with-scarlet-witch-preview-media-type:\n      summary: Response with scarlet-witch-preview media type\n      value:\n        id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        forks_count: 9\n        forks: 9\n        stargazers_count: 80\n        watchers_count: 80\n        watchers: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        open_issues: 0\n        is_template: false\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          pull: true\n          push: false\n          admin: false\n        allow_rebase_merge: true\n        template_repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World-Template\n          full_name: octocat/Hello-World-Template\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World-Template\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World-Template\n          archive_url: https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World-Template/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World-Template/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World-Template/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World-Template/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World-Template/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World-Template.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World-Template/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World-Template/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World-Template.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World-Template/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World-Template/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World-Template/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World-Template/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World-Template/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World-Template.git\n          mirror_url: git:git.example.com/octocat/Hello-World-Template\n          hooks_url: https://api.github.com/repos/octocat/Hello-World-Template/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World-Template\n          homepage: https://github.com\n          forks: 9\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          watchers: 80\n          size: 108\n          default_branch: master\n          open_issues: 0\n          open_issues_count: 0\n          is_template: true\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n        temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n        allow_squash_merge: true\n        delete_branch_on_merge: true\n        allow_merge_commit: true\n        subscribers_count: 42\n        network_count: 0\n        license:\n          key: mit\n          name: MIT License\n          spdx_id: MIT\n          url: https://api.github.com/licenses/mit\n          node_id: MDc6TGljZW5zZW1pdA==\n        organization:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: Organization\n          site_admin: false\n        parent:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n        source:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n        code_of_conduct:\n          key: other\n          name: Other\n          html_url: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md\n          url: https://api.github.com/repos/github/docs/community/code_of_conduct\n    full-repository:\n      value:\n        id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        license:\n          key: mit\n          name: MIT License\n          url: https://api.github.com/licenses/mit\n          spdx_id: MIT\n          node_id: MDc6TGljZW5zZW1pdA==\n          html_url: https://github.com/licenses/mit\n        forks_count: 9\n        forks: 9\n        stargazers_count: 80\n        watchers_count: 80\n        watchers: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        open_issues: 0\n        is_template: false\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          pull: true\n          push: false\n          admin: false\n        allow_rebase_merge: true\n        template_repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World-Template\n          full_name: octocat/Hello-World-Template\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World-Template\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World-Template\n          archive_url: https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World-Template/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World-Template/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World-Template/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World-Template/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World-Template/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World-Template.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World-Template/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World-Template/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World-Template.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World-Template/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World-Template/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World-Template/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World-Template/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World-Template/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World-Template.git\n          mirror_url: git:git.example.com/octocat/Hello-World-Template\n          hooks_url: https://api.github.com/repos/octocat/Hello-World-Template/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World-Template\n          homepage: https://github.com\n          forks: 9\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          watchers: 80\n          size: 108\n          default_branch: master\n          open_issues: 0\n          open_issues_count: 0\n          is_template: true\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n        temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n        allow_squash_merge: true\n        delete_branch_on_merge: true\n        allow_merge_commit: true\n        allow_forking: true\n        subscribers_count: 42\n        network_count: 0\n        organization:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: Organization\n          site_admin: false\n        parent:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n        source:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n    artifact-paginated:\n      value:\n        total_count: 2\n        artifacts:\n        - id: 11\n          node_id: MDg6QXJ0aWZhY3QxMQ==\n          name: Rails\n          size_in_bytes: 556\n          url: https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11\n          archive_download_url: https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip\n          expired: false\n          created_at: '2020-01-10T14:59:22Z'\n          expires_at: '2020-03-21T14:59:22Z'\n          updated_at: '2020-02-21T14:59:22Z'\n        - id: 13\n          node_id: MDg6QXJ0aWZhY3QxMw==\n          name: ''\n          size_in_bytes: 453\n          url: https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13\n          archive_download_url: https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13/zip\n          expired: false\n          created_at: '2020-01-10T14:59:22Z'\n          expires_at: '2020-03-21T14:59:22Z'\n          updated_at: '2020-02-21T14:59:22Z'\n    artifact:\n      value:\n        id: 11\n        node_id: MDg6QXJ0aWZhY3QxMQ==\n        name: Rails\n        size_in_bytes: 556\n        url: https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11\n        archive_download_url: https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip\n        expired: false\n        created_at: '2020-01-10T14:59:22Z'\n        expires_at: '2020-01-21T14:59:22Z'\n        updated_at: '2020-01-21T14:59:22Z'\n    job:\n      value:\n        id: 399444496\n        run_id: 29679449\n        run_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449\n        node_id: MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==\n        head_sha: f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0\n        url: https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496\n        html_url: https://github.com/octo-org/octo-repo/runs/399444496\n        status: completed\n        conclusion: success\n        started_at: '2020-01-20T17:42:40Z'\n        completed_at: '2020-01-20T17:44:39Z'\n        name: build\n        steps:\n        - name: Set up job\n          status: completed\n          conclusion: success\n          number: 1\n          started_at: '2020-01-20T09:42:40.000-08:00'\n          completed_at: '2020-01-20T09:42:41.000-08:00'\n        - name: Run actions/checkout@v2\n          status: completed\n          conclusion: success\n          number: 2\n          started_at: '2020-01-20T09:42:41.000-08:00'\n          completed_at: '2020-01-20T09:42:45.000-08:00'\n        - name: Set up Ruby\n          status: completed\n          conclusion: success\n          number: 3\n          started_at: '2020-01-20T09:42:45.000-08:00'\n          completed_at: '2020-01-20T09:42:45.000-08:00'\n        - name: Run actions/cache@v2\n          status: completed\n          conclusion: success\n          number: 4\n          started_at: '2020-01-20T09:42:45.000-08:00'\n          completed_at: '2020-01-20T09:42:48.000-08:00'\n        - name: Install Bundler\n          status: completed\n          conclusion: success\n          number: 5\n          started_at: '2020-01-20T09:42:48.000-08:00'\n          completed_at: '2020-01-20T09:42:52.000-08:00'\n        - name: Install Gems\n          status: completed\n          conclusion: success\n          number: 6\n          started_at: '2020-01-20T09:42:52.000-08:00'\n          completed_at: '2020-01-20T09:42:53.000-08:00'\n        - name: Run Tests\n          status: completed\n          conclusion: success\n          number: 7\n          started_at: '2020-01-20T09:42:53.000-08:00'\n          completed_at: '2020-01-20T09:42:59.000-08:00'\n        - name: Deploy to Heroku\n          status: completed\n          conclusion: success\n          number: 8\n          started_at: '2020-01-20T09:42:59.000-08:00'\n          completed_at: '2020-01-20T09:44:39.000-08:00'\n        - name: Post actions/cache@v2\n          status: completed\n          conclusion: success\n          number: 16\n          started_at: '2020-01-20T09:44:39.000-08:00'\n          completed_at: '2020-01-20T09:44:39.000-08:00'\n        - name: Complete job\n          status: completed\n          conclusion: success\n          number: 17\n          started_at: '2020-01-20T09:44:39.000-08:00'\n          completed_at: '2020-01-20T09:44:39.000-08:00'\n        check_run_url: https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496\n    actions-repository-permissions:\n      value:\n        enabled: true\n        allowed_actions: selected\n        selected_actions_url: https://api.github.com/repositories/42/actions/permissions/selected-actions\n    workflow-run-paginated:\n      value:\n        total_count: 1\n        workflow_runs:\n        - id: 30433642\n          name: Build\n          node_id: MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==\n          head_branch: master\n          head_sha: acb5820ced9479c074f688cc328bf03f341a511d\n          run_number: 562\n          event: push\n          status: queued\n          conclusion: \n          workflow_id: 159038\n          url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642\n          html_url: https://github.com/octo-org/octo-repo/actions/runs/30433642\n          pull_requests: []\n          created_at: '2020-01-22T19:33:08Z'\n          updated_at: '2020-01-22T19:33:08Z'\n          jobs_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs\n          logs_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs\n          check_suite_url: https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374\n          artifacts_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts\n          cancel_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel\n          rerun_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun\n          workflow_url: https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038\n          head_commit:\n            id: acb5820ced9479c074f688cc328bf03f341a511d\n            tree_id: d23f6eedb1e1b9610bbc754ddb5197bfe7271223\n            message: Create linter.yaml\n            timestamp: '2020-01-22T19:33:05Z'\n            author:\n              name: Octo Cat\n              email: octocat@github.com\n            committer:\n              name: GitHub\n              email: noreply@github.com\n          repository:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n          head_repository:\n            id: 217723378\n            node_id: MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=\n            name: octo-repo\n            full_name: octo-org/octo-repo\n            private: true\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            html_url: https://github.com/octo-org/octo-repo\n            description: \n            fork: false\n            url: https://api.github.com/repos/octo-org/octo-repo\n            forks_url: https://api.github.com/repos/octo-org/octo-repo/forks\n            keys_url: https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}\n            collaborators_url: https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}\n            teams_url: https://api.github.com/repos/octo-org/octo-repo/teams\n            hooks_url: https://api.github.com/repos/octo-org/octo-repo/hooks\n            issue_events_url: https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}\n            events_url: https://api.github.com/repos/octo-org/octo-repo/events\n            assignees_url: https://api.github.com/repos/octo-org/octo-repo/assignees{/user}\n            branches_url: https://api.github.com/repos/octo-org/octo-repo/branches{/branch}\n            tags_url: https://api.github.com/repos/octo-org/octo-repo/tags\n            blobs_url: https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}\n            git_tags_url: https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}\n            git_refs_url: https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}\n            trees_url: https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}\n            statuses_url: https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}\n            languages_url: https://api.github.com/repos/octo-org/octo-repo/languages\n            stargazers_url: https://api.github.com/repos/octo-org/octo-repo/stargazers\n            contributors_url: https://api.github.com/repos/octo-org/octo-repo/contributors\n            subscribers_url: https://api.github.com/repos/octo-org/octo-repo/subscribers\n            subscription_url: https://api.github.com/repos/octo-org/octo-repo/subscription\n            commits_url: https://api.github.com/repos/octo-org/octo-repo/commits{/sha}\n            git_commits_url: https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}\n            comments_url: https://api.github.com/repos/octo-org/octo-repo/comments{/number}\n            issue_comment_url: https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}\n            contents_url: https://api.github.com/repos/octo-org/octo-repo/contents/{+path}\n            compare_url: https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}\n            merges_url: https://api.github.com/repos/octo-org/octo-repo/merges\n            archive_url: https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}\n            downloads_url: https://api.github.com/repos/octo-org/octo-repo/downloads\n            issues_url: https://api.github.com/repos/octo-org/octo-repo/issues{/number}\n            pulls_url: https://api.github.com/repos/octo-org/octo-repo/pulls{/number}\n            milestones_url: https://api.github.com/repos/octo-org/octo-repo/milestones{/number}\n            notifications_url: https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}\n            labels_url: https://api.github.com/repos/octo-org/octo-repo/labels{/name}\n            releases_url: https://api.github.com/repos/octo-org/octo-repo/releases{/id}\n            deployments_url: https://api.github.com/repos/octo-org/octo-repo/deployments\n    workflow-run:\n      value:\n        id: 30433642\n        name: Build\n        node_id: MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==\n        check_suite_id: 42\n        check_suite_node_id: MDEwOkNoZWNrU3VpdGU0Mg==\n        head_branch: master\n        head_sha: acb5820ced9479c074f688cc328bf03f341a511d\n        run_number: 562\n        event: push\n        status: queued\n        workflow_id: 159038\n        url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642\n        html_url: https://github.com/octo-org/octo-repo/actions/runs/30433642\n        pull_requests: []\n        created_at: '2020-01-22T19:33:08Z'\n        updated_at: '2020-01-22T19:33:08Z'\n        jobs_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs\n        logs_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs\n        check_suite_url: https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374\n        artifacts_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts\n        cancel_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel\n        rerun_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun\n        workflow_url: https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038\n        head_commit:\n          id: acb5820ced9479c074f688cc328bf03f341a511d\n          tree_id: d23f6eedb1e1b9610bbc754ddb5197bfe7271223\n          message: Create linter.yaml\n          timestamp: '2020-01-22T19:33:05Z'\n          author:\n            name: Octo Cat\n            email: octocat@github.com\n          committer:\n            name: GitHub\n            email: noreply@github.com\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n        head_repository:\n          id: 217723378\n          node_id: MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=\n          name: octo-repo\n          full_name: octo-org/octo-repo\n          private: true\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          html_url: https://github.com/octo-org/octo-repo\n          description: \n          fork: false\n          url: https://api.github.com/repos/octo-org/octo-repo\n          forks_url: https://api.github.com/repos/octo-org/octo-repo/forks\n          keys_url: https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}\n          collaborators_url: https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}\n          teams_url: https://api.github.com/repos/octo-org/octo-repo/teams\n          hooks_url: https://api.github.com/repos/octo-org/octo-repo/hooks\n          issue_events_url: https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}\n          events_url: https://api.github.com/repos/octo-org/octo-repo/events\n          assignees_url: https://api.github.com/repos/octo-org/octo-repo/assignees{/user}\n          branches_url: https://api.github.com/repos/octo-org/octo-repo/branches{/branch}\n          tags_url: https://api.github.com/repos/octo-org/octo-repo/tags\n          blobs_url: https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}\n          git_tags_url: https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}\n          git_refs_url: https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}\n          trees_url: https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}\n          statuses_url: https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}\n          languages_url: https://api.github.com/repos/octo-org/octo-repo/languages\n          stargazers_url: https://api.github.com/repos/octo-org/octo-repo/stargazers\n          contributors_url: https://api.github.com/repos/octo-org/octo-repo/contributors\n          subscribers_url: https://api.github.com/repos/octo-org/octo-repo/subscribers\n          subscription_url: https://api.github.com/repos/octo-org/octo-repo/subscription\n          commits_url: https://api.github.com/repos/octo-org/octo-repo/commits{/sha}\n          git_commits_url: https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}\n          comments_url: https://api.github.com/repos/octo-org/octo-repo/comments{/number}\n          issue_comment_url: https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}\n          contents_url: https://api.github.com/repos/octo-org/octo-repo/contents/{+path}\n          compare_url: https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}\n          merges_url: https://api.github.com/repos/octo-org/octo-repo/merges\n          archive_url: https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}\n          downloads_url: https://api.github.com/repos/octo-org/octo-repo/downloads\n          issues_url: https://api.github.com/repos/octo-org/octo-repo/issues{/number}\n          pulls_url: https://api.github.com/repos/octo-org/octo-repo/pulls{/number}\n          milestones_url: https://api.github.com/repos/octo-org/octo-repo/milestones{/number}\n          notifications_url: https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}\n          labels_url: https://api.github.com/repos/octo-org/octo-repo/labels{/name}\n          releases_url: https://api.github.com/repos/octo-org/octo-repo/releases{/id}\n          deployments_url: https://api.github.com/repos/octo-org/octo-repo/deployments\n    job-paginated:\n      value:\n        total_count: 1\n        jobs:\n        - id: 399444496\n          run_id: 29679449\n          run_url: https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449\n          node_id: MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==\n          head_sha: f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0\n          url: https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496\n          html_url: https://github.com/octo-org/octo-repo/runs/399444496\n          status: completed\n          conclusion: success\n          started_at: '2020-01-20T17:42:40Z'\n          completed_at: '2020-01-20T17:44:39Z'\n          name: build\n          steps:\n          - name: Set up job\n            status: completed\n            conclusion: success\n            number: 1\n            started_at: '2020-01-20T09:42:40.000-08:00'\n            completed_at: '2020-01-20T09:42:41.000-08:00'\n          - name: Run actions/checkout@v2\n            status: completed\n            conclusion: success\n            number: 2\n            started_at: '2020-01-20T09:42:41.000-08:00'\n            completed_at: '2020-01-20T09:42:45.000-08:00'\n          - name: Set up Ruby\n            status: completed\n            conclusion: success\n            number: 3\n            started_at: '2020-01-20T09:42:45.000-08:00'\n            completed_at: '2020-01-20T09:42:45.000-08:00'\n          - name: Run actions/cache@v2\n            status: completed\n            conclusion: success\n            number: 4\n            started_at: '2020-01-20T09:42:45.000-08:00'\n            completed_at: '2020-01-20T09:42:48.000-08:00'\n          - name: Install Bundler\n            status: completed\n            conclusion: success\n            number: 5\n            started_at: '2020-01-20T09:42:48.000-08:00'\n            completed_at: '2020-01-20T09:42:52.000-08:00'\n          - name: Install Gems\n            status: completed\n            conclusion: success\n            number: 6\n            started_at: '2020-01-20T09:42:52.000-08:00'\n            completed_at: '2020-01-20T09:42:53.000-08:00'\n          - name: Run Tests\n            status: completed\n            conclusion: success\n            number: 7\n            started_at: '2020-01-20T09:42:53.000-08:00'\n            completed_at: '2020-01-20T09:42:59.000-08:00'\n          - name: Deploy to Heroku\n            status: completed\n            conclusion: success\n            number: 8\n            started_at: '2020-01-20T09:42:59.000-08:00'\n            completed_at: '2020-01-20T09:44:39.000-08:00'\n          - name: Post actions/cache@v2\n            status: completed\n            conclusion: success\n            number: 16\n            started_at: '2020-01-20T09:44:39.000-08:00'\n            completed_at: '2020-01-20T09:44:39.000-08:00'\n          - name: Complete job\n            status: completed\n            conclusion: success\n            number: 17\n            started_at: '2020-01-20T09:44:39.000-08:00'\n            completed_at: '2020-01-20T09:44:39.000-08:00'\n          check_run_url: https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496\n    actions-secret-paginated:\n      value:\n        total_count: 2\n        secrets:\n        - name: GH_TOKEN\n          created_at: '2019-08-10T14:59:22Z'\n          updated_at: '2020-01-10T14:59:22Z'\n        - name: GIST_ID\n          created_at: '2020-01-10T10:59:22Z'\n          updated_at: '2020-01-11T11:59:22Z'\n    actions-secret:\n      value:\n        name: GH_TOKEN\n        created_at: '2019-08-10T14:59:22Z'\n        updated_at: '2020-01-10T14:59:22Z'\n    workflow-paginated:\n      value:\n        total_count: 2\n        workflows:\n        - id: 161335\n          node_id: MDg6V29ya2Zsb3cxNjEzMzU=\n          name: CI\n          path: \".github/workflows/blank.yaml\"\n          state: active\n          created_at: '2020-01-08T23:48:37.000-08:00'\n          updated_at: '2020-01-08T23:50:21.000-08:00'\n          url: https://api.github.com/repos/octo-org/octo-repo/actions/workflows/161335\n          html_url: https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335\n          badge_url: https://github.com/octo-org/octo-repo/workflows/CI/badge.svg\n        - id: 269289\n          node_id: MDE4OldvcmtmbG93IFNlY29uZGFyeTI2OTI4OQ==\n          name: Linter\n          path: \".github/workflows/linter.yaml\"\n          state: active\n          created_at: '2020-01-08T23:48:37.000-08:00'\n          updated_at: '2020-01-08T23:50:21.000-08:00'\n          url: https://api.github.com/repos/octo-org/octo-repo/actions/workflows/269289\n          html_url: https://github.com/octo-org/octo-repo/blob/master/.github/workflows/269289\n          badge_url: https://github.com/octo-org/octo-repo/workflows/Linter/badge.svg\n    workflow:\n      value:\n        id: 161335\n        node_id: MDg6V29ya2Zsb3cxNjEzMzU=\n        name: CI\n        path: \".github/workflows/blank.yaml\"\n        state: active\n        created_at: '2020-01-08T23:48:37.000-08:00'\n        updated_at: '2020-01-08T23:50:21.000-08:00'\n        url: https://api.github.com/repos/octo-org/octo-repo/actions/workflows/161335\n        html_url: https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335\n        badge_url: https://github.com/octo-org/octo-repo/workflows/CI/badge.svg\n    short-branch-with-protection-items:\n      value:\n      - name: master\n        commit:\n          sha: c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\n          url: https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\n        protected: true\n        protection:\n          required_status_checks:\n            enforcement_level: non_admins\n            contexts:\n            - ci-test\n            - linter\n        protection_url: https://api.github.com/repos/octocat/hello-world/branches/master/protection\n    branch-protection:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection\n        required_status_checks:\n          url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks\n          contexts:\n          - continuous-integration/travis-ci\n          contexts_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts\n          enforcement_level: non_admins\n        enforce_admins:\n          url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins\n          enabled: true\n        required_pull_request_reviews:\n          url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_pull_request_reviews\n          dismissal_restrictions:\n            url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions\n            users_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions/users\n            teams_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions/teams\n            users:\n            - login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            teams:\n            - id: 1\n              node_id: MDQ6VGVhbTE=\n              url: https://api.github.com/teams/1\n              html_url: https://github.com/orgs/github/teams/justice-league\n              name: Justice League\n              slug: justice-league\n              description: A great team.\n              privacy: closed\n              permission: admin\n              members_url: https://api.github.com/teams/1/members{/member}\n              repositories_url: https://api.github.com/teams/1/repos\n              parent: \n          dismiss_stale_reviews: true\n          require_code_owner_reviews: true\n          required_approving_review_count: 2\n        restrictions:\n          url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions\n          users_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/users\n          teams_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams\n          apps_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams\n          users:\n          - login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          teams:\n          - id: 1\n            node_id: MDQ6VGVhbTE=\n            url: https://api.github.com/teams/1\n            html_url: https://github.com/orgs/github/teams/justice-league\n            name: Justice League\n            slug: justice-league\n            description: A great team.\n            privacy: closed\n            permission: admin\n            members_url: https://api.github.com/teams/1/members{/member}\n            repositories_url: https://api.github.com/teams/1/repos\n            parent: \n          apps:\n          - id: 1\n            slug: octoapp\n            node_id: MDExOkludGVncmF0aW9uMQ==\n            owner:\n              login: github\n              id: 1\n              node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n              url: https://api.github.com/orgs/github\n              repos_url: https://api.github.com/orgs/github/repos\n              events_url: https://api.github.com/orgs/github/events\n              hooks_url: https://api.github.com/orgs/github/hooks\n              issues_url: https://api.github.com/orgs/github/issues\n              members_url: https://api.github.com/orgs/github/members{/member}\n              public_members_url: https://api.github.com/orgs/github/public_members{/member}\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              description: A great organization\n            name: Octocat App\n            description: ''\n            external_url: https://example.com\n            html_url: https://github.com/apps/octoapp\n            created_at: '2017-07-08T16:18:44-04:00'\n            updated_at: '2017-07-08T16:18:44-04:00'\n            permissions:\n              metadata: read\n              contents: read\n              issues: write\n              single_file: write\n            events:\n            - push\n            - pull_request\n        required_linear_history:\n          enabled: true\n        allow_force_pushes:\n          enabled: true\n        allow_deletions:\n          enabled: true\n        required_conversation_resolution:\n          enabled: true\n    protected-branch-admin-enforced-2:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins\n        enabled: true\n    protected-branch-pull-request-review:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_pull_request_reviews\n        dismissal_restrictions:\n          url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions\n          users_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions/users\n          teams_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions/teams\n          users:\n          - login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          teams:\n          - id: 1\n            node_id: MDQ6VGVhbTE=\n            url: https://api.github.com/teams/1\n            html_url: https://github.com/orgs/github/teams/justice-league\n            name: Justice League\n            slug: justice-league\n            description: A great team.\n            privacy: closed\n            permission: admin\n            members_url: https://api.github.com/teams/1/members{/member}\n            repositories_url: https://api.github.com/teams/1/repos\n            parent: \n        dismiss_stale_reviews: true\n        require_code_owner_reviews: true\n        required_approving_review_count: 2\n    protected-branch-admin-enforced:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures\n        enabled: true\n    status-check-policy:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks\n        strict: true\n        contexts:\n        - continuous-integration/travis-ci\n        contexts_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts\n    branch-restriction-policy:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions\n        users_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/users\n        teams_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams\n        apps_url: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/restrictions/teams\n        users:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        teams:\n        - id: 1\n          node_id: MDQ6VGVhbTE=\n          url: https://api.github.com/teams/1\n          html_url: https://github.com/orgs/github/teams/justice-league\n          name: Justice League\n          slug: justice-league\n          description: A great team.\n          privacy: closed\n          permission: admin\n          members_url: https://api.github.com/teams/1/members{/member}\n          repositories_url: https://api.github.com/teams/1/repos\n          parent: \n        apps:\n        - id: 1\n          slug: octoapp\n          node_id: MDExOkludGVncmF0aW9uMQ==\n          owner:\n            login: github\n            id: 1\n            node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n            url: https://api.github.com/orgs/github\n            repos_url: https://api.github.com/orgs/github/repos\n            events_url: https://api.github.com/orgs/github/events\n            hooks_url: https://api.github.com/orgs/github/hooks\n            issues_url: https://api.github.com/orgs/github/issues\n            members_url: https://api.github.com/orgs/github/members{/member}\n            public_members_url: https://api.github.com/orgs/github/public_members{/member}\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            description: A great organization\n          name: Octocat App\n          description: ''\n          external_url: https://example.com\n          html_url: https://github.com/apps/octoapp\n          created_at: '2017-07-08T16:18:44-04:00'\n          updated_at: '2017-07-08T16:18:44-04:00'\n          permissions:\n            metadata: read\n            contents: read\n            issues: write\n            single_file: write\n          events:\n          - push\n          - pull_request\n    integration-items:\n      value:\n      - id: 1\n        slug: octoapp\n        node_id: MDExOkludGVncmF0aW9uMQ==\n        owner:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: true\n        name: Octocat App\n        description: ''\n        external_url: https://example.com\n        html_url: https://github.com/apps/octoapp\n        created_at: '2017-07-08T16:18:44-04:00'\n        updated_at: '2017-07-08T16:18:44-04:00'\n        permissions:\n          metadata: read\n          contents: read\n          issues: write\n          single_file: write\n        events:\n        - push\n        - pull_request\n    check-run-example-of-completed-conclusion:\n      summary: Response for completed conclusion\n      value:\n        id: 4\n        head_sha: ce587453ced02b1526dfb4cb910479d431683101\n        node_id: MDg6Q2hlY2tSdW40\n        external_id: ''\n        url: https://api.github.com/repos/github/hello-world/check-runs/4\n        html_url: https://github.com/github/hello-world/runs/4\n        details_url: https://example.com\n        status: completed\n        conclusion: neutral\n        started_at: '2018-05-04T01:14:52Z'\n        completed_at: '2018-05-04T01:14:52Z'\n        output:\n          title: Mighty Readme report\n          summary: There are 0 failures, 2 warnings, and 1 notice.\n          text: You may have some misspelled words on lines 2 and 4. You also may\n            want to add a section in your README about how to install your app.\n          annotations_count: 2\n          annotations_url: https://api.github.com/repos/github/hello-world/check-runs/4/annotations\n        name: mighty_readme\n        check_suite:\n          id: 5\n        app:\n          id: 1\n          slug: octoapp\n          node_id: MDExOkludGVncmF0aW9uMQ==\n          owner:\n            login: github\n            id: 1\n            node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n            url: https://api.github.com/orgs/github\n            repos_url: https://api.github.com/orgs/github/repos\n            events_url: https://api.github.com/orgs/github/events\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: true\n          name: Octocat App\n          description: ''\n          external_url: https://example.com\n          html_url: https://github.com/apps/octoapp\n          created_at: '2017-07-08T16:18:44-04:00'\n          updated_at: '2017-07-08T16:18:44-04:00'\n          permissions:\n            metadata: read\n            contents: read\n            issues: write\n            single_file: write\n          events:\n          - push\n          - pull_request\n        pull_requests:\n        - url: https://api.github.com/repos/github/hello-world/pulls/1\n          id: 1934\n          number: 3956\n          head:\n            ref: say-hello\n            sha: 3dca65fa3e8d4b3da3f3d056c59aee1c50f41390\n            repo:\n              id: 526\n              url: https://api.github.com/repos/github/hello-world\n              name: hello-world\n          base:\n            ref: master\n            sha: e7fdf7640066d71ad16a86fbcbb9c6a10a18af4f\n            repo:\n              id: 526\n              url: https://api.github.com/repos/github/hello-world\n              name: hello-world\n    check-run:\n      value:\n        id: 4\n        head_sha: ce587453ced02b1526dfb4cb910479d431683101\n        node_id: MDg6Q2hlY2tSdW40\n        external_id: ''\n        url: https://api.github.com/repos/github/hello-world/check-runs/4\n        html_url: https://github.com/github/hello-world/runs/4\n        details_url: https://example.com\n        status: completed\n        conclusion: neutral\n        started_at: '2018-05-04T01:14:52Z'\n        completed_at: '2018-05-04T01:14:52Z'\n        output:\n          title: Mighty Readme report\n          summary: There are 0 failures, 2 warnings, and 1 notice.\n          text: You may have some misspelled words on lines 2 and 4. You also may\n            want to add a section in your README about how to install your app.\n          annotations_count: 2\n          annotations_url: https://api.github.com/repos/github/hello-world/check-runs/4/annotations\n        name: mighty_readme\n        check_suite:\n          id: 5\n        app:\n          id: 1\n          slug: octoapp\n          node_id: MDExOkludGVncmF0aW9uMQ==\n          owner:\n            login: github\n            id: 1\n            node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n            url: https://api.github.com/orgs/github\n            repos_url: https://api.github.com/orgs/github/repos\n            events_url: https://api.github.com/orgs/github/events\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: true\n          name: Octocat App\n          description: ''\n          external_url: https://example.com\n          html_url: https://github.com/apps/octoapp\n          created_at: '2017-07-08T16:18:44-04:00'\n          updated_at: '2017-07-08T16:18:44-04:00'\n          permissions:\n            metadata: read\n            contents: read\n            issues: write\n            single_file: write\n          events:\n          - push\n          - pull_request\n        pull_requests:\n        - url: https://api.github.com/repos/github/hello-world/pulls/1\n          id: 1934\n          number: 3956\n          head:\n            ref: say-hello\n            sha: 3dca65fa3e8d4b3da3f3d056c59aee1c50f41390\n            repo:\n              id: 526\n              url: https://api.github.com/repos/github/hello-world\n              name: hello-world\n          base:\n            ref: master\n            sha: e7fdf7640066d71ad16a86fbcbb9c6a10a18af4f\n            repo:\n              id: 526\n              url: https://api.github.com/repos/github/hello-world\n              name: hello-world\n    check-annotation-items:\n      value:\n      - path: README.md\n        start_line: 2\n        end_line: 2\n        start_column: 5\n        end_column: 10\n        annotation_level: warning\n        title: Spell Checker\n        message: Check your spelling for 'banaas'.\n        raw_details: Do you mean 'bananas' or 'banana'?\n        blob_href: https://api.github.com/repos/github/rest-api-description/git/blobs/abc\n    check-suite:\n      value:\n        id: 5\n        node_id: MDEwOkNoZWNrU3VpdGU1\n        head_branch: master\n        head_sha: d6fde92930d4715a2b49857d24b940956b26d2d3\n        status: completed\n        conclusion: neutral\n        url: https://api.github.com/repos/github/hello-world/check-suites/5\n        before: 146e867f55c26428e5f9fade55a9bbf5e95a7912\n        after: d6fde92930d4715a2b49857d24b940956b26d2d3\n        pull_requests: []\n        created_at: '2017-07-08T16:18:44-04:00'\n        updated_at: '2017-07-08T16:18:44-04:00'\n        app:\n          id: 1\n          slug: octoapp\n          node_id: MDExOkludGVncmF0aW9uMQ==\n          owner:\n            login: github\n            id: 1\n            node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n            url: https://api.github.com/orgs/github\n            repos_url: https://api.github.com/orgs/github/repos\n            events_url: https://api.github.com/orgs/github/events\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: true\n          name: Octocat App\n          description: ''\n          external_url: https://example.com\n          html_url: https://github.com/apps/octoapp\n          created_at: '2017-07-08T16:18:44-04:00'\n          updated_at: '2017-07-08T16:18:44-04:00'\n          permissions:\n            metadata: read\n            contents: read\n            issues: write\n            single_file: write\n          events:\n          - push\n          - pull_request\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          template_repository:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World-Template\n            full_name: octocat/Hello-World-Template\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World-Template\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World-Template\n            archive_url: https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World-Template/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World-Template/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World-Template/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World-Template/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World-Template/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World-Template.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World-Template/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World-Template/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World-Template.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World-Template/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World-Template/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World-Template/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World-Template/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World-Template/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World-Template.git\n            mirror_url: git:git.example.com/octocat/Hello-World-Template\n            hooks_url: https://api.github.com/repos/octocat/Hello-World-Template/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World-Template\n            homepage: https://github.com\n            forks: 9\n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            watchers: 80\n            size: 108\n            default_branch: master\n            open_issues: 0\n            open_issues_count: 0\n            is_template: true\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n              html_url: https://api.github.com/licenses/mit\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            visibility: public\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            delete_branch_on_merge: true\n            allow_merge_commit: true\n            subscribers_count: 42\n            network_count: 0\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: false\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          delete_branch_on_merge: true\n          subscribers_count: 42\n          network_count: 0\n        head_commit:\n          id: 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d\n          tree_id: 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d\n          message: |-\n            Merge pull request #6 from Spaceghost/patch-1\n\n            New line at end of file.\n          timestamp: '2016-10-10T00:00:00Z'\n          author:\n            name: The Octocat\n            email: octocat@nowhere.com\n          committer:\n            name: The Octocat\n            email: octocat@nowhere.com\n        latest_check_runs_count: 1\n        check_runs_url: https://api.github.com/repos/octocat/Hello-World/check-suites/5/check-runs\n    check-suite-preference:\n      value:\n        preferences:\n          auto_trigger_checks:\n          - app_id: 2\n            setting: true\n          - app_id: 4\n            setting: false\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: false\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          template_repository:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World-Template\n            full_name: octocat/Hello-World-Template\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World-Template\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World-Template\n            archive_url: https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World-Template/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World-Template/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World-Template/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World-Template/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World-Template/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World-Template.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World-Template/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World-Template/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World-Template.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World-Template/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World-Template/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World-Template/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World-Template/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World-Template/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World-Template.git\n            mirror_url: git:git.example.com/octocat/Hello-World-Template\n            hooks_url: https://api.github.com/repos/octocat/Hello-World-Template/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World-Template\n            homepage: https://github.com\n            forks: 9\n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            watchers: 80\n            size: 108\n            default_branch: master\n            open_issues: 0\n            open_issues_count: 0\n            is_template: true\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n              html_url: https://api.github.com/licenses/mit\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            visibility: public\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            delete_branch_on_merge: true\n            allow_merge_commit: true\n            subscribers_count: 42\n            network_count: 0\n    check-run-paginated:\n      value:\n        total_count: 1\n        check_runs:\n        - id: 4\n          head_sha: ce587453ced02b1526dfb4cb910479d431683101\n          node_id: MDg6Q2hlY2tSdW40\n          external_id: ''\n          url: https://api.github.com/repos/github/hello-world/check-runs/4\n          html_url: https://github.com/github/hello-world/runs/4\n          details_url: https://example.com\n          status: completed\n          conclusion: neutral\n          started_at: '2018-05-04T01:14:52Z'\n          completed_at: '2018-05-04T01:14:52Z'\n          output:\n            title: Mighty Readme report\n            summary: There are 0 failures, 2 warnings, and 1 notice.\n            text: You may have some misspelled words on lines 2 and 4. You also may\n              want to add a section in your README about how to install your app.\n            annotations_count: 2\n            annotations_url: https://api.github.com/repos/github/hello-world/check-runs/4/annotations\n          name: mighty_readme\n          check_suite:\n            id: 5\n          app:\n            id: 1\n            slug: octoapp\n            node_id: MDExOkludGVncmF0aW9uMQ==\n            owner:\n              login: github\n              id: 1\n              node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n              url: https://api.github.com/orgs/github\n              repos_url: https://api.github.com/orgs/github/repos\n              events_url: https://api.github.com/orgs/github/events\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: true\n            name: Octocat App\n            description: ''\n            external_url: https://example.com\n            html_url: https://github.com/apps/octoapp\n            created_at: '2017-07-08T16:18:44-04:00'\n            updated_at: '2017-07-08T16:18:44-04:00'\n            permissions:\n              metadata: read\n              contents: read\n              issues: write\n              single_file: write\n            events:\n            - push\n            - pull_request\n          pull_requests:\n          - url: https://api.github.com/repos/github/hello-world/pulls/1\n            id: 1934\n            number: 3956\n            head:\n              ref: say-hello\n              sha: 3dca65fa3e8d4b3da3f3d056c59aee1c50f41390\n              repo:\n                id: 526\n                url: https://api.github.com/repos/github/hello-world\n                name: hello-world\n            base:\n              ref: master\n              sha: e7fdf7640066d71ad16a86fbcbb9c6a10a18af4f\n              repo:\n                id: 526\n                url: https://api.github.com/repos/github/hello-world\n                name: hello-world\n    code-scanning-alert-items:\n      value:\n      - number: 4\n        created_at: '2020-02-13T12:29:18Z'\n        url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/4\n        html_url: https://github.com/octocat/hello-world/code-scanning/4\n        state: open\n        dismissed_by: \n        dismissed_at: \n        dismissed_reason: \n        rule:\n          id: js/zipslip\n          severity: error\n          description: Arbitrary file write during zip extraction\n          name: js/zipslip\n        tool:\n          name: CodeQL\n          guid: \n          version: 2.4.0\n        most_recent_instance:\n          ref: refs/heads/main\n          analysis_key: \".github/workflows/codeql-analysis.yml:CodeQL-Build\"\n          environment: \"{}\"\n          state: open\n          commit_sha: 39406e42cb832f683daa691dd652a8dc36ee8930\n          message:\n            text: This path depends on a user-provided value.\n          location:\n            path: spec-main/api-session-spec.ts\n            start_line: 917\n            end_line: 917\n            start_column: 7\n            end_column: 18\n          classifications:\n          - test\n        instances_url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/4/instances\n      - number: 3\n        created_at: '2020-02-13T12:29:18Z'\n        url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/3\n        html_url: https://github.com/octocat/hello-world/code-scanning/3\n        state: dismissed\n        dismissed_by:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        dismissed_at: '2020-02-14T12:29:18Z'\n        dismissed_reason: false positive\n        rule:\n          id: js/zipslip\n          severity: error\n          description: Arbitrary file write during zip extraction\n          name: js/zipslip\n        tool:\n          name: CodeQL\n          guid: \n          version: 2.4.0\n        most_recent_instance:\n          ref: refs/heads/main\n          analysis_key: \".github/workflows/codeql-analysis.yml:CodeQL-Build\"\n          environment: \"{}\"\n          state: open\n          commit_sha: 39406e42cb832f683daa691dd652a8dc36ee8930\n          message:\n            text: This path depends on a user-provided value.\n          location:\n            path: lib/ab12-gen.js\n            start_line: 917\n            end_line: 917\n            start_column: 7\n            end_column: 18\n          classifications: []\n        instances_url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/3/instances\n    code-scanning-alert:\n      value:\n        number: 42\n        created_at: '2020-06-19T11:21:34Z'\n        url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42\n        html_url: https://github.com/octocat/hello-world/code-scanning/42\n        state: dismissed\n        dismissed_by:\n          login: octocat\n          id: 54933897\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        dismissed_at: '2020-02-14T12:29:18Z'\n        dismissed_reason: false positive\n        rule:\n          id: js/zipslip\n          severity: error\n          description: Arbitrary file write during zip extraction (\"Zip Slip\")\n          name: js/zipslip\n          full_description: Extracting files from a malicious zip archive without\n            validating that the destination file path is within the destination directory\n            can cause files outside the destination directory to be overwritten.\n          tags:\n          - security\n          - external/cwe/cwe-022\n          help: '# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting\n            files from a malicious zip archive without validating that the destination\n            file path is within the destination directory can cause files outside\n            the destination directory to be overwritten ...'\n        tool:\n          name: CodeQL\n          guid: \n          version: 2.4.0\n        most_recent_instance:\n          ref: refs/heads/main\n          analysis_key: \".github/workflows/codeql-analysis.yml:CodeQL-Build\"\n          environment: \"{}\"\n          state: dismissed\n          commit_sha: 39406e42cb832f683daa691dd652a8dc36ee8930\n          message:\n            text: This path depends on a user-provided value.\n          location:\n            path: spec-main/api-session-spec.ts\n            start_line: 917\n            end_line: 917\n            start_column: 7\n            end_column: 18\n          classifications:\n          - test\n        instances_url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances\n    code-scanning-alert-dismissed:\n      value:\n        number: 42\n        created_at: '2020-08-25T21:28:36Z'\n        url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42\n        html_url: https://github.com/octocat/hello-world/code-scanning/42\n        state: dismissed\n        dismissed_by:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        dismissed_at: '2020-09-02T22:34:56Z'\n        dismissed_reason: false positive\n        rule:\n          id: js/zipslip\n          severity: error\n          description: Arbitrary file write during zip extraction (\"Zip Slip\")\n          name: js/zipslip\n          full_description: Extracting files from a malicious zip archive without\n            validating that the destination file path is within the destination directory\n            can cause files outside the destination directory to be overwritten.\n          tags:\n          - security\n          - external/cwe/cwe-022\n          help: '# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting\n            files from a malicious zip archive without validating that the destination\n            file path is within the destination directory can cause files outside\n            the destination directory to be overwritten ...'\n        tool:\n          name: CodeQL\n          guid: \n          version: 2.4.0\n        most_recent_instance:\n          ref: refs/heads/main\n          analysis_key: \".github/workflows/codeql-analysis.yml:CodeQL-Build\"\n          environment: \"{}\"\n          state: dismissed\n          commit_sha: 39406e42cb832f683daa691dd652a8dc36ee8930\n          message:\n            text: This path depends on a user-provided value.\n          location:\n            path: spec-main/api-session-spec.ts\n            start_line: 917\n            end_line: 917\n            start_column: 7\n            end_column: 18\n          classifications:\n          - test\n        instances_url: https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/42/instances\n    code-scanning-analysis-items:\n      value:\n      - ref: refs/heads/main\n        commit_sha: d99612c3e1f2970085cfbaeadf8f010ef69bad83\n        analysis_key: \".github/workflows/codeql-analysis.yml:analyze\"\n        environment: '{\"language\":\"python\"}'\n        error: ''\n        category: \".github/workflows/codeql-analysis.yml:analyze/language:python\"\n        created_at: '2020-08-27T15:05:21Z'\n        results_count: 17\n        rules_count: 49\n        id: 201\n        url: https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/201\n        sarif_id: 6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53\n        tool:\n          name: CodeQL\n          guid: \n          version: 2.4.0\n        deletable: true\n        warning: ''\n      - ref: refs/heads/my-branch\n        commit_sha: c8cff6510d4d084fb1b4aa13b64b97ca12b07321\n        analysis_key: \".github/workflows/shiftleft.yml:build\"\n        environment: \"{}\"\n        error: ''\n        category: \".github/workflows/shiftleft.yml:build/\"\n        created_at: '2020-08-31T22:46:44Z'\n        results_count: 17\n        rules_count: 32\n        id: 200\n        url: https://api.github.com/repos/octocat/hello-world/code-scanning/analyses/200\n        sarif_id: 8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\n        tool:\n          name: Python Security Analysis\n          guid: \n          version: 1.2.0\n        deletable: true\n        warning: ''\n    code-scanning-sarif-upload:\n      summary: Default response\n      value:\n        id: 47177e22-5596-11eb-80a1-c1e54ef945c6\n        url: https://api.github.com/repos/octocat/hello-world/code-scanning/sarifs/47177e22-5596-11eb-80a1-c1e54ef945c6\n    collaborator-items:\n      value:\n      - login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n        permissions:\n          pull: true\n          push: true\n          admin: false\n    repository-invitation-response-when-a-new-invitation-is-created:\n      value:\n        id: 1\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n        invitee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        inviter:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        permissions: write\n        created_at: '2016-06-13T14:52:50-05:00'\n        url: https://api.github.com/user/repository_invitations/1296269\n        html_url: https://github.com/octocat/Hello-World/invitations\n    repository-collaborator-permission-response-if-user-has-admin-permissions:\n      value:\n        permission: admin\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    commit-comment-items:\n      value:\n      - html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e#commitcomment-1\n        url: https://api.github.com/repos/octocat/Hello-World/comments/1\n        id: 1\n        node_id: MDEzOkNvbW1pdENvbW1lbnQx\n        body: Great stuff\n        path: file1.txt\n        position: 4\n        line: 14\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n        author_association: COLLABORATOR\n    commit-comment:\n      value:\n        html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e#commitcomment-1\n        url: https://api.github.com/repos/octocat/Hello-World/comments/1\n        id: 1\n        node_id: MDEzOkNvbW1pdENvbW1lbnQx\n        body: Great stuff\n        path: file1.txt\n        position: 4\n        line: 14\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        author_association: COLLABORATOR\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n    commit-comment-2:\n      value:\n        html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e#commitcomment-1\n        url: https://api.github.com/repos/octocat/Hello-World/comments/1\n        id: 1\n        node_id: MDEzOkNvbW1pdENvbW1lbnQx\n        body: Nice change\n        path: file1.txt\n        position: 4\n        line: 14\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        author_association: COLLABORATOR\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n    commit-items:\n      value:\n      - url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        node_id: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\n        html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        comments_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\n        commit:\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          author:\n            name: Monalisa Octocat\n            email: support@github.com\n            date: '2011-04-14T16:00:49Z'\n          committer:\n            name: Monalisa Octocat\n            email: support@github.com\n            date: '2011-04-14T16:00:49Z'\n          message: Fix all the bugs\n          tree:\n            url: https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          comment_count: 0\n          verification:\n            verified: false\n            reason: unsigned\n            signature: \n            payload: \n        author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        committer:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        parents:\n        - url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n    branch-short-items:\n      value:\n      - name: branch_5\n        commit:\n          sha: c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\n          url: https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\n        protected: false\n    pull-request-simple-items:\n      value:\n      - url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n        id: 1\n        node_id: MDExOlB1bGxSZXF1ZXN0MQ==\n        html_url: https://github.com/octocat/Hello-World/pull/1347\n        diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n        patch_url: https://github.com/octocat/Hello-World/pull/1347.patch\n        issue_url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n        commits_url: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\n        review_comments_url: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\n        review_comment_url: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        number: 1347\n        state: open\n        locked: true\n        title: Amazing new feature\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Please pull these awesome changes in!\n        labels:\n        - id: 208045946\n          node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n          url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n          name: bug\n          description: Something isn't working\n          color: f29513\n          default: true\n        milestone:\n          url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n          html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n          labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n          id: 1002604\n          node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n          number: 1\n          state: open\n          title: v1.0\n          description: Tracking milestone for version 1.0\n          creator:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          open_issues: 4\n          closed_issues: 8\n          created_at: '2011-04-10T20:09:31Z'\n          updated_at: '2014-03-03T18:58:10Z'\n          closed_at: '2013-02-12T13:22:01Z'\n          due_on: '2012-10-09T23:39:01Z'\n        active_lock_reason: too heated\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:01:12Z'\n        closed_at: '2011-01-26T19:01:12Z'\n        merged_at: '2011-01-26T19:01:12Z'\n        merge_commit_sha: e5bd3914e2e596debea16f433f57875b5b90bcd6\n        assignee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        assignees:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        - login: hubot\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/hubot_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/hubot\n          html_url: https://github.com/hubot\n          followers_url: https://api.github.com/users/hubot/followers\n          following_url: https://api.github.com/users/hubot/following{/other_user}\n          gists_url: https://api.github.com/users/hubot/gists{/gist_id}\n          starred_url: https://api.github.com/users/hubot/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/hubot/subscriptions\n          organizations_url: https://api.github.com/users/hubot/orgs\n          repos_url: https://api.github.com/users/hubot/repos\n          events_url: https://api.github.com/users/hubot/events{/privacy}\n          received_events_url: https://api.github.com/users/hubot/received_events\n          type: User\n          site_admin: true\n        requested_reviewers:\n        - login: other_user\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/other_user_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/other_user\n          html_url: https://github.com/other_user\n          followers_url: https://api.github.com/users/other_user/followers\n          following_url: https://api.github.com/users/other_user/following{/other_user}\n          gists_url: https://api.github.com/users/other_user/gists{/gist_id}\n          starred_url: https://api.github.com/users/other_user/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/other_user/subscriptions\n          organizations_url: https://api.github.com/users/other_user/orgs\n          repos_url: https://api.github.com/users/other_user/repos\n          events_url: https://api.github.com/users/other_user/events{/privacy}\n          received_events_url: https://api.github.com/users/other_user/received_events\n          type: User\n          site_admin: false\n        requested_teams:\n        - id: 1\n          node_id: MDQ6VGVhbTE=\n          url: https://api.github.com/teams/1\n          html_url: https://github.com/orgs/github/teams/justice-league\n          name: Justice League\n          slug: justice-league\n          description: A great team.\n          privacy: closed\n          permission: admin\n          members_url: https://api.github.com/teams/1/members{/member}\n          repositories_url: https://api.github.com/teams/1/repos\n        head:\n          label: octocat:new-topic\n          ref: new-topic\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          user:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          repo:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World.git\n            mirror_url: git:git.example.com/octocat/Hello-World\n            hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World\n            homepage: https://github.com\n            language: \n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            size: 108\n            default_branch: master\n            open_issues_count: 0\n            is_template: true\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            visibility: public\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            template_repository: \n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            delete_branch_on_merge: true\n            allow_merge_commit: true\n            subscribers_count: 42\n            network_count: 0\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n              html_url: https://github.com/licenses/mit\n            forks: 1\n            open_issues: 1\n            watchers: 1\n        base:\n          label: octocat:master\n          ref: master\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          user:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          repo:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World.git\n            mirror_url: git:git.example.com/octocat/Hello-World\n            hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World\n            homepage: https://github.com\n            language: \n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            size: 108\n            default_branch: master\n            open_issues_count: 0\n            is_template: true\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            visibility: public\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            template_repository: \n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            delete_branch_on_merge: true\n            allow_merge_commit: true\n            subscribers_count: 42\n            network_count: 0\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n              html_url: https://github.com/licenses/mit\n            forks: 1\n            open_issues: 1\n            watchers: 1\n        _links:\n          self:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n          html:\n            href: https://github.com/octocat/Hello-World/pull/1347\n          issue:\n            href: https://api.github.com/repos/octocat/Hello-World/issues/1347\n          comments:\n            href: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n          review_comments:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\n          review_comment:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\n          commits:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\n          statuses:\n            href: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        author_association: OWNER\n        draft: false\n    commit:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        node_id: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\n        html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        comments_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\n        commit:\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          author:\n            name: Monalisa Octocat\n            email: mona@github.com\n            date: '2011-04-14T16:00:49Z'\n          committer:\n            name: Monalisa Octocat\n            email: mona@github.com\n            date: '2011-04-14T16:00:49Z'\n          message: Fix all the bugs\n          tree:\n            url: https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          comment_count: 0\n          verification:\n            verified: false\n            reason: unsigned\n            signature: \n            payload: \n        author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        committer:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        parents:\n        - url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        stats:\n          additions: 104\n          deletions: 4\n          total: 108\n        files:\n        - filename: file1.txt\n          additions: 10\n          deletions: 2\n          changes: 12\n          status: modified\n          raw_url: https://github.com/octocat/Hello-World/raw/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt\n          blob_url: https://github.com/octocat/Hello-World/blob/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt\n          patch: |-\n            @@ -29,7 +29,7 @@\n            .....\n    check-suite-paginated:\n      value:\n        total_count: 1\n        check_suites:\n        - id: 5\n          node_id: MDEwOkNoZWNrU3VpdGU1\n          head_branch: master\n          head_sha: d6fde92930d4715a2b49857d24b940956b26d2d3\n          status: completed\n          conclusion: neutral\n          url: https://api.github.com/repos/github/hello-world/check-suites/5\n          before: 146e867f55c26428e5f9fade55a9bbf5e95a7912\n          after: d6fde92930d4715a2b49857d24b940956b26d2d3\n          pull_requests: []\n          app:\n            id: 1\n            slug: octoapp\n            node_id: MDExOkludGVncmF0aW9uMQ==\n            owner:\n              login: github\n              id: 1\n              node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n              url: https://api.github.com/orgs/github\n              repos_url: https://api.github.com/orgs/github/repos\n              events_url: https://api.github.com/orgs/github/events\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: true\n            name: Octocat App\n            description: ''\n            external_url: https://example.com\n            html_url: https://github.com/apps/octoapp\n            created_at: '2017-07-08T16:18:44-04:00'\n            updated_at: '2017-07-08T16:18:44-04:00'\n            permissions:\n              metadata: read\n              contents: read\n              issues: write\n              single_file: write\n            events:\n            - push\n            - pull_request\n          repository:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World.git\n            mirror_url: git:git.example.com/octocat/Hello-World\n            hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World\n            homepage: https://github.com\n            language: \n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            size: 108\n            default_branch: master\n            open_issues_count: 0\n            is_template: true\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            visibility: public\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            delete_branch_on_merge: true\n            subscribers_count: 42\n            network_count: 0\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          head_commit:\n            id: 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d\n            tree_id: 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d\n            message: |-\n              Merge pull request #6 from Spaceghost/patch-1\n\n              New line at end of file.\n            timestamp: '2016-10-10T00:00:00Z'\n            author:\n              name: The Octocat\n              email: octocat@nowhere.com\n            committer:\n              name: The Octocat\n              email: octocat@nowhere.com\n          latest_check_runs_count: 1\n          check_runs_url: https://api.github.com/repos/octocat/Hello-World/check-suites/5/check-runs\n    combined-commit-status:\n      value:\n        state: success\n        statuses:\n        - url: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          avatar_url: https://github.com/images/error/hubot_happy.gif\n          id: 1\n          node_id: MDY6U3RhdHVzMQ==\n          state: success\n          description: Build has completed successfully\n          target_url: https://ci.example.com/1000/output\n          context: continuous-integration/jenkins\n          created_at: '2012-07-20T01:19:13Z'\n          updated_at: '2012-07-20T01:19:13Z'\n        - url: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          avatar_url: https://github.com/images/error/other_user_happy.gif\n          id: 2\n          node_id: MDY6U3RhdHVzMg==\n          state: success\n          description: Testing has completed successfully\n          target_url: https://ci.example.com/2000/output\n          context: security/brakeman\n          created_at: '2012-08-20T01:19:13Z'\n          updated_at: '2012-08-20T01:19:13Z'\n        sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        total_count: 2\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n        commit_url: https://api.github.com/repos/octocat/Hello-World/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        url: https://api.github.com/repos/octocat/Hello-World/6dcb09b5b57875f334f61aebed695e2e4193db5e/status\n    status-items:\n      value:\n      - url: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        avatar_url: https://github.com/images/error/hubot_happy.gif\n        id: 1\n        node_id: MDY6U3RhdHVzMQ==\n        state: success\n        description: Build has completed successfully\n        target_url: https://ci.example.com/1000/output\n        context: continuous-integration/jenkins\n        created_at: '2012-07-20T01:19:13Z'\n        updated_at: '2012-07-20T01:19:13Z'\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    commit-comparison:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/compare/master...topic\n        html_url: https://github.com/octocat/Hello-World/compare/master...topic\n        permalink_url: https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17\n        diff_url: https://github.com/octocat/Hello-World/compare/master...topic.diff\n        patch_url: https://github.com/octocat/Hello-World/compare/master...topic.patch\n        base_commit:\n          url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          node_id: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\n          html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          comments_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\n          commit:\n            url: https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            author:\n              name: Monalisa Octocat\n              email: mona@github.com\n              date: '2011-04-14T16:00:49Z'\n            committer:\n              name: Monalisa Octocat\n              email: mona@github.com\n              date: '2011-04-14T16:00:49Z'\n            message: Fix all the bugs\n            tree:\n              url: https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\n              sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n            comment_count: 0\n            verification:\n              verified: false\n              reason: unsigned\n              signature: \n              payload: \n          author:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          committer:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          parents:\n          - url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        merge_base_commit:\n          url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          node_id: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\n          html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          comments_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\n          commit:\n            url: https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            author:\n              name: Monalisa Octocat\n              email: mona@github.com\n              date: '2011-04-14T16:00:49Z'\n            committer:\n              name: Monalisa Octocat\n              email: mona@github.com\n              date: '2011-04-14T16:00:49Z'\n            message: Fix all the bugs\n            tree:\n              url: https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\n              sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n            comment_count: 0\n            verification:\n              verified: false\n              reason: unsigned\n              signature: \n              payload: \n          author:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          committer:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          parents:\n          - url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        status: behind\n        ahead_by: 1\n        behind_by: 2\n        total_commits: 1\n        commits:\n        - url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          node_id: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\n          html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e\n          comments_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments\n          commit:\n            url: https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            author:\n              name: Monalisa Octocat\n              email: mona@github.com\n              date: '2011-04-14T16:00:49Z'\n            committer:\n              name: Monalisa Octocat\n              email: mona@github.com\n              date: '2011-04-14T16:00:49Z'\n            message: Fix all the bugs\n            tree:\n              url: https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e\n              sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n            comment_count: 0\n            verification:\n              verified: false\n              reason: unsigned\n              signature: \n              payload: \n          author:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          committer:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          parents:\n          - url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n            sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        files:\n        - sha: bbcd538c8e72b8c175046e27cc8f907076331401\n          filename: file1.txt\n          status: added\n          additions: 103\n          deletions: 21\n          changes: 124\n          blob_url: https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\n          raw_url: https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e\n          patch: \"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"\n    content-reference-attachment:\n      value:\n        id: 101\n        title: \"[A-1234] Error found in core/models.py file'\"\n        body: |-\n          You have used an email that already exists for the user_email_uniq field.\n           ## DETAILS:\n\n          The (email)=(Octocat@github.com) already exists.\n\n           The error was found in core/models.py in get_or_create_user at line 62.\n\n           self.save()\n    content-file-response-if-content-is-a-file:\n      summary: Response if content is a file\n      value:\n        type: file\n        encoding: base64\n        size: 5362\n        name: README.md\n        path: README.md\n        content: encoded content ...\n        sha: 3d21ec53a331a6f037a91c368710b99387d012c1\n        url: https://api.github.com/repos/octokit/octokit.rb/contents/README.md\n        git_url: https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1\n        html_url: https://github.com/octokit/octokit.rb/blob/master/README.md\n        download_url: https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md\n        _links:\n          git: https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1\n          self: https://api.github.com/repos/octokit/octokit.rb/contents/README.md\n          html: https://github.com/octokit/octokit.rb/blob/master/README.md\n    content-file-response-if-content-is-a-directory:\n      summary: Response if content is a directory\n      value:\n      - type: file\n        size: 625\n        name: octokit.rb\n        path: lib/octokit.rb\n        sha: fff6fe3a23bf1c8ea0692b4a883af99bee26fd3b\n        url: https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit.rb\n        git_url: https://api.github.com/repos/octokit/octokit.rb/git/blobs/fff6fe3a23bf1c8ea0692b4a883af99bee26fd3b\n        html_url: https://github.com/octokit/octokit.rb/blob/master/lib/octokit.rb\n        download_url: https://raw.githubusercontent.com/octokit/octokit.rb/master/lib/octokit.rb\n        _links:\n          self: https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit.rb\n          git: https://api.github.com/repos/octokit/octokit.rb/git/blobs/fff6fe3a23bf1c8ea0692b4a883af99bee26fd3b\n          html: https://github.com/octokit/octokit.rb/blob/master/lib/octokit.rb\n      - type: dir\n        size: 0\n        name: octokit\n        path: lib/octokit\n        sha: a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\n        url: https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit\n        git_url: https://api.github.com/repos/octokit/octokit.rb/git/trees/a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\n        html_url: https://github.com/octokit/octokit.rb/tree/master/lib/octokit\n        download_url: \n        _links:\n          self: https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit\n          git: https://api.github.com/repos/octokit/octokit.rb/git/trees/a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\n          html: https://github.com/octokit/octokit.rb/tree/master/lib/octokit\n    content-file-response-if-content-is-a-symlink:\n      summary: Response if content is a symlink\n      value:\n        type: symlink\n        target: \"/path/to/symlink/target\"\n        size: 23\n        name: some-symlink\n        path: bin/some-symlink\n        sha: 452a98979c88e093d682cab404a3ec82babebb48\n        url: https://api.github.com/repos/octokit/octokit.rb/contents/bin/some-symlink\n        git_url: https://api.github.com/repos/octokit/octokit.rb/git/blobs/452a98979c88e093d682cab404a3ec82babebb48\n        html_url: https://github.com/octokit/octokit.rb/blob/master/bin/some-symlink\n        download_url: https://raw.githubusercontent.com/octokit/octokit.rb/master/bin/some-symlink\n        _links:\n          git: https://api.github.com/repos/octokit/octokit.rb/git/blobs/452a98979c88e093d682cab404a3ec82babebb48\n          self: https://api.github.com/repos/octokit/octokit.rb/contents/bin/some-symlink\n          html: https://github.com/octokit/octokit.rb/blob/master/bin/some-symlink\n    content-file-response-if-content-is-a-submodule:\n      summary: Response if content is a submodule\n      value:\n        type: submodule\n        submodule_git_url: git://github.com/jquery/qunit.git\n        size: 0\n        name: qunit\n        path: test/qunit\n        sha: 6ca3721222109997540bd6d9ccd396902e0ad2f9\n        url: https://api.github.com/repos/jquery/jquery/contents/test/qunit?ref=master\n        git_url: https://api.github.com/repos/jquery/qunit/git/trees/6ca3721222109997540bd6d9ccd396902e0ad2f9\n        html_url: https://github.com/jquery/qunit/tree/6ca3721222109997540bd6d9ccd396902e0ad2f9\n        download_url: \n        _links:\n          git: https://api.github.com/repos/jquery/qunit/git/trees/6ca3721222109997540bd6d9ccd396902e0ad2f9\n          self: https://api.github.com/repos/jquery/jquery/contents/test/qunit?ref=master\n          html: https://github.com/jquery/qunit/tree/6ca3721222109997540bd6d9ccd396902e0ad2f9\n    file-commit-example-for-updating-a-file:\n      value:\n        content:\n          name: hello.txt\n          path: notes/hello.txt\n          sha: a56507ed892d05a37c6d6128c260937ea4d287bd\n          size: 9\n          url: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt\n          html_url: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt\n          git_url: https://api.github.com/repos/octocat/Hello-World/git/blobs/a56507ed892d05a37c6d6128c260937ea4d287bd\n          download_url: https://raw.githubusercontent.com/octocat/HelloWorld/master/notes/hello.txt\n          type: file\n          _links:\n            self: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt\n            git: https://api.github.com/repos/octocat/Hello-World/git/blobs/a56507ed892d05a37c6d6128c260937ea4d287bd\n            html: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt\n        commit:\n          sha: 18a43cd8e1e3a79c786e3d808a73d23b6d212b16\n          node_id: MDY6Q29tbWl0MThhNDNjZDhlMWUzYTc5Yzc4NmUzZDgwOGE3M2QyM2I2ZDIxMmIxNg==\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/18a43cd8e1e3a79c786e3d808a73d23b6d212b16\n          html_url: https://github.com/octocat/Hello-World/git/commit/18a43cd8e1e3a79c786e3d808a73d23b6d212b16\n          author:\n            date: '2014-11-07T22:01:45Z'\n            name: Monalisa Octocat\n            email: octocat@github.com\n          committer:\n            date: '2014-11-07T22:01:45Z'\n            name: Monalisa Octocat\n            email: octocat@github.com\n          message: my commit message\n          tree:\n            url: https://api.github.com/repos/octocat/Hello-World/git/trees/9a21f8e2018f42ffcf369b24d2cd20bc25c9e66f\n            sha: 9a21f8e2018f42ffcf369b24d2cd20bc25c9e66f\n          parents:\n          - url: https://api.github.com/repos/octocat/Hello-World/git/commits/da5a433788da5c255edad7979b328b67d79f53f6\n            html_url: https://github.com/octocat/Hello-World/git/commit/da5a433788da5c255edad7979b328b67d79f53f6\n            sha: da5a433788da5c255edad7979b328b67d79f53f6\n          verification:\n            verified: false\n            reason: unsigned\n            signature: \n            payload: \n    file-commit-example-for-creating-a-file:\n      value:\n        content:\n          name: hello.txt\n          path: notes/hello.txt\n          sha: 95b966ae1c166bd92f8ae7d1c313e738c731dfc3\n          size: 9\n          url: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt\n          html_url: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt\n          git_url: https://api.github.com/repos/octocat/Hello-World/git/blobs/95b966ae1c166bd92f8ae7d1c313e738c731dfc3\n          download_url: https://raw.githubusercontent.com/octocat/HelloWorld/master/notes/hello.txt\n          type: file\n          _links:\n            self: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt\n            git: https://api.github.com/repos/octocat/Hello-World/git/blobs/95b966ae1c166bd92f8ae7d1c313e738c731dfc3\n            html: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt\n        commit:\n          sha: 7638417db6d59f3c431d3e1f261cc637155684cd\n          node_id: MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\n          html_url: https://github.com/octocat/Hello-World/git/commit/7638417db6d59f3c431d3e1f261cc637155684cd\n          author:\n            date: '2014-11-07T22:01:45Z'\n            name: Monalisa Octocat\n            email: octocat@github.com\n          committer:\n            date: '2014-11-07T22:01:45Z'\n            name: Monalisa Octocat\n            email: octocat@github.com\n          message: my commit message\n          tree:\n            url: https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb\n            sha: 691272480426f78a0138979dd3ce63b77f706feb\n          parents:\n          - url: https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5\n            html_url: https://github.com/octocat/Hello-World/git/commit/1acc419d4d6a9ce985db7be48c6349a0475975b5\n            sha: 1acc419d4d6a9ce985db7be48c6349a0475975b5\n          verification:\n            verified: false\n            reason: unsigned\n            signature: \n            payload: \n    file-commit:\n      value:\n        content: \n        commit:\n          sha: 7638417db6d59f3c431d3e1f261cc637155684cd\n          node_id: MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\n          html_url: https://github.com/octocat/Hello-World/git/commit/7638417db6d59f3c431d3e1f261cc637155684cd\n          author:\n            date: '2014-11-07T22:01:45Z'\n            name: Monalisa Octocat\n            email: octocat@github.com\n          committer:\n            date: '2014-11-07T22:01:45Z'\n            name: Monalisa Octocat\n            email: octocat@github.com\n          message: my commit message\n          tree:\n            url: https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb\n            sha: 691272480426f78a0138979dd3ce63b77f706feb\n          parents:\n          - url: https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5\n            html_url: https://github.com/octocat/Hello-World/git/commit/1acc419d4d6a9ce985db7be48c6349a0475975b5\n            sha: 1acc419d4d6a9ce985db7be48c6349a0475975b5\n          verification:\n            verified: false\n            reason: unsigned\n            signature: \n            payload: \n    contributor-items-response-if-repository-contains-content:\n      value:\n      - login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n        contributions: 32\n    deployment-items:\n      value:\n      - url: https://api.github.com/repos/octocat/example/deployments/1\n        id: 1\n        node_id: MDEwOkRlcGxveW1lbnQx\n        sha: a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\n        ref: topic-branch\n        task: deploy\n        payload: {}\n        original_environment: staging\n        environment: production\n        description: Deploy request from hubot\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2012-07-20T01:19:13Z'\n        updated_at: '2012-07-20T01:19:13Z'\n        statuses_url: https://api.github.com/repos/octocat/example/deployments/1/statuses\n        repository_url: https://api.github.com/repos/octocat/example\n        transient_environment: false\n        production_environment: true\n    deployment-simple-example:\n      summary: Simple example\n      value:\n        url: https://api.github.com/repos/octocat/example/deployments/1\n        id: 1\n        node_id: MDEwOkRlcGxveW1lbnQx\n        sha: a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\n        ref: topic-branch\n        task: deploy\n        payload: {}\n        original_environment: staging\n        environment: production\n        description: Deploy request from hubot\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2012-07-20T01:19:13Z'\n        updated_at: '2012-07-20T01:19:13Z'\n        statuses_url: https://api.github.com/repos/octocat/example/deployments/1/statuses\n        repository_url: https://api.github.com/repos/octocat/example\n        transient_environment: false\n        production_environment: true\n    deployment:\n      value:\n        url: https://api.github.com/repos/octocat/example/deployments/1\n        id: 1\n        node_id: MDEwOkRlcGxveW1lbnQx\n        sha: a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d\n        ref: topic-branch\n        task: deploy\n        payload: {}\n        original_environment: staging\n        environment: production\n        description: Deploy request from hubot\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2012-07-20T01:19:13Z'\n        updated_at: '2012-07-20T01:19:13Z'\n        statuses_url: https://api.github.com/repos/octocat/example/deployments/1/statuses\n        repository_url: https://api.github.com/repos/octocat/example\n        transient_environment: false\n        production_environment: true\n    deployment-status-items:\n      value:\n      - url: https://api.github.com/repos/octocat/example/deployments/42/statuses/1\n        id: 1\n        node_id: MDE2OkRlcGxveW1lbnRTdGF0dXMx\n        state: success\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        description: Deployment finished successfully.\n        environment: production\n        target_url: https://example.com/deployment/42/output\n        created_at: '2012-07-20T01:19:13Z'\n        updated_at: '2012-07-20T01:19:13Z'\n        deployment_url: https://api.github.com/repos/octocat/example/deployments/42\n        repository_url: https://api.github.com/repos/octocat/example\n        environment_url: https://test-branch.lab.acme.com\n        log_url: https://example.com/deployment/42/output\n    deployment-status:\n      value:\n        url: https://api.github.com/repos/octocat/example/deployments/42/statuses/1\n        id: 1\n        node_id: MDE2OkRlcGxveW1lbnRTdGF0dXMx\n        state: success\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        description: Deployment finished successfully.\n        environment: production\n        target_url: https://example.com/deployment/42/output\n        created_at: '2012-07-20T01:19:13Z'\n        updated_at: '2012-07-20T01:19:13Z'\n        deployment_url: https://api.github.com/repos/octocat/example/deployments/42\n        repository_url: https://api.github.com/repos/octocat/example\n        environment_url: https://test-branch.lab.acme.com\n        log_url: https://example.com/deployment/42/output\n    minimal-repository-items-2:\n      value:\n      - id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: true\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        language: \n        forks_count: 9\n        stargazers_count: 80\n        watchers_count: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        is_template: true\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          admin: false\n          push: false\n          pull: true\n        temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n        delete_branch_on_merge: true\n        subscribers_count: 42\n        network_count: 0\n        license:\n          key: mit\n          name: MIT License\n          spdx_id: MIT\n          url: https://api.github.com/licenses/mit\n          node_id: MDc6TGljZW5zZW1pdA==\n    short-blob:\n      value:\n        url: https://api.github.com/repos/octocat/example/git/blobs/3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\n        sha: 3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\n    blob:\n      value:\n        content: Q29udGVudCBvZiB0aGUgYmxvYg==\n        encoding: base64\n        url: https://api.github.com/repos/octocat/example/git/blobs/3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\n        sha: 3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15\n        size: 19\n        node_id: Q29udGVudCBvZiB0aGUgYmxvYg==\n    git-commit:\n      value:\n        sha: 7638417db6d59f3c431d3e1f261cc637155684cd\n        node_id: MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==\n        url: https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\n        author:\n          date: '2014-11-07T22:01:45Z'\n          name: Monalisa Octocat\n          email: octocat@github.com\n        committer:\n          date: '2014-11-07T22:01:45Z'\n          name: Monalisa Octocat\n          email: octocat@github.com\n        message: my commit message\n        tree:\n          url: https://api.github.com/repos/octocat/Hello-World/git/trees/827efc6d56897b048c772eb4087f854f46256132\n          sha: 827efc6d56897b048c772eb4087f854f46256132\n        parents:\n        - url: https://api.github.com/repos/octocat/Hello-World/git/commits/7d1b31e74ee336d15cbd21741bc88a537ed063a0\n          sha: 7d1b31e74ee336d15cbd21741bc88a537ed063a0\n          html_url: https://github.com/octocat/Hello-World/commit/7d1b31e74ee336d15cbd21741bc88a537ed063a0\n        verification:\n          verified: false\n          reason: unsigned\n          signature: \n          payload: \n        html_url: https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd\n    git-commit-2:\n      value:\n        sha: 7638417db6d59f3c431d3e1f261cc637155684cd\n        node_id: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==\n        url: https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd\n        html_url: https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd\n        author:\n          date: '2014-11-07T22:01:45Z'\n          name: Monalisa Octocat\n          email: octocat@github.com\n        committer:\n          date: '2014-11-07T22:01:45Z'\n          name: Monalisa Octocat\n          email: octocat@github.com\n        message: added readme, because im a good github citizen\n        tree:\n          url: https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb\n          sha: 691272480426f78a0138979dd3ce63b77f706feb\n        parents:\n        - url: https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5\n          sha: 1acc419d4d6a9ce985db7be48c6349a0475975b5\n          html_url: https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd\n        verification:\n          verified: false\n          reason: unsigned\n          signature: \n          payload: \n    git-ref-items:\n      value:\n      - ref: refs/heads/feature-a\n        node_id: MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlLWE=\n        url: https://api.github.com/repos/octocat/Hello-World/git/refs/heads/feature-a\n        object:\n          type: commit\n          sha: aa218f56b14c9653891f9e74264a383fa43fefbd\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\n      - ref: refs/heads/feature-b\n        node_id: MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlLWI=\n        url: https://api.github.com/repos/octocat/Hello-World/git/refs/heads/feature-b\n        object:\n          type: commit\n          sha: 612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac\n    git-ref:\n      value:\n        ref: refs/heads/featureA\n        node_id: MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlQQ==\n        url: https://api.github.com/repos/octocat/Hello-World/git/refs/heads/featureA\n        object:\n          type: commit\n          sha: aa218f56b14c9653891f9e74264a383fa43fefbd\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\n    git-tag:\n      value:\n        node_id: MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==\n        tag: v0.0.1\n        sha: 940bd336248efae0f9ee5bc7b2d5c985887b16ac\n        url: https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac\n        message: initial version\n        tagger:\n          name: Monalisa Octocat\n          email: octocat@github.com\n          date: '2014-11-07T22:01:45Z'\n        object:\n          type: commit\n          sha: c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c\n          url: https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c\n        verification:\n          verified: false\n          reason: unsigned\n          signature: \n          payload: \n    git-tree:\n      value:\n        sha: cd8274d15fa3ae2ab983129fb037999f264ba9a7\n        url: https://api.github.com/repos/octocat/Hello-World/trees/cd8274d15fa3ae2ab983129fb037999f264ba9a7\n        tree:\n        - path: file.rb\n          mode: '100644'\n          type: blob\n          size: 132\n          sha: 7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\n          url: https://api.github.com/repos/octocat/Hello-World/git/blobs/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\n        truncated: true\n    git-tree-default-response:\n      summary: Default response\n      value:\n        sha: 9fb037999f264ba9a7fc6274d15fa3ae2ab98312\n        url: https://api.github.com/repos/octocat/Hello-World/trees/9fb037999f264ba9a7fc6274d15fa3ae2ab98312\n        tree:\n        - path: file.rb\n          mode: '100644'\n          type: blob\n          size: 30\n          sha: 44b4fc6d56897b048c772eb4087f854f46256132\n          url: https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132\n        - path: subdir\n          mode: '040000'\n          type: tree\n          sha: f484d249c660418515fb01c2b9662073663c242e\n          url: https://api.github.com/repos/octocat/Hello-World/git/blobs/f484d249c660418515fb01c2b9662073663c242e\n        - path: exec_file\n          mode: '100755'\n          type: blob\n          size: 75\n          sha: 45b983be36b73c0788dc9cbcb76cbb80fc7bb057\n          url: https://api.github.com/repos/octocat/Hello-World/git/blobs/45b983be36b73c0788dc9cbcb76cbb80fc7bb057\n        truncated: false\n    git-tree-response-recursively-retrieving-a-tree:\n      summary: Response recursively retrieving a tree\n      value:\n        sha: fc6274d15fa3ae2ab983129fb037999f264ba9a7\n        url: https://api.github.com/repos/octocat/Hello-World/trees/fc6274d15fa3ae2ab983129fb037999f264ba9a7\n        tree:\n        - path: subdir/file.txt\n          mode: '100644'\n          type: blob\n          size: 132\n          sha: 7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\n          url: https://api.github.com/repos/octocat/Hello-World/git/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\n        truncated: false\n    hook-items:\n      value:\n      - type: Repository\n        id: 12345678\n        name: web\n        active: true\n        events:\n        - push\n        - pull_request\n        config:\n          content_type: json\n          insecure_ssl: '0'\n          url: https://example.com/webhook\n        updated_at: '2019-06-03T00:57:16Z'\n        created_at: '2019-06-03T00:57:16Z'\n        url: https://api.github.com/repos/octocat/Hello-World/hooks/12345678\n        test_url: https://api.github.com/repos/octocat/Hello-World/hooks/12345678/test\n        ping_url: https://api.github.com/repos/octocat/Hello-World/hooks/12345678/pings\n        last_response:\n          code: \n          status: unused\n          message: \n    hook:\n      value:\n        type: Repository\n        id: 12345678\n        name: web\n        active: true\n        events:\n        - push\n        - pull_request\n        config:\n          content_type: json\n          insecure_ssl: '0'\n          url: https://example.com/webhook\n        updated_at: '2019-06-03T00:57:16Z'\n        created_at: '2019-06-03T00:57:16Z'\n        url: https://api.github.com/repos/octocat/Hello-World/hooks/12345678\n        test_url: https://api.github.com/repos/octocat/Hello-World/hooks/12345678/test\n        ping_url: https://api.github.com/repos/octocat/Hello-World/hooks/12345678/pings\n        last_response:\n          code: \n          status: unused\n          message: \n    repository-invitation-items:\n      value:\n      - id: 1\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n        invitee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        inviter:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        permissions: write\n        created_at: '2016-06-13T14:52:50-05:00'\n        url: https://api.github.com/user/repository_invitations/1296269\n        html_url: https://github.com/octocat/Hello-World/invitations\n        node_id: MDQ6VXNlcjE=\n    repository-invitation:\n      value:\n        id: 1\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n        invitee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        inviter:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        permissions: write\n        created_at: '2016-06-13T14:52:50-05:00'\n        expired: false\n        url: https://api.github.com/user/repository_invitations/1296269\n        html_url: https://github.com/octocat/Hello-World/invitations\n    issue-items:\n      value:\n      - id: 1\n        node_id: MDU6SXNzdWUx\n        url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n        repository_url: https://api.github.com/repos/octocat/Hello-World\n        labels_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n        events_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/events\n        html_url: https://github.com/octocat/Hello-World/issues/1347\n        number: 1347\n        state: open\n        title: Found a bug\n        body: I'm having a problem with this.\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        labels:\n        - id: 208045946\n          node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n          url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n          name: bug\n          description: Something isn't working\n          color: f29513\n          default: true\n        assignee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        assignees:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        milestone:\n          url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n          html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n          labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n          id: 1002604\n          node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n          number: 1\n          state: open\n          title: v1.0\n          description: Tracking milestone for version 1.0\n          creator:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          open_issues: 4\n          closed_issues: 8\n          created_at: '2011-04-10T20:09:31Z'\n          updated_at: '2014-03-03T18:58:10Z'\n          closed_at: '2013-02-12T13:22:01Z'\n          due_on: '2012-10-09T23:39:01Z'\n        locked: true\n        active_lock_reason: too heated\n        comments: 0\n        pull_request:\n          url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n          html_url: https://github.com/octocat/Hello-World/pull/1347\n          diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n          patch_url: https://github.com/octocat/Hello-World/pull/1347.patch\n        closed_at: \n        created_at: '2011-04-22T13:33:48Z'\n        updated_at: '2011-04-22T13:33:48Z'\n        closed_by:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        author_association: COLLABORATOR\n    issue:\n      value:\n        id: 1\n        node_id: MDU6SXNzdWUx\n        url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n        repository_url: https://api.github.com/repos/octocat/Hello-World\n        labels_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n        events_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/events\n        html_url: https://github.com/octocat/Hello-World/issues/1347\n        number: 1347\n        state: open\n        title: Found a bug\n        body: I'm having a problem with this.\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        labels:\n        - id: 208045946\n          node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n          url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n          name: bug\n          description: Something isn't working\n          color: f29513\n          default: true\n        assignee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        assignees:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        milestone:\n          url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n          html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n          labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n          id: 1002604\n          node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n          number: 1\n          state: open\n          title: v1.0\n          description: Tracking milestone for version 1.0\n          creator:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          open_issues: 4\n          closed_issues: 8\n          created_at: '2011-04-10T20:09:31Z'\n          updated_at: '2014-03-03T18:58:10Z'\n          closed_at: '2013-02-12T13:22:01Z'\n          due_on: '2012-10-09T23:39:01Z'\n        locked: true\n        active_lock_reason: too heated\n        comments: 0\n        pull_request:\n          url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n          html_url: https://github.com/octocat/Hello-World/pull/1347\n          diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n          patch_url: https://github.com/octocat/Hello-World/pull/1347.patch\n        closed_at: \n        created_at: '2011-04-22T13:33:48Z'\n        updated_at: '2011-04-22T13:33:48Z'\n        closed_by:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        author_association: COLLABORATOR\n    issue-comment-items:\n      value:\n      - id: 1\n        node_id: MDEyOklzc3VlQ29tbWVudDE=\n        url: https://api.github.com/repos/octocat/Hello-World/issues/comments/1\n        html_url: https://github.com/octocat/Hello-World/issues/1347#issuecomment-1\n        body: Me too\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n        issue_url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n        author_association: COLLABORATOR\n    issue-comment:\n      value:\n        id: 1\n        node_id: MDEyOklzc3VlQ29tbWVudDE=\n        url: https://api.github.com/repos/octocat/Hello-World/issues/comments/1\n        html_url: https://github.com/octocat/Hello-World/issues/1347#issuecomment-1\n        body: Me too\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n        issue_url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n        author_association: COLLABORATOR\n    issue-event-items:\n      value:\n      - id: 1\n        node_id: MDEwOklzc3VlRXZlbnQx\n        url: https://api.github.com/repos/octocat/Hello-World/issues/events/1\n        actor:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        event: closed\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        commit_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        created_at: '2011-04-14T16:00:49Z'\n        issue:\n          id: 1\n          node_id: MDU6SXNzdWUx\n          url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n          repository_url: https://api.github.com/repos/octocat/Hello-World\n          labels_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n          events_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/events\n          html_url: https://github.com/octocat/Hello-World/issues/1347\n          number: 1347\n          state: open\n          title: Found a bug\n          body: I'm having a problem with this.\n          user:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          labels:\n          - id: 208045946\n            node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n            url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n            name: bug\n            description: Something isn't working\n            color: f29513\n            default: true\n          assignee:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          assignees:\n          - login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          milestone:\n            url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n            html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n            labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n            id: 1002604\n            node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n            number: 1\n            state: open\n            title: v1.0\n            description: Tracking milestone for version 1.0\n            creator:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            open_issues: 4\n            closed_issues: 8\n            created_at: '2011-04-10T20:09:31Z'\n            updated_at: '2014-03-03T18:58:10Z'\n            closed_at: '2013-02-12T13:22:01Z'\n            due_on: '2012-10-09T23:39:01Z'\n          locked: true\n          active_lock_reason: too heated\n          comments: 0\n          pull_request:\n            url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n            html_url: https://github.com/octocat/Hello-World/pull/1347\n            diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n            patch_url: https://github.com/octocat/Hello-World/pull/1347.patch\n          closed_at: \n          created_at: '2011-04-22T13:33:48Z'\n          updated_at: '2011-04-22T13:33:48Z'\n          author_association: COLLABORATOR\n    issue-event:\n      value:\n        id: 1\n        node_id: MDEwOklzc3VlRXZlbnQx\n        url: https://api.github.com/repos/octocat/Hello-World/issues/events/1\n        actor:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        event: closed\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        commit_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        created_at: '2011-04-14T16:00:49Z'\n        issue:\n          id: 1\n          node_id: MDU6SXNzdWUx\n          url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n          repository_url: https://api.github.com/repos/octocat/Hello-World\n          labels_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n          events_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/events\n          html_url: https://github.com/octocat/Hello-World/issues/1347\n          number: 1347\n          state: open\n          title: Found a bug\n          body: I'm having a problem with this.\n          user:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          labels:\n          - id: 208045946\n            node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n            url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n            name: bug\n            description: Something isn't working\n            color: f29513\n            default: true\n          assignee:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          assignees:\n          - login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          milestone:\n            url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n            html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n            labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n            id: 1002604\n            node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n            number: 1\n            state: open\n            title: v1.0\n            description: Tracking milestone for version 1.0\n            creator:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            open_issues: 4\n            closed_issues: 8\n            created_at: '2011-04-10T20:09:31Z'\n            updated_at: '2014-03-03T18:58:10Z'\n            closed_at: '2013-02-12T13:22:01Z'\n            due_on: '2012-10-09T23:39:01Z'\n          locked: true\n          performed_via_github_app:\n            id: 1\n            slug: octoapp\n            node_id: MDExOkludGVncmF0aW9uMQ==\n            owner:\n              login: github\n              id: 1\n              node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n              url: https://api.github.com/orgs/github\n              repos_url: https://api.github.com/orgs/github/repos\n              events_url: https://api.github.com/orgs/github/events\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: true\n            name: Octocat App\n            description: ''\n            external_url: https://example.com\n            html_url: https://github.com/apps/octoapp\n            created_at: '2017-07-08T16:18:44-04:00'\n            updated_at: '2017-07-08T16:18:44-04:00'\n            permissions:\n              metadata: read\n              contents: read\n              issues: write\n              single_file: write\n            events:\n            - push\n            - pull_request\n          comments: 0\n          pull_request:\n            url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n            html_url: https://github.com/octocat/Hello-World/pull/1347\n            diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n            patch_url: https://github.com/octocat/Hello-World/pull/1347.patch\n          closed_at: \n          created_at: '2011-04-22T13:33:48Z'\n          updated_at: '2011-04-22T13:33:48Z'\n          author_association: COLLABORATOR\n    issue-event-for-issue-items:\n      value:\n      - id: 1\n        node_id: MDEwOklzc3VlRXZlbnQx\n        url: https://api.github.com/repos/octocat/Hello-World/issues/events/1\n        actor:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        event: closed\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        commit_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        created_at: '2011-04-14T16:00:49Z'\n        performed_via_github_app: \n        label:\n          name: label\n          color: red\n    label-items:\n      value:\n      - id: 208045946\n        node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n        url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n        name: bug\n        description: Something isn't working\n        color: f29513\n        default: true\n      - id: 208045947\n        node_id: MDU6TGFiZWwyMDgwNDU5NDc=\n        url: https://api.github.com/repos/octocat/Hello-World/labels/enhancement\n        name: enhancement\n        description: New feature or request\n        color: a2eeef\n        default: false\n    label-items-2:\n      value:\n      - id: 208045946\n        node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n        url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n        name: bug\n        description: Something isn't working\n        color: f29513\n        default: true\n    deploy-key-items:\n      value:\n      - id: 1\n        key: ssh-rsa AAA...\n        url: https://api.github.com/repos/octocat/Hello-World/keys/1\n        title: octocat@octomac\n        verified: true\n        created_at: '2014-12-10T15:53:42Z'\n        read_only: true\n    deploy-key:\n      value:\n        id: 1\n        key: ssh-rsa AAA...\n        url: https://api.github.com/repos/octocat/Hello-World/keys/1\n        title: octocat@octomac\n        verified: true\n        created_at: '2014-12-10T15:53:42Z'\n        read_only: true\n    label:\n      value:\n        id: 208045946\n        node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n        url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n        name: bug\n        description: Something isn't working\n        color: f29513\n        default: true\n    label-2:\n      value:\n        id: 208045946\n        node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n        url: 'https://api.github.com/repos/octocat/Hello-World/labels/bug%20:bug:'\n        name: 'bug :bug:'\n        description: Small bug fix required\n        color: b01f26\n        default: true\n    language:\n      value:\n        C: 78769\n        Python: 7769\n    license-content:\n      value:\n        name: LICENSE\n        path: LICENSE\n        sha: 401c59dcc4570b954dd6d345e76199e1f4e76266\n        size: 1077\n        url: https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=master\n        html_url: https://github.com/benbalter/gman/blob/master/LICENSE\n        git_url: https://api.github.com/repos/benbalter/gman/git/blobs/401c59dcc4570b954dd6d345e76199e1f4e76266\n        download_url: https://raw.githubusercontent.com/benbalter/gman/master/LICENSE?lab=true\n        type: file\n        content: |\n          VGhlIE1JVCBMaWNlbnNlIChNSVQpCgpDb3B5cmlnaHQgKGMpIDIwMTMgQmVu\n          IEJhbHRlcgoKUGVybWlzc2lvbiBpcyBoZXJlYnkgZ3JhbnRlZCwgZnJlZSBv\n          ZiBjaGFyZ2UsIHRvIGFueSBwZXJzb24gb2J0YWluaW5nIGEgY29weSBvZgp0\n          aGlzIHNvZnR3YXJlIGFuZCBhc3NvY2lhdGVkIGRvY3VtZW50YXRpb24gZmls\n          ZXMgKHRoZSAiU29mdHdhcmUiKSwgdG8gZGVhbCBpbgp0aGUgU29mdHdhcmUg\n          d2l0aG91dCByZXN0cmljdGlvbiwgaW5jbHVkaW5nIHdpdGhvdXQgbGltaXRh\n          dGlvbiB0aGUgcmlnaHRzIHRvCnVzZSwgY29weSwgbW9kaWZ5LCBtZXJnZSwg\n          cHVibGlzaCwgZGlzdHJpYnV0ZSwgc3VibGljZW5zZSwgYW5kL29yIHNlbGwg\n          Y29waWVzIG9mCnRoZSBTb2Z0d2FyZSwgYW5kIHRvIHBlcm1pdCBwZXJzb25z\n          IHRvIHdob20gdGhlIFNvZnR3YXJlIGlzIGZ1cm5pc2hlZCB0byBkbyBzbywK\n          c3ViamVjdCB0byB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnM6CgpUaGUgYWJv\n          dmUgY29weXJpZ2h0IG5vdGljZSBhbmQgdGhpcyBwZXJtaXNzaW9uIG5vdGlj\n          ZSBzaGFsbCBiZSBpbmNsdWRlZCBpbiBhbGwKY29waWVzIG9yIHN1YnN0YW50\n          aWFsIHBvcnRpb25zIG9mIHRoZSBTb2Z0d2FyZS4KClRIRSBTT0ZUV0FSRSBJ\n          UyBQUk9WSURFRCAiQVMgSVMiLCBXSVRIT1VUIFdBUlJBTlRZIE9GIEFOWSBL\n          SU5ELCBFWFBSRVNTIE9SCklNUExJRUQsIElOQ0xVRElORyBCVVQgTk9UIExJ\n          TUlURUQgVE8gVEhFIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZLCBG\n          SVRORVNTCkZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSBBTkQgTk9OSU5GUklO\n          R0VNRU5ULiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUgQVVUSE9SUyBPUgpDT1BZ\n          UklHSFQgSE9MREVSUyBCRSBMSUFCTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdF\n          UyBPUiBPVEhFUiBMSUFCSUxJVFksIFdIRVRIRVIKSU4gQU4gQUNUSU9OIE9G\n          IENPTlRSQUNULCBUT1JUIE9SIE9USEVSV0lTRSwgQVJJU0lORyBGUk9NLCBP\n          VVQgT0YgT1IgSU4KQ09OTkVDVElPTiBXSVRIIFRIRSBTT0ZUV0FSRSBPUiBU\n          SEUgVVNFIE9SIE9USEVSIERFQUxJTkdTIElOIFRIRSBTT0ZUV0FSRS4K\n        encoding: base64\n        _links:\n          self: https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=master\n          git: https://api.github.com/repos/benbalter/gman/git/blobs/401c59dcc4570b954dd6d345e76199e1f4e76266\n          html: https://github.com/benbalter/gman/blob/master/LICENSE\n        license:\n          key: mit\n          name: MIT License\n          spdx_id: MIT\n          url: https://api.github.com/licenses/mit\n          node_id: MDc6TGljZW5zZW1pdA==\n    milestone-items:\n      value:\n      - url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n        html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n        labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n        id: 1002604\n        node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n        number: 1\n        state: open\n        title: v1.0\n        description: Tracking milestone for version 1.0\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        open_issues: 4\n        closed_issues: 8\n        created_at: '2011-04-10T20:09:31Z'\n        updated_at: '2014-03-03T18:58:10Z'\n        closed_at: '2013-02-12T13:22:01Z'\n        due_on: '2012-10-09T23:39:01Z'\n    milestone:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n        html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n        labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n        id: 1002604\n        node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n        number: 1\n        state: open\n        title: v1.0\n        description: Tracking milestone for version 1.0\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        open_issues: 4\n        closed_issues: 8\n        created_at: '2011-04-10T20:09:31Z'\n        updated_at: '2014-03-03T18:58:10Z'\n        closed_at: '2013-02-12T13:22:01Z'\n        due_on: '2012-10-09T23:39:01Z'\n    page:\n      value:\n        url: https://api.github.com/repos/github/developer.github.com/pages\n        status: built\n        cname: developer.github.com\n        custom_404: false\n        html_url: https://developer.github.com\n        source:\n          branch: master\n          path: \"/\"\n        public: true\n        https_certificate:\n          state: approved\n          description: Certificate is approved\n          domains:\n          - developer.github.com\n          expires_at: '2021-05-22'\n        https_enforced: true\n    page-build-items:\n      value:\n      - url: https://api.github.com/repos/github/developer.github.com/pages/builds/5472601\n        status: built\n        error:\n          message: \n        pusher:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        commit: 351391cdcb88ffae71ec3028c91f375a8036a26b\n        duration: 2104\n        created_at: '2014-02-10T19:00:49Z'\n        updated_at: '2014-02-10T19:00:51Z'\n    page-build-status:\n      value:\n        url: https://api.github.com/repos/github/developer.github.com/pages/builds/latest\n        status: queued\n    page-build:\n      value:\n        url: https://api.github.com/repos/github/developer.github.com/pages/builds/5472601\n        status: built\n        error:\n          message: \n        pusher:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        commit: 351391cdcb88ffae71ec3028c91f375a8036a26b\n        duration: 2104\n        created_at: '2014-02-10T19:00:49Z'\n        updated_at: '2014-02-10T19:00:51Z'\n    repository-pre-receive-hook-items:\n      value:\n      - id: 42\n        name: Check Commits\n        enforcement: disabled\n        configuration_url: https://github.example.com/api/v3/orgs/octocat/pre-receive-hooks/42\n    repository-pre-receive-hook:\n      value:\n        id: 42\n        name: Check Commits\n        enforcement: disabled\n        configuration_url: https://github.example.com/api/v3/orgs/octocat/pre-receive-hooks/42\n    repository-pre-receive-hook-2:\n      value:\n        id: 42\n        name: Check Commits\n        enforcement: enabled\n        configuration_url: https://github.example.com/api/v3/repos/octocat/hello-world/pre-receive-hooks/42\n    project-items-2:\n      value:\n      - owner_url: https://api.github.com/repos/api-playground/projects-test\n        url: https://api.github.com/projects/1002604\n        html_url: https://github.com/api-playground/projects-test/projects/1\n        columns_url: https://api.github.com/projects/1002604/columns\n        id: 1002604\n        node_id: MDc6UHJvamVjdDEwMDI2MDQ=\n        name: Projects Documentation\n        body: Developer documentation project for the developer site.\n        number: 1\n        state: open\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-10T20:09:31Z'\n        updated_at: '2014-03-03T18:58:10Z'\n    pull-request:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n        id: 1\n        node_id: MDExOlB1bGxSZXF1ZXN0MQ==\n        html_url: https://github.com/octocat/Hello-World/pull/1347\n        diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n        patch_url: https://github.com/octocat/Hello-World/pull/1347.patch\n        issue_url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n        commits_url: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\n        review_comments_url: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\n        review_comment_url: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        number: 1347\n        state: open\n        locked: true\n        title: Amazing new feature\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Please pull these awesome changes in!\n        labels:\n        - id: 208045946\n          node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n          url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n          name: bug\n          description: Something isn't working\n          color: f29513\n          default: true\n        milestone:\n          url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n          html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n          labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n          id: 1002604\n          node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n          number: 1\n          state: open\n          title: v1.0\n          description: Tracking milestone for version 1.0\n          creator:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          open_issues: 4\n          closed_issues: 8\n          created_at: '2011-04-10T20:09:31Z'\n          updated_at: '2014-03-03T18:58:10Z'\n          closed_at: '2013-02-12T13:22:01Z'\n          due_on: '2012-10-09T23:39:01Z'\n        active_lock_reason: too heated\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:01:12Z'\n        closed_at: '2011-01-26T19:01:12Z'\n        merged_at: '2011-01-26T19:01:12Z'\n        merge_commit_sha: e5bd3914e2e596debea16f433f57875b5b90bcd6\n        assignee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        assignees:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        - login: hubot\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/hubot_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/hubot\n          html_url: https://github.com/hubot\n          followers_url: https://api.github.com/users/hubot/followers\n          following_url: https://api.github.com/users/hubot/following{/other_user}\n          gists_url: https://api.github.com/users/hubot/gists{/gist_id}\n          starred_url: https://api.github.com/users/hubot/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/hubot/subscriptions\n          organizations_url: https://api.github.com/users/hubot/orgs\n          repos_url: https://api.github.com/users/hubot/repos\n          events_url: https://api.github.com/users/hubot/events{/privacy}\n          received_events_url: https://api.github.com/users/hubot/received_events\n          type: User\n          site_admin: true\n        requested_reviewers:\n        - login: other_user\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/other_user_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/other_user\n          html_url: https://github.com/other_user\n          followers_url: https://api.github.com/users/other_user/followers\n          following_url: https://api.github.com/users/other_user/following{/other_user}\n          gists_url: https://api.github.com/users/other_user/gists{/gist_id}\n          starred_url: https://api.github.com/users/other_user/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/other_user/subscriptions\n          organizations_url: https://api.github.com/users/other_user/orgs\n          repos_url: https://api.github.com/users/other_user/repos\n          events_url: https://api.github.com/users/other_user/events{/privacy}\n          received_events_url: https://api.github.com/users/other_user/received_events\n          type: User\n          site_admin: false\n        requested_teams:\n        - id: 1\n          node_id: MDQ6VGVhbTE=\n          url: https://api.github.com/teams/1\n          html_url: https://github.com/orgs/github/teams/justice-league\n          name: Justice League\n          slug: justice-league\n          description: A great team.\n          privacy: closed\n          permission: admin\n          members_url: https://api.github.com/teams/1/members{/member}\n          repositories_url: https://api.github.com/teams/1/repos\n        head:\n          label: octocat:new-topic\n          ref: new-topic\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          user:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          repo:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World.git\n            mirror_url: git:git.example.com/octocat/Hello-World\n            hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World\n            homepage: https://github.com\n            language: \n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            size: 108\n            default_branch: master\n            open_issues_count: 0\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            allow_merge_commit: true\n            allow_forking: true\n            forks: 123\n            open_issues: 123\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n            watchers: 123\n        base:\n          label: octocat:master\n          ref: master\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          user:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          repo:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World.git\n            mirror_url: git:git.example.com/octocat/Hello-World\n            hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World\n            homepage: https://github.com\n            language: \n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            size: 108\n            default_branch: master\n            open_issues_count: 0\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            allow_merge_commit: true\n            forks: 123\n            open_issues: 123\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n            watchers: 123\n        _links:\n          self:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n          html:\n            href: https://github.com/octocat/Hello-World/pull/1347\n          issue:\n            href: https://api.github.com/repos/octocat/Hello-World/issues/1347\n          comments:\n            href: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n          review_comments:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\n          review_comment:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\n          commits:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\n          statuses:\n            href: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        author_association: OWNER\n        draft: false\n        merged: false\n        mergeable: true\n        rebaseable: true\n        mergeable_state: clean\n        merged_by:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        comments: 10\n        review_comments: 0\n        maintainer_can_modify: true\n        commits: 3\n        additions: 100\n        deletions: 3\n        changed_files: 5\n    pull-request-review-comment-items:\n      value:\n      - url: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n        pull_request_review_id: 42\n        id: 10\n        node_id: MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\n        diff_hunk: \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n        path: file1.txt\n        position: 1\n        original_position: 4\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        original_commit_id: 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\n        in_reply_to_id: 8\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Great stuff!\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n        html_url: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        author_association: NONE\n        _links:\n          self:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n          html:\n            href: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        start_line: 1\n        original_start_line: 1\n        start_side: RIGHT\n        line: 2\n        original_line: 2\n        side: RIGHT\n    pull-request-review-comment-2:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n        pull_request_review_id: 42\n        id: 10\n        node_id: MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\n        diff_hunk: \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n        path: file1.txt\n        position: 1\n        original_position: 4\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        original_commit_id: 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\n        in_reply_to_id: 8\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Great stuff!\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n        html_url: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        author_association: NONE\n        _links:\n          self:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n          html:\n            href: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        start_line: 1\n        original_start_line: 1\n        start_side: RIGHT\n        line: 2\n        original_line: 2\n        side: RIGHT\n    pull-request-review-comment-example-for-a-multi-line-comment:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n        pull_request_review_id: 42\n        id: 10\n        node_id: MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\n        diff_hunk: \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n        path: file1.txt\n        position: 1\n        original_position: 4\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        original_commit_id: 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\n        in_reply_to_id: 8\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Great stuff!\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n        html_url: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        author_association: NONE\n        _links:\n          self:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n          html:\n            href: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        start_line: 1\n        original_start_line: 1\n        start_side: RIGHT\n        line: 2\n        original_line: 2\n        side: RIGHT\n    pull-request-review-comment:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n        pull_request_review_id: 42\n        id: 10\n        node_id: MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\n        diff_hunk: \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n        path: file1.txt\n        position: 1\n        original_position: 4\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        original_commit_id: 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\n        in_reply_to_id: 426899381\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Great stuff!\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n        html_url: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        author_association: NONE\n        _links:\n          self:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n          html:\n            href: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        start_line: 1\n        original_start_line: 1\n        start_side: RIGHT\n        line: 2\n        original_line: 2\n        side: RIGHT\n    diff-entry-items:\n      value:\n      - sha: bbcd538c8e72b8c175046e27cc8f907076331401\n        filename: file1.txt\n        status: added\n        additions: 103\n        deletions: 21\n        changes: 124\n        blob_url: https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\n        raw_url: https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e\n        patch: \"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"\n    pull-request-merge-result-response-if-merge-was-successful:\n      value:\n        sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        merged: true\n        message: Pull Request successfully merged\n    simple-pull-request-review-request:\n      value:\n        users:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        teams:\n        - id: 1\n          node_id: MDQ6VGVhbTE=\n          url: https://api.github.com/teams/1\n          html_url: https://github.com/orgs/github/teams/justice-league\n          name: Justice League\n          slug: justice-league\n          description: A great team.\n          privacy: closed\n          permission: admin\n          members_url: https://api.github.com/teams/1/members{/member}\n          repositories_url: https://api.github.com/teams/1/repos\n          parent: \n    pull-request-review-request:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n        id: 1\n        node_id: MDExOlB1bGxSZXF1ZXN0MQ==\n        html_url: https://github.com/octocat/Hello-World/pull/1347\n        diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n        patch_url: https://github.com/octocat/Hello-World/pull/1347.patch\n        issue_url: https://api.github.com/repos/octocat/Hello-World/issues/1347\n        commits_url: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\n        review_comments_url: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\n        review_comment_url: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        number: 1347\n        state: open\n        locked: true\n        title: Amazing new feature\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Please pull these awesome changes in!\n        labels:\n        - id: 208045946\n          node_id: MDU6TGFiZWwyMDgwNDU5NDY=\n          url: https://api.github.com/repos/octocat/Hello-World/labels/bug\n          name: bug\n          description: Something isn't working\n          color: f29513\n          default: true\n        milestone:\n          url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n          html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n          labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n          id: 1002604\n          node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n          number: 1\n          state: open\n          title: v1.0\n          description: Tracking milestone for version 1.0\n          creator:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          open_issues: 4\n          closed_issues: 8\n          created_at: '2011-04-10T20:09:31Z'\n          updated_at: '2014-03-03T18:58:10Z'\n          closed_at: '2013-02-12T13:22:01Z'\n          due_on: '2012-10-09T23:39:01Z'\n        active_lock_reason: too heated\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:01:12Z'\n        closed_at: '2011-01-26T19:01:12Z'\n        merged_at: '2011-01-26T19:01:12Z'\n        merge_commit_sha: e5bd3914e2e596debea16f433f57875b5b90bcd6\n        assignee:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        assignees:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        - login: hubot\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/hubot_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/hubot\n          html_url: https://github.com/hubot\n          followers_url: https://api.github.com/users/hubot/followers\n          following_url: https://api.github.com/users/hubot/following{/other_user}\n          gists_url: https://api.github.com/users/hubot/gists{/gist_id}\n          starred_url: https://api.github.com/users/hubot/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/hubot/subscriptions\n          organizations_url: https://api.github.com/users/hubot/orgs\n          repos_url: https://api.github.com/users/hubot/repos\n          events_url: https://api.github.com/users/hubot/events{/privacy}\n          received_events_url: https://api.github.com/users/hubot/received_events\n          type: User\n          site_admin: true\n        requested_reviewers:\n        - login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        - login: hubot\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/hubot_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/hubot\n          html_url: https://github.com/hubot\n          followers_url: https://api.github.com/users/hubot/followers\n          following_url: https://api.github.com/users/hubot/following{/other_user}\n          gists_url: https://api.github.com/users/hubot/gists{/gist_id}\n          starred_url: https://api.github.com/users/hubot/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/hubot/subscriptions\n          organizations_url: https://api.github.com/users/hubot/orgs\n          repos_url: https://api.github.com/users/hubot/repos\n          events_url: https://api.github.com/users/hubot/events{/privacy}\n          received_events_url: https://api.github.com/users/hubot/received_events\n          type: User\n          site_admin: true\n        - login: other_user\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/other_user_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/other_user\n          html_url: https://github.com/other_user\n          followers_url: https://api.github.com/users/other_user/followers\n          following_url: https://api.github.com/users/other_user/following{/other_user}\n          gists_url: https://api.github.com/users/other_user/gists{/gist_id}\n          starred_url: https://api.github.com/users/other_user/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/other_user/subscriptions\n          organizations_url: https://api.github.com/users/other_user/orgs\n          repos_url: https://api.github.com/users/other_user/repos\n          events_url: https://api.github.com/users/other_user/events{/privacy}\n          received_events_url: https://api.github.com/users/other_user/received_events\n          type: User\n          site_admin: false\n        requested_teams:\n        - id: 1\n          node_id: MDQ6VGVhbTE=\n          url: https://api.github.com/teams/1\n          html_url: https://github.com/orgs/github/teams/justice-league\n          name: Justice League\n          slug: justice-league\n          description: A great team.\n          privacy: closed\n          permission: admin\n          members_url: https://api.github.com/teams/1/members{/member}\n          repositories_url: https://api.github.com/teams/1/repos\n          parent: \n        head:\n          label: octocat:new-topic\n          ref: new-topic\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          user:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          repo:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World.git\n            mirror_url: git:git.example.com/octocat/Hello-World\n            hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World\n            homepage: https://github.com\n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            size: 108\n            default_branch: master\n            open_issues_count: 0\n            is_template: true\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            visibility: public\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            delete_branch_on_merge: true\n            allow_merge_commit: true\n            subscribers_count: 42\n            network_count: 0\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n              html_url: https://github.com/licenses/mit\n            forks: 1\n            open_issues: 1\n            watchers: 1\n        base:\n          label: octocat:master\n          ref: master\n          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n          user:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          repo:\n            id: 1296269\n            node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n            name: Hello-World\n            full_name: octocat/Hello-World\n            owner:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Hello-World\n            description: This your first repo!\n            fork: false\n            url: https://api.github.com/repos/octocat/Hello-World\n            archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n            assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n            blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n            branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n            collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n            comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n            commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n            compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n            contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n            contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n            deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n            downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n            events_url: https://api.github.com/repos/octocat/Hello-World/events\n            forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n            git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n            git_url: git:github.com/octocat/Hello-World.git\n            issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n            issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n            issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n            keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n            labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n            languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n            merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n            milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n            pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n            releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n            ssh_url: git@github.com:octocat/Hello-World.git\n            stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n            statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n            subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n            tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n            teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n            trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n            clone_url: https://github.com/octocat/Hello-World.git\n            mirror_url: git:git.example.com/octocat/Hello-World\n            hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n            svn_url: https://svn.github.com/octocat/Hello-World\n            homepage: https://github.com\n            forks_count: 9\n            stargazers_count: 80\n            watchers_count: 80\n            size: 108\n            default_branch: master\n            open_issues_count: 0\n            is_template: true\n            topics:\n            - octocat\n            - atom\n            - electron\n            - api\n            has_issues: true\n            has_projects: true\n            has_wiki: true\n            has_pages: false\n            has_downloads: true\n            archived: false\n            disabled: false\n            visibility: public\n            pushed_at: '2011-01-26T19:06:43Z'\n            created_at: '2011-01-26T19:01:12Z'\n            updated_at: '2011-01-26T19:14:43Z'\n            permissions:\n              admin: false\n              push: false\n              pull: true\n            allow_rebase_merge: true\n            temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n            allow_squash_merge: true\n            delete_branch_on_merge: true\n            allow_merge_commit: true\n            subscribers_count: 42\n            network_count: 0\n            license:\n              key: mit\n              name: MIT License\n              url: https://api.github.com/licenses/mit\n              spdx_id: MIT\n              node_id: MDc6TGljZW5zZW1pdA==\n              html_url: https://api.github.com/licenses/mit\n            forks: 1\n            open_issues: 1\n            watchers: 1\n        _links:\n          self:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n          html:\n            href: https://github.com/octocat/Hello-World/pull/1347\n          issue:\n            href: https://api.github.com/repos/octocat/Hello-World/issues/1347\n          comments:\n            href: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\n          review_comments:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\n          review_comment:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\n          commits:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\n          statuses:\n            href: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        author_association: OWNER\n        draft: false\n    pull-request-review-items:\n      value:\n      - id: 80\n        node_id: MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Here is the body for the review.\n        state: APPROVED\n        html_url: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        _links:\n          html:\n            href: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        submitted_at: '2019-11-17T17:43:43Z'\n        commit_id: ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\n        author_association: COLLABORATOR\n    pull-request-review:\n      value:\n        id: 80\n        node_id: MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: This is close to perfect! Please address the suggested inline change.\n        state: CHANGES_REQUESTED\n        html_url: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        _links:\n          html:\n            href: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        submitted_at: '2019-11-17T17:43:43Z'\n        commit_id: ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\n        author_association: COLLABORATOR\n    pull-request-review-4:\n      value:\n        id: 80\n        node_id: MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Here is the body for the review.\n        state: APPROVED\n        html_url: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        _links:\n          html:\n            href: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        submitted_at: '2019-11-17T17:43:43Z'\n        commit_id: ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\n        author_association: COLLABORATOR\n    pull-request-review-5:\n      value:\n        id: 80\n        node_id: MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: This is close to perfect! Please address the suggested inline change.\n          And add more about this.\n        state: CHANGES_REQUESTED\n        html_url: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        _links:\n          html:\n            href: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        submitted_at: '2019-11-17T17:43:43Z'\n        commit_id: ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\n        author_association: COLLABORATOR\n    review-comment-items:\n      value:\n      - url: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n        pull_request_review_id: 42\n        id: 10\n        node_id: MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw\n        diff_hunk: \"@@ -16,33 +16,40 @@ public class Connection : IConnection...\"\n        path: file1.txt\n        position: 1\n        original_position: 4\n        commit_id: 6dcb09b5b57875f334f61aebed695e2e4193db5e\n        original_commit_id: 9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840\n        in_reply_to_id: 8\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Great stuff!\n        created_at: '2011-04-14T16:00:49Z'\n        updated_at: '2011-04-14T16:00:49Z'\n        html_url: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/1\n        author_association: NONE\n        _links:\n          self:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/comments/1\n          html:\n            href: https://github.com/octocat/Hello-World/pull/1#discussion-diff-1\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/1\n    pull-request-review-3:\n      value:\n        id: 80\n        node_id: MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        body: Here is the body for the review.\n        state: DISMISSED\n        html_url: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n        pull_request_url: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        _links:\n          html:\n            href: https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80\n          pull_request:\n            href: https://api.github.com/repos/octocat/Hello-World/pulls/12\n        submitted_at: '2019-11-17T17:43:43Z'\n        commit_id: ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091\n        author_association: COLLABORATOR\n    content-file:\n      value:\n        type: file\n        encoding: base64\n        size: 5362\n        name: README.md\n        path: README.md\n        content: encoded content ...\n        sha: 3d21ec53a331a6f037a91c368710b99387d012c1\n        url: https://api.github.com/repos/octokit/octokit.rb/contents/README.md\n        git_url: https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1\n        html_url: https://github.com/octokit/octokit.rb/blob/master/README.md\n        download_url: https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md\n        _links:\n          git: https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1\n          self: https://api.github.com/repos/octokit/octokit.rb/contents/README.md\n          html: https://github.com/octokit/octokit.rb/blob/master/README.md\n    release-items:\n      value:\n      - url: https://api.github.com/repos/octocat/Hello-World/releases/1\n        html_url: https://github.com/octocat/Hello-World/releases/v1.0.0\n        assets_url: https://api.github.com/repos/octocat/Hello-World/releases/1/assets\n        upload_url: https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}\n        tarball_url: https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0\n        zipball_url: https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0\n        id: 1\n        node_id: MDc6UmVsZWFzZTE=\n        tag_name: v1.0.0\n        target_commitish: master\n        name: v1.0.0\n        body: Description of the release\n        draft: false\n        prerelease: false\n        created_at: '2013-02-27T19:35:32Z'\n        published_at: '2013-02-27T19:35:32Z'\n        author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        assets:\n        - url: https://api.github.com/repos/octocat/Hello-World/releases/assets/1\n          browser_download_url: https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\n          id: 1\n          node_id: MDEyOlJlbGVhc2VBc3NldDE=\n          name: example.zip\n          label: short description\n          state: uploaded\n          content_type: application/zip\n          size: 1024\n          download_count: 42\n          created_at: '2013-02-27T19:35:32Z'\n          updated_at: '2013-02-27T19:35:32Z'\n          uploader:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n    release:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/releases/1\n        html_url: https://github.com/octocat/Hello-World/releases/v1.0.0\n        assets_url: https://api.github.com/repos/octocat/Hello-World/releases/1/assets\n        upload_url: https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}\n        tarball_url: https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0\n        zipball_url: https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0\n        discussion_url: https://github.com/octocat/Hello-World/discussions/90\n        id: 1\n        node_id: MDc6UmVsZWFzZTE=\n        tag_name: v1.0.0\n        target_commitish: master\n        name: v1.0.0\n        body: Description of the release\n        draft: false\n        prerelease: false\n        created_at: '2013-02-27T19:35:32Z'\n        published_at: '2013-02-27T19:35:32Z'\n        author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        assets:\n        - url: https://api.github.com/repos/octocat/Hello-World/releases/assets/1\n          browser_download_url: https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\n          id: 1\n          node_id: MDEyOlJlbGVhc2VBc3NldDE=\n          name: example.zip\n          label: short description\n          state: uploaded\n          content_type: application/zip\n          size: 1024\n          download_count: 42\n          created_at: '2013-02-27T19:35:32Z'\n          updated_at: '2013-02-27T19:35:32Z'\n          uploader:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n    release-asset:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/releases/assets/1\n        browser_download_url: https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\n        id: 1\n        node_id: MDEyOlJlbGVhc2VBc3NldDE=\n        name: example.zip\n        label: short description\n        state: uploaded\n        content_type: application/zip\n        size: 1024\n        download_count: 42\n        created_at: '2013-02-27T19:35:32Z'\n        updated_at: '2013-02-27T19:35:32Z'\n        uploader:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    release-asset-items:\n      value:\n      - url: https://api.github.com/repos/octocat/Hello-World/releases/assets/1\n        browser_download_url: https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\n        id: 1\n        node_id: MDEyOlJlbGVhc2VBc3NldDE=\n        name: example.zip\n        label: short description\n        state: uploaded\n        content_type: application/zip\n        size: 1024\n        download_count: 42\n        created_at: '2013-02-27T19:35:32Z'\n        updated_at: '2013-02-27T19:35:32Z'\n        uploader:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    release-asset-response-for-successful-upload:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/releases/assets/1\n        browser_download_url: https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\n        id: 1\n        node_id: MDEyOlJlbGVhc2VBc3NldDE=\n        name: example.zip\n        label: short description\n        state: uploaded\n        content_type: application/zip\n        size: 1024\n        download_count: 42\n        created_at: '2013-02-27T19:35:32Z'\n        updated_at: '2013-02-27T19:35:32Z'\n        uploader:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    simple-user-items-default-response:\n      summary: Default response\n      value:\n      - login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n    stargazer-items-alternative-response-with-star-creation-timestamps:\n      summary: Alternative response with star creation timestamps\n      value:\n      - starred_at: '2011-01-16T19:06:43Z'\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    code-frequency-stat-items:\n      value:\n      - - 1302998400\n        - 1124\n        - -435\n    commit-activity-items:\n      value:\n      - days:\n        - 0\n        - 3\n        - 26\n        - 20\n        - 39\n        - 1\n        - 0\n        total: 89\n        week: 1336280400\n    contributor-activity-items:\n      value:\n      - author:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        total: 135\n        weeks:\n        - w: 1367712000\n          a: 6898\n          d: 77\n          c: 10\n    participation-stats:\n      value:\n        all:\n        - 11\n        - 21\n        - 15\n        - 2\n        - 8\n        - 1\n        - 8\n        - 23\n        - 17\n        - 21\n        - 11\n        - 10\n        - 33\n        - 91\n        - 38\n        - 34\n        - 22\n        - 23\n        - 32\n        - 3\n        - 43\n        - 87\n        - 71\n        - 18\n        - 13\n        - 5\n        - 13\n        - 16\n        - 66\n        - 27\n        - 12\n        - 45\n        - 110\n        - 117\n        - 13\n        - 8\n        - 18\n        - 9\n        - 19\n        - 26\n        - 39\n        - 12\n        - 20\n        - 31\n        - 46\n        - 91\n        - 45\n        - 10\n        - 24\n        - 9\n        - 29\n        - 7\n        owner:\n        - 3\n        - 2\n        - 3\n        - 0\n        - 2\n        - 0\n        - 5\n        - 14\n        - 7\n        - 9\n        - 1\n        - 5\n        - 0\n        - 48\n        - 19\n        - 2\n        - 0\n        - 1\n        - 10\n        - 2\n        - 23\n        - 40\n        - 35\n        - 8\n        - 8\n        - 2\n        - 10\n        - 6\n        - 30\n        - 0\n        - 2\n        - 9\n        - 53\n        - 104\n        - 3\n        - 3\n        - 10\n        - 4\n        - 7\n        - 11\n        - 21\n        - 4\n        - 4\n        - 22\n        - 26\n        - 63\n        - 11\n        - 2\n        - 14\n        - 1\n        - 10\n        - 3\n    code-frequency-stat-items-2:\n      value:\n      - - 0\n        - 0\n        - 5\n      - - 0\n        - 1\n        - 43\n      - - 0\n        - 2\n        - 21\n    status:\n      value:\n        url: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\n        avatar_url: https://github.com/images/error/hubot_happy.gif\n        id: 1\n        node_id: MDY6U3RhdHVzMQ==\n        state: success\n        description: Build has completed successfully\n        target_url: https://ci.example.com/1000/output\n        context: continuous-integration/jenkins\n        created_at: '2012-07-20T01:19:13Z'\n        updated_at: '2012-07-20T01:19:13Z'\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    repository-subscription-response-if-you-subscribe-to-the-repository:\n      value:\n        subscribed: true\n        ignored: false\n        reason: \n        created_at: '2012-10-06T21:34:12Z'\n        url: https://api.github.com/repos/octocat/example/subscription\n        repository_url: https://api.github.com/repos/octocat/example\n    repository-subscription:\n      value:\n        subscribed: true\n        ignored: false\n        reason: \n        created_at: '2012-10-06T21:34:12Z'\n        url: https://api.github.com/repos/octocat/example/subscription\n        repository_url: https://api.github.com/repos/octocat/example\n    tag-items:\n      value:\n      - name: v0.1\n        commit:\n          sha: c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\n          url: https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc\n        zipball_url: https://github.com/octocat/Hello-World/zipball/v0.1\n        tarball_url: https://github.com/octocat/Hello-World/tarball/v0.1\n        node_id: MDQ6VXNlcjE=\n    topic:\n      value:\n        names:\n        - octocat\n        - atom\n        - electron\n        - api\n    minimal-repository:\n      value:\n        id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        forks_count: 9\n        stargazers_count: 80\n        watchers_count: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        is_template: false\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          admin: false\n          push: false\n          pull: true\n        template_repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World-Template\n          full_name: octocat/Hello-World-Template\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World-Template\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World-Template\n          archive_url: https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World-Template/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World-Template/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World-Template/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World-Template/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World-Template/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World-Template.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World-Template/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World-Template/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World-Template.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World-Template/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World-Template/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World-Template/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World-Template/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World-Template/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World-Template.git\n          mirror_url: git:git.example.com/octocat/Hello-World-Template\n          hooks_url: https://api.github.com/repos/octocat/Hello-World-Template/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World-Template\n          homepage: https://github.com\n          forks: 9\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          watchers: 80\n          size: 108\n          default_branch: master\n          open_issues: 0\n          open_issues_count: 0\n          is_template: true\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          allow_forking: true\n          subscribers_count: 42\n          network_count: 0\n    repository-3:\n      value:\n        id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        forks_count: 9\n        forks: 9\n        stargazers_count: 80\n        watchers_count: 80\n        watchers: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        open_issues: 0\n        is_template: false\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          admin: false\n          push: false\n          pull: true\n        allow_rebase_merge: true\n        license:\n          key: mit\n          name: MIT License\n          url: https://api.github.com/licenses/mit\n          spdx_id: MIT\n          node_id: MDc6TGljZW5zZW1pdA==\n          html_url: https://github.com/licenses/mit\n        template_repository: {}\n    public-repository-items:\n      value:\n      - id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        hooks_url: http://api.github.com/repos/octocat/Hello-World/hooks\n    code-search-result-item-paginated:\n      value:\n        total_count: 7\n        incomplete_results: false\n        items:\n        - name: classes.js\n          path: src/attributes/classes.js\n          sha: d7212f9dee2dcc18f084d7df8f417b80846ded5a\n          url: https://api.github.com/repositories/167174/contents/src/attributes/classes.js?ref=825ac3773694e0cd23ee74895fd5aeb535b27da4\n          git_url: https://api.github.com/repositories/167174/git/blobs/d7212f9dee2dcc18f084d7df8f417b80846ded5a\n          html_url: https://github.com/jquery/jquery/blob/825ac3773694e0cd23ee74895fd5aeb535b27da4/src/attributes/classes.js\n          repository:\n            id: 167174\n            node_id: MDEwOlJlcG9zaXRvcnkxNjcxNzQ=\n            name: jquery\n            full_name: jquery/jquery\n            owner:\n              login: jquery\n              id: 70142\n              node_id: MDQ6VXNlcjcwMTQy\n              avatar_url: https://0.gravatar.com/avatar/6906f317a4733f4379b06c32229ef02f?d=https%3A%2F%2Fidenticons.github.com%2Ff426f04f2f9813718fb806b30e0093de.png\n              gravatar_id: ''\n              url: https://api.github.com/users/jquery\n              html_url: https://github.com/jquery\n              followers_url: https://api.github.com/users/jquery/followers\n              following_url: https://api.github.com/users/jquery/following{/other_user}\n              gists_url: https://api.github.com/users/jquery/gists{/gist_id}\n              starred_url: https://api.github.com/users/jquery/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/jquery/subscriptions\n              organizations_url: https://api.github.com/users/jquery/orgs\n              repos_url: https://api.github.com/users/jquery/repos\n              events_url: https://api.github.com/users/jquery/events{/privacy}\n              received_events_url: https://api.github.com/users/jquery/received_events\n              type: Organization\n              site_admin: false\n            private: false\n            html_url: https://github.com/jquery/jquery\n            description: jQuery JavaScript Library\n            fork: false\n            url: https://api.github.com/repos/jquery/jquery\n            forks_url: https://api.github.com/repos/jquery/jquery/forks\n            keys_url: https://api.github.com/repos/jquery/jquery/keys{/key_id}\n            collaborators_url: https://api.github.com/repos/jquery/jquery/collaborators{/collaborator}\n            teams_url: https://api.github.com/repos/jquery/jquery/teams\n            hooks_url: https://api.github.com/repos/jquery/jquery/hooks\n            issue_events_url: https://api.github.com/repos/jquery/jquery/issues/events{/number}\n            events_url: https://api.github.com/repos/jquery/jquery/events\n            assignees_url: https://api.github.com/repos/jquery/jquery/assignees{/user}\n            branches_url: https://api.github.com/repos/jquery/jquery/branches{/branch}\n            tags_url: https://api.github.com/repos/jquery/jquery/tags\n            blobs_url: https://api.github.com/repos/jquery/jquery/git/blobs{/sha}\n            git_tags_url: https://api.github.com/repos/jquery/jquery/git/tags{/sha}\n            git_refs_url: https://api.github.com/repos/jquery/jquery/git/refs{/sha}\n            trees_url: https://api.github.com/repos/jquery/jquery/git/trees{/sha}\n            statuses_url: https://api.github.com/repos/jquery/jquery/statuses/{sha}\n            languages_url: https://api.github.com/repos/jquery/jquery/languages\n            stargazers_url: https://api.github.com/repos/jquery/jquery/stargazers\n            contributors_url: https://api.github.com/repos/jquery/jquery/contributors\n            subscribers_url: https://api.github.com/repos/jquery/jquery/subscribers\n            subscription_url: https://api.github.com/repos/jquery/jquery/subscription\n            commits_url: https://api.github.com/repos/jquery/jquery/commits{/sha}\n            git_commits_url: https://api.github.com/repos/jquery/jquery/git/commits{/sha}\n            comments_url: https://api.github.com/repos/jquery/jquery/comments{/number}\n            issue_comment_url: https://api.github.com/repos/jquery/jquery/issues/comments/{number}\n            contents_url: https://api.github.com/repos/jquery/jquery/contents/{+path}\n            compare_url: https://api.github.com/repos/jquery/jquery/compare/{base}...{head}\n            merges_url: https://api.github.com/repos/jquery/jquery/merges\n            archive_url: https://api.github.com/repos/jquery/jquery/{archive_format}{/ref}\n            downloads_url: https://api.github.com/repos/jquery/jquery/downloads\n            issues_url: https://api.github.com/repos/jquery/jquery/issues{/number}\n            pulls_url: https://api.github.com/repos/jquery/jquery/pulls{/number}\n            milestones_url: https://api.github.com/repos/jquery/jquery/milestones{/number}\n            notifications_url: https://api.github.com/repos/jquery/jquery/notifications{?since,all,participating}\n            labels_url: https://api.github.com/repos/jquery/jquery/labels{/name}\n            deployments_url: http://api.github.com/repos/octocat/Hello-World/deployments\n            releases_url: http://api.github.com/repos/octocat/Hello-World/releases{/id}\n          score: 1\n    commit-search-result-item-paginated:\n      value:\n        total_count: 1\n        incomplete_results: false\n        items:\n        - url: https://api.github.com/repos/octocat/Spoon-Knife/commits/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f\n          sha: bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f\n          html_url: https://github.com/octocat/Spoon-Knife/commit/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f\n          comments_url: https://api.github.com/repos/octocat/Spoon-Knife/commits/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f/comments\n          commit:\n            url: https://api.github.com/repos/octocat/Spoon-Knife/git/commits/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f\n            author:\n              date: '2014-02-04T14:38:36-08:00'\n              name: The Octocat\n              email: octocat@nowhere.com\n            committer:\n              date: '2014-02-12T15:18:55-08:00'\n              name: The Octocat\n              email: octocat@nowhere.com\n            message: Create styles.css and updated README\n            tree:\n              url: https://api.github.com/repos/octocat/Spoon-Knife/git/trees/a639e96f9038797fba6e0469f94a4b0cc459fa68\n              sha: a639e96f9038797fba6e0469f94a4b0cc459fa68\n            comment_count: 8\n          author:\n            login: octocat\n            id: 583231\n            node_id: MDQ6VXNlcjU4MzIzMQ==\n            avatar_url: https://avatars.githubusercontent.com/u/583231?v=3\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          committer: {}\n          parents:\n          - url: https://api.github.com/repos/octocat/Spoon-Knife/commits/a30c19e3f13765a3b48829788bc1cb8b4e95cee4\n            html_url: https://github.com/octocat/Spoon-Knife/commit/a30c19e3f13765a3b48829788bc1cb8b4e95cee4\n            sha: a30c19e3f13765a3b48829788bc1cb8b4e95cee4\n          repository:\n            id: 1300192\n            node_id: MDEwOlJlcG9zaXRvcnkxMzAwMTky\n            name: Spoon-Knife\n            full_name: octocat/Spoon-Knife\n            owner:\n              login: octocat\n              id: 583231\n              node_id: MDQ6VXNlcjU4MzIzMQ==\n              avatar_url: https://avatars.githubusercontent.com/u/583231?v=3\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            private: false\n            html_url: https://github.com/octocat/Spoon-Knife\n            description: This repo is for demonstration purposes only.\n            fork: false\n            url: https://api.github.com/repos/octocat/Spoon-Knife\n            forks_url: https://api.github.com/repos/octocat/Spoon-Knife/forks\n            keys_url: https://api.github.com/repos/octocat/Spoon-Knife/keys{/key_id}\n            collaborators_url: https://api.github.com/repos/octocat/Spoon-Knife/collaborators{/collaborator}\n            teams_url: https://api.github.com/repos/octocat/Spoon-Knife/teams\n            hooks_url: https://api.github.com/repos/octocat/Spoon-Knife/hooks\n            issue_events_url: https://api.github.com/repos/octocat/Spoon-Knife/issues/events{/number}\n            events_url: https://api.github.com/repos/octocat/Spoon-Knife/events\n            assignees_url: https://api.github.com/repos/octocat/Spoon-Knife/assignees{/user}\n            branches_url: https://api.github.com/repos/octocat/Spoon-Knife/branches{/branch}\n            tags_url: https://api.github.com/repos/octocat/Spoon-Knife/tags\n            blobs_url: https://api.github.com/repos/octocat/Spoon-Knife/git/blobs{/sha}\n            git_tags_url: https://api.github.com/repos/octocat/Spoon-Knife/git/tags{/sha}\n            git_refs_url: https://api.github.com/repos/octocat/Spoon-Knife/git/refs{/sha}\n            trees_url: https://api.github.com/repos/octocat/Spoon-Knife/git/trees{/sha}\n            statuses_url: https://api.github.com/repos/octocat/Spoon-Knife/statuses/{sha}\n            languages_url: https://api.github.com/repos/octocat/Spoon-Knife/languages\n            stargazers_url: https://api.github.com/repos/octocat/Spoon-Knife/stargazers\n            contributors_url: https://api.github.com/repos/octocat/Spoon-Knife/contributors\n            subscribers_url: https://api.github.com/repos/octocat/Spoon-Knife/subscribers\n            subscription_url: https://api.github.com/repos/octocat/Spoon-Knife/subscription\n            commits_url: https://api.github.com/repos/octocat/Spoon-Knife/commits{/sha}\n            git_commits_url: https://api.github.com/repos/octocat/Spoon-Knife/git/commits{/sha}\n            comments_url: https://api.github.com/repos/octocat/Spoon-Knife/comments{/number}\n            issue_comment_url: https://api.github.com/repos/octocat/Spoon-Knife/issues/comments{/number}\n            contents_url: https://api.github.com/repos/octocat/Spoon-Knife/contents/{+path}\n            compare_url: https://api.github.com/repos/octocat/Spoon-Knife/compare/{base}...{head}\n            merges_url: https://api.github.com/repos/octocat/Spoon-Knife/merges\n            archive_url: https://api.github.com/repos/octocat/Spoon-Knife/{archive_format}{/ref}\n            downloads_url: https://api.github.com/repos/octocat/Spoon-Knife/downloads\n            issues_url: https://api.github.com/repos/octocat/Spoon-Knife/issues{/number}\n            pulls_url: https://api.github.com/repos/octocat/Spoon-Knife/pulls{/number}\n            milestones_url: https://api.github.com/repos/octocat/Spoon-Knife/milestones{/number}\n            notifications_url: https://api.github.com/repos/octocat/Spoon-Knife/notifications{?since,all,participating}\n            labels_url: https://api.github.com/repos/octocat/Spoon-Knife/labels{/name}\n            releases_url: https://api.github.com/repos/octocat/Spoon-Knife/releases{/id}\n            deployments_url: https://api.github.com/repos/octocat/Spoon-Knife/deployments\n          score: 1\n          node_id: MDQ6VXNlcjU4MzIzMQ==\n    issue-search-result-item-paginated:\n      value:\n        total_count: 280\n        incomplete_results: false\n        items:\n        - url: https://api.github.com/repos/batterseapower/pinyin-toolkit/issues/132\n          repository_url: https://api.github.com/repos/batterseapower/pinyin-toolkit\n          labels_url: https://api.github.com/repos/batterseapower/pinyin-toolkit/issues/132/labels{/name}\n          comments_url: https://api.github.com/repos/batterseapower/pinyin-toolkit/issues/132/comments\n          events_url: https://api.github.com/repos/batterseapower/pinyin-toolkit/issues/132/events\n          html_url: https://github.com/batterseapower/pinyin-toolkit/issues/132\n          id: 35802\n          node_id: MDU6SXNzdWUzNTgwMg==\n          number: 132\n          title: Line Number Indexes Beyond 20 Not Displayed\n          user:\n            login: Nick3C\n            id: 90254\n            node_id: MDQ6VXNlcjkwMjU0\n            avatar_url: https://secure.gravatar.com/avatar/934442aadfe3b2f4630510de416c5718?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png\n            gravatar_id: ''\n            url: https://api.github.com/users/Nick3C\n            html_url: https://github.com/Nick3C\n            followers_url: https://api.github.com/users/Nick3C/followers\n            following_url: https://api.github.com/users/Nick3C/following{/other_user}\n            gists_url: https://api.github.com/users/Nick3C/gists{/gist_id}\n            starred_url: https://api.github.com/users/Nick3C/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/Nick3C/subscriptions\n            organizations_url: https://api.github.com/users/Nick3C/orgs\n            repos_url: https://api.github.com/users/Nick3C/repos\n            events_url: https://api.github.com/users/Nick3C/events{/privacy}\n            received_events_url: https://api.github.com/users/Nick3C/received_events\n            type: User\n            site_admin: true\n          labels:\n          - id: 4\n            node_id: MDU6TGFiZWw0\n            url: https://api.github.com/repos/batterseapower/pinyin-toolkit/labels/bug\n            name: bug\n            color: ff0000\n          state: open\n          assignee: \n          milestone:\n            url: https://api.github.com/repos/octocat/Hello-World/milestones/1\n            html_url: https://github.com/octocat/Hello-World/milestones/v1.0\n            labels_url: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels\n            id: 1002604\n            node_id: MDk6TWlsZXN0b25lMTAwMjYwNA==\n            number: 1\n            state: open\n            title: v1.0\n            description: Tracking milestone for version 1.0\n            creator:\n              login: octocat\n              id: 1\n              node_id: MDQ6VXNlcjE=\n              avatar_url: https://github.com/images/error/octocat_happy.gif\n              gravatar_id: ''\n              url: https://api.github.com/users/octocat\n              html_url: https://github.com/octocat\n              followers_url: https://api.github.com/users/octocat/followers\n              following_url: https://api.github.com/users/octocat/following{/other_user}\n              gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n              starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n              subscriptions_url: https://api.github.com/users/octocat/subscriptions\n              organizations_url: https://api.github.com/users/octocat/orgs\n              repos_url: https://api.github.com/users/octocat/repos\n              events_url: https://api.github.com/users/octocat/events{/privacy}\n              received_events_url: https://api.github.com/users/octocat/received_events\n              type: User\n              site_admin: false\n            open_issues: 4\n            closed_issues: 8\n            created_at: '2011-04-10T20:09:31Z'\n            updated_at: '2014-03-03T18:58:10Z'\n            closed_at: '2013-02-12T13:22:01Z'\n            due_on: '2012-10-09T23:39:01Z'\n          comments: 15\n          created_at: '2009-07-12T20:10:41Z'\n          updated_at: '2009-07-19T09:23:43Z'\n          closed_at: \n          pull_request:\n            url: https://api/github.com/repos/octocat/Hello-World/pull/1347\n            html_url: https://github.com/octocat/Hello-World/pull/1347\n            diff_url: https://github.com/octocat/Hello-World/pull/1347.diff\n            patch_url: https://api.github.com/repos/octocat/Hello-World/pulls/1347\n          body: \"...\"\n          score: 1\n          locked: true\n          author_association: COLLABORATOR\n    label-search-result-item-paginated:\n      value:\n        total_count: 2\n        incomplete_results: false\n        items:\n        - id: 418327088\n          node_id: MDU6TGFiZWw0MTgzMjcwODg=\n          url: https://api.github.com/repos/octocat/linguist/labels/enhancement\n          name: enhancement\n          color: 84b6eb\n          default: true\n          description: New feature or request.\n          score: 1\n        - id: 418327086\n          node_id: MDU6TGFiZWw0MTgzMjcwODY=\n          url: https://api.github.com/repos/octocat/linguist/labels/bug\n          name: bug\n          color: ee0701\n          default: true\n          description: Something isn't working.\n          score: 1\n    repo-search-result-item-paginated:\n      value:\n        total_count: 40\n        incomplete_results: false\n        items:\n        - id: 3081286\n          node_id: MDEwOlJlcG9zaXRvcnkzMDgxMjg2\n          name: Tetris\n          full_name: dtrupenn/Tetris\n          owner:\n            login: dtrupenn\n            id: 872147\n            node_id: MDQ6VXNlcjg3MjE0Nw==\n            avatar_url: https://secure.gravatar.com/avatar/e7956084e75f239de85d3a31bc172ace?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png\n            gravatar_id: ''\n            url: https://api.github.com/users/dtrupenn\n            received_events_url: https://api.github.com/users/dtrupenn/received_events\n            type: User\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            site_admin: true\n          private: false\n          html_url: https://github.com/dtrupenn/Tetris\n          description: A C implementation of Tetris using Pennsim through LC4\n          fork: false\n          url: https://api.github.com/repos/dtrupenn/Tetris\n          created_at: '2012-01-01T00:31:50Z'\n          updated_at: '2013-01-05T17:58:47Z'\n          pushed_at: '2012-01-01T00:37:02Z'\n          homepage: https://github.com\n          size: 524\n          stargazers_count: 1\n          watchers_count: 1\n          language: Assembly\n          forks_count: 0\n          open_issues_count: 0\n          master_branch: master\n          default_branch: master\n          score: 1\n          archive_url: https://api.github.com/repos/dtrupenn/Tetris/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/dtrupenn/Tetris/assignees{/user}\n          blobs_url: https://api.github.com/repos/dtrupenn/Tetris/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/dtrupenn/Tetris/branches{/branch}\n          collaborators_url: https://api.github.com/repos/dtrupenn/Tetris/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/dtrupenn/Tetris/comments{/number}\n          commits_url: https://api.github.com/repos/dtrupenn/Tetris/commits{/sha}\n          compare_url: https://api.github.com/repos/dtrupenn/Tetris/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/dtrupenn/Tetris/contents/{+path}\n          contributors_url: https://api.github.com/repos/dtrupenn/Tetris/contributors\n          deployments_url: https://api.github.com/repos/dtrupenn/Tetris/deployments\n          downloads_url: https://api.github.com/repos/dtrupenn/Tetris/downloads\n          events_url: https://api.github.com/repos/dtrupenn/Tetris/events\n          forks_url: https://api.github.com/repos/dtrupenn/Tetris/forks\n          git_commits_url: https://api.github.com/repos/dtrupenn/Tetris/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/dtrupenn/Tetris/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/dtrupenn/Tetris/git/tags{/sha}\n          git_url: git:github.com/dtrupenn/Tetris.git\n          issue_comment_url: https://api.github.com/repos/dtrupenn/Tetris/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/dtrupenn/Tetris/issues/events{/number}\n          issues_url: https://api.github.com/repos/dtrupenn/Tetris/issues{/number}\n          keys_url: https://api.github.com/repos/dtrupenn/Tetris/keys{/key_id}\n          labels_url: https://api.github.com/repos/dtrupenn/Tetris/labels{/name}\n          languages_url: https://api.github.com/repos/dtrupenn/Tetris/languages\n          merges_url: https://api.github.com/repos/dtrupenn/Tetris/merges\n          milestones_url: https://api.github.com/repos/dtrupenn/Tetris/milestones{/number}\n          notifications_url: https://api.github.com/repos/dtrupenn/Tetris/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/dtrupenn/Tetris/pulls{/number}\n          releases_url: https://api.github.com/repos/dtrupenn/Tetris/releases{/id}\n          ssh_url: git@github.com:dtrupenn/Tetris.git\n          stargazers_url: https://api.github.com/repos/dtrupenn/Tetris/stargazers\n          statuses_url: https://api.github.com/repos/dtrupenn/Tetris/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/dtrupenn/Tetris/subscribers\n          subscription_url: https://api.github.com/repos/dtrupenn/Tetris/subscription\n          tags_url: https://api.github.com/repos/dtrupenn/Tetris/tags\n          teams_url: https://api.github.com/repos/dtrupenn/Tetris/teams\n          trees_url: https://api.github.com/repos/dtrupenn/Tetris/git/trees{/sha}\n          clone_url: https://github.com/dtrupenn/Tetris.git\n          mirror_url: git:git.example.com/dtrupenn/Tetris\n          hooks_url: https://api.github.com/repos/dtrupenn/Tetris/hooks\n          svn_url: https://svn.github.com/dtrupenn/Tetris\n          forks: 1\n          open_issues: 1\n          watchers: 1\n          has_issues: true\n          has_projects: true\n          has_pages: true\n          has_wiki: true\n          has_downloads: true\n          archived: true\n          disabled: true\n          visibility: private\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n    topic-search-result-item-paginated:\n      value:\n        total_count: 6\n        incomplete_results: false\n        items:\n        - name: ruby\n          display_name: Ruby\n          short_description: Ruby is a scripting language designed for simplified\n            object-oriented programming.\n          description: Ruby was developed by Yukihiro \"Matz\" Matsumoto in 1995 with\n            the intent of having an easily readable programming language. It is integrated\n            with the Rails framework to create dynamic web-applications. Ruby's syntax\n            is similar to that of Perl and Python.\n          created_by: Yukihiro Matsumoto\n          released: December 21, 1995\n          created_at: '2016-11-28T22:03:59Z'\n          updated_at: '2017-10-30T18:16:32Z'\n          featured: true\n          curated: true\n          score: 1\n        - name: rails\n          display_name: Rails\n          short_description: Ruby on Rails (Rails) is a web application framework\n            written in Ruby.\n          description: Ruby on Rails (Rails) is a web application framework written\n            in Ruby. It is meant to help simplify the building of complex websites.\n          created_by: David Heinemeier Hansson\n          released: December 13 2005\n          created_at: '2016-12-09T17:03:50Z'\n          updated_at: '2017-10-30T16:20:19Z'\n          featured: true\n          curated: true\n          score: 1\n        - name: python\n          display_name: Python\n          short_description: Python is a dynamically typed programming language.\n          description: Python is a dynamically typed programming language designed\n            by Guido Van Rossum. Much like the programming language Ruby, Python was\n            designed to be easily read by programmers. Because of its large following\n            and many libraries, Python can be implemented and used to do anything\n            from webpages to scientific research.\n          created_by: Guido van Rossum\n          released: February 20, 1991\n          created_at: '2016-12-07T00:07:02Z'\n          updated_at: '2017-10-27T22:45:43Z'\n          featured: true\n          curated: true\n          score: 1\n        - name: jekyll\n          display_name: Jekyll\n          short_description: Jekyll is a simple, blog-aware static site generator.\n          description: Jekyll is a blog-aware, site generator written in Ruby. It\n            takes raw text files, runs it through a renderer and produces a publishable\n            static website.\n          created_by: Tom Preston-Werner\n          released: '2008'\n          created_at: '2016-12-16T21:53:08Z'\n          updated_at: '2017-10-27T19:00:24Z'\n          featured: true\n          curated: true\n          score: 1\n        - name: sass\n          display_name: Sass\n          short_description: Sass is a stable extension to classic CSS.\n          description: Sass is a stylesheet language with a main implementation in\n            Ruby. It is an extension of CSS that makes improvements to the old stylesheet\n            format, such as being able to declare variables and using a cleaner nesting\n            syntax.\n          created_by: Hampton Catlin, Natalie Weizenbaum, Chris Eppstein\n          released: November 28, 2006\n          created_at: '2016-12-16T21:53:45Z'\n          updated_at: '2018-01-16T16:30:40Z'\n          featured: true\n          curated: true\n          score: 1\n        - name: homebrew\n          display_name: Homebrew\n          short_description: Homebrew is a package manager for macOS.\n          description: Homebrew is a package manager for Apple's macOS operating system.\n            It simplifies the installation of software and is popular in the Ruby\n            on Rails community.\n          created_by: Max Howell\n          released: '2009'\n          created_at: '2016-12-17T20:30:44Z'\n          updated_at: '2018-02-06T16:14:56Z'\n          featured: true\n          curated: true\n          score: 1\n    user-search-result-item-paginated:\n      value:\n        total_count: 12\n        incomplete_results: false\n        items:\n        - login: mojombo\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://secure.gravatar.com/avatar/25c7c18223fb42a4c6ae1c8db6f50f9b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png\n          gravatar_id: ''\n          url: https://api.github.com/users/mojombo\n          html_url: https://github.com/mojombo\n          followers_url: https://api.github.com/users/mojombo/followers\n          subscriptions_url: https://api.github.com/users/mojombo/subscriptions\n          organizations_url: https://api.github.com/users/mojombo/orgs\n          repos_url: https://api.github.com/users/mojombo/repos\n          received_events_url: https://api.github.com/users/mojombo/received_events\n          type: User\n          score: 1\n          following_url: https://api.github.com/users/mojombo/following{/other_user}\n          gists_url: https://api.github.com/users/mojombo/gists{/gist_id}\n          starred_url: https://api.github.com/users/mojombo/starred{/owner}{/repo}\n          events_url: https://api.github.com/users/mojombo/events{/privacy}\n          site_admin: true\n    configuration-status:\n      value:\n        status: running\n        progress:\n        - status: DONE\n          key: Appliance core components\n        - status: DONE\n          key: GitHub utilities\n        - status: DONE\n          key: GitHub applications\n        - status: CONFIGURING\n          key: GitHub services\n        - status: PENDING\n          key: Reloading appliance services\n    maintenance-status:\n      value:\n        status: scheduled\n        scheduled_time: Tuesday, January 22 at 15:34 -0800\n        connection_services:\n        - name: git operations\n          number: 0\n        - name: mysql queries\n          number: 233\n        - name: resque jobs\n          number: 54\n    enterprise-settings:\n      value:\n        enterprise:\n          private_mode: false\n          public_pages: false\n          subdomain_isolation: true\n          signup_enabled: false\n          github_hostname: ghe.local\n          identicons_host: dotcom\n          http_proxy: \n          auth_mode: default\n          expire_sessions: false\n          admin_password: \n          configuration_id: 1401777404\n          configuration_run_count: 4\n          avatar:\n            enabled: false\n            uri: ''\n          customer:\n            name: GitHub\n            email: stannis@themannis.biz\n            uuid: af6cac80-e4e1-012e-d822-1231380e52e9\n            secret_key_data: |\n              -----BEGIN PGP PRIVATE KEY BLOCK-----\n              Version: GnuPG v1.4.10 (GNU/Linux)\n\n              lQcYBE5TCgsBEACk4yHpUcapplebaumBMXYMiLF+nCQ0lxpx...\n              -----END PGP PRIVATE KEY BLOCK-----\n            public_key_data: |\n              -----BEGIN PGP PUBLIC KEY BLOCK-----\n              Version: GnuPG v1.4.10 (GNU/Linux)\n\n              mI0ETqzZYgEEALSe6snowdenXyqvLfSQ34HWD6C7....\n              -----END PGP PUBLIC KEY BLOCK-----\n          license:\n            seats: 0\n            evaluation: false\n            perpetual: false\n            unlimited_seating: true\n            support_key: ssh-rsa AAAAB3N....\n            ssh_allowed: true\n            cluster_support: false\n            expire_at: '2016-04-27T00:00:00-07:00'\n          github_ssl:\n            enabled: false\n            cert: \n            key: \n          ldap:\n            host: \n            port: 0\n            base: []\n            uid: \n            bind_dn: \n            password: \n            method: Plain\n            search_strategy: detect\n            user_groups: []\n            admin_group: \n            virtual_attribute_enabled: false\n            recursive_group_search: false\n            posix_support: true\n            user_sync_emails: false\n            user_sync_keys: false\n            user_sync_interval: 4\n            team_sync_interval: 4\n            sync_enabled: false\n            reconciliation:\n              user: \n              org: \n            profile:\n              uid: uid\n              name: \n              mail: \n              key: \n          cas:\n            url: \n          saml:\n            sso_url: \n            certificate: \n            certificate_path: \n            issuer: \n            idp_initiated_sso: false\n            disable_admin_demote: false\n          github_oauth:\n            client_id: '12313412'\n            client_secret: kj123131132\n            organization_name: Homestar Runners\n            organization_team: homestarrunners/characters\n          smtp:\n            enabled: true\n            address: smtp.example.com\n            authentication: plain\n            port: '1234'\n            domain: blah\n            username: foo\n            user_name: mr_foo\n            enable_starttls_auto: true\n            password: bar\n            discard-to-noreply-address: true\n            support_address: enterprise@github.com\n            support_address_type: email\n            noreply_address: noreply@github.com\n          ntp:\n            primary_server: 0.pool.ntp.org\n            secondary_server: 1.pool.ntp.org\n          timezone: \n          snmp:\n            enabled: false\n            community: ''\n          syslog:\n            enabled: false\n            server: \n            protocol_name: udp\n          assets: \n          pages:\n            enabled: true\n          collectd:\n            enabled: false\n            server: \n            port: 0\n            encryption: \n            username: \n            password: \n          mapping:\n            enabled: true\n            tileserver: \n            basemap: company.map-qsz2zrvs\n            token: \n          load_balancer: \n        run_list:\n        - recipe[enterprise-configure]\n    ssh-key-items:\n      value:\n      - key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...\n        pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64\n      - key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...\n        pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64\n      - key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...\n        pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64\n    team-repository-alternative-response-with-extra-repository-information:\n      value:\n        id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        forks_count: 9\n        stargazers_count: 80\n        watchers_count: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        is_template: false\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          admin: false\n          maintain: false\n          push: false\n          triage: false\n          pull: true\n        allow_rebase_merge: true\n        template_repository:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World-Template\n          full_name: octocat/Hello-World-Template\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World-Template\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World-Template\n          archive_url: https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World-Template/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World-Template/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World-Template/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World-Template/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World-Template/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World-Template.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World-Template/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World-Template/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World-Template.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World-Template/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World-Template/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World-Template/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World-Template/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World-Template/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World-Template.git\n          mirror_url: git:git.example.com/octocat/Hello-World-Template\n          hooks_url: https://api.github.com/repos/octocat/Hello-World-Template/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World-Template\n          homepage: https://github.com\n          forks: 9\n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          watchers: 80\n          size: 108\n          default_branch: master\n          open_issues: 0\n          open_issues_count: 0\n          is_template: true\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://api.github.com/licenses/mit\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            pull: true\n            triage: false\n            push: false\n            maintain: false\n            admin: false\n          allow_rebase_merge: true\n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n        temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n        allow_squash_merge: true\n        delete_branch_on_merge: true\n        allow_merge_commit: true\n        subscribers_count: 42\n        network_count: 0\n        license:\n          key: mit\n          name: MIT License\n          url: https://api.github.com/licenses/mit\n          spdx_id: MIT\n          node_id: MDc6TGljZW5zZW1pdA==\n          html_url: https://api.github.com/licenses/mit\n        forks: 1\n        open_issues: 1\n        watchers: 1\n    private-user-response-with-public-and-private-profile-information:\n      summary: Response with public and private profile information\n      value:\n        login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n        name: monalisa octocat\n        company: GitHub\n        blog: https://github.com/blog\n        location: San Francisco\n        email: octocat@github.com\n        hireable: false\n        bio: There once was...\n        public_repos: 2\n        public_gists: 1\n        followers: 20\n        following: 0\n        created_at: '2008-01-14T04:33:35Z'\n        updated_at: '2008-01-14T04:33:35Z'\n        private_gists: 81\n        total_private_repos: 100\n        owned_private_repos: 100\n        disk_usage: 10000\n        collaborators: 8\n        two_factor_authentication: true\n        plan:\n          name: Medium\n          space: 400\n          private_repos: 20\n          collaborators: 0\n    private-user-response-with-public-profile-information:\n      summary: Response with public profile information\n      value:\n        login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n        name: monalisa octocat\n        company: GitHub\n        blog: https://github.com/blog\n        location: San Francisco\n        email: octocat@github.com\n        hireable: false\n        bio: There once was...\n        public_repos: 2\n        public_gists: 1\n        followers: 20\n        following: 0\n        created_at: '2008-01-14T04:33:35Z'\n        updated_at: '2008-01-14T04:33:35Z'\n    private-user:\n      value:\n        login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n        name: monalisa octocat\n        company: GitHub\n        blog: https://github.com/blog\n        location: San Francisco\n        email: octocat@github.com\n        hireable: false\n        bio: There once was...\n        public_repos: 2\n        public_gists: 1\n        followers: 20\n        following: 0\n        created_at: '2008-01-14T04:33:35Z'\n        updated_at: '2008-01-14T04:33:35Z'\n        private_gists: 81\n        total_private_repos: 100\n        owned_private_repos: 100\n        disk_usage: 10000\n        collaborators: 8\n        two_factor_authentication: true\n        plan:\n          name: Medium\n          space: 400\n          private_repos: 20\n          collaborators: 0\n    email-items-2:\n      value:\n      - email: octocat@github.com\n        verified: true\n        primary: true\n        visibility: public\n    email-items:\n      value:\n      - email: octocat@octocat.org\n        primary: false\n        verified: false\n        visibility: public\n      - email: octocat@github.com\n        primary: false\n        verified: false\n        visibility: \n      - email: mona@github.com\n        primary: false\n        verified: false\n        visibility: \n    gpg-key-items:\n      value:\n      - id: 3\n        primary_key_id: 2\n        key_id: 3262EFF25BA0D270\n        public_key: xsBNBFayYZ...\n        emails:\n        - email: mastahyeti@users.noreply.github.com\n          verified: true\n        subkeys:\n        - id: 4\n          primary_key_id: 3\n          key_id: 4A595D4C72EE49C7\n          public_key: zsBNBFayYZ...\n          emails: []\n          subkeys: []\n          can_sign: false\n          can_encrypt_comms: true\n          can_encrypt_storage: true\n          can_certify: false\n          created_at: '2016-03-24T11:31:04-06:00'\n          expires_at: '2016-03-24T11:31:04-07:00'\n        can_sign: true\n        can_encrypt_comms: false\n        can_encrypt_storage: false\n        can_certify: true\n        created_at: '2016-03-24T11:31:04-06:00'\n        expires_at: '2016-03-24T11:31:04-07:00'\n        raw_key: string\n    gpg-key:\n      value:\n        id: 3\n        primary_key_id: 2\n        key_id: 3262EFF25BA0D270\n        public_key: xsBNBFayYZ...\n        emails:\n        - email: mastahyeti@users.noreply.github.com\n          verified: true\n        subkeys:\n        - id: 4\n          primary_key_id: 3\n          key_id: 4A595D4C72EE49C7\n          public_key: zsBNBFayYZ...\n          emails: []\n          subkeys: []\n          can_sign: false\n          can_encrypt_comms: true\n          can_encrypt_storage: true\n          can_certify: false\n          created_at: '2016-03-24T11:31:04-06:00'\n          expires_at: '2016-03-24T11:31:04-07:00'\n        can_sign: true\n        can_encrypt_comms: false\n        can_encrypt_storage: false\n        can_certify: true\n        created_at: '2016-03-24T11:31:04-06:00'\n        expires_at: '2016-03-24T11:31:04-07:00'\n        raw_key: '\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\nVersion: GnuPG v2\\n\\nmQENBFayYZ0BCAC4hScoJXXpyR+MXGcrBxElqw3FzCVvkViuyeko+Jp76QJhg8kr\\nucRTxbnOoHfda/FmilEa/wxf9ch5/PSrrL26FxEoPHhJolp8fnIDLQeITn94NYdB\\nZtnnEKslpPrG97qSUWIchvyqCPtvOb8+8fWvGx9K/ZWcEEdh1X8+WFR2jMENMeoX\\nwxHWQoPnS7LpX/85/M7VUcJxvDVfv+eHsnQupmE5bGarKNih0oMe3LbdN3qA5PTz\\nSCm6Iudar1VsQ+xTz08ymL7t4pnEtLguQ7EyatFHCjxNblv5RzxoL0tDgN3HqoDz\\nc7TEA+q4RtDQl9amcvQ95emnXmZ974u7UkYdABEBAAG0HlNvbWUgVXNlciA8c29t\\nZXVzZXJAZ21haWwuY29tPokBOAQTAQIAIgUCVrJhnQIbAwYLCQgHAwIGFQgCCQoL\\nBBYCAwECHgECF4AACgkQMmLv8lug0nAViQgArWjI55+7p48URr2z9Jvak+yrBTx1\\nzkufltQAnHTJkq+Kl9dySSmTnOop8o3rE4++IOpYV5Y36PkKf9EZMk4n1RQiDPKE\\nAFtRVTkRaoWzOir9KQXJPfhKrl01j/QzY+utfiMvUoBJZ9ybq8Pa885SljW9lbaX\\nIYw+hl8ZdJ2KStvGrEyfQvRyq3aN5c9TV//4BdGnwx7Qabq/U+G18lizG6f/yq15\\ned7t0KELaCfeKPvytp4VE9/z/Ksah/h3+Qilx07/oG2Ae5kC1bEC9coD/ogPUhbv\\nb2bsBIoY9E9YwsLoif2lU+o1t76zLgUktuNscRRUKobW028H1zuFS/XQhrkBDQRW\\nsmGdAQgApnyyv3i144OLYy0O4UKQxd3e10Y3WpDwfnGIBefAI1m7RxnUxBag/DsU\\n7gi9qLEC4VHSfq4eiNfr1LJOyCL2edTgCWFgBhVjbXjZe6YAOrAnhxwCErnN0Y7N\\n6s8wVh9fObSOyf8ZE6G7JeKpcq9Q6gd/KxagfD48a1v+fyRHpyQc6J9pUEmtrDJ7\\nBjmsd2VWzLBvNWdHyxDNtZweIaqIO9VUYYpr1mtTliNBOZLUelmgrt7HBRcJpWMA\\nS8muVVbuP5MK0trLBq/JB8qUH3zRzB/PhMgzmkIfjEK1VYDWm4E8DYyTWEJcHqkb\\neqFsNjrIlwPaA122BWC6gUOPwwH+oQARAQABiQEfBBgBAgAJBQJWsmGdAhsMAAoJ\\nEDJi7/JboNJwAyAIALd4xcdmGbZD98gScJzqwzkOMcO8zFHqHNvJ42xIFvGny7c0\\n1Rx7iyrdypOby5AxE+viQcjG4rpLZW/xKYBNGrCfDyQO7511I0v8x20EICMlMfD/\\nNrWQCzesEPcUlKTP07d+sFyP8AyseOidbzY/92CpskTgdSBjY/ntLSaoknl/fjJE\\nQM8OkPqU7IraO1Jzzdnm20d5PZL9+PIwIWdSTedU/vBMTJyNcoqvSfKf1wNC66XP\\nhqfYgXJE564AdWZKA3C0IyCqiv+LHwxLnUHio1a4/r91C8KPzxs6tGxRDjXLd7ms\\nuYFGWymiUGOE/giHlcxdYcHzwLnPDliMQOLiTkK5AQ0EVuxMygEIAOD+bW1cDTmE\\nBxh5JECoqeHuwgl6DlLhnubWPkQ4ZeRzBRAsFcEJQlwlJjrzFDicL+lnm6Qq4tt0\\n560TwHdf15/AKTZIZu7H25axvGNzgeaUkJEJdYAq9zTKWwX7wKyzBszi485nQg97\\nMfAqwhMpDW0Qqf8+7Ug+WEmfBSGv9uL3aQC6WEeIsHfri0n0n8v4XgwhfShXguxO\\nCsOztEsuW7WWKW9P4TngKKv4lCHdPlV6FwxeMzODBJvc2fkHVHnqc0PqszJ5xcF8\\n6gZCpMM027SbpeYWCAD5zwJyYP9ntfO1p2HjnQ1dZaP9FeNcO7uIV1Lnd1eGCu6I\\nsrVp5k1f3isAEQEAAYkCPgQYAQIACQUCVuxMygIbAgEpCRAyYu/yW6DScMBdIAQZ\\nAQIABgUCVuxMygAKCRCKohN4dhq2b4tcCACHxmOHVXNpu47OvUGYQydLgMACUlXN\\nlj+HfE0VReqShxdDmpasAY9IRpuMB2RsGK8GbNP+4SlOlAiPf5SMhS7nZNkNDgQQ\\naZ3HFpgrFmFwmE10BKT4iQtoxELLM57z0qGOAfTsEjWFQa4sF+6IHAQR/ptkdkkI\\nBUEXiMnAwVwBysLIJiLO8qdjB6qp52QkT074JVrwywT/P+DkMfC2k4r/AfEbf6eF\\ndmPDuPk6KD87+hJZsSa5MaMUBQVvRO/mgEkhJRITVu58eWGaBOcQJ8gqurhCqM5P\\nDfUA4TJ7wiqM6sS764vV1rOioTTXkszzhClQqET7hPVnVQjenYgv0EZHNyQH/1f1\\n/CYqvV1vFjM9vJjMbxXsATCkZe6wvBVKD8vLsJAr8N+onKQz+4OPc3kmKq7aESu3\\nCi/iuie5KKVwnuNhr9AzT61vEkKxwHcVFEvHB77F6ZAAInhRvjzmQbD2dlPLLQCC\\nqDj71ODSSAPTEmUy6969bgD9PfWei7kNkBIx7s3eBv8yzytSc2EcuUgopqFazquw\\nFs1+tqGHjBvQfTo6bqbJjp/9Ci2pvde3ElV2rAgUlb3lqXyXjRDqrXosh5GcRPQj\\nK8Nhj1BNhnrCVskE4BP0LYbOHuzgm86uXwGCFsY+w2VOsSm16Jx5GHyG5S5WU3+D\\nIts/HFYRLiFgDLmTlxo=\\n=+OzK\\n-----END\n          PGP PUBLIC KEY BLOCK-----\"'\n    base-installation-for-auth-user-paginated:\n      value:\n        total_count: 2\n        installations:\n        - id: 1\n          account:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          access_tokens_url: https://api.github.com/installations/1/access_tokens\n          repositories_url: https://api.github.com/installation/repositories\n          html_url: https://github.com/organizations/github/settings/installations/1\n          app_id: 1\n          target_id: 1\n          target_type: Organization\n          permissions:\n            checks: write\n            metadata: read\n            contents: read\n          events:\n          - push\n          - pull_request\n          single_file_name: config.yaml\n          has_multiple_single_files: true\n          single_file_paths:\n          - config.yml\n          - \".github/issue_TEMPLATE.md\"\n          repository_selection: all\n          created_at: '2017-07-08T16:18:44-04:00'\n          updated_at: '2017-07-08T16:18:44-04:00'\n          app_slug: github-actions\n          suspended_at: \n          suspended_by: \n        - id: 3\n          account:\n            login: octocat\n            id: 2\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          access_tokens_url: https://api.github.com/installations/1/access_tokens\n          repositories_url: https://api.github.com/installation/repositories\n          html_url: https://github.com/organizations/github/settings/installations/1\n          app_id: 1\n          target_id: 1\n          target_type: Organization\n          permissions:\n            checks: write\n            metadata: read\n            contents: read\n          events:\n          - push\n          - pull_request\n          single_file_name: config.yaml\n          has_multiple_single_files: true\n          single_file_paths:\n          - config.yml\n          - \".github/issue_TEMPLATE.md\"\n          repository_selection: all\n          created_at: '2017-07-08T16:18:44-04:00'\n          updated_at: '2017-07-08T16:18:44-04:00'\n          app_slug: github-actions\n          suspended_at: \n          suspended_by: \n    key-items:\n      value:\n      - key: 2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\n        id: 2\n        url: https://api.github.com/user/keys/2\n        title: ssh-rsa AAAAB3NzaC1yc2EAAA\n        created_at: '2020-06-11T21:31:57Z'\n        verified: false\n        read_only: false\n      - key: 2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJy931234\n        id: 3\n        url: https://api.github.com/user/keys/3\n        title: ssh-rsa AAAAB3NzaC1yc2EAAB\n        created_at: '2020-07-11T21:31:57Z'\n        verified: false\n        read_only: false\n    key:\n      value:\n        key: 2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\n        id: 2\n        url: https://api.github.com/user/keys/2\n        title: ssh-rsa AAAAB3NzaC1yc2EAAA\n        created_at: '2020-06-11T21:31:57Z'\n        verified: false\n        read_only: false\n    org-membership-items:\n      value:\n      - url: https://api.github.com/orgs/octocat/memberships/defunkt\n        state: active\n        role: admin\n        organization_url: https://api.github.com/orgs/octocat\n        organization:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          hooks_url: https://api.github.com/orgs/github/hooks\n          issues_url: https://api.github.com/orgs/github/issues\n          members_url: https://api.github.com/orgs/github/members{/member}\n          public_members_url: https://api.github.com/orgs/github/public_members{/member}\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          description: A great organization\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n      - url: https://api.github.com/orgs/invitocat/memberships/defunkt\n        state: pending\n        role: admin\n        organization_url: https://api.github.com/orgs/invitocat\n        organization:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          hooks_url: https://api.github.com/orgs/github/hooks\n          issues_url: https://api.github.com/orgs/github/issues\n          members_url: https://api.github.com/orgs/github/members{/member}\n          public_members_url: https://api.github.com/orgs/github/public_members{/member}\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          description: A great organization\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    org-membership:\n      value:\n        url: https://api.github.com/orgs/invitocat/memberships/defunkt\n        state: pending\n        role: admin\n        organization_url: https://api.github.com/orgs/invitocat\n        organization:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          hooks_url: https://api.github.com/orgs/github/hooks\n          issues_url: https://api.github.com/orgs/github/issues\n          members_url: https://api.github.com/orgs/github/members{/member}\n          public_members_url: https://api.github.com/orgs/github/public_members{/member}\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          description: A great organization\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    org-membership-2:\n      value:\n        url: https://api.github.com/orgs/octocat/memberships/defunkt\n        state: active\n        role: admin\n        organization_url: https://api.github.com/orgs/octocat\n        organization:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          hooks_url: https://api.github.com/orgs/github/hooks\n          issues_url: https://api.github.com/orgs/github/issues\n          members_url: https://api.github.com/orgs/github/members{/member}\n          public_members_url: https://api.github.com/orgs/github/public_members{/member}\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          description: A great organization\n        user:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n    project:\n      value:\n        owner_url: https://api.github.com/users/octocat\n        url: https://api.github.com/projects/1002603\n        html_url: https://github.com/users/octocat/projects/1\n        columns_url: https://api.github.com/projects/1002603/columns\n        id: 1002603\n        node_id: MDc6UHJvamVjdDEwMDI2MDM=\n        name: My Projects\n        body: A board to manage my personal projects.\n        number: 1\n        state: open\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-10T20:09:31Z'\n        updated_at: '2014-03-03T18:58:10Z'\n    repository-items-default-response:\n      summary: Default response\n      value:\n      - id: 1296269\n        node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n        name: Hello-World\n        full_name: octocat/Hello-World\n        owner:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        private: false\n        html_url: https://github.com/octocat/Hello-World\n        description: This your first repo!\n        fork: false\n        url: https://api.github.com/repos/octocat/Hello-World\n        archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n        assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n        blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n        branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n        collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n        comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n        commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n        compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n        contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n        contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n        deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n        downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n        events_url: https://api.github.com/repos/octocat/Hello-World/events\n        forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n        git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n        git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n        git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n        git_url: git:github.com/octocat/Hello-World.git\n        issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n        issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n        issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n        keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n        labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n        languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n        merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n        milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n        notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n        pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n        releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n        ssh_url: git@github.com:octocat/Hello-World.git\n        stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n        statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n        subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n        subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n        tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n        teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n        trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n        clone_url: https://github.com/octocat/Hello-World.git\n        mirror_url: git:git.example.com/octocat/Hello-World\n        hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n        svn_url: https://svn.github.com/octocat/Hello-World\n        homepage: https://github.com\n        language: \n        forks_count: 9\n        stargazers_count: 80\n        watchers_count: 80\n        size: 108\n        default_branch: master\n        open_issues_count: 0\n        is_template: true\n        topics:\n        - octocat\n        - atom\n        - electron\n        - api\n        has_issues: true\n        has_projects: true\n        has_wiki: true\n        has_pages: false\n        has_downloads: true\n        archived: false\n        disabled: false\n        visibility: public\n        pushed_at: '2011-01-26T19:06:43Z'\n        created_at: '2011-01-26T19:01:12Z'\n        updated_at: '2011-01-26T19:14:43Z'\n        permissions:\n          admin: false\n          push: false\n          pull: true\n        allow_rebase_merge: true\n        template_repository: \n        temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n        allow_squash_merge: true\n        delete_branch_on_merge: true\n        allow_merge_commit: true\n        subscribers_count: 42\n        network_count: 0\n        license:\n          key: mit\n          name: MIT License\n          url: https://api.github.com/licenses/mit\n          spdx_id: MIT\n          node_id: MDc6TGljZW5zZW1pdA==\n          html_url: https://github.com/licenses/mit\n        forks: 1\n        open_issues: 1\n        watchers: 1\n    starred-repository-items-alternative-response-with-star-creation-timestamps:\n      summary: Alternative response with star creation timestamps\n      value:\n      - starred_at: '2011-01-16T19:06:43Z'\n        repo:\n          id: 1296269\n          node_id: MDEwOlJlcG9zaXRvcnkxMjk2MjY5\n          name: Hello-World\n          full_name: octocat/Hello-World\n          owner:\n            login: octocat\n            id: 1\n            node_id: MDQ6VXNlcjE=\n            avatar_url: https://github.com/images/error/octocat_happy.gif\n            gravatar_id: ''\n            url: https://api.github.com/users/octocat\n            html_url: https://github.com/octocat\n            followers_url: https://api.github.com/users/octocat/followers\n            following_url: https://api.github.com/users/octocat/following{/other_user}\n            gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n            starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n            subscriptions_url: https://api.github.com/users/octocat/subscriptions\n            organizations_url: https://api.github.com/users/octocat/orgs\n            repos_url: https://api.github.com/users/octocat/repos\n            events_url: https://api.github.com/users/octocat/events{/privacy}\n            received_events_url: https://api.github.com/users/octocat/received_events\n            type: User\n            site_admin: false\n          private: false\n          html_url: https://github.com/octocat/Hello-World\n          description: This your first repo!\n          fork: false\n          url: https://api.github.com/repos/octocat/Hello-World\n          archive_url: https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}\n          assignees_url: https://api.github.com/repos/octocat/Hello-World/assignees{/user}\n          blobs_url: https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}\n          branches_url: https://api.github.com/repos/octocat/Hello-World/branches{/branch}\n          collaborators_url: https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}\n          comments_url: https://api.github.com/repos/octocat/Hello-World/comments{/number}\n          commits_url: https://api.github.com/repos/octocat/Hello-World/commits{/sha}\n          compare_url: https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}\n          contents_url: https://api.github.com/repos/octocat/Hello-World/contents/{+path}\n          contributors_url: https://api.github.com/repos/octocat/Hello-World/contributors\n          deployments_url: https://api.github.com/repos/octocat/Hello-World/deployments\n          downloads_url: https://api.github.com/repos/octocat/Hello-World/downloads\n          events_url: https://api.github.com/repos/octocat/Hello-World/events\n          forks_url: https://api.github.com/repos/octocat/Hello-World/forks\n          git_commits_url: https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}\n          git_refs_url: https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}\n          git_tags_url: https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}\n          git_url: git:github.com/octocat/Hello-World.git\n          issue_comment_url: https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}\n          issue_events_url: https://api.github.com/repos/octocat/Hello-World/issues/events{/number}\n          issues_url: https://api.github.com/repos/octocat/Hello-World/issues{/number}\n          keys_url: https://api.github.com/repos/octocat/Hello-World/keys{/key_id}\n          labels_url: https://api.github.com/repos/octocat/Hello-World/labels{/name}\n          languages_url: https://api.github.com/repos/octocat/Hello-World/languages\n          merges_url: https://api.github.com/repos/octocat/Hello-World/merges\n          milestones_url: https://api.github.com/repos/octocat/Hello-World/milestones{/number}\n          notifications_url: https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}\n          pulls_url: https://api.github.com/repos/octocat/Hello-World/pulls{/number}\n          releases_url: https://api.github.com/repos/octocat/Hello-World/releases{/id}\n          ssh_url: git@github.com:octocat/Hello-World.git\n          stargazers_url: https://api.github.com/repos/octocat/Hello-World/stargazers\n          statuses_url: https://api.github.com/repos/octocat/Hello-World/statuses/{sha}\n          subscribers_url: https://api.github.com/repos/octocat/Hello-World/subscribers\n          subscription_url: https://api.github.com/repos/octocat/Hello-World/subscription\n          tags_url: https://api.github.com/repos/octocat/Hello-World/tags\n          teams_url: https://api.github.com/repos/octocat/Hello-World/teams\n          trees_url: https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}\n          clone_url: https://github.com/octocat/Hello-World.git\n          mirror_url: git:git.example.com/octocat/Hello-World\n          hooks_url: https://api.github.com/repos/octocat/Hello-World/hooks\n          svn_url: https://svn.github.com/octocat/Hello-World\n          homepage: https://github.com\n          language: \n          forks_count: 9\n          stargazers_count: 80\n          watchers_count: 80\n          size: 108\n          default_branch: master\n          open_issues_count: 0\n          is_template: true\n          topics:\n          - octocat\n          - atom\n          - electron\n          - api\n          has_issues: true\n          has_projects: true\n          has_wiki: true\n          has_pages: false\n          has_downloads: true\n          archived: false\n          disabled: false\n          visibility: public\n          pushed_at: '2011-01-26T19:06:43Z'\n          created_at: '2011-01-26T19:01:12Z'\n          updated_at: '2011-01-26T19:14:43Z'\n          permissions:\n            admin: false\n            push: false\n            pull: true\n          allow_rebase_merge: true\n          template_repository: \n          temp_clone_token: ABTLWHOULUVAXGTRYU7OC2876QJ2O\n          allow_squash_merge: true\n          delete_branch_on_merge: true\n          allow_merge_commit: true\n          subscribers_count: 42\n          network_count: 0\n          license:\n            key: mit\n            name: MIT License\n            url: https://api.github.com/licenses/mit\n            spdx_id: MIT\n            node_id: MDc6TGljZW5zZW1pdA==\n            html_url: https://github.com/licenses/mit\n          forks: 1\n          open_issues: 1\n          watchers: 1\n    team-full-items:\n      value:\n      - id: 1\n        node_id: MDQ6VGVhbTE=\n        url: https://api.github.com/teams/1\n        html_url: https://github.com/orgs/github/teams/justice-league\n        name: Justice League\n        slug: justice-league\n        description: A great team.\n        privacy: closed\n        permission: admin\n        members_url: https://api.github.com/teams/1/members{/member}\n        repositories_url: https://api.github.com/teams/1/repos\n        parent: \n        members_count: 3\n        repos_count: 10\n        created_at: '2017-07-14T16:53:42Z'\n        updated_at: '2017-08-17T12:37:15Z'\n        organization:\n          login: github\n          id: 1\n          node_id: MDEyOk9yZ2FuaXphdGlvbjE=\n          url: https://api.github.com/orgs/github\n          repos_url: https://api.github.com/orgs/github/repos\n          events_url: https://api.github.com/orgs/github/events\n          hooks_url: https://api.github.com/orgs/github/hooks\n          issues_url: https://api.github.com/orgs/github/issues\n          members_url: https://api.github.com/orgs/github/members{/member}\n          public_members_url: https://api.github.com/orgs/github/public_members{/member}\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          description: A great organization\n          name: github\n          company: GitHub\n          blog: https://github.com/blog\n          location: San Francisco\n          email: octocat@github.com\n          has_organization_projects: true\n          has_repository_projects: true\n          public_repos: 2\n          public_gists: 1\n          followers: 20\n          following: 0\n          html_url: https://github.com/octocat\n          created_at: '2008-01-14T04:33:35Z'\n          type: Organization\n        ldap_dn: uid=asdf,ou=users,dc=github,dc=com\n    public-user-default-response:\n      summary: Default response\n      value:\n        login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n        name: monalisa octocat\n        company: GitHub\n        blog: https://github.com/blog\n        location: San Francisco\n        email: octocat@github.com\n        hireable: false\n        bio: There once was...\n        twitter_username: monatheoctocat\n        public_repos: 2\n        public_gists: 1\n        followers: 20\n        following: 0\n        created_at: '2008-01-14T04:33:35Z'\n        updated_at: '2008-01-14T04:33:35Z'\n    public-user-response-with-git-hub-plan-information:\n      summary: Response with GitHub plan information\n      value:\n        login: octocat\n        id: 1\n        node_id: MDQ6VXNlcjE=\n        avatar_url: https://github.com/images/error/octocat_happy.gif\n        gravatar_id: ''\n        url: https://api.github.com/users/octocat\n        html_url: https://github.com/octocat\n        followers_url: https://api.github.com/users/octocat/followers\n        following_url: https://api.github.com/users/octocat/following{/other_user}\n        gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n        subscriptions_url: https://api.github.com/users/octocat/subscriptions\n        organizations_url: https://api.github.com/users/octocat/orgs\n        repos_url: https://api.github.com/users/octocat/repos\n        events_url: https://api.github.com/users/octocat/events{/privacy}\n        received_events_url: https://api.github.com/users/octocat/received_events\n        type: User\n        site_admin: false\n        name: monalisa octocat\n        company: GitHub\n        blog: https://github.com/blog\n        location: San Francisco\n        email: octocat@github.com\n        hireable: false\n        bio: There once was...\n        twitter_username: monatheoctocat\n        public_repos: 2\n        public_gists: 1\n        followers: 20\n        following: 0\n        created_at: '2008-01-14T04:33:35Z'\n        updated_at: '2008-01-14T04:33:35Z'\n        plan:\n          name: pro\n          space: 976562499\n          collaborators: 0\n          private_repos: 9999\n    hovercard:\n      value:\n        contexts:\n        - message: Owns this repository\n          octicon: repo\n    key-simple-items:\n      value:\n      - id: 1\n        key: ssh-rsa AAA...\n    project-items-3:\n      value:\n      - owner_url: https://api.github.com/users/octocat\n        url: https://api.github.com/projects/1002603\n        html_url: https://github.com/users/octocat/projects/1\n        columns_url: https://api.github.com/projects/1002603/columns\n        id: 1002603\n        node_id: MDc6UHJvamVjdDEwMDI2MDM=\n        name: My Projects\n        body: A board to manage my personal projects.\n        number: 1\n        state: open\n        creator:\n          login: octocat\n          id: 1\n          node_id: MDQ6VXNlcjE=\n          avatar_url: https://github.com/images/error/octocat_happy.gif\n          gravatar_id: ''\n          url: https://api.github.com/users/octocat\n          html_url: https://github.com/octocat\n          followers_url: https://api.github.com/users/octocat/followers\n          following_url: https://api.github.com/users/octocat/following{/other_user}\n          gists_url: https://api.github.com/users/octocat/gists{/gist_id}\n          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}\n          subscriptions_url: https://api.github.com/users/octocat/subscriptions\n          organizations_url: https://api.github.com/users/octocat/orgs\n          repos_url: https://api.github.com/users/octocat/repos\n          events_url: https://api.github.com/users/octocat/events{/privacy}\n          received_events_url: https://api.github.com/users/octocat/received_events\n          type: User\n          site_admin: false\n        created_at: '2011-04-10T20:09:31Z'\n        updated_at: '2014-03-03T18:58:10Z'\n  headers:\n    link:\n      example: <https://api.github.com/resource?page=2>; rel=\"next\", <https://api.github.com/resource?page=5>;\n        rel=\"last\"\n      schema:\n        type: string\n    content-type:\n      example: text/html\n      schema:\n        type: string\n    x-common-marker-version:\n      example: 0.17.4\n      schema:\n        type: string\n    x-rate-limit-limit:\n      example: 5000\n      schema:\n        type: integer\n    x-rate-limit-remaining:\n      example: 4999\n      schema:\n        type: integer\n    x-rate-limit-reset:\n      example: 1590701888\n      schema:\n        type: integer\n        format: timestamp\n    location:\n      example: https://pipelines.actions.githubusercontent.com/OhgS4QRKqmgx7bKC27GKU83jnQjyeqG8oIMTge8eqtheppcmw8/_apis/pipelines/1/runs/176/signedlogcontent?urlExpires=2020-01-24T18%3A10%3A31.5729946Z&urlSigningMethod=HMACV1&urlSignature=agG73JakPYkHrh06seAkvmH7rBR4Ji4c2%2B6a2ejYh3E%3D\n      schema:\n        type: string\n  responses:\n    not_found:\n      description: Resource not found\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    validation_failed_simple:\n      description: Validation failed\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/validation-error-simple\"\n    preview_header_missing:\n      description: Preview header missing\n      content:\n        application/json:\n          schema:\n            type: object\n            required:\n            - message\n            - documentation_url\n            properties:\n              message:\n                type: string\n              documentation_url:\n                type: string\n    forbidden:\n      description: Forbidden\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    requires_authentication:\n      description: Requires authentication\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    validation_failed:\n      description: Validation failed\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/validation-error\"\n    not_modified:\n      description: Not modified\n    gone:\n      description: Gone\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    service_unavailable:\n      description: Service unavailable\n      content:\n        application/json:\n          schema:\n            type: object\n            properties:\n              code:\n                type: string\n              message:\n                type: string\n              documentation_url:\n                type: string\n    forbidden_gist:\n      description: Forbidden Gist\n      content:\n        application/json:\n          schema:\n            type: object\n            properties:\n              block:\n                type: object\n                properties:\n                  reason:\n                    type: string\n                  created_at:\n                    type: string\n                  html_url:\n                    type:\n                    - string\n                    - 'null'\n              message:\n                type: string\n              documentation_url:\n                type: string\n    moved_permanently:\n      description: Moved permanently\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    conflict:\n      description: Conflict\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    temporary_redirect:\n      description: Temporary Redirect\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    internal_error:\n      description: Internal Error\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    code_scanning_forbidden_read:\n      description: Response if GitHub Advanced Security is not enabled for this repository\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    code_scanning_forbidden_write:\n      description: Response if the repository is archived or if github advanced security\n        is not enabled for this repository\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n    bad_request:\n      description: Bad Request\n      content:\n        application/json:\n          schema:\n            \"$ref\": \"#/components/schemas/basic-error\"\n        application/scim+json:\n          schema:\n            \"$ref\": \"#/components/schemas/scim-error\"\n    found:\n      description: Found\n    accepted:\n      description: Accepted\n      content:\n        application/json:\n          schema:\n            type: object\n    no_content:\n      description: A header with no content is returned.\n"
  },
  {
    "path": "python/tests/data/mcp_component_server_sample.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom appbuilder.mcp_server.server import MCPComponentServer\n\nif __name__ == \"__main__\":\n    from appbuilder.core.components.v2 import (\n        Translation,\n        StyleWriting,\n        OralQueryGeneration,\n        \n    )\n\n    server = MCPComponentServer(name=\"AB Component Server\")\n\n    model = \"DeepSeek-V3.1\"\n    server.add_component(Translation())  \n    server.add_component(StyleWriting(model=model))  \n    server.add_component(\n        OralQueryGeneration(model=model)\n    )\n\n    server.run()\n"
  },
  {
    "path": "python/tests/data/mcp_knowledge_base_case.txt",
    "content": "物质都是由分子构成的，分子又由原子构成——错的！因为有些物质是不含分子的！比如原子晶体中就只有原子而没有分子，像金刚石，只有C原子，SI‘O2只有硅原子和O原子！还有NaCL这种离子晶体只有Na+和CL-组成"
  },
  {
    "path": "python/tests/data/mcp_official_server_sample.py",
    "content": "# https://github.com/modelcontextprotocol/quickstart-resources/blob/main/weather-server-python/weather.py\nfrom typing import Any\nimport httpx\nfrom mcp.server.fastmcp import FastMCP\n\n# Initialize FastMCP server\nmcp = FastMCP(\"weather\")\n\n# Constants\nNWS_API_BASE = \"https://api.weather.gov\"\nUSER_AGENT = \"weather-app/1.0\"\n\n\nasync def make_nws_request(url: str) -> dict[str, Any] | None:\n    \"\"\"Make a request to the NWS API with proper error handling.\"\"\"\n    headers = {\"User-Agent\": USER_AGENT, \"Accept\": \"application/geo+json\"}\n    async with httpx.AsyncClient() as client:\n        try:\n            response = await client.get(url, headers=headers, timeout=30.0)\n            response.raise_for_status()\n            return response.json()\n        except Exception:\n            return None\n\n\ndef format_alert(feature: dict) -> str:\n    \"\"\"Format an alert feature into a readable string.\"\"\"\n    props = feature[\"properties\"]\n    return f\"\"\"\nEvent: {props.get('event', 'Unknown')}\nArea: {props.get('areaDesc', 'Unknown')}\nSeverity: {props.get('severity', 'Unknown')}\nDescription: {props.get('description', 'No description available')}\nInstructions: {props.get('instruction', 'No specific instructions provided')}\n\"\"\"\n\n\n@mcp.tool()\nasync def get_alerts(state: str) -> str:\n    \"\"\"Get weather alerts for a US state.\n\n    Args:\n        state: Two-letter US state code (e.g. CA, NY)\n    \"\"\"\n    url = f\"{NWS_API_BASE}/alerts/active/area/{state}\"\n    data = await make_nws_request(url)\n\n    if not data or \"features\" not in data:\n        return \"Unable to fetch alerts or no alerts found.\"\n\n    if not data[\"features\"]:\n        return \"No active alerts for this state.\"\n\n    alerts = [format_alert(feature) for feature in data[\"features\"]]\n    return \"\\n---\\n\".join(alerts)\n\n\n@mcp.tool()\nasync def get_forecast(latitude: float, longitude: float) -> str:\n    \"\"\"Get weather forecast for a location.\n\n    Args:\n        latitude: Latitude of the location\n        longitude: Longitude of the location\n    \"\"\"\n    # First get the forecast grid endpoint\n    points_url = f\"{NWS_API_BASE}/points/{latitude},{longitude}\"\n    points_data = await make_nws_request(points_url)\n\n    if not points_data:\n        return \"Unable to fetch forecast data for this location.\"\n\n    # Get the forecast URL from the points response\n    forecast_url = points_data[\"properties\"][\"forecast\"]\n    forecast_data = await make_nws_request(forecast_url)\n\n    if not forecast_data:\n        return \"Unable to fetch detailed forecast.\"\n\n    # Format the periods into a readable forecast\n    periods = forecast_data[\"properties\"][\"periods\"]\n    forecasts = []\n    for period in periods[:5]:  # Only show next 5 periods\n        forecast = f\"\"\"\n{period['name']}:\nTemperature: {period['temperature']}°{period['temperatureUnit']}\nWind: {period['windSpeed']} {period['windDirection']}\nForecast: {period['detailedForecast']}\n\"\"\"\n        forecasts.append(forecast)\n\n    return \"\\n---\\n\".join(forecasts)\n\n\nif __name__ == \"__main__\":\n    # Initialize and run the server\n    mcp.run(transport=\"stdio\")\n"
  },
  {
    "path": "python/tests/parallel_ut_run.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# add test\nimport os\nimport sys\nimport multiprocessing\nimport subprocess\nimport shutil\nimport copy\nimport time\nfrom collections import deque\nimport logging\nimport coverage\n\nlogger = logging.getLogger(\"root\")\nlogger.setLevel(logging.INFO)\nhandler = logging.StreamHandler(sys.stdout)\nlogger.addHandler(handler)\nlogger.propagate = False\ncurrent_path = os.path.dirname(os.path.abspath(__file__))\nparent_path = os.path.dirname(current_path)\n\n\"\"\"\n将Unittest Case分为以下几类\n1、SKIP_UNITTEST\n2、CPU_PARALLEL_RUN_UNITTEST\n3、CPU_SERIAL_RUN_UNITTEST\n4、UNKNOWN_UNITTEST\n\"\"\"\n\n# Coverage 运行命令\nCOVERAGE_CMD = [\"coverage\", \"run\", \"--pylib\", \"--source=appbuilder.core,appbuilder.utils\", \"--parallel-mode\"]\n\n# 需要跳过的单测用例\nSKIP_UNITTEST = []\n\n# 可以CPU并行的单测用例\nCPU_PARALLEL_RUN_UNITTEST = []\n\n# 分类未知，故在CPU上串行执行的单测用例\nUNKNOWN_UNITTEST = []\n\n\ndef choose_test_case(file):\n    \"\"\"\n    选择测试用例，根据不同的环境变量选择对应的测试用例。如果没有找到指定的测试用例，则返回。\n\n    Args:\n        file (str): 文件路径，包含完整路径和文件名。\n\n    Returns:\n        None, str: 无返回值，如果找到了指定的测试用例，将其添加到相应的列表中；否则，返回None。\n    \"\"\"\n    skip_case_str = '@unittest.skip('\n    cpu_parallel_str = '@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\"'\n\n    with open(file, 'r') as f:\n        all_line = f.readlines()\n\n        if list(set([line.strip().find(skip_case_str) for line in all_line])) != [-1]:\n            SKIP_UNITTEST.append(file.split(\"/\")[-1])\n            return\n\n        if list(set([line.strip().find(cpu_parallel_str) for line in all_line])) != [-1]:\n            CPU_PARALLEL_RUN_UNITTEST.append(file.split(\"/\")[-1])\n            return\n\n        UNKNOWN_UNITTEST.append(file.split(\"/\")[-1])\n        return\n\n\ndef get_all_unittest_file():\n    \"\"\"\n    获取当前目录下所有以test开头的.py文件，并返回一个列表，包含这些文件的完整路径名。\n\n    Args:\n        无参数。\n\n    Returns:\n        list (list[str]): 返回一个列表，包含所有以test开头的.py文件的完整路径名。如果没有找到任何文件，则返回一个空列表。\n    \"\"\"\n    for root, _, fs in os.walk(current_path):\n        for f in fs:\n            file = f.split(\".\")[-1]\n            prefix = f.split(\".\")[0].split(\"_\")[0]\n            if file == \"py\" and prefix == \"test\":\n                fullname = os.path.join(root, f)\n                choose_test_case(fullname)\n    \n    logger.info(\"\\n需要跳过的单测用例：{}个\".format(len(SKIP_UNITTEST)))\n    for idx, case in enumerate(SKIP_UNITTEST):\n        logger.info(\"--> {}. {}\".format(idx+1, case))\n\n    logger.info(\"\\nCPU并行的单测用例：{}个\".format(len(CPU_PARALLEL_RUN_UNITTEST)))\n    for idx, case in enumerate(CPU_PARALLEL_RUN_UNITTEST):\n        logger.info(\"--> {}. {}\".format(idx+1, case))\n\n    logger.info(\"\\nCPU串行执行的单测用例：{}个\".format(len(UNKNOWN_UNITTEST)))\n    for idx, case in enumerate(UNKNOWN_UNITTEST):\n        logger.info(\"--> {}. {}\".format(idx+1, case))\n\n\ndef pull_last_n_log(ut_context, file_name, line_count=80):\n    \"\"\"\n    打印最后的line_count行日志，默认为80行。\n\n    Args:\n        ut_context (dict): 测试用例上下文字典，包含了log_file字段，表示错误日志文件路径。\n        file_name (str): 要打印的日志文件名称，将会显示在日志前面。\n        line_count (int, optional): 要打印的行数，默认为80行。\n\n    Returns:\n        None.\n    \"\"\"\n    sys.stdout.write(\"\\nError LOG of {}, at {} :\\n\".format(\n        file_name, os.path.abspath(ut_context[\"log_file\"])))\n    if ut_context[\"log_file\"]:\n        prefix = \"|{} Error LOG| \".format(file_name)\n        sys.stdout.write(\n            prefix + prefix.join(deque(open(ut_context[\"log_file\"], 'r', encoding='utf-8'), line_count)))\n\n\ndef run_sync_unittest(test_file):\n    \"\"\"\n    同步运行单元测试\n    \n    Args:\n        test_file (str): 测试文件名\n    \n    Returns:\n        dict: 包含进程对象、日志文件对象以及开始时间的字典\n    \n    \"\"\"\n    default_env = os.environ.copy()\n    current_env = copy.copy(default_env)\n    current_env[\"PYTHONPATH\"] = parent_path + os.pathsep + current_env.get(\"PYTHONPATH\", \"\")\n    cmd = COVERAGE_CMD + [test_file]\n    log = open(\"{}/ut_logs/{}_run.log\".format(current_path, test_file), \"w\")\n    begin_time = time.time()\n    proc = subprocess.Popen(\n        cmd, env=current_env, cwd=current_path, stdout=log, stderr=log)\n    return {\"process\": proc, \"log\": log, \"begin_time\": begin_time}\n\n\ndef run_async_unittest(test_file, case_idx, case_num, timeout=1200):\n    \"\"\"\n    异步运行单元测试，并记录日志文件和结果。\n\n    Args:\n        test_file (str): 测试文件名，包含路径。\n        case_idx (int): 当前测试用例在所有测试用例中的索引值，从1开始。\n        case_num (int): 所有测试用例的数量。\n        timeout (int, optional): 超时时间，默认为1200秒（20分钟）。\n\n    Returns:\n        None, str: 无返回值，会将结果写入到一个文件中。\n    \"\"\"\n    default_env = os.environ.copy()\n    current_env = copy.copy(default_env)\n    current_env[\"PYTHONPATH\"] = parent_path + os.pathsep + current_env.get(\"PYTHONPATH\", \"\")\n    cmd = COVERAGE_CMD + [test_file]\n    log_file = \"{}/ut_logs/{}_run.log\".format(current_path, test_file)\n    log = open(log_file, \"w\")\n    begin_time = time.time()\n    proc = subprocess.Popen(\n        cmd, env=current_env, cwd=current_path, stdout=log, stderr=log)\n\n    proc.wait(timeout)\n    ret = proc.poll()\n\n    end_time = time.time()\n    with open(\"ut_logs/{}_res\".format(test_file), \"w+\") as f:\n        f.write(str({\"name\": test_file, \"time\": end_time -\n                begin_time, \"status\": ret, \"log_file\": log_file}))\n    logger.info(\"[{}] Test Case : {}/{} 耗时: {:.2f} s --> {}\".format(\"OK\" if ret == 0 else \"ERROR\",\n                                                                    case_idx, case_num, end_time - begin_time, test_file,))\n    return\n\ndef parallel_execute_unittest(test_cases, parallel_num=2):\n    case_num = len(test_cases)\n    success_cases = []\n    failed_cases = []\n\n    process_pool = multiprocessing.Pool(processes=6)\n    for idx, test_file in enumerate(test_cases):\n        process_pool.apply_async(\n            run_async_unittest, args=(test_file, idx+1, case_num,))\n\n    process_pool.close()\n    process_pool.join()\n    total_case_time = 0\n\n    for case in test_cases:\n        if not os.path.exists(\"ut_logs/{}_res\".format(case)):\n            continue\n        with open(\"ut_logs/{}_res\".format(case), 'r') as f:\n            line = f.readlines()[0]\n            message = eval(line.split(\"\\n\")[0])\n\n        if message[\"status\"] == 0:\n            if message[\"name\"] not in success_cases:\n                success_cases.append(message[\"name\"])\n        else:\n            if message[\"name\"] not in failed_cases:\n                failed_cases.append(message[\"name\"])\n                pull_last_n_log(message, message[\"name\"], )\n        total_case_time += message[\"time\"]\n\n    return success_cases, failed_cases, total_case_time\n\n\ndef run_cpu_parallel_unittest():\n    os.environ[\"TEST_CASE\"] = \"CPU_PARALLEL\"\n    logger.info(\"\\n================ CPU_PARALLEL ================\\n\")\n\n    begin_time = time.time()\n    success_cases, failed_cases, total_case_time = parallel_execute_unittest(\n        CPU_PARALLEL_RUN_UNITTEST)\n\n    logger.info(\"\\n CPU_PARALLEL 运行成功单测：{} 个\".format(len(success_cases)))\n\n    if len(failed_cases) > 0:\n        logger.info(\"\\n以下单测失败，将重试运行 2 次\")\n        for case in failed_cases:\n            logger.info(\"retry case --> {}\".format(case))\n        retry_success_cases, retry_failed_cases, retry_case_time = parallel_execute_unittest(\n            failed_cases, 1)\n\n        total_case_time += retry_case_time\n\n        for success in retry_success_cases:\n            failed_cases.remove(success)\n    \n        if len(retry_failed_cases) > 0:\n            logger.info(\"\\n以下单测失败，将重试运行 1 次\")\n            for case in retry_failed_cases:\n                logger.info(\"retry case --> {}\".format(case))\n            second_success_cases, second_failed_cases, second_case_time = parallel_execute_unittest(\n                retry_failed_cases, 1)\n            total_case_time += second_case_time\n            for success in second_success_cases:\n                failed_cases.remove(success)\n\n    end_time = time.time()\n    logger.info(\"\\n CPU_PARALLEL 运行失败单测： {} 个\".format(len(failed_cases)))\n    for failed in failed_cases:\n        logger.info(\"--> {}\".format(failed))\n\n    logger.info(\"\\n CPU_PARALLEL 单测并行运行总计耗时 {} s\".format(\n        end_time - begin_time))\n    logger.info(\"\\n CPU_PARALLEL 单测串行运行总计耗时 {} s\".format(\n        total_case_time))\n\n    return success_cases, failed_cases, end_time - begin_time\n\ndef run_unknown_unittest():\n    os.environ[\"TEST_CASE\"] = \"CPU_SERIAL\"\n    logger.info(\"\\n================ CPU_SERIAL ================\\n\")\n\n    begin_time = time.time()\n    success_cases, failed_cases, total_case_time = parallel_execute_unittest(\n        UNKNOWN_UNITTEST, 1)\n\n    logger.info(\"\\n CPU_SERIAL 运行成功单测：{} 个\".format(len(success_cases)))\n\n    if len(failed_cases) > 0:\n        logger.info(\"\\n以下单测失败，将重试运行一次\")\n        for case in failed_cases:\n            logger.info(\"retry case --> {}\".format(case))\n        retry_success_cases, retry_failed_cases, retry_case_time = parallel_execute_unittest(\n            failed_cases, 1)\n\n        total_case_time += retry_case_time\n\n        for success in retry_success_cases:\n            failed_cases.remove(success)\n\n    end_time = time.time()\n    logger.info(\"\\n CPU_SERIAL 运行失败单测： {} 个\".format(len(failed_cases)))\n    for failed in failed_cases:\n        logger.info(\"--> {}\".format(failed))\n\n    logger.info(\"\\n CPU_SERIAL 单测并行运行总计耗时 {} s\".format(\n        end_time - begin_time))\n    logger.info(\"\\n CPU_SERIAL 单测串行运行总计耗时 {} s\".format(\n        total_case_time))\n\n    return success_cases, failed_cases, end_time - begin_time\n\n\ndef create_unittest_report():\n    \"\"\"\n    生成单元测试报告。\n    \n    Args:\n        无。\n    \n    Returns:\n        无返回值。\n    \n    \"\"\"\n    # 创建日志目录\n    if not os.path.exists(\"./ut_logs\"):\n        os.mkdir(\"./ut_logs\")\n\n    get_all_unittest_file()\n    total_success_cases = []\n    total_failed_cases = []\n    total_ut_time = 0\n\n    test_suite = [run_cpu_parallel_unittest, run_unknown_unittest]\n    for suite in test_suite:\n        success_cases, failed_cases, suite_time = suite()\n        total_success_cases += success_cases\n        total_failed_cases += failed_cases\n        total_ut_time += suite_time\n    \n    logger.info(\"============== Summary Report =============\")\n    logger.info(\"\\nCI运行结束，总耗时：{}\".format(total_ut_time))\n    if len(total_failed_cases) != 0:\n        logger.info(\"\\nCI 运行失败！Failed Case 如下: \")\n        for case in total_failed_cases:\n            logger.info(\"ERROR： {}\".format(case))\n        exit(1)\n    else:\n        logger.info(\"\\nCI 运行成功！\")\n\n    # shutil.rmtree(\"./ut_logs\")\n\n\nif __name__ == '__main__':\n    create_unittest_report()\n"
  },
  {
    "path": "python/tests/print_components_error_info.py",
    "content": "import os\n\ndef pretty_print_dict(kv_dict, header=[\"Key\", \"Value\"]):\n    spacing = 2\n    max_k = 25\n    max_v = 80\n\n    for k, v in kv_dict.items():\n        max_k = max(max_k, len(k))\n\n    h_format = \"    \" + \"{{:^{}s}}{}{{:^{}s}}\\n\".format(max_k, \" \" * spacing,\n                                                          max_v)\n    l_format = \"    \" + \"{{:^{}s}}{{}}{{:<{}s}}\\n\".format(max_k, max_v)\n    length = max_k + max_v + spacing\n\n    front_border = \"    ╔\" + \"\".join([\"═\"] * length) + \"╗\"\n    line = \"    ╠\" + \"\".join([\"═\"] * length) + \"╣\"\n    back_border = \"    ╚\" + \"\".join([\"═\"] * length) + \"╝\"\n\n    draws = \"\"\n    draws += front_border + \"\\n\"\n\n    draws += h_format.format(header[0], header[1])\n\n    draws += line + \"\\n\"\n\n    for k, v in kv_dict.items():\n        if isinstance(v, str) and len(v) >= max_v:\n            str_v = \"... \" + v[-46:]\n        else:\n            str_v = v\n        draws += l_format.format(k, \" \" * spacing, str(str_v))\n    \n    draws += back_border\n\n    _str = \"\\n{}\\n\".format(draws)\n    return _str\n\n\ndef read_error_file(filename):\n    kv_dict = {}\n    with open(filename, 'r', encoding='utf-8') as file:\n        lines = file.readlines()\n        header = lines[0].strip().split('\\t')\n        for line in lines[1:-3]: \n            components = line.strip().split('\\t')\n            if len(components) == 2:\n                kv_dict[components[0]] = components[1]\n    return kv_dict, header\n\n\nif __name__ == \"__main__\":\n    if os.path.exists('components_error_info.txt'):\n        print(\"旧组件:\")\n        filename = 'components_error_info.txt' \n        kv_dict, header = read_error_file(filename)\n        print(pretty_print_dict(kv_dict, header=header))\n    if os.path.exists('v2_components_error_info.txt'):\n        print(\"v2组件:\")\n        filename = 'v2_components_error_info.txt' \n        kv_dict, header = read_error_file(filename)\n        print(pretty_print_dict(kv_dict, header=header))"
  },
  {
    "path": "python/tests/pytest_config.py",
    "content": "\n# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nfrom appbuilder.utils.logger_util import get_logger\nlog = get_logger(__name__)\n\nclass LoadConfig(object):\n    \"\"\"\n    config\n    \"\"\"\n    def __init__(self):\n        \"\"\"\n        初始化函数，读取配置文件并设置实例属性。\n        \"\"\"\n        self.token = os.environ.get(\"APPBUILDER_TOKEN\", \"\")\n        self.console_url = os.environ.get(\"GATEWAY_URL\", \"https://appbuilder.baidu.com\")\n        self.cookie =  os.environ.get(\"COOKIE\", \"\")\n        self.csrftoken = os.environ.get('CSRFTOKEN', \"\")\n\n        log.info(\"token: %s\" % self.token)\n        log.info(\"console_url: %s\" % self.console_url)\n        log.info(\"cookie: %s\" % self.cookie)\n        log.info(\"csrftoken: %s\" % self.csrftoken)\n\n\n\n\n"
  },
  {
    "path": "python/tests/pytest_utils.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport random\nimport string\nimport os\n\nclass Utils(object):\n    \"\"\"\n    utils 方法父类\n    \"\"\"\n    @staticmethod\n    def get_random_string(str_len, prefix=None):\n        \"\"\"\n        生成随机字符串，可指定前缀\n        \"\"\"\n        gen_name = ''.join(\n            random.choice(string.ascii_letters + string.digits) for _ in range(str_len)\n        )\n        if prefix:\n            name = str(prefix) + gen_name\n        else:\n            name = gen_name\n        return name\n\n    @staticmethod\n    def get_data_file(filename):\n        current_dir = os.path.dirname(os.path.abspath(__file__))\n        full_file_path = os.path.join(current_dir, \"data\", filename)\n        return full_file_path\n\n"
  },
  {
    "path": "python/tests/run_python_test.sh",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# 该脚本执行以下功能\n# 1、克隆git仓库: \n# 2、基于环境变量，checkout到指定commit\n# 3、执行setup.sh，生产whl包，并更新当前环境的python库\n# 4、执行parallel_ut_run.py，运行python单元测试\n# 5、基于测试结果计算单测覆盖率\n\n\n# # 1、克隆git仓库\n# git clone https://github.com/baidubce/app-builder.git\n# cd app-builder\n# 1.1、添加提交者的源\n# fork_repo=\"https://github.com/$AGILE_MODULE_NAME.git\"\n# git clone $fork_repo\n# cd app-builder\n# git remote add upstream https://github.com/baidubce/app-builder.git \n# git fetch upstream\n\n\n# # 2、checkout到制定commit\n# # 环境变量形如：AGILE_REVISION=2352a2574bdfcfff22f0ba7413d9318781a85b3d\n# export AGILE_REVISION=2352a2574bdfcfff22f0ba7413d9318781a85b3d\n# commit_id=$AGILE_REVISION\n# # checkout 到指定commit\n# git checkout $commit_id\n# 代码Pass，保存在流水线配置中，并在流水线环境执行\n\n# 3、单测环境的涉密准备\n# 3.1、首先是各个单测所需的token、appid、secret等信息，会保存在仅在百度内网可以下载的环境中\n# 代码Pass，保存在流水线配置中，并在流水线环境执行\n\n# 4、执行setup.py，生产whl包，并更新当前环境的python库\npython3 -m pip install wheel\npython3 -m pip install coverage\npython3 -m pip install diff-cover\n\npython3 setup.py bdist_wheel\npython3 -m pip install --force-reinstall dist/*.whl\npython3 -m pip uninstall numpy -y\npython3 -m pip install numpy==1.26.4\necho \"重新安装pydantic包，设置版本为2.7.4\"\npython3 -m pip uninstall -y pydantic\npython3 -m pip install pydantic==2.7.4\npython3 -m pip install langchain==0.3.0\npython3 -m pip install datamodel-code-generator==0.25.8\npython3 -m pip install jsonschema\npython3 -m pip install mcp; true\ncd python/tests/\n\n\n# 5、执行parallel_ut_run.py，运行python单元测试\npython3 parallel_ut_run.py\n\nrun_result=$?\n\n# 6、基于coverage 测试结果计算全量单测覆盖率\n# coverage combine ./python/tests/\ncoverage combine\ncoverage xml -o coverage.xml \ncoverage html -d coverage_html\necho \"--------------------------\"\necho \"全量代码覆盖率为：\"\ncoverage report -m\necho \"--------------------------\"\n\n# 7、计算增量代码的单测覆盖率\n# 首先需要将coverage.xml里的文件路径替换\n# 规则是：从python lib的安装目录，替换为git clone的目录，举例：\n# 替换前 /Users/chengmo/Library/Python/3.9/lib/python/site-packages/\n# 替换后 /Users/chengmo/workspace/baidu_code/app-builder/\n# 首先获取appbuilder-sdk的python lib的安装目录\npython_lib=$(python3 -m pip show appbuilder-sdk | grep Location | awk '{print $2}')\n# 再获取git clone的目录, 当前目录为 app-builder/python/tests, 取 app-builder/目录\ngit_dir=$(pwd | sed 's/python\\/tests//')\n# 批量替换coverage.xml文件中的python_lib为git_dir，并将源文件备份一个orignal.xml后缀\npython3 -u sed_str.py coverage.xml $python_lib $git_dir\nsed -i 's|/appbuilder|python|g' coverage.xml\n# 最后进行增量代码覆盖率测试\necho \"增量代码覆盖率为：\"\ndiff-cover coverage.xml --compare-branch=upstream/master   --html-report coverage_diff.html --fail-under=90\ncover_result=$?\n\n\necho \"--------------------------\"\necho \"CI 流水线运行结果如下: \"\necho \"单测运行结果: $run_result\"\necho \"单测覆盖率结果: $cover_result\"\necho \"--------------------------\"\n\necho \"--------------------------\"\necho \"Components组件检查规范性检测结果: \"\npython3 print_components_error_info.py\necho \"--------------------------\"\n\n# 若单测失败，则退出\nif [ $run_result -ne 0 ]; then echo \"单测运行失败，请检查错误日志，修复单测后重试\" && exit 1; fi\n\nif [ $cover_result -ne 0 ]; then echo \"增量代码的单元测试覆盖率低于90%，请完善单元测试后重试\" && exit 1; fi\n\n\n"
  },
  {
    "path": "python/tests/sed_str.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# 该文件的作用等同于以 sed -i 命令，对文件进行修改\n# 接受三个输入，分别为文件名，替换原始字符串，替换目标字符串\n# 会将文件中的原始字符串替换为目标字符串\n\nimport sys\nimport os\ndef sed_str(file, old_str, new_str):\n    \"\"\"\n    使用sed命令替换文件中的字符串，并返回修改后的结果。\n\n    Args:\n        file (str): 需要进行字符串替换的文件路径。\n        old_str (str): 需要被替换的原始字符串。\n        new_str (str): 需要替换成的新字符串。\n\n    Returns:\n        int: 返回值为0表示操作成功，其他值表示失败。\n\n    Raises:\n        无。\n    \"\"\"\n    with open(file, 'r') as f:\n        lines = f.read()\n    new_lines = lines.replace(\n        old_str, new_str)\n    with open(file, 'w') as f:\n        f.write(new_lines)\n        f.close()\n    os.chmod(file, 0o755)\n    print(\"sed success!\")\n    return 0    \n\nif __name__ == '__main__':\n    if len(sys.argv) != 4:\n        print(\"Usage: python sed_str.py file old_str new_str\")\n        exit(-1)\n    file = sys.argv[1]\n    old_str = sys.argv[2]\n    new_str = sys.argv[3]\n    sed_str(file, old_str, new_str)"
  },
  {
    "path": "python/tests/test_agent.py",
    "content": "import os\nimport sys\nimport json\nimport subprocess\nimport unittest\nimport pydantic\nimport appbuilder\nfrom appbuilder.core.component import Component\nfrom appbuilder.utils.sse_util import SSEClient\nfrom appbuilder import (\n    AgentRuntime,\n    Message,\n    Playground,\n    AppBuilderClient\n)\n\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\n    def test_no_token_http(self):\n        \"\"\" 测试http \"\"\"\n        component = appbuilder.Playground(\n            prompt_template=\"{query}\",\n            model=\"DeepSeek-V3.1\",\n            lazy_certification=True,\n        )\n        agent = appbuilder.AgentRuntime(component=component)\n        app = agent.create_flask_app(url_rule=\"/chat\")\n        app.config['TESTING'] = True\n        client = app.test_client()\n        \n        payload = {\n            \"message\": {\"query\": \"你好\"},\n            \"stream\": False\n        }\n        headers = {}\n        response = client.post('/chat', json=payload, headers=headers)\n        self.assertNotEqual(response.json.get('code'), 0)\n  \n    def test_err_http(self):\n        \"\"\" 测试http \"\"\"\n        component = appbuilder.Playground(\n            prompt_template=\"{query}\",\n            model=\"DeepSeek-V3.1\",\n            lazy_certification=True,\n        )\n        agent = appbuilder.AgentRuntime(component=component)\n        app = agent.create_flask_app(url_rule=\"/chat\")\n        app.config['TESTING'] = True\n        client = app.test_client()\n        \n        payload = {\n            \"message\": {\"query\": \"你好\"},\n            \"stream\": False\n        }\n        headers = {\n            \"X-Appbuilder-Authorization\": \"...\",\n            \"X-Appbuilder-Token\": \"...\"\n        }\n        response = client.post('/chat', json=payload, headers=headers)\n        self.assertNotEqual(response.json.get('code'), 0)\n        \n    def test_stream_http(self):\n        \"\"\" 测试http \"\"\"\n        component = appbuilder.Playground(\n            prompt_template=\"{query}\",\n            model=\"DeepSeek-V3.1\",\n            lazy_certification=True,\n        )\n        agent = appbuilder.AgentRuntime(component=component)\n        app = agent.create_flask_app(url_rule=\"/chat\")\n        app.config['TESTING'] = True\n        client = app.test_client()\n        \n        payload = {\n            \"message\": {\"query\": \"你好\"},\n            \"stream\": True\n        }\n        headers = {\n            \"X-Appbuilder-Authorization\": os.environ.get(\"APPBUILDER_TOKEN\", \"\"),\n            \"X-Appbuilder-Token\": os.environ.get(\"APPBUILDER_TOKEN\", \"\")\n        }\n        response = client.post('/chat', json=payload, headers=headers)\n        for e in response.text.split(\"\\n\\n\"):\n            data_str = e.strip()\n            if data_str:\n                data_str = data_str[len(\"data: \"):]\n                data = json.loads(data_str)\n                self.assertEqual(data.get('code'), 0)\n        \n    def test_http(self):\n        \"\"\" 测试http \"\"\"\n        component = appbuilder.Playground(\n            prompt_template=\"{query}\",\n            model=\"DeepSeek-V3.1\",\n            lazy_certification=True,\n        )\n        agent = appbuilder.AgentRuntime(component=component)\n        app = agent.create_flask_app(url_rule=\"/chat\")\n        app.config['TESTING'] = True\n        client = app.test_client()\n        \n        payload = {\n            \"message\": {\"query\": \"你好\"},\n            \"stream\": False\n        }\n        headers = {\n            \"X-Appbuilder-Authorization\": os.environ.get(\"APPBUILDER_TOKEN\", \"\"),\n            \"X-Appbuilder-Token\": os.environ.get(\"APPBUILDER_TOKEN\", \"\")\n        }\n        response = client.post('/chat', json=payload, headers=headers)\n        self.assertEqual(response.status_code, 200)\n        self.assertEqual(response.json.get('code'), 0)\n        \n    def test_init_with_valid_component(self):\n        \"\"\" 测试在component有效时运行 \"\"\"\n        component = Playground(\n            prompt_template=\"{query}\",\n            model=\"DeepSeek-V3.1\"\n        )\n        agent = AgentRuntime(component=component)\n\n    def test_init_with_invalid_component(self):\n        \"\"\" 测试在component非法时运行 \"\"\"\n        component = \"invalid_component\"\n        with self.assertRaises(pydantic.ValidationError):\n            agent = AgentRuntime(component=component)\n\n    def test_chat_with_valid_message_and_blocking(self):\n        \"\"\" 测试在消息有效时处理 \"\"\"\n        component = Playground(\n            prompt_template=\"{query}\",\n            model=\"DeepSeek-V3.1\"\n        )\n        agent = appbuilder.AgentRuntime(component=component)\n        message = appbuilder.Message({\"query\": \"你好\"})\n        answer = agent.chat(message, stream=False)\n        self.assertIs(type(answer.content), str)\n\n    def test_chat_with_valid_message_and_streaming(self):\n        \"\"\" 测试在消息有效时处理 \"\"\"\n        component = Playground(\n            prompt_template=\"{query}\",\n            model=\"DeepSeek-V3.1\"\n        )\n        agent = AgentRuntime(component=component)\n        message = Message({\"query\": \"你好\"})\n        answer = agent.chat(message, stream=True)\n        for it in answer.content:\n            self.assertIs(type(it), str)\n\n    # def test_chainlit_agent_component_error(self):\n    #     \"\"\" 测试chainlit agent组件错误 \"\"\"\n    #     component = Component()\n    #     agent = AgentRuntime(component=component)\n    #     subprocess.check_call(\n    #         [sys.executable, \"-m\", \"pip\", \"uninstall\", \"-y\", \"chainlit\"]\n    #     )\n    #     with self.assertRaises(ImportError):\n    #         agent.chainlit_agent()\n    #     subprocess.check_call(\n    #         [sys.executable, \"-m\", \"pip\", \"install\", \"chainlit~=1.0.200\"]\n    #     )\n    #     with self.assertRaises(ValueError):\n    #         agent.chainlit_agent()\n    #     os.environ[\"APPBUILDER_RUN_CHAINLIT\"] = \"1\"\n    #     agent_builder = AppBuilderClient(self.app_id)\n    #     agent = AgentRuntime(component=agent_builder)\n    #     agent.chainlit_agent()\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_ai_search.py",
    "content": "import unittest\nimport appbuilder\nimport os\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAgentRuntime(unittest.TestCase):\n\n    def test_base_search(self):\n        client = appbuilder.AISearch()\n        messages = [\n            {\n                \"role\": \"user\",\n                \"content\": \"请帮我写一个Python程序，实现斐波那契数列的输出。\",\n            }\n        ]\n        msg = client.run(messages=messages)\n        assert msg.content is not None\n    \n    def test_ai_search(self):\n        client = appbuilder.AISearch()\n        messages = [\n            {\n                \"role\": \"user\",\n                \"content\": \"请帮我写一个Python程序，实现斐波那契数列的输出。\",\n            }\n        ]\n        msg = client.run(messages=messages, model=\"deepseek-v3.1-250821\")\n        assert msg.content is not None\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_ai_search_stream.py",
    "content": "import unittest\nimport appbuilder\nimport os\n\n\n# @unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAgentRuntime(unittest.TestCase):\n\n    def test_base_search_stream(self):\n        client = appbuilder.AISearch()\n        messages = [\n            {\n                \"role\": \"user\",\n                \"content\": \"请帮我写一个Python程序，实现斐波那契数列的输出。\",\n            }\n        ]\n        msg = client.run(messages=messages, stream=True)\n        for data in msg.content:\n            print(data)\n    \n    def test_ai_search_stream(self):\n        client = appbuilder.AISearch()\n        messages = [\n            {\n                \"role\": \"user\",\n                \"content\": \"请帮我写一个Python程序，实现斐波那契数列的输出。\",\n            }\n        ]\n        msg = client.run(messages=messages, model=\"deepseek-v3.1-250821\", stream=True)\n        for data in msg.content:\n            print(data)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_all_components.py",
    "content": "from multiprocessing import Pool\nimport os\nimport numpy as np\nimport pandas as pd\nimport unittest\nimport os\n\nfrom appbuilder.core._exception import AppbuilderBuildexException\nfrom component_tool_eval_cases import component_tool_eval_cases\nfrom component_collector import  get_all_components, get_v2_components, get_component_white_list\nfrom component_check import check_component_with_retry, write_error_data\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestComponentManifestsAndToolEval(unittest.TestCase):\n    \"\"\"\n    组件manifests和tool_eval入参测试类\n    Args:\n        无\n    \n    Returns:\n        无返回值\n    \n    Raises:\n        无\n        \n    \"\"\"\n    def setUp(self) -> None:\n        \"\"\"初始化测试用例，设置component名单和白名单，并初始化ComponentCheckBase实例\n        Args:\n            无\n        Returns:\n            无\n        \"\"\"\n        self.all_components = get_all_components()\n        self.v2_components = get_v2_components()\n        self.whitelist_components = get_component_white_list()\n\n    def _test_component(self, components, component_cases, whitelist_components, txt_file_path):\n        \"\"\"测试所有组件的manifests和tool_eval入参\n        Args:\n            无\n        Raises:\n            AppbuilderBuildexException: 如果有任何组件不在白名单中，则抛出异常\n        \"\"\"\n        error_data = []\n        error_stats ={}\n         \n        with Pool(processes=os.cpu_count()) as pool:\n            # 使用pool.map来执行多进程\n            args = []\n            for component, import_res in components.items():\n                if component not in component_cases:\n                    error_data.append({\"Component Name\": component, \"Error Message\": \"{} 没有添加测试case到 \\\n                        component_tool_eval_cases 中\".format(component)})\n                    continue\n                else:\n                    args.append((component, import_res, component_tool_eval_cases[component]))\n            \n            results = pool.map(check_component_with_retry, args)\n            \n            # 合并每个进程返回的错误数据\n            for result in results:\n                error_data.extend(result)\n\n\n        error_df = pd.DataFrame(error_data) if len(error_data) > 0 else None\n\n        if error_df is not None:\n            print(\"\\n错误信息表格:\")\n            print(error_df)\n            # 使用 NumPy 进行统计\n            unique_errors, counts = np.unique(error_df[\"Error Message\"], return_counts=True)\n            error_stats = dict(zip(unique_errors, counts))\n            print(\"\\n错误统计信息:\")\n            for error, count in error_stats.items():\n                print(f\"错误信息: {error}, 出现次数: {count}\")\n            # 将报错信息写入文件\n            write_error_data(txt_file_path, error_df, error_stats)\n\n            # 判断报错组件是否位于白名单中\n            component_names = error_df[\"Component Name\"].tolist()\n            for component_name in component_names:\n                if component_name in whitelist_components:\n                    print(\"{}在白名单中，暂时忽略报错。\".format(component_name), flush=True)\n                else:\n                    raise AppbuilderBuildexException(f\"组件 {component_name} 未在白名单中，请检查是否需要添加到白名单。\")\n\n        else:\n            print(\"\\n所有组件测试通过，无错误信息。\")\n\n    def _test_all_components(self):\n        \"\"\"测试旧版本组件\"\"\"\n        self._test_component(self.all_components, [], self.whitelist_components, 'components_error_info.txt')\n\n    def test_v2_components(self):\n        \"\"\"测试v2版本组件\"\"\"\n        self._test_component(self.v2_components, component_tool_eval_cases, [], 'v2_components_error_info.txt')\n\n\nif __name__ == '__main__':\n    unittest.main() "
  },
  {
    "path": "python/tests/test_animal_recognize.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport requests\nimport appbuilder\nimport os\n\nclass TestAnimalRecognition(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \"\"\"\n        self.animal_recognition = appbuilder.AnimalRecognition()\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        # Recognize animal\n        output = self.animal_recognition.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_url(self):\n        \"\"\"\n        使用图片 URL 进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n        # Create message with image URL\n        message = appbuilder.Message(content={\"url\": image_url})\n        # Recognize animal\n        output = self.animal_recognition.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_timeout_and_retry(self):\n        \"\"\"\n        测试run方法，timeout、retry参数\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        # Recognize animal with timeout and retry parameters\n        output = self.animal_recognition.run(message, timeout=5.0, retry=3)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_invalid_input(self):\n        \"\"\"\n        测试run函数在传入无效输入的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = appbuilder.Message(content={})\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.animal_recognition.run(message)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message(content={\"url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.animal_recognition.run(message)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n        img_name = \"test_img.jpg\"\n        file_urls = {img_name: img_url}\n        result = self.animal_recognition.tool_eval(name=\"animal_recognition\", streaming=True,\n                                                   img_name=img_name, file_urls=file_urls, origin_query=\"\")\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.animal_recognition.tool_eval(name=\"animal_recognition\", streaming=True,\n                                                       origin_query=\"\")\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_assistant_trace.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder import AppBuilderTracer\nfrom appbuilder import AssistantEventHandler\nfrom tests.pytest_utils import Utils\n\ncheck_tool = {\n    \"name\": \"get_cur_whether\",\n    \"description\": \"这是一个获得指定地点天气的工具\",\n    \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n        \"required\": [\n                \"location\"\n            ]\n    }\n}\n\nclass MyEventHandler(AssistantEventHandler):\n    def get_cur_whether(self, location:str, unit:str):\n        return \"{} 的当前温度是30 {}\".format(location, unit)\n    \n    def run_begin(self, status_event):\n        run_id = self.stream_run_context.current_run_id\n        thread_id = self.stream_run_context.current_thread_id\n        print(\"Run_id: {}, Thread_id: {}\".format(run_id, thread_id))\n\n    def run_end(self, status_event):\n        print(\"\\n\", status_event)\n        \n    def tool_step_begin(self, status_event):\n        step_id = self.stream_run_context.current_run_step_id\n        print(\"Step_id: {}\".format(step_id))\n    \n    def tool_calls(self, status_event):\n        current_tool_calls = self.stream_run_context.current_tool_calls\n        for tool_call in current_tool_calls:\n            name = tool_call.function.name\n            \n            if name == \"get_cur_whether\":\n                arguments = tool_call.function.arguments\n                func_res = self.get_cur_whether(**eval(arguments))\n                submit_res = appbuilder.assistant.threads.runs.submit_tool_outputs(\n                    run_id=self.stream_run_context.current_run_id,\n                    thread_id=self.stream_run_context.current_thread_id,\n                    tool_outputs=[\n                        {\"tool_call_id\": tool_call.id,\n                            \"output\": func_res,}\n                    ]\n                )\n\nclass TestAppBuilderTrace(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置测试环境所需的变量。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \n        \"\"\"\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_appbuilder_assistant_trace(self):\n        \"\"\"\n        测试AppBuilder Assistant的追踪功能。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \n        \"\"\"\n        tracer=AppBuilderTracer(\n            enable_phoenix = True,\n            enable_console = True,\n            )\n\n        tracer.start_trace()\n\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_assistant\",\n            description=\"test assistant\",\n            instructions=\"每句话回复前都加上我是秦始皇\"\n        )\n\n        file_path = Utils.get_data_file(\"qa_doc_parser_extract_table_from_doc.png\")\n        file = appbuilder.assistant.assistants.files.create(file_path)\n\n        thread = appbuilder.assistant.threads.create()\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"hello world\",\n            file_ids=[file.id]\n        )\n\n        run_result = appbuilder.assistant.threads.runs.run(\n            thread_id=thread.id,\n            assistant_id=assistant.id\n        )\n\n\n        tracer.end_trace()\n\n    def test_appbuilder_assistant_stream_run(self):\n        tracer=AppBuilderTracer(\n            enable_phoenix = True,\n            enable_console = True,\n            )\n\n        tracer.start_trace()\n\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_assistant\",\n            description=\"test assistant\",\n            instructions=\"每句话回复前都加上我是秦始皇\"\n        )\n\n        file_path = Utils.get_data_file(\"qa_doc_parser_extract_table_from_doc.png\")\n        file = appbuilder.assistant.assistants.files.create(file_path)\n\n        thread = appbuilder.assistant.threads.create()\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"hello world\",\n            file_ids=[file.id]\n        )\n        generator = appbuilder.assistant.threads.runs.stream_run(\n            thread_id=thread.id,\n            assistant_id=assistant.id\n        )\n\n        for run_step in generator:\n            print(run_step)\n        \n        tracer.end_trace()\n            \n\nif __name__ == \"__main__\":\n    unittest.main()"
  },
  {
    "path": "python/tests/test_appbuilder_client.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\nfrom tests.pytest_utils import Utils\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\n    def test_agent_builder_client(self):\n        agent_builder = appbuilder.AppBuilderClient(self.app_id)\n\n    def test_agent_builder_run(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        import tests.pytest_utils as pu\n\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n    \n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        msg = builder.run(conversation_id, \"你可以做什么？\")\n        print(msg)\n        file_path = Utils.get_data_file(\"qa_doc_parser_extract_table_from_doc.png\")\n        respid = builder.upload_local_file(conversation_id, file_path)\n        print(respid)\n        \n    def test_upload_local_file_raise(self):\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        with self.assertRaises(ValueError):\n            builder.upload_local_file(conversation_id='', local_file_path='')\n            \n        with self.assertRaises(ValueError):\n            builder.run(conversation_id='', query='')\n\n        conversation_id = builder.create_conversation()\n        with self.assertRaises(FileNotFoundError):\n            builder.upload_local_file(conversation_id=conversation_id, local_file_path='not_exist')\n    \n    def test_upload_file_url(self):\n        file_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad6862cf937c03f8c5260d51c6ae\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        builder.upload_file(conversation_id=conversation_id, file_url=file_url)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_app_detail.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport appbuilder\nimport os\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestGetAppList(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n        self.chatflow_app_id = \"4403205e-fb83-4fac-96d8-943bdb63796f\"\n\n    def test_describe_app_agent(self):\n        app_case = appbuilder.describe_app(self.app_id)\n        self.assertIsInstance(app_case.id, str)\n        self.assertIsInstance(app_case.name, str)\n        self.assertIsInstance(app_case.description, str)\n\n    def test_describe_app_chatflow(self):\n        app_case = appbuilder.describe_app(self.chatflow_app_id)\n        print(app_case)\n        self.assertIsInstance(app_case.id, str)\n        self.assertIsInstance(app_case.name, str)\n        self.assertIsInstance(app_case.description, str)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_app_list.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport appbuilder\nimport os\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestGetAppList(unittest.TestCase):\n    def test_get_app_list_v1(self):\n        app_list = appbuilder.get_app_list()\n        self.assertIsInstance(app_list, list)\n\n    def test_describe_apps(self):\n        app_list = appbuilder.describe_apps()\n        self.assertIsInstance(app_list, list)\n        app_case = app_list[0]\n        self.assertIsInstance(app_case.id, str)\n        self.assertIsInstance(app_case.name, str)\n        self.assertIsInstance(app_case.description, str)\n        self.assertIn(app_case.appType, [\"chatflow\", \"agent\"])\n        self.assertIsInstance(app_case.isPublished, bool)\n        isSecondTimestamp = str(app_case.updateTime).isdigit() and len(str(app_case.updateTime)) < 13\n        self.assertTrue(isSecondTimestamp)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_chatflow.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client import data_class\n\n\nclass TestAppBuilderClientChatflow(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"4403205e-fb83-4fac-96d8-943bdb63796f\"\n\n    def test_appbuilder_run_chatflow(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLevel(\"ERROR\")\n        interrupt_ids = []\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        msg = builder.run(conversation_id, \"查天气\", stream=True)\n\n        interrupt_event_id = None\n        for ans in msg.content:\n            for event in ans.events:\n                if event.content_type == \"chatflow_interrupt\":\n                    assert event.event_type == \"chatflow\"\n                    interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n                    break\n        self.assertIsNotNone(interrupt_event_id)\n        interrupt_ids.append(interrupt_event_id)\n\n        msg = builder.run(\n            conversation_id,\n            \"查航班\",\n            stream=True,\n            action=data_class.Action.create_resume_action(interrupt_event_id),\n        )\n        interrupt_event_id = None\n        for ans in msg.content:\n            for event in ans.events:\n                if event.content_type == \"chatflow_interrupt\":\n                    assert event.event_type == \"chatflow\"\n                    interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n                    break\n        self.assertIsNotNone(interrupt_event_id)\n        interrupt_ids.append(interrupt_event_id)\n\n        msg2 = builder.run(conversation_id=conversation_id,\n                           query=\"CA1234\", stream=True,\n                           action=data_class.Action.create_resume_action(interrupt_ids.pop()))\n        interrupt_event_id = None\n        for ans in msg2.content:\n            for event in ans.events:\n                if event.content_type == \"chatflow_interrupt\":\n                    assert event.event_type == \"chatflow\"\n                    interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n                    interrupt_ids.append(interrupt_event_id)\n                    break\n\n        msg2 = builder.run(conversation_id=conversation_id,\n                           query=\"北京的\", stream=True,\n                           action=data_class.Action.create_resume_action(interrupt_ids.pop()))\n        has_multiple_dialog_event = False\n        for ans in msg2.content:\n            for event in ans.events:\n                if event.content_type == \"multiple_dialog_event\":\n                    assert event.event_type == \"chatflow\"\n                    has_multiple_dialog_event = True\n                    break\n        self.assertTrue(has_multiple_dialog_event)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_chatflow_event_handler.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.event_handler import (\n    AppBuilderEventHandler,\n)\n\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def __init__(self):\n        super().__init__()\n        self.interrupt_ids = []\n\n    def handle_content_type(self, run_context, run_response):\n        interrupt_event_id = None\n        event = run_response.events[-1]\n        if event.content_type == \"chatflow_interrupt\":\n            interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n        if interrupt_event_id is not None:\n            self.interrupt_ids.append(interrupt_event_id)\n\n    def _create_action(self):\n        if len(self.interrupt_ids) == 0:\n            return None\n        event_id = self.interrupt_ids.pop()\n        return {\n            \"action_type\": \"resume\",\n            \"parameters\": {\"interrupt_event\": {\"id\": event_id, \"type\": \"chat\"}},\n        }\n\n    def run(self, query=None):\n        super().new_dialog(\n            query=query,\n            action=self._create_action(),\n        )\n\n\nclass TestAppBuilderClientChatflow(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"4403205e-fb83-4fac-96d8-943bdb63796f\"\n\n    def test_appbuilder_client_run_with_handler_stream(self):\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n\n        event_handler = MyEventHandler()\n        event_handler.init(appbuilder_client=builder,\n                           conversation_id=conversation_id, stream=True, query=\"查天气\")\n        for data in event_handler:\n            pass\n        event_handler.run(\n            query=\"查航班\",\n        )\n        for data in event_handler:\n            pass\n        event_handler.run(\n            query=\"CA1234\",\n        )\n        for data in event_handler:\n            pass\n        event_handler.run(\n            query=\"北京的\",\n        )\n        for data in event_handler:\n            pass\n\n    def test_appbuilder_client_run_with_handler(self):\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n\n        event_handler = MyEventHandler()\n        event_handler.init(\n            appbuilder_client=builder,\n            conversation_id=conversation_id,\n            stream=False,\n            query=\"查天气\",\n        )\n        for data in event_handler:\n            pass\n        event_handler.run(\n            query=\"查航班\",\n        )\n        for data in event_handler:\n            pass\n        event_handler.run(\n            query=\"CA1234\",\n        )\n        for data in event_handler:\n            pass\n        event_handler.run(\n            query=\"北京的\",\n        )\n        for data in event_handler:\n            pass\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_chatflow_event_handler_v2.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.event_handler import (\n    AppBuilderEventHandler,\n)\n\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def __init__(self):\n        super().__init__()\n        self.interrupt_ids = []\n\n    def handle_content_type(self, run_context, run_response):\n        interrupt_event_id = None\n        event = run_response.events[-1]\n        if event.content_type == \"chatflow_interrupt\":\n            interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n        if interrupt_event_id is not None:\n            self.interrupt_ids.append(interrupt_event_id)\n\n    def _create_action(self):\n        if len(self.interrupt_ids) == 0:\n            return None\n        event_id = self.interrupt_ids.pop()\n        return {\n            \"action_type\": \"resume\",\n            \"parameters\": {\"interrupt_event\": {\"id\": event_id, \"type\": \"chat\"}},\n        }\n\n    def gen_action(self):\n        while True:\n            yield self._create_action()\n\n\nclass TestAppBuilderClientChatflow(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"4403205e-fb83-4fac-96d8-943bdb63796f\"\n\n    def test_appbuilder_client_run_with_handler_multiple_dialog(self):\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLevel(\"DEBUG\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n\n        queries = [\"查天气\", \"查航班\", \"CA1234\", \"北京的\"]\n        event_handler = MyEventHandler()\n        event_handler = builder.run_multiple_dialog_with_handler(\n            conversation_id=conversation_id,\n            queries=queries,\n            event_handler=event_handler,\n            stream=True,\n            actions=event_handler.gen_action(),\n        )\n        for data in event_handler:\n            for ans in data:\n                pass\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_custom_metadata.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.data_class import CustomMetadata\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientFeedback(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"a3654cd9-378a-4b46-a33b-2259ca3b304e\"\n\n    def test_appbuilder_custom_metadata(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLoglevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        msg = builder.run(conversation_id, \"我要回老家相亲\", stream=False, custom_metadata=CustomMetadata(\n            override_role_instruction=\"# 角色任务\\n\" +\n                                         \"作为高情商大师，你的主要任务是根据提问，做出最佳的建议。\\n\" +\n                                         \"\\n\" +\n                                         \"# 工具能力\\n\" +\n                                         \"\\n\" +\n                                         \"无工具集提供\\n\" +\n                                         \"\\n\" +\n                                         \"# 要求与限制\\n\" +\n                                         \"\\n\" +\n                                         \"1. 输出内容的风格为幽默\\n\" +\n                                         \"2.输出的字数限制为100字以内\",\n        ))\n\n        print(msg.content.answer)\n\n    def test_appbuilder_custom_metadata_stream(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLoglevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        msg = builder.run(conversation_id, \"我要回老家相亲\", stream=True, custom_metadata=CustomMetadata(\n            override_role_instruction=\"# 角色任务\\n\" +\n                                         \"作为高情商大师，你的主要任务是根据提问，做出最佳的建议。\\n\" +\n                                         \"\\n\" +\n                                         \"# 工具能力\\n\" +\n                                         \"\\n\" +\n                                         \"无工具集提供\\n\" +\n                                         \"\\n\" +\n                                         \"# 要求与限制\\n\" +\n                                         \"\\n\" +\n                                         \"1. 输出内容的风格为幽默\\n\" +\n                                         \"2.输出的字数限制为100字以内\",\n        ))\n        for content in msg.content:\n            print(content.answer)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_feedback.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientFeedback(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"fb64d96b-f828-4385-ba1d-835298d635a9\"\n\n    def test_appbuilder_feedback(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLoglevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        msg = builder.run(conversation_id, \"你能做什么\", stream=False)\n        message_id = msg.content.message_id\n        builder.feedback(\n            conversation_id=conversation_id,\n            message_id=message_id,\n            type=\"downvote\",\n            flag=[\"没有帮助\"],\n            reason=\"测试\"\n        )\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_follow_up_query.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.event_handler import (\n    AppBuilderEventHandler,\n)\n\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def __init__(self):\n        super().__init__()\n        self.follow_up_queries = []\n\n    def handle_content_type(self, run_context, run_response):\n        for event in run_response.events:\n            print(event)\n            if event.content_type == \"json\" and event.event_type == \"FollowUpQuery\":\n                follow_up_queries = event.detail.get(\"json\").get(\"follow_up_querys\")\n                self.follow_up_queries.extend(follow_up_queries)\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientChatflow(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"fb64d96b-f828-4385-ba1d-835298d635a9\"\n\n    def test_appbuilder_run_follow_up_query(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLoglevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        msg = builder.run(conversation_id, \"你能做什么\", stream=True)\n\n        for ans in msg.content:\n            for event in ans.events:\n                if event.content_type == \"json\" and event.event_type == \"FollowUpQuery\":\n                    follow_up_query = event.detail.get(\n                        \"json\").get(\"follow_up_querys\")[0]\n                    print(follow_up_query)\n                    assert follow_up_query is not None\n\n    def test_appbuilder_run_followupquery_with_event_handler(self):\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLoglevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n\n        event_handler = MyEventHandler()\n        with builder.run_with_handler(\n            conversation_id = conversation_id,\n            query = \"你能做什么\",\n            stream=False,\n            event_handler=event_handler,\n        ) as run:\n            run.until_done()\n\n        print(event_handler.follow_up_queries)\n        assert len(event_handler.follow_up_queries) > 0\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_mcp.py",
    "content": "import unittest\nimport appbuilder\nimport os\nimport sys\nimport subprocess\nimport asyncio\n\nfrom appbuilder.core.console.appbuilder_client.async_event_handler import (\n    AsyncToolCallEventHandler,\n)\n\n\n@appbuilder.manifest(\n    description=\"获取指定中国城市的当前天气信息。仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\"\n)\n@appbuilder.manifest_parameter(\n    name=\"location\", description=\"城市名，例如：北京。\"\n)\n@appbuilder.manifest_parameter(\n    name=\"unit\", description=\"温度单位，支持 'celsius' 或 'fahrenheit'\"\n)\ndef get_current_weather(location: str, unit: str) -> str:\n    return \"北京今天25度\"\n\n\nfunctions = [get_current_weather]\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientMCP(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\n    def test_appbuilder_client_mcp(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n\n        async def process():\n            tools = [appbuilder.Manifest.from_function(f) for f in functions]\n            mcp_client = MCPClient()\n            await mcp_client.connect_to_server(\"./data/mcp_component_server_sample.py\")\n            tools.extend(mcp_client.tools)\n\n            appbuilder_client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await appbuilder_client.create_conversation()\n\n            event_handler = AsyncToolCallEventHandler(\n                mcp_client, functions=functions)\n            with await appbuilder_client.run_with_handler(\n                conversation_id=conversation_id,\n                query=\"北京的天气怎么样\",\n                tools=tools,\n                event_handler=event_handler,\n                stream=False,\n            ) as run:\n                await run.until_done()\n\n            with await appbuilder_client.run_with_handler(\n                conversation_id=conversation_id,\n                query=\"翻译hello world为中文\",\n                tools=tools,\n                event_handler=event_handler,\n                stream=True,\n            ) as run:\n                await run.until_done()\n            \n\n            await appbuilder_client.http_client.session.close()\n            await mcp_client.cleanup()\n\n        from appbuilder.mcp_server.client import MCPClient\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(process())\n\n\nif __name__ == \"__main__\":\n    appbuilder.logger.setLoglevel(\"DEBUG\")\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_mcp_component.py",
    "content": "import unittest\nimport appbuilder\nimport os\nimport sys\nimport asyncio\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\n    def test_appbuilder_client_mcp_component(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        async def process(mcp_client):\n            client = appbuilder.AppBuilderClient(self.app_id)\n            conversation_id = client.create_conversation()\n\n            await mcp_client.connect_to_server(\n                \"./data/mcp_component_server_sample.py\",\n                env={\"APPBUILDER_TOKEN\": os.getenv(\"APPBUILDER_TOKEN\")},\n            )\n            msg = client.run(\n                conversation_id=conversation_id,\n                query=\"将“测试效果”翻译成英文\",\n                tools=mcp_client.tools,\n            )\n\n            event = msg.content.events[-1]\n            assert event.status == \"interrupt\"\n            assert event.event_type == \"Interrupt\"\n            assert client._mcp_context == \"client\"\n            print(\n                \"\\033[1;31m\",\n                \"Agent思考过程：\\n{}\\n\".format(\n                    msg.content.events[-1].model_dump_json(indent=4)\n                ),\n                \"\\033[0m\",\n            )\n\n            tool_call = msg.content.events[-1].tool_calls[-1]\n            tool_call_id = tool_call.id\n            tool_call_arg = tool_call.function.arguments\n\n            print(\"\\033[1;32m\", \"MCP参数:{}\\n\".format(tool_call_arg), \"\\033[0m\")\n            mcp_server_result = await mcp_client.session.call_tool(\n                name=tool_call.function.name, arguments=tool_call.function.arguments\n            )\n            print(\"\\033[1;33m\", \"MCP结果: {}\\n\".format(mcp_server_result))\n            msg_2 = client.run(\n                conversation_id=conversation_id,\n                tool_outputs=[{\n                    \"tool_call_id\": tool_call_id,\n                    \"output\": mcp_server_result.content[0].text\n                }]\n            )\n            assert client._mcp_context == \"client\"\n            print(\n                \"\\033[1;34m\",\n                \"Agent 最终结果:{}\".format(msg_2.content.answer),\n                \"\\033[0m\",\n            )\n\n        async def handler():\n            mcp_client = MCPClient()\n            try:\n                await process(mcp_client)\n            finally:\n                await mcp_client.cleanup()\n\n        from appbuilder.mcp_server.client import MCPClient\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(handler())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_mcp_official.py",
    "content": "import unittest\nimport appbuilder\nimport os\nimport sys\nimport subprocess\nimport asyncio\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\n    def test_appbuilder_client_mcp_official(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        async def process(mcp_client):\n            client = appbuilder.AppBuilderClient(self.app_id)\n            conversation_id = client.create_conversation()\n\n            await mcp_client.connect_to_server(\"./data/mcp_official_server_sample.py\")\n            msg = client.run(\n                conversation_id=conversation_id,\n                query=\"latitude:51.5，longtitude:-0.12\",\n                tools=mcp_client.tools,\n            )\n\n            event = msg.content.events[-1]\n            assert event.status == \"interrupt\"\n            assert event.event_type == \"Interrupt\"\n\n            print(\n                \"\\033[1;31m\",\n                \"Agent思考过程：\\n{}\\n\".format(\n                    msg.content.events[-1].model_dump_json(indent=4)\n                ),\n                \"\\033[0m\",\n            )\n\n            tool_call = msg.content.events[-1].tool_calls[-1]\n            tool_call_id = tool_call.id\n            tool_call_arg = tool_call.function.arguments\n\n            print(\"\\033[1;32m\", \"MCP参数:{}\\n\".format(tool_call_arg), \"\\033[0m\")\n            mcp_server_result = await mcp_client.session.call_tool(\n                name=tool_call.function.name, arguments=tool_call.function.arguments\n            )\n            print(\"\\033[1;33m\", \"MCP结果: {}\\n\".format(mcp_server_result))\n            msg_2 = client.run(\n                conversation_id=conversation_id,\n                tool_outputs=[{\n                    \"tool_call_id\": tool_call_id,\n                    \"output\": mcp_server_result.content[0].text\n                }]\n            )\n            print(\n                \"\\033[1;34m\",\n                \"Agent 最终结果:{}\".format(msg_2.content.answer),\n                \"\\033[0m\",\n            )\n\n        async def handler():\n            mcp_client = MCPClient()\n            try:\n                await process(mcp_client)\n            finally:\n                await mcp_client.cleanup()\n\n        from appbuilder.mcp_server.client import MCPClient\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(handler())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_parameters.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientFeedback(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"2313e282-baa6-4db6-92dd-a21e99cfd59e\"\n\n    def test_appbuilder_parameters(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLoglevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        msg = builder.run(conversation_id, \"国庆长假\", stream=False, parameters={\"city\": \"北京\"})\n        print(msg.content.answer)\n\n    def test_appbuilder_parameters_stream(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        if len(self.app_id) == 0:\n            self.skipTest(\"self.app_id is empty\")\n        appbuilder.logger.setLoglevel(\"ERROR\")\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        msg = builder.run(conversation_id, \"国庆长假\", stream=True, parameters={\"city\": \"北京\"})\n\n        for content in msg.content:\n            print(content.answer)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_run_with_handler.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\n\ntools = {\n    \"name\": \"get_weather\",\n    \"description\": \"这是一个获得指定地点天气的工具\",\n    \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n        \"required\": [\n                \"location\"\n            ]\n    }\n}\n\nfrom appbuilder.core.console.appbuilder_client.event_handler import (\n    AppBuilderEventHandler,\n)\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def get_weather(self, location: str, unit: str):\n        return \"{} 的当前温度是30 {}\".format(location, unit)\n    \n    def messages(self, event):\n        info = \"\"\n        print(\"\\n\\033[1;31m\",\"-> Agent 回答: \", info, \"\\033[0m\")\n\n    def tool_calls(self, event):\n        current_tool_calls = None\n        for tool_call in current_tool_calls:\n            tool_call_id = tool_call.id\n            func_name = tool_call.function.name\n            arguments = tool_call.function.arguments\n\n            result = \"\"\n            if func_name == \"get_weather\":\n                result = self.get_weather(**arguments)\n            \n        return [result]\n                \n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        msg = builder.run(\n            conversation_id=conversation_id,\n            query=\"今天北京天气怎么样？\",\n            tools=tools)\n        print(msg.model_dump_json(indent=4))\n\n        event = msg.content.events[-1]\n        assert event.status == \"interrupt\"\n        assert event.event_type == \"Interrupt\"\n\n        msg_2 = builder.run(\n            conversation_id=conversation_id,\n            tool_outputs=[\n                {\n                    \"tool_call_id\": event.tool_calls[-1].id,\n                    \"output\": \"北京今天35度\"\n                }\n            ]\n        )\n        print(msg_2.model_dump_json(indent=4))\n\n        \n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall.py",
    "content": "import unittest\nimport appbuilder\nimport os\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        client = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = client.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\n                                \"type\": \"string\",\n                                \"enum\": [\"celsius\", \"fahrenheit\"],\n                            },\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        msg = client.run(\n            conversation_id=conversation_id, query=\"今天北京天气怎么样？\", tools=tools\n        )\n        print(msg.model_dump_json(indent=4))\n\n        event = msg.content.events[-1]\n        assert event.status == \"interrupt\"\n        assert event.event_type == \"Interrupt\"\n\n        msg_2 = client.run(\n            conversation_id=conversation_id,\n            tool_outputs=[\n                {\"tool_call_id\": event.tool_calls[-1].id, \"output\": \"北京今天35度\"}\n            ],\n        )\n        print(msg_2.model_dump_json(indent=4))\n\n    def test_appbuilder_client_tool_call_from_function(self):\n        \"\"\"测试functions2model功能\"\"\"\n        # 定义本地函数\n        def get_current_weather(location: str, unit: str) -> str:\n            \"\"\"获取指定中国城市的当前天气信息。\n\n            仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\n\n            Args:\n                location (str): 城市名，例如：\"北京\"。\n                unit (int): 温度单位，支持 \"celsius\" 或 \"fahrenheit\"。\n\n            Returns:\n                str: 天气情况描述\n            \"\"\"\n            return \"北京今天25度\"\n\n        # 定义函数列表\n        functions = [get_current_weather]\n        function_map = {f.__name__: f for f in functions}\n\n        client = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = client.create_conversation()\n        msg = client.run(\n            conversation_id=conversation_id,\n            query=\"今天北京的天气怎么样？\",\n            tools=[\n                appbuilder.Manifest.from_function(f) for f in functions\n            ],\n        )\n        print(msg.model_dump_json(indent=4))\n        event = msg.content.events[-1]\n        tool_call = event.tool_calls[-1]\n\n        # 获取函数名称和参数\n        name = tool_call.function.name\n        args = tool_call.function.arguments\n\n        # 将函数名称映射到具体的函数并执行\n        raw_result = function_map[name](**args)\n\n        # 传递工具的输出\n        msg_2 = client.run(\n            conversation_id=conversation_id,\n            tool_outputs=[{\"tool_call_id\": tool_call.id, \"output\": str(raw_result)}],\n        )\n        print(msg_2.model_dump_json(indent=4))\n\n    def test_appbuilder_client_tool_call_from_function_decorator(self):    \n        @appbuilder.manifest(\n            description=\"获取指定中国城市的当前天气信息。仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\"\n        )\n        @appbuilder.manifest_parameter(\n            name=\"location\", description=\"城市名，例如：北京。\"\n        )\n        @appbuilder.manifest_parameter(\n            name=\"unit\", description=\"温度单位，支持 'celsius' 或 'fahrenheit'\"\n        )\n        # 定义示例函数\n        def get_current_weather(location: str, unit: str) -> str:\n            return \"北京今天25度\"\n\n        # 定义函数列表\n        functions = [get_current_weather]\n        function_map = {f.__name__: f for f in functions}\n        # 调用大模型\n        client = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = client.create_conversation()\n        msg = client.run(\n            conversation_id=conversation_id,\n            query=\"今天北京的天气怎么样？\",\n            tools=[\n                appbuilder.Manifest.from_function(f) for f in functions\n            ],\n        )\n        print(msg.model_dump_json(indent=4))\n        # 获取最后的事件和工具调用信息\n        event = msg.content.events[-1]\n        tool_call = event.tool_calls[-1]\n\n        # 获取函数名称和参数\n        name = tool_call.function.name\n        args = tool_call.function.arguments\n\n        # 将函数名称映射到具体的函数并执行\n        raw_result = function_map[name](**args)\n\n        # 传递工具的输出\n        msg_2 = client.run(\n            conversation_id=conversation_id,\n            tool_outputs=[{\"tool_call_id\": tool_call.id, \"output\": str(raw_result)}],\n        )\n        print(msg_2.model_dump_json(indent=4))\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall_event_handler.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\nfrom appbuilder.core.console.appbuilder_client.event_handler import AppBuilderEventHandler\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def get_current_weather(self, location=None, unit=\"摄氏度\"):\n        return \"{} 的温度是 {} {}\".format(location, 20, unit)\n    \n    def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        # 绿色打印\n        print(\"\\033[1;32m\", \"-> Agent 中间思考: \", thought, \"\\033[0m\")\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            tool_call_id = tool_call.id\n            tool_res = self.get_current_weather(\n                **tool_call.function.arguments)\n            # 蓝色打印\n            print(\"\\033[1;34m\", \"-> 本地ToolCall结果: \", tool_res, \"\\033[0m\\n\")\n            tool_output.append(\n                {\n                    \"tool_call_id\": tool_call_id,\n                    \"output\": tool_res\n                }\n            )\n        return tool_output\n    \n    def success(self, run_context, run_response):\n        print(\"\\n\\033[1;31m\",\"-> Agent 非流式回答: \", run_response.answer, \"\\033[0m\")\n        \n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"摄氏度\", \"华氏度\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        cities = [\"北京\", \"上海\", \"广州\"]\n        query = \"下面这些城市的天气怎么样：{}\".format(\",\".join(cities))\n\n        with builder.run_with_handler(\n            conversation_id = conversation_id,\n            query = query,\n            tools = tools,\n            event_handler = MyEventHandler(),\n        ) as run:\n            run.until_done()\n\n        \nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall_event_handler_error.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\nfrom appbuilder.core.console.appbuilder_client.event_handler import AppBuilderEventHandler\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def get_current_weather(self, location=None, unit=\"摄氏度\"):\n        return \"{} 的温度是 {} {}\".format(location, 20, unit)\n    \n    def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        # 绿色打印\n        print(\"\\033[1;32m\", \"-> Agent 中间思考: \", thought, \"\\033[0m\")\n\n        empty_output = [{}]\n        return empty_output\n    \n    def success(self, run_context, run_response):\n        print(\"\\n\\033[1;31m\",\"-> Agent 非流式回答: \", run_response.answer, \"\\033[0m\")\n        \n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"摄氏度\", \"华氏度\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        cities = [\"北京\", \"上海\", \"广州\"]\n        query = \"下面这些城市的天气怎么样：{}\".format(\",\".join(cities))\n\n        with self.assertRaises(Exception):\n            stream = builder.run_with_handler(\n                conversation_id = conversation_id,\n                query = query,\n                tools = tools,\n                event_handler = MyEventHandler(),\n            )\n            for res in stream:\n                pass\n\n        conversation_id = builder.create_conversation()\n        with self.assertRaises(Exception):\n            stream = builder.run_with_handler(\n                conversation_id = conversation_id,\n                query = query,\n                tools = tools,\n                stream = True,\n                event_handler = MyEventHandler(),\n            )\n            for res in stream:\n                pass\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall_event_handler_stream.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\nfrom appbuilder.core.console.appbuilder_client.event_handler import AppBuilderEventHandler\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def get_current_weather(self, location=None, unit=\"摄氏度\"):\n        return \"{} 的温度是 {} {}\".format(location, 20, unit)\n    \n    def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        # 绿色打印\n        print(\"\\033[1;32m\", \"-> Agent 中间思考: \", thought, \"\\033[0m\")\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            tool_call_id = tool_call.id\n            tool_res = self.get_current_weather(\n                **tool_call.function.arguments)\n            # 蓝色打印\n            print(\"\\033[1;34m\", \"-> 本地ToolCall结果: \", tool_res, \"\\033[0m\\n\")\n            tool_output.append(\n                {\n                    \"tool_call_id\": tool_call_id,\n                    \"output\": tool_res\n                }\n            )\n        return tool_output\n    \n    def running(self, run_context, run_response):\n        print(\"\\n\\033[1;31m\",\"-> Agent 流式回答: \\n\", run_response.answer, \"\\033[0m\")\n        \n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"摄氏度\", \"华氏度\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        cities = [\"北京\", \"上海\", \"广州\"]\n        query = \"下面这些城市的天气怎么样：{}\".format(\",\".join(cities))\n\n        with builder.run_with_handler(\n            conversation_id = conversation_id,\n            query = query,\n            tools = tools,\n            stream = True,\n            event_handler = MyEventHandler(),\n        ) as run:\n            run.until_done()\n\n        \nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall_event_handler_v2.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\nfrom appbuilder.core.console.appbuilder_client.event_handler import AppBuilderEventHandler\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def get_current_weather(self, location=None, unit=\"摄氏度\"):\n        return \"{} 的温度是 {} {}\".format(location, 20, unit)\n    \n    def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        # 绿色打印\n        print(\"\\033[1;32m\", \"-> Agent 中间思考: \", thought, \"\\033[0m\")\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            tool_call_id = tool_call.id\n            tool_res = self.get_current_weather(\n                **tool_call.function.arguments)\n            # 蓝色打印\n            print(\"\\033[1;34m\", \"-> 本地ToolCall结果: \", tool_res, \"\\033[0m\\n\")\n            tool_output.append(\n                {\n                    \"tool_call_id\": tool_call_id,\n                    \"output\": tool_res\n                }\n            )\n        return tool_output\n    \n    def success(self, run_context, run_response):\n        print(\"\\n\\033[1;31m\",\"-> Agent 非流式回答: \", run_response.answer, \"\\033[0m\")\n        \n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"摄氏度\", \"华氏度\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        query = \"北京的天气怎么样\"\n\n        with builder.run_with_handler(\n            conversation_id = conversation_id,\n            query = query,\n            tools = tools,\n            event_handler = MyEventHandler(),\n        ) as run:\n            run.until_done()\n\n        query = \"上海的天气怎么样\"\n        run = builder.run_with_handler(\n            conversation_id = conversation_id,\n            query = query,\n            tools = tools,\n            event_handler = MyEventHandler(),\n        )\n        for res in run:\n            print(res)\n\n        \nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall_event_handler_v3.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\nfrom appbuilder.core.console.appbuilder_client.event_handler import AppBuilderEventHandler\n\nclass MyEventHandler(AppBuilderEventHandler):\n    def get_current_weather(self, location=None, unit=\"摄氏度\"):\n        return \"{} 的温度是 {} {}\".format(location, 20, unit)\n    \n    def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        # 绿色打印\n        print(\"\\033[1;32m\", \"-> Agent 中间思考: \", thought, \"\\033[0m\")\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            tool_call_id = tool_call.id\n            tool_res = self.get_current_weather(\n                **tool_call.function.arguments)\n            # 蓝色打印\n            print(\"\\033[1;34m\", \"-> 本地ToolCall结果: \", tool_res, \"\\033[0m\\n\")\n            tool_output.append(\n                {\n                    \"tool_call_id\": tool_call_id,\n                    \"output\": tool_res\n                }\n            )\n        return tool_output\n\n    def running(self, run_context, run_response):\n        print(\"\\n\\033[1;31m\",\"-> Agent 流式回答: \\n\", run_response.answer, \"\\033[0m\")\n  \n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"摄氏度\", \"华氏度\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        query = \"北京的天气怎么样\"\n\n        with builder.run_with_handler(\n            conversation_id = conversation_id,\n            query = query,\n            tools = tools,\n            stream = True,\n            event_handler = MyEventHandler(),\n        ) as run:\n            run.until_done()\n\n        query = \"上海的天气怎么样\"\n        run = builder.run_with_handler(\n            conversation_id = conversation_id,\n            query = query,\n            tools = tools,\n            stream= True,\n            event_handler = MyEventHandler(),\n        )\n        for res in run:\n            print(res)\n\n        \nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall_stream.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        msg = builder.run(\n            conversation_id=conversation_id,\n            query=\"今天北京天气怎么样？\",\n            tools=tools,\n            stream=True)\n        for res in msg.content:\n            print(res.model_dump_json(indent=4))\n            if len(res.events) > 0:\n                event = res.events[-1]\n\n        assert event.status == \"interrupt\"\n        assert event.event_type == \"Interrupt\"\n\n        msg_2 = builder.run(\n            conversation_id=conversation_id,\n            tool_outputs=[\n                {\n                    \"tool_call_id\": event.tool_calls[-1].id,\n                    \"output\": \"北京今天35度\"\n                }\n            ],\n            stream=True\n        )\n\n        for res in msg_2.content:\n            print(res.model_dump_json(indent=4))\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall_v2.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"支持多个中国城市的天气查询，参数location为一个list，包含多个中国城市名称\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {'items': {'type': 'string'}, 'title': 'Location', 'type': 'array'},\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        msg = builder.run(\n            conversation_id=conversation_id,\n            query=\"今天北京和上海天气怎么样？\",\n            tools=tools)\n        print(msg.model_dump_json(indent=4))\n\n        event = msg.content.events[-1]\n        assert event.status == \"interrupt\"\n        assert event.event_type == \"Interrupt\"\n\n        msg_2 = builder.run(\n            conversation_id=conversation_id,\n            tool_outputs=[\n                {\n                    \"tool_call_id\": event.tool_calls[-1].id,\n                    \"output\": \"北京和上海今天都是35度\"\n                }\n            ]\n        )\n        print(msg_2.model_dump_json(indent=4))\n\n        \nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_toolcall_v3.py",
    "content": "import unittest\nimport appbuilder\nimport requests\nimport tempfile\nimport os\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\",\"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n    \n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n    \n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        cities = [\"北京\", \"上海\", \"广州\", \"深圳\", \"杭州\"]\n        query = \"下面这些城市的天气怎么样：{}\".format(\",\".join(cities))\n        msg = builder.run(\n            conversation_id=conversation_id,\n            query=query,\n            tools=tools)\n        print(\"------ Response: --------\\n\")\n        print(msg.model_dump_json(indent=4))\n        print(\"------ End of response--------\\n\")\n        event = msg.content.events[-1]\n\n        idx = 0\n        while True:\n            if event.status == \"success\":\n                break\n\n            msg_2 = builder.run(\n                conversation_id=conversation_id,\n                tool_outputs=[\n                    {\n                        \"tool_call_id\": event.tool_calls[-1].id,\n                        \"output\": \"{}今天的温度是35度\".format(cities[idx])\n                    }\n                ]\n            )\n            idx += 1\n            print(\"------ Response: --------\\n\")\n            print(msg_2.model_dump_json(indent=4))\n            print(\"------ End of response--------\\n\")\n            event = msg_2.content.events[-1]\n        \n        print(msg.content.answer)\n\n        \n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_client_trace.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport appbuilder\nimport os\n\nfrom appbuilder.utils.trace.tracer import AppBuilderTracer, AppbuilderInstrumentor\nfrom appbuilder.utils.trace.phoenix_wrapper import runtime_main,stop_phoenix,launch_phoenix\nfrom appbuilder.core.console.appbuilder_client import get_app_list\n\nclass TestAppBuilderTrace(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        初始化方法，用于设置测试前的环境。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \n        \"\"\"\n        self.app_id = \"2a19f6dd-de02-46d9-841d-ef5c52b00466\"\n    \n    def test_appbuilder_client_trace_un_stream(self):\n        \"\"\"\n        测试AppBuilderClient的跟踪功能\n        \n        Args:\n            无\n        \n        Returns:\n            无返回值，该函数主要用于测试跟踪功能\n        \n        \"\"\"\n\n        tracer=AppBuilderTracer(\n            enable_phoenix = True,\n            enable_console = False,\n            )\n        \n        tracer.start_trace()\n\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        \n        # test stream = True\n        msg = builder.run(conversation_id=conversation_id, query=\"人参有什么用？\",stream=False)\n        print(msg)\n        tracer.end_trace()\n\n    def test_appbuilder_client_trace_stream(self):\n        \"\"\"\n        测试AppBuilderClient的跟踪功能\n        \n        Args:\n            无\n        \n        Returns:\n            无返回值，该函数主要用于测试跟踪功能\n        \n        \"\"\"\n\n        tracer=AppBuilderTracer(\n            enable_phoenix = True,\n            enable_console = False,\n            )\n        \n        tracer.start_trace()\n\n        builder = appbuilder.AppBuilderClient(self.app_id)\n        conversation_id = builder.create_conversation()\n        \n        # test stream = True\n        msg = builder.run(conversation_id=conversation_id, query=\"人参有什么用？\",stream=True)\n        for m in msg.content:\n            pass\n\n        # test get_app_list\n        get_app_list()\n\n\n        tracer.end_trace()\n\n    def test_trace_tracer(self):\n        \"\"\"\n        测试AppbuilderInstrumentor类的trace_tracer方法。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \n        \"\"\"\n        tracer=AppbuilderInstrumentor()\n        tracer.instrumentation_dependencies()\n        tracer._instrument()\n        \n\n    def test_appbuilder_phoenix_run(self):\n        \"\"\"\n        测试appbuilder_phoenix_run方法\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \n        Raises:\n            TypeError: 当调用runtime_main()或stop_phoenix()函数时，预期会抛出TypeError异常。\n        \n        \"\"\"\n        with self.assertRaises(ImportError):\n            runtime_main()\n        \n        with self.assertRaises(ImportError):\n            launch_phoenix()\n            \n        with self.assertRaises(ImportError):\n            stop_phoenix()\n\n\nif __name__ == '__main__':\n    unittest.main()\n            \n\n        \n\n    \n        "
  },
  {
    "path": "python/tests/test_appbuilder_components_trace.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport requests\nimport appbuilder\nimport os\n\nfrom appbuilder import AppBuilderTracer\n\nTEST_QUERY = '澳门新麻蒲烤肉店每天开门吗？'\nTEST_CONTEXT = \\\n('澳门美食： 澳门新麻蒲韩国烤肉店\\n'\n'在澳门一年四季之中除了火锅，烤肉也相当受欢迎。提到韩烧，有一间令我印象最深刻，就是号称韩国第一的烤肉店－新麻蒲韩国烤肉店，光是韩国的分店便多'\n'达四百多间，海外分店更是遍布世界各地，2016年便落户澳门筷子基区，在原本已经食肆林立的地方一起百花齐放！店内的装修跟韩国分店还完度几乎没差，让'\n'食客彷如置身于韩国的感觉，还要大赞其抽风系统不俗，离开时身上都不会沾上烤肉味耶！\\n'\n'时间：周一至周日 下午5:00 - 上午3:00\\n'\n'电话：＋853 2823 4012\\n'\n'地址：澳门筷子基船澳街海擎天第三座地下O号铺96号\\n'\n'必食推介:\\n'\n'护心肉二人套餐\\n'\n'来新麻蒲必试的有两样东西，现在差不多每间烤肉店都有炉边烤蛋，但大家知道吗？原来新麻蒲就是炉边烤蛋的开创者，既然是始祖，这已经是个非吃不可的理'\n'由！还有一款必试的就是护心肉，即是猪的横隔膜与肝中间的部分，每头猪也只有200克这种肉，非常珍贵，其味道吃起来有种独特的肉香味，跟牛护心肉一样'\n'精彩！\\n'\n'秘制猪皮\\n'\n'很多怕胖的女生看到猪皮就怕怕，但其实猪皮含有大量胶原蛋白，营养价值很高呢！这里红通通的猪皮还经过韩国秘制酱汁处理过，会有一点点辣味。烤猪皮的'\n'时候也需特别注意火侯，这样吃起来才会有外脆内Q的口感！')\nTEST_ANSWER = '澳门新麻蒲烤肉店并不是每天开门，周日休息。'\n\nclass TestAppBuilderComponentsTrace(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        初始化函数，用于设置测试所需的变量和对象。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \n        \"\"\"\n        self.image_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\"\\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\"\\\n            \"064079145ff4698856f477b820147768fc2187d3\"\n        self.table_ocr = appbuilder.TableOCR()\n        self.play = appbuilder.Playground(prompt_template=\"你好，{name}，我是{bot_name}，{bot_name}是一个{bot_type}，我可以{bot_function}，你可以问我{bot_question}。\", model=\"DeepSeek-V3.1\")\n        model_name = \"DeepSeek-V3.1\"\n        secret_key = os.getenv('SECRET_KEY', None)\n        self.hallucination_detection = appbuilder.HallucinationDetection(model=model_name, secret_key=secret_key)\n        \n    def test_trace(self):\n        \"\"\"\n        测试追踪功能，包括ASR运行、工具评估、playground运行和幻觉检测工具评估。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \n        \"\"\"\n        tracer=AppBuilderTracer(\n            enable_phoenix = True,\n            enable_console = True,\n        )\n\n        tracer.start_trace()\n\n        # test asr run and tool_eval\n        out = self.table_ocr.run(appbuilder.Message(content={\"url\": self.image_url}))\n        print(out)\n        result = self.table_ocr.tool_eval(name=\"asr\", streaming=True, file_names=[self.image_url])\n        for res in result:\n            print(res)\n\n        # test playground run\n        msg = appbuilder.Message({\n            \"name\": \"小明\",\n            \"bot_name\": \"机器人\",\n            \"bot_type\": \"聊天机器人\",\n            \"bot_function\": \"聊天\",\n            \"bot_question\": \"你好吗？\"\n        })\n\n        answer = self.play.run(message=msg, stream=False, temperature=1)\n\n        \n        # test hallucination_detection tool_eval\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        model_configs = {'temperature': 0.5, 'top_p': 0.5}\n        answer = self.hallucination_detection.tool_eval(name='',\n                                                stream=True,\n                                                query=query,\n                                                context=context,\n                                                answer=answer,\n                                                model_configs=model_configs)\n        for res in answer:\n            print(res)\n            \n        tracer.end_trace()\n        \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_appbuilder_core_components_retriever.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport subprocess\nimport sys\nimport time \n\nfrom appbuilder.core.components.retriever.baidu_vdb.component import _try_import,BaiduVDBVectorStoreIndex\n\n\nclass TestAppbuilderCoreComponentsRetriever__try_import(unittest.TestCase):\n    def test_baidu_vdb_baiduvdb_retriever_try_import(self):\n        subprocess.check_call([sys.executable, \"-m\", \"pip\", \"uninstall\", \"-y\", \"pymochow\"])\n        with self.assertRaises(ImportError):\n            _try_import()\n        subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"pymochow\"])\n        _try_import()\n    \n    \n    def test_baidu_vdb_baiduvdb_retriever_BaiduVDBVectorStoreIndex(self):\n        # test not isinstance(instance_id, str): \n        with self.assertRaises(TypeError):\n            BaiduVDBVectorStoreIndex(\n                instance_id = 1,\n                api_key=\"key\", \n            )\n        # test not isinstance(api_key, str): \n        with self.assertRaises(TypeError):\n            BaiduVDBVectorStoreIndex(\n                instance_id = \"test\",\n                api_key=1, \n            )   \n    \n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_appbuilder_sentry_trace_off.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os \nimport uuid\nimport unittest\nimport subprocess\nimport importlib\nimport requests\nimport logging\n\nimport appbuilder\nfrom appbuilder import AppBuilderTracer, AppbuilderInstrumentor\nfrom appbuilder.utils.trace._function import _components_run_trace_with_sentry,_components_stream_run_trace_with_sentry\n\nlogging.basicConfig(level=logging.INFO)\n\nclass TestAppbuilderForSentryOff(unittest.TestCase):\n\n    def test_sentry_inport_error(self):\n        \"\"\"\n        测试sentry导入错误的情况\n        \n        Args:\n            无\n        \n        Returns:\n            无返回值，该函数主要用于测试\n        \n        Raises:\n            ImportError: 当sentry-sdk库不存在时，会触发ImportError异常\n        \n        \"\"\"\n        # 配置测试环境\n        try:\n            subprocess.check_output(['python3','-m','pip', 'uninstall', 'sentry-sdk', '-y'])\n        except Exception as e:\n            print('pip uninstall sentry-sdk failed')\n        os.environ['ENABLE_SENTRY_TRACE'] = 'true'\n        os.environ['SENTRY_DSN'] = 'test'\n\n        with self.assertRaises(ImportError):\n            tracer = AppBuilderTracer()\n            tracer.start_trace()\n\n        with self.assertRaises(ImportError):\n            arg = ()\n            kwarg = {}\n            _components_run_trace_with_sentry(func = 'func', args = arg, kwargs = kwarg)\n        \n        with self.assertRaises(ImportError):\n            arg = ()\n            kwarg = {}\n            res = _components_stream_run_trace_with_sentry(func = 'func', args = arg, kwargs = kwarg)\n            for r in res:\n                pass\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_appbuilder_sentry_trace_on.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os \nimport uuid\nimport unittest\nimport subprocess\nimport importlib\nimport requests\nimport logging\n\nimport appbuilder\nfrom appbuilder import AppbuilderInstrumentor, StyleRewrite\nfrom appbuilder.core.components.v2 import StyleRewrite as StyleRewriteV2\n\nlogging.basicConfig(level=logging.INFO)\n\nclass TestAppbuilderForSentryOff(unittest.TestCase):\n    def test_sentry_normal(self):\n        \"\"\"\n        测试Sentry的追踪功能是否正常。\n        \n        Args:\n            无。\n        \n        Returns:\n            无返回值。\n        \n        Raises:\n            ImportError: 如果未安装sentry-sdk库，则抛出此异常。\n        \n        \"\"\"\n        try:\n            subprocess.check_output(['python3','-m','pip', 'install', 'sentry-sdk==1.44.1'])\n        except Exception as e:\n            print('pip uninstall sentry-sdk failed')\n\n        os.environ[\"ENABLE_SENTRY_TRACE\"] = \"true\"\n        os.environ[\"SENTRY_DSN\"] = \"test\"\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n\n        # 启动跟踪器(仅测试Sentry Trace功能)\n        tracer = AppbuilderInstrumentor()\n        tracer._instrument()\n        # 启动Sentry\n        try:\n            import sentry_sdk\n        except ImportError:\n            raise ImportError(\"Please install `sentry-sdk` first.\")\n        try:\n            sentry_sdk.init(\n                dsn=\"https://c6f17a6bb2163ad7b10760e70cfdba16@appsentry-sandbox.now.baidu-int.com/59\",\n                traces_sample_rate=1.0,\n            )\n            logging.info(\"Sentry SDK is initialized successfully.\")\n            # _patch_sentry_sdk_trace_id()\n            logging.info(\"Patch_sentry_sdk_trace_id is initialized successfully.\")\n        except Exception as e:\n            print(e)\n        # 启动事务\n        with sentry_sdk.start_transaction(op=\"task\", name=\"UT-Components-trace-test\"):\n            # test Components run\n            sr = StyleRewrite(model=\"DeepSeek-V3.1\")\n            text = \"成都是个包容的城市\"\n            style = \"直播话术\"\n            msg = appbuilder.Message(content=text)\n            run_out = sr.run(message=msg, style=style)\n            print(run_out)\n            sr = StyleRewrite(model=\"DeepSeek-V3.1\")\n            tool_eval_out = sr.tool_eval(name=\"name\", query=text, style=style, streaming=True)\n            for res in tool_eval_out:\n                print(res)\n\n            # test Components v2 tool_eval\n            sr_v2 = StyleRewriteV2(model=\"DeepSeek-V3.1\")\n            text = \"成都是个包容的城市\"\n            style = \"直播话术\"\n            tool_eval_out = sr_v2.tool_eval(query=text, style=style)\n            for res in tool_eval_out:\n                print(res)\n\n        # 清理测试环境\n        try:\n            subprocess.check_output(['python3','-m','pip', 'uninstall', 'sentry-sdk', '-y'])\n        except Exception as e:\n            print('pip uninstall sentry-sdk failed')\n        del os.environ[\"ENABLE_SENTRY_TRACE\"]\n        del os.environ[\"SENTRY_DSN\"]\n        del os.environ[\"APPBUILDER_TRACE_DEBUG\"]\n        \n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_appbuilder_trace_raise_error.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os \nimport unittest\n\nfrom opentelemetry import trace\nfrom appbuilder import AppbuilderTraceException\nfrom appbuilder.utils.trace._function import _input,_client_trace_generator,_assistant_stream_run_with_handler_output\n\n\nclass TestAppbuilderTraceRaiseError(unittest.TestCase):\n    def setUp(self):\n        tracer_provider = trace.get_tracer_provider()\n        tracer = trace.get_tracer(\n                instrumenting_module_name=__name__,\n                tracer_provider=tracer_provider,\n            )\n\n        self.tracer = tracer\n\n    def test_appbuilder_trace_raise_error_input(self):\n        \"\"\"\n        测试AppBuilder跟踪时输入错误时抛出AppbuilderTraceException异常\n        \n        Args:\n            无参数\n        \n        Returns:\n            无返回值\n        \n        Raises:\n            AppbuilderTraceException: 如果输入不满足要求，抛出AppbuilderTraceException异常\n        \n        \"\"\" \n        def sample_function(x):\n            return x * 2\n        with self.assertRaises(AppbuilderTraceException):\n            _input([sample_function], 2, 3)\n\n    def test_appbuilder_trace_raise_error_client_trace_generator(self):\n        generator = _client_trace_generator('generator', self.tracer, 'parent_context')\n        with self.assertRaises(AppbuilderTraceException):\n            next(generator)\n\n    def test_appbuilder_trace_raise_error_assistant_stream_run_with_handler_output(self):\n        generator = _assistant_stream_run_with_handler_output(None, self.tracer, None)\n        with self.assertRaises(AppbuilderTraceException):\n            next(generator)\n            \n\nif __name__ == '__main__':\n    unittest.main()\n       "
  },
  {
    "path": "python/tests/test_asr.py",
    "content": "import unittest\nimport uuid\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core._exception import InvalidRequestArgumentError\nfrom appbuilder.core.components.asr.model import ShortSpeechRecognitionRequest, ShortSpeechRecognitionResponse\nimport os\n\n@unittest.skip(\"测试API超限，暂时跳过\")\nclass TestASRComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            None\n\n        Returns:\n            None.\n        \"\"\"\n        self.audio_file_url = \"https://bj.bcebos.com/v1/appbuilder/asr_test.pcm?authorization=bce-auth-v1\" \\\n                              \"%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A56%3A41Z%2F-1%2Fhost\" \\\n                              \"%2Fa6c4d2ca8a3f0259f4cae8ae3fa98a9f75afde1a063eaec04847c99ab7d1e411\"\n        self.audio_speech_too_long_url = (\"https://bj.bcebos.com/v1/agi-dev-platform-sdk-test/speech_too_long.wav?\"\n                                          \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-07-01T03%3A41%3A00Z%2F300%2Fhost%2Febd71063a7ada87a722a6c9a801d95bd41f75f363236623882586ac9d37e7665\")\n        self.asr = appbuilder.ASR()\n\n    def test_run(self):\n        \"\"\"\n        使用原始语音文件进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        raw_audio = requests.get(self.audio_file_url).content\n        inp = appbuilder.Message(content={\"raw_audio\": raw_audio})\n        out = self.asr.run(inp)\n        self.assertIsNotNone(out)\n        self.assertIsInstance(out, appbuilder.Message)\n        self.assertIn('result', out.content)\n\n    def test_run_different_rate(self):\n        \"\"\"\n        使用不同rate进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        raw_audio = requests.get(self.audio_file_url).content\n        inp = appbuilder.Message(content={\"raw_audio\": raw_audio})\n        try:\n            out = self.asr.run(inp, rate=8000)\n            self.assertIsNotNone(out)\n            self.assertIsInstance(out, appbuilder.Message)\n        except appbuilder.AppBuilderServerException as ex:\n            self.assertIsNotNone(ex, \"请求捕获到异常\")\n\n    def test_run_invalid_audio(self):\n        \"\"\"\n        使用非法语音文件进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        inp = appbuilder.Message(content={\"raw_audio\": b\"invalid\"})\n        with self.assertRaises(Exception):\n            self.asr.run(inp)\n\n    def test_recognition(self):\n        \"\"\"\n        recognition方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        raw_audio = requests.get(self.audio_file_url).content\n        request = ShortSpeechRecognitionRequest()\n        request.format = 'pcm'\n        request.rate = 16000\n        request.cuid = str(uuid.uuid4())\n        request.dev_pid = \"80001\"\n        request.speech = raw_audio\n        response = self.asr._recognize(request)\n        self.assertIsNotNone(response)\n        self.assertIsInstance(response, ShortSpeechRecognitionResponse)\n\n    def test_recognition_invalid_request(self):\n        \"\"\"\n        recognition方法单测，非法请求体\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        with self.assertRaises(Exception):\n            self.asr._recognize(None)\n\n    def test_check_service_error(self):\n        \"\"\"\n        check_service_error方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        data = {'err_msg': 'Error', 'err_no': 1}\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.asr._check_service_error(\"\", data)\n        data = {'err_msg': 'No Error', 'err_no': 0}\n        self.assertIsNone(self.asr._check_service_error(\"\", data))\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        result = self.asr.tool_eval(name=\"asr\", streaming=True, file_url=self.audio_file_url)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(InvalidRequestArgumentError):\n            result = self.asr.tool_eval(name=\"asr\", streaming=True)\n            next(result)\n\n    def test_tool_eval_speech_too_long(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        result = self.asr.tool_eval(name=\"asr\", streaming=True, file_url=self.audio_speech_too_long_url)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_assistant_basic_import.py",
    "content": "import unittest\nimport os\nimport appbuilder\n\n@unittest.skip(\"QPS超限\")\nclass TestAssistantImport(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_assistants_beta_import(self):\n        from appbuilder import assistant\n        from appbuilder.core.assistant.base import BetaAssistant\n        obj = assistant\n        self.assertIsInstance(obj, BetaAssistant)\n\n        obj_dir = obj.__dir__()\n        self.assertIn(\"assistants\", obj_dir)\n        self.assertIn(\"threads\", obj_dir)\n    \n\n    def test_assistants_obj_import(self):\n        from appbuilder import assistant\n        obj = assistant.assistants\n\n        from appbuilder.core.assistant.assistants import Assistants\n        self.assertIsInstance(obj, Assistants)\n\n        obj_dir = obj.__dir__()\n        self.assertIn(\"create\", obj_dir)\n\n    def test_threads_obj_import(self):\n        from appbuilder import assistant\n        obj = assistant.threads\n\n        from appbuilder.core.assistant.threads import Threads\n        self.assertIsInstance(obj, Threads)\n\n        obj_dir = obj.__dir__()\n        self.assertIn(\"create\", obj_dir)\n\n    def test_messages_obj_import(self):\n        from appbuilder import assistant\n        obj = assistant.threads.messages\n\n        from appbuilder.core.assistant.threads.messages import Messages\n        self.assertIsInstance(obj, Messages)\n        obj_dir = obj.__dir__()\n        self.assertIn(\"create\", obj_dir)\n\n    def test_runs_obj_import(self):\n        from appbuilder import assistant\n        obj = assistant.threads.runs\n\n        from appbuilder.core.assistant.threads.runs import Runs\n        self.assertIsInstance(obj, Runs)\n\n        obj_dir = obj.__dir__()\n        self.assertIn(\"run\", obj_dir)\n        self.assertIn(\"stream_run\", obj_dir)\n        self.assertIn(\"submit_tool_outputs\", obj_dir)\n        self.assertIn(\"cancel\", obj_dir)\n\n    def test_type_obj_import(self):\n        from appbuilder import assistant\n        type_folder = assistant.type\n        assistant_type = assistant.assistant_type\n        thread_type = assistant.thread_type\n        public_type = assistant.public_type\n\n        \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_assistant_class_assistans.py",
    "content": "import unittest\nimport os\nimport appbuilder\nfrom tests.pytest_utils import Utils\n\n@unittest.skip(\"QPS超限\")\nclass TestAssistant(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_assistants_create_v1(self):\n        from appbuilder.core.assistant.type import assistant_type\n\n        assistant = appbuilder.assistant.assistants.create(\n            model = \"ERNIE-4.0T-8K\",\n            name=\"Abc-_123\",\n            description=\"test\",\n        )\n\n        self.assertIsInstance(assistant, assistant_type.AssistantCreateResponse)\n        self.assertEqual(assistant.name, \"Abc-_123\")\n        self.assertEqual(assistant.description, \"test\")\n\n\n    def test_assistants_create_v2(self):\n        try:\n            appbuilder.assistant.assistants.create(\n                model = \"ERNIE-4.0T-8K\",\n                name=\"Abc-_123@\",\n                description=\"test\"*512,\n                response_format=\"other\",\n                instructions=\"test\"*4096,\n                thought_instructions=\"test\"*4096,\n                chat_instructions=\"test\"*4096,\n                file_ids=[\"test\"]*11,\n            )\n        except Exception as e:\n            self.assertEqual(e.error_count(), 7)\n\n    def test_assistants_create_v3(self):\n        try:\n            appbuilder.assistant.assistants.create(\n                model = \"ERNIE-4.0T-8K\",\n                name=\"Abc-_123\",\n                description=\"test\",\n                metadata={\n                    \"key\" * 64 : \"value\" * 512\n                }\n            )\n        except Exception as e:\n            self.assertIn(\"metadata\", e.description)\n\n    def test_assistants_create_v4(self):\n        from appbuilder.core.assistant.type import assistant_type\n        assistant=appbuilder.assistant.assistants.create(\n            model = \"ERNIE-4.0T-8K\",\n            name=\"测试\",\n            description=\"test\",\n            metadata={\n                \"key\": \"value\",\n            }\n        )\n        self.assertIsInstance(assistant, assistant_type.AssistantCreateResponse)\n            \n    def test_Assistant(self):\n        from appbuilder.core.assistant.type import assistant_type\n        assistant = appbuilder.assistant.assistants.create(\n            model = \"ERNIE-4.0T-8K\",\n            name=\"Abc-_123\",\n            description=\"test\",\n        )\n        \n        # test assistant update\n        assistant_update = appbuilder.assistant.assistants.update(\n            assistant_id = assistant.id,\n            model=\"ERNIE-4.0T-8K\",\n            name=\"Test_Name\",\n            description = \"test\"\n        )\n        self.assertIsInstance(assistant_update, assistant_type.AssistantUpdateResponse)\n        \n        # test assistant list\n        assistant_list = appbuilder.assistant.assistants.list()\n        self.assertIsInstance(assistant_list, assistant_type.AssistantListResponse)\n        \n        # test assistant query\n        assistant_query = appbuilder.assistant.assistants.query(\n            assistant_id = assistant.id,\n        )\n        self.assertIsInstance(assistant_query, assistant_type.AssistantQueryResponse)\n        \n        # test assistant mount_files\n        # create file\n        file_path = Utils.get_data_file(\"qa_doc_parser_extract_table_from_doc.png\")\n        file = appbuilder.assistant.assistants.files.create(file_path=file_path)\n        with self.assertRaises(FileNotFoundError):\n            appbuilder.assistant.assistants.mount_files(\n                assistant_id = assistant.id,\n                file_id = \"test_not_exist\",\n            )\n        assistant_mount = appbuilder.assistant.assistants.mount_files(\n            assistant_id = assistant.id,\n            file_id = file.id,\n        )\n        self.assertIsInstance(assistant_mount, assistant_type.AssistantFilesResponse)\n        \n        # test assistant files list\n        assistant_files_list = appbuilder.assistant.assistants.mounted_files_list(\n            assistant_id = assistant.id,\n        )\n        self.assertIsInstance(assistant_files_list, assistant_type.AssistantMountedFilesListResponse)\n        self.assertEqual(len(assistant_files_list.data), 1)\n        \n        # test assistant unmount_files\n        with self.assertRaises(FileNotFoundError):\n            appbuilder.assistant.assistants.unmount_files(\n                assistant_id = assistant.id,\n                file_id = \"test_not_exist\",\n            )\n        assistant_files_delete = appbuilder.assistant.assistants.unmount_files(\n            assistant_id = assistant.id,\n            file_id = file.id,\n        )\n        self.assertIsInstance(assistant_files_delete, assistant_type.AssistantFilesDeleteResponse)\n        \n        # test assistant delete\n        assistant_delete = appbuilder.assistant.assistants.delete(\n            assistant_id = assistant.id,\n        )\n        self.assertIsInstance(assistant_delete, assistant_type.AssistantDeleteResponse)\n        \n    def test_unmote_raise(self):\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.assistants.unmount_files(\n                assistant_id = \"test\",\n                file_id = 123,\n            )\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.assistants.unmount_files(\n                assistant_id = 123,\n                file_id = \"test\",\n            )\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.assistants.unmount_files(\n                assistant_id = \"\",\n                file_id = \"test\",\n            )\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.assistants.unmount_files(\n                assistant_id = \"test\",\n                file_id = \"\",\n            )\n\n    def test_mount_raise(self):\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.assistants.mount_files(\n                assistant_id = \"test\",\n                file_id = 123,\n            )\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.assistants.mount_files(\n                assistant_id = 123,\n                file_id = \"test\",\n            )\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.assistants.mount_files(\n                assistant_id = \"\",\n                file_id = \"test\",\n            )\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.assistants.mount_files(\n                assistant_id = \"test\",\n                file_id = \"\",\n            )\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_assistant_class_files.py",
    "content": "import unittest\nimport os\nimport appbuilder\n\nfrom appbuilder.core._exception import AssistantServerException\nfrom tests.pytest_utils import Utils\n\n@unittest.skip(\"QPS超限\")\nclass TestFilesCreate(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n        \n    def test_create_files_v1(self):\n        from appbuilder.core.assistant.type import assistant_type\n        file_path = Utils.get_data_file(\"qa_doc_parser_extract_table_from_doc.png\")\n        file = appbuilder.assistant.assistants.files.create(file_path=file_path)\n        self.assertIsInstance(file, assistant_type.AssistantFilesCreateResponse)\n        \n    def test_create_files_v2(self):\n        from appbuilder.core.assistant.type import assistant_type\n        file_path = \"test\"\n        with self.assertRaises(ValueError):\n            file = appbuilder.assistant.assistants.files.create(file_path=file_path)\n\n    def test_files(self):\n        from appbuilder.core.assistant.type import assistant_type\n\n        current_dir = os.path.dirname(os.path.abspath(__file__))\n        data_dir = os.path.join(current_dir, \"data\")\n        file_path = os.path.join(data_dir, \"qa_doc_parser_extract_table_from_doc.png\")\n        file = appbuilder.assistant.assistants.files.create(file_path=file_path)\n        self.assertIsInstance(file, assistant_type.AssistantFilesCreateResponse)\n        \n        # test list\n        files_list = appbuilder.assistant.assistants.files.list()\n        self.assertIsInstance(files_list, assistant_type.AssistantFilesListResponse)\n        \n        # test query\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.assistants.files.query(file_id=123)\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.assistants.files.query(file_id=\"test\")\n        files_query = appbuilder.assistant.assistants.files.query(file_id=file.id)\n        self.assertIsInstance(files_query, assistant_type.AssistantFilesQueryResponse)\n        \n        # test content\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.assistants.files.content(file_id=123)\n        with self.assertRaises(FileNotFoundError):\n            appbuilder.assistant.assistants.files.content(file_id='test_not_exist')\n        files_content=appbuilder.assistant.assistants.files.content(file_id=file.id)\n        self.assertIsInstance(files_content, assistant_type.AssistantFilesContentResponse)\n        self.assertIsInstance(files_content.content, bytes)\n        \n        # test download\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.assistants.files.download(file_id='test', file_path=123)\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.assistants.files.download(file_id=123, file_path=data_dir)\n        with self.assertRaises(FileNotFoundError):\n            appbuilder.assistant.assistants.files.download(file_id='test_not_exist', file_path=data_dir)\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.assistants.files.download(file_id='', file_path=data_dir)\n        with self.assertRaises(FileNotFoundError):\n            appbuilder.assistant.assistants.files.download(file_id=file.id, file_path=os.path.join(data_dir, 'data/'))\n        with self.assertRaises(ValueError):\n            try:\n                with open(os.path.join(data_dir, 'test'), 'wb') as f:\n                    f.write(b'test')\n                appbuilder.assistant.assistants.files.download(file_id=file.id, file_path=os.path.join(data_dir, 'test'))\n            finally:\n                os.remove(os.path.join(data_dir, 'test'))\n        \n        appbuilder.assistant.assistants.files.download(file_id=file.id, file_path=data_dir)\n\n        # test delete\n        files_delete = appbuilder.assistant.assistants.files.delete(file_id=file.id)\n        self.assertIsInstance(files_delete, assistant_type.AssistantFilesDeleteResponse)\n        \n\nif __name__ == '__main__':\n    unittest.main()\n        "
  },
  {
    "path": "python/tests/test_assistant_class_messages.py",
    "content": "import unittest\nimport os\nimport appbuilder\n\nfrom appbuilder.core._exception import AssistantServerException\n\n@unittest.skip(\"QPS超限\")\nclass TestMessageCreate(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_messages_create_v1(self):\n        from appbuilder.core.assistant.type import thread_type\n        thread = appbuilder.assistant.threads.create()\n        message = appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"hello world\"\n        )\n        \n        self.assertIsInstance(message, thread_type.AssistantMessageCreateResponse) \n        self.assertEqual(message.thread_id, thread.id)\n\n\n    def test_messages_create_v2(self):\n        from appbuilder.core.assistant.type import thread_type\n        thread = appbuilder.assistant.threads.create()\n        try:\n            appbuilder.assistant.threads.messages.create(\n                thread_id=thread.id,\n                content=\"hello world\",\n                role='custom',\n                file_ids=[\"file_id\"]*11\n            )\n        except Exception as e:\n            self.assertEqual(e.error_count(), 2)\n\n        \n    def test_messages(self):\n        from appbuilder.core.assistant.type import thread_type\n        thread = appbuilder.assistant.threads.create()\n        msg = appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"hello world?\"\n        )\n\n        # test list\n        msg_list = appbuilder.assistant.threads.messages.list(\n            thread_id=msg.thread_id,\n            limit=1\n        ) \n        self.assertIsInstance(msg_list, thread_type.AssistantMessageListResponse)  \n        \n        # test query\n        msg_query = appbuilder.assistant.threads.messages.query(\n            thread_id=msg.thread_id,\n            message_id=msg.id\n        )\n        self.assertIsInstance(msg_query, thread_type.AssistantMessageQueryResponse)  \n            \n        # test update\n        msg_update= appbuilder.assistant.threads.messages.update(\n            thread_id=msg.thread_id,\n            message_id=msg.id,\n            content='你好'\n        )\n        self.assertIsInstance(msg_update, thread_type.AssistantMessageUpdateResponse)  \n            \n        # test file\n        msg_files = appbuilder.assistant.threads.messages.files(\n            thread_id=msg_update.thread_id,\n            message_id=msg_update.id,\n            limit=1\n        )\n        self.assertIsInstance(msg_files, thread_type.AssistantMessageFilesResponse)  \n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_assistant_class_runs.py",
    "content": "import unittest\nimport os\nimport appbuilder\n# from tests.pytest_utils import Utils\n\nimport random\nimport string\nimport os\n\nclass Utils(object):\n    \"\"\"\n    utils 方法父类\n    \"\"\"\n    @staticmethod\n    def get_random_string(str_len, prefix=None):\n        \"\"\"\n        生成随机字符串，可指定前缀\n        \"\"\"\n        gen_name = ''.join(\n            random.choice(string.ascii_letters + string.digits) for _ in range(str_len)\n        )\n        if prefix:\n            name = str(prefix) + gen_name\n        else:\n            name = gen_name\n        return name\n\n    @staticmethod\n    def get_data_file(filename):\n        current_dir = os.path.dirname(os.path.abspath(__file__))\n        full_file_path = os.path.join(current_dir, \"data\", filename)\n        return full_file_path\n\ndef get_cur_whether(location:str, unit:str):\n    return \"{} 的当前温度是30 {}\".format(location, unit)\n\n@unittest.skip(\"QPS超限\")\nclass TestFunctionCall(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_run_create_v1(self):\n        from appbuilder.core.assistant.type import thread_type\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_assistant\",\n            description=\"test assistant\",\n            instructions=\"每句话回复前都加上我是秦始皇\"\n        )\n\n        file_path = Utils.get_data_file(\"qa_doc_parser_extract_table_from_doc.png\")\n        file = appbuilder.assistant.assistants.files.create(file_path)\n\n        self.assertIsInstance(file, appbuilder.assistant.type.AssistantFilesCreateResponse)\n\n        thread = appbuilder.assistant.threads.create()\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"hello world\",\n            file_ids=[file.id]\n        )\n\n        model_parameters = appbuilder.assistant.public_type.AssistantModelParameters(\n            chat_parameters = appbuilder.assistant.public_type.AssistantChatParameters(\n                temperature = 0.8,\n                top_p = 0.8,\n                penalty_score = 1.0\n                ),\n            thought_parameters = appbuilder.assistant.public_type.AssistantThoughtParameters(\n                temperature = 0.01,\n                top_p = 0.0,\n                penalty_score = 1.0\n            )\n        )\n        run_result = appbuilder.assistant.threads.runs.run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n            model_parameters=model_parameters\n        )\n\n        self.assertIsInstance(run_result, thread_type.RunResult)\n        self.assertEqual(run_result.assistant_id, assistant.id)\n        self.assertEqual(run_result.thread_id, thread.id)\n        self.assertEqual(run_result.status, \"completed\")\n        self.assertIn(\"我是秦始皇\", run_result.final_answer.message.content[0].text.value)\n\n    def test_run_create_v2(self):\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_assistant\",\n            description=\"test assistant\",\n            instructions=\"每句话回复前都加上我是秦始皇\"\n        )\n\n        thread = appbuilder.assistant.threads.create()\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"hello world\",\n        )\n\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.threads.runs.run(\n                assistant_id=assistant.id,\n            )\n\n    def test_threads_run_raise(self):\n        run=appbuilder.core.assistant.threads.runs.runs.Runs()\n        with self.assertRaises(ValueError):\n            run._stream(assistant_id='')\n\n    def test_threads_run_model_raise(self):\n        run=appbuilder.core.assistant.threads.runs.runs.Runs()\n        model_parameters = appbuilder.assistant.public_type.AssistantModelParameters(\n            chat_parameters = appbuilder.assistant.public_type.AssistantChatParameters(\n                temperature = 0.8,\n                top_p = 0.8,\n                penalty_score = 1.0\n                ),\n            thought_parameters = appbuilder.assistant.public_type.AssistantThoughtParameters(\n                temperature = 0.01,\n                top_p = 0.0,\n                penalty_score = 1.0\n            )\n        )\n        with self.assertRaises(ValueError):\n            model_parameters.chat_parameters.temperature = 10\n            run.run(assistant_id='test', thread_id = 'thread_id', model_parameters = model_parameters)\n        with self.assertRaises(ValueError):\n            run._stream(assistant_id='test',thread_id = 'thread_id', model_parameters = model_parameters)\n        model_parameters.chat_parameters.temperature = 0.8\n        with self.assertRaises(ValueError):\n            model_parameters.chat_parameters.top_p = 10\n            run.run(assistant_id='test', thread_id = 'thread_id', model_parameters = model_parameters)\n        with self.assertRaises(ValueError):\n            run._stream(assistant_id='test', thread_id = 'thread_id', model_parameters = model_parameters)\n        model_parameters.chat_parameters.top_p = 0.8\n        with self.assertRaises(ValueError):\n            model_parameters.chat_parameters.penalty_score = 10\n            run.run(assistant_id='test', thread_id = 'thread_id', model_parameters = model_parameters)\n        with self.assertRaises(ValueError):\n            run._stream(assistant_id='test',thread_id = 'thread_id', model_parameters = model_parameters)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_assistant_class_runs_v2.py",
    "content": "import unittest\nimport os\nimport appbuilder\n\n\ndef get_cur_whether(location:str, unit:str):\n    return \"{} 的当前温度是30 {}\".format(location, unit)\n\n\n@unittest.skip(\"QPS超限\")\nclass TestFunctionCall(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n        from appbuilder.core.assistant.type import thread_type\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_assistant\",\n            description=\"test assistant\",\n            instructions=\"每句话回复前都加上我是秦始皇\"\n        )\n\n        thread = appbuilder.assistant.threads.create()\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"hello world\",\n        )\n\n        run_result = appbuilder.assistant.threads.runs.run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n        )\n\n        self.thread_id = thread.id\n        self.run_id = run_result.id\n\n    def test_run_list_v1(self):\n        run_list = appbuilder.assistant.threads.runs.list(\n            thread_id=self.thread_id,\n            limit=5\n        )\n        self.assertEqual(len(run_list.data), 1)\n\n    def test_run_query_v1(self):\n        run = appbuilder.assistant.threads.runs.query(\n            thread_id=self.thread_id,\n            run_id=self.run_id\n        )\n        self.assertEqual(run.status, \"completed\")\n        \n    def test_run_step_list_v1(self):\n        step_list = appbuilder.assistant.threads.runs.steps.list(\n            thread_id=self.thread_id,\n            run_id=self.run_id,\n        )\n        self.assertEqual(len(step_list.data), 1)\n\n        last_step = step_list.data[-1]\n        last_step_id = last_step.id\n\n        step = appbuilder.assistant.threads.runs.steps.query(\n            thread_id=self.thread_id,\n            run_id=self.run_id,\n            step_id=last_step_id,\n        )\n        self.assertEqual(step.id, last_step_id)\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_assistant_class_threads.py",
    "content": "import unittest\nimport os\nimport appbuilder\n\n@unittest.skip(\"QPS超限\")\nclass TestThreadCreate(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_threads_create_v1(self):\n        from appbuilder.core.assistant.type import thread_type\n        thread = appbuilder.assistant.threads.create()\n        self.assertIsInstance(thread, thread_type.ThreadCreateResponse)\n\n\n    def test_threads_create_v2(self):\n        from appbuilder.core.assistant.type import thread_type\n        message = thread_type.AssistantMessage(\n            content=\"hello world\"\n        )\n        thread = appbuilder.assistant.threads.create([message])\n        self.assertIsInstance(thread, thread_type.ThreadCreateResponse) \n\n    def test_threads_create_v3(self):\n        from appbuilder.core.assistant.type import thread_type\n        message = thread_type.AssistantMessage(\n            content=\"hello world\"\n        )\n\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.threads.create(message)\n            \n    def test_threads_query_delete(self):\n        from appbuilder.core.assistant.type import thread_type\n        message = thread_type.AssistantMessage(\n            content=\"hello world\"\n        )\n        thread = appbuilder.assistant.threads.create([message])\n        \n        # test query\n        thr_query = appbuilder.assistant.threads.query(thread_id=thread.id)\n        self.assertIsInstance(thr_query, thread_type.ThreadQueryResponse)\n        \n        # test update\n        with self.assertRaises(TypeError):\n            appbuilder.assistant.threads.update(thread_id=thread.id,metadata=123)\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.threads.update(thread_id=thread.id,metadata={'finish_reason'*10:'513value'})\n        with self.assertRaises(ValueError):\n            appbuilder.assistant.threads.update(thread_id=thread.id,metadata={'finish_reason':'513value'*64+'A'})\n        thr_update = appbuilder.assistant.threads.update(thread_id=thread.id)\n        self.assertIsInstance(thr_update, thread_type.ThreadUpdateResponse)\n        \n        # test delete\n        thr_delete = appbuilder.assistant.threads.delete(thread_id=thread.id)\n        self.assertIsInstance(thr_delete, thread_type.ThreadDeleteResponse)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_assistant_e2e_funccall.py",
    "content": "import unittest\nimport pydantic\nimport os\nimport appbuilder\n\ndef get_cur_whether(location:str, unit:str):\n    return \"{} 的当前温度是30 {}\".format(location, unit)\n\ncheck_tool = {\n    \"name\": \"get_cur_whether\",\n    \"description\": \"这是一个获得指定地点天气的工具\",\n    \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n        \"required\": [\n                \"location\"\n            ]\n    }\n}\n\n@unittest.skip(reason=\"暂时跳过\")\nclass TestFunctionCall(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_end_to_end(self):\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_function\",\n            description=\"你是一个热心的朋友\",\n            instructions=\"请用友善的语气回答问题\",\n            tools=[\n                {'type': 'function', 'function': check_tool}\n            ]\n        )\n        \n        thread = appbuilder.assistant.threads.create()\n\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"今天北京的天气怎么样？\",\n        )\n\n        run_result = appbuilder.assistant.threads.runs.run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n        )\n\n        print(\"\\nFirst run result: {}\\n\".format(run_result))\n\n        self.assertEqual(run_result.status, \"requires_action\")\n        self.assertEqual(run_result.required_action.type, \"submit_tool_outputs\")\n        self.assertEqual(len(run_result.required_action.submit_tool_outputs.tool_calls), 1)\n        \n        tool_call = run_result.required_action.submit_tool_outputs.tool_calls[0]\n        \n        self.assertEqual(tool_call.type, \"function\")\n        self.assertEqual(tool_call.function.name, \"get_cur_whether\")\n        self.assertEqual(tool_call.function.arguments, '{\"location\":\"北京\",\"unit\":\"摄氏度\"}')\n\n        func_res = get_cur_whether(**eval(tool_call.function.arguments))\n        print(\"\\nFunction result: {}\\n\".format(func_res))\n\n        run_result = appbuilder.assistant.threads.runs.run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n            tool_output={\n                \"tool_call_id\":tool_call.id,\n                \"output\": func_res,\n                \"run_id\": run_result.id\n            },\n        )\n        print(\"\\nFinal run result: {}\\n\".format(run_result))\n        self.assertEqual(run_result.status, \"completed\")\n        self.assertEqual(run_result.required_action, None)\n        self.assertEqual(run_result.assistant_id, assistant.id)\n        self.assertEqual(run_result.thread_id, thread.id)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_assistant_e2e_funccall_component.py",
    "content": "import unittest\nimport os\nimport appbuilder\n\n\n@unittest.skip(\"QPS超限\")\n@unittest.skip(reason=\"暂时跳过\")\nclass TestFunctionCall(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_end_to_end(self):\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_function\",\n            description=\"你是一个热心的朋友\",\n            instructions=\"请用友善的语气回答问题\",\n            tools=[\n                {'type': 'function', 'function': appbuilder.AnimalRecognition().manifests[0]}\n            ]\n        )\n        \n        thread = appbuilder.assistant.threads.create()\n\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n\n        origin_query = \"我有一张图片，url是: {}, 麻烦帮我看看这是什么动物\".format(image_url)\n\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=origin_query,\n        )\n\n        run_result = appbuilder.assistant.threads.runs.run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n        )\n\n        print(\"\\nFirst run result: {}\\n\".format(run_result))\n\n        self.assertEqual(run_result.status, \"requires_action\")\n        self.assertEqual(run_result.required_action.type, \"submit_tool_outputs\")\n        self.assertEqual(len(run_result.required_action.submit_tool_outputs.tool_calls), 1)\n        \n        tool_call = run_result.required_action.submit_tool_outputs.tool_calls[0]\n        \n        self.assertEqual(tool_call.type, \"function\")\n        self.assertEqual(tool_call.function.name, \"animal_rec\")\n\n        print(tool_call.function.arguments)\n\n        func_res = appbuilder.AnimalRecognition().tool_eval(\n            name=\"animal_rec\",\n            streaming=True,\n            origin_query=origin_query,\n            **eval(tool_call.function.arguments))\n        \n        func_message = \"\"\n        for res in func_res:\n            func_message += res\n        print(\"\\nFunction result: {}\\n\".format(func_message))\n\n        run_result = appbuilder.assistant.threads.runs.run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n            tool_output={\n                \"tool_call_id\":tool_call.id,\n                \"output\": func_message,\n                \"run_id\": run_result.id\n            },\n        )\n        print(\"\\nFinal run result: {}\\n\".format(run_result))\n        self.assertEqual(run_result.status, \"completed\")\n        self.assertEqual(run_result.required_action, None)\n        self.assertEqual(run_result.assistant_id, assistant.id)\n        self.assertEqual(run_result.thread_id, thread.id)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_assistant_e2e_run.py",
    "content": "import unittest\nimport pydantic\nimport os\nimport appbuilder\n\n@unittest.skip(\"QPS超限\")\nclass TestAssistantTalk(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_end_to_end(self):\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_assistant\",\n            description=\"test assistant\",\n            instructions=\"每句话回复前都加上我是秦始皇\"\n        )\n        thread = appbuilder.assistant.threads.create(\n            [\n                {'content': 'hello world'}\n            ]\n        )\n\n        run_result = appbuilder.assistant.threads.runs.run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n        )\n        self.assertIsInstance(run_result, appbuilder.assistant.type.RunResult)\n        self.assertEqual(run_result.assistant_id, assistant.id)\n        self.assertEqual(run_result.thread_id, thread.id)\n        self.assertEqual(run_result.status, \"completed\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()"
  },
  {
    "path": "python/tests/test_assistant_e2e_stream_cancel.py",
    "content": "import unittest\nimport pydantic\nimport os\nimport appbuilder\n# import json\n\ndef get_cur_whether(location:str, unit:str):\n    return \"{} 的当前温度是30 {}\".format(location, unit)\n\ncheck_tool = {\n    \"name\": \"get_cur_whether\",\n    \"description\": \"这是一个获得指定地点天气的工具\",\n    \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n        \"required\": [\n                \"location\"\n            ]\n    }\n}\n\n@unittest.skip(\"暂时跳过\")\nclass TestCancel(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_end_to_end(self):\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_function\",\n            description=\"你是一个热心的朋友\",\n            instructions=\"请用友善的语气回答问题\",\n            tools=[\n                {'type': 'function', 'function': check_tool}\n            ]\n        )\n        \n        thread = appbuilder.assistant.threads.create()\n\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"今天北京的天气怎么样？\",\n        )\n\n        run_result = appbuilder.assistant.threads.runs.stream_run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n        )\n\n        import json\n        run_id = \"\"\n        for run_step in run_result:\n            print(\"\\nRun result: {}\\n\".format(\n                run_step.model_dump_json(indent=4)\n            ))\n            if run_step.status == 'queued':\n                run_obj = run_step.details.run_object\n                run_id = run_obj.id\n            else:\n                appbuilder.assistant.threads.runs.cancel(\n                    run_id=run_id,\n                    thread_id=thread.id,\n                )\n\n        self.assertEqual(run_step.status, 'cancelled')\n        self.assertEqual(run_step.event_type, \"run_end\")\n        self.assertNotEqual(run_step.details.run_object.cancelled_at, 0)\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_assistant_e2e_stream_event_handler.py",
    "content": "import unittest\nimport pydantic\nimport os\nimport appbuilder\nfrom appbuilder import AssistantEventHandler\nfrom appbuilder.core.assistant.type.thread_type import StreamRunMessage\n\ncheck_tool = {\n    \"name\": \"get_cur_whether\",\n    \"description\": \"这是一个获得指定地点天气的工具\",\n    \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n        \"required\": [\n                \"location\"\n            ]\n    }\n}\n\nclass MyEventHandler(AssistantEventHandler):\n    def get_cur_whether(self, location:str, unit:str):\n        return \"{} 的当前温度是30 {}\".format(location, unit)\n    \n    def messages(self, messages_event: StreamRunMessage):\n        info = messages_event.content[-1].text.value\n        # 使用红色打印\n        print(\"\\n\\033[1;31m\",\"-> Assistant 回答: \", info, \"\\033[0m\")\n    \n    def tool_calls(self, status_event):\n        current_tool_calls = self.stream_run_context.current_tool_calls\n        for tool_call in current_tool_calls:\n            name = tool_call.function.name\n            \n            if name == \"get_cur_whether\":\n                arguments = tool_call.function.arguments\n                func_res = self.get_cur_whether(**eval(arguments))\n                submit_res = appbuilder.assistant.threads.runs.submit_tool_outputs(\n                    run_id=self.stream_run_context.current_run_id,\n                    thread_id=self.stream_run_context.current_thread_id,\n                    tool_outputs=[\n                        {\"tool_call_id\": tool_call.id,\n                            \"output\": func_res,}\n                    ]\n                )\n\n\n@unittest.skip(\"QPS超限\")\nclass TestFunctionCall(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_end_to_end_trace(self):\n        from appbuilder.utils.trace.tracer import AppBuilderTracer\n        tracer=AppBuilderTracer(\n            enable_phoenix = True,\n            enable_console = False,\n            )\n\n        tracer.start_trace()\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_function\",\n            description=\"你是一个热心的朋友\",\n            instructions=\"请用友善的语气回答问题\",\n            tools=[\n                {'type': 'function', 'function': check_tool}\n            ]\n        )\n        \n        thread = appbuilder.assistant.threads.create()\n\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"今天北京的天气怎么样？\",\n        )\n\n        with appbuilder.assistant.threads.runs.stream_run_with_handler(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n            event_handler=MyEventHandler(),\n        ) as stream:\n            stream.until_done()\n\n        tracer.end_trace()  \n\n    def test_end_to_end(self):\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_function\",\n            description=\"你是一个热心的朋友\",\n            instructions=\"请用友善的语气回答问题\",\n            tools=[\n                {'type': 'function', 'function': check_tool}\n            ]\n        )\n        \n        thread = appbuilder.assistant.threads.create()\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"今天北京的天气怎么样？\",\n        )\n        with appbuilder.assistant.threads.runs.stream_run_with_handler(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n            event_handler=MyEventHandler(),\n        ) as stream:\n            stream.until_done()\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_assistant_e2e_stream_event_handler_v2.py",
    "content": "import unittest\nimport pydantic\nimport os\nimport appbuilder\nfrom appbuilder import AssistantEventHandler\nfrom appbuilder.core.assistant.type.thread_type import StreamRunMessage\n\ncheck_tool = {\n    \"name\": \"get_cur_whether\",\n    \"description\": \"这是一个获得指定地点天气的工具\",\n    \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n        \"required\": [\n                \"location\"\n            ]\n    }\n}\n\n@unittest.skip(\"QPS超限\")\nclass MyEventHandler(AssistantEventHandler):\n    def get_cur_whether(self, location:str, unit:str):\n        return \"{} 的当前温度是30 {}\".format(location, unit)\n    \n    def run_begin(self, status_event):\n        run_id = self.stream_run_context.current_run_id\n        thread_id = self.stream_run_context.current_thread_id\n        print(\"Run_id: {}, Thread_id: {}\".format(run_id, thread_id))\n\n    def run_end(self, status_event):\n        print(\"\\n\", status_event)\n        \n    def tool_step_begin(self, status_event):\n        step_id = self.stream_run_context.current_run_step_id\n        print(\"Step_id: {}\".format(step_id))\n    \n    def tool_calls(self, status_event):\n        current_tool_calls = self.stream_run_context.current_tool_calls\n        for tool_call in current_tool_calls:\n            name = tool_call.function.name\n            \n            if name == \"get_cur_whether\":\n                arguments = tool_call.function.arguments\n                func_res = self.get_cur_whether(**eval(arguments))\n                submit_res = appbuilder.assistant.threads.runs.submit_tool_outputs(\n                    run_id=self.stream_run_context.current_run_id,\n                    thread_id=self.stream_run_context.current_thread_id,\n                    tool_outputs=[\n                        {\"tool_call_id\": tool_call.id,\n                            \"output\": func_res,}\n                    ]\n                )\n\n\nclass TestFunctionCall(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_end_to_end(self):\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_function\",\n            description=\"你是一个热心的朋友\",\n            instructions=\"请用友善的语气回答问题\",\n            tools=[\n                {'type': 'function', 'function': check_tool}\n            ]\n        )\n        \n        thread = appbuilder.assistant.threads.create()\n\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"今天北京的天气怎么样？\",\n        )\n\n        with appbuilder.assistant.threads.runs.stream_run_with_handler(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n            event_handler=MyEventHandler(),\n        ) as stream:\n            for _ in stream:\n                ...\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_assistant_e2e_stream_funccall.py",
    "content": "import unittest\nimport pydantic\nimport os\nimport appbuilder\n\ndef get_cur_whether(location:str, unit:str):\n    return \"{} 的当前温度是30 {}\".format(location, unit)\n\ncheck_tool = {\n    \"name\": \"get_cur_whether\",\n    \"description\": \"这是一个获得指定地点天气的工具\",\n    \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"省，市名，例如：河北省\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                        \"摄氏度\",\n                        \"华氏度\"\n                    ]\n                }\n            },\n        \"required\": [\n                \"location\"\n            ]\n    }\n}\n\n@unittest.skip(\"QPS超限\")\nclass TestFunctionCall(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_end_to_end(self):\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_function\",\n            description=\"你是一个热心的朋友\",\n            instructions=\"请用友善的语气回答问题\",\n            tools=[\n                {'type': 'function', 'function': check_tool}\n            ]\n        )\n        \n        thread = appbuilder.assistant.threads.create()\n\n        appbuilder.assistant.threads.messages.create(\n            thread_id=thread.id,\n            content=\"今天北京的天气怎么样？\",\n        )\n\n        run_result = appbuilder.assistant.threads.runs.stream_run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n        )\n\n        run_id = \"\"\n        for run_step in run_result:\n            print(\"\\nRun result: {}\\n\".format(run_step))\n            if run_step.status == 'queued':\n                run_obj = run_step.details.run_object\n                run_id = run_obj.id\n            elif run_step.status == 'requires_action':\n                detail = run_step.details\n                tool_call = detail.tool_calls[0]\n                func_res = get_cur_whether(**eval(tool_call.function.arguments))\n                submit_res = appbuilder.assistant.threads.runs.submit_tool_outputs(\n                    run_id=run_id,\n                    thread_id=thread.id,\n                    tool_outputs=[\n                        {\"tool_call_id\": tool_call.id,\n                            \"output\": func_res,}\n                    ]\n                )\n                self.assertIsInstance(submit_res, appbuilder.assistant.type.RunResult)\n\n        self.assertIsInstance(run_step, appbuilder.assistant.type.StreamRunStatus)\n        self.assertEqual(run_step.status, 'completed')\n        self.assertEqual(run_step.event_type, 'run_end')\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_assistant_e2e_stream_run.py",
    "content": "import unittest\nimport pydantic\nimport os\nimport time\nimport appbuilder\n\n@unittest.skip(\"QPS超限\")\nclass TestAssistantStreamTalk(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TOKEN\"] = os.environ[\"APPBUILDER_TOKEN_V2\"]\n\n    def test_end_to_end(self):\n        begin_time = time.time()\n        last_time = time.time()\n        assistant = appbuilder.assistant.assistants.create(\n            name=\"test_assistant\",\n            description=\"test assistant\",\n            instructions=\"每句话回复前都加上我是秦始皇\"\n        )\n        thread = appbuilder.assistant.threads.create(\n            [\n                {'content': 'hello world'}\n            ]\n        )\n        \n        run_result = appbuilder.assistant.threads.runs.stream_run(\n            thread_id=thread.id,\n            assistant_id=assistant.id,\n        )\n\n        for run_step in run_result:\n            current_time = time.time()\n            print(run_step)\n            print(\"cur step use_time: {} s\\n\".format(current_time - last_time))\n            last_time = current_time\n\n        self.assertIsInstance(run_step, appbuilder.assistant.type.StreamRunStatus)\n        self.assertEqual(run_step.status, 'completed')\n        end_time = time.time()\n        print(\"total use_time: {} s\".format(end_time - begin_time))\n\n\nif __name__ == \"__main__\":\n    unittest.main()"
  },
  {
    "path": "python/tests/test_async_appbuilder_client.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\nimport asyncio\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientAsync(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"fb64d96b-f828-4385-ba1d-835298d635a9\"\n\n    def test_async_run_stream(self):\n        appbuilder.logger.setLoglevel(\"ERROR\")\n\n        async def agent_run(client, conversation_id, text):\n            ans = await client.run(conversation_id, text, stream=True)\n            async for data in ans.content:\n                print(data)\n\n        async def agent_handle():\n            client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await client.create_conversation()\n            task1 = asyncio.create_task(\n                agent_run(client, conversation_id, \"最早的邮展\"))\n            task2 = asyncio.create_task(\n                agent_run(client, conversation_id, \"最早的漫展\"))\n            await asyncio.gather(task1, task2)\n            await client.http_client.session.close()\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(agent_handle())\n\n    def test_async_run(self):\n        appbuilder.logger.setLoglevel(\"ERROR\")\n\n        async def agent_run(client, conversation_id, text):\n            ans = await client.run(conversation_id, text, stream=False)\n            print(ans.content.answer)\n\n        async def agent_handle():\n            client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await client.create_conversation()\n            await client.upload_file(conversation_id, \"./data/qa_appbuilder_client_demo.pdf\")\n            await client.upload_file(\n                conversation_id=conversation_id,\n                file_url=\"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad6862cf937c03f8c5260d51c6ae\",\n            )\n            task1 = asyncio.create_task(\n                agent_run(client, conversation_id, \"最早的邮展\"))\n            task2 = asyncio.create_task(\n                agent_run(client, conversation_id, \"最早的漫展\"))\n            await asyncio.gather(task1, task2)\n            await client.http_client.session.close()\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(agent_handle())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_async_appbuilder_client_chatflow.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport asyncio\nimport unittest\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.async_event_handler import (\n    AsyncAppBuilderEventHandler,\n)\n\n\nclass MyEventHandler(AsyncAppBuilderEventHandler):\n    def __init__(self):\n        super().__init__()\n        self.interrupt_ids = []\n\n    async def handle_content_type(self, run_context, run_response):\n        interrupt_event_id = None\n        event = run_response.events[-1]\n        if event.content_type == \"chatflow_interrupt\":\n            interrupt_event_id = event.detail.get(\"interrupt_event_id\")\n        if interrupt_event_id is not None:\n            self.interrupt_ids.append(interrupt_event_id)\n\n    def _create_action(self):\n        if len(self.interrupt_ids) == 0:\n            return None\n        event_id = self.interrupt_ids.pop()\n        return {\n            \"action_type\": \"resume\",\n            \"parameters\": {\"interrupt_event\": {\"id\": event_id, \"type\": \"chat\"}},\n        }\n\n    async def run(self, query=None):\n        await super().new_dialog(\n            query=query,\n            action=self._create_action(),\n        )\n\n    def gen_action(self):\n        while True:\n            yield self._create_action()\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientChatflow(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"4403205e-fb83-4fac-96d8-943bdb63796f\"\n\n    def test_chatflow(self):\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n\n        async def agent_handle():\n            client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await client.create_conversation()\n            event_handler = MyEventHandler()\n            await event_handler.init(\n                appbuilder_client=client,\n                conversation_id=conversation_id,\n                stream=False,\n                query=\"查天气\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"查航班\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"CA1234\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"北京的\",\n            )\n            async for data in event_handler:\n                pass\n\n            await client.http_client.session.close()\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(agent_handle())\n\n    def test_chatflow_stream(self):\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n\n        async def agent_handle():\n            client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await client.create_conversation()\n            event_handler = MyEventHandler()\n            await event_handler.init(\n                appbuilder_client=client,\n                conversation_id=conversation_id,\n                stream=True,\n                query=\"查天气\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"查航班\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"CA1234\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"北京的\",\n            )\n            async for data in event_handler:\n                pass\n\n            await client.http_client.session.close()\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(agent_handle())\n\n    def test_chatflow_stream(self):\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n\n        async def agent_handle():\n            client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await client.create_conversation()\n            event_handler = MyEventHandler()\n            await event_handler.init(\n                appbuilder_client=client,\n                conversation_id=conversation_id,\n                stream=True,\n                query=\"查天气\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"查航班\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"CA1234\",\n            )\n            async for data in event_handler:\n                pass\n            await event_handler.run(\n                query=\"北京的\",\n            )\n            async for data in event_handler:\n                pass\n\n            await client.http_client.session.close()\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(agent_handle())\n    \n    def test_chatflow_multiple_dialog(self):\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n\n        async def agent_handle():\n            client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await client.create_conversation()\n            queries = [\"查天气\", \"查航班\", \"CA1234\", \"北京的\"]\n            event_handler = MyEventHandler()\n            event_handler = client.run_multiple_dialog_with_handler(\n                    conversation_id=conversation_id,\n                    queries=queries,\n                    event_handler=event_handler,\n                    stream=False,\n                    actions=event_handler.gen_action(),\n                )\n            async for data in event_handler:\n                async for answer in data:\n                    print(answer)\n\n            await client.http_client.session.close()\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(agent_handle())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_async_appbuilder_client_custom_metadata.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport asyncio\nimport os\nimport unittest\n\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.data_class import CustomMetadata\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientFeedback(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"a3654cd9-378a-4b46-a33b-2259ca3b304e\"\n\n    def test_async_appbuilder_custom_metadata(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n\n        async def agent_handle():\n            if len(self.app_id) == 0:\n                self.skipTest(\"self.app_id is empty\")\n            appbuilder.logger.setLoglevel(\"ERROR\")\n            builder = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await builder.create_conversation()\n            msg = await builder.run(conversation_id, \"我要回老家相亲\", stream=False, custom_metadata=CustomMetadata(\n                override_role_instruction=\"# 角色任务\\n\" +\n                                          \"作为高情商大师，你的主要任务是根据提问，做出最佳的建议。\\n\" +\n                                          \"\\n\" +\n                                          \"# 工具能力\\n\" +\n                                          \"\\n\" +\n                                          \"无工具集提供\\n\" +\n                                          \"\\n\" +\n                                          \"# 要求与限制\\n\" +\n                                          \"\\n\" +\n                                          \"1. 输出内容的风格为幽默\\n\" +\n                                          \"2.输出的字数限制为100字以内\\n\" +\n                                          \"3. 在每次回复开头都声明今天的天气情况\\n\" +\n                                          \"4. 在每次回复结尾都声明现在的btc价格\",\n            ))\n            print(msg)\n            await builder.http_client.session.close()\n\n        asyncio.run(agent_handle())\n\n    def test_async_appbuilder_custom_metadata_stream(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n\n        async def agent_handle():\n            if len(self.app_id) == 0:\n                self.skipTest(\"self.app_id is empty\")\n            appbuilder.logger.setLoglevel(\"ERROR\")\n            builder = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await builder.create_conversation()\n            msg = await builder.run(conversation_id, \"我要回老家相亲\", stream=True, custom_metadata=CustomMetadata(\n                override_role_instruction=\"# 角色任务\\n\" +\n                                          \"作为高情商大师，你的主要任务是根据提问，做出最佳的建议。\\n\" +\n                                          \"\\n\" +\n                                          \"# 工具能力\\n\" +\n                                          \"\\n\" +\n                                          \"无工具集提供\\n\" +\n                                          \"\\n\" +\n                                          \"# 要求与限制\\n\" +\n                                          \"\\n\" +\n                                          \"1. 输出内容的风格为幽默\\n\" +\n                                          \"2.输出的字数限制为100字以内\\n\" +\n                                          \"3. 在每次回复开头都声明今天的天气情况\\n\" +\n                                          \"4. 在每次回复结尾都声明现在的btc价格\",\n            ))\n\n            async for content in msg.content:\n                print(content)\n            await builder.http_client.session.close()\n\n        asyncio.run(agent_handle())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_async_appbuilder_client_follow_up_query.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\nimport asyncio\nimport appbuilder\nfrom appbuilder.core.console.appbuilder_client.async_event_handler import (\n    AsyncAppBuilderEventHandler,\n)\n\n\nclass MyEventHandler(AsyncAppBuilderEventHandler):\n    def __init__(self):\n        super().__init__()\n        self.follow_up_queries = []\n\n    async def handle_content_type(self, run_context, run_response):\n        event = run_response.events[-1]\n        if event.content_type == \"json\" and event.event_type == \"FollowUpQuery\":\n            follow_up_queries = event.detail.get(\"json\").get(\"follow_up_querys\")\n            self.follow_up_queries.extend(follow_up_queries)\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientAsync(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"fb64d96b-f828-4385-ba1d-835298d635a9\"\n\n    def test_async_run_stream(self):\n        appbuilder.logger.setLoglevel(\"ERROR\")\n        async def agent_handle():\n            client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await client.create_conversation()\n            event_handler = MyEventHandler()\n            with await client.run_with_handler(\n                conversation_id = conversation_id,\n                query = \"你能做什么\",\n                stream=True,\n                event_handler=event_handler,\n            ) as run:\n                await run.until_done()\n\n            print(event_handler.follow_up_queries)\n            await client.http_client.session.close()\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(agent_handle())\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_async_appbuilder_client_parameters.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport asyncio\nimport unittest\nimport os\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAppBuilderClientFeedback(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"2313e282-baa6-4db6-92dd-a21e99cfd59e\"\n\n    def test_async_appbuilder_parameters(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n\n        async def agent_handle():\n            if len(self.app_id) == 0:\n                self.skipTest(\"self.app_id is empty\")\n            appbuilder.logger.setLoglevel(\"ERROR\")\n            builder = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await builder.create_conversation()\n            msg = await builder.run(conversation_id, \"国庆长假\", stream=False, parameters={\"city\": \"北京\"})\n            print(msg.content.answer)\n            await builder.http_client.session.close()\n\n        asyncio.run(agent_handle())\n\n    def test_async_appbuilder_parameters_stream(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n\n        async def agent_handle():\n            if len(self.app_id) == 0:\n                self.skipTest(\"self.app_id is empty\")\n            appbuilder.logger.setLoglevel(\"ERROR\")\n            builder = appbuilder.AsyncAppBuilderClient(self.app_id)\n            conversation_id = await builder.create_conversation()\n            msg = await builder.run(conversation_id, \"元旦节\", stream=True, parameters={\"city\": \"北京\"})\n\n            async for content in msg.content:\n                print(content.answer)\n            await builder.http_client.session.close()\n\n        asyncio.run(agent_handle())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_async_appbuilder_client_toolcall.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport appbuilder\nimport asyncio\nimport os\nfrom appbuilder.core.console.appbuilder_client.async_event_handler import (\n    AsyncAppBuilderEventHandler,\n)\n\n\nclass MyEventHandler(AsyncAppBuilderEventHandler):\n    def get_current_weather(self, location=None, unit=\"摄氏度\"):\n        return \"{} 的温度是 {} {}\".format(location, 20, unit)\n\n    async def interrupt(self, run_context, run_response):\n        thought = run_context.current_thought\n        # 绿色打印\n        print(\"\\033[1;32m\", \"-> Agent 中间思考: \", thought, \"\\033[0m\")\n\n        tool_output = []\n        for tool_call in run_context.current_tool_calls:\n            tool_call_id = tool_call.id\n            tool_res = self.get_current_weather(**tool_call.function.arguments)\n            # 蓝色打印\n            print(\"\\033[1;34m\", \"-> 本地ToolCallId: \", tool_call_id, \"\\033[0m\")\n            print(\"\\033[1;34m\", \"-> ToolCall结果: \", tool_res, \"\\033[0m\\n\")\n            tool_output.append(\n                {\"tool_call_id\": tool_call_id, \"output\": tool_res})\n        return tool_output\n\n    async def success(self, run_context, run_response):\n        print(\"\\n\\033[1;31m\", \"-> Agent 非流式回答: \",\n              run_response.answer, \"\\033[0m\")\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestAgentRuntime(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.app_id = \"b2a972c5-e082-46e5-b313-acbf51792422\"\n\n    def test_appbuilder_client_tool_call(self):\n        # 如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n        \"\"\"\n        如果app_id为空，则跳过单测执行, 避免单测因配置无效而失败\n\n        Args:\n            self (unittest.TestCase): unittest的TestCase对象\n\n        Raises:\n            None: 如果app_id不为空，则不会引发任何异常\n            unittest.SkipTest (optional): 如果app_id为空，则跳过单测执行\n        \"\"\"\n        tools = [\n            {\n                \"type\": \"function\",\n                \"function\": {\n                    \"name\": \"get_current_weather\",\n                    \"description\": \"仅支持中国城市的天气查询，参数location为中国城市名称，其他国家城市不支持天气查询\",\n                    \"parameters\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"location\": {\n                                \"type\": \"string\",\n                                \"description\": \"城市名，举例：北京\",\n                            },\n                            \"unit\": {\"type\": \"string\", \"enum\": [\"摄氏度\", \"华氏度\"]},\n                        },\n                        \"required\": [\"location\", \"unit\"],\n                    },\n                },\n            }\n        ]\n\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n\n        async def agent_run(client, query):\n            conversation_id = await client.create_conversation()\n            with await client.run_with_handler(\n                conversation_id=conversation_id,\n                query=query,\n                tools=tools,\n                event_handler=MyEventHandler(),\n            ) as run:\n                await run.until_done()\n\n        async def agent_handle():\n            client = appbuilder.AsyncAppBuilderClient(self.app_id)\n            task1 = asyncio.create_task(\n                agent_run(client, \"北京的天气怎么样\"))\n            task2 = asyncio.create_task(\n                agent_run(client, \"上海的天气怎么样\"))\n            await asyncio.gather(task1, task2)\n\n            await client.http_client.session.close()\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(agent_handle())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_base_component.py",
    "content": "import os\nimport unittest\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.component import ComponentOutput, Urls, Chart\n\n# @unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestBaseComponent(unittest.TestCase):\n    def setUp(self) -> None:\n        self.component = Component()\n\n\n    def test_valid_output_with_str(self):\n        out1 = self.component.create_output(type=\"text\", text=\"test\")\n        out2 = self.component.create_output(type=\"code\", text=\"import appbuilder\")\n        out3 = self.component.create_output(type=\"urls\", text=\"http://www.baidu.com\")\n        out4 = self.component.create_output(type=\"oral_text\", text=\"你是哪个\")\n        out5 = self.component.create_output(type=\"json\", text=\"{'key':'value'}\")\n        out6 = self.component.create_output(type=\"reasoning_content\", text=\"思考过程\")\n        self.assertIsInstance(out1, ComponentOutput)\n        self.assertIsInstance(out2, ComponentOutput)\n        self.assertIsInstance(out3, ComponentOutput)\n        self.assertIsInstance(out4, ComponentOutput)\n        self.assertIsInstance(out5, ComponentOutput)\n        self.assertIsInstance(out6, ComponentOutput)\n    def test_valid_output_with_dict(self):\n        output1 = self.component.create_output(type=\"text\", text={\"info\": \"1\"})\n        output2 = self.component.create_output(type=\"code\", text={\"code\": \"1\"})\n        output3 = self.component.create_output(type=\"urls\", text={\"url\": \"http://www.baidu.com\"})\n        output4 = self.component.create_output(type=\"oral_text\", text={\"info\": \"你好\"})\n        output5 = self.component.create_output(type=\"files\", text={\"filename\": \"file.txt\", \"url\": \"http://www.baidu.com\"})\n        output6 = self.component.create_output(type=\"image\", text={\"filename\": \"file.png\", \"url\": \"http://www.baidu.com\"})\n        output7 = self.component.create_output(type=\"chart\", text={\"type\": \"chart\", \"data\": '{\"key\": \"value\"}'})\n        output8 = self.component.create_output(type=\"audio\", text={\"filename\": \"file.mp3\", \"url\": \"http://www.baidu.com\"})\n        output9 = self.component.create_output(type=\"plan\", text={\"detail\": \"hello\", \"steps\":[{\"name\": \"1\", \"arguments\": {\"query\": \"a\", \"chat_history\": \"world\"}}]})\n        output10 = self.component.create_output(type=\"function_call\", text={\"thought\": \"hello\", \"name\": \"AppBuilder\", \"arguments\": {\"query\": \"a\", \"chat_history\": \"world\"}})\n        output11 = self.component.create_output(type=\"references\", text={\"type\": \"engine\", \"doc_id\": \"1\", \"content\": \"hello, world\", \"title\": \"Have a nice day\", \"source\": \"bing\", \"extra\": {\"key\": \"value\"}})\n        output12 = self.component.create_output(type=\"json\", text={\"data\": \"value\"})\n        output13 = self.component.create_output(type=\"browser\", text={\"query\": \"go to http://www.baidu.com\"})\n        output14 = self.component.create_output(type=\"progress\", text={\"progress\": 0.5, \"step\": \"end\", \"next_step_name\": \"step2\", \"message\": \"message\"})\n        output15 = self.component.create_output(type=\"reasoning_content\", text={\"info\": \"思考过程\"})\n        self.assertIsInstance(output1, ComponentOutput)\n        self.assertIsInstance(output2, ComponentOutput)\n        self.assertIsInstance(output3, ComponentOutput)\n        self.assertIsInstance(output4, ComponentOutput)\n        self.assertIsInstance(output5, ComponentOutput)\n        self.assertIsInstance(output6, ComponentOutput)\n        self.assertIsInstance(output7, ComponentOutput)\n        self.assertIsInstance(output8, ComponentOutput)\n        self.assertIsInstance(output9, ComponentOutput)\n        self.assertIsInstance(output10, ComponentOutput)\n        self.assertIsInstance(output11, ComponentOutput)\n        self.assertIsInstance(output12, ComponentOutput)\n        self.assertIsInstance(output13, ComponentOutput)\n        self.assertIsInstance(output14, ComponentOutput)\n        self.assertIsInstance(output15, ComponentOutput)\n        self.assertEqual(output11.content[0].text.extra[\"key\"], \"value\")\n\n    def test_valid_output_type_with_same_key(self):\n        output1 = self.component.create_output(type=\"urls\", text={\"url\": \"http://www.baidu.com\"})\n        self.assertIsInstance(output1.content[0].text, Urls)\n        output2 = self.component.create_output(type=\"chart\", text={\"type\": \"chart_sheet\", \"data\": '{\"key\": \"value\"}'})\n        self.assertIsInstance(output2.content[0].text, Chart)\n        with self.assertRaises(ValueError):\n            output = self.component.create_output(type=\"files\", text=[\"http://www.baidu.com\"])\n        with self.assertRaises(ValueError):\n            output = self.component.create_output(type=\"test\", text={\"filename\": \"file.txt\", \"url\": [\"http://www.baidu.com\"]})\n        \n        \n        \n    def test_invalid_output_type_json(self):\n        with self.assertRaises(ValueError):\n            output = self.component.create_output(type=\"test\", text=\"\")\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_bes_retriever.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\n\nimport unittest\nimport time\nimport appbuilder\n\n@unittest.skip(\"ConnectionError: NotFoundError\")\nclass TestBESRetriever(unittest.TestCase):\n\n    def setUp(self):\n\n        # for es test\n        self.cluster_id = \"...\"\n        self.username = \"...\"\n        self.password = \"...\"\n\n        self.embedding = appbuilder.Embedding()\n        self.index_type = \"hnsw\"\n        self.vector_index = appbuilder.BESVectorStoreIndex(cluster_id=self.cluster_id,\n                                                           user_name=self.username,\n                                                           password=self.password,\n                                                           embedding=self.embedding)\n\n    def test_generate_id(self):\n        id_length = 16\n        index_id = appbuilder.BESVectorStoreIndex.generate_id(length=id_length)\n        self.assertEqual(len(index_id), id_length)\n\n    def test_create_index_mappings_linear(self):\n        index_type = \"linear\"\n        vector_dims = 100\n        expected_mappings = {\n            'properties': {\n                'vector': {\n                    'type': 'bpack_vector',\n                    'dims': vector_dims,\n                }\n            }\n        }\n        actual_mappings = self.vector_index.create_index_mappings(index_type, vector_dims)\n        self.assertEqual(actual_mappings, expected_mappings)\n\n    def test_create_index_mappings_hnsw(self):\n        index_type = \"hnsw\"\n        vector_dims = 100\n        expected_mappings = {\n            'properties': {\n                'vector': {\n                    'type': 'bpack_vector',\n                    'dims': vector_dims,\n                    'index_type': 'hnsw',\n                    'space_type': 'cosine',\n                    'parameters': {\"m\": 4, \"ef_construction\": 200}\n                }\n            }\n        }\n        actual_mappings = self.vector_index.create_index_mappings(index_type, vector_dims)\n        self.assertEqual(actual_mappings, expected_mappings)\n\n    def test_add_segments(self):\n        segments = appbuilder.Message([\"文心一言大模型\", \"百度在线科技有限公司\"])\n        self.vector_index.add_segments(segments)\n        time.sleep(5)\n        self.assertEqual(self.vector_index.get_all_segments()[\"hits\"][\"total\"][\"value\"], len(segments.content))\n\n    def test_query(self):\n        segments = appbuilder.Message([\"文心一言大模型\", \"百度在线科技有限公司\"])\n        vector_index = appbuilder.BESVectorStoreIndex.from_segments(segments, self.cluster_id, self.username,\n                                                                    self.password)\n        query = appbuilder.Message(\"文心一言\")\n        time.sleep(5)\n        retriever = vector_index.as_retriever()\n        res = retriever(query)\n        self.assertEqual(res.content[0][\"text\"], \"文心一言大模型\")\n\n    def test_delete_all_segments(self):\n        segments = appbuilder.Message([\"文心一言大模型\"])\n        vector_index = appbuilder.BESVectorStoreIndex.from_segments(segments, self.cluster_id, self.username,\n                                                                    self.password)\n        time.sleep(5)\n        vector_index.delete_all_segments()\n        time.sleep(5)\n        self.assertEqual(vector_index.get_all_segments()[\"hits\"][\"total\"][\"value\"], 0)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_component_client.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport appbuilder\nimport os\n\n\n#unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestComponentCLient(unittest.TestCase):\n    def test_component_client(self):\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n        client = appbuilder.ComponentClient()\n\n        res = client.run(component_id=\"44205c67-3980-41f7-aad4-37357b577fd0\",\n                         version=\"latest\", sys_origin_query=\"北京景点推荐\")\n        print(res.content)\n\n    def test_component_client_stream(self):\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n        client = appbuilder.ComponentClient()\n\n        res = client.run(component_id=\"44205c67-3980-41f7-aad4-37357b577fd0\",\n                         version=\"latest\", sys_origin_query=\"北京景点推荐\", stream=True)\n        for data in res.content:\n            print(data)\n\n    def test_component_header_client(self):\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n        client = appbuilder.ComponentClient()\n\n        res = client.run(component_id=\"c-wf-a39ee06c-808f-4a19-9f5f-544044283749\",\n                         version=\"latest\", sys_origin_query=\"梦到巨人\")\n        print(res.content)\n\n    def test_component_header_client_stream(self):\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n        client = appbuilder.ComponentClient()\n\n        res = client.run(component_id=\"c-wf-a39ee06c-808f-4a19-9f5f-544044283749\",\n                         version=\"latest\", sys_origin_query=\"梦到巨人\", stream=True)\n        for data in res.content:\n            print(data)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_component_is_async.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport json\nimport os\nimport unittest\nfrom appbuilder.core.component import Component\n\nclass MockComponent(Component):\n\n    def __init__(self, *args, **kwargs):\n        pass\n\n    def tool_eval(self, *args, **kwargs):\n        print(\"Success\")\n    \n\nclass TestComponentInit(unittest.TestCase):\n    def test_component_init(self):\n        component = MockComponent()\n        os.environ[\"APPBUILDER_TOKEN\"] = \"abc\"\n        component.set_secret_key_and_gateway()\n        component.tool_eval()\n\n    def test_private_llm_component_init(self):\n        os.environ[\"PRIVATE_AB\"] = \"true\"\n        component = MockComponent()\n        component.set_model_info(\"test_model_name\", \"test_model_url\")\n        os.environ[\"APPBUILDER_TOKEN\"] = \"abc\"\n        component.set_secret_key_and_gateway()\n        component.tool_eval()\n        \nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_console_dataset.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport uuid\nimport time\n\nimport unittest\nimport appbuilder\nfrom appbuilder.core._client import HTTPClient\n\n\n@unittest.skip(\"暂时跳过\")\nclass TestDataset(unittest.TestCase):\n    def setUp(self):\n        self.dataset_id = os.getenv(\"DATASET_ID\", \"UNKNOWN\")\n    \n    @classmethod\n    def setUpClass(cls):\n        # 获取当前文件所在的目录路径\n        cls.current_dir = os.path.dirname(__file__)\n        cls.test_pdf_path = os.path.join(cls.current_dir, 'test.pdf')\n\n    def test_create_dataset(self):\n        # test_dataset\n        dataset_name = \"baidu-test\"+str(int(time.time()))\n        dataset_id=str(uuid.uuid4())\n        dataset = appbuilder.console.Dataset(dataset_id=dataset_id, dataset_name=dataset_name)\n        dataset.create_dataset\n        http_result=dataset.http_client\n        self.assertIsInstance(http_result, HTTPClient)\n    \n    def test_dataset(self):\n        # 初始化数据库\n        dataset = appbuilder.console.Dataset(\n            dataset_id=self.dataset_id,\n            dataset_name=\"勿删-appbuilder-sdk测试数据集\"\n        )\n        self.assertIsNotNone(dataset.dataset_id)\n\n        # 上传文档\n        file_paths = [self.test_pdf_path]\n        document_infos = dataset.add_documents(file_paths)\n        self.assertEqual(len(document_infos.document_ids), 1)\n\n        # 获取第一页的文档列表, 每页10条\n        file_list = dataset.get_documents(1, 10)\n        self.assertIsInstance(file_list.total, int)\n\n        # 删除文档\n        file_ids = [document_infos.document_ids[0]]\n        dataset.delete_documents(file_ids)\n\n        # 获取第一页的文档列表, 每页10条\n        document_list = dataset.get_documents(1, 10)\n        self.assertIsInstance(document_list.total, int)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_console_rag.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport appbuilder\nimport os\n\nfrom appbuilder.core.console.rag.rag import RAG\n\n\n@unittest.skip(\"暂时跳过\")\nclass TestRag(unittest.TestCase):\n\n    def setUp(self):\n        self.app_id = \"06e3f5c9-885d-4f85-af57-97dc85ee4606\"\n\n    def test_rag(self):\n        rag_app = RAG(self.app_id)\n        query = \"写一个200字作文，主题关于百度AI\"\n        answer = rag_app.run(appbuilder.Message(query))\n        self.assertIsNotNone(answer.content)\n        \n        # test debug\n        rag_app.debug(appbuilder.Message(query))\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_core_agent.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport json\nimport os\nimport unittest\nimport random\n\nfrom appbuilder.core.components.llms.style_writing import StyleWriting\nfrom appbuilder.core.agent import AgentRuntime\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.message import Message\nfrom appbuilder.utils.sse_util import SSEClient\n\n\ndef generate_event(case):\n    # 模拟正常事件\n    if case == \"normal\":\n        yield \"event1\"\n        yield \"event2\"\n        yield \"event3\"\n    # 模拟首包一定概率出错\n    elif case == \"head_may_failed\":\n        num = random.randint(1, 100)\n        if num < 20:\n            raise Exception(\"事件生成报错\")\n        else:\n            yield \"event1\"\n    # 模型中包出错\n    elif case == \"middle_failed\":\n        yield \"event1\"\n        raise Exception(\"事件生成报错\")\n    # 模拟首包总是报错\n    elif case == \"head_always_failed\":\n        raise Exception(\"事件生成报错\")\n\n\n# 模拟流式事件生成报错\nclass FakeComponent1(Component):\n    def run(self, message, stream, **kwargs):\n        # 模拟流式调用\n        if stream:\n            case = kwargs[\"case\"]\n            return Message(content=generate_event(case))\n        else:\n            return Message(content=\"result\")\n\n\n# 模拟组件内部执行报错\nclass FakeComponent2(Component):\n    def run(self, message, stream, **kwargs):\n        # 内部执行报错\n        raise Exception(\"内部执行报错\")\n\n\nclass TestCoreAgent(unittest.TestCase):\n    def setUp(self):\n        pass\n\n    def test_core_agent_create_flask1(self):\n        component = FakeComponent1()\n        # agent = AgentRuntime(component=StyleWriting(model=\"eb\"))\n        agent = AgentRuntime(component=component)\n\n        app = agent.create_flask_app()\n        client = app.test_client()\n        payload = {\n            \"stream\": False,\n            \"message\": \"message\",\n        }\n        # 非流式请求\n        rsp = client.post(\"http://127.0.0.1:8080/chat\", json=payload)\n        assert (rsp.json[\"code\"] == 0)\n\n        # 流式请求\n        for case in [\"normal\", \"head_may_failed\", \"middle_failed\", \"head_always_failed\"]:\n            payload = {\n                \"stream\": True,\n                \"message\": \"message\",\n                \"case\": case\n            }\n            if case == \"normal\":\n                rsp = client.post(\"http://127.0.0.1:8080/chat\", json=payload)\n                data_chunks = rsp.data.splitlines(keepends=True)\n                for event in SSEClient(data_chunks).events():\n                    d = json.loads(event.data)\n                    self.assertEqual(d[\"code\"], 0)\n            if case == \"head_may_failed\":\n                for i in range(5):\n                    rsp = client.post(\"http://127.0.0.1:8080/chat\", json=payload)\n                    data_chunks = rsp.data.splitlines(keepends=True)\n                    for event in SSEClient(data_chunks).events():\n                        d = json.loads(event.data)\n                        self.assertEqual(d[\"code\"], 0)\n            if case == \"middle_failed\":\n                rsp = client.post(\"http://127.0.0.1:8080/chat\", json=payload)\n                data_chunks = rsp.data.splitlines(keepends=True)\n                i = 0\n                for event in SSEClient(data_chunks).events():\n                    d = json.loads(event.data)\n                    if i == 0:\n                        self.assertEqual(d[\"code\"], 0)\n                    if i == 1:\n                        self.assertNotEqual(d[\"code\"], 0)\n                    i += 1\n\n            if case == \"head_always_failed\":\n                rsp = client.post(\"http://127.0.0.1:8080/chat\", json=payload)\n                data_chunks = rsp.data.splitlines(keepends=True)\n                for event in SSEClient(data_chunks).events():\n                    self.assertNotEqual(d[\"code\"], 0)\n\n    def test_core_agent_create_flask2(self):\n        component = FakeComponent2()\n        agent = AgentRuntime(component=component)\n        app = agent.create_flask_app()\n        client = app.test_client()\n        payload = {\n            \"stream\": False,\n            \"message\": \"message\",\n        }\n        # 非流式请求\n        rsp = client.post(\"http://127.0.0.1:8080/chat\", json=payload)\n        assert (rsp.json[\"code\"] != 0)\n\n        payload = {\n            \"stream\": True,\n            \"message\": \"message\",\n        }\n        # 流式请求\n        rsp = client.post(\"http://127.0.0.1:8080/chat\", json=payload)\n        data_chunks = rsp.data.splitlines(keepends=True)\n        for event in SSEClient(data_chunks).events():\n            d = json.loads(event.data)\n            self.assertNotEqual(d[\"code\"], 0)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_core_client.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport json\nimport asyncio\n\nfrom appbuilder.core._client import HTTPClient, AsyncHTTPClient\nfrom appbuilder.core._exception import *\n\n# 创建一个response类,模拟requests.Response\n\n\nclass Response:\n    def __init__(self, status_code, headers, text):\n        self.status_code = status_code\n        self.headers = headers\n        self.text = text\n\n    def json(self):\n        return json.loads(self.text)\n\n\nclass AsyncResponse:\n    def __init__(self, status_code, headers, text):\n        self.status = status_code\n        self.headers = headers\n        self.text = text\n\n    def json(self):\n        return json.loads(self.text)\n\n\nclass TestCoreClient(unittest.TestCase):\n    def setUp(self):\n        # 保存原始环境变量\n        self.original_appbuilder_token = os.getenv('APPBUILDER_TOKEN')\n        self.original_gateway_url = os.getenv('GATEWAY_URL')\n\n    def tearDown(self):\n        # 恢复环境变量\n        if self.original_appbuilder_token is None:\n            os.unsetenv('APPBUILDER_TOKEN')\n        else:\n            os.environ['APPBUILDER_TOKEN'] = self.original_appbuilder_token\n\n        if self.original_gateway_url is None:\n            os.unsetenv('GATEWAY_URL')\n        else:\n            os.environ['GATEWAY_URL'] = self.original_gateway_url\n\n    def test_core_client_init_non_APPBUILDER_TOKEN(self):\n        os.environ['APPBUILDER_TOKEN'] = ''\n        with self.assertRaises(ValueError):\n            HTTPClient()\n\n    def test_core_client_init_non_GATEWAY_URL(self):\n        os.environ['GATEWAY_URL'] = 'test'\n        hp = HTTPClient()\n        assert hp.gateway.startswith('https://')\n\n    def test_core_client_check_response_header(self):\n        # 测试各种response报错\n        response = Response(\n            status_code=400,\n            headers={'Content-Type': 'application/json'},\n            text='{\"code\": 0, \"message\": \"success\"}'\n        )\n        with self.assertRaises(BadRequestException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 403\n        with self.assertRaises(ForbiddenException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 404\n        with self.assertRaises(NotFoundException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 428\n        with self.assertRaises(PreconditionFailedException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 500\n        with self.assertRaises(InternalServerErrorException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 201\n        with self.assertRaises(BaseRPCException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 401\n        with self.assertRaises(UnAuthorizedException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 405\n        with self.assertRaises(MethodNotAllowedException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 409\n        with self.assertRaises(ConflictException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 411\n        with self.assertRaises(MissingContentLengthException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 422\n        with self.assertRaises(UnprocessableEntityException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 424\n        with self.assertRaises(DependencyFailedException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 429\n        with self.assertRaises(TooManyRequestsException):\n            HTTPClient.check_response_header(response)\n\n        response.status_code = 507\n        with self.assertRaises(InsufficientStorageException):\n            HTTPClient.check_response_header(response)\n\n        import requests\n        http_error = requests.exceptions.HTTPError(response=response)\n        with self.assertRaises(InsufficientStorageException):\n            HTTPClient.classify_exception(http_error)\n\n    def test_core_client_check_async_response_header(self):\n        async def run_test():\n            # 测试各种response报错\n            response = AsyncResponse(\n                status_code=400,\n                headers={'Content-Type': 'application/json'},\n                text=lambda:asyncio.sleep(0) or '{\"code\": 0, \"message\": \"success\"}'\n            )\n            with self.assertRaises(BadRequestException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 403\n            with self.assertRaises(ForbiddenException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 404\n            with self.assertRaises(NotFoundException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 428\n            with self.assertRaises(PreconditionFailedException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 500\n            with self.assertRaises(InternalServerErrorException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 201\n            with self.assertRaises(BaseRPCException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 401\n            with self.assertRaises(UnAuthorizedException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 405\n            with self.assertRaises(MethodNotAllowedException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 409\n            with self.assertRaises(ConflictException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 411\n            with self.assertRaises(MissingContentLengthException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 422\n            with self.assertRaises(UnprocessableEntityException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 424\n            with self.assertRaises(DependencyFailedException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 429\n            with self.assertRaises(TooManyRequestsException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            response.status = 507\n            with self.assertRaises(InsufficientStorageException):\n                await AsyncHTTPClient.check_response_header(response)\n\n            import requests\n            http_error = requests.exceptions.HTTPError(response=response)\n            with self.assertRaises(InsufficientStorageException):\n                await AsyncHTTPClient.classify_exception(http_error)\n            \n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(run_test())\n\n    def test_core_client_check_response_json(self):\n        data = {\n            'code': 0,\n            'message': 'test',\n            'requestId': 'test'\n        }\n        with self.assertRaises(AppBuilderServerException):\n            HTTPClient.check_response_json(data)\n\n    def test_core_check_console_response(self):\n        response = Response(\n            status_code=400,\n            headers={'Content-Type': 'application/json'},\n            text=json.dumps({\n                'code': 1,\n                'message': 'test',\n                'requestId': 'test'\n            })\n        )\n        with self.assertRaises(AppBuilderServerException):\n            HTTPClient.check_console_response(response)\n\n    def test_classify_exception(self):\n        \"\"\"测试异常分类方法\"\"\"\n        import requests\n        client = HTTPClient()\n        \n        # 测试 HTTP 错误\n        response = Response(\n            status_code=requests.codes.internal_server_error,\n            headers=client.auth_header(),\n            text=\"Internal Server Error\"\n        )\n        http_error = requests.exceptions.HTTPError(response=response)\n        \n        with self.assertRaises(InternalServerErrorException):\n            client.classify_exception(http_error)\n        \n        # 测试 AppBuilder 服务器异常\n        app_error = AppBuilderServerException(\n            request_id=\"test_id\",\n            code=500,\n            message=\"Interal Server Error\"\n        )\n        \n        with self.assertRaises(AppBuilderServerException) as context:\n            client.classify_exception(app_error)\n        \n        self.assertEqual(context.exception.code, 500)\n        \n        # 测试其他类型异常\n        other_error = ValueError(\"Test error\")\n        \n        with self.assertRaises(InternalServerException) as context:\n            client.classify_exception(other_error)\n        \n        self.assertEqual(str(context.exception), \"Test error\")\n\n\n    def test_AsyncHTTPClient_classify_exception(self):\n        \"\"\"测试异常分类方法\"\"\"\n        async def run_test():\n            import requests\n            client = AsyncHTTPClient()\n            # 测试 HTTP 错误\n            response = AsyncResponse(\n                status_code=requests.codes.internal_server_error,\n                headers=client.auth_header(),\n                text=lambda:asyncio.sleep(0) or '{\"code\": 0, \"message\": \"success\"}'\n            )\n            http_error = requests.exceptions.HTTPError(response=response)\n            \n            with self.assertRaises(InternalServerErrorException):\n                await client.classify_exception(http_error)\n            \n            # 测试 AppBuilder 服务器异常\n            app_error = AppBuilderServerException(\n                request_id=\"test_id\",\n                code=\"500\",\n                message=\"Interal Server Error\"\n            )\n            \n            with self.assertRaises(AppBuilderServerException) as context:\n                await client.classify_exception(app_error)\n            \n            self.assertEqual(context.exception.code, \"500\")\n            \n            # 测试其他类型异常\n            other_error = ValueError(\"Test error\")\n            \n            with self.assertRaises(InternalServerException) as context:\n                await client.classify_exception(other_error)\n            \n            self.assertEqual(str(context.exception), \"Test error\")\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(run_test())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_core_components_baidu_vdb_retriever.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport time\n\nimport appbuilder\n\nfrom appbuilder import BESVectorStoreIndex\nfrom appbuilder import BaiduVDBVectorStoreIndex,TableParams\nfrom appbuilder.core.component import Message \n\n@unittest.skip(reason=\"vdb欠费了,跳过\")\nclass TestBaiduVbdRetriever(unittest.TestCase):\n    def setUp(self):\n        self.instance_id=os.getenv(\"INSTANCE_ID\", \"UNKNOWN\")\n        self.api_key=os.getenv(\"BAIDU_VDB_API_KEY\", \"UNKNOWN\")\n\n        \n    def test_BaiduVDBVectorStoreIndex_init(self):\n        bvvsi=BaiduVDBVectorStoreIndex(self.instance_id, self.api_key)\n        \n    def test_create_database_if_not_exists_and_create_table(self):\n        bvvsi=BaiduVDBVectorStoreIndex(self.instance_id, self.api_key)\n        dataset_name=\"test_dataset\"+str(int(time.time()))\n        bvvsi._create_database_if_not_exists(dataset_name)\n        with self.assertRaises(ValueError):\n            bvvsi._create_table(table_params=None)\n        bvvsi._create_table(table_params=TableParams(dimension=384))\n        \n        # test_as_retriever\n        retriever=bvvsi.as_retriever()\n        \n        # test_add_segments\n        message=Message()\n        with self.assertRaises(IndexError):\n            bvvsi.add_segments(message)\n\n        \n\n        \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_core_components_doc.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport copy\n\nfrom appbuilder.core.components.doc_crop_enhance.component import DocCropEnhance\nfrom appbuilder.core.components.doc_splitter.component import DocSplitter, ChunkSplitter, TitleSplitter\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.doc_parser.base import ParseResult, ParaNode,Position\nfrom appbuilder.core.components.doc_format_converter.component import DocFormatConverter\n\nfrom appbuilder.core._exception import InvalidRequestArgumentError\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCoreComponentsDoc(unittest.TestCase):\n    def test_doc_crop_enhance_component(self):\n        message=Message()\n        dce=DocCropEnhance()\n        with self.assertRaises(InvalidRequestArgumentError):\n            dce.run(message=message,enhance_type=10)\n            \n    def test_doc_splitter_doc_splitter_DocSplitter(self):\n        # test_if not self.splitter_type\n        ds=DocSplitter(splitter_type='')\n        dr=ParseResult()\n        message=Message()\n        message.content=dr\n        with self.assertRaises(ValueError):\n            ds.run(message=message)\n        \n        #test_splitter_type must be split_by_chunk or split_by_title\n        ds=DocSplitter(splitter_type='test')\n        with self.assertRaises(ValueError):\n            ds.run(message=message)\n        \n    def test_doc_splitter_doc_splitter_ChunkSplitter(self):\n        # test if not isinstance(paser_res, ParseResult)\n        cs=ChunkSplitter()\n        message=Message()\n        with self.assertRaises(ValueError):\n            cs.run(message=message)\n    \n    def test_doc_splitter_doc_splitter_TitleSplitter_run(self):\n        # test if not isinstance(paser_res, ParseResult)\n        ts=TitleSplitter()\n        message=Message()\n        with self.assertRaises(ValueError):\n            ts.run(input_message=message)\n            \n    def test_doc_splitter_doc_splitter_TitleSplitter(self):\n        pos = Position(\n            pageno=1,\n            box=[10, 20, 30, 40]\n        )\n        node=ParaNode(\n            node_id=1,\n            text='test',\n            para_type= 'test',\n            parent=None,\n            children=[] ,\n            position=[pos],\n            table =None \n        )\n        # test if node.para_type == \"head_tail\" and test segment.content\n        node_head_tail=copy.deepcopy(node)\n        node_head_tail.para_type='head_tail'\n        message=Message()\n        pr=ParseResult(\n            para_node_tree=[node,node,node_head_tail]\n        )\n        message.content=pr\n        ts=TitleSplitter()\n        ts.run(input_message=message)\n        \n    def test_doc_format_converter_component_tool_eval(self):\n        dfc=DocFormatConverter()\n        result=dfc.tool_eval(streaming=False,origin_query='origin_query',page_num='str page')\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n        result=dfc.tool_eval(streaming=False,origin_query='origin_query',page_num=1)\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n        result=dfc.tool_eval(streaming=False,origin_query='origin_query',page_num=1,file_name='test')\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)    \n\n            \n        \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_core_components_embedding.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\n\nfrom appbuilder.core.components.embeddings.component import Embedding\nfrom appbuilder.core.components.embeddings.base import EmbeddingBaseComponent\nfrom appbuilder.core._exception import ModelNotSupportedException,AppBuilderServerException\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCoreComponentsEmbedding(unittest.TestCase):\n            \n    def test_embeddings_base(self):\n        ebc=EmbeddingBaseComponent()\n        message=[1,2,3]\n        ebc.abatch(texts=message)\n        \n    def test_embeddings_component_init(self):\n        # test_embeddings_component_init\n        with self.assertRaises(ModelNotSupportedException):\n            emb=Embedding()\n            emb.accepted_models.append('test')\n            emb.__init__('test')\n            \n    \n    def test_embeddings_component(self):\n        #test_embeddings_component_check_response_json\n        emb=Embedding()\n        data={\n            'error_code':'error_code',\n            'error_msg': 'error_msg'\n        }\n        with self.assertRaises(AppBuilderServerException):\n            emb._check_response_json(data=data)\n                    \n        # test_embeddings_component_batchify\n        texts=['test','test']\n        with self.assertRaises(ValueError):\n            emb._batchify(texts=texts,batch_size=17)\n            \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_core_components_table.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\n\nfrom appbuilder.core.components.table_ocr.component import TableOCR\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.extract_table.component import ExtractTableFromDoc\nfrom appbuilder.core.message import Message\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCoreCmpsTable(unittest.TestCase):\n    def test_table_ocr_component_get_table_markdown(self):\n        # test_get_table_markdown\n        to=TableOCR()\n        table={\n            \"body\":[\n                {'row_end': 1, 'col_end': 2,'row_start': 0, 'col_start': 0,'words':'words'},\n            ]\n        }\n        tables=[table]\n        md=to.get_table_markdown(tables)\n            \n    def test_table_ocr_component_tool_eval(self):\n        # test_tool_eval 未测试完全\n        to=TableOCR()\n        url='https://www.baidu.com/'\n        res=to.tool_eval(name=\"test_name\", streaming=True, file_names=[\"test\"],file_urls={'test':url})\n        with self.assertRaises(AppBuilderServerException):\n            next(res)\n        res=to.tool_eval(name=\"test_name\", streaming=True, files=[\"test\"],file_urls={'test':url})\n        with self.assertRaises(AppBuilderServerException):\n            next(res)\n            \n    def test_extract_table_component_ExtractTableFromDoc(self):\n        # test_input_check\n        etf=ExtractTableFromDoc()\n        message=Message()\n        with self.assertRaises(ValueError):\n            etf._input_check(message=message,table_max_size=29,doc_node_num_before_table=5)\n        with self.assertRaises(ValueError):\n            etf._input_check(message=message,table_max_size=31,doc_node_num_before_table=11)\n        with self.assertRaises(ValueError):\n            etf._input_check(message=message,table_max_size=31,doc_node_num_before_table=5)\n\n        #test_post_process\n        resp={\n            'result':{\n                'mdtables':[[\n                    {'para': 'test'},\n                    {'para':'描述一表：\\n|数据A|数据B表|数据A|数据B表|数据A|数据B表'}\n                ]]\n            }\n        }\n        etf.table_max_size=10\n        etf._post_process(resp=resp)\n        \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_core_components_tts.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nfrom io import BytesIO\n\nfrom appbuilder.core.components.tts.model import TTSRequest\nfrom appbuilder.core.components.tts.component import TTS, _iterate_chunk\nfrom appbuilder.core._exception import AppBuilderServerException\n\n# 模拟response对象        \nclass MockResponse:\n    def __init__(self, data):\n        # 将字符串数据转换为字节流\n        self.data = BytesIO(data.encode('utf-8'))\n\n    def close(self):\n        # 模拟关闭响应\n        pass\n\n    def iter_lines(self):\n        # 逐行返回数据\n        return self.data.readlines()\n    \n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCoreComponentsTTS(unittest.TestCase):\n    def test_tts_component_iterate_chunk_success(self):\n        data = 'data: SGVsbG8sIFdvcmxkIQ=='  # base64编码的\"Hello, World!\"\n        response = MockResponse(data)\n        result = list(_iterate_chunk('test_request', response))\n        self.assertEqual(result, [b'Hello, World!'])\n\n    def test_tts_component_iterate_chunk_exception(self):\n        # 模拟一个会导致异常的response\n        def raise_exception():\n            raise ValueError(\"Test Exception\")\n        response = MockResponse('')\n        response.iter_lines = raise_exception\n        with self.assertRaises(AppBuilderServerException):\n            list(_iterate_chunk('test_request', response))\n    \n    def test_tts_model(self):\n        tr = TTSRequest()\n        # 定义测试参数和对应的期望结果\n        test_cases = [\n            ({'tex': ''}, ValueError, tr.validate_baidu_tts),\n            ({'tex': 'test', 'spd': 16}, ValueError, tr.validate_baidu_tts),\n            ({'tex': 'test', 'spd': 15, 'vol': 16}, ValueError, tr.validate_baidu_tts),\n            ({'tex': 'test', 'spd': 15, 'vol': 15, 'per': 2}, ValueError, tr.validate_baidu_tts),\n            ({'tex': 'test', 'spd': 15, 'vol': 15, 'per': 1, 'aue': 0}, None, tr.validate_baidu_tts),\n            ({'tex': 'test', 'spd': 15, 'vol': 15, 'per': 1, 'aue': 2}, ValueError, tr.validate_baidu_tts),\n            ({'tex': 'test', 'spd': 15, 'vol': 15, 'per': 1, 'aue': 0}, None, tr.validate_paddle_speech_tts),\n            ({'tex': 'test', 'spd': 15, 'vol': 15, 'per': 1, 'aue': 1}, ValueError, tr.validate_paddle_speech_tts)\n        ]\n\n        for attrs, expected_exception, method in test_cases:\n            # 设置属性\n            for attr, value in attrs.items():\n                setattr(tr, attr, value)\n            # 验证期望结果\n            if expected_exception:\n                with self.assertRaises(expected_exception):\n                    method()\n            else:\n                method()\n                \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_core_console_base.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport json\n\nfrom appbuilder.core.console.base import ConsoleLLMMessage,ConsoleCompletionResponse\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.message import Message\n\n# 创建一个response类,模拟requests.Response\nclass Response:\n    def __init__(self, status_code, headers, text):\n        self.status_code = status_code\n        self.headers = headers\n        self.text = text\n        \n    def json(self):\n            return json.loads(self.text)\n       \n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCoreConsoleBase(unittest.TestCase):\n    def test_ConsoleLLMMessage_init(self):\n        # 测试stream=True\n        cr=ConsoleLLMMessage()\n        self.assertIsInstance(str(cr), str)\n        \n    def test_ConsoleCompletionResponse_init(self):\n        # 测试初始化,同时测试response.status_code != 200 and \n        response=Response(\n            status_code=201,\n            headers={},\n            text=json.dumps({\"message\": \"test\"})\n        )\n        with self.assertRaises(AppBuilderServerException):\n            ConsoleCompletionResponse(response)\n            \n        # 测试if \"code\" in data and \"message\" in data and \"requestId\" in data\n        response=Response(\n            status_code=200,\n            headers={},\n            text=json.dumps({\n                \"code\": \"test\",\n                \"requestId\":\"test\",\n                \"message\":\"test\"\n                })\n        )\n        with self.assertRaises(AppBuilderServerException):\n            ConsoleCompletionResponse(response)\n            \n        # 测试if \"code\" in data and \"message\" in data and \"status\" in data\n        response=Response(\n            status_code=200,\n            headers={},\n            text=json.dumps({\n                \"code\": \"test\",\n                \"message\":\"test\",\n                \"status\":\"test\"\n                })\n        )\n        with self.assertRaises(AppBuilderServerException):\n            ConsoleCompletionResponse(response)\n        \n        # if \"code\" in data and data.get(\"code\") != 0\n        response=Response(\n            status_code=200,\n            headers={},\n            text=json.dumps({\n                \"code\": 1,\n                \"message\": \"test\"\n                })\n        )\n        with self.assertRaises(AppBuilderServerException):\n            ConsoleCompletionResponse(response)\n            \n        # 测试init其余部分\n        content = [\n            {\n                \"content_type\": \"references\",\n                \"outputs\": {\n                    \"references\": [\n                        {\"from\": \"key\"} \n                        # 确认这是一个正确的字典\n                    ]\n                }\n            }\n        ]\n\n        # 序列化 content 列表为 JSON 字符串\n        content_json = json.dumps(content)\n\n        # 使用序列化后的 JSON 字符串作为响应文本\n        response = Response(\n            status_code=200,\n            headers={},\n            text=json.dumps({\n                \"code\": 0,\n                \"result\": {\n                    \"answer\": \"test\",\n                    \"conversation_id\": \"test\",\n                    \"content\": content  # 这里直接使用 content 变量\n                }\n            })\n        )\n        ccr=ConsoleCompletionResponse(response) \n        \n        # test_ConsoleCompletionResponse_message_iterable_wrapper(原代码可能冗余，迭代器未被调用)\n        message = Message()\n        def message_content():\n            resps=[\n                {'result': {'answer': 'test', 'conversation_id': 'test', 'content': content}},\n                {'result': {'answer': 'test', 'conversation_id': 'test', 'content': content}}\n            ]\n            for resp in resps:\n                yield resp\n        message.content = message_content()\n        result = ccr.message_iterable_wrapper(message)\n  \n        #test_ConsoleCompletionResponse_to_message\n        message=ccr.to_message()\n        \n            \n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_core_session.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport appbuilder\nimport asyncio\nimport aiohttp\nfrom unittest.mock import patch, MagicMock\nfrom appbuilder.core._session import AsyncInnerSession\n\nclass TestCoreSession(unittest.TestCase):\n    @patch(\"aiohttp.ClientSession.put\")\n    def test_async_session_get(self, mock_put):\n        async def demo():\n            return {\"status\": 200}\n        \n        async def async_magic():\n            pass\n\n        async def get_demo():\n            mock_put.return_value.__aenter__.return_value.json = await demo()\n            MagicMock.__await__ = lambda x: async_magic().__await__()   \n            session = AsyncInnerSession()\n            await session.get(\"http://www.baidu.com\")\n            await session.put(\"https://example.com\")\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(get_demo())\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_core_user_session.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport os\nimport uuid\nimport sqlite3\n\nfrom appbuilder.core.user_session import UserSession\nfrom appbuilder.core.session_message import SessionMessage\nfrom appbuilder.core.context import init_context,_LOCAL_KEY,get_context,context_var\nfrom appbuilder.core.message import Message \n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCoreUserSession(unittest.TestCase):      \n    def test_usersession_init(self):\n        UserSession._instance = None \n        UserSession._initialized = False \n        with self.assertRaises(ValueError):\n            user_session=UserSession(user_session_config=1234)\n        UserSession._instance = None \n        UserSession._initialized = False  \n    \n    def test_get_context(self):\n        get_context() \n          \n    def test_not_startswith_LOCAL_KEY(self): \n        user_session = UserSession()\n        init_context(\n            session_id=str(uuid.uuid4()),\n            request_id=str(uuid.uuid4())\n        )\n        key = \"test_key\"\n        message_dict = {key: Message(content={\"key\": \"value\"})}\n        # if key not in ctx.session_vars_dict\n        user_session.append(message_dict)\n        history = user_session.get_history(key)\n        self.assertEqual(len(history), 0)\n        # if not isinstance(message, Message)\n        with self.assertRaises(ValueError):\n            user_session.append({key: \"test\"})\n        # 测试if key in ctx.session_vars_dict\n        with self.assertRaises(KeyError):\n            user_session.append(message_dict)       \n        # 测试_post_append(self)的try\n        user_session._post_append()\n\n    def test_startswith_LOCAL_KEY(self):\n        user_session = UserSession()\n        init_context(\n            session_id=_LOCAL_KEY+str(uuid.uuid4()),\n            request_id=_LOCAL_KEY+str(uuid.uuid4())               \n        )\n        key = \"test_key\"\n        message_dict = {key: Message(content={\"key\": \"value\"})}\n        # if key not in ctx.session_vars_dict\n        user_session.append(message_dict)\n        history = user_session.get_history(\"test\")\n        self.assertEqual(len(history), 0) \n        history = user_session.get_history(key)\n        self.assertEqual(len(history), 1)\n        # if not isinstance(message, Message)\n        with self.assertRaises(ValueError):\n            user_session.append({key: \"test\"})\n        # 测试_post_append(self)的异常 \n        with self.assertRaises(Exception):\n            user_session._post_append()  \n\n        # 验证user_session.db文件是否创建,并验证文件内容\n        user_session_path = 'user_session.db' \n        conn = sqlite3.connect(user_session_path)  \n        cursor = conn.cursor()  \n\n        # 执行一条 SQL 语句，列出所有表  \n        cursor.execute(\"SELECT name FROM sqlite_master WHERE type='table';\")  \n        sql = cursor.fetchall()\n        print('sql:{}'.format(sql))  \n        assert sql[0][0] == 'appbuilder_session_messages'  \n        # 执行一条 SQL 语句，列出表所有列  \n        cursor.execute(\"PRAGMA table_info(appbuilder_session_messages);\")  \n        \n        columns_info = cursor.fetchall()  \n\n        column_names = [info[1] for info in columns_info]  # info[1]是列名的位置  \n        for column_name in column_names:  \n            print(column_name)\n        assert 'id' in column_names   \n        \n          \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_core_utils.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport os\nimport base64\n\nimport appbuilder.core.utils as ut\nfrom appbuilder.utils.sse_util import SSEClient,Event\n\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCoreUtils(unittest.TestCase):\n    def test_utils_get_user_agent(self):\n        user_agent=ut.utils_get_user_agent()\n    \n    def test_get_model_list(self):\n        from appbuilder.core._exception import TypeNotSupportedException \n        with self.assertRaises(TypeNotSupportedException):\n            model_list=ut.get_model_list(api_type_filter=[\"unknown\"])\n\n    def test_convert_cloudhub_url(self):\n        try:    \n            from appbuilder.core._client import HTTPClient\n        except:\n            pass\n        with self.assertRaises(ValueError):\n            url=ut.convert_cloudhub_url(client=HTTPClient,qianfan_url=\"unknown\")\n\n    def test_is_url(self):\n        is_url=ut.is_url(\"unknown\")\n\n    # def test_utils_sse_uti_events(self):\n    #     binary_data = os.urandom(100)  # 生成100字节的随机数据\n    #     encoded_data = base64.b64encode(binary_data).decode('utf-8')\n    #     sseClient=SSEClient(event_source=encoded_data)\n    #     sseClient.events()\n\n    # def test_utils_sse_uti_events(self):\n    #     binary_data = os.urandom(100)  # 生成100字节的随机数据\n    #     encoded_data = base64.b64encode(binary_data).decode('utf-8')\n    #     sseClient=SSEClient(event_source=encoded_data)\n    #     sseClient.close()\n\n    def test_utils_sse_uti_Events(self):\n        event_null_data=Event(id=\"id\")\n        s=event_null_data.debug_str\n        event=Event(id=\"id\",data='data',retry=\"retry\")\n        s=event.debug_str\n        event.raw=\"raw\"\n        s_change_raw=event.debug_str\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n        \n\n\n\n    \n    \n\n"
  },
  {
    "path": "python/tests/test_dialog_summary.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport appbuilder\n\nclass TestDialogSummary(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.DialogSummary(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        dialog_text = \"用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见\"\n        msg = appbuilder.Message(dialog_text)\n        summary = self.node(msg)\n        self.assertIsNotNone(summary)\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\"\"\"\n        dialog_text = \"用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见\"\n        msg = appbuilder.Message(dialog_text)\n        summary = self.node(msg, stream=False, temperature=0.5)\n        self.assertIsNotNone(summary)\n\n    def test_run_with_model_names(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\"\"\"\n\n        chats = appbuilder.get_model_list(api_type_filter=[\"chat\"])\n        self.assertTrue(\"DeepSeek-V3.1\" in chats)\n\n        appbuilder.DialogSummary(model=\"DeepSeek-V3.1\")\n\n        with self.assertRaises(Exception):\n            appbuilder.DialogSummary(model=\"\")\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'name': 'dialog_summary',\n            'query': '用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见'\n        }\n        result = self.node.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'dialog_summary'\n            }\n            result = self.node.tool_eval(streaming=True, **params)\n            next(result)\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_dish_recognize.py",
    "content": "import unittest\nimport os\nimport requests\n\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestDishRecognitionComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        在开始测试之前配置环境和实例化DishRecognition对象。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        self.dish_recognition = appbuilder.DishRecognition()\n\n    def test_run_with_valid_image(self):\n        \"\"\"\n        测试run函数在传入有效图像的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/dish_recognize_test.jpg?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T\" \\\n                    \"10%3A58%3A25Z%2F-1%2Fhost%2F7b8fc08b2be5adfaeaa4e3a0bb0d1a1281b10da\" \\\n                    \"3d6b798e116cce3e37feb3438\"\n        raw_image = requests.get(image_url).content\n        message = appbuilder.Message({\"raw_image\": raw_image})\n        output_message = self.dish_recognition(message=message)\n        self.assertIsInstance(output_message, appbuilder.Message)\n\n    def test_run_with_invalid_image(self):\n        \"\"\"\n        测试run函数在传入无效图像的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n\n        current_dir = os.path.dirname(__file__)\n        file_path = os.path.join(current_dir, 'test_translate.py')\n\n        with open(file_path, \"rb\") as f:\n            message = appbuilder.Message({\"raw_image\": f.read()})\n            with self.assertRaises(appbuilder.AppBuilderServerException):\n                self.dish_recognition(message=message)\n\n    def test_run_with_valid_url(self):\n        \"\"\"\n        测试run函数在传入有效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/dish_recognize_test.jpg?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T\" \\\n                    \"10%3A58%3A25Z%2F-1%2Fhost%2F7b8fc08b2be5adfaeaa4e3a0bb0d1a1281b10da\" \\\n                    \"3d6b798e116cce3e37feb3438\"\n        message = appbuilder.Message({\"url\": image_url})\n        output_message = self.dish_recognition(message=message)\n        self.assertIsInstance(output_message, appbuilder.Message)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message({\"url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.dish_recognition(message=message)\n\n    def test_run_without_image_and_url(self):\n        \"\"\"\n        测试run 函数在没有传入图像和URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        message = appbuilder.Message({})\n        with self.assertRaises(ValueError):\n            self.dish_recognition(message=message)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_doc_crop_enhance.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport requests\nimport appbuilder\nimport os\nclass TestDocCropEnhance(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \"\"\"\n        self.doc_crop_enhance = appbuilder.DocCropEnhance()\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/doc_enhance_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01\" \\\n                    \"-24T12%3A51%3A09Z%2F-1%2Fhost%2F2020d2433da471b40dafa933d557a1e\" \\\n                    \"be8abf28df78010f865e45dfcd6dc3951\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        # Doc enhance\n        output = self.doc_crop_enhance.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_url(self):\n        \"\"\"\n        使用图片 URL 进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/doc_enhance_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01\" \\\n                    \"-24T12%3A51%3A09Z%2F-1%2Fhost%2F2020d2433da471b40dafa933d557a1e\" \\\n                    \"be8abf28df78010f865e45dfcd6dc3951\"\n        # Create message with image URL\n        message = appbuilder.Message(content={\"url\": image_url})\n        # Doc enhance\n        output = self.doc_crop_enhance.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_timeout_and_retry(self):\n        \"\"\"\n        测试run方法，enhance_type、timeout、retry参数\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # 定义一个图片URL\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/doc_enhance_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01\" \\\n                    \"-24T12%3A51%3A09Z%2F-1%2Fhost%2F2020d2433da471b40dafa933d557a1e\" \\\n                    \"be8abf28df78010f865e45dfcd6dc3951\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        #  Doc enhance with timeout and retry parameters\n        output = self.doc_crop_enhance.run(message, enhance_type=3, timeout=5.0, retry=3)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_invalid_input(self):\n        \"\"\"\n        测试run函数在传入无效输入的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = appbuilder.Message(content={})\n\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.doc_crop_enhance.run(message)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message(content={\"url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.doc_crop_enhance.run(message)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_doc_format_converter.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\n\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestDocFormatConverter(unittest.TestCase):\n\n    @classmethod\n    def setUpClass(cls):\n        pass\n\n    def setUp(self):\n        pass\n\n    @classmethod\n    def test_doc_format_url(cls):\n        image_url = \"https://ai-cape-strategy-data.bj.bcebos.com/document-restructure/1EF33F9307451C9413D5D1160.jpg\"\n        doc_format_converter = appbuilder.DocFormatConverter()\n        resp = doc_format_converter(appbuilder.Message({\"file_path\": image_url}))\n\n        assert \"word_url\" in resp.content\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_doc_parser.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\n\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestDocParser(unittest.TestCase):\n\n    @classmethod\n    def setUpClass(cls):\n        \"\"\"\n        设置测试类所需的全局变量，包括当前文件所在目录路径和测试PDF文件路径。\n        \n        Args:\n            无\n        \n        Returns:\n            无\n        \n        \"\"\"\n        # 获取当前文件所在的目录路径\n        cls.current_dir = os.path.dirname(__file__)\n        cls.test_pdf_path = os.path.join(cls.current_dir, 'test.pdf')\n\n    def test_set_config(self):\n        self.doc_parser = appbuilder.DocParser()\n        config = appbuilder.ParserConfig()\n        config.convert_file_to_pdf = True\n        config.return_para_node_tree = False\n        config.convert_file_to_pdf = True\n        self.doc_parser.set_config(config)\n        self.assertEqual(self.doc_parser.config.return_para_node_tree, False)\n        self.assertEqual(self.doc_parser.config.convert_file_to_pdf, True)\n\n    def test_make_parse_result(self):\n        self.doc_parser = appbuilder.DocParser()\n        data = {'para_nodes': {}, 'catalog': {}, 'pdf_data': '', 'file_content': []}\n        result = self.doc_parser.make_parse_result(data)\n        self.assertEqual(result['para_node_tree'], {})\n        self.assertEqual(result['page_contents'], [])\n        self.assertEqual(result['pdf_data'], '')\n\n    def test_doc_parser_with_default_config(self):\n        # 测试文档解析器使用默认配置\n        msg = appbuilder.Message(self.test_pdf_path)\n        parser = appbuilder.DocParser()\n        result = parser(msg)\n        # 断言解析结果的 para_node_tree 不为空（根据实际情况调整断言）\n        self.assertIsNotNone(result.content.para_node_tree)\n\n    def test_doc_parser_with_modified_config(self):\n        # 测试文档解析器使用修改后的配置\n        msg = appbuilder.Message(self.test_pdf_path)\n        parser = appbuilder.DocParser()\n        # 修改配置参数\n        config = parser.config\n        config.return_para_node_tree = False\n        result = parser(msg)\n        self.assertIs(len(result.content.para_node_tree), 0)\n        config.convert_file_to_pdf = True\n        result = parser(msg)\n        # 断言解析结果的 para_node_tree 根据配置更改（根据实际情况调整断言）\n        self.assertIsNotNone(result.content.pdf_data)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        parser = appbuilder.DocParser()\n        params = {\n            'file_urls': {'test.pdf': 'http://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d'},\n            'file_names': ['test.pdf']\n        }\n        result = parser.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = parser.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        parser = appbuilder.DocParser()\n        with self.assertRaises(ValueError):\n            params = {\n                'file_names': ['test.pdf']\n            }\n            result = parser.tool_eval(streaming=True, **params)\n            next(result)\n        \n        with self.assertRaises(ValueError):\n            params = {\n                'file_urls': {'test.pdf': 'http://agi-dev-platform-bos.bj.bcebos.com/ut_appbuilder/test.pdf?authorization=bce-auth-v1/e464e6f951124fdbb2410c590ef9ed2f/2024-01-25T12%3A56%3A15Z/-1/host/b54178fea9be115eafa2a8589aeadfcfaeba20d726f434f871741d4a6cb0c70d'}\n            }\n            result = parser.tool_eval(streaming=True, **params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_doc_splitter.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nimport json\nimport unittest\nimport os\n\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestDocSplitter(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        pass\n\n    def test_splitter_with_chunk_size(self):\n        \"\"\"\n        测试文档分割: 指定最大chunk的大小\\结尾分隔符\\chunk块重叠的字数等参数,对文档进行分割\n        \"\"\"\n        # 1. 文档解析\n        current_dir = os.path.dirname(__file__)\n        file_name = \"test.pdf\"\n        test_pdf_path = os.path.join(current_dir, file_name)\n        msg = appbuilder.Message(test_pdf_path)\n        parser = appbuilder.DocParser()\n        xmind_output = parser(msg, return_raw=True)\n\n        # 2. 按照参数进行文档分段\n        doc_splitter = appbuilder.DocSplitter(splitter_type=\"split_by_chunk\",\n                                   separators=[\"。\", \"！\", \"？\", \".\", \"!\", \"?\", \"……\", \"|\\n\"],\n                                   max_segment_length=800,\n                                   overlap=200,\n                                   join_symbol=\"\")\n        doc_splitter_result = doc_splitter(xmind_output)\n\n        appbuilder.logger.info(\"paragraphs: {}\".format(\n            json.dumps(doc_splitter_result.content, ensure_ascii=False))\n        )\n\n        # 断言解析结果的不为空（根据实际情况调整断言）\n        self.assertIsNotNone(doc_splitter_result.content[\"paragraphs\"])\n\n    def test_splitter_with_title_level(self):\n        \"\"\"\n         测试文档分割: 按照标题级别进行分割\n        \"\"\"\n        config = dict(title=\"title_splitter.docx\")\n\n        # 1. 文档解析\n        current_dir = os.path.dirname(__file__)\n        test_pdf_path = os.path.join(current_dir, config[\"title\"])\n        msg = appbuilder.Message(test_pdf_path)\n        parser = appbuilder.DocParser()\n        xmind_output = parser(msg, return_raw=True)\n\n        # 2. 按照文档标题层级分段\n        doc_splitter = appbuilder.DocSplitter(splitter_type=\"split_by_title\")\n        result = doc_splitter(xmind_output)\n\n        appbuilder.logger.info(\"paragraphs: {}\".format(\n            json.dumps(result.content[\"paragraphs\"], ensure_ascii=False))\n        )\n\n        # 在这里进行断言，确保你的代码达到预期的效果\n        self.assertIsInstance(result, appbuilder.Message)\n        self.assertTrue(\"paragraphs\" in result.content)\n\n    def test_run_chunk_splitter_with_invalid_input(self):\n        # 模拟DocParser的输出结果\n        invalid_result = \"Invalid Result\"\n        message = appbuilder.Message(content=invalid_result)\n\n        doc_splitter = appbuilder.DocSplitter(splitter_type=\"title_level\")\n\n        # 运行 DocSplitter，确保它能处理无效输入\n        with self.assertRaises(ValueError):\n            doc_splitter.run(message)\n\n\n    def test_run_splitter_with_invalid_input(self):\n        config = dict(title=\"title_splitter.docx\")\n\n        # 1. 文档解析\n        current_dir = os.path.dirname(__file__)\n        test_pdf_path = os.path.join(current_dir, config[\"title\"])\n        msg = appbuilder.Message(test_pdf_path)\n        parser = appbuilder.DocParser()\n        xmind_output = parser(msg, return_raw=False)\n\n        # 2. 按照文档标题层级分段\n        doc_splitter = appbuilder.DocSplitter(splitter_type=\"split_by_title\")\n\n        # 在这里进行断言，确保你的代码达到预期的效果\n        with self.assertRaises(ValueError):\n            doc_splitter.run(xmind_output)\n\n\nif __name__ == '__main__':\n    # unittest.main()\n    suite = unittest.TestLoader().loadTestsFromTestCase(TestDocSplitter)\n    unittest.TextTestRunner(verbosity=2).run(suite)\n    unittest.main(verbosity=2)\n"
  },
  {
    "path": "python/tests/test_document_understanding.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\nimport os\nimport unittest\nimport appbuilder\n\nTEST_INPUT = {\n    \"query\": appbuilder.Message(\"这篇文档讲了什么\"),\n    \"instruction\": \"请根据文档内容回答问题\",\n    \"addition_instruction\": \"请你用一句话简短概括\",\n    \"file_path\": \"data/qa_demo.xlsx\",\n    \"stream\": True,\n    \"app_id\": \"87187054-78f0-4ef3-b710-fdcf2bfba7f2\"\n}\n\n\n@unittest.skip(reason=\"组件API实现问题，暂时跳过。修复后重新打开\")\nclass TestDocumentUnderstandingComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.du = appbuilder.DocumentUnderstanding()\n\n    def test_run_with_stream(self):\n        \"\"\"测试 run 方法流式输出\n        \"\"\"\n        query = TEST_INPUT.get(\"query\")\n        results = self.du.run(query,\n                             TEST_INPUT.get(\"file_path\"),\n                             instruction=TEST_INPUT.get(\"instruction\"),\n                             addition_instruction=TEST_INPUT.get(\"addition_instruction\"),\n                             stream=TEST_INPUT.get(\"stream\"),\n                             app_id=TEST_INPUT.get(\"app_id\"))\n\n        for result in results:\n            self.assertIsNotNone(result)\n            print(f'\\n[result]\\n{result}\\n')\n\n    def test_run_with_nostream(self):\n        \"\"\"测试 run 方法非流式输出\n        \"\"\"\n        query = TEST_INPUT.get(\"query\")\n        results = self.du.run(query,\n                             TEST_INPUT.get(\"file_path\"),\n                             instruction=TEST_INPUT.get(\"instruction\"),\n                             addition_instruction=TEST_INPUT.get(\"addition_instruction\"),\n                             stream=False,\n                             app_id=TEST_INPUT.get(\"app_id\"))\n\n        for result in results:\n            self.assertIsNotNone(result)\n            print(f'\\n[result]\\n{result}\\n')\n    def test_run_with_nofile(self):\n        \"\"\"测试 run 方法上传无效文件\n        \"\"\"\n        query = TEST_INPUT.get(\"query\")\n        # 使用 assertRaises 捕获预期异常\n        with self.assertRaises(FileNotFoundError):  # 假设无效文件抛出 FileNotFoundError 异常\n            results = self.du.run(query,\n                                  \"invalid_file.txt\",  # 使用无效文件\n                                  instruction=TEST_INPUT.get(\"instruction\"),\n                                  addition_instruction=TEST_INPUT.get(\"addition_instruction\"),\n                                  stream=False,\n                                  app_id=TEST_INPUT.get(\"app_id\"))\n\n            # 如果 run 方法抛出异常，以下代码将不会执行\n            for result in results:\n                self.assertIsNotNone(result)\n                print(f'\\n[result]\\n{result}\\n')\n\n    def test_tool_eval(self):\n        '''测试tool_eval方法'''\n        INPUT_JON_ = {\n            \"instruction\": TEST_INPUT.get(\"instruction\", \"\"),\n            \"addition_instruction\": TEST_INPUT.get(\"addition_instruction\", \"\"),\n            \"app_id\": TEST_INPUT.get(\"app_id\")\n        }\n        query = TEST_INPUT.get(\"query\", \"\")\n        results = self.du.tool_eval(query, file_path=TEST_INPUT.get(\"file_path\", \"\"), stream=False, **INPUT_JON_)\n        for result in results:\n            print(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_embedding.py",
    "content": "\"\"\"\ntest ernie bot embedding\n\"\"\"\nimport os\nimport sys\nsys.path.append('../..')\n\nimport unittest\nimport asyncio\n\nimport appbuilder\n\nimport numpy as np\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestEmbedding(unittest.TestCase):\n    def setUp(self):\n        self.embedding = appbuilder.Embedding()\n\n    def test_run(self):\n        embedding_1 = self.embedding(\"hello world!\")\n        embedding_2 = self.embedding(appbuilder.Message(\"hello world!\"))\n        np.testing.assert_array_almost_equal(embedding_1.content, embedding_1.content, decimal=4)\n\n    def test_batch(self):\n        embeddings_1 = self.embedding.batch(\n            [\"hello\", \"world\", \"!\"],\n        )\n        self.assertEqual(len(embeddings_1.content), 3)\n\n        embeddings_2 = self.embedding.batch(\n            appbuilder.Message([\"hello\", \"world\", \"!\"])\n        )\n        np.testing.assert_array_almost_equal(embeddings_1.content, embeddings_2.content, decimal=4)\n\n        embeddings_3 = self.embedding.batch(\n            appbuilder.Message([]),\n        )\n        self.assertListEqual(embeddings_3.content, [])\n\n    def test_arun(self):\n        embedding_1 = asyncio.run(self.embedding.arun(\"hello world!\"))\n        print(embedding_1.content)\n\n    def test_not_support_model(self):\n        try:\n            embedding = appbuilder.Embedding(model=\"foo\")\n        except Exception as e:\n            from appbuilder.core._exception import ModelNotSupportedException\n            assert isinstance(e, ModelNotSupportedException)\n            msg = str(e)\n            assert \"Model foo not supported\" in msg\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_extract_table.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"test\"\"\"\nimport json\nimport unittest\nimport os\n\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder import Message, ExtractTableFromDoc, DocParser\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestExtractTableFromDoc(unittest.TestCase):\n    \"\"\" pass\n    \"\"\"\n    @classmethod\n    def setUpClass(cls):\n        # 获取当前文件所在的目录路径\n        current_dir = os.path.dirname(__file__)\n        cls.test_pdf_path = os.path.join(current_dir, 'test.pdf')\n\n        # 1.解析文档，并返回原始解析结果\n        msg = Message(cls.test_pdf_path)\n        parser = DocParser()\n        cls.doc = parser(msg, return_raw=True).content.raw\n\n\n    def test_doc_table_to_markdown_with_default_config(self):\n        \"\"\" pass\n        \"\"\"\n        # 2.文档原始的解析结果，作为输入，解析表格。表格默认最大字符长度：800\n        parser = ExtractTableFromDoc()\n        result = parser(Message(self.doc), table_max_size=800)\n        logger.info(\"default config Tables: {}\".format(\n            json.dumps(result.content, ensure_ascii=False))\n        )\n\n        self.assertIsNotNone(result.content[0][0][\"para\"])\n    \n    def test_doc_table_to_markdown(self):\n        \"\"\" pass\n        \"\"\"\n        # 2.文档原始的解析结果，作为输入，解析表格。表格默认字符长度：800\n        table_max_size = 200\n        parser = ExtractTableFromDoc()\n        result = parser(Message(self.doc), table_max_size=table_max_size, doc_node_num_before_table=10)\n        logger.info(\"Tables: {}\".format(\n            json.dumps(result.content, ensure_ascii=False))\n        )\n        for table in result.content:\n            for sub in table:\n                self.assertLessEqual(len(sub[\"para\"]), table_max_size)\n\nif __name__ == '__main__':\n    unittest.main()\n    "
  },
  {
    "path": "python/tests/test_gbi_nl2sql.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nimport unittest\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.gbi.basic import NL2SqlResult, SessionRecord\nfrom appbuilder.core.components.gbi.basic import ColumnItem\nfrom appbuilder.core._exception import BaseRPCException\n\nSUPER_MARKET_SCHEMA = \"\"\"\n```\nCREATE TABLE `supper_market_info` (\n  `订单编号` varchar(32) DEFAULT NULL,\n  `订单日期` date DEFAULT NULL,\n  `邮寄方式` varchar(32) DEFAULT NULL,\n  `地区` varchar(32) DEFAULT NULL,\n  `省份` varchar(32) DEFAULT NULL,\n  `客户类型` varchar(32) DEFAULT NULL,\n  `客户名称` varchar(32) DEFAULT NULL,\n  `商品类别` varchar(32) DEFAULT NULL,\n  `制造商` varchar(32) DEFAULT NULL,\n  `商品名称` varchar(32) DEFAULT NULL,\n  `数量` int(11) DEFAULT NULL,\n  `销售额` int(11) DEFAULT NULL,\n  `利润` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\n```\n\"\"\"\n\nPRODUCT_SALES_INFO = \"\"\"\n现有 mysql 表 product_sales_info, \n该表的用途是: 产品收入表\n```\nCREATE TABLE `product_sales_info` (\n  `年` int,\n  `月` int,\n  `产品名称` varchar,\n  `收入` decimal,\n  `非交付成本` decimal,\n  `含交付毛利` decimal\n)\n```\n\"\"\"\n\nPROMPT_TEMPLATE = \"\"\"\n  MySql 表 Schema 如下:\n  {schema}\n  请根据用户当前问题，联系历史信息，仅编写1个sql，其中 sql 语句需要使用```sql ```这种 markdown 形式给出。\n  请参考列选信息：\n  {instrument}\n  请参考知识:\n  {kg}\n  当前时间：{date}\n  历史信息如下:{history_prompt}\n  当前问题：\"{query}\"\n  回答：\n\"\"\"\nclass TestGBINL2Sql(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量及必要数据。\n        \"\"\"\n        model_name = \"ERNIE-Bot 4.0\"\n        table_schemas = [SUPER_MARKET_SCHEMA]\n        self.nl2sql_node = appbuilder.NL2Sql(model_name=model_name,\n                                             table_schemas=table_schemas)\n\n\n    def test_run_with_column_constraint(self):\n        session = list()\n        query = \"列出商品类别是水果的的利润率\"\n        column_constraint = [ColumnItem(ori_value=\"水果\",\n                                        column_value=\"新鲜水果\",\n                                        column_name=\"商品类别\",\n                                        table_name=\"超市营收明细\",\n                                        is_like=False)]\n\n        msg = Message({\"query\": query, \"column_constraint\": column_constraint,\"session\": session})\n        \n        try:\n            result_message = self.nl2sql_node(msg)\n\n            self.assertIsNotNone(result_message)\n            self.assertTrue(result_message.content.sql != \"\")\n            self.assertTrue(result_message.content.llm_result != \"\")\n            self.assertIn(\"水果\", result_message.content.sql)\n            self.nl2sql_node.knowledge = dict()\n            self.nl2sql_node.prompt_template = \"\"\n        except BaseRPCException:\n            pass\n        except: \n            raise Exception('单测失败')\n        \n    def test_nl2sql_raise(self):\n        with self.assertRaises(ValueError):\n            node = appbuilder.NL2Sql(model_name='test',table_schemas=['test'])  \n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_gbi_select_table.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nimport unittest\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.gbi.basic import SessionRecord\nfrom appbuilder.core.components.gbi.basic import NL2SqlResult\nfrom appbuilder.core._exception import BaseRPCException\n\nSUPER_MARKET_SCHEMA = \"\"\"\n```\nCREATE TABLE `supper_market_info` (\n  `订单编号` varchar(32) DEFAULT NULL,\n  `订单日期` date DEFAULT NULL,\n  `邮寄方式` varchar(32) DEFAULT NULL,\n  `地区` varchar(32) DEFAULT NULL,\n  `省份` varchar(32) DEFAULT NULL,\n  `客户类型` varchar(32) DEFAULT NULL,\n  `客户名称` varchar(32) DEFAULT NULL,\n  `商品类别` varchar(32) DEFAULT NULL,\n  `制造商` varchar(32) DEFAULT NULL,\n  `商品名称` varchar(32) DEFAULT NULL,\n  `数量` int(11) DEFAULT NULL,\n  `销售额` int(11) DEFAULT NULL,\n  `利润` int(11) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\n```\n\"\"\"\n\nPRODUCT_SALES_INFO = \"\"\"\n现有 mysql 表 product_sales_info, \n该表的用途是: 产品收入表\n```\nCREATE TABLE `product_sales_info` (\n  `年` int,\n  `月` int,\n  `产品名称` varchar,\n  `收入` decimal,\n  `非交付成本` decimal,\n  `含交付毛利` decimal\n)\n```\n\"\"\"\n\nPROMPT_TEMPLATE = \"\"\"\n你是一个专业的业务人员，下面有{num}张表，具体表名如下:\n{table_desc}\n请根据问题帮我选择上述1-{num}种的其中相关表并返回，可以为多表，也可以为单表,\n返回多张表请用“,”隔开\n返回格式请参考如下示例：\n问题:有多少个审核通过的投运单？\n回答: ```DWD_MAT_OPERATION```\n请严格参考示例只不要返回无关内容，直接给出最终答案后面的内容，分析步骤不要输出\n问题:{query}\n回答:\n\"\"\"\nclass TestGBISelectTable(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量及必要数据。\n        \"\"\"\n        model_name = \"ERNIE-Bot 4.0\"\n\n        self.select_table_node = \\\n            appbuilder.SelectTable(model_name=model_name,\n                                   table_descriptions={\"supper_market_info\": \"超市营收明细表，包含超市各种信息等\",\n                                                       \"product_sales_info\": \"产品销售表\"})\n\n    def test_run_with_default_param(self):\n        \"\"\"测试 run 方法使用有效参数\"\"\"\n        query = \"列出超市中的所有数据\"\n        msg = Message({\"query\": query})\n        try:\n            result_message = self.select_table_node(message=msg)\n            # print(result_message.content)\n            self.assertIsNotNone(result_message)\n            self.assertEqual(len(result_message.content), 1)\n            self.assertEqual(result_message.content[0], \"supper_market_info\")\n        except BaseRPCException:\n            pass\n        except: \n            raise Exception('单测失败')\n            \n\n    def test_run_with_prompt_template(self):\n        \"\"\"测试 run 方法中 prompt template 模版\"\"\"\n        query = \"列出超市中的所有数据\"\n        msg = Message({\"query\": query})\n        self.select_table_node.prompt_template = PROMPT_TEMPLATE\n        try:\n            result_message = self.select_table_node(msg)\n\n            self.assertIsNotNone(result_message)\n            self.assertEqual(len(result_message.content), 1)\n            self.assertTrue(result_message.content[0].startswith(\"supper_market_info\"))\n            self.select_table_node.prompt_template = \"\"\n        except BaseRPCException:\n            pass\n        except: \n            raise Exception('单测失败')\n\n    def test_run_with_session(self):\n        \"\"\"测试 run 方法中 prompt template 模版\"\"\"\n\n        session = list()\n        session_record = SessionRecord(query=\"列出商品类别是水果的的利润率\",\n                                       answer=NL2SqlResult(\n                                           llm_result=\"根据问题分析得到 sql 如下: \\n \"\n                                                      \"```sql\\nSELECT * FROM `超市营收明细` \"\n                                                      \"WHERE `商品类别` = '水果'\\n```\",\n                                           sql=\"SELECT * FROM `超市营收明细` WHERE `商品类别` = '水果'\"))\n        session.append(session_record)\n\n        query = \"列出超市中的所有数据\"\n        msg = Message({\"query\": query, \"session\": session})\n        try:\n            result_message = self.select_table_node(msg)\n\n            self.assertIsNotNone(result_message)\n            self.assertEqual(len(result_message.content), 1)\n            self.assertEqual(result_message.content[0], \"supper_market_info\")\n        except BaseRPCException:\n            pass\n        except: \n            raise Exception('单测失败')\n        \n    def test_st_raise(self):\n        with self.assertRaises(ValueError):\n            appbuilder.SelectTable(model_name='test',table_descriptions={})\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_general_ocr.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport base64\nimport requests\nimport appbuilder\nfrom appbuilder.core._exception import InvalidRequestArgumentError\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestGeneralOCR(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            None\n\n        Returns:\n            None.\n        \"\"\"\n        self.general_ocr = appbuilder.GeneralOCR()\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        测试只使用有效图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\" \\\n                    \"857a27513734d765495f89ffa5f73\"\n        raw_image = requests.get(image_url).content\n        image_base64 = base64.b64encode(raw_image)\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"image_base64\": image_base64})\n\n        # Recognize landmark\n        output = self.general_ocr.run(message)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_no_image(self):\n        \"\"\"\n        测试run函数在传入无效图像的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = appbuilder.Message(content={})\n\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.general_ocr.run(message)\n\n    def test_run_with_timeout_and_retry(self):\n        \"\"\"\n         测试run函数在传入timeout、retry参数\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\" \\\n                    \"857a27513734d765495f89ffa5f73\"\n        raw_image = requests.get(image_url).content\n        image_base64 = base64.b64encode(raw_image)\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"image_base64\": image_base64})\n\n        # Recognize general_ocr with timeout and retry parameters\n        output = self.general_ocr.run(message, timeout=5.0, retry=3)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message({\"image_url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.general_ocr.run(message=message)\n\n    def test_run_without_image_and_url(self):\n        \"\"\"\n        测试run 函数在没有传入图像和URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        message = appbuilder.Message({})\n        with self.assertRaises(ValueError):\n            self.general_ocr.run(message=message)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\" \\\n                    \"857a27513734d765495f89ffa5f73\"\n        result = self.general_ocr.tool_eval(name=\"general_ocr\", streaming=True, img_url=image_url)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(InvalidRequestArgumentError):\n            result = self.general_ocr.tool_eval(name=\"general_ocr\", streaming=True)\n            next(result)\n\n    def test_new_tool_eval(self):\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\" \\\n                    \"857a27513734d765495f89ffa5f73\"\n        result = self.general_ocr.tool_eval(img_url=img_url, language_type='CHN_ENG', name=\"general_ocr\", streaming=True,)\n        for res in result:\n            print(res)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_get_app_list.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.utils.model_util import GetModelListRequest, Models, GetModelListResponse\nappbuilder.logger.setLoglevel(\"DEBUG\")\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestApps(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            None\n\n        Returns:\n            None.\n        \"\"\"\n        self.model = Models()\n\n    def test_get_app_list(self):\n        response = appbuilder.get_app_list()\n        self.assertIsInstance(response, list)\n\n    def test_get_app_list_v2(self):\n        response = appbuilder.get_app_list(limit=2)\n        self.assertIsInstance(response, list)\n        self.assertEqual(len(response),2)\n\n    def test_get_app_list_v3(self):\n        self.assertRaises(ValueError, appbuilder.get_app_list, limit=200)\n        self.assertRaises(ValueError, appbuilder.get_app_list, limit=0)\n\n    def test_get_app_list_v4(self):\n        self.assertRaises(ValueError, appbuilder.get_app_list, limit=\"a\")\n\n    def test_get_app_number(self):\n        app_list = appbuilder.get_all_apps()\n        self.assertIsInstance(app_list, list)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_get_model_list.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.utils.model_util import (\n    GetModelListRequest, \n    Models, \n    GetModelListResponse,\n    GetModelListRequestV2,\n    GetModelListResponseV2,\n    CommonModelV2\n)\n\n# @unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestModels(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            None\n\n        Returns:\n            None.\n        \"\"\"\n        self.model = Models()\n\n    def test_get_model_list(self):\n        \"\"\"\n        get_model_list方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        token = os.getenv(\"APPBUILDER_TOKEN\")\n        response = appbuilder.get_model_list(secret_key=token, api_type_filter=[\"text2image\"])\n        print(response)\n        self.assertIsNotNone(response)\n        self.assertIsInstance(response, list)\n\n    def test_list(self):\n        \"\"\"\n        list方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n\n        request = GetModelListRequest()\n        response = self.model.list(request)\n        self.assertIsNotNone(response)\n        self.assertIsInstance(response, GetModelListResponse)\n\n    def test_check_service_error(self):\n        \"\"\"\n        check_service_error方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        data = {'error_msg': 'Error', 'error_code': 1}\n        request_id = \"request_id\"\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.model._check_service_error(request_id, data)\n        data = {'error_msg': 'No Error', 'error_code': 0}\n        self.assertIsNone(self.model._check_service_error(request_id, data))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_hallucination_detection.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\nfrom appbuilder.core._exception import AppBuilderServerException\n\n\nTEST_QUERY = '澳门新麻蒲烤肉店每天开门吗？'\nTEST_CONTEXT = \\\n('澳门美食： 澳门新麻蒲韩国烤肉店\\n'\n'在澳门一年四季之中除了火锅，烤肉也相当受欢迎。提到韩烧，有一间令我印象最深刻，就是号称韩国第一的烤肉店－新麻蒲韩国烤肉店，光是韩国的分店便多'\n'达四百多间，海外分店更是遍布世界各地，2016年便落户澳门筷子基区，在原本已经食肆林立的地方一起百花齐放！店内的装修跟韩国分店还完度几乎没差，让'\n'食客彷如置身于韩国的感觉，还要大赞其抽风系统不俗，离开时身上都不会沾上烤肉味耶！\\n'\n'时间：周一至周日 下午5:00 - 上午3:00\\n'\n'电话：＋853 2823 4012\\n'\n'地址：澳门筷子基船澳街海擎天第三座地下O号铺96号\\n'\n'必食推介:\\n'\n'护心肉二人套餐\\n'\n'来新麻蒲必试的有两样东西，现在差不多每间烤肉店都有炉边烤蛋，但大家知道吗？原来新麻蒲就是炉边烤蛋的开创者，既然是始祖，这已经是个非吃不可的理'\n'由！还有一款必试的就是护心肉，即是猪的横隔膜与肝中间的部分，每头猪也只有200克这种肉，非常珍贵，其味道吃起来有种独特的肉香味，跟牛护心肉一样'\n'精彩！\\n'\n'秘制猪皮\\n'\n'很多怕胖的女生看到猪皮就怕怕，但其实猪皮含有大量胶原蛋白，营养价值很高呢！这里红通通的猪皮还经过韩国秘制酱汁处理过，会有一点点辣味。烤猪皮的'\n'时候也需特别注意火侯，这样吃起来才会有外脆内Q的口感！')\nTEST_ANSWER = '澳门新麻蒲烤肉店并不是每天开门，周日休息。'\n\n\nclass TestHallucinationDetectionComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n\n        self.model_name = 'DeepSeek-V3.1'\n        secret_key = os.getenv('SECRET_KEY', None)\n        self.hallucination_detection = appbuilder.HallucinationDetection(model=self.model_name, secret_key=secret_key)\n    \n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        msg = appbuilder.Message({'query': query, 'context': context, 'answer': answer})\n        answer = self.hallucination_detection(msg)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer.content}\\n')\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        msg = appbuilder.Message({'query': query, 'context': context, 'answer': answer})\n        answer = self.hallucination_detection(msg, stream=False, temperature=0.5)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer.content}\\n')\n\n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        answer = self.hallucination_detection.tool_eval(name='', query=query, context=context, answer=answer)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer}\\n')\n\n    def test_tool_eval_with_model_configs(self):\n        \"\"\"测试 tool_eval 方法使用不同temperature和top_p参数值。\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        model_configs = {'temperature': 0.5, 'top_p': 0.5}\n        answer = self.hallucination_detection.tool_eval(name='',\n                                                        stream=True,\n                                                        query=query,\n                                                        context=context,\n                                                        answer=answer,\n                                                        model_configs=model_configs)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n')\n        for ans in answer:\n            print(ans)\n\n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        answer = self.hallucination_detection.tool_eval(name='', query=query, context=context, answer=answer)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer}\\n')\n\n    def test_tool_eval_with_model_configs(self):\n        \"\"\"测试 tool_eval 方法使用不同temperature和top_p参数值。\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        model_configs = {'temperature': 0.5, 'top_p': 0.5}\n        answer = self.hallucination_detection.tool_eval(name='',\n                                                        stream=True,\n                                                        query=query,\n                                                        context=context,\n                                                        answer=answer,\n                                                        model_configs=model_configs)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n')\n        for ans in answer:\n            print(ans)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_handwrite_ocr.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import InvalidRequestArgumentError \n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestPlantRecognition(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        # 从BOS存储读取样例文件\n        self.image_url=(\"https://bj.bcebos.com/v1/appbuilder/test_handw\"\n                        \"rite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8\"\n                        \"m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2\"\n                        \"F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b\")\n        self.raw_image = requests.get(self.image_url).content\n        self.handwrite_ocr = appbuilder.HandwriteOCR()\n\n        # 输入参数为一张图片\n\n    def test_run_with_image_url(self):\n        \"\"\"\n        使用图片url进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"url\": self.image_url})\n        msg = self.handwrite_ocr.run(inp)\n        self.assertIsNotNone(msg.content)\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"raw_image\": self.raw_image})\n        msg = self.handwrite_ocr.run(inp)\n        self.assertIsNotNone(msg.content)\n        \n    def test_tool_eval(self):\n        result=self.handwrite_ocr.tool_eval(name='name',streaming=False,files=['test'])\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n        result=self.handwrite_ocr.tool_eval(\n            name='name',\n            streaming=True,\n            file_names=['test'],\n            file_urls={'test':self.image_url}\n            )\n        res=next(result)\n        self.assertEqual(res['visible_scope'],'llm')\n        res=next(result)\n        self.assertEqual(res['visible_scope'],'user')\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_image_understand.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport requests\nimport appbuilder\nimport time \n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import AppBuilderServerException\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestImageUnderstand(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        # 从BOS存储读取样例文件\n        self.image_url = \"https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6\"\n        self.raw_image = requests.get(self.image_url).content\n        self.image_understand = appbuilder.ImageUnderstand()\n\n        # 输入参数为一张图片\n\n    def test_run_with_image_url(self):\n        \"\"\"\n        使用图片url进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"url\": self.image_url, \"question\": \"图像内容是什么？\"})\n        msg = self.image_understand.run(inp)\n        self.assertIsNotNone(msg.content)\n        time.sleep(1)\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"raw_image\": self.raw_image, \"question\": \"图像内容是什么？\"})\n        msg = self.image_understand.run(inp)\n        self.assertIsNotNone(msg.content)\n        time.sleep(1)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                  \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                  \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                  \"62cf937c03f8c5260d51c6ae\"\n        img_name = \"test_img.jpg\"\n\n        file_urls = {img_name: img_url}\n        result = self.image_understand.tool_eval(name=\"image_understand\", streaming=True,\n                                                 img_name=img_name, file_urls=file_urls, origin_query=\"\")\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        time.sleep(1)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.image_understand.tool_eval(name=\"image_understand\", streaming=True,\n                                                     origin_query=\"\")\n            next(result)\n            time.sleep(1)\n\n    def test_run_language_en(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        inp = Message(content={\"raw_image\": self.raw_image, \"question\": \"图像内容是什么？\", \"language\": \"en\"})\n        self.image_understand.run(inp)\n        time.sleep(1) \n    \n    def test_run_raise(self):\n        # question is empty\n        with self.assertRaises(ValueError):\n            inp = Message(content={\"raw_image\": self.raw_image, \"question\": \"\"})\n            self.image_understand.run(inp)\n        \n        # question length bigger than 100\n        with self.assertRaises(ValueError):\n            question=\"test\"*26\n            inp = Message(content={\"raw_image\": self.raw_image, \"question\": question, \"language\": \"\"})\n            self.image_understand.run(inp)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_is_complex_query.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\n\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestIsComplexQueryComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.IsComplexQuery(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n\n    # def test_run_with_custom_params(self):\n    #     \"\"\"测试 run 方法使用自定义参数\"\"\"\n    #     query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n    #     msg = appbuilder.Message(query)\n    #     answer = self.node(msg, stream=True, temperature=0.5)\n    #     self.assertIsNotNone(answer)\n    #     # 检查 answer 是否符合预期\n\n    def test_run_with_invalid_params(self):\n        \"\"\"测试 run 方法使用无效参数\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(query)\n        with self.assertRaises((ValueError, TypeError)):\n            self.node(msg, invalid_param=\"invalid\")\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'name': 'is_complex_query',\n            'query': '吸塑包装盒在工业化生产和物流运输中分别有什么重要性？'\n        }\n        result = self.node.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'is_complex_query'\n            }\n            result = self.node.tool_eval(streaming=True, **params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_knowledge_base.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport appbuilder\nimport os\n\nfrom appbuilder.core._exception import BadRequestException\nfrom appbuilder.core.console.knowledge_base import data_class\n\n\nclass TestKnowLedge(unittest.TestCase):\n    def setUp(self):\n        self.whether_create_knowledge_base = False\n\n    def test_doc_knowledage(self):\n        dataset_id = os.getenv(\"DATASET_ID\", \"UNKNOWN\")\n        appbuilder.logger.setLoglevel('DEBUG')\n        knowledge = appbuilder.KnowledgeBase(knowledge_id=dataset_id)\n\n        upload_res = knowledge.upload_file(\n            \"./data/qa_appbuilder_client_demo.pdf\")\n        add_res = knowledge.add_document(\n            content_type=\"raw_text\",\n            file_ids=[upload_res.id],\n            custom_process_rule=appbuilder.CustomProcessRule(\n                separators=[\"?\"], target_length=400, overlap_rate=0.2\n            ),\n        )\n        list_res = knowledge.get_documents_list()\n        delete_res = knowledge.delete_document(\n            document_id=add_res.document_ids[0])\n        all_doc = knowledge.get_all_documents()\n        self.assertIsInstance(all_doc, list)\n\n    def test_get_documents_number_raise(self):\n        knowledge = appbuilder.KnowledgeBase()\n        with self.assertRaises(ValueError):\n            knowledge.get_all_documents()\n\n    def test_xlsx_knowledage(self):\n        dataset_id = os.getenv(\"DATASET_ID\", \"UNKNOWN\")\n        knowledge = appbuilder.KnowledgeBase(knowledge_id=dataset_id)\n\n        upload_res = knowledge.upload_file(\"./data/qa_demo.xlsx\")\n        add_res = knowledge.add_document(\n            content_type=\"qa\", file_ids=[upload_res.id])\n        list_res = knowledge.get_documents_list()\n        delete_res = knowledge.delete_document(\n            document_id=add_res.document_ids[0])\n\n    def test_create_knowledge_base(self):\n        knowledge = appbuilder.KnowledgeBase()\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n        try:\n            resp = knowledge.create_knowledge_base(\n                name=\"test\",\n                description=\"test\",\n                type=\"public\",\n                pathPrefix=\"/全部群组\",\n            )\n            knowledge_base_id = resp.id\n            knowledge.get_knowledge_base_detail(knowledge_base_id)\n            knowledge.get_knowledge_base_list(knowledge_base_id, maxKeys=10)\n            self.whether_create_knowledge_base = True\n        except BadRequestException as e:\n            print(\"create_knowledge_base函数运行失败{},将调用本地DATASET_ID\".format(e))\n            knowledge_base_id = os.getenv('DATASET_ID', 'UNKNOWN')\n\n        create_documents_response = knowledge.create_documents(\n            id=knowledge_base_id,\n            contentFormat=\"rawText\",\n            source=appbuilder.DocumentSource(\n                type=\"web\",\n                urls=[\"https://baijiahao.baidu.com/s?id=1802527379394162441\"],\n                urlDepth=1,\n                urlConfigs=[appbuilder.DocumentSourceUrlConfig(frequency=1)]\n            ),\n            processOption=appbuilder.DocumentProcessOption(\n                template=\"custom\",\n                parser=appbuilder.DocumentChoices(\n                    choices=[\"layoutAnalysis\", \"ocr\"]\n                ),\n                chunker=appbuilder.DocumentChunker(\n                    choices=[\"separator\"],\n                    separator=appbuilder.DocumentSeparator(\n                        separators=[\"。\"],\n                        targetLength=300,\n                        overlapRate=0.25,\n                    ),\n                    prependInfo=[\"title\", \"filename\"],\n                ),\n                knowledgeAugmentation=appbuilder.DocumentChoices(choices=[\n                                                                 \"faq\"]),\n            ),\n        )\n        self.assertIsInstance(create_documents_response.documentIds, list)\n\n        upload_documents_response = knowledge.upload_documents(\n            id=knowledge_base_id,\n            content_format=\"rawText\",\n            file_path=\"./data/qa_appbuilder_client_demo.pdf\",\n            processOption=appbuilder.DocumentProcessOption(\n                template=\"custom\",\n                parser=appbuilder.DocumentChoices(\n                    choices=[\"layoutAnalysis\", \"ocr\"]\n                ),\n                chunker=appbuilder.DocumentChunker(\n                    choices=[\"separator\"],\n                    separator=appbuilder.DocumentSeparator(\n                        separators=[\"。\"],\n                        targetLength=300,\n                        overlapRate=0.25,\n                    ),\n                    prependInfo=[\"title\", \"filename\"],\n                ),\n                knowledgeAugmentation=appbuilder.DocumentChoices(choices=[\n                                                                 \"faq\"]),\n            ),\n        )\n        self.assertIsInstance(upload_documents_response.documentId, str)\n\n        knowledge.get_documents_list(\n            knowledge_base_id=knowledge_base_id)\n        list_res = knowledge.describe_documents(knowledge_base_id=knowledge_base_id)\n        document_id = list_res.data[-1].id\n        knowledge.describe_chunks(document_id, knowledgebase_id=knowledge_base_id, keyword=\"test\")\n        resp = knowledge.create_chunk(document_id, content=\"test\", knowledgebase_id=knowledge_base_id)\n        chunk_id = resp.id\n        knowledge.modify_chunk(chunk_id, content=\"new test\", enable=True, knowledgebase_id=knowledge_base_id)\n        # 目前openapi有延迟，后续openapi完善后，删除注释\n        knowledge.describe_chunk(chunk_id, knowledgebase_id=knowledge_base_id)\n        knowledge.delete_chunk(chunk_id, knowledgebase_id=knowledge_base_id)\n\n        knowledge.modify_knowledge_base(\n            knowledge_base_id=knowledge_base_id,\n            name=\"test\",\n            pathPrefix=\"/全部群组\",\n        )\n\n        if self.whether_create_knowledge_base:\n            knowledge.delete_knowledge_base(knowledge_base_id)\n\n    def test_query_knowledge_base(self):\n        knowledge = appbuilder.KnowledgeBase()\n        appbuilder.logger.setLoglevel(\"DEBUG\")\n        client = appbuilder.KnowledgeBase()\n        res = client.query_knowledge_base(\n            query=\"民法典第三条\",\n            type=\"fulltext\",\n            knowledgebase_ids=[\"70c6375a-1595-41f2-9a3b-e81bc9060b7f\"],\n            top=5,\n            skip=0,\n            metadata_filters=data_class.MetadataFilters(filters=[], condition=\"or\"),\n            pipeline_config=data_class.QueryPipelineConfig(\n                id=\"pipeline_001\",\n                pipeline=[\n                    {\n                        \"name\": \"step1\",\n                        \"type\": \"elastic_search\",\n                        \"threshold\": 0.1,\n                        \"top\": 400,\n                        \"pre_ranking\": {\n                            \"bm25_weight\": 0.25,\n                            \"vec_weight\": 0.75,\n                            \"bm25_b\": 0.75,\n                            \"bm25_k1\": 1.5,\n                            \"bm25_max_score\": 50,\n                        },\n                    },\n                    {\n                        \"name\": \"step2\",\n                        \"type\": \"ranking\",\n                        \"inputs\": [\"step1\"],\n                        \"model_name\": \"ranker-v1\",\n                        \"top\": 20,\n                    },\n                ],\n            ),\n        )\n        chunk_id = res.chunks[0].chunk_id\n        self.assertIsNotNone(chunk_id)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_landmark_recognize.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core.message import Message\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestLandmarkRecognition(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            None\n\n        Returns:\n            None.\n        \"\"\"\n        self.landmark_recognition =  appbuilder.LandmarkRecognition()\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/landmark_test.jpeg?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T10%3A59%3A56Z%2F-1%2Fhost%2Fc249a068c6f321b91\" \\\n                    \"da0d0fd629b26ded58dcac2b6a3674f32378f5eb8df1ed0\"\n        self.raw_image = requests.get(image_url).content\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        message = Message(content={\"raw_image\": self.raw_image})\n\n        # Recognize landmark\n        output = self.landmark_recognition.run(message)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_no_image(self):\n        \"\"\"\n        Testing run method with no image. This should raise a ValueError.\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = Message(content={})\n\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.landmark_recognition.run(message)\n\n    def test_run_with_timeout_and_retry(self):\n        \"\"\"\n        Testing run method with timeout and retry parameters.\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        message = Message(content={\"raw_image\": self.raw_image})\n\n        # Recognize landmark with timeout and retry parameters\n        output = self.landmark_recognition.run(message, timeout=5.0, retry=3)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_langchain_adapter_run.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\n\nclass HelloWorldComponent(Component):\n    manifests = [\n        {\n            \"name\": \"hello_world\",\n            \"description\": \"向使用这个工具的人打招呼\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"使用者的名字\"\n                    }\n                }\n            }\n        }\n    ]\n\n    def run(self, name: str, **kwargs):\n        return \"hello world from {}\".format(name)\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestLandmarkRecognition(unittest.TestCase):\n    def setUp(self):\n        self.component = HelloWorldComponent()\n\n    def test_to_langchain_tool(self):\n        tool = self.component.create_langchain_tool()\n        from langchain.tools import StructuredTool\n        self.assertIsInstance(tool, StructuredTool)\n\n    def test_langchain_tool_run(self):\n        tool = self.component.create_langchain_tool()\n        res = tool.run(\n            tool_input = {\n                \"name\": \"test\"\n            }\n        )\n        self.assertEqual(res, \"hello world from test\")\n\n    def test_langchin_tool_elements(self):\n        tool = self.component.create_langchain_tool()\n        name = tool.name\n        self.assertEqual(name, \"hello_world\")\n\n        desc = tool.description\n        self.assertEqual(desc, \"向使用这个工具的人打招呼\")\n\n        args = tool.args\n        self.assertEqual(args, {'name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': '使用者的名字', 'title': 'Name'}})\n\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_langchain_adapter_tool_eval.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\n\nclass HelloWorldComponent(Component):\n    manifests = [\n        {\n            \"name\": \"hello_world\",\n            \"description\": \"向使用这个工具的人打招呼\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"使用者的名字\"\n                    }\n                }\n            }\n        }\n    ]\n\n    def run(self, name: str, **kwargs):\n        return Message(content=\"hello world from {}\".format(name))\n    \n    def tool_eval(self, name: str, **kwargs):\n        print(\"name\", name)\n        res = self.run(name)\n        print(res)\n        yield {\n            \"type\": \"text\",\n            \"text\": res.content,\n            \"visible_scope\": \"user\"\n        }\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestLandmarkRecognition(unittest.TestCase):\n    def setUp(self):\n        self.component = HelloWorldComponent()\n\n    def test_to_langchain_tool(self):\n        tool = self.component.create_langchain_tool()\n        from langchain.tools import StructuredTool\n        self.assertIsInstance(tool, StructuredTool)\n\n    def test_langchain_tool_run(self):\n        tool = self.component.create_langchain_tool()\n        res = tool.run(\n            tool_input = {\n                \"name\": \"test\"\n            }\n        )\n        self.assertEqual(res, \"hello world from test\")\n\n    def test_langchin_tool_elements(self):\n        tool = self.component.create_langchain_tool()\n        name = tool.name\n        self.assertEqual(name, \"hello_world\")\n\n        desc = tool.description\n        self.assertEqual(desc, \"向使用这个工具的人打招呼\")\n\n        args = tool.args\n        self.assertEqual(args, {'name': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': '使用者的名字', 'title': 'Name'}})\n\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_langchain_error.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\n\nclass HelloWorldComponentwithoutMainfest(Component):\n    def run(self, name: str, **kwargs):\n        return Message(content=\"hello world from {}\".format(name))\n    \nclass HelloWorldComponentwithMultiTools(Component):\n    manifests = [\n        {\n            \"name\": \"hello_world\",\n            \"description\": \"向使用这个工具的人打招呼\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"name\": {\n                        \"type\": \"string\",\n                        \"description\": \"使用者的名字\"\n                    }\n                }\n            }\n        },\n        {\n            \"name\": \"hello_world_2\",\n            \"description\": \"向使用这个工具的人打招呼\",\n        },\n        {\n            \"name\": \"general_ocr\",\n            \"description\": \"提供更高精度的通用文字识别能力，能够识别图片中的文字，不支持html后缀文件的输入\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url,根据该url能够获取图片\"\n                    },\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名,用于生成图片url\"\n                    },\n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    }\n                ]\n            }\n        }\n\n    ]\n\n    def run(self, name: str, **kwargs):\n        return Message(content=\"hello world from {}\".format(name))\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestLandmarkRecognition(unittest.TestCase):\n    def test_without_mainfest(self):\n        component = HelloWorldComponentwithoutMainfest()\n        with self.assertRaises(ValueError):\n            tool = component.create_langchain_tool()\n\n    def test_with_multi_tools(self):\n        component = HelloWorldComponentwithMultiTools()\n        with self.assertRaises(ValueError):\n            tool = component.create_langchain_tool()\n\n    def test_with_multi_tools_v2(self):\n        component = HelloWorldComponentwithMultiTools()\n        tools = component.create_langchain_tool(tool_name=\"hello_world\")\n\n\n    def test_with_multi_tools_v3(self):\n        component = HelloWorldComponentwithMultiTools()\n        with self.assertRaises(ValueError):\n            tools = component.create_langchain_tool(tool_name=\"hello_world_3\")\n\n    def test_with_multi_tools_v4(self):\n        component = HelloWorldComponentwithMultiTools()\n        with self.assertRaises(RuntimeError):\n            tools = component.create_langchain_tool(tool_name=\"hello_world_2\")\n\n    def test_with_multi_tools_v5(self):\n        component = HelloWorldComponentwithMultiTools()\n        tools = component.create_langchain_tool(tool_name=\"general_ocr\")\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_llm_base.py",
    "content": "import unittest\nimport os\nimport appbuilder\n\n\nclass ErrorComponent(appbuilder.Playground):\n\n    def completion(\n        self,\n        version,\n        base_url,\n        request,\n        timeout: float = None,\n        retry: int = 0,\n        request_id: str = None,\n    ):\n        r\"\"\"Send a byte array of an audio file to obtain the result of speech recognition.\"\"\"\n\n        headers = self.http_client.auth_header(request_id)\n        headers[\"Content-Type\"] = \"application/json\"\n\n        completion_url = \"/\" + self.version + \"/api/llm/\" + self.name\n\n        stream = True if request.response_mode == \"streaming\" else False\n        url = self.http_client.service_url(completion_url, self.base_url)\n        request.params[\"model_config\"][\"model\"][\"name\"] = \"<sdk-unittest>\"\n        request.params[\"model_config\"][\"model\"][\"url\"] = \"<sdk-unittest>\"\n        response = self.http_client.session.post(url, json=request.params, headers=headers, timeout=timeout,\n                                                 stream=stream)\n        return self.gene_response(response, stream) \n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestLlmBase(unittest.TestCase):\n\n    def test_err_request(self):\n        \"\"\" 测试在消息有效时运行 \"\"\"\n        cmpt = ErrorComponent(prompt_template=\"{query}\", model=\"DeepSeek-V3.1\")\n        msg = appbuilder.Message({\n            \"query\": \"小明\",\n        })\n\n        answer = cmpt.run(message=msg, stream=True, temperature=1)\n        with self.assertRaises(Exception):\n            for x in answer.content:\n                pass\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_log_set_log_config.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport time\nimport logging\nimport unittest\n\n\nfrom appbuilder import SizeAndTimeRotatingFileHandler\nfrom appbuilder.utils.logger_util import LoggerWithLoggerId\n\nclass TestLogSetLogConfig(unittest.TestCase):\n    def test_set_log_config(self):\n        lwl=LoggerWithLoggerId(logger='test_logger',extra={'logid':'test_logid'},loglevel='INFO')\n        lwl.setLogConfig(\n            console_output = True,\n            loglevel='DEBUG',\n            file_name='test.log',\n            rotate_frequency='D',\n            rotate_interval=0, # 测试rotate_interval<1时，自动更新为1\n            max_file_size=None, # 测试not max_file_size or max_file_size <= 0时，自动更新为sys.maxsize\n            total_log_size=None, # 测试not total_log_size or total_log_size <= 0时，自动更新为sys.maxsize\n            max_log_files=None, # 测试not max_log_files or max_log_files <= 0时，自动更新为sys.maxsize\n        )\n\n    def test_set_log_config_log_path(self):\n        os.environ[\"APPBUILDER_LOGPATH\"] = \"/tmp\"\n        lwl=LoggerWithLoggerId(logger='test_logger',extra={'logid':'test_logid'},loglevel='INFO')\n        lwl.setLogConfig(\n            console_output = True,\n            loglevel='DEBUG',\n            log_path='/tmp',\n            file_name='test.log',\n            rotate_frequency='D',\n            rotate_interval=0, # 测试rotate_interval<1时，自动更新为1\n            max_file_size=None, # 测试not max_file_size or max_file_size <= 0时，自动更新为sys.maxsize\n            total_log_size=None, # 测试not total_log_size or total_log_size <= 0时，自动更新为sys.maxsize\n            max_log_files=None, # 测试not max_log_files or max_log_files <= 0时，自动更新为sys.maxsize\n        )\n\n    def test_set_log_config_raise_error(self):\n        lwl=LoggerWithLoggerId(logger='test_logger',extra={'logid':'test_logid'},loglevel='INFO')\n        with self.assertRaises(ValueError):    \n            lwl.setLogConfig(\n                console_output = True,\n                loglevel='DEBUG',\n                file_name='test.log',\n                rotate_frequency='ERROR-FREQUENCY',\n                rotate_interval=0, # 测试rotate_interval<1时，自动更新为1\n                max_file_size=None, # 测试not max_file_size or max_file_size <= 0时，自动更新为sys.maxsize\n                total_log_size=None, # 测试not total_log_size or total_log_size <= 0时，自动更新为sys.maxsize\n                max_log_files=None, # 测试not max_log_files or max_log_files <= 0时，自动更新为sys.maxsize\n            )\n\n        with self.assertRaises(ValueError):    \n            lwl.setLogConfig(\n                console_output = True,\n                loglevel='ERROR-LEVEL',\n                file_name='test.log',\n                rotate_frequency='D',\n                rotate_interval=0, # 测试rotate_interval<1时，自动更新为1\n                max_file_size=0, # 测试not max_file_size or max_file_size <= 0时，自动更新为sys.maxsize\n                total_log_size=None, # 测试not total_log_size or total_log_size <= 0时，自动更新为sys.maxsize\n                max_log_files=None, # 测试not max_log_files or max_log_files <= 0时，自动更新为sys.maxsize\n            )\n\n    def test_rolling_with_time(self):\n        time_msgs = ['S', 'M', 'H', 'D', 'MIDNIGHT']\n        for time_msg in time_msgs:\n            logger = logging.getLogger('CustomLogger')\n            logger.setLevel(logging.DEBUG)\n            handler = SizeAndTimeRotatingFileHandler(\n                file_name ='test.log', \n                rotate_frequency=time_msg, \n                rotate_interval=1, \n                max_file_size=1024*100*1024, \n                max_log_files=10, \n                total_log_size=1024*300*1024\n            )\n            formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')\n            handler.setFormatter(formatter)\n            logger.addHandler(handler)\n\n            for _ in range(2):\n                logger.info(\"This is a test log message.\")\n                time.sleep(0.1)\n\n    def test_rolling_with_size(self):\n        logger = logging.getLogger('CustomLogger')\n        logger.setLevel(logging.DEBUG)\n        handler = SizeAndTimeRotatingFileHandler(\n            file_name ='test.log', \n            rotate_frequency='S', \n            rotate_interval=10, \n            max_file_size=1*1024, \n            max_log_files=2, \n            total_log_size=1024*300*1024\n        )\n        formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')\n        handler.setFormatter(formatter)\n        logger.addHandler(handler)\n\n        for i in range(100):\n            logger.info(\"This is a test log message.\"*100)\n            time.sleep(0.001)\n\n    def test_rolling_to_total_max_size(self):\n        logger = logging.getLogger('CustomLogger')\n        logger.setLevel(logging.DEBUG)\n        handler = SizeAndTimeRotatingFileHandler(\n            file_name ='test.log', \n            rotate_frequency='S', \n            rotate_interval=100, \n            max_file_size=10*1024, \n            max_log_files=10000, \n            total_log_size=20*1024\n        )\n        formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')\n        handler.setFormatter(formatter)\n        logger.addHandler(handler)\n\n        for _ in range(100):\n            logger.info(\"This is a test log message.\"*100)\n            time.sleep(0.001)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_manifest.py",
    "content": "import unittest\nimport os\nfrom typing import Any, Dict, List, Optional\nimport appbuilder\nfrom appbuilder import Manifest\nfrom appbuilder import manifest, manifest_parameter\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestManifest(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        os.environ[\"APPBUILDER_TOKEN\"] = (\n            \"your api key\"\n        )\n        self.app_id = \"7cc4c21f-0e25-4a76-baf7-01a2b923a1a7\"\n\n    def test_google_style(self):\n        # Generated by vscode plugin\n        # https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring\n        def google_style(\n            name: str,\n            val: str = None,\n            val_obj: Optional[Any] = None,\n            val_list: List[str] = None,\n            data: Dict[str, int] = None,\n        ) -> str:\n            \"\"\"Google style docstring.\n\n            Args:\n                name (str): Name of object.\n                val (str, optional): Value of obj. Defaults to None.\n                val_obj (Optional[Any], optional): Real object reference. Defaults to None.\n                val_list (List[str], optional): List of items with object. Defaults to None.\n                data (Dict[str, int], optional): Data along with object. Defaults to None.\n\n            Returns:\n                str: Styled string.\n            \"\"\"\n            return \"\"\n\n        manifest_from_function = appbuilder.Manifest.from_function(google_style)\n\n        # 断言顶层的结构\n        assert manifest_from_function.type == \"function\", \"Type does not match 'function'\"\n        assert (\n            manifest_from_function.function[\"name\"] == \"google_style\"\n        ), \"Function name does not match 'google_style'\"\n        assert (\n            manifest_from_function.function[\"description\"]\n            == \"\"\"Google style docstring.\n\n            Args:\n                name (str): Name of object.\n                val (str, optional): Value of obj. Defaults to None.\n                val_obj (Optional[Any], optional): Real object reference. Defaults to None.\n                val_list (List[str], optional): List of items with object. Defaults to None.\n                data (Dict[str, int], optional): Data along with object. Defaults to None.\n\n            Returns:\n                str: Styled string.\n            \"\"\"\n        ), \"Description does not match\"\n\n        # 断言参数结构\n        parameters = manifest_from_function.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 断言各个参数的类型和描述\n        properties = parameters[\"properties\"]\n\n        # name 参数\n        assert \"name\" in properties, \"'name' parameter missing\"\n        # 添加类型检查时的调试信息\n        try:\n            assert (\n                properties[\"name\"][\"type\"] == \"str\"\n            ), f\"'name' type does not match 'str'. Actual type: {properties['name']['type']}\"\n        except AssertionError as e:\n            print(f\"Debug Info: Actual 'name' type is {properties['name']['type']}\")\n            raise e  # 重新抛出异常\n\n        # val 参数\n        assert \"val\" in properties, \"'val' parameter missing\"\n        assert properties[\"val\"][\"type\"] == \"str\", \"'val' type does not match 'str'\"\n\n        # val_obj 参数\n        assert \"val_obj\" in properties, \"'val_obj' parameter missing\"\n        assert (\n            properties[\"val_obj\"][\"type\"] == \"Optional[Any]\"\n        ), \"'val_obj' type does not match 'object'\"\n\n        # val_list 参数\n        assert \"val_list\" in properties, \"'val_list' parameter missing\"\n        assert (\n            properties[\"val_list\"][\"type\"] == \"List[str]\"\n        ), \"'val_list' type does not match 'array'\"\n\n        # data 参数\n        assert \"data\" in properties, \"'data' parameter missing\"\n        assert (\n            properties[\"data\"][\"type\"] == \"Dict[str, int]\"\n        ), \"'data' type does not match 'object'\"\n\n        # 断言必需参数\n        assert \"required\" in parameters, \"'required' field missing in parameters\"\n        assert parameters[\"required\"] == [\"name\"], \"'required' does not match ['name']\"\n\n    def test_google_style_bad_args_return_dict(self):\n        def func(\n            bad_param: str,\n            bad_generic_param: List[str],\n            bad_format: int,\n            val: str = None,\n        ) -> Dict[str, str]:\n            \"\"\"Google style docstring.\n\n            Args:\n                bad param (str): Bad parameter, name contains whitespace.\n                bad_generic_param (List<str>): Bad generic parameter, use <> instead of []\n                bad_format (int) Bad arg doc format, lost :.\n                val (str    ,      optional): Value of obj. Defaults to None.\n\n            Returns:\n                Dict[str, str]: Returns a dict.\n            \"\"\"\n            return \"\"\n\n        manifest_from_function = appbuilder.Manifest.from_function(func)\n        # 断言顶层的结构\n        assert manifest_from_function.type == \"function\", \"Type does not match 'function'\"\n        assert (\n            manifest_from_function.function[\"name\"] == \"func\"\n        ), \"Function name does not match 'func'\"\n        assert (\n            manifest_from_function.function[\"description\"]\n            == \"\"\"Google style docstring.\n\n            Args:\n                bad param (str): Bad parameter, name contains whitespace.\n                bad_generic_param (List<str>): Bad generic parameter, use <> instead of []\n                bad_format (int) Bad arg doc format, lost :.\n                val (str    ,      optional): Value of obj. Defaults to None.\n\n            Returns:\n                Dict[str, str]: Returns a dict.\n            \"\"\"\n        ), \"Description does not match\"\n\n        # 断言参数结构\n        parameters = manifest_from_function.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 断言各个参数的类型和描述\n        properties = parameters[\"properties\"]\n\n        # bad_param 参数\n        assert \"bad_param\" in properties, \"'bad_param' parameter missing\"\n        assert (\n            properties[\"bad_param\"][\"type\"] == \"str\"\n        ), \"'bad_param' type does not match 'str'\"\n\n        # bad_format 参数\n        assert \"bad_format\" in properties, \"'bad_format' parameter missing\"\n        assert (\n            properties[\"bad_format\"][\"type\"] == \"int\"\n        ), \"'bad_format' type does not match 'int'\"\n\n        # val 参数\n        assert \"val\" in properties, \"'val' parameter missing\"\n        assert properties[\"val\"][\"type\"] == \"str\", \"'val' type does not match 'str'\"\n\n        # 断言必需参数\n        assert \"required\" in parameters, \"'required' field missing in parameters\"\n        assert parameters[\"required\"] == [\n            \"bad_param\",\n            \"bad_generic_param\",\n            \"bad_format\",\n        ], \"'required' does not match expected required parameters\"\n\n        # 断言没有多余参数\n        assert len(properties) == 4, \"Unexpected number of parameters in properties\"\n\n    def test_google_style_no_return(self):\n        def func(\n            name: str,\n        ):\n            \"\"\"Google style docstring.\n\n            Args:\n                name (str): Name of object.\n\n            \"\"\"\n            return \"\"\n\n        manifest_from_function = appbuilder.Manifest.from_function(func)\n        # 断言顶层的结构\n        assert manifest_from_function.type == \"function\", \"Type does not match 'function'\"\n        assert (\n            manifest_from_function.function[\"name\"] == \"func\"\n        ), \"Function name does not match 'func'\"\n        assert (\n            manifest_from_function.function[\"description\"]\n            == \"\"\"Google style docstring.\n\n            Args:\n                name (str): Name of object.\n\n            \"\"\"\n        ), \"Description does not match\"\n\n        # 断言参数结构\n        parameters = manifest_from_function.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 断言参数类型和描述\n        properties = parameters[\"properties\"]\n\n        # name 参数\n        assert \"name\" in properties, \"'name' parameter missing\"\n        assert properties[\"name\"][\"type\"] == \"str\", \"'name' type does not match 'str'\"\n\n        # 断言必需参数\n        assert \"required\" in parameters, \"'required' field missing in parameters\"\n        assert parameters[\"required\"] == [\"name\"], \"'required' does not match ['name']\"\n\n        # 断言没有[\"parameters\"][1]的参数了\n        assert not (\n            \"parameters\" in manifest_from_function.function\n            and len(manifest_from_function.function[\"parameters\"]) == 1\n        )\n\n    def test_no_doc(self):\n        def func(\n            name: str,\n            /,\n            *args,\n            val: str = None,\n            val_obj: Optional[Any] = None,\n            data: Dict[str, int] = None,\n            **kwargs,\n        ) -> str:\n            return \"\"\n\n        # 断言这里会抛出缺少文档字符串的 ValueError 异常\n        try:\n            manifest_from_function = appbuilder.Manifest.from_function(func)\n        except ValueError as e:\n            assert (\n                str(e) == \"函数 func 缺少文档字符串\"\n            ), \"未抛出预期的 ValueError 或信息不匹配\"\n\n    def test_decorator_google_style_basic(self):\n        @manifest(description=\"Function with required parameter.\")\n        def func(\n            name: str,\n        ) -> str:\n            \"\"\"Function with required parameter.\n\n            Args:\n                name (str): Name of object.\n\n            Returns:\n                str: Styled string.\n            \"\"\"\n            return \"\"\n\n        # 获取装饰器生成的 Manifest\n        manifest_from_function = func.__ab_manifest__\n\n        # 断言顶层的结构\n        assert manifest_from_function.type == \"function\", \"Type does not match 'function'\"\n        assert (\n            manifest_from_function.function[\"name\"] == \"func\"\n        ), \"Function name does not match 'func'\"\n        assert (\n            manifest_from_function.function[\"description\"]\n            == \"Function with required parameter.\"\n        ), \"Description does not match\"\n\n        # 断言参数结构\n        parameters = manifest_from_function.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 断言各个参数的类型和描述\n        properties = parameters[\"properties\"]\n\n        # name 参数\n        assert \"name\" in properties, \"'name' parameter missing\"\n        assert properties[\"name\"][\"type\"] == \"str\", \"'name' type does not match 'str'\"\n        assert (\n            properties[\"name\"][\"description\"] == None\n        ), \"'name' description does not match\"\n\n        # 断言必需参数\n        assert \"required\" in parameters, \"'required' field missing in parameters\"\n        assert parameters[\"required\"] == [\"name\"], \"'required' does not match ['name']\"\n\n    def test_manifest_decorator(self):\n        @appbuilder.manifest(\n            description=\"获取指定中国城市的当前天气信息。仅支持中国城市的天气查询。参数 `location` 为中国城市名称，其他国家城市不支持天气查询。\"\n        )\n        @appbuilder.manifest_parameter(\n            name=\"location\", description=\"城市名，例如：北京。\"\n        )\n        @appbuilder.manifest_parameter(\n            name=\"unit\", description=\"温度单位，支持 'celsius' 或 'fahrenheit'\"\n        )\n        # 定义示例函数\n        def get_current_weather(location: str, unit) -> str:\n            return \"北京今天25度\"\n        manifest_from_function = appbuilder.Manifest.from_function(get_current_weather)\n        assert manifest_from_function.function.get(\"description\") is not None\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_manifest_decorator.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nimport os\nimport unittest\nfrom appbuilder import Manifest, manifest, manifest_parameter\nfrom appbuilder.core.manifest.manifest_decorator import _merge_dict, _update_list\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestManifestDecorator(unittest.TestCase):\n    def test_disable_docstring(self):\n        @manifest(description=\"anotated function\")\n        @manifest_parameter(name=\"param\", description=\"a parameter\", type=\"str\")\n        def func(param: str) -> str:\n            return param\n\n        manifest_from_function = func.__ab_manifest__\n\n        # 断言顶层的结构\n        assert manifest_from_function.type == \"function\", \"Type does not match 'function'\"\n        assert (\n            manifest_from_function.function[\"name\"] == \"func\"\n        ), \"Function name does not match 'func'\"\n        assert (\n            manifest_from_function.function[\"description\"] == \"anotated function\"\n        ), \"Description does not match\"\n\n        # 断言参数结构\n        parameters = manifest_from_function.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 断言具体参数\n        properties = parameters[\"properties\"]\n        assert \"param\" in properties, \"'param' parameter missing\"\n        assert properties[\"param\"][\"type\"] == \"str\", \"'param' type does not match 'str'\"\n        assert (\n            properties[\"param\"][\"description\"] == \"a parameter\"\n        ), \"'param' description does not match\"\n\n        # 断言必需参数\n        assert \"required\" in parameters, \"'required' field missing in parameters\"\n        assert parameters[\"required\"] == [\n            \"param\"\n        ], \"'required' does not match ['param']\"\n\n    def test_combine(self):\n        @manifest()\n        @manifest_parameter(name=\"param\")\n        def func(param: str = \"[]\") -> int:\n            \"\"\"An example function.\n\n            Args:\n                param (str): A list of numbers.\n\n            Returns:\n                int: The sum of parameter.\n            \"\"\"\n            return param\n\n        # 获取装饰器生成的 Manifest\n        manifest_from_function = func.__ab_manifest__\n\n        # 断言顶层结构\n        assert manifest_from_function.type == \"function\", \"Type does not match 'function'\"\n        assert (\n            manifest_from_function.function[\"name\"] == \"func\"\n        ), \"Function name does not match 'func'\"\n        assert (\n            manifest_from_function.function[\"description\"]\n            == \"\"\"An example function.\n\n            Args:\n                param (str): A list of numbers.\n\n            Returns:\n                int: The sum of parameter.\n            \"\"\"\n        ), \"Description does not match\"\n\n        # 断言参数结构\n        parameters = manifest_from_function.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 断言具体参数\n        properties = parameters[\"properties\"]\n        assert \"param\" in properties, \"'param' parameter missing\"\n        assert properties[\"param\"][\"type\"] == \"str\", \"'param' type does not match 'str'\"\n        assert \"description\" in properties[\"param\"], \"'param' description missing\"\n        assert (\n            properties[\"param\"][\"description\"] == None\n        ), \"'param' description does not match\"\n\n        # 断言必需参数\n        assert \"required\" in parameters, \"'required' field missing in parameters\"\n        assert (\n            \"param\" not in parameters[\"required\"]\n        ), \"'param' should not be required as it has a default value\"\n\n    def test_reversed_decorators(self):\n        @manifest_parameter(name=\"param\", description=\"DECORATOR A list of numbers.\")\n        @manifest()\n        def func(param: str = \"[]\") -> int:\n            \"\"\"An example function.\n\n            Args:\n                param (str): A list of numbers.\n\n            Returns:\n                int: The sum of parameter.\n            \"\"\"\n            return param\n\n        # 获取装饰器生成的 Manifest\n        manifest_from_function = func.__ab_manifest__\n\n        # 断言顶层结构\n        assert manifest_from_function.type == \"function\", \"Type does not match 'function'\"\n        assert (\n            manifest_from_function.function[\"name\"] == \"func\"\n        ), \"Function name does not match 'func'\"\n        assert (\n            manifest_from_function.function[\"description\"]\n            == \"\"\"An example function.\n\n            Args:\n                param (str): A list of numbers.\n\n            Returns:\n                int: The sum of parameter.\n            \"\"\"\n        ), \"Description does not match\"\n\n        # 断言参数结构\n        parameters = manifest_from_function.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 断言具体参数\n        properties = parameters[\"properties\"]\n        assert \"param\" in properties, \"'param' parameter missing\"\n        assert properties[\"param\"][\"type\"] == \"str\", \"'param' type does not match 'str'\"\n\n        # 断言必需参数\n        assert \"required\" in parameters, \"'required' field missing in parameters\"\n        assert (\n            \"param\" in parameters[\"required\"]\n        ), \"'param' should not be required as it has a default value\"\n\n    def test_only_function_decorator(self):\n        @manifest()\n        def func(param: str = \"[]\") -> int:\n            \" \"\n            return param\n\n        view = func.__ab_manifest__\n\n        # 获取装饰器生成的 Manifest\n        manifest_from_function = func.__ab_manifest__\n\n        # 断言顶层结构\n        assert manifest_from_function.type == \"function\", \"Type does not match 'function'\"\n        assert (\n            manifest_from_function.function[\"name\"] == \"func\"\n        ), \"Function name does not match 'func'\"\n        assert (\n            manifest_from_function.function[\"description\"] == \" \"\n        ), \"Description should be None when not explicitly provided\"\n\n        # 断言参数结构\n        parameters = manifest_from_function.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 断言具体参数\n        properties = parameters[\"properties\"]\n        assert \"param\" in properties, \"'param' parameter missing\"\n        assert properties[\"param\"][\"type\"] == \"str\", \"'param' type does not match 'str'\"\n\n        # 检查是否为必需参数\n        assert \"required\" in parameters, \"'required' field missing in parameters\"\n        assert (\n            \"param\" not in parameters[\"required\"]\n        ), \"'param' should not be required as it has a default value\"\n\n    def test_merge_dict(self):\n        self.assertEqual(_merge_dict({}, {}), {})\n        self.assertEqual(_merge_dict({}, {\"a\": 1}), {\"a\": 1})\n\n    def test_update_list(self):\n        def condition(item, new_item):\n            return item['id'] == new_item['id']\n\n        def replacer(item, new_item):\n            item.update(new_item)\n            return item\n\n        existing_item = {'id': 1, 'value': 'a'}\n        new_item = {'id': 1, 'value': 'b'}\n        list = [existing_item]\n        expected_result = [new_item]\n        self.assertEqual(_update_list(new_item, list, condition, replacer), expected_result)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_manifest_signature.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport os\nfrom typing import Any, Dict, List, Optional, Union\nfrom appbuilder import Manifest, manifest\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestManifestSignature(unittest.TestCase):\n    def test_is_normal(self):\n        @manifest()\n        def func():\n            return 1\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest)\n\n    def test_is_async(self):\n        @manifest(description=\"test\")\n        async def func():\n            import asyncio\n\n            await asyncio.sleep(0)\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest)\n\n    def test_is_stream(self):\n        @manifest()\n        def func():\n            for i in range(2):\n                yield i\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest)\n\n    def test_is_async_and_stream(self):\n        @manifest()\n        async def func():\n            import asyncio\n\n            for i in range(1):\n                await asyncio.sleep(0)\n                yield i\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest)\n\n    def test_decorator_google_style_function_description_no_args(self):\n        @manifest()\n        def func():\n            \"\"\"A function to test function description.\n\n            Args:\n                name (str): Name of object.\n\n            Returns:\n                str: Styled string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest)\n        assert view.function[\"name\"] == \"func\"\n        assert (\n            view.function[\"description\"]\n            == \"\"\"A function to test function description.\n\n            Args:\n                name (str): Name of object.\n\n            Returns:\n                str: Styled string.\n            \"\"\"\n        )\n\n        # Assert that parameters are an empty dictionary since there are no function arguments\n        assert view.function[\"parameters\"][\"properties\"] == {}\n        assert view.function[\"parameters\"][\"required\"] == []\n\n    def test_decorator_google_style_basic(self):\n        @manifest()\n        def func(\n            name: str,\n        ) -> str:\n            \"\"\"Function with required parameter.\n\n            Args:\n                name (str): Name of object.\n\n            Returns:\n                str: Styled string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest)\n\n        # 检查函数元信息\n        assert view.function[\"name\"] == \"func\", \"Function name does not match 'func'\"\n        assert (\n            view.function[\"description\"]\n            == \"\"\"Function with required parameter.\n\n            Args:\n                name (str): Name of object.\n\n            Returns:\n                str: Styled string.\n            \"\"\"\n        )\n\n        # 检查参数结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'name'\n        properties = parameters[\"properties\"]\n        assert \"name\" in properties, \"'name' parameter missing\"\n        name_property = properties[\"name\"]\n        assert name_property[\"type\"] == \"str\", \"'name' type does not match 'str'\"\n        assert (\n            name_property[\"description\"] is None\n        ), \"'name' description does not match None\"\n        assert name_property[\"required\"] is True, \"'name' required does not match True\"\n\n    def test_decorator_google_style_list(self):\n        @manifest()\n        def func(\n            val: List[str],\n        ) -> str:\n            \"\"\"Function with a List parameter.\n\n            Args:\n                val (List[str]): A list of strings.\n\n            Returns:\n                str: A result string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest)\n\n        # 检查参数的总体结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'val'\n        properties = parameters[\"properties\"]\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证 'val' 参数的各项属性\n        assert (\n            val_property[\"type\"] == \"List[str]\"\n        ), \"'val' type does not match 'List[str]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_list_of_dicts(self):\n        @manifest()\n        def func(\n            val: List[Dict[str, List[str]]],\n        ) -> str:\n            \"\"\"Function with a complex nested parameter.\n\n            Args:\n                val (List[Dict[str, List[str]]]): A list of dictionaries mapping strings to lists of strings.\n\n            Returns:\n                str: A result string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        # 检查参数的总体结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'val'\n        properties = parameters[\"properties\"]\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证 'val' 参数的各项属性\n        assert (\n            val_property[\"type\"] == \"List[Dict[str, List[str]]]\"\n        ), \"'val' type does not match 'List[Dict[str, List[str]]]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_dict(self):\n        @manifest()\n        def func(\n            val: Dict[str, Any],\n        ) -> str:\n            \"\"\"Function with a dictionary parameter.\n\n            Args:\n                val (Dict[str, Any]): A dictionary with string keys and any values.\n\n            Returns:\n                str: A result string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        # 检查参数的总体结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'val'\n        properties = parameters[\"properties\"]\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证 'val' 参数的各项属性\n        assert (\n            val_property[\"type\"] == \"Dict[str, Any]\"\n        ), \"'val' type does not match 'Dict[str, Any]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_dict_of_lists(self):\n        @manifest()\n        def func(\n            val: Dict[str, List[Dict[str, List[str]]]],\n        ) -> str:\n            \"\"\"Function with a complex nested parameter.\n\n            Args:\n                val (Dict[str, List[Dict[str, List[str]]]]): A dictionary where keys are strings and values are lists of dictionaries.\n\n            Returns:\n                str: A result string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        # 检查参数的总体结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'val'\n        properties = parameters[\"properties\"]\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证 'val' 参数的各项属性\n        assert (\n            val_property[\"type\"] == \"Dict[str, List[Dict[str, List[str]]]]\"\n        ), \"'val' type does not match 'Dict[str, List[Dict[str, List[str]]]]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_union_simple(self):\n        @manifest()\n        def func(\n            val: Union[str, int, Any],\n        ) -> str:\n            \"\"\"Function with a Union parameter.\n\n            Args:\n                val (Union[str, int, Any]): A parameter that can accept multiple types.\n\n            Returns:\n                str: A result string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        # 检查参数的总体结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'val'\n        properties = parameters[\"properties\"]\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证 'val' 参数的各项属性\n        assert (\n            val_property[\"type\"] == \"Union[str, int, Any]\"\n        ), \"'val' type does not match 'Union[str, int, Any]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_union(self):\n        @manifest()\n        def func(\n            val: Union[str, List[int]],\n        ) -> str:\n            \"\"\"Function with a Union parameter.\n\n            Args:\n                val (Union[str, List[int]]): A parameter that can accept a string or a list of integers.\n\n            Returns:\n                str: A result string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        # 检查参数的总体结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'val'\n        properties = parameters[\"properties\"]\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证 'val' 参数的各项属性\n        assert (\n            val_property[\"type\"] == \"Union[str, List[int]]\"\n        ), \"'val' type does not match 'Union[str, List[int]]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_union_nest1_dict(self):\n        @manifest()\n        def func(\n            val: Union[float, Dict[str, int]],\n        ) -> str:\n            \"\"\"Function with a nested Union parameter.\n\n            Args:\n                val (Union[float, Dict[str, int]]): A parameter that can accept a float or a dictionary with string keys and integer values.\n\n            Returns:\n                str: A result string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        # 检查参数的总体结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'val'\n        properties = parameters[\"properties\"]\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证 'val' 参数的各项属性\n        assert (\n            val_property[\"type\"] == \"Union[float, Dict[str, int]]\"\n        ), \"'val' type does not match 'Union[float, Dict[str, int]]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_union_combine(self):\n        @manifest()\n        def func(\n            val: Union[float, Union[str, int]],\n        ) -> str:\n            \"\"\"Function with a combined Union parameter.\n\n            Args:\n                val (Union[float, str, int]): A parameter that can accept a float, string, or integer.\n\n            Returns:\n                str: A result string.\n            \"\"\"\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        # 检查生成的 Manifest 对象\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        # 检查参数的总体结构\n        parameters = view.function[\"parameters\"]\n        assert parameters[\"type\"] == \"object\", \"Parameters type does not match 'object'\"\n        assert \"properties\" in parameters, \"Properties not found in parameters\"\n\n        # 检查具体参数 'val'\n        properties = parameters[\"properties\"]\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证 'val' 参数的各项属性\n        assert (\n            val_property[\"type\"] == \"Union[float, str, int]\"\n        ), \"'val' type does not match 'Union[float, str, int]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_no_annotation(self):\n        @manifest(description=\"Test Function\")\n        def func(\n            val,\n        ) -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        assert val_property[\"type\"] == \"Any\", \"'val' type does not match 'Any'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_default(self):\n        @manifest(description=\"Test Function\")\n        def func(val: str = \"value\") -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        assert val_property[\"type\"] == \"str\", \"'val' type does not match 'str'\"\n        assert val_property[\"required\"] is False, \"'val' required does not match False\"\n\n    def test_decorator_google_style_optional(self):\n        @manifest(description=\"Test Function\")\n        def func(\n            val: Optional[str],\n        ) -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        assert (\n            val_property[\"type\"] == \"Optional[str]\"\n        ), \"'val' type does not match 'Optional[str]'\"\n        assert val_property[\"required\"] is False, \"'val' required does not match False\"\n\n    def test_decorator_google_style_optional_equals_none(self):\n        @manifest(description=\"Test Function\")\n        def func(\n            val: Optional[str] = None,\n        ) -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        assert (\n            val_property[\"type\"] == \"Optional[str]\"\n        ), \"'val' type does not match 'Optional[str]'\"\n        assert val_property[\"required\"] is False, \"'val' required does not match False\"\n\n    def test_decorator_google_style_optional_list(self):\n        @manifest(description=\"Test Function\")\n        def func(\n            val: Optional[List[str]],\n        ) -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        assert (\n            val_property[\"type\"] == \"Optional[List[str]]\"\n        ), \"'val' type does not match 'Optional[List[str]]'\"\n        assert val_property[\"required\"] is False, \"'val' required does not match False\"\n\n    def test_decorator_google_style_list_nest_optional(self):\n        @manifest(description=\"Test Function\")\n        def func(\n            val: List[Optional[str]],\n        ) -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        assert (\n            val_property[\"type\"] == \"List[Optional[str]]\"\n        ), \"'val' type does not match 'List[Optional[str]]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n    def test_decorator_google_style_union_nest_single_optional(self):\n        @manifest(description=\"Test Function\")\n        def func(\n            val: Union[Optional[str]],\n        ) -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        assert (\n            val_property[\"type\"] == \"Optional[str]\"\n        ), \"'val' type does not match 'Optional[str]'\"\n        assert val_property[\"required\"] is False, \"'val' required does not match False\"\n\n    def test_decorator_google_style_union_nest_optional(self):\n        @manifest(description=\"Test Function\")\n        def func(\n            val: Union[Optional[int], Optional[str]],\n        ) -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        # 验证类型，inspect 可能优化嵌套 Union\n        assert (\n            val_property[\"type\"] == \"Union[int, str]\"\n        ), \"'val' type does not match 'Union[int, str]'\"\n        assert val_property[\"required\"] is False, \"'val' required does not match False\"\n\n    def test_decorator_google_style_union_nest1_dict_optional_value(self):\n        @manifest(description=\"Test Function\")\n        def func(\n            val: Union[float, Dict[str, Optional[int]]],\n        ) -> str:\n            return \"\"\n\n        view = func.__ab_manifest__\n\n        assert isinstance(view, Manifest), \"view is not an instance of Manifest\"\n\n        parameters = view.function[\"parameters\"]\n        properties = parameters[\"properties\"]\n\n        assert \"val\" in properties, \"'val' parameter missing\"\n        val_property = properties[\"val\"]\n\n        assert (\n            val_property[\"type\"] == \"Union[float, Dict[str, Optional[int]]]\"\n        ), \"'val' type does not match 'Union[float, Dict[str, Optional[int]]]'\"\n        assert val_property[\"required\"] is True, \"'val' required does not match True\"\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_matching.py",
    "content": "\"\"\"\ntest mathcing\n\"\"\"\n\nimport sys\n\nsys.path.append('../..')\n\nimport unittest\nimport os\nimport appbuilder\n\nclass TestMatching(unittest.TestCase):\n\n    def test_example(self):\n        # 初始化所需要的组件\n        embedding = appbuilder.Embedding()\n        matching = appbuilder.Matching(embedding)\n\n        # 定义输入query和文本列表\n        query = appbuilder.Message(\"你好\")\n        contexts = appbuilder.Message([\"世界\", \"你好\"])\n\n        # 根据query，对文本列表做相似度排序\n        contexts_matched = matching(query, contexts)\n        self.assertListEqual(contexts_matched.content, ['你好', '世界'])\n\n    def test_run(self):\n        embedding = appbuilder.Embedding()\n        matching = appbuilder.Matching(embedding)\n\n        query = appbuilder.Message(\"你好\")\n        contexts = appbuilder.Message([\"世界\", \"你好\"])\n\n        contexts_matched = matching(query, contexts)\n\n        self.assertListEqual(\n            contexts_matched.content,\n            ['你好', '世界']\n        )\n\n    def test_return_score(self):\n        embedding = appbuilder.Embedding()\n        matching = appbuilder.Matching(embedding)\n\n        query = appbuilder.Message(\"你好\")\n        contexts = appbuilder.Message([\"世界\", \"你好\"])\n\n        contexts_matched = matching(query, contexts, return_score=True)\n\n        scores = [i[0] for i in contexts_matched.content]\n        contexts = [i[1] for i in contexts_matched.content]\n\n        self.assertListEqual(\n            contexts,\n            ['你好', '世界']\n        )\n        self.assertGreater(scores[0], scores[1])\n\n    def test_semantics(self):\n        embedding = appbuilder.Embedding()\n        matching = appbuilder.Matching(embedding)\n\n        query = appbuilder.Message(\"你好\")\n        query_embedding = embedding(query)\n\n        contexts = appbuilder.Message([\"世界\", \"你好\"])\n        context_embedding = embedding.batch(contexts)\n\n        semantics = matching.semantics(query_embedding, context_embedding)\n\n        self.assertEqual(len(semantics.content), 2)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_mcp_ai_search_stdio.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport sys\nimport subprocess\nimport asyncio\nimport os\nimport inspect\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestGetAppList(unittest.TestCase):\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\n    def test_ai_search_mcp_stdio(self):\n        async def process():\n            mcp_client = MCPClient()\n            env = {\"APPBUILDER_TOKEN\": os.getenv(\"APPBUILDER_TOKEN\")}\n            await mcp_client.connect_to_server(\n                inspect.getfile(ai_search_server), env=env\n            )\n            tools = mcp_client.tools\n            assert len(tools) > 0\n            result = await mcp_client.call_tool(\"AIsearch\", {\"query\": \"今天的头条新闻\"})\n            print(result)\n            assert result.content[0] != \"\"\n\n        from appbuilder.mcp_server import MCPClient\n        from appbuilder.mcp_server.ai_search import ai_search_server\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(process())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_mcp_app_server_stdio.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport sys\nimport asyncio\nimport os\nimport inspect\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestGetAppList(unittest.TestCase):\n\n    def setUp(self):\n        self.app_id = \"aa8af334-df27-4855-b3d1-0d249c61fc08\"\n\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\n    def test_app_list_stdio(self):\n        async def process():\n            mcp_client = MCPClient()\n            env = {\"APPBUILDER_TOKEN\": os.getenv(\"APPBUILDER_TOKEN\")}\n            await mcp_client.connect_to_server(\n                inspect.getfile(app_server), env=env\n            )\n            tools = mcp_client.tools\n            assert len(tools) > 0\n            result = await mcp_client.call_tool(\"list_apps\", {})\n            print(result)\n            assert result.content[0] != \"\"\n\n        from appbuilder.mcp_server import MCPClient\n        from appbuilder.mcp_server.app import app_server\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(process())\n\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\n    def test_app_run_stdio(self):\n        async def process():\n            mcp_client = MCPClient()\n            env = {\"APPBUILDER_TOKEN\": os.getenv(\"APPBUILDER_TOKEN\")}\n            await mcp_client.connect_to_server(inspect.getfile(app_server), env=env)\n            tools = mcp_client.tools\n            assert len(tools) > 0\n            create_conversation_result = await mcp_client.call_tool(\"create_conversation\", {\"app_id\": self.app_id})\n            conversation_id = create_conversation_result.content[0].text\n            print(conversation_id)\n            assert conversation_id is not None\n            result = await mcp_client.call_tool(\"run\", {\n                \"app_id\": self.app_id,\n                \"conversation_id\": conversation_id,\n                \"query\": \"北京的小学生数量\",\n                })\n            answer = result.content[0].text\n            print(answer)\n            assert answer is not None\n\n            await mcp_client.cleanup()\n\n        from appbuilder.mcp_server import MCPClient\n        from appbuilder.mcp_server.app import app_server\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(process())\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_mcp_rag_stdio.py",
    "content": "# Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport sys\nimport json\nimport asyncio\nimport os\nimport inspect\nimport appbuilder\nfrom appbuilder import (\n    KnowledgeBase,\n)\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_SERIAL\", \"\")\nclass TestGetAppList(unittest.TestCase):\n\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\n    def test_knowledgebase_mcp(self):\n        async def process():\n            # case list tools\n            mcp_client = MCPClient()\n            env = {\"APPBUILDER_TOKEN\": os.getenv(\"APPBUILDER_TOKEN\")}\n            await mcp_client.connect_to_server(inspect.getfile(knowledge_base_server), env=env)\n            tools = mcp_client.tools\n            print(tools)\n\n            # case create_knowledge_base\n            result = await mcp_client.call_tool(\n                \"create_knowledge_base\",\n                {\"name\": \"mcp测试可删\", \"description\": \"mcp测试，可删\"},\n            )\n            knowledge_base_info = json.loads(result.content[0].text)\n            knowledge_base_id = knowledge_base_info.get(\"id\")\n            assert knowledge_base_id is not None\n\n            # case describe_knowledge_base\n            appbuilder.logger.debug(\n                f\"create knowledge base success: {knowledge_base_id}\")\n            result = await mcp_client.call_tool(\n                \"describe_knowledge_base\",\n                {\"id\": knowledge_base_id},\n            )\n            knowledge_base_info = json.loads(result.content[0].text)\n            knowledge_base_id = knowledge_base_info.get(\"id\")\n            assert knowledge_base_id is not None\n            appbuilder.logger.debug(\n                f\"describe knowledge base success: {knowledge_base_id}\"\n            )\n\n            # case list_knowledge_bases\n            result = await mcp_client.call_tool(\n                \"list_knowledge_bases\",\n                {\"max_keys\": 10},\n            )\n            assert len(result.content) == 10\n            appbuilder.logger.debug(\n                f\"list knowledge bases success: {len(result.content)}\"\n            )\n\n            # case upload_document\n            result = await mcp_client.call_tool(\n                \"upload_document\",\n                {\"id\": knowledge_base_id,\n                    \"file_path\": \"./data/mcp_knowledge_base_case.txt\"},\n            )\n            document_info = json.loads(result.content[0].text)\n            print(document_info)\n            document_id = document_info.get(\"documentId\")\n            assert document_id is not None\n            appbuilder.logger.debug(f\"upload document success: {document_id}\")\n\n            # case list_documents\n            result = await mcp_client.call_tool(\n                \"list_documents\",\n                {\"id\": document_id},\n            )\n            assert len(result.content) == 1\n            appbuilder.logger.debug(\n                f\"list documents base success: {document_id}\")\n\n            # case query_knowledge_base\n            result = await mcp_client.call_tool(\n                \"query_knowledge_base\",\n                {\"query\": \"分子\", \"id_list\": [\n                    \"56e82915-9642-4a03-bb02-74744c17863e\"]},\n            )\n            assert result.content[0].text is not None\n            appbuilder.logger.debug(\"query knowledge base success\")\n\n            await mcp_client.cleanup()\n\n        from appbuilder.mcp_server import MCPClient\n        from appbuilder.mcp_server.knowledge_base import knowledge_base_server\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(process())\n\n\ndef query_knowledge_base(query: str, id_list: list[str]):\n    \"\"\"\n    Query content from KnowledgeBases.\n\n    Args:\n        query: Search query string\n        id_list: List of KnowledgeBase ID to search in\n    \"\"\"\n    client = KnowledgeBase()\n    resp = client.query_knowledge_base(query, knowledgebase_ids=id_list)\n    return [\n        {\n            \"chunk_id\": chunk.chunk_id,\n            \"content\": chunk.content,\n            \"document_id\": chunk.document_id,\n            \"document_name\": chunk.document_name,\n        }\n        for chunk in resp.chunks\n    ]\n\n\nif __name__ == \"__main__\":\n    appbuilder.logger.setLevel(\"DEBUG\")\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_message.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nfrom appbuilder.core.message import Message\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestMessage(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        pass\n        \"\"\"\n        pass\n\n    def test_message(self):\n        \"\"\"\n        test message\n        \"\"\"\n        m = Message({\"query\": \"my message\"}, name=\"m\")\n        print(m)\n        m = Message(content={\"query\": \"my message\"}, name=\"m\")\n        print(m)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_mix_card_ocr.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import InvalidRequestArgumentError\nfrom appbuilder.core.components.mix_card_ocr.model import MixCardOCRRequest\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestPlantRecognition(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        # 从BOS存储读取样例文件\n        self.image_url=(\"https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?\"\n                        \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06\"\n                        \"%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe\"\n                        \"1865e4393da5a3515e90d72d81ef18296bd29598\")\n\n        self.raw_image = requests.get(self.image_url).content\n        self.mix_card_ocr = appbuilder.MixCardOCR()\n\n        # 输入参数为一张图片\n\n    def test_run_with_image_url(self):\n        \"\"\"\n        使用图片url进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"url\": self.image_url})\n        msg = self.mix_card_ocr.run(inp)\n        self.assertIsNotNone(msg.content)\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"raw_image\": self.raw_image})\n        msg = self.mix_card_ocr.run(inp)\n        self.assertIsNotNone(msg.content)\n        \n    def test_tool_eval(self):\n        result=self.mix_card_ocr.tool_eval(name='name',streaming=False,files=['test'])\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n        result=self.mix_card_ocr.tool_eval(\n            name='name',\n            streaming=True,\n            file_names=['test'],\n            file_urls={'test':self.image_url}\n            )\n        res=next(result)\n        self.assertEqual(res['visible_scope'],'llm')\n        res=next(result)\n        self.assertEqual(res['visible_scope'],'user')\n        result=self.mix_card_ocr.tool_eval(\n            name='name',\n            streaming=False,\n            file_names=['test'],\n            file_urls={'test':self.image_url}\n            )\n        \n    def test_recognize_raise(self):\n        mco=appbuilder.MixCardOCR()\n        with self.assertRaises(ValueError):\n            mcor=MixCardOCRRequest()\n            mco._recognize(request=mcor)\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_mrc.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nimport time\n\nclass TestMRC(unittest.TestCase):\n    def setUp(self):\n        '''\n        return mrc class\n        '''\n        # 设置环境变量和初始化TestMRCComponent实例\n        self.model_name = \"DeepSeek-V3.1\"\n        self.mrc = appbuilder.MRC(model=self.model_name)\n\n    def test_mrc_with_custom_context_list(self):\n        \"\"\"测试run方法使用自定义格式context_out_list\"\"\"\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        context_list = appbuilder.Message([\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n        2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n        听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                            \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\n        C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n        北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n        有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n        4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"])\n        answer = self.mrc(msg, context_list)\n        self.assertIsNotNone(answer)\n        time.sleep(1) \n\n    def test_mrc_with_invalid_context(self):\n        \"\"\"测试run方法使用无效格式的context_list\"\"\"\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        context_list = appbuilder.Message(\"无效样式\")\n        self.mrc(msg, context_list)\n        time.sleep(1) \n\n    def test_mrc_with_reject(self):\n        \"\"\"测试拒答功能开启情况\"\"\"\n        # 测试阅读理解问答\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        context_list = appbuilder.Message([\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n        2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n        听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                            \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\n        C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n        北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n        有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n        4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"])\n        answer = self.mrc(msg, context_list, reject=True, clarify=True, highlight=True, friendly=True,cite=True)\n        print(answer)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        context_list = [\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n        2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n        听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                            \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\n        C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n        北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n        有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n        4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"]\n        params = {\n            'name': 'mrc',\n            'query': '残疾人怎么办相关证件',\n            'context_list': context_list\n        }\n        result = self.mrc.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.mrc.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        context_list = [\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n        2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n        听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                            \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\n        C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n        北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n        有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n        4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"]\n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'mrc',\n                'query': '残疾人怎么办相关证件'\n            }\n            result = self.mrc.tool_eval(streaming=True, **params)\n            next(result)\n        \n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'mrc',\n                'context_list': context_list\n            }\n            result = self.mrc.tool_eval(streaming=True, **params)\n            next(result)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_nl2pandas.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nimport unittest\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\n\n\nclass TestNl2pandasComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量及必要数据。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.Nl2pandasComponent(model=self.model_name)\n        self.table_info = '''表格列信息如下：\n        学校名 : 清华附小 , 字符串类型，代表小学学校的名称\n        所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\n        创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\n        类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\n        学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\n        教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\n        教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量\n        '''\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试 stream 和 temperature 参数\"\"\"\n        query = \"海淀区有哪些学校\"\n        msg = Message(query)\n        code = self.node(msg, table_info=self.table_info, stream=False, temperature=0.5)\n        self.assertIsNotNone(code)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'name': 'nl2pandas',\n            'query': '海淀区有哪些学校',\n            'table_info': self.table_info\n        }\n        result = self.node.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'nl2pandas',\n                'query': '海淀区有哪些学校'\n            }\n            result = self.node.tool_eval(streaming=True, **params)\n            next(result)\n        \n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'nl2pandas',\n                'table_info': self.table_info\n            }\n            result = self.node.tool_eval(streaming=True, **params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_object_recognize.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport requests\nimport appbuilder\nfrom appbuilder.core._exception import InvalidRequestArgumentError\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestObjectRecognize(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            None\n\n        Returns:\n            None.\n        \"\"\"\n        self.object_recognition = appbuilder.ObjectRecognition()\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc\" \\\n                    \"1ba1de0a8f072bc5a87102bd32f9e3\"\n        raw_image = requests.get(image_url).content\n\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n\n        # Recognize landmark\n        output = self.object_recognition.run(message)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_no_image(self):\n        \"\"\"\n         测试run函数在传入无效图像的情况下的行为\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = appbuilder.Message(content={})\n\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.object_recognition.run(message)\n\n    def test_run_with_timeout_and_retry(self):\n        \"\"\"\n        测试run方法，timeout、retry参数\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc\" \\\n                    \"1ba1de0a8f072bc5a87102bd32f9e3\"\n        raw_image = requests.get(image_url).content\n\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n\n        # Recognize landmark with timeout and retry parameters\n        output = self.object_recognition.run(message, timeout=5.0, retry=3)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message({\"url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.object_recognition.run(message=message)\n\n    def test_run_without_image_and_url(self):\n        \"\"\"\n        测试run 函数在没有传入图像和URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        message = appbuilder.Message({})\n        with self.assertRaises(ValueError):\n            self.object_recognition.run(message=message)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc\" \\\n                    \"1ba1de0a8f072bc5a87102bd32f9e3\"\n        result = self.object_recognition.tool_eval(name=\"object_recognition\", streaming=True, img_url=image_url)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(InvalidRequestArgumentError):\n            result = self.object_recognition.tool_eval(name=\"object_recognition\", streaming=True)\n            next(result)\n        \n        with self.assertRaises(InvalidRequestArgumentError):\n            result=self.object_recognition.tool_eval(name='test',streaming=False,file_urls={'test_01':'test'},img_name='test')\n            next(result)\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_openapi_convert.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n#     http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicable law or agreed to in writing, software\r\n# distributed under the License is distributed on an \"AS IS\" BASIS,\r\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n# See the License for the specific language governing permissions and\r\n# limitations under the License.\r\n\r\nimport unittest\r\nimport asyncio\r\nimport json\r\nimport os\r\nimport sys\r\n\r\n\r\nclass TestOpenAPIMCPConverter(unittest.TestCase):\r\n\r\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\r\n    def setUp(self):\r\n        \"\"\"\r\n        设置测试环境。\r\n\r\n        Args:\r\n            无参数，默认值为空。\r\n\r\n        Returns:\r\n            无返回值，方法中执行了环境变量的赋值操作。\r\n        \"\"\"\r\n\r\n        from mcp_server.openapi import OpenAPIMCPConverter\r\n        self.converter = OpenAPIMCPConverter(\r\n            base_url=\"https://api.github.com\",\r\n            headers={\r\n                \"Accept\": \"application/vnd.github.v3+json\",\r\n                \"User-Agent\": \"OpenAPIMCPConverter-Test\"\r\n            },\r\n            timeout=30.0,\r\n            max_retries=3\r\n        )\r\n\r\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\r\n    async def asyncSetUp(self):\r\n        \"\"\"异步设置，加载本地GitHub API规范\"\"\"\r\n        import os\r\n        # Get the path to the test data file\r\n        current_dir = os.path.dirname(os.path.abspath(__file__))\r\n        json_spec_path = os.path.join(current_dir, 'data', 'ghes-3.0.json')\r\n        await self.converter.load_spec(json_spec_path)\r\n\r\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\r\n    def test_list_tools(self):\r\n        \"\"\"测试 list_tools 方法\"\"\"\r\n        async def run_test():\r\n            await self.asyncSetUp()\r\n            tools = self.converter.list_tools()\r\n            self.assertIsNotNone(tools)\r\n            self.assertTrue(len(tools) > 0)\r\n\r\n            # 验证前5个工具的结构\r\n            for tool in tools[:5]:\r\n                self.assertIn('name', tool)\r\n                self.assertIn('description', tool)\r\n                self.assertIn('input_schema', tool)\r\n\r\n        asyncio.run(run_test())\r\n\r\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\r\n    def test_call_tool_list_repos(self):\r\n        \"\"\"测试调用 list_repos_for_user 工具\"\"\"\r\n        async def run_test():\r\n            await self.asyncSetUp()\r\n            # Get a list of available tools\r\n            tools = self.converter.list_tools()\r\n            tool_names = [tool['name'] for tool in tools]\r\n\r\n            # Skip the test if the tool is not available\r\n            if \"get_/users/{username}/repos\" not in tool_names:\r\n                print(\"Skipping test_call_tool_list_repos: Tool 'get_/users/{username}/repos' not found in local test data\")\r\n                return\r\n\r\n            result = await self.converter.call_tool(\r\n                \"get_/users/{username}/repos\",\r\n                {\r\n                    \"username\": \"octocat\",\r\n                    \"type\": \"owner\",\r\n                    \"sort\": \"created\",\r\n                    \"per_page\": 1\r\n                }\r\n            )\r\n            self.assertIsNotNone(result)\r\n            self.assertTrue(isinstance(result, list))\r\n\r\n        asyncio.run(run_test())\r\n\r\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\r\n    def test_call_tool_get_repo(self):\r\n        \"\"\"测试调用 get_repo 工具\"\"\"\r\n        async def run_test():\r\n            await self.asyncSetUp()\r\n            # Get a list of available tools\r\n            tools = self.converter.list_tools()\r\n            tool_names = [tool['name'] for tool in tools]\r\n\r\n            # Skip the test if the tool is not available\r\n            if \"get_/repos/{owner}/{repo}\" not in tool_names:\r\n                print(\"Skipping test_call_tool_get_repo: Tool 'get_/repos/{owner}/{repo}' not found in local test data\")\r\n                return\r\n\r\n            result = await self.converter.call_tool(\r\n                \"get_/repos/{owner}/{repo}\",\r\n                {\r\n                    \"owner\": \"octocat\",\r\n                    \"repo\": \"Hello-World\"\r\n                }\r\n            )\r\n            self.assertIsNotNone(result)\r\n            self.assertIn('name', result)\r\n            self.assertIn('owner', result)\r\n\r\n        asyncio.run(run_test())\r\n\r\n    @unittest.skipIf(sys.version_info < (3, 10), \"Only for Python >= 3.10\")\r\n    def test_load_yaml_spec(self):\r\n        \"\"\"测试加载YAML格式的API规范\"\"\"\r\n        async def run_test():\r\n            import os\r\n            # Get the path to the test data file\r\n            current_dir = os.path.dirname(os.path.abspath(__file__))\r\n            yaml_spec_path = os.path.join(current_dir, 'data', 'ghes-3.0.yaml')\r\n\r\n            # Create a new converter for YAML test\r\n            from mcp_server.openapi import OpenAPIMCPConverter\r\n            yaml_converter = OpenAPIMCPConverter(\r\n                base_url=\"https://api.github.com\",\r\n                headers={\r\n                    \"Accept\": \"application/vnd.github.v3+json\",\r\n                    \"User-Agent\": \"OpenAPIMCPConverter-Test\"\r\n                },\r\n                timeout=30.0,\r\n                max_retries=3\r\n            )\r\n\r\n            # Load the YAML spec\r\n            await yaml_converter.load_spec(yaml_spec_path)\r\n\r\n            # Verify tools were loaded\r\n            tools = yaml_converter.list_tools()\r\n            self.assertIsNotNone(tools)\r\n            self.assertTrue(len(tools) > 0)\r\n\r\n            # Clean up\r\n            await yaml_converter.close()\r\n\r\n        asyncio.run(run_test())\r\n\r\n    def tearDown(self):\r\n        \"\"\"清理测试环境\"\"\"\r\n        async def cleanup():\r\n            await self.converter.close()\r\n\r\n        asyncio.run(cleanup())\r\n"
  },
  {
    "path": "python/tests/test_oral_query_generation.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n\nTEST_TEXT = ('文档标题：在OPPO Reno5上使用视频超级防抖\\n'\n             '文档摘要：OPPO Reno5上的视频超级防抖，视频超级防抖3.0，多代视频防抖算法积累，这一代依旧超级防抖超级稳。 开启视频超级'\n             '防抖 开启路径：打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能，开启超级'\n             '防抖后手机屏幕将出现超级防抖Pro开关，点击即可开启或关闭。 除此之外，前置视频同样加持防抖算法，边走边拍也能稳定聚焦脸部'\n             '，实时视频分享您的生活。')\n\n\nclass TestOralQueryGenerationComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n\n        self.model_name = \"DeepSeek-V3.1\"\n        secret_key = os.getenv('SECRET_KEY', None)\n        self.query_generation = appbuilder.OralQueryGeneration(model=self.model_name, secret_key=secret_key)\n    \n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\n        \"\"\"\n        text = TEST_TEXT\n        msg = appbuilder.Message(text)\n        answer = self.query_generation(msg)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer.content}\\n')\n    \n    def test_run_with_question_output_and_json_output(self):\n        \"\"\"测试 run 方法，输出query类型为问题，输出格式为json\n        \"\"\"\n        text = TEST_TEXT\n        msg = appbuilder.Message(text)\n        answer = self.query_generation(msg, query_type='问题', output_format='json')\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer.content}\\n')\n\n    def test_run_with_phrase_output_and_str_output(self):\n        \"\"\"测试 run 方法，输出query类型为短语，输出格式为str\n        \"\"\"\n        text = TEST_TEXT\n        msg = appbuilder.Message(text)\n        answer = self.query_generation(msg, query_type='短语', output_format='str')\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer.content}\\n')\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\n        \"\"\"\n        text = TEST_TEXT\n        msg = appbuilder.Message(text)\n        answer = self.query_generation(msg, stream=False, temperature=0.5)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer.content}\\n')\n\n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        text = TEST_TEXT\n        answer = self.query_generation.tool_eval(name='', stream=False, text=text)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer}\\n')\n\n    def test_tool_eval_with_model_configs(self):\n        \"\"\"测试 tool_eval 方法使用不同temperature和top_p参数值。\n        \"\"\"\n        text = TEST_TEXT\n        model_configs = {'temperature': 0.5, 'top_p': 0.5}\n        answer = self.query_generation.tool_eval(name='', stream=True, text=text, model_configs=model_configs)\n        # print(answer)\n        print(f'\\n[result]\\n')\n        for ans in answer:\n            print(ans)\n\n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        text = TEST_TEXT\n        answer = self.query_generation.tool_eval(name='', stream=False, text=text)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer}\\n')\n\n    def test_tool_eval_with_model_configs(self):\n        \"\"\"测试 tool_eval 方法使用不同temperature和top_p参数值。\n        \"\"\"\n        text = TEST_TEXT\n        model_configs = {'temperature': 0.5, 'top_p': 0.5}\n        answer = self.query_generation.tool_eval(name='', stream=True, text=text, model_configs=model_configs)\n        # print(answer)\n        print(f'\\n[result]\\n')\n        for ans in answer:\n            print(ans)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_plant_recognize.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport requests\nimport appbuilder\nfrom appbuilder.core.message import Message\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestPlantRecognition(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        # 从BOS存储读取样例文件\n        self.image_url = (\"https://bj.bcebos.com/v1/appbuilder/\"\n                          \"palnt_recognize_test.jpg?authorization=\"\n                          \"bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%\"\n                          \"2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2\"\n                          \"Faa2217067f78f0236c8262cdd89a4b4f4b2188\"\n                          \"d971ca547c53d01742af4a2cbe\")\n        self.raw_image = requests.get(self.image_url).content\n        self.plant_recognize = appbuilder.PlantRecognition()\n\n        # 输入参数为一张图片\n\n    def test_run_with_image_url(self):\n        \"\"\"\n        使用图片url进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"url\": self.image_url})\n        msg = self.plant_recognize.run(inp)\n        self.assertIsNotNone(msg.content)\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"raw_image\": self.raw_image})\n        msg = self.plant_recognize.run(inp)\n        self.assertIsNotNone(msg.content)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                  \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                  \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                  \"62cf937c03f8c5260d51c6ae\"\n        img_name = \"test_img.jpg\"\n        file_urls = {img_name: img_url}\n        result = self.plant_recognize.tool_eval(name=\"plant_recognition\", streaming=True,\n                                                img_name=img_name, file_urls=file_urls, origin_query=\"\")\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.plant_recognize.tool_eval(name=\"plant_recognition\", streaming=True,\n                                                    origin_query=\"\")\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_playground.py",
    "content": "import unittest\nimport os\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestPlayground(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n\n        self.model_name = \"DeepSeek-V3.1\"\n        self.play = appbuilder.Playground(prompt_template=\"你好，{name}，我是{bot_name}，{bot_name}是一个{bot_type}，我可以{bot_function}，你可以问我{bot_question}。\", model=self.model_name)\n\n    def test_run_with_valid_message(self):\n        \"\"\" 测试在消息有效时运行 \"\"\"\n        msg = appbuilder.Message({\n            \"name\": \"小明\",\n            \"bot_name\": \"机器人\",\n            \"bot_type\": \"聊天机器人\",\n            \"bot_function\": \"聊天\",\n            \"bot_question\": \"你好吗？\"\n        })\n\n        answer = self.play.run(message=msg, stream=False, temperature=1)\n        self.assertIsNotNone(answer)\n\n    def test_run_with_invalid_message(self):\n        \"\"\" 测试在消息无效时处理 \"\"\"\n        msg = appbuilder.Message({\n            \"name\": \"小明\"\n        })\n\n        with self.assertRaises(ValueError):\n            self.play.run(message=msg, stream=False, temperature=1)\n\n    def test_run_with_string_message(self):\n        \"\"\" 测试在消息为字符串时运行 \"\"\"\n        msg = appbuilder.Message(\"你好，小明。\")\n\n        self.play = appbuilder.Playground(prompt_template=\"你好，{name}。\", model=self.model_name)\n        answer = self.play.run(message=msg, stream=False, temperature=1)\n        self.assertIsNotNone(answer)\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试运行时使用参数 stream 和 temperature\"\"\"\n        msg = appbuilder.Message({\n            \"name\": \"小明\",\n            \"bot_name\": \"机器人\",\n            \"bot_type\": \"聊天机器人\",\n            \"bot_function\": \"聊天\",\n            \"bot_question\": \"你好吗？\"\n        })\n\n        answer = self.play.run(message=msg, stream=True, temperature=0.5, top_p=0.2)\n\n        for ans in answer.content:\n            self.assertIsNotNone(ans)\n\n    def test_run_with_max_output_tokens(self):\n        \"\"\"测试运行时使用参数 max_output_tokens 和 disable_search\"\"\"\n        msg = appbuilder.Message({\n            \"name\": \"小明\",\n            \"bot_name\": \"机器人\",\n            \"bot_type\": \"聊天机器人\",\n            \"bot_function\": \"聊天\",\n            \"bot_question\": \"2023年北京昌平线地铁出轨事件发生在哪一天？\"\n        })\n\n        answer = self.play.run(message=msg, stream=False, temperature=1, max_output_tokens=20, disable_search=False)\n        print(answer)\n        token_usage = answer.token_usage.get(\"completion_tokens\",100)\n        self.assertLessEqual(token_usage, 20)\n    \n    def test_run_with_extra_params(self):\n        \"\"\"测试运行时使用额外的参数\"\"\"\n        msg = appbuilder.Message({\n            \"name\": \"小明\",\n            \"bot_name\": \"机器人\",\n            \"bot_type\": \"聊天机器人\",\n            \"bot_function\": \"聊天\",\n            \"bot_question\": \"2023年北京昌平线地铁出轨事件发生在哪一天？\"\n        })\n        answer = self.play.run(message=msg, stream=False, temperature=1,system=\"你是北京市公安局刑事侦查支队的一名警员\" )\n        for ans in answer.content:\n            self.assertIsNotNone(ans)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_ppt_generation_from_file.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\nimport os\nimport unittest\nimport appbuilder\n\n\nTEST_INPUT = {\n    'file_url':'https://fsh.bcebos.com/v1/chenqingyang/data/PPT%E7%94%9F%E6%88%90%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE/'\n               '%E6%A0%B7%E4%BE%8B%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6/%E6%96%87%E4%BB%B6%E7%94%9F%E6%88%90PPT_%E5%8A%'\n               '9F%E8%83%BD%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6.doc?authorization=bce-auth-v1%2F2ea5034b154145dc8962ca'\n               'e2393d71a6%2F2024-08-01T12%3A15%3A17Z%2F-1%2Fhost%2F9ceed45f60a852d3ef56f405d21916af3596b2988b8f9166fa'\n               '6533bd79bf0f45',\n    'user_name':'百度千帆AppBuilder'\n}\n\n\n@unittest.skip(\"暂时跳过\")\nclass TestPPTGenerationFromFileComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.ppt_generator = appbuilder.PPTGenerationFromFile()\n    \n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\n        \"\"\"\n        msg = appbuilder.Message(TEST_INPUT)\n        result = self.ppt_generator(msg)\n        # print(result)\n        self.assertIsNotNone(result)\n        print(f'\\n[result]\\n{result.content}\\n')\n    \n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        print(f'\\n[result]\\n')\n        for chunk_data in self.ppt_generator.tool_eval(stream=True, **TEST_INPUT):\n            print(chunk_data)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_ppt_generation_from_instruction.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\nimport os\nimport unittest\nimport appbuilder\n\n\nTEST_INPUT = {\n    'text': '生成一个介绍北京的PPT。',\n    'custom_data': {},\n    'complex': 1,\n    'user_name': '百度千帆AppBuilder'\n}\n\n\n@unittest.skip(\"暂时跳过\")\nclass TestPPTGenerationComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        # os.environ['APPBUILDER_TOKEN'] = os.environ['APPBUILDER_TOKEN_PPT_GENERATION']\n        self.ppt_generator = appbuilder.PPTGenerationFromInstruction()\n    \n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\n        \"\"\"\n        msg = appbuilder.Message(TEST_INPUT)\n        result = self.ppt_generator(msg)\n        # print(result)\n        self.assertIsNotNone(result)\n        print(f'\\n[result]\\n{result.content}\\n')\n    \n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        print(f'\\n[result]\\n')\n        for chunk_data in self.ppt_generator.tool_eval(stream=True, **TEST_INPUT):\n            print(chunk_data)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_ppt_generation_from_paper.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\nimport os\nimport unittest\nimport appbuilder\n\n\nTEST_INPUT = {\n    'file_key': 'https://fsh.bcebos.com/v1/chenqingyang/data/PPT%E7%94%9F%E6%88%90%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE'\n                '/%E6%A0%B7%E4%BE%8B%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6/%E8%AE%BA%E6%96%87%E7%94%9F%E6%88%90PPT_%E5%8'\n                'A%9F%E8%83%BD%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6.docx?authorization=bce-auth-v1%2F2ea5034b154145dc89'\n                '62cae2393d71a6%2F2024-08-01T12%3A17%3A25Z%2F-1%2Fhost%2Fce12dce3cfc65060c16495222058e0837e0134945a073'\n                '36b353679541f6b8002',\n    'style': '科技',\n    'color': '蓝色',\n    'title': '',\n    'pleader': '百度千帆AppBuilder',\n    'advisor': '百度千帆AppBuilder',\n    'school': '',\n    'school_logo': '',\n    'school_picture': ''\n}\n\n\n@unittest.skip(\"Open api request limit reached\")\nclass TestPPTGenerationFromPaperComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.ppt_generator = appbuilder.PPTGenerationFromPaper()\n    \n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\n        \"\"\"\n        msg = appbuilder.Message(TEST_INPUT)\n        result = self.ppt_generator(msg)\n        # print(result)\n        self.assertIsNotNone(result)\n        print(f'\\n[result]\\n{result.content}\\n')\n    \n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        print(f'\\n[result]\\n')\n        for chunk_data in self.ppt_generator.tool_eval(stream=True, **TEST_INPUT):\n            print(chunk_data)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_private_llm_component.py",
    "content": "import os\nimport unittest\nfrom appbuilder.core.components.llms.base import CompletionBaseComponent, ModelArgsConfig\n\nclass MockLLMComponent(CompletionBaseComponent):\n\n    def __init__(self, *args, **kwargs):\n        pass\n\n    def run(self, *args, **kwargs):\n        print(\"Success\")\n\n\nclass TestComponentInit(unittest.TestCase):\n    def setUp(self):\n        '''\n        return mrc class\n        '''\n        # 设置环境变量和初始化TestMRCComponent实例\n        self.model_name = \"DeepSeek-V3.1\"\n        self.component = MockLLMComponent(model=self.model_name)\n\n    def test_private_llm_component_init(self):\n        os.environ[\"PRIVATE_AB\"] = \"true\"\n        self.component.set_model_info(\"test_model_name\", \"test_model_url\")\n        os.environ[\"APPBUILDER_TOKEN\"] = \"abc\"\n        self.component.set_secret_key_and_gateway()\n        model_config_inputs = ModelArgsConfig(**{\"stream\": True, \"temperature\": 0.01, \"top_p\": 1})\n        self.component.get_model_config(model_config_inputs)\n        self.component.run()\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_aicape_animal_rec.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestAnimalRecognition(unittest.TestCase):\n    \n    def test_run(self):\n        image_url = (\"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \n                \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \n                \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \n                \"62cf937c03f8c5260d51c6ae\")\n        \n        animal_recognition = appbuilder.AnimalRecognition()\n        out = animal_recognition.run(appbuilder.Message(content={\"url\": image_url}))\n        \n        self.assertIn(\"熊猫\", str(out.content))\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_qa_aicape_doc_crop_enhance.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestDocCropEnhance(unittest.TestCase):\n\n    def test_run(self):\n        image_url = (\n            \"https://bj.bcebos.com/v1/appbuilder/doc_enhance_test.png?\"\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01\"\n            \"-24T12%3A51%3A09Z%2F-1%2Fhost%2F2020d2433da471b40dafa933d557a1e\"\n            \"be8abf28df78010f865e45dfcd6dc3951\")\n        enhance_type = 0\n        doc_enhance = appbuilder.DocCropEnhance()\n        out = doc_enhance.run(appbuilder.Message(content={\"url\": image_url}, enhance_type=enhance_type))\n\n        res = out.content\n        self.assertIsNotNone(res[\"image_processed\"])\n        self.assertIsNotNone(res[\"points\"])\n\n    \nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_qa_aicape_handwriting_ocr.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestHandwritingOcr(unittest.TestCase):\n    def test_run(self):\n        image_url=(\"https://bj.bcebos.com/v1/appbuilder/test_handwrite_ocr.jpg?\"\n                   \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-23T\"\n                   \"11%3A58%3A09Z%2F-1%2Fhost%2F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b0\"\n                \"83d195c8b\")\n        \n        image = image_url\n        handwrite_ocr = appbuilder.HandwriteOCR()\n        out = handwrite_ocr.run(appbuilder.Message(content={\"url\": image}))\n        \n        self.assertIn(\"我们家住的小区里有很多银杏树\", str(out.content))\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_qa_aicape_image_understand.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nimport time\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestAnimalRecognition(unittest.TestCase):\n\n    def test_run(self):\n        image_url = (\n            \"https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUa\"\n            \"sgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bf\"\n            \"e25c372b7e56e6\"\n        )\n        question = \"图片里内容是什么?\"\n\n        image_understand = appbuilder.ImageUnderstand()\n        out = image_understand.run(appbuilder.Message(content={\"url\": image_url, \"question\": question}))\n        \n        self.assertIn(\"蔬菜\", str(out.content))\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_aicape_mixcard_ocr.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestMixcardOcr(unittest.TestCase):\n\n    def test_run(self):\n        image_url = (\n            \"https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgol\"\n            \"jdEDAzLm%2F2024-01-24T06%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe1865e4393da5a3515e90d72d81ef18\"\n            \"296bd29598\"\n        )\n\n        mixcard_ocr = appbuilder.MixCardOCR()\n        out = mixcard_ocr.run(appbuilder.Message(content={\"url\": image_url}))\n        \n        self.assertIn(\"110103\", str(out.content))\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_aicape_plant_rec.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestPlantRecognition(unittest.TestCase):\n\n    def test_run(self):\n        image_url = (\n            \"https://bj.bcebos.com/v1/appbuilder/palnt_recognize_test.jpg?authorization=bce-auth-v1%2FALTAKGa\"\n            \"8m4qCUasgoljdEDAzLm%2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2Faa2217067f78f0236c8262cdd89a4b4f4b2\"\n            \"188d971ca547c53d01742af4a2cbe\"\n        )\n\n        plant_recognition = appbuilder.PlantRecognition()\n        out = plant_recognition.run(appbuilder.Message(content={\"url\": image_url}))\n        \n        self.assertTrue(\"plant_score_list\" in out.content)\n        self.assertIn(\"树\", str(out.content))\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_aicape_qrcode_orc.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestQrcodeOcr(unittest.TestCase):\n\n    def test_run(self):\n        image_url = (\n            \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\"\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\"\n            \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        )\n        location = \"true\"\n\n        qrcode_ocr = appbuilder.QRcodeOCR()\n        out = qrcode_ocr.run(appbuilder.Message(content={\"url\": image_url, \"location\": location}))\n\n        self.assertIn(\"QR_CODE\", str(out.content))\n        \n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_qa_aicape_table_ocr.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestTableOcr(unittest.TestCase):\n\n    def test_run(self):\n        image_url = (\n            \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\"\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\"\n            \"064079145ff4698856f477b820147768fc2187d3\"\n        )\n\n        table_ocr = appbuilder.TableOCR()\n        out = table_ocr.run(appbuilder.Message(content={\"url\": image_url}))\n        \n        self.assertIn(\"tables_result\", out.content)\n        self.assertIn(\"header\", out.content[\"tables_result\"][0])\n        self.assertIn(\"body\", out.content[\"tables_result\"][0])\n        self.assertIn(\"table_location\", out.content[\"tables_result\"][0])\n        self.assertIn(\"流动资金来源\", str(out.content))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_doc_parser_extract_table_from_doc.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestDocParserExtractTableFromDoc(unittest.TestCase):\n\n    def test_run(self):\n        test_dir = os.path.dirname(__file__)\n        image_path = os.path.join(test_dir, \"data/qa_doc_parser_extract_table_from_doc.png\")\n        return_raw = True\n\n        builder = appbuilder.DocParser()\n        msg = Message(image_path)\n        doc = builder(msg, return_raw=return_raw).content.raw\n\n        ExtractTableBuilder = appbuilder.ExtractTableFromDoc()\n        out = ExtractTableBuilder.run(Message(doc), table_max_size=1000)\n\n        self.assertIn(\"客户名称\", str(out))\n        self.assertIn(\"有限责任公司\", str(out))\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_dialog_summary.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder import Message\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestDialogSummaryComponent(unittest.TestCase):\n\n    def test_run(self):\n        model_name = \"DeepSeek-V3.1\"\n        text = (\"客户：你好，我购买的新笔记本电脑出现了无法连接无线网络的问题。客服：你好，很抱歉听到你遇到了\"\n                \"网络问题。请问你尝试过重新启动路由器和笔记本电脑吗？客户：是的，我已经尝试过，但问题仍然存在。客服：\"\n                \"明白了。请问其他设备是否能够成功连接到同一网络？客户：是的，我的手机和平板电脑都可以正常连接。客服：\"\n                \"感谢你的反馈。在笔记本电脑无法连接网络时，你是否收到了任何错误消息？客户：是的，我收到了一个提示说\"\n                \"“无法获得有效的IP地址”。客服：好的，这是有关IP地址分配的问题。请尝试手动分配一个IP地址并查看是否\"\n                \"解决问题。我可以为你提供详细的步骤。客户：好的，我愿意尝试。客户：我按照你提供的步骤手动分配了IP地址，\"\n                \"但问题依然存在。客服：谢谢你的尝试。我们可能需要进一步检查网络设置。你是否同意进行远程连接以便我查看电脑\"\n                \"的网络配置？客户：可以。客服：我发现你的网络配置正常，但存在一个驱动程序更新可能会解决的问题。你是否同意我\"\n                \"协助你更新网络驱动程序？客户：好的，请帮我更新。客户：感谢你的帮助，更新后问题已经解决了。我现在可以正常连接到\"\n                \"无线网络了。客服：太好了，我很高兴能够帮到你。如果还有其他问题，随时告诉我。客户：其实，我还有一个关于电池寿命的问题。\"\n                \"最近感觉电池很快就耗尽了。客服：明白了，电池寿命问题也很重要。你可以尝试通过减少屏幕亮度和关闭一些背景应用来延长电池寿命。\"\n                \"另外，我可以为你提供一些建议，帮你优化电池使用。\")\n        stream = None\n        temperature = None\n\n        builder = appbuilder.DialogSummary(model=model_name)\n        msg = Message(content=text)\n        input_params = {}\n\n        if stream is not None:\n            input_params[\"stream\"] = stream\n        if temperature is not None:\n            input_params[\"temperature\"] = temperature\n\n        res = builder(msg, **input_params)\n        content = \"\".join(res.content) if stream else res.content\n\n        self.assertIn(\"诉求\", content)\n        self.assertIn(\"回应\", content)\n        self.assertIn(\"解决情况\", content)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_get_qianfan_model_list.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport appbuilder\n\n# @unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestGetQianfanModelList(unittest.TestCase):\n\n    def test_run(self):\n        \"\"\"\n        正常用例\n        \"\"\"\n        secret_key = os.environ[\"APPBUILDER_TOKEN\"]\n        api_type_filter = [\"chat\", \"completions\", \"embeddings\", \"text2image\"]\n        is_available = True\n\n        models = appbuilder.get_model_list(\n            secret_key=secret_key,\n            api_type_filter=api_type_filter,\n            is_available=is_available\n        )\n        self.assertIn(\"ERNIE\", str(models))\n        self.assertGreater(len(models), 0, \"Model list should not be empty\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_is_complex_query.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestIsComplexQuery(unittest.TestCase):\n\n    def test_run(self):\n        model_name = \"DeepSeek-V3.1\"\n        message = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        is_complex_query = appbuilder.IsComplexQuery(model=model_name)\n        out = is_complex_query(appbuilder.Message(content=message))\n    \n        self.assertIn(\"类型：复杂问题\", out.content)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_matching.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestSemanticRankComponent(unittest.TestCase):\n    def test_normal_case(self):\n        query = \"合同中展期利率与罚息利率分别是什么？\"\n        contexts = [\n            \"借款展期部分的利率为年化利率（单利），并按下列方式确定：借款展期期限加上原借款期限达到新的利率期限档次的，从展期之日起，借款利息\"\n            \"按新的期限档次利率计收，年利率执行2%。\",\n            \"乙方未按照本协议的约定按期偿还展期借款本息的，甲方有权在展期利率基础上加收1%作为罚息利率，对乙方逾期借款自应还款之日（含）起按罚\"\n            \"息利率计收利息，并对未按时支付的利息（含罚息）按罚息利率计收复利。\",\n            \"担保人承诺按照原担保合同的约定继续对借款人在原借款合同和本借款展期协议项下的全部义务承担担保责任。担保人提供的担保为保证担保的，\"\n            \"保证期间变更为自本协议约定的借款展期到期之日起三年。\"\n        ]\n\n        query_message = appbuilder.Message(content=query)\n        contexts_message = appbuilder.Message(content=contexts)\n\n        embedding = appbuilder.Embedding()\n        matching = appbuilder.Matching(embedding)\n        out_matching = matching(query_message, contexts_message)\n        \n        query_embedding = embedding(query_message)\n        context_embeddings = embedding.batch(contexts_message)\n        out_semantics = matching.semantics(query_embedding, context_embeddings)\n\n        self.assertEqual(len(out_matching.content), 3)\n        self.assertEqual(len(out_semantics.content), 3)\n        for score in out_semantics.content:\n            self.assertGreater(score, 0)\n            self.assertLess(score, 1)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_oral_query_generation.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestOralQueryGeneration(unittest.TestCase):\n    def test_normal_case(self):\n        model_name = \"DeepSeek-V3.1\"\n        text = ('文档标题：在OPPO Reno5上使用视频超级防抖\\n'\n                '文档摘要：OPPO Reno5上的视频超级防抖，视频超级防抖3.0，多代视频防抖算法积累，这一代依旧超级防抖超级稳。 开启视频超级'\n                '防抖 开启路径：打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能，开启超级'\n                '防抖后手机屏幕将出现超级防抖Pro开关，点击即可开启或关闭。 除此之外，前置视频同样加持防抖算法，边走边拍也能稳定聚焦脸部'\n                '，实时视频分享您的生活。')\n\n        query_generation = appbuilder.OralQueryGeneration(model=model_name)\n        msg = appbuilder.Message(content=text)\n        out = query_generation(msg)\n\n        self.assertIn(\"OPPO\", str(out.content))\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_paddle_speech_tts.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestPaddleSpeechTTS(unittest.TestCase):\n    def test_normal_case(self):\n        text = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性\"\n        tts_model = \"paddlespeech-tts\"\n        audio_type = \"wav\"\n        \n        # Setup\n        tts = appbuilder.TTS()\n        inp = appbuilder.Message(content={\"text\": text})\n        param_dict = {\n            \"model\": tts_model,\n            \"audio_type\": audio_type,\n        }\n        \n        out = tts.run(inp, **param_dict)\n        self.assertGreaterEqual(len(out.content[\"audio_binary\"]), 0)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_pandas.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder import Message\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestNl2pandasComponent(unittest.TestCase):\n    def test_normal_case(self):\n        model_name = \"DeepSeek-V3.1\"\n        query = \"海淀区的学校数量\"\n        table_info = '''表格列信息如下：\n                        学校名 : 清华附小 , 字符串类型，代表小学学校的名称\n                        所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\n                        创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\n                        类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\n                        学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\n                        教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\n                        教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量\n                    '''\n\n        nl2pandas = appbuilder.Nl2pandasComponent(model=model_name)\n        msg = Message(content=query)\n        input_params = {\n            \"table_info\": table_info,\n        }\n        out = nl2pandas(msg, **input_params)\n\n        self.assertIn(\"df[\", out.content)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_query_decomposition.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestQueryDecomposition(unittest.TestCase):\n    def test_normal_case(self):\n        model_name = \"DeepSeek-V3.1\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性\"\n        query_decomposition = appbuilder.QueryDecomposition(model=model_name)\n        msg = appbuilder.Message(content=query)\n        out = query_decomposition(msg)\n\n        self.assertGreater(len(out.content.split(\"\\n\")), 0)\n        \n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_llm_style_rewrite.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestStyleRewrite(unittest.TestCase):\n    def test_normal_case(self):\n        text = \"文心大模型发布新版\"\n        model_name = \"DeepSeek-V3.1\"\n        style = \"激励话术\"\n\n        builder = appbuilder.StyleRewrite(model=model_name)\n        msg = appbuilder.Message(content=text)\n        out = builder(msg, style=style)\n\n        self.assertIn(\"文心大模型\", out.content)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qa_pair_mining.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nimport unittest\nimport os\n\nimport appbuilder\n\n\nclass TestQAPairMiningComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.QAPairMining(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"2017年，工商银行根据外部宏观环境变化...\"\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n        self.assertIn(\"问题\", answer.content)\n        self.assertIn(\"答案\", answer.content)\n\n    # def test_run_with_custom_params(self):\n    #     \"\"\"测试 run 方法使用自定义参数\"\"\"\n    #     query = \"2017年，工商银行根据外部宏观环境变化...\"\n    #     msg = appbuilder.Message(query)\n    #     answer = self.node(msg, stream=True, temperature=0.5)\n    #     self.assertIsNotNone(answer)\n    #     # 检查 answer 是否符合预期\n\n    def test_run_with_invalid_params(self):\n        \"\"\"测试 run 方法使用无效参数\"\"\"\n        query = \"2017年，工商银行根据外部宏观环境变化...\"\n        msg = appbuilder.Message(query)\n        with self.assertRaises((ValueError, TypeError)):\n            self.node(msg, invalid_param=\"invalid\")\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'name': 'qa_pair_mining',\n            'query': '2017年，工商银行根据外部宏观环境变化...'\n        }\n        result = self.node.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'qa_pair_mining'\n            }\n            result = self.node.tool_eval(streaming=True, **params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_qrcode_ocr.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport os\nimport requests\nimport unittest\nimport appbuilder\n\nfrom appbuilder.core._exception import InvalidRequestArgumentError \n\nclass TestQRcodeOCR(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \"\"\"\n        self.qrcode_ocr = appbuilder.QRcodeOCR()\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        # Qrcode ocr\n        output = self.qrcode_ocr.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_url(self):\n        \"\"\"\n        使用图片 URL 进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        # Create message with image URL\n        message = appbuilder.Message(content={\"url\": image_url})\n        # Qrcode ocr\n        output = self.qrcode_ocr.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_args(self):\n        \"\"\"\n        测试run方法，location、timeout、retry参数\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        #  Qrcode ocr with timeout and retry parameters\n        output = self.qrcode_ocr.run(message, location=\"true\", timeout=5.0, retry=3)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_invalid_input(self):\n        \"\"\"\n        测试run函数在传入无效输入的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = appbuilder.Message(content={})\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.qrcode_ocr.run(message)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message(content={\"url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.qrcode_ocr.run(message)\n        \n        with self.assertRaises(InvalidRequestArgumentError):\n            self.qrcode_ocr.run(message=message,location='test')\n        \n            \n    def test_tool_eval(self):\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        result=self.qrcode_ocr.tool_eval(name='name',streaming=False,files=['test'])\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n        result=self.qrcode_ocr.tool_eval(\n            name='name',\n            streaming=True,\n            file_names=['test'],\n            file_urls={'test':image_url}\n            )\n        res=next(result)\n        self.assertEqual(res['visible_scope'],'llm')\n        res=next(result)\n        self.assertEqual(res['visible_scope'],'user')\n        \n        result=self.qrcode_ocr.tool_eval(\n            name='name',\n            streaming=False,\n            file_names=['test'],\n            file_urls={'test':image_url},\n            locations = 'test'\n        )\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n        \n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_query_decomposition.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\n\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestQueryDecompositionComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.QueryDecomposition(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n\n    # def test_run_with_custom_params(self):\n    #     \"\"\"测试 run 方法使用自定义参数\"\"\"\n    #     query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n    #     msg = appbuilder.Message(query)\n    #     answer = self.node(msg, stream=True, temperature=0.5)\n    #     self.assertIsNotNone(answer)\n    #     # 检查 answer 是否符合预期\n\n    def test_run_with_invalid_params(self):\n        \"\"\"测试 run 方法使用无效参数\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(query)\n        with self.assertRaises((ValueError, TypeError)):\n            self.node(msg, invalid_param=\"invalid\")\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'name': 'query_decomposition',\n            'query': '吸塑包装盒在工业化生产和物流运输中分别有什么重要性？'\n        }\n        result = self.node.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'query_decomposition'\n            }\n            result = self.node.tool_eval(streaming=True, **params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_query_rewrite.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# !/usr/bin/env python3\n\n\nimport os\nimport unittest\nfrom typing import List, Tuple\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")  \nclass TestQueryRewriteComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        初始化查询重写组件的单元测试基类。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \"\"\"\n        # 设置环境变量和初始化TranslateComponent实例\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.QueryRewrite(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = ['我应该怎么办理护照？', '您可以查询官网或人工咨询', '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n        # 可以添加更多断言来检查 answer 的特定属性\n\n    def test_run_with_custom_params(self):\n        \"\"\"测试 run 方法使用自定义参数\"\"\"\n        query = ['我应该怎么办理护照？', '您可以查询官网或人工咨询', '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']\n        msg = appbuilder.Message(query)\n        type = \"仅用户查询\"\n        answer = self.node(msg, rewrite_type=type)\n        self.assertIsNotNone(answer)\n        # 检查 answer 是否符合预期\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\"\"\"\n        node = appbuilder.QueryRewrite(\"DeepSeek-V3.1\")\n        query = ['我应该怎么办理护照？', '您可以查询官网或人工咨询', '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']\n        msg = appbuilder.Message(query)\n        answer = node(msg, rewrite_type=\"带机器人回复\", stream=False, temperature=0.5)\n        self.assertIsNotNone(answer)\n        \n    def test_run_raise(self):\n        with self.assertRaises(ValueError):\n            self.node(message=None)\n\n        query = ['我应该怎么办理护照？', '您可以查询官网或人工咨询']\n        msg=appbuilder.Message(query)\n        with self.assertRaises(ValueError):\n            self.node(message=msg)\n           \n        test_str='test'*1500    \n        query = [test_str]\n        msg=appbuilder.Message(query)\n        with self.assertRaises(ValueError):\n            self.node(message=msg) \n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'name': 'query_rewrite',\n            'query': ['我应该怎么办理护照？', '您可以查询官网或人工咨询']\n        }\n        result = self.node.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'query_rewrite'\n            }\n            result = self.node.tool_eval(streaming=True, **params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_rag_baidu_search.py",
    "content": "import os\nimport unittest\nimport appbuilder\nimport json\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestRagBaiduSearch(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        return rag_with_baidu_search class\n        \"\"\"\n        # 设置环境变量和初始化TestMRCComponent实例\n        self.model_name = \"DeepSeek-V3.1\"\n        self.rag_with_baidu_search = appbuilder.RAGWithBaiduSearch(model=self.model_name)\n\n    def test_rag_with_baidu_search(self):\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        is_stream = False\n        instruction = \"你是问答助手，在回答问题前需要加上“很高兴为您解答：”\"\n        instruction = appbuilder.Message(instruction)\n        answer = self.rag_with_baidu_search(msg, reject=True, clarify=True, highlight=True,\n                                            friendly=True, cite=True, temperature=0.5, stream=is_stream,\n                                            instruction=instruction)\n        self.assertIsNotNone(answer)\n        if not is_stream:\n            self.assertIsNotNone(answer.content)\n            self.assertIsNotNone(answer.extra)\n        else:\n            for content, extra in zip(answer.content, answer.extra):\n                self.assertIsNotNone(content)\n                self.assertIsNotNone(extra)\n\n    def test_rag_with_baidu_search_with_none_inst(self):\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        is_stream = False\n        instruction = None\n        answer = self.rag_with_baidu_search(msg, reject=True, clarify=True, highlight=True,\n                                            friendly=True, cite=True, temperature=0.5, top_p=0.1, stream=is_stream,\n                                            instruction=instruction)\n        self.assertIsNotNone(answer)\n        if not is_stream:\n            self.assertIsNotNone(answer.content)\n            self.assertIsNotNone(answer.extra)\n        else:\n            for content, extra in zip(answer.content, answer.extra):\n                self.assertIsNotNone(content)\n                self.assertIsNotNone(extra)\n"
  },
  {
    "path": "python/tests/test_rag_baidu_search_pro.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n@time :    24.5.24  PM3:44\n@File:     test_rag_baidu_search_pro\n@Author :  baiyuchen\n@Version:  python3.8\n\"\"\"\nimport os\nimport unittest\nimport appbuilder\n\nfrom appbuilder.core._exception import AppBuilderServerException\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestRagBaiduSearch(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        return rag_with_baidu_search class\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.rag_with_baidu_search_pro = appbuilder.RagWithBaiduSearchPro(model=self.model_name)\n\n    def test_rag_with_baidu_search_pro_block(self):\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        is_stream = False\n        instruction = \"你是问答助手，在回答问题前需要加上“很高兴为您解答：”\"\n        instruction = appbuilder.Message(instruction)\n\n        answer = self.rag_with_baidu_search_pro(message=msg, stream=is_stream, instruction=instruction)\n\n        self.assertIsNotNone(answer)\n        self.assertIsNotNone(answer.content)\n        self.assertIsInstance(answer.content, str)\n        self.assertTrue(answer.content != \"\")\n\n        search_baidu = answer.extra.get(\"search_baidu\")\n        ref_content = search_baidu[0][\"content\"]\n        self.assertIsNotNone(ref_content)\n        self.assertIsInstance(ref_content, str)\n        self.assertTrue(ref_content != \"\")\n\n    def test_rag_with_baidu_search_pro_stream(self):\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        is_stream = True\n        instruction = \"你是问答助手，在回答问题前需要加上“很高兴为您解答：”\"\n        instruction = appbuilder.Message(instruction)\n\n        answer = self.rag_with_baidu_search_pro(message=msg, stream=is_stream, instruction=instruction)\n        self.assertIsNotNone(answer)\n\n        flag_content = False\n        flag_ref_content = False\n        for content in answer.content:\n            self.assertIsNotNone(content)\n            self.assertIsNotNone(answer.extra)\n\n            self.assertIsInstance(content, str)\n\n            if content != \"\":\n                flag_content = True\n\n            search_baidu = answer.extra.get(\"search_baidu\")\n            if search_baidu:\n                ref_content = search_baidu[0][\"content\"]\n                self.assertIsInstance(ref_content, str)\n                if ref_content != \"\":\n                    flag_ref_content = True\n\n        self.assertTrue(flag_content and flag_ref_content)\n\n\n    def test_rag_with_baidu_search_component_RAGWithBaiduSearch(self):\n        rwbs=appbuilder.RAGWithBaiduSearch(model='ERNIE-Bot 4.0')\n\n        # test_get_search_input\n        text='text'\n        res_text=rwbs._get_search_input(text)\n        self.assertEqual(res_text, 'text')\n        text='UTF-8是一种变长字节表示的Unicode字符集编码方式，它可以使用1到4个字节来表示一个字符。'\n        res_text=rwbs._get_search_input(text)\n        self.assertEqual(res_text, 'UTF-8是一种变长字节表示的Unicode字符集编码方式，它可')\n\n        # test run\n        message=appbuilder.Message()\n        message.content=\"\"\"\n        appbuilderappbuilderappbuilderappbuilderappbuilderappbuilderappbuilderappbuilder\n        appbuilderappbuilderappbuilderappbuilderappbuilderappbuilderappbuilderappbuilder\n        \"\"\"\n        with self.assertRaises(AppBuilderServerException):\n            rwbs.run(message=message)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_rerank.py",
    "content": "\"\"\"\ntest rerank\n\"\"\"\nimport os\nimport time\n\nimport unittest\n\nimport appbuilder\n\n\nclass TestReranker(unittest.TestCase):\n\n    def setUp(self):\n        self.reranker = appbuilder.Reranker()\n\n    def test_run(self):\n        ranked_1 = self.reranker(\"你好\", [\"他好\", \"hello?\"])\n        time.sleep(1)\n        ranked_2 = self.reranker(appbuilder.Message(\"你好\"), appbuilder.Message([\"他好\", \"hello?\"]))\n\n        self.assertEqual(ranked_1.content[0][\"relevance_score\"], ranked_2.content[0][\"relevance_score\"])\n        self.assertEqual(ranked_1.content[1][\"relevance_score\"], ranked_2.content[1][\"relevance_score\"])\n\n    def test_not_support_model(self):\n        try:\n            _ = appbuilder.Reranker(model=\"foo\")\n        except Exception as e:\n            from appbuilder.core._exception import ModelNotSupportedException\n            assert isinstance(e, ModelNotSupportedException)\n            msg = str(e)\n            assert \"Model foo not supported\" in msg\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_similar_question.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\nimport appbuilder\n\nclass TestSimilarQuestionComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.SimilarQuestion(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool_eval 方法使用有效参数\"\"\"\n        query = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n        result = self.node.tool_eval(name=\"similar_question\", streaming=True, query=query)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool_eval 方法使用无效参数\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.node.tool_eval(name=\"similar_question\", streaming=True)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_style_rewrite.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nimport unittest\nimport os\n\nfrom appbuilder.core.components.llms.style_rewrite.base import StyleChoices\nimport appbuilder\n\nclass TestStyleRewriteComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.StyleRewrite(model=self.model_name)\n        self.sc=StyleChoices.YINGXIAO\n\n    def test_to_chinese(self):\n        result=self.sc.to_chinese()\n        self.assertEqual(result,\"营销话术\")\n        \n    def test_run_with_custom_params(self):\n        \"\"\"测试 run 方法使用自定义参数\"\"\"\n        query = \"帮我写一篇关于人体工学椅的文案\"\n        msg = appbuilder.Message(query)\n        style = \"营销话术\"\n        answer = self.node(msg, style=style)\n        self.assertIsNotNone(answer)\n        # 检查 answer 是否符合预期\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool_eval 方法使用有效参数\"\"\"\n        query = \"帮我写一篇关于人体工学椅的文案\"\n        result = self.node.tool_eval(name=\"style_rewrite\", streaming=True, query=query)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool_eval 方法使用无效参数\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.node.tool_eval(name=\"style_rewrite\", streaming=True)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_style_writing.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nimport unittest\nimport os\nimport appbuilder\nimport time \n\nfrom appbuilder.core.components.llms.style_writing.component import StyleQueryChoices, LengthChoices\n\nclass TestStyleWritingComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = appbuilder.StyleWriting(model=self.model_name)\n        self.sqc=StyleQueryChoices.BILIBILI\n        self.lc=LengthChoices.SHORT\n\n    def test_to_chinese(self):\n        result=self.sqc.to_chinese()\n        self.assertEqual(result,\"B站\") \n        result=self.lc.to_chinese()\n        self.assertEqual(result,\"短\")  \n    \n    def test_run_with_custom_params(self):\n        \"\"\"测试 run 方法使用自定义参数\"\"\"\n        query = \"帮我写一篇关于人体工学椅的文案\"\n        msg = appbuilder.Message(query)\n        style = \"小红书\"\n        length = 100\n        answer = self.node(msg, style_query=style, length=length)\n        self.assertIsNotNone(answer)\n        # 检查 answer 是否符合预期\n\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool_eval 方法使用有效参数\"\"\"\n        query = \"帮我写一篇关于人体工学椅的文案\"\n        result = self.node.tool_eval(name=\"style_writing\", streaming=True, query=query)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        time.sleep(1)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool_eval 方法使用无效参数\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.node.tool_eval(name=\"style_writing\", streaming=True)\n            next(result)\n            \n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_table_ocr.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport requests\nimport appbuilder\nimport os\n\nfrom appbuilder.core._exception import InvalidRequestArgumentError \n\nclass TestTableOCR(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \"\"\"\n        self.table_ocr = appbuilder.TableOCR()\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024\" \\\n                    \"-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\" \\\n                    \"064079145ff4698856f477b820147768fc2187d3\"\n\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        # Table ocr\n        output = self.table_ocr.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_url(self):\n        \"\"\"\n        使用图片 URL 进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024\" \\\n                    \"-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\" \\\n                    \"064079145ff4698856f477b820147768fc2187d3\"\n\n        # Create message with image URL\n        message = appbuilder.Message(content={\"url\": image_url})\n        # Table ocr\n        output = self.table_ocr.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_timeout_and_retry(self):\n        \"\"\"\n        测试run方法，timeout、retry参数\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024\" \\\n                    \"-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\" \\\n                    \"064079145ff4698856f477b820147768fc2187d3\"\n        raw_image = requests.get(image_url).content\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        #  TableOCR with timeout and retry parameters\n        output = self.table_ocr.run(message, timeout=5.0, retry=3)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_invalid_input(self):\n        \"\"\"\n        测试run函数在传入无效输入的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = appbuilder.Message(content={})\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.table_ocr.run(message)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message(content={\"url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.table_ocr.run(message)\n            \n    def test_tool_eval(self):\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024\" \\\n                    \"-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\" \\\n                    \"064079145ff4698856f477b820147768fc2187d3\"\n        result=self.table_ocr.tool_eval(name='name',streaming=False,files=['test'])\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n        result=self.table_ocr.tool_eval(\n            name='name',\n            streaming=True,\n            file_names=['test'],\n            file_urls={'test':image_url}\n            )\n        res=next(result)\n        self.assertEqual(res['visible_scope'],'llm')\n        res=next(result)\n        self.assertEqual(res['visible_scope'],'user')\n        \n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_tag_extraction.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.import unittest import os\n\nimport appbuilder\nimport os\nimport unittest\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestTagExtractionComponent(unittest.TestCase): \n    def setUp(self): \n        \"\"\" 设置环境变量。\n        Args:\n                无参数，默认值为空。\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.tag_extraction = appbuilder.TagExtraction(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"本实用新型公开了一种可利用热能的太阳能光伏光热一体化组件，包括太阳能电池，还包括有吸热板，太阳能电池粘附在吸热板顶面，吸热板内嵌入有热电材料制成的内芯，吸热板底面设置有蛇形管。本实用新型结构紧凑，安装方便，能充分利用太阳能电池散发的热能，具有较高的热能利用率。\"\n        msg = appbuilder.Message(query)\n        answer = self.tag_extraction(msg)\n        print(answer)\n        self.assertIsNotNone(answer)\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\"\"\"\n        msg = appbuilder.Message(\"本实用新型公开了一种可利用热能的太阳能光伏光热一体化组件，包括太阳能电池，还包括有吸热板，太阳能电池粘附在吸热板顶面，吸热板内嵌入有热电材料制成的内芯，吸热板底面设置有蛇形管。本实用新型结构紧凑，安装方便，能充分利用太阳能电池散发的热能，具有较高的热能利用率。\")\n        answer = self.tag_extraction(msg, stream=False, temperature=0.5)\n        self.assertIsNotNone(answer)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'name': 'tag_extraction',\n            'query': '本实用新型公开了一种可利用热能的太阳能光伏光热一体化组件，包括太阳能电池，还包括有吸热板，太阳能电池粘附在吸热板顶面，吸热板内嵌入有热电材料制成的内芯，吸热板底面设置有蛇形管。本实用新型结构紧凑，安装方便，能充分利用太阳能电池散发的热能，具有较高的热能利用率。'\n        }\n        result = self.tag_extraction.tool_eval(streaming=True, **params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.tag_extraction.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n    \n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'name': 'tag_extraction'\n            }\n            result = self.tag_extraction.tool_eval(streaming=True, **params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_text_to_image.py",
    "content": "import unittest\nimport os\nimport appbuilder\nfrom appbuilder.core.components.text_to_image.model import (Text2ImageSubmitRequest, Text2ImageSubmitResponse,\n                                                            Text2ImageQueryRequest, Text2ImageQueryResponse, SubTaskResult)\n\nfrom appbuilder.core._exception import RiskInputException \n\n@unittest.skip(\"偶现报错暂时跳过\")\nclass TestText2ImageComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            None\n\n        Returns:\n            None.\n        \"\"\"\n        self.text2Image = appbuilder.Text2Image()\n        \n    def test_run(self):\n        \"\"\"\n        使用原始文本进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        inp = appbuilder.Message(content={\"prompt\": \"上海的经典风景\"})\n        out = self.text2Image.run(inp)\n        print(out)\n        self.assertIsNotNone(out)\n        self.assertIsInstance(out, appbuilder.Message)\n\n    def test_submitText2ImageTask(self):\n        \"\"\"\n        submitText2ImageTask方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        request = Text2ImageSubmitRequest()\n        request.prompt = \"上海的经典风景\"\n        request.width = 1024\n        request.height = 1024\n        request.image_num = 1\n        response = self.text2Image.submitText2ImageTask(request)\n        self.assertIsNotNone(response)\n        self.assertIsInstance(response, Text2ImageSubmitResponse)\n\n    def test_queryText2ImageData(self):\n        \"\"\"\n        queryText2ImageData方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        request = Text2ImageQueryRequest(\n            task_id = \"123456\",\n        )\n        response = self.text2Image.queryText2ImageData(request)\n        self.assertIsNotNone(response)\n        self.assertIsInstance(response, Text2ImageQueryResponse)\n\n    def test_extract_img_urls(self):\n        \"\"\"\n        extract_img_urls方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        response = Text2ImageQueryResponse()\n        response.data.task_progress = 1.0\n        response.data.task_progress_detail = 0.5\n        response.data.sub_task_result_list = [SubTaskResult(**{'sub_task_progress_detail':0.8, 'final_image_list': [{'img_url': 'http://example.com'}]})]\n        img_urls = self.text2Image.extract_img_urls(response)\n        self.assertEqual(img_urls, ['http://example.com'])\n\n    def test_check_service_error(self):\n        \"\"\"\n        check_service_error方法单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        data = {\"error_code\": \"ERROR\", \"error_msg\": \"Error message\"}\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.text2Image.check_service_error(\"\", data)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_trace.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestTrace(unittest.TestCase):\n    def test_trace(self):\n        from appbuilder.utils.trace._function import _client_tool_trace_output_deep_iterate\n        try:\n            test_dict = {\n                \"a\": 1,\n                \"b\": [2],\n                \"c\": {3: \"4\"},\n            }\n            _client_tool_trace_output_deep_iterate(output=test_dict, span=None)\n        except:\n            print(\"test_trace测试span添加dict类型\")\n\n        \n\nif __name__ == \"__main__\":\n    unittest.main()"
  },
  {
    "path": "python/tests/test_trace_skip_raise_error.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\n\nfrom appbuilder.utils.trace.tracer_wrapper import (\nsession_post, \nclient_run_trace, \nclient_tool_trace,\nassistent_tool_trace,\nassistant_run_trace,\nassistent_stream_run_trace,\nassistent_stream_run_with_handler_trace,\ncomponents_run_trace,\ncomponents_run_stream_trace, \nlist_trace, \n)\n\nclass TestException(Exception):\n    def __init__(self):\n        pass\n\n@session_post\ndef mock_post_01():\n    raise Exception(\"mock exception\")\n\n@session_post\ndef mock_post_02():\n    raise TestException()\n\n@client_run_trace\ndef mock_client_run_trace_01():\n    raise Exception(\"mock exception\")\n\n@client_run_trace\ndef mock_client_run_trace_02():\n    raise TestException()\n\n@client_tool_trace\ndef mock_client_tool_trace_01():\n    raise Exception(\"mock exception\")\n\n@client_tool_trace\ndef mock_client_tool_trace_02():\n    raise TestException()\n\n@assistent_tool_trace\ndef mock_assistent_tool_trace_01():\n    raise Exception(\"mock exception\")\n\n@assistent_tool_trace\ndef mock_assistent_tool_trace_02():\n    raise TestException()\n\n@assistant_run_trace\ndef mock_assistant_run_trace_01():\n    raise Exception(\"mock exception\")\n\n@assistant_run_trace\ndef mock_assistant_run_trace_02():\n    raise TestException()\n\n@assistent_stream_run_trace\ndef mock_assistent_stream_run_trace_01():\n    raise Exception(\"mock exception\")\n\n@assistent_stream_run_trace\ndef mock_assistent_stream_run_trace_02():\n    raise TestException()\n\n@assistent_stream_run_with_handler_trace\ndef mock_assistent_stream_run_with_handler_trace_01():\n    raise Exception(\"mock exception\")\n\n@assistent_stream_run_with_handler_trace\ndef mock_assistent_stream_run_with_handler_trace_02():\n    raise TestException()\n\n@components_run_trace\ndef mock_components_run_trace_01():\n    raise Exception(\"mock exception\")\n\n@components_run_trace\ndef mock_components_run_trace_02():\n    raise TestException()\n\n@components_run_stream_trace\ndef mock_components_run_stream_trace_01():\n    raise Exception(\"mock exception\")\n\n@components_run_stream_trace\ndef mock_components_run_stream_trace_02():\n    raise TestException()\n\n@list_trace\ndef mock_list_trace_01():\n    raise Exception(\"mock exception\")\n\n@list_trace\ndef mock_list_trace_02():\n    raise TestException()\n\nclass TestTraceSkipRaiseError(unittest.TestCase):\n    def setUp(self):\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"True\"\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"true\"\n\n    def tearDown(self):\n        del os.environ[\"APPBUILDER_TRACE_DEBUG\"]\n        del os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"]\n\n    def test_session_post(self):\n        # test_session_post APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_post_01()\n        # test_session_post APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_post_01()\n        with self.assertRaises(TestException):\n            mock_post_02()\n\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_post_02()\n\n    def test_client_run_trace(self):\n        # test_client_run_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_client_run_trace_01()\n        # test_client_run_trace APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_client_run_trace_01()\n        with self.assertRaises(TestException):\n            mock_client_run_trace_02()\n\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_client_run_trace_02()\n\n    def test_client_tool_trace(self):\n        # test_client_tool_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_client_tool_trace_01()\n        # test_client\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_client_tool_trace_01()\n        with self.assertRaises(TestException):\n            mock_client_tool_trace_02()\n\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_client_tool_trace_02()\n\n    def test_assistent_tool_trace(self):\n        # test_assistent_tool_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_assistent_tool_trace_01()\n        # test_assistent_tool_trace APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_assistent_tool_trace_01()\n        with self.assertRaises(TestException):\n            mock_assistent_tool_trace_02()\n\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_assistent_tool_trace_02()\n\n    def test_assistant_run_trace(self):\n        # test_assistant_run_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_assistant_run_trace_01()\n        # test_assistant_run_trace APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_assistant_run_trace_01()\n        with self.assertRaises(TestException):\n            mock_assistant_run_trace_02()\n        \n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_assistant_run_trace_02()\n\n    def test_assistent_stream_run_trace(self):\n        # test_assistent_stream_run_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_assistent_stream_run_trace_01()\n        # test_assistent_stream_run_trace APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_assistent_stream_run_trace_01()\n        with self.assertRaises(TestException):\n            mock_assistent_stream_run_trace_02()\n        \n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_assistent_stream_run_trace_02()\n\n    def test_assistent_stream_run_with_handler_trace(self):\n        # test_assistent_stream_run_with_handler_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_assistent_stream_run_with_handler_trace_01()\n        # test_assistent_stream_run_with_handler_trace APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_assistent_stream_run_with_handler_trace_01()\n        with self.assertRaises(TestException):\n            mock_assistent_stream_run_with_handler_trace_02()\n\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_assistent_stream_run_with_handler_trace_02()\n\n    def test_components_run_trace(self):\n        # test_components_run_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_components_run_trace_01()\n        # test_components_run_trace APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_components_run_trace_01()\n        with self.assertRaises(TestException):\n            mock_components_run_trace_02()\n\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_components_run_trace_02()\n    \n    def test_components_run_stream_trace(self):\n        # test_components_run_stream_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_components_run_stream_trace_01()\n        # test_components_run_stream_trace APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_components_run_stream_trace_01()\n        with self.assertRaises(TestException):\n            mock_components_run_stream_trace_02()\n\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_components_run_stream_trace_02()\n\n    def test_list_trace(self):\n        # test_list_trace APPBUILDER_TRACE_DEBUG = true\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"true\"\n        with self.assertRaises(Exception):\n            mock_list_trace_01()\n        # test_list_trace APPBUILDER_TRACE_DEBUG = false\n        os.environ[\"APPBUILDER_TRACE_DEBUG\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_list_trace_01()\n        with self.assertRaises(TestException):\n            mock_list_trace_02()\n\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"false\"\n        with self.assertRaises(Exception):\n            mock_list_trace_02()\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_translate.py",
    "content": "import unittest\nimport appbuilder\nfrom appbuilder.core._exception import InvalidRequestArgumentError\nimport os\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestTranslationComponent(unittest.TestCase):\n    def setUp(self):\n        self.translation = appbuilder.Translation()\n\n    def test_run_valid_request(self):\n        \"\"\"测试 run 方法对有效请求的处理。\"\"\"\n        msg = appbuilder.Message(content=\"你好\")\n        result = self.translation(msg)\n        self.assertEqual(result.content['from_lang'], 'zh')\n        self.assertEqual(result.content['to_lang'], 'en')\n\n    def test_run_invalid_request(self):\n        \"\"\"测试 run 方法对无效请求的处理。\"\"\"\n        msg = appbuilder.Message(content=\"\")\n        with self.assertRaises(ValueError):\n            _ = self.translation(msg)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        result = self.translation.tool_eval(name=\"translation\", streaming=True, q=\"你好\\n中国\", to_lang=\"en\")\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(InvalidRequestArgumentError):\n            result = self.translation.tool_eval(name=\"translation\", streaming=True, to_lang=\"en\")\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_treemind.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nfrom appbuilder.core.message import Message\nfrom appbuilder import TreeMind\n\n@unittest.skip(\"测试API超限，暂时跳过\")\nclass TestTreeMindComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n            初始化测试用例，设置环境变量和网关URL。\n        如果没有设置CAR_EXPERT_TOKEN环境变量，则使用空字符串。\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        self.tm = TreeMind()\n        self.query = \"生成一份年度总结的思维导图\"\n\n    def test_treemind_component_tool_eval(self):\n        \"\"\"测试tool_eval方法的返回值是否正确\n        \"\"\"\n        import time\n        time.sleep(1)\n        result = self.tm.tool_eval(query=self.query)\n        self.assertIsNotNone(result)\n        for r in result:\n            print(r)\n            self.assertIsNotNone(r)\n            self.assertIn(r[\"type\"],[\"text\", \"urls\"])\n\n    def test_treemind_component_run(self):\n        \"\"\"测试run函数的返回值是否正确\n        \"\"\"\n        msg = Message(content=self.query)\n        result = self.tm.run(msg)\n        print(result)\n        self.assertIsNotNone(result)\n        self.assertIsInstance(result, Message)\n\n    def test_run_with_invalid_input(self):\n        \"\"\"测试run函数在传入无效输入的情况下的行为。\n        \"\"\"\n        message = Message(content={})\n        with self.assertRaises(ValueError):\n            self.tm.run(message)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法传入无效输入的情况下的行为\"\"\"\n        with self.assertRaises(TypeError):\n            result = self.tm.tool_eval(name=\"treemind\", streaming=True, origin_query=\"\")\n            next(result)\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_tts.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport appbuilder\nfrom appbuilder.core._exception import InvalidRequestArgumentError\nimport os\n\n@unittest.skip(\"测试API超限，暂时跳过\")\nclass TestTTS(unittest.TestCase):\n    def setUp(self):\n        self.tts = appbuilder.TTS()\n        self.text_message = appbuilder.Message(content={\"text\": \"\"\"随着科技的迅速发展\"\"\"})\n\n    def test_model_validation(self):\n        with self.assertRaises(InvalidRequestArgumentError):\n            self.tts.run(self.text_message, model=\"invalid_model\")\n\n    def test_text_validation(self):\n        empty_message = appbuilder.Message(content={})\n        with self.assertRaises(BaseException):\n            self.tts.run(empty_message)\n\n    def test_audio_type_validation_baidu_tts(self):\n        with self.assertRaises(InvalidRequestArgumentError):\n            self.tts.run(self.text_message, model=\"baidu-tts\", audio_type=\"flac\")\n\n    def test_audio_type_validation_paddlespeech_tts(self):\n        with self.assertRaises(InvalidRequestArgumentError):\n            self.tts.run(self.text_message, model=\"paddlespeech-tts\", audio_type=\"mp3\")\n\n    def test_run_baidu_tts(self):\n        out = self.tts.run(self.text_message, model=\"baidu-tts\", audio_type=\"wav\")\n        self.assertTrue(\"audio_binary\" in out.content and \"audio_type\" in out.content)\n\n    def test_run_paddlespeech_tts(self):\n        out = self.tts.run(self.text_message, model=\"paddlespeech-tts\", audio_type=\"wav\")\n        self.assertTrue(\"audio_binary\" in out.content and \"audio_type\" in out.content)\n\n    def test_run_paddlespeech_tts_stream(self):\n        out = self.tts.run(self.text_message, model=\"paddlespeech-tts\", audio_type=\"pcm\", stream=True)\n        for o in out:\n            self.assertIsNotNone(o)\n\n    def test_run_error_model_tts_stream(self):\n        with self.assertRaises(InvalidRequestArgumentError):\n            self.tts.run(self.text_message, model=\"baidu-tts\", audio_type=\"pcm\", stream=True)\n\n    def test_run_paddlespeech_validation_tts_stream(self):\n        with self.assertRaises(InvalidRequestArgumentError):\n            self.tts.run(self.text_message, model=\"paddlespeech-tts\", audio_type=\"mp3\", stream=True)\n            \n    def test_run_raise_text_field_empty(self):\n        message=appbuilder.Message(content={\"text\": \"\"})\n        with self.assertRaises(InvalidRequestArgumentError):\n            self.tts.run(message)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_utils.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport asyncio\n\nfrom unittest.mock import MagicMock\nfrom appbuilder.utils.sse_util import SSEClient,AsyncSSEClient, Event\nfrom appbuilder.utils.model_util import RemoteModel,Models\nfrom appbuilder.utils.logger_util import LoggerWithLoggerId,_setup_logging,logger\nfrom threading import current_thread \n\n# 创建一个logger类\nclass test_logger_level():\n    def __init__(self):\n        self.level='level'\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestUtils(unittest.TestCase):\n    def test_sse_util_SSEClient(self):\n        mock_event_source = MagicMock()\n        mock_event_source.__iter__.return_value = iter([\n            b'data: Test event 1\\n\\n',\n            b'data: Last incomplete event'\n        ])\n        sse_client = SSEClient(event_source=mock_event_source)\n        event_generator = sse_client._read()\n        self.assertEqual(next(event_generator), b'data: Test event 1\\n\\n')\n        self.assertEqual(next(event_generator), b'data: Last incomplete event')\n        # 测试是否抛出 StopIteration 异常，表示没有更多事件\n        with self.assertRaises(StopIteration):\n            next(event_generator)\n\n        # test_events\n        mock_event_source.__iter__.return_value = iter([\n            b': Test event 1\\n\\n',\n            b'test: Test event 2\\n\\n',\n            b'data:Testevent3\\n\\n',\n            b'data\\n\\n',\n            b'event:Testevent5\\n\\n',\n        ])\n        sse_client = SSEClient(event_source=mock_event_source)\n        for event in sse_client.events():\n            pass\n\n        # test_close\n        sse_client.close()\n    \n    def test_sse_util_AsyncSSEClient(self):\n        async def mock_client():\n            mock_event_source = MagicMock()\n            mock_event_source.__iter__.return_value = iter([\n                b'data: Test event 1\\n\\n',\n                b'data: Last incomplete event'\n            ])\n            sse_client = AsyncSSEClient(mock_event_source)\n            event_generator = sse_client._read()\n            async for data in event_generator:\n                pass\n\n            # test_events\n            mock_event_source.__aiter__.return_value = iter([\n                b': Test event 1\\n\\n',\n                b'test: Test event 2\\n\\n',\n                b'data:Testevent3\\n\\n',\n                b'data\\n\\n',\n                b'event:Testevent5\\n\\n',\n            ])\n            sse_client = AsyncSSEClient(mock_event_source)\n            async for event in sse_client.events():\n                pass\n\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(mock_client())\n\n    def test_sse_util_SSEClient_DEBUG(self):\n        logger.setLoglevel(\"DEBUG\")\n        mock_event_source = MagicMock()\n        mock_event_source.__iter__.return_value = iter(\n            [b\"data: Test event 1\\n\\n\", b\"data: Last incomplete event\"]\n        )\n        sse_client = SSEClient(event_source=mock_event_source)\n        event_generator = sse_client._read()\n        self.assertEqual(next(event_generator), b\"data: Test event 1\\n\\n\")\n        self.assertEqual(next(event_generator), b\"data: Last incomplete event\")\n        # 测试是否抛出 StopIteration 异常，表示没有更多事件\n        with self.assertRaises(StopIteration):\n            next(event_generator)\n\n        # test_events\n        mock_event_source.__iter__.return_value = iter(\n            [\n                b\": Test event 1\\n\\n\",\n                b\"test: Test event 2\\n\\n\",\n                b\"data:Testevent3\\n\\n\",\n                b\"data\\n\\n\",\n                b\"event:Testevent5\\n\\n\",\n            ]\n        )\n        sse_client = SSEClient(event_source=mock_event_source)\n        for event in sse_client.events():\n            pass\n\n        # test_close\n        sse_client.close()\n\n    def test_sse_util_Event(self):\n        # test_str_\n        event_str=str(Event(id='id',retry=10))\n        assert event_str.startswith('message')\n\n    def test_model_util_RemoteModel(self):\n        # test_get_remote_name_by_short_name\n        rm=RemoteModel(remote_name='test_remote')\n        rm.get_remote_name_by_short_name(short_name=\"eb-turbo-appbuilder\")\n\n    def test_model_util_Models(self):\n        # test_list\n        models=Models()\n        models.list(retry=-1)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_utils_collector.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\n\nfrom collections import OrderedDict\nfrom appbuilder.utils.collector import Collector\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestCollector(unittest.TestCase):\n    def test_del_collection(self):\n        collector = Collector()\n\n        # test del_collection with not name\n        collector.del_collection(\"test\")\n\n        # test del_collection with name\n        collector.add_to_collection(\"test\", 1)\n        collector.del_collection(\"test\")\n\n    def test_other_collection(self):\n        collector = Collector()\n        # test if collection is None and index_key is None\n        result=collector.get_collection(\"test\")\n        self.assertEqual(result, [])\n\n        # test if index_key is not None\n        collector.add_to_collection(\"test\", 1,'test-key')\n        result=collector.get_collection(name=\"test\", index_key='test-key')\n        self.assertEqual(result, 1)\n\n        # test if index_key is None and collection is not None\n        collector.add_to_collection(\"test01\", 1)\n        result=collector.get_collection(name=\"test01\", index_key='test-key')\n        self.assertEqual(result,None)\n\n        # get_collection_as_dict\n        result=collector.get_collection_as_dict(\"test\")\n        self.assertEqual(type(result), OrderedDict)\n        result=collector.get_collection_as_dict(\"test\", reverse=True)\n        self.assertEqual(type(result), OrderedDict)\n        result=collector.get_collection_as_dict(\"test02\")\n        self.assertEqual(type(result), OrderedDict)\n\n        # get_all_collection_keys\n        collector.get_all_collection_keys()\n        \n        # test clear_collection 清空collection\n        collector.clear_collection(\"test\")\n        collector.clear_collection(\"test01\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n\n"
  },
  {
    "path": "python/tests/test_utils_logger.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport logging\nimport unittest\n\nfrom appbuilder.utils.logger_util import LoggerWithLoggerId,_setup_logging\nfrom threading import current_thread \n\n# 创建一个logger类\nclass test_logger_level():\n    def __init__(self):\n        self.level='level'\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestUtilsLogger(unittest.TestCase):\n    def test_logger_util_LoggerWithLoggerId(self):\n        # test_get_logid\n        lwl=LoggerWithLoggerId(logger='test_logger',extra={'logid':'test_logid'},loglevel='INFO')\n        self.assertEqual(lwl.get_logid(),None)\n        lwl.logid_dict[current_thread().ident]='ident'\n        self.assertEqual(lwl.get_logid(),'ident')\n\n        # test_process\n        kwargs={\n            'extra':{'logid':'test_logid'}\n        }\n        msg,kwargs=lwl.process(msg='test_msg',kwargs=kwargs)\n        self.assertEqual(kwargs['extra']['logid'],lwl.logid_dict[current_thread().ident])\n        msg,kwargs=lwl.process(msg='test_msg',kwargs={})\n        self.assertEqual(kwargs['extra']['logid'],lwl.logid_dict[current_thread().ident])\n\n        # test_level\n        test_logger=test_logger_level()\n        lwl.logger=test_logger\n        self.assertEqual(lwl.level,'level')\n\n    def test_setup_logging(self):\n        # test_setup_logging\n        os.environ[\"APPBUILDER_LOGFILE\"] = \"/tmp/appbuilder.log\"\n        _setup_logging()\n        os.environ[\"APPBUILDER_LOGLEVEL\"]=\"test\" \n        with self.assertRaises(ValueError):\n            _setup_logging()\n\n    def test_set_filename_and_loglevel(self):\n        # test_set_filename\n        lwl=LoggerWithLoggerId(logger='test_logger',extra={'logid':'test_logid'},loglevel='INFO')\n        lwl.setLoglevel(\"debug\")\n        lwl.setFilename(\"/tmp/appbuilder.log\")\n        with self.assertRaises(ValueError):\n            lwl.setLoglevel(\"test\")\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_utils_logging_util.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport os\n\nfrom appbuilder.utils.logger_util import LoggerWithLoggerId,LOGGING_CONFIG\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestTestUtilsLoggingUtil(unittest.TestCase):\n    def setUp(self):\n        self.logger = LoggerWithLoggerId(LOGGING_CONFIG[\"loggers\"][\"appbuilder\"], {}, 'DEBUG')\n\n    def test_set_auto_logid(self):\n        self.logger.set_auto_logid()\n    \n    def test_set_logid(self):\n        self.logger.set_logid('test')\n        \n    def test_get_logid(self):\n        self.logger.set_auto_logid()\n    \n    # def test_level(self):\n    #     level=self.logger.level()\n    \n    def test_process(self):\n        msg,kwargs=self.logger.process(msg='test',kwargs={})\n        msg,kwargs=self.logger.process(msg='test',kwargs={'extra':{'logid':'test'}})\n        \n\n\nif __name__ == '__main__':\n    unittest.main()\n        \n        \n        "
  },
  {
    "path": "python/tests/test_v2_animal_recognize.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport requests\nimport appbuilder\nfrom appbuilder.core.components.v2 import AnimalRecognition\nimport os\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestAnimalRecognition(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \"\"\"\n        self.animal_recognition = AnimalRecognition()\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        # Recognize animal\n        output = self.animal_recognition.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n        self.assertIsInstance(output, appbuilder.Message)\n        self.assertIsInstance(output.content[\"result\"], list)\n        self.assertIsInstance(output.content[\"result\"][0][\"name\"], str)\n        \n\n    def test_run_with_url(self):\n        \"\"\"\n        使用图片 URL 进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n        # Create message with image URL\n        message = appbuilder.Message(content={\"url\": image_url})\n        # Recognize animal\n        output = self.animal_recognition.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n        self.assertIsInstance(output, appbuilder.Message)\n\n    def test_run_with_timeout_and_retry(self):\n        \"\"\"\n        测试run方法，timeout、retry参数\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"url\": image_url, \"raw_image\": raw_image})\n        # Recognize animal with timeout and retry parameters\n        output = self.animal_recognition.run(message, timeout=5.0, retry=3)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_invalid_input(self):\n        \"\"\"\n        测试run函数在传入无效输入的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = appbuilder.Message(content={})\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.animal_recognition.run(message)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message(content={\"url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.animal_recognition.run(message)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                    \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                    \"62cf937c03f8c5260d51c6ae\"\n        img_name = \"test_img.jpg\"\n        file_urls = {img_name: img_url}\n        result = self.animal_recognition.tool_eval(img_name=img_name, img_url=img_url, file_urls=file_urls)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.animal_recognition.tool_eval(name=\"animal_recognition\", streaming=True,\n                                                       origin_query=\"\")\n            next(result)\n\n    def test_tool_eval_raise_exception(self):\n        \"\"\"测试 tool 方法对异常情况的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.animal_recognition.tool_eval()\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_asr.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core.component import ComponentOutput\nfrom appbuilder.core._exception import InvalidRequestArgumentError\nfrom appbuilder.core.components.v2 import ASR\nfrom appbuilder.core.components.v2.asr.component import _convert as convert\n\n@unittest.skip(\"测试API超限，暂时跳过\")\nclass TestASR(unittest.TestCase):\n    def setUp(self):\n        self.audio_file_url = \"https://bj.bcebos.com/v1/appbuilder/asr_test.pcm?authorization=bce-auth-v1\" \\\n                              \"%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-11T10%3A56%3A41Z%2F-1%2Fhost\" \\\n                              \"%2Fa6c4d2ca8a3f0259f4cae8ae3fa98a9f75afde1a063eaec04847c99ab7d1e411\"\n        self.com = ASR()\n\n    def test_asr_run(self):\n        raw_audio = requests.get(self.audio_file_url).content\n        inp = appbuilder.Message(content={\"raw_audio\": raw_audio})\n        out = self.com.run(inp)\n        self.assertIsNotNone(out)\n        print(out)\n\n    def test_asr_tool_eval(self):\n        result = self.com.tool_eval(file_url=self.audio_file_url)\n        for res in result:\n            self.assertIsInstance(res, ComponentOutput)\n            print(res)\n\n    def test_asr_tool_eval_error(self):\n        result = self.com.tool_eval()\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n\n        result = self.com.tool_eval(file_name='test_path')\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n\n    def test_convert_with_mp3(self):\n        file_type = [\"mp3\", \"wav\", \"pcm\", \"m4a\"]\n        for type in file_type:\n            with self.assertRaises(FileNotFoundError):\n                path = os.path.join(os.path.dirname(__file__), \"test_audio\")\n                path += \".{}\".format(type)\n                convert(path, type)\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_v2_component_trace.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nfrom appbuilder.core.components.v2 import StyleRewrite\nfrom appbuilder.core.component import ComponentOutput\nfrom appbuilder import AppBuilderTracer\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestStyleRewrite(unittest.TestCase):\n    def setUp(self) -> None:\n        self.com = StyleRewrite(model=\"DeepSeek-V3.1\")\n        self.tracer = AppBuilderTracer(\n            enable_phoenix = False,\n            enable_console = True\n        )\n\n    def test_non_stream_tool_eval(self):\n        self.tracer.start_trace()\n        text = \"成都是个包容的城市\"\n        style = \"直播话术\"\n        out = self.com.non_stream_tool_eval(query=text, style=style)\n        print(out)\n        self.assertIsInstance(out, ComponentOutput)\n        self.tracer.end_trace()\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_v2_dialog_summary.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.components.v2 import DialogSummary\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestDialogSummary(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = DialogSummary(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        dialog_text = \"用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见\"\n        msg = appbuilder.Message(dialog_text)\n        summary = self.node(msg)\n        self.assertIsNotNone(summary)\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\"\"\"\n        dialog_text = \"用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见\"\n        msg = appbuilder.Message(dialog_text)\n        summary = self.node(msg, stream=False, temperature=0.5)\n        self.assertIsNotNone(summary)\n\n    def test_run_with_model_names(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\"\"\"\n\n        chats = appbuilder.get_model_list(api_type_filter=[\"chat\"])\n        self.assertTrue(\"DeepSeek-V3.1\" in chats)\n\n        DialogSummary(model=\"DeepSeek-V3.1\")\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'query': '用户:喂我想查一下我的话费\\n坐席:好的女士您话费余的话还有87.49元钱\\n用户:好的知道了谢谢\\n坐席:嗯不客气祝您生活愉快再见'\n        }\n        result = self.node.tool_eval(**params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(**params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'query': None\n            }\n            result = self.node.tool_eval(**params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_general_ocr.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport requests\nimport base64\nimport unittest\nimport appbuilder\nfrom appbuilder.core.components.v2 import GeneralOCR\nfrom appbuilder.core.component import ComponentOutput\nfrom appbuilder.core._exception import InvalidRequestArgumentError\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestGeneralOCR(unittest.TestCase):\n    def setUp(self) -> None:\n        self.com = GeneralOCR()\n\n    def test_run(self):\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\" \\\n                    \"857a27513734d765495f89ffa5f73\"\n        raw_image = requests.get(img_url).content\n        image_base64 = base64.b64encode(raw_image)\n        message = appbuilder.Message(content={\"image_base64\": image_base64})\n        output = self.com.run(message)\n        print(output)\n\n    def test_tool_eval(self):\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/general_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                    \"11T10%3A59%3A17Z%2F-1%2Fhost%2F081bf7bcccbda5207c82a4de074628b04ae\" \\\n                    \"857a27513734d765495f89ffa5f73\"\n        img_names = [\"general_ocr_test.png\", \"test\"]\n        img_urls = [\n                   \"https://agi-dev-platform-file.bj.bcebos.com/files_qa/10b495b5ceea44e5a1e7d194f3a59ed7/uploads/file-6cxezmhc_1.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-08-04T03%3A27%3A03Z%2F259200%2Fhost%2Ff420874be9fe2511a73eab458339aad110d97c55742b14fb4fabf78cc0e1d4cc\",\n                   \"https://agi-dev-platform-file.bj.bcebos.com/files_qa/10b495b5ceea44e5a1e7d194f3a59ed7/uploads/file-wjka6g3h_%E5%BC%80%E6%88%B7%E8%AE%B8%E5%8F%AF%E8%AF%81.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-08-04T03%3A28%3A23Z%2F259200%2Fhost%2F2e3355869d9f62143051a12c2b19bc39b33d439e18839fe6dd15d0f37ab3a999\"]\n        pdf_urls = [\"https://agi-dev-platform-file.bj.bcebos.com/files_qa/10b495b5ceea44e5a1e7d194f3a59ed7/uploads/file-hf7nhtdw_8_%E8%B4%A8%E9%87%8F%E6%B5%81%E9%87%8F%E8%AE%A1-1.pdf?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-08-04T03%3A22%3A29Z%2F259200%2Fhost%2Fd1e301ba51cbe39fbbe10a334c5e4f75d71b40522916e25205e83404b6cea791\"]\n        result = self.com.tool_eval(img_names=img_names, img_urls=img_urls, pdf_urls=pdf_urls, _sys_file_urls={'general_ocr_test.png': img_url})\n        for res in result:\n            assert isinstance(res, ComponentOutput)\n            print(res.content)\n\n    def test_error_tool_eval(self):\n        result = self.com.tool_eval(img_url='', img_name='')\n        with self.assertRaises(InvalidRequestArgumentError):\n            list(result)\n\n        result = self.com.tool_eval(img_url='', img_name='test.jpg')\n        with self.assertRaises(InvalidRequestArgumentError):\n            list(result)\n\n    def test_run_pdf_base64(self):\n        pdf_url = \"https://bj.bcebos.com/agi-dev-platform-sdk-test/8、质量流量计.pdf\"\n        raw_pdf = requests.get(pdf_url).content\n        pdf_base64 = base64.b64encode(raw_pdf)\n        general_ocr = GeneralOCR()\n        out = general_ocr.run(appbuilder.Message(content={\"pdf_base64\": pdf_base64, \"pdf_file_num\": \"3\"}))\n        self.assertIsInstance(out, appbuilder.Message)\n\n    def test_run_pdf_url(self):\n        pdf_url = \"https://bj.bcebos.com/agi-dev-platform-sdk-test/8、质量流量计.pdf\"\n        general_ocr = GeneralOCR()\n        out = general_ocr.run(appbuilder.Message(content={\"pdf_url\": pdf_url, \"pdf_file_num\": \"5\"}))\n        self.assertIsInstance(out, appbuilder.Message)\n\n    def test_tool_eval_pdf_url(self):\n        pdf_url = \"https://bj.bcebos.com/agi-dev-platform-sdk-test/8、质量流量计.pdf\"\n        result = self.com.tool_eval(pdf_urls=[pdf_url])\n        for iter in result:\n            self.assertIsInstance(iter, ComponentOutput)\n\n    def test_tool_eval_none_input(self):\n        result = self.com.tool_eval(pdf_name=\"test.pdf\")\n        with self.assertRaises(InvalidRequestArgumentError):\n            list(result)\n\n    def test_rotated_image(self):\n        image_url = \"https://bj.bcebos.com/agi-dev-platform-sdk-test/8、质量流量计-1_rotated_page-0001.jpg\"\n        out = self.com.run(appbuilder.Message(content={\n            \"image_url\": image_url, \n            \"detect_direction\": \"true\", \n            \"multidirectional_recognize\": \"false\"}\n        ))\n        self.assertIsInstance(out, appbuilder.Message)\n    \n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_hallucination_detection.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\n\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.v2 import HallucinationDetection\n\n\nTEST_QUERY = '澳门新麻蒲烤肉店每天开门吗？'\nTEST_CONTEXT = \\\n('澳门美食： 澳门新麻蒲韩国烤肉店\\n'\n'在澳门一年四季之中除了火锅，烤肉也相当受欢迎。提到韩烧，有一间令我印象最深刻，就是号称韩国第一的烤肉店－新麻蒲韩国烤肉店，光是韩国的分店便多'\n'达四百多间，海外分店更是遍布世界各地，2016年便落户澳门筷子基区，在原本已经食肆林立的地方一起百花齐放！店内的装修跟韩国分店还完度几乎没差，让'\n'食客彷如置身于韩国的感觉，还要大赞其抽风系统不俗，离开时身上都不会沾上烤肉味耶！\\n'\n'时间：周一至周日 下午5:00 - 上午3:00\\n'\n'电话：＋853 2823 4012\\n'\n'地址：澳门筷子基船澳街海擎天第三座地下O号铺96号\\n'\n'必食推介:\\n'\n'护心肉二人套餐\\n'\n'来新麻蒲必试的有两样东西，现在差不多每间烤肉店都有炉边烤蛋，但大家知道吗？原来新麻蒲就是炉边烤蛋的开创者，既然是始祖，这已经是个非吃不可的理'\n'由！还有一款必试的就是护心肉，即是猪的横隔膜与肝中间的部分，每头猪也只有200克这种肉，非常珍贵，其味道吃起来有种独特的肉香味，跟牛护心肉一样'\n'精彩！\\n'\n'秘制猪皮\\n'\n'很多怕胖的女生看到猪皮就怕怕，但其实猪皮含有大量胶原蛋白，营养价值很高呢！这里红通通的猪皮还经过韩国秘制酱汁处理过，会有一点点辣味。烤猪皮的'\n'时候也需特别注意火侯，这样吃起来才会有外脆内Q的口感！')\nTEST_ANSWER = '澳门新麻蒲烤肉店并不是每天开门，周日休息。'\n\n\nclass TestHallucinationDetectionComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n\n        Args:\n            无参数，默认值为空。\n\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n\n        self.hallucination_detection = HallucinationDetection(model=\"DeepSeek-V3.1\")\n    \n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        msg = appbuilder.Message({'query': query, 'context': context, 'answer': answer})\n        answer = self.hallucination_detection(msg)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer.content}\\n')\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        msg = appbuilder.Message({'query': query, 'context': context, 'answer': answer})\n        answer = self.hallucination_detection(msg, stream=False, temperature=0.5)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer.content}\\n')\n\n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        answer = self.hallucination_detection.tool_eval(query=query, context=context, answer=answer)\n        print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer}\\n')\n\n    def test_tool_eval_with_model_configs(self):\n        \"\"\"测试 tool_eval 方法使用不同temperature和top_p参数值。\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        model_configs = {'temperature': 0.5, 'top_p': 0.5}\n        answer = self.hallucination_detection.tool_eval(query=query,\n                                                        context=context,\n                                                        answer=answer,\n                                                        model_configs=model_configs)\n        print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n')\n        for ans in answer:\n            print(ans)\n\n    def test_tool_eval_with_default_params(self):\n        \"\"\"测试 tool_eval 方法使用默认参数\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        answer = self.hallucination_detection.tool_eval(query=query, context=context, answer=answer)\n        print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n{answer}\\n')\n\n    def test_tool_eval_with_model_configs(self):\n        \"\"\"测试 tool_eval 方法使用不同temperature和top_p参数值。\n        \"\"\"\n        query = TEST_QUERY\n        context = TEST_CONTEXT\n        answer = TEST_ANSWER\n        model_configs = {'temperature': 0.5, 'top_p': 0.5}\n        answer = self.hallucination_detection.tool_eval(query=query,\n                                                        context=context,\n                                                        answer=answer,\n                                                        model_configs=model_configs)\n        # print(answer)\n        self.assertIsNotNone(answer)\n        print(f'\\n[result]\\n')\n        for ans in answer:\n            print(ans)\n\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_v2_handwrite_ocr.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import InvalidRequestArgumentError \nfrom appbuilder.core.components.v2 import HandwriteOCR\n\n\nclass TestHandWriteOCR(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        # 从BOS存储读取样例文件\n        self.image_url=(\"https://bj.bcebos.com/v1/appbuilder/test_handw\"\n                        \"rite_ocr.jpg?authorization=bce-auth-v1%2FALTAKGa8\"\n                        \"m4qCUasgoljdEDAzLm%2F2024-01-23T11%3A58%3A09Z%2F-1%2Fhost%2\"\n                        \"F677f93445fb65157bee11cd492ce213d5c56e7a41827e45ce7e32b083d195c8b\")\n        self.raw_image = requests.get(self.image_url).content\n        self.handwrite_ocr = HandwriteOCR()\n\n\n    def test_run_with_image_url(self):\n        \"\"\"\n        使用图片url进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"url\": self.image_url})\n        msg = self.handwrite_ocr.run(inp)\n        self.assertIsNotNone(msg.content)\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"raw_image\": self.raw_image})\n        msg = self.handwrite_ocr.run(inp)\n        self.assertIsNotNone(msg.content)\n        \n    def test_tool_eval(self):\n        result=self.handwrite_ocr.tool_eval(\n            file_names=['test.jpg', \"test_2\"],\n            file_urls = [\"https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6\"],\n            _sys_file_urls={'test.jpg':self.image_url}\n            )\n        res=next(result)\n        print(res)\n        self.assertEqual(res.content[-1].visible_scope,'llm')\n        res=next(result)\n        self.assertEqual(res.content[-1].visible_scope,'user')\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_image_understand.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport requests\nimport appbuilder\nimport time \n\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import NoFileUploadedExecption, InvalidRequestArgumentError\nfrom appbuilder.core.components.v2 import ImageUnderstand\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestImageUnderstand(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        # 从BOS存储读取样例文件\n        self.image_url = \"https://bj.bcebos.com/v1/appbuilder/test_image_understand.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T09%3A41%3A01Z%2F-1%2Fhost%2Fe8665506e30e0edaec4f1cc84a2507c4cb3fdb9b769de3a5bfe25c372b7e56e6\"\n        self.raw_image = requests.get(self.image_url).content\n        self.image_understand = ImageUnderstand()\n\n        # 输入参数为一张图片\n\n    def test_run_with_image_url(self):\n        \"\"\"\n        使用图片url进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"url\": self.image_url, \"question\": \"图像内容是什么？\"})\n        msg = self.image_understand.run(inp)\n        self.assertIsNotNone(msg.content)\n        self.assertIsInstance(msg, Message)\n        self.assertIsInstance(msg.content[\"description\"], str)\n        time.sleep(1)\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"raw_image\": self.raw_image, \"question\": \"图像内容是什么？\"})\n        msg = self.image_understand.run(inp)\n        self.assertIsNotNone(msg.content)\n        self.assertIsInstance(msg, Message)\n        self.assertIsInstance(msg.content[\"description\"], str)\n        time.sleep(1)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        img_urls = [\"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                  \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                  \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                  \"62cf937c03f8c5260d51c6ae\",\n                  \"https://agi-dev-platform-file.bj.bcebos.com/files_qa/10b495b5ceea44e5a1e7d194f3a59ed7/uploads/file-6cxezmhc_1.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-08-04T03%3A27%3A03Z%2F259200%2Fhost%2Ff420874be9fe2511a73eab458339aad110d97c55742b14fb4fabf78cc0e1d4cc\"]\n        img_name = \"test_img.jpg\"\n        _sys_file_urls = {\"开户许可证.jpeg\": \"https://agi-dev-platform-file.bj.bcebos.com/files_qa/10b495b5ceea44e5a1e7d194f3a59ed7/uploads/file-wjka6g3h_%E5%BC%80%E6%88%B7%E8%AE%B8%E5%8F%AF%E8%AF%81.jpeg?authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2025-08-04T03%3A28%3A23Z%2F259200%2Fhost%2F2e3355869d9f62143051a12c2b19bc39b33d439e18839fe6dd15d0f37ab3a999\"}\n\n        result = self.image_understand.tool_eval(img_names=[img_name, \"hh\"], img_urls=img_urls, _sys_file_urls=_sys_file_urls)\n        # for item in result:\n        #     print(item)\n        res = [item for item in result]\n        print(res)\n        self.assertNotEqual(len(res), 0)\n        time.sleep(1)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(InvalidRequestArgumentError):\n            result = self.image_understand.tool_eval(name=\"image_understand\", streaming=True,\n                                                     origin_query=\"\")\n            next(result)\n            time.sleep(1)\n\n    def test_run_language_en(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        inp = Message(content={\"raw_image\": self.raw_image, \"question\": \"图像内容是什么？\", \"language\": \"en\"})\n        self.image_understand.run(inp)\n        time.sleep(1) \n    \n    def test_run_raise(self):\n        # question is empty\n        with self.assertRaises(ValueError):\n            inp = Message(content={\"raw_image\": self.raw_image, \"question\": \"\"})\n            self.image_understand.run(inp)\n        \n        # question length bigger than 100\n        with self.assertRaises(ValueError):\n            question=\"test\"*26\n            inp = Message(content={\"raw_image\": self.raw_image, \"question\": question, \"language\": \"\"})\n            self.image_understand.run(inp)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_v2_is_complex_query.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport unittest\nimport os\n\nimport appbuilder\nfrom appbuilder.core.components.v2 import IsComplexQuery\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestIsComplexQueryComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = IsComplexQuery(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n\n    # def test_run_with_custom_params(self):\n    #     \"\"\"测试 run 方法使用自定义参数\"\"\"\n    #     query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n    #     msg = appbuilder.Message(query)\n    #     answer = self.node(msg, stream=True, temperature=0.5)\n    #     self.assertIsNotNone(answer)\n    #     # 检查 answer 是否符合预期\n\n    def test_run_with_invalid_params(self):\n        \"\"\"测试 run 方法使用无效参数\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(query)\n        with self.assertRaises((ValueError, TypeError)):\n            self.node(msg, invalid_param=\"invalid\")\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        result = self.node.tool_eval(query='吸塑包装盒在工业化生产和物流运输中分别有什么重要性？')\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(query='吸塑包装盒在工业化生产和物流运输中分别有什么重要性？')\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.node.tool_eval(query=None)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_mix_card_ocr.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core._exception import InvalidRequestArgumentError\nfrom appbuilder.core.components.v2.mix_card_ocr.model import MixCardOCRRequest\nfrom appbuilder.core.components.v2.mix_card_ocr.component import MixCardOCR\n\n\nclass TestMixCardOCR(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        # 从BOS存储读取样例文件\n        self.image_url=(\"https://bj.bcebos.com/v1/appbuilder/test_mix_card_ocr.jpeg?\"\n                        \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T06\"\n                        \"%3A18%3A11Z%2F-1%2Fhost%2F695b8041c1ded194b9e80dbe\"\n                        \"1865e4393da5a3515e90d72d81ef18296bd29598\")\n\n        self.raw_image = requests.get(self.image_url).content\n        self.mix_card_ocr = MixCardOCR()\n\n        # 输入参数为一张图片\n\n    def test_run_with_image_url(self):\n        \"\"\"\n        使用图片url进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"url\": self.image_url})\n        msg = self.mix_card_ocr.run(inp)\n        self.assertIsNotNone(msg.content)\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"raw_image\": self.raw_image})\n        msg = self.mix_card_ocr.run(inp)\n        self.assertIsNotNone(msg.content)\n        \n    def test_tool_eval(self):\n        result=self.mix_card_ocr.tool_eval(file_names=['test'])\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n        result=self.mix_card_ocr.tool_eval(\n            file_names=['test'],\n            _sys_file_urls={'test':self.image_url}\n        )\n        res=next(result)\n        print(\"res: {}\".format(res))\n        self.assertEqual(res.content[-1].visible_scope,'llm')\n        res=next(result)\n        self.assertEqual(res.content[-1].visible_scope,'user')\n        \n    def test_recognize_raise(self):\n        mco=appbuilder.MixCardOCR()\n        with self.assertRaises(ValueError):\n            mcor=MixCardOCRRequest()\n            mco._recognize(request=mcor)\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_mrc.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nimport time\nfrom appbuilder.core.components.v2 import MRC\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestMRC(unittest.TestCase):\n    def setUp(self):\n        '''\n        return mrc class\n        '''\n        # 设置环境变量和初始化TestMRCComponent实例\n        self.model_name = \"DeepSeek-V3.1\"\n        self.mrc = MRC(model=self.model_name)\n\n    def test_mrc_with_custom_context_list(self):\n        \"\"\"测试run方法使用自定义格式context_out_list\"\"\"\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        context_list = appbuilder.Message([\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n        2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n        听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                                           \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\n                       C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n                       北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n                       有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n                       4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"])\n        answer = self.mrc(msg, context_list)\n        self.assertIsNotNone(answer)\n        time.sleep(1)\n\n    def test_mrc_with_invalid_context(self):\n        \"\"\"测试run方法使用无效格式的context_list\"\"\"\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        context_list = appbuilder.Message(\"无效样式\")\n        self.mrc(msg, context_list)\n        time.sleep(1)\n\n    def test_mrc_with_reject(self):\n        \"\"\"测试拒答功能开启情况\"\"\"\n        # 测试阅读理解问答\n        msg = \"残疾人怎么办相关证件\"\n        msg = appbuilder.Message(msg)\n        context_list = appbuilder.Message([\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n        2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n        听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                                           \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\n                       C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n                       北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n                       有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n                       4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"])\n        answer = self.mrc(msg, context_list, reject=True, clarify=True, highlight=True, friendly=True, cite=True)\n        print(answer)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        context_list = [\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n        2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n        听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                        \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\n    C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n    北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n    有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n    4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"]\n        params = {\n            'query': '残疾人怎么办相关证件',\n            'context_list': context_list\n        }\n        result = self.mrc.tool_eval(**params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.mrc.tool_eval(**params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        context_list = [\"\"\"如何办理残疾人通行证一、残疾人通行证办理条件：\n        1、持有中华人民共和国残疾人证，下肢残疾或者听力残疾；\n        2、持有准驾车型为C1（听力残疾）、C2（左下肢残疾、听力残疾）、C5（右下肢、双下肢残疾）的机动车驾驶证，\n        听力残疾人驾驶证须有“驾驶机动车应佩戴助听设备”的批注（批注请到各车管分所办理）；\"\"\",\n                        \"\"\"3、本人拥有本市登记核发的非营运小型载客汽车，车辆须在检验有效期内，并有有效交强险凭证，\n    C5车辆加装操纵辅助装置后已办理变更手续。二、办理地点：北京市朝阳区左家庄北里35号：\n    北京市无障碍环境建设促进中心（北京市残疾人辅助器具资源中心），咨询电话：63547715 或68397831。三、所需材料：1、\n    有效的身份证明原件和复印件；2、残疾人证原件和复印件；3、驾驶证原件和复印件；\n    4、车辆行驶证原件和复印件；5、有效的机动车交强险凭证。\"\"\"]\n        with self.assertRaises(ValueError):\n            params = {\n                'query': '残疾人怎么办相关证件',\n                'context_list': None\n            }\n            result = self.mrc.tool_eval(**params)\n            next(result)\n\n        with self.assertRaises(ValueError):\n            params = {\n                'query': None,\n                'context_list': context_list\n            }\n            result = self.mrc.tool_eval(**params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_nl2pandas.py",
    "content": "\"\"\"\nCopyright (c) 2023 Baidu, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nimport unittest\nimport os\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.components.v2 import Nl2pandasComponent\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestNl2pandasComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量及必要数据。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = Nl2pandasComponent(model=self.model_name)\n        self.table_info = '''表格列信息如下：\n        学校名 : 清华附小 , 字符串类型，代表小学学校的名称\n        所属地区 : 西城区 , 字符串类型，表示该小学学校所在的位置\n        创办时间 : 1998 , 数字值类型，表示该小学学校的创办时间\n        类别 : 公立小学 , 字符串类型，表示该小学学校所在的类别\n        学生人数 : 2000 , 数字值类型，表示该小学学校的学生数量\n        教职工人数 : 140 , 数字值类型，表示该小学学校的教职工数量\n        教学班数量 : 122 , 数字值类型，表示该小学学校的教学班数量\n        '''\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试 stream 和 temperature 参数\"\"\"\n        query = \"海淀区有哪些学校\"\n        msg = Message(query)\n        code = self.node(msg, table_info=self.table_info, stream=False, temperature=0.5)\n        self.assertIsNotNone(code)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'query': '海淀区有哪些学校',\n            'table_info': self.table_info\n        }\n        result = self.node.tool_eval(**params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'query': '海淀区有哪些学校',\n                'table_info': None\n            }\n            result = self.node.tool_eval(**params)\n            next(result)\n        \n        with self.assertRaises(ValueError):\n            params = {\n                'query': None,\n                'table_info': self.table_info\n            }\n            result = self.node.tool_eval(**params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_object_recognition.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core.component import ComponentOutput\nfrom appbuilder.core._exception import InvalidRequestArgumentError\nfrom appbuilder.core.components.v2 import ObjectRecognition\nfrom appbuilder.core._exception import AppBuilderServerException\nfrom appbuilder.core.components.object_recognize.model import ObjectRecognitionRequest\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestObjectRecognition(unittest.TestCase):\n    def setUp(self):\n        self.com = ObjectRecognition()\n        self.image_url = \"https://bj.bcebos.com/v1/appbuilder/object_recognize_test.png?\" \\\n                        \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-\" \\\n                        \"11T11%3A00%3A19Z%2F-1%2Fhost%2F2c31bf29205f61e58df661dc80af31a1dc\" \\\n                        \"1ba1de0a8f072bc5a87102bd32f9e3\"\n        self.func_recognize = self.com._recognize\n\n    def test_run(self):\n        raw_image = requests.get(self.image_url).content\n        message = appbuilder.Message(content={\"raw_image\": raw_image, \"url\": self.image_url})\n        out = self.com.run(message)\n        self.assertIsNotNone(out)\n        print(out)\n\n    def test_tool_eval(self):\n        result = self.com.tool_eval(img_url=self.image_url)\n        for res in result:\n            self.assertIsInstance(res, ComponentOutput)\n            print(res)\n\n    def test_tool_eval_error(self):\n        result = self.com.tool_eval(img_name='test_path')\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n\n        result = self.com.tool_eval()\n        with self.assertRaises(InvalidRequestArgumentError):\n            next(result)\n\n    def test_recognize_error(self):\n        with self.assertRaises(ValueError):\n            self.func_recognize(ObjectRecognitionRequest())\n\n        with self.assertRaises(AppBuilderServerException):\n            self.func_recognize(ObjectRecognitionRequest(url='test-url'), retry=1)\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_v2_oral_query_generat.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport appbuilder\nfrom appbuilder.core.component import ComponentOutput\nfrom appbuilder.core.components.v2 import OralQueryGeneration\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestOralQueryGeneration(unittest.TestCase):\n    def setUp(self):\n        self.com = OralQueryGeneration(model=\"DeepSeek-V3.1\")\n        self.text = ('文档标题：在OPPO Reno5上使用视频超级防抖\\n'\n                '文档摘要：OPPO Reno5上的视频超级防抖，视频超级防抖3.0，多代视频防抖算法积累，这一代依旧超级防抖超级稳。 开启视频超级'\n                '防抖 开启路径：打开「相机 > 视频 > 点击屏幕上方的“超级防抖”标识」 后置视频同时支持超级防抖和超级防抖Pro功能，开启超级'\n                '防抖后手机屏幕将出现超级防抖Pro开关，点击即可开启或关闭。 除此之外，前置视频同样加持防抖算法，边走边拍也能稳定聚焦脸部'\n                '，实时视频分享您的生活。')\n\n    def test_run(self):\n        message = appbuilder.Message(self.text)\n        output = self.com.run(message)\n        self.assertIsNotNone(output)\n        print(output)\n\n    def test_tool_eval(self):\n        result = self.com.tool_eval(text = self.text)\n        for str in result:\n            assert isinstance(str, ComponentOutput)\n            print(str)\n\nif __name__ == \"__main__\":\n    unittest.main()"
  },
  {
    "path": "python/tests/test_v2_plant_recognize.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport requests\nimport appbuilder\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.component import ComponentOutput\nfrom appbuilder.core.components.v2.plant_recognize.component import PlantRecognition\n\n# @unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestPlantRecognition(unittest.TestCase):\n\n    def setUp(self):\n        \"\"\"\n        设置环境变量\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        # 从BOS存储读取样例文件\n        self.image_url = (\"https://bj.bcebos.com/v1/appbuilder/\"\n                          \"palnt_recognize_test.jpg?authorization=\"\n                          \"bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%\"\n                          \"2F2024-01-23T09%3A51%3A03Z%2F-1%2Fhost%2\"\n                          \"Faa2217067f78f0236c8262cdd89a4b4f4b2188\"\n                          \"d971ca547c53d01742af4a2cbe\")\n        self.raw_image = requests.get(self.image_url).content\n        self.plant_recognize = PlantRecognition()\n\n        # 输入参数为一张图片\n\n    def test_run_with_image_url(self):\n        \"\"\"\n        使用图片url进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"url\": self.image_url})\n        msg = self.plant_recognize.run(inp)\n        self.assertIsNotNone(msg.content)\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # Create message with raw_image\n        inp = Message(content={\"raw_image\": self.raw_image})\n        msg = self.plant_recognize.run(inp)\n        self.assertIsNotNone(msg.content)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.plant_recognize.tool_eval(name=\"plant_recognition\", streaming=True,\n                                                    origin_query=\"\")\n            next(result)\n\n    def test_tool_eval(self):\n        \"\"\"测试 tool 方法的处理。\"\"\"\n        img_url = \"https://bj.bcebos.com/v1/appbuilder/animal_recognize_test.png?\" \\\n                  \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T\" \\\n                  \"12%3A19%3A16Z%2F-1%2Fhost%2F411bad53034fa8f9c6edbe5c4909d76ecf6fad68\" \\\n                  \"62cf937c03f8c5260d51c6ae\"\n        img_name = \"test_img.jpg\"\n        result = self.plant_recognize.tool_eval(\n            img_name=img_name, img_url=img_url)\n        for r in result:\n            print(r)\n            self.assertIsInstance(r, ComponentOutput)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_qa_pair_mining.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nimport unittest\nimport os\n\nimport appbuilder\nfrom appbuilder.core.components.v2 import QAPairMining\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestQAPairMiningComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = QAPairMining(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"2017年，工商银行根据外部宏观环境变化...\"\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n        self.assertIn(\"问题\", answer.content)\n        self.assertIn(\"答案\", answer.content)\n\n    # def test_run_with_custom_params(self):\n    #     \"\"\"测试 run 方法使用自定义参数\"\"\"\n    #     query = \"2017年，工商银行根据外部宏观环境变化...\"\n    #     msg = appbuilder.Message(query)\n    #     answer = self.node(msg, stream=True, temperature=0.5)\n    #     self.assertIsNotNone(answer)\n    #     # 检查 answer 是否符合预期\n\n    def test_run_with_invalid_params(self):\n        \"\"\"测试 run 方法使用无效参数\"\"\"\n        query = \"2017年，工商银行根据外部宏观环境变化...\"\n        msg = appbuilder.Message(query)\n        with self.assertRaises((ValueError, TypeError)):\n            self.node(msg, invalid_param=\"invalid\")\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        query = \"2017年，工商银行根据外部宏观环境变化...\"\n        result = self.node.tool_eval(query=query)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(query=query)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.node.tool_eval(query=None)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_qrcode_ocr.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport unittest\nimport os\nimport requests\nimport unittest\nimport appbuilder\n\nfrom appbuilder.core._exception import InvalidRequestArgumentError\nfrom appbuilder.core.components.v2 import QRcodeOCR\n\nclass TestQRcodeOCR(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \"\"\"\n        self.qrcode_ocr = QRcodeOCR()\n\n    def test_run_with_raw_image(self):\n        \"\"\"\n        使用原始图片进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        # Qrcode ocr\n        output = self.qrcode_ocr.run(message)\n        # Assert output is not None\n        print(output)\n        self.assertIsNotNone(output)\n\n    def test_run_with_url(self):\n        \"\"\"\n        使用图片 URL 进行单测\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        # Create message with image URL\n        message = appbuilder.Message(content={\"url\": image_url})\n        # Qrcode ocr\n        output = self.qrcode_ocr.run(message)\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_args(self):\n        \"\"\"\n        测试run方法，location、timeout、retry参数\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        raw_image = requests.get(image_url).content\n        # Create message with raw_image\n        message = appbuilder.Message(content={\"raw_image\": raw_image})\n        #  Qrcode ocr with timeout and retry parameters\n        output = self.qrcode_ocr.run(message, location=\"true\", timeout=5.0, retry=3)\n\n        # Assert output is not None\n        self.assertIsNotNone(output)\n\n    def test_run_with_invalid_input(self):\n        \"\"\"\n        测试run函数在传入无效输入的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        # create empty message\n        message = appbuilder.Message(content={})\n        # Assert ValueError is raised\n        with self.assertRaises(ValueError):\n            self.qrcode_ocr.run(message)\n\n    def test_run_with_invalid_url(self):\n        \"\"\"\n        测试run函数在传入无效URL的情况下的行为。\n\n        Args:\n            None\n\n        Returns:\n            None\n\n        \"\"\"\n        url = \"http://example.com/invalid_url.jpg\"\n        message = appbuilder.Message(content={\"url\": url})\n        with self.assertRaises(appbuilder.AppBuilderServerException):\n            self.qrcode_ocr.run(message)\n        \n        with self.assertRaises(InvalidRequestArgumentError):\n            self.qrcode_ocr.run(message=message,location='test')\n        \n            \n    def test_tool_eval(self):\n        image_url = \"https://bj.bcebos.com/v1/appbuilder/qrcode_ocr_test.png?\" \\\n                    \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-\" \\\n                    \"01-24T12%3A45%3A13Z%2F-1%2Fhost%2Ffc43d07b41903aeeb5a023131ba6\" \\\n                    \"e74ab057ce26d50e966dc31ff083e6a9c41b\"\n        result=self.qrcode_ocr.tool_eval(file_names=['test'])\n        with self.assertRaises(InvalidRequestArgumentError):\n            msg = next(result)\n            print(msg)\n        result=self.qrcode_ocr.tool_eval(\n            file_names=['test'],\n            _sys_file_urls={'test':image_url},\n            location='True',\n        )\n        res=next(result)\n        print(res)\n        self.assertEqual(res.content[-1].visible_scope,'llm')\n        res=next(result)\n        print(res)\n        self.assertEqual(res.content[-1].visible_scope,'user')\n        \n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_query_decomposition.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport appbuilder\nfrom appbuilder.core.components.v2 import QueryDecomposition\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestQueryDecompositionComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        \n        Args:\n            无参数，默认值为空。\n        \n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = QueryDecomposition(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n\n    # def test_run_with_custom_params(self):\n    #     \"\"\"测试 run 方法使用自定义参数\"\"\"\n    #     query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n    #     msg = appbuilder.Message(query)\n    #     answer = self.node(msg, stream=True, temperature=0.5)\n    #     self.assertIsNotNone(answer)\n    #     # 检查 answer 是否符合预期\n\n    def test_run_with_invalid_params(self):\n        \"\"\"测试 run 方法使用无效参数\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        msg = appbuilder.Message(query)\n        with self.assertRaises((ValueError, TypeError)):\n            self.node(msg, invalid_param=\"invalid\")\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        query = \"吸塑包装盒在工业化生产和物流运输中分别有什么重要性？\"\n        result = self.node.tool_eval(query)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(query)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.node.tool_eval(query=None)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_query_rewrite.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# !/usr/bin/env python3\n\n\nimport os\nimport unittest\nfrom typing import List, Tuple\nimport appbuilder\nfrom appbuilder.core.components.v2 import QueryRewrite\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")  \nclass TestQueryRewriteComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        初始化查询重写组件的单元测试基类。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \"\"\"\n        # 设置环境变量和初始化TranslateComponent实例\n        self.model_name = \"DeepSeek-V3.1\"\n        self.node = QueryRewrite(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = ['我应该怎么办理护照？', '您可以查询官网或人工咨询', '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']\n        msg = appbuilder.Message(query)\n        answer = self.node(msg)\n        self.assertIsNotNone(answer)\n        # 可以添加更多断言来检查 answer 的特定属性\n\n    def test_run_with_custom_params(self):\n        \"\"\"测试 run 方法使用自定义参数\"\"\"\n        query = ['我应该怎么办理护照？', '您可以查询官网或人工咨询', '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']\n        msg = appbuilder.Message(query)\n        type = \"仅用户查询\"\n        answer = self.node(msg, rewrite_type=type)\n        self.assertIsNotNone(answer)\n        # 检查 answer 是否符合预期\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\"\"\"\n        node = QueryRewrite(\"DeepSeek-V3.1\")\n        query = ['我应该怎么办理护照？', '您可以查询官网或人工咨询', '我需要准备哪些材料？', '身份证、免冠照片一张以及填写完整的《中国公民因私出国（境）申请表》', '在哪里办']\n        msg = appbuilder.Message(query)\n        answer = node(msg, rewrite_type=\"带机器人回复\", stream=False, temperature=0.5)\n        self.assertIsNotNone(answer)\n        \n    def test_run_raise(self):\n        with self.assertRaises(ValueError):\n            self.node(message=None)\n\n        query = ['我应该怎么办理护照？', '您可以查询官网或人工咨询']\n        msg=appbuilder.Message(query)\n        with self.assertRaises(ValueError):\n            self.node(message=msg)\n           \n        test_str='test'*1500    \n        query = [test_str]\n        msg=appbuilder.Message(query)\n        with self.assertRaises(ValueError):\n            self.node(message=msg) \n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        params = {\n            'query': ['我应该怎么办理护照？', '您可以查询官网或人工咨询']\n        }\n        result = self.node.tool_eval(**params)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.node.tool_eval(streaming=False, **params)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            params = {\n                'query': None\n            }\n            result = self.node.tool_eval(**params)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_similar_question.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\n\nimport requests\n\nimport appbuilder\nfrom appbuilder.core.component import ComponentOutput\nfrom appbuilder.core.components.v2 import SimilarQuestion\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestSimilarQuestion(unittest.TestCase):\n    def setUp(self):\n        self.com = SimilarQuestion(model=\"DeepSeek-V3.1\")\n\n    def test_run(self):\n        query = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n        msg = appbuilder.Message(query)\n        out = self.com.run(msg)\n        self.assertIsNotNone(out)\n        print(out)\n\n    def test_tool_eval(self):\n        query = \"我想吃冰淇淋，哪里的冰淇淋比较好吃？\"\n        for output in self.com.tool_eval(query):\n            self.assertIsInstance(output, ComponentOutput)\n            print(output)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "python/tests/test_v2_style_rewrite.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport time\nimport appbuilder\nfrom appbuilder.core.components.v2 import StyleRewrite\nfrom appbuilder.core.component import ComponentOutput\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestStyleRewrite(unittest.TestCase):\n    def setUp(self) -> None:\n        self.com = StyleRewrite(model=\"DeepSeek-V3.1\")\n    \n    def test_normal_case(self):\n        time.sleep(2)\n        text = \"文心大模型发布新版\"\n        style = \"激励话术\"\n        msg = appbuilder.Message(content=text)\n        out = self.com(msg, style=style)\n        self.assertIn(\"文心大模型\", out.content)\n\n    def test_tool_eval(self):\n        time.sleep(2)\n        text = \"文心大模型发布新版\"\n        style = \"营销话术\"\n        out = self.com.tool_eval(query=text, style=style)\n        for item in out:\n            self.assertIsInstance(item, ComponentOutput)\n\n    def test_non_stream_tool_eval(self):\n        text = \"成都是个包容的城市\"\n        style = \"直播话术\"\n        out = self.com.non_stream_tool_eval(query=text, style=style)\n        print(out)\n        self.assertIsInstance(out, ComponentOutput)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(TypeError):\n            result = self.com.tool_eval(name=\"image_understand\", streaming=True,\n                                                     origin_query=\"\")\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_style_writing.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.components.v2 import StyleWriting\nfrom appbuilder.core.component import ComponentOutput\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestStyleWriting(unittest.TestCase):\n    def setUp(self):\n        self.com = StyleWriting(model = \"DeepSeek-V3.1\")\n\n    def test_run(self):\n        query = \"帮我写一篇关于足球的文案\"\n        msg = appbuilder.Message(query)\n        style = \"小红书\"\n        length = 100\n        out = self.com.run(msg, style_query=style, length=length)\n        print(out)\n\n    def test_tool_eval(self):\n        query = \"帮我写一篇关于足球的文案\"\n        style = \"小红书\"\n        length = 150\n        result = self.com.tool_eval(query, style, length)\n        for res in result:\n            assert isinstance(res, ComponentOutput)\n            print(res)\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_v2_table_ocr.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.components.v2 import TableOCR\nfrom appbuilder.core.component import ComponentOutput\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestTableOCR(unittest.TestCase):\n    def setUp(self):\n        self.com = TableOCR()\n        self.image_url = \"https://bj.bcebos.com/v1/appbuilder/table_ocr_test.png?\"\\\n            \"authorization=bce-auth-v1%2FALTAKGa8m4qCUasgoljdEDAzLm%2F2024-01-24T12%3A37%3A09Z%2F-1%2Fhost%2Fab528a5a9120d328dc6d18c6\"\\\n            \"064079145ff4698856f477b820147768fc2187d3\"\n\n    def test_run(self):\n        out = self.com.run(appbuilder.Message(content={\"url\": self.image_url}))\n        print(out)\n        \n\n    def test_tool_eval_01(self):\n        result = self.com.tool_eval(file_urls = [self.image_url])\n    def test_tool_eval_01(self):\n        result = self.com.tool_eval(file_urls = [self.image_url])\n        for res in result:\n            assert isinstance(res, ComponentOutput)\n            print(res.role, res.content)\n\n    def test_tool_eval_02(self):\n        _sys_file_urls = {\n            \"test-name.png\": self.image_url\n        }\n        result = self.com.tool_eval(file_names = [\"test-name.png\"], _sys_file_urls = _sys_file_urls)\n        for res in result:\n            assert isinstance(res, ComponentOutput)\n            print(res.role, res.content)\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_v2_tag_extraction.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.import unittest import os\n\nimport appbuilder\nimport os\nimport unittest\nfrom appbuilder.core.components.v2 import TagExtraction\n\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestTagExtractionComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\" 设置环境变量。\n        Args:\n                无参数，默认值为空。\n        Returns:\n            无返回值，方法中执行了环境变量的赋值操作。\n        \"\"\"\n        self.model_name = \"DeepSeek-V3.1\"\n        self.tag_extraction = TagExtraction(model=self.model_name)\n\n    def test_run_with_default_params(self):\n        \"\"\"测试 run 方法使用默认参数\"\"\"\n        query = \"本实用新型公开了一种可利用热能的太阳能光伏光热一体化组件，包括太阳能电池，还包括有吸热板，太阳能电池粘附在吸热板顶面，吸热板内嵌入有热电材料制成的内芯，吸热板底面设置有蛇形管。本实用新型结构紧凑，安装方便，能充分利用太阳能电池散发的热能，具有较高的热能利用率。\"\n        msg = appbuilder.Message(query)\n        answer = self.tag_extraction(msg)\n        self.assertIsNotNone(answer)\n\n    def test_run_with_stream_and_temperature(self):\n        \"\"\"测试不同的 stream 和 temperature 参数值\"\"\"\n        msg = appbuilder.Message(\n            \"本实用新型公开了一种可利用热能的太阳能光伏光热一体化组件，包括太阳能电池，还包括有吸热板，太阳能电池粘附在吸热板顶面，吸热板内嵌入有热电材料制成的内芯，吸热板底面设置有蛇形管。本实用新型结构紧凑，安装方便，能充分利用太阳能电池散发的热能，具有较高的热能利用率。\")\n        answer = self.tag_extraction(msg, stream=False, temperature=0.5)\n        self.assertIsNotNone(answer)\n\n    def test_tool_eval_valid(self):\n        \"\"\"测试 tool 方法对有效请求的处理。\"\"\"\n        query = \"本实用新型公开了一种可利用热能的太阳能光伏光热一体化组件，包括太阳能电池，还包括有吸热板，太阳能电池粘附在吸热板顶面，吸热板内嵌入有热电材料制成的内芯，吸热板底面设置有蛇形管。本实用新型结构紧凑，安装方便，能充分利用太阳能电池散发的热能，具有较高的热能利用率。\"\n        result = self.tag_extraction.tool_eval(query=query)\n        res = [item for item in result]\n        self.assertNotEqual(len(res), 0)\n        result = self.tag_extraction.tool_eval(query=query)\n        res = [item for item in result]\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法对无效请求的处理。\"\"\"\n        with self.assertRaises(ValueError):\n            result = self.tag_extraction.tool_eval(query=None)\n            next(result)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_text_to_image.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport unittest\nimport appbuilder\n\nfrom appbuilder.core.components.v2 import Text2Image\nfrom appbuilder.core.component import ComponentOutput\n\n@unittest.skip(\"偶现报错暂时跳过\")\nclass TestText2Image(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n        设置环境变量。\n        Args:\n            None\n        Returns:\n            None.\n        \"\"\"\n        self.com = Text2Image()\n\n    def test_run(self):\n        \"\"\"\n        使用原始文本进行单测\n        Args:\n            None\n        Returns:\n            None\n        \"\"\"\n        inp = appbuilder.Message(content={\"prompt\": \"上海的经典风景\"})\n        out = self.com.run(inp)\n        self.assertIsNotNone(out)\n        self.assertIsInstance(out, appbuilder.Message)\n\n    def test_tool_eval(self):\n        \"\"\"\n        测试 tool_eval 方法的正确性。\n        \n        Args:\n            self: 测试类的实例。\n        \n        Returns:\n            无返回值。\n        \n        Raises:\n            无异常抛出。\n        \n        \"\"\"\n        result = self.com.tool_eval(query = \"上海的经典风景\")\n        for res in result:\n            self.assertIsInstance(res, ComponentOutput)\n            print(res)\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_v2_translate.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nimport appbuilder\nfrom appbuilder.core.components.v2 import Translation\nfrom appbuilder.core.component import ComponentOutput\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestTranslation(unittest.TestCase):\n    def setUp(self) -> None:\n        self.com = Translation()\n\n    def test_run(self):\n        msg = appbuilder.Message(content=\"你好\")\n        result = self.com.run(message = msg, to_lang=\"en\")\n        print(result)\n\n    def test_tool_eval(self):\n        result = self.com.tool_eval(q=\"你好\", to_lang=\"en\")\n        for res in result:\n            assert isinstance(res, ComponentOutput)\n            print(res)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/tests/test_v2_treemind.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport unittest\nfrom appbuilder.core.message import Message\nfrom appbuilder.core.component import Component\nfrom appbuilder.core.component import ComponentOutput\nfrom appbuilder.core.components.v2 import TreeMind\n\n@unittest.skip(\"测试API超限，暂时跳过\")\nclass TestTreeMindComponent(unittest.TestCase):\n    def setUp(self):\n        \"\"\"\n            初始化测试用例，设置环境变量和网关URL。\n        如果没有设置CAR_EXPERT_TOKEN环境变量，则使用空字符串。\n        Args:\n            None.\n        Returns:\n            None.\n        \"\"\"\n        self.tm = TreeMind()\n        self.query = \"生成一份年度总结的思维导图\"\n\n    def test_treemind_component_tool_eval(self):\n        \"\"\"测试tool_eval方法的返回值是否正确\n        \"\"\"\n        import time\n        time.sleep(1)\n        result = self.tm.tool_eval(query=self.query)\n        self.assertIsNotNone(result)\n        for r in result:\n            self.assertIsNotNone(r)\n\n    def test_run_with_invalid_input(self):\n        \"\"\"测试run函数在传入无效输入的情况下的行为。\n        \"\"\"\n        message = Message(content={})\n        with self.assertRaises(ValueError):\n            self.tm.run(message)\n\n    def test_tool_eval_invalid(self):\n        \"\"\"测试 tool 方法传入无效输入的情况下的行为\"\"\"\n        with self.assertRaises(TypeError):\n            result = self.tm.tool_eval(name=\"treemind\", streaming=True, origin_query=\"\")\n            next(result)\n\n    def test_tool_eval(self):\n        result = self.tm.tool_eval(query=self.query)\n        for r in result:\n            self.assertIsInstance(r, ComponentOutput)\n\nif __name__ == '__main__':\n    unittest.main()"
  },
  {
    "path": "python/tests/test_vdb_retriever.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# !/usr/bin/env python3\n\n\nimport os\nimport unittest\nfrom typing import List, Tuple\nimport appbuilder\n\n@unittest.skipUnless(os.getenv(\"TEST_CASE\", \"UNKNOWN\") == \"CPU_PARALLEL\", \"\")\nclass TestBaiduVDBRetrieverParameter(unittest.TestCase):\n    def setUp(self) -> None:\n        os.environ[\"APPBUILDER_TOKEN\"] = \"bce-v3/ABCDE\"\n\n    def test_run_parameter_query(self):\n        query = appbuilder.Message('')\n        retriever = appbuilder.BaiduVDBRetriever(\n            embedding=\"abcde\",\n            table=\"abcde\")\n        \n        with self.assertRaises(ValueError) as context:\n            retriever.run(query)\n        self.assertIn(\"Parameter `query` content is empty\", str(context.exception))\n    \n    def test_run_paramter_query_type(self):\n        query = appbuilder.Message(content=12345)\n\n        retriever = appbuilder.BaiduVDBRetriever(\n            embedding=\"abcde\",\n            table=\"abcde\")\n        \n        with self.assertRaises(ValueError) as context:\n            retriever.run(query)\n        self.assertIn(\"Parameter `query` content is not a string\", str(context.exception))\n\n    def test_run_parameter_query_length(self):\n        query = appbuilder.Message(content=\"a\" * 1025)\n        retriever = appbuilder.BaiduVDBRetriever(\n            embedding=\"abcde\",\n            table=\"abcde\")\n        with self.assertRaises(ValueError) as context:\n            retriever.run(query)\n        self.assertIn(\"Parameter `query` content is too long\", str(context.exception))\n\n    def test_run_parameter_topk_positive(self):\n        query = appbuilder.Message()\n        retriever = appbuilder.BaiduVDBRetriever(\n            embedding=\"abcde\",\n            table=\"abcde\")\n        with self.assertRaises(ValueError) as context:\n            retriever.run(query, top_k=-1)\n        self.assertIn(\"Parameter `top_k` must be a positive integer\", str(context.exception))\n\nclass TestVDBParameterCheck(unittest.TestCase):\n    def setUp(self) -> None:\n        os.environ[\"APPBUILDER_TOKEN\"] = \"bce-v3/ABCDE\"\n\n    def test_vdb_parameter_account(self):\n        with self.assertRaises(TypeError) as context:\n            appbuilder.BaiduVDBVectorStoreIndex(\n                instance_id=\"abcde\",\n                api_key=\"abcde\",\n                account=123456)\n        self.assertIn(\"must be a string\", str(context.exception))\n        \n    def test_vdb_parameter_database_name(self):\n        with self.assertRaises(TypeError) as context:\n            appbuilder.BaiduVDBVectorStoreIndex(\n                instance_id=\"abcde\",\n                api_key=\"abcde\",\n                database_name=123456)\n        self.assertIn(\"must be a string\", str(context.exception))\n\n\n    def test_vdb_parameter_table_params(self):\n        with self.assertRaises(TypeError) as context:\n            appbuilder.BaiduVDBVectorStoreIndex(\n                instance_id=\"abcde\",\n                api_key=\"abcde\",\n                table_params=123456)\n        self.assertIn(\"must be a TableParams\", str(context.exception))\n\n    def test_vdb_parameter_embedding(self):\n        with self.assertRaises(TypeError) as context:\n            appbuilder.BaiduVDBVectorStoreIndex(\n                instance_id=\"abcde\",\n                api_key=\"abcde\",\n                embedding=123456)\n        self.assertIn(\"must be a Embedding\", str(context.exception))\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "python/utils/__init__.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n"
  },
  {
    "path": "python/utils/_bcc.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nfrom baidubce.services.bcc import bcc_client, bcc_model\nfrom baidubce.utils import aes128_encrypt_16char_key\nfrom baidubce.http import http_methods\nimport json\nimport uuid\n\n\nclass InnerBccClient(bcc_client.BccClient):\n    def __init__(self, config=None):\n        bcc_client.BccClient.__init__(self, config)\n\n    def create_instance_by_spec(\n        self,\n        spec,\n        image_id,\n        root_disk_size_in_gb=0,\n        root_disk_storage_type=None,\n        ephemeral_disks=None,\n        create_cds_list=None,\n        network_capacity_in_mbps=0,\n        eip_name=None,\n        internet_charge_type=None,\n        purchase_count=1,\n        name=None,\n        hostname=None,\n        auto_seq_suffix=None,\n        is_open_hostname_domain=None,\n        admin_pass=None,\n        billing=None,\n        zone_name=None,\n        subnet_id=None,\n        security_group_id=None,\n        enterprise_security_group_id=None,\n        security_group_ids=None,\n        enterprise_security_group_ids=None,\n        relation_tag=None,\n        is_open_ipv6=None,\n        tags=None,\n        key_pair_id=None,\n        auto_renew_time_unit=None,\n        auto_renew_time=0,\n        cds_auto_renew=None,\n        asp_id=None,\n        bid_model=None,\n        bid_price=None,\n        dedicate_host_id=None,\n        deploy_id=None,\n        deploy_id_list=None,\n        client_token=None,\n        config=None,\n        user_data=None,\n    ):\n        path = b\"/instanceBySpec\"\n        params = {}\n        if client_token is None:\n            params[\"clientToken\"] = str(uuid.uuid4())\n        else:\n            params[\"clientToken\"] = client_token\n        if billing is None:\n            billing = bcc_model.Billing(\"Postpaid\")\n        body = {\"spec\": spec, \"imageId\": image_id, \"billing\": billing.__dict__}\n        if root_disk_size_in_gb != 0:\n            body[\"rootDiskSizeInGb\"] = root_disk_size_in_gb\n        if root_disk_storage_type is not None:\n            body[\"rootDiskStorageType\"] = root_disk_storage_type\n        if create_cds_list is not None:\n            body[\"createCdsList\"] = [\n                create_cds.__dict__ for create_cds in create_cds_list\n            ]\n        if network_capacity_in_mbps != 0:\n            body[\"networkCapacityInMbps\"] = network_capacity_in_mbps\n        if eip_name is not None:\n            body[\"eipName\"] = eip_name\n        if purchase_count > 0:\n            body[\"purchaseCount\"] = purchase_count\n        if name is not None:\n            body[\"name\"] = name\n        if hostname is not None:\n            body[\"hostname\"] = hostname\n        if auto_seq_suffix is not None:\n            body[\"autoSeqSuffix\"] = auto_seq_suffix\n        if is_open_hostname_domain is not None:\n            body[\"isOpenHostnameDomain\"] = is_open_hostname_domain\n        if admin_pass is not None:\n            secret_access_key = self.config.credentials.secret_access_key\n            cipher_admin_pass = aes128_encrypt_16char_key(\n                admin_pass, secret_access_key)\n            body[\"adminPass\"] = cipher_admin_pass\n        if zone_name is not None:\n            body[\"zoneName\"] = zone_name\n        if subnet_id is not None:\n            body[\"subnetId\"] = subnet_id\n        if security_group_id is not None:\n            body[\"securityGroupId\"] = security_group_id\n        if enterprise_security_group_id is not None:\n            body[\"enterpriseSecurityGroupId\"] = enterprise_security_group_id\n        if security_group_ids is not None:\n            body[\"securityGroupIds\"] = security_group_ids\n        if enterprise_security_group_ids is not None:\n            body[\"enterpriseSecurityGroupIds\"] = enterprise_security_group_ids\n        if auto_renew_time != 0:\n            body[\"autoRenewTime\"] = auto_renew_time\n        if auto_renew_time_unit is None:\n            body[\"autoRenewTimeUnit\"] = \"month\"\n        else:\n            body[\"autoRenewTimeUnit\"] = auto_renew_time_unit\n        if ephemeral_disks is not None:\n            body[\"ephemeralDisks\"] = [\n                ephemeral_disk.__dict__ for ephemeral_disk in ephemeral_disks\n            ]\n        if dedicate_host_id is not None:\n            body[\"dedicatedHostId\"] = dedicate_host_id\n        if deploy_id is not None:\n            body[\"deployId\"] = deploy_id\n        if deploy_id_list is not None:\n            body[\"deployIdList\"] = deploy_id_list\n        if bid_model is not None:\n            body[\"bidModel\"] = bid_model\n        if bid_price is not None:\n            body[\"bidPrice\"] = bid_price\n        if key_pair_id is not None:\n            body[\"keypairId\"] = key_pair_id\n        if internet_charge_type is not None:\n            body[\"internetChargeType\"] = internet_charge_type\n        if asp_id is not None:\n            body[\"aspId\"] = asp_id\n        if relation_tag is not None:\n            body[\"relationTag\"] = relation_tag\n        if is_open_ipv6 is not None:\n            body[\"isOpenIpv6\"] = is_open_ipv6\n        if user_data is not None:\n            body[\"userData\"] = user_data\n        if tags is not None:\n            tag_list = [tag.__dict__ for tag in tags]\n            body[\"tags\"] = tag_list\n        body[\"cdsAutoRenew\"] = cds_auto_renew\n        return self._send_request(\n            http_methods.POST, path, json.dumps(body), params=params, config=config\n        )\n\n    def _compute_service_id(self):\n        return \"bcc\"\n"
  },
  {
    "path": "python/utils/bce_deploy.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\nimport time\nimport uuid\nimport os\nimport yaml\nimport tarfile\nimport argparse\nfrom datetime import datetime\n\nfrom baidubce.auth.bce_credentials import BceCredentials\nfrom baidubce.bce_client_configuration import BceClientConfiguration\nfrom baidubce.services.bos.bos_client import BosClient\nfrom baidubce.services.bcc import bcc_model\n\nfrom appbuilder.utils.logger_util import logger\nfrom appbuilder.utils._bcc import InnerBccClient\n\n\nclass AppbuilderSDKInstance:\n    def __init__(self, config_path):\n        self.config_path = config_path\n        self.load_config()\n\n        self.credentials = BceCredentials(self.bce_config[\"ak\"], self.bce_config[\"sk\"])\n        self.bos_client = self.create_bos_client()\n        self.bcc_client = self.create_bce_client()\n\n    def load_config(self):\n        with open(self.config_path) as f:\n            config = yaml.load(f, Loader=yaml.FullLoader)\n        self.config = config\n\n        self.bce_config = self.config[\"bce_config\"]\n        self.security_group_id = self.bce_config[\"security_group_id\"]\n        self.admin_pass = self.bce_config[\"admin_pass\"]\n        self.zone_name = self.bce_config[\"zone_name\"]\n\n        self.appbuilder_config = self.config[\"appbuilder_config\"]\n        self.env = self.config[\"env\"]\n\n    def save_config(self, config):\n        self.config[\"bce_config\"][\"security_group_id\"] = self.security_group_id\n        with open(self.config_path, \"w\") as f:\n            yaml.dump(config, f, indent=4)\n\n    def create_bce_client(self):\n        bce_config = BceClientConfiguration(\n            self.credentials, endpoint=self.bce_config[\"host\"]\n        )\n        return InnerBccClient(bce_config)\n\n    def create_bos_client(self):\n        bos_config = BceClientConfiguration(\n            self.credentials, endpoint=self.bce_config[\"bos_host\"]\n        )\n        return BosClient(bos_config)\n\n    def create_tar(self):\n        local_dir = self.appbuilder_config[\"local_dir\"]\n        timestamp = int(time.time())\n        self.tar_file_name = \"pkg_\" + str(timestamp) + \".tar\"\n        with tarfile.open(self.tar_file_name, \"w\") as tar:\n            for filename in os.listdir(local_dir):\n                file_path = os.path.join(local_dir, filename)\n                if os.path.isfile(file_path):\n                    tar.add(file_path, arcname=filename)\n\n    def bos_upload(self):\n        bucket_name = \"appbuilder-sdk-test\"\n\n        if not self.bos_client.does_bucket_exist(bucket_name):\n            self.bos_client.create_bucket(bucket_name)\n\n        self.bos_client.put_object_from_file(\n            bucket_name, self.tar_file_name, self.tar_file_name\n        )\n        timestamp = int(time.time())\n        url = self.bos_client.generate_pre_signed_url(\n            bucket_name, self.tar_file_name, timestamp, expiration_in_seconds=3600\n        )\n        self.tar_bos_url = url.decode(\"utf-8\")\n        if self.tar_bos_url == None:\n            raise Exception(\"upload to bos failed\")\n        self.log.debug(\"upload to bos successfully! url: {}\".format(self.tar_bos_url))\n\n    def clear_local(self):\n        os.remove(self.run_script)\n        os.remove(self.tar_file_name)\n\n    def build_user_data(self):\n        workspace = self.appbuilder_config[\"workspace\"]\n        user_data = (\n            \"#!/bin/bash\\\\n\"\n            + \"mkdir /root/test\\\\n\"\n            + \"chmod 777 /root/test\\\\n\"\n            + \"cd /root/test\\\\n\"\n            + f\"wget -O {self.tar_file_name} {self.tar_bos_url}\\\\n\"\n            + f\"tar -xvf {self.tar_file_name}\\\\n\"\n            + f\"rm {self.tar_file_name}\\\\n\"\n            + f\"chmod a+x {self.run_script_name}\\\\n\"\n            + \"yum install -y docker\\\\n\"\n            + \"docker pull registry.baidubce.com/appbuilder/appbuilder-sdk-cloud:1.0.4\\\\n\"\n            + f\"docker run -itd --net=host -v /root/test:{workspace} --name appbuilder-sdk registry.baidubce.com/appbuilder/appbuilder-sdk-cloud:1.0.4 {workspace}/{self.run_script_name}\"\n        )\n\n        return user_data\n\n    def build_run_script(self):\n        timestamp = int(time.time())\n        self.run_script_name = \"start_\" + str(timestamp) + \".sh\"\n        self.run_script = os.path.join(\n            self.appbuilder_config[\"local_dir\"], self.run_script_name\n        )\n\n        commands = []\n        workspace = self.appbuilder_config[\"workspace\"]\n        for key, value in self.env.items():\n            commands.append(f'export {key}=\"{value}\"')\n        run_cmd = \" && \".join(commands) + \" && \" + self.appbuilder_config[\"run_cmd\"]\n\n        with open(self.run_script, \"w\") as file:\n            file.write(\"#!/bin/sh\\n\")\n            file.write(f\"cd {workspace}\\n\")\n            file.write(run_cmd)\n\n    def create_instance(self):\n        if self.security_group_id == None or self.security_group_id == \"\":\n            self.create_security_group()\n        now_str = datetime.now().strftime(\"%Y-%m-%d-%H-%M-%S\")\n        instance = self.bcc_client.create_instance_by_spec(\n            spec=self.bce_config[\"spec\"],  # 实例规格\n            image_id=\"m-43wfwG1G\",  # 镜像ID\n            # 待创建虚拟机实例的系统盘大小，单位GB，默认是40GB，范围为[40,\n            # 2048]GB，超过40GB按照云磁盘价格收费。注意指定的系统盘大小需要满足所使用镜像最小磁盘空间限制。\n            root_disk_size_in_gb=self.bce_config[\"root_disk_size_in_gb\"],\n            network_capacity_in_mbps=1,\n            name=\"instance-appbuilder-sdk-service-{}\".format(now_str),\n            hostname=\"host-appbuilder-sdk-service-{}\".format(now_str),\n            admin_pass=self.admin_pass,\n            zone_name=self.zone_name,\n            user_data=self.build_user_data(),\n        )\n        self.log.debug(\"create instance info: {}\".format(instance))\n        self.get_instance_id(instance)\n        if self.instance_id == None:\n            raise Exception(\"create instance failed\")\n        self.log.info(\"instance create successfully! id: {}\".format(self.instance_id))\n\n    def get_instance_id(self, instance):\n        self.instance_id = instance.instance_ids[0]\n\n    def get_public_ip(self, instance_id=None):\n        if instance_id == None and self.instance_id == None:\n            return\n\n        self.public_ip = None\n        while self.public_ip is None or self.public_ip == \"\":\n            time.sleep(3)\n            response = None\n            if instance_id != None:\n                response = self.bcc_client.get_instance(instance_id)\n            else:\n                response = self.bcc_client.get_instance(self.instance_id)\n            self.log.debug(\"get instance info: {}\".format(response))\n            self.public_ip = response.instance.public_ip\n\n    def create_security_group(self):\n        client_token = str(uuid.uuid4())\n\n        # 设置安全组名称\n        security_group_name = \"appbuilder-sdk-\" + client_token\n\n        # 设置安全组规则\n        security_group_rule = bcc_model.SecurityGroupRuleModel(\n            \"rule_\" + client_token,  # 设置备注\n            \"ingress\",  # 设置入站/出站，取值ingress或egress，必选参数\n            portRange=\"1-65535\",  # 设置端口范围，默认空时为1-65535，可以指定80等单个端口\n            protocol=\"\",  # 设置协议类型\n            sourceGroupId=\"\",  # 设置源安全组ID\n            sourceIp=\"\",\n        )\n        security_group_rule_list = []\n        security_group_rule_list.append(security_group_rule)\n\n        response = self.bcc_client.create_security_group(\n            name=security_group_name,\n            rules=security_group_rule_list,\n            client_token=client_token,\n        )\n        self.security_group_id = response.security_group_id\n        if self.security_group_id == None:\n            raise Exception(\"create security group failed\")\n\n        self.log.info(\n            \"security group create successfully！id: {}\".format(self.security_group_id)\n        )\n        self.save_config(self.config)\n\n    def bind_security_group(self):\n        response = self.bcc_client.bind_instance_to_security_group(\n            self.instance_id, self.security_group_id\n        )\n        self.log.debug(\"bind instance to security group: {}\".format(response))\n\n    def _pre_deploy(self):\n        self.log = logger\n        self.log.info(\n            \"The deployment to cloud feature is currently in the beta testing stage.If any issues arise, please submit an issue or contact us through our WeChat group.\"\n        )\n        self.build_run_script()\n        self.log.debug(\"build run script done!\")\n        self.create_tar()\n        self.log.debug(\"create tar done!\")\n        self.bos_upload()\n        self.log.debug(\"upload tar to bos done!\")\n        self.clear_local()\n\n    def _deploy(self):\n        self.create_instance()\n\n    def _after_deploy(self):\n        self.get_public_ip()\n        self.bind_security_group()\n        self.log.info(\"deployment finished! public ip: {}\".format(self.public_ip))\n\n    def deploy(self):\n        self._pre_deploy()\n        self._deploy()\n        self._after_deploy()\n\n\ndef deploy():\n    parser = argparse.ArgumentParser(description=\"configuration\")\n    parser.add_argument(\"--conf\", type=str, help=\"config yaml file\")\n    args = parser.parse_args()\n    conf = args.conf\n    instance = AppbuilderSDKInstance(conf)\n    instance.deploy()\n\n\nif __name__ == \"__main__\":\n    deploy()\n"
  },
  {
    "path": "python/utils/chainlit.md",
    "content": "# 欢迎使用AppBuilder-SDK🚀\n您好，欢迎您体验AppBuilder-SDK的Chainlit可视化服务化功能。\n\n## 什么是AppBuilder-SDK👋\n百度智能云千帆AppBuilder-SDK是[百度智能云千帆AppBuilder](https://appbuilder.cloud.baidu.com/)面向AI原生应用开发者提供的一站式开发平台的客户端SDK。\n\n我们提供自底向上的：基础组件、流程编排、端到端应用 三类功能。使用百度智能云千帆AppBuilder-SDK，你可以：\n\n- 配合百度智能云千帆AppBuilder平台[网页端](https://console.bce.baidu.com/ai_apaas/app)，分钟级在本地搭建包含百度工业实践的`端到端的AI原生应用`\n- 配合 `基础组件` & `流程编排`，积木式搭建个性化的Assistant + FunctionCall应用\n- 提供 `API调用` & `交互式窗口` 两种服务化部署方式，支持快速上云，平滑嵌入到你的产品中\n\n## 如何使用AppBuilder-SDK & Chainlit可视化功能💻\n当前SDK中的`AgentRuntime`模块基于Chainlit实现了基础的可视化功能，支持AppBuilderClient + 能力组件实现可视化交互。\n- `chainlit_demo`接口支持基础组件的简单交互\n- `chainlit_agent`接口支持AppBuilderClient的进阶交互，提供新建会话和上传文件的功能\n\n如果对于可视化有更多需求，可以参考AppBuilder SDK中的代码，基于Chainlit进行二次开发。\n\n## 链接 🔗\n- [AppBuilder官网](https://appbuilder.cloud.baidu.com/)\n- [AppBuilder-SDK开源代码仓库](https://github.com/baidubce/app-builder)\n- [AppBuilder文档中心](https://cloud.baidu.com/doc/AppBuilder/index.html)\n- [Chainlit文档中心](https://docs.chainlit.io/get-started/overview)"
  },
  {
    "path": "python/utils/collector.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport collections\n\nclass AssistantKeys(object):\n    ASSISTANT = \"assistant\"\n    CONVERSATION = \"conversation\"\n    FILE = \"file\"\n    RUN = \"run\"\n    MESSAGE = \"message\"\n\n\nclass Collector():\n    _instance = None\n    _initialized = False\n\n    def __new__(cls, *args, **kwargs):\n        \"\"\"\n        单例模式\n        \"\"\"\n        if cls._instance is None:\n            cls._instance = object.__new__(cls)\n        return cls._instance\n\n    def __init__(self) -> None:\n        if self._initialized:\n            return\n        self._initialized = True\n        self._collections = collections.OrderedDict()\n\n    def add_to_collection(self, name, value, index_key=None):\n        assert isinstance(name, str)\n        if name not in self._collections:\n            self._collections[name] = collections.OrderedDict()\n\n        if index_key is not None:\n            self._collections[name][index_key] = value\n        else:\n            index = len(self._collections[name])\n            self._collections[name][str(index)] = value\n\n    def del_collection(self, name, index_key=None):\n        assert isinstance(name, str)\n        if name not in self._collections:\n            return\n\n        if index_key is not None:\n            del self._collections[name][index_key]\n        else:\n            del self._collections[name]\n\n    def get_collection(self, name, index_key=None, scope=None):\n        collection = self._collections.get(name, None)\n        if collection is None:\n            if index_key is None:\n                return []\n            else:\n                return None\n\n        if index_key is not None:\n            return collection.get(index_key, None)\n        else:\n            return list(collection.values())\n\n    def get_collection_as_dict(self, name, reverse=False):\n        if name in self._collections:\n            if reverse:\n                return collections.OrderedDict(zip(self._collections[name].values(), self._collections[name].keys()))\n            else:\n                return collections.OrderedDict(self._collections[name])\n        else:\n            self._collections[name] = collections.OrderedDict()\n            return self._collections[name]\n\n    def get_all_collection_keys(self, name=None):\n        return list(self._collections.keys())\n\n    def clear_collection(self, name):\n        if name in self._collections:\n            del self._collections[name]"
  },
  {
    "path": "python/utils/func_utils.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport warnings\nfrom functools import wraps\n\ndef deprecated(reason=None, version=None):\n    \"\"\"This is a decorator which can be used to mark functions\n    as deprecated. It will result in a warning being emitted\n    when the function is used.\"\"\"\n\n    def decorator(func):\n        @wraps(func)\n        def new_func(*args, **kwargs):\n            warnings.simplefilter('always', DeprecationWarning)  # turn off filter\n            messages = \"Call deprecated API {}().\".format(func.__qualname__)\n            if reason is not None:\n                messages += \" Deprecated because {}.\".format(reason)\n            \n            if version is not None:\n                messages += \" This API will be removed after version {}.\".format(version)\n            \n            messages += \"\\nDetailed information: \"\n\n            warnings.warn(messages,\n                        category=DeprecationWarning,\n                        stacklevel=2)\n            warnings.simplefilter('default', DeprecationWarning)  # reset filter\n            return func(*args, **kwargs)\n        return new_func\n    return decorator\n\nclass Singleton(type):\n    _instances = {}\n\n    def __call__(cls, *args, **kwargs):\n        if cls not in cls._instances:\n            cls._instances[cls] = super(\n                Singleton, cls).__call__(*args, **kwargs)\n        return cls._instances[cls]"
  },
  {
    "path": "python/utils/json_schema_to_model.py",
    "content": "import importlib.util\nimport json\nimport re\nimport sys\nimport copy\nfrom contextlib import contextmanager\nfrom pathlib import Path\nfrom tempfile import NamedTemporaryFile\nfrom types import ModuleType\n\nfrom datamodel_code_generator.parser.jsonschema import JsonSchemaParser\nfrom pydantic import BaseModel\n\n\nNON_ALPHANUMERIC = re.compile(r\"[^a-zA-Z0-9]+\")\nSTARTS_WITH_NUMBER = re.compile(r'[0-9]+')\nUPPER_CAMEL_CASE = re.compile(r\"[A-Z][a-zA-Z0-9]+\")\nLOWER_CAMEL_CASE = re.compile(r\"[a-z][a-zA-Z0-9]+\")\n\nclass BadJsonSchema(Exception):\n    pass\n\n\ndef _to_camel_case(name: str) -> str:\n    if any(NON_ALPHANUMERIC.finditer(name)):\n        return  \"\".join(term.lower().title() if not STARTS_WITH_NUMBER.match(term) else term.lower() for term in NON_ALPHANUMERIC.split(name))\n    if UPPER_CAMEL_CASE.match(name):\n        return name\n    if LOWER_CAMEL_CASE.match(name):\n        return name[0].upper() + name[1:]\n    raise BadJsonSchema(f\"Unknown case used for {name}\")\n\n\ndef _load_module_from_file(file_path: Path) -> ModuleType:\n    spec = importlib.util.spec_from_file_location(\n        name=file_path.stem, location=str(file_path)\n    )\n    module = importlib.util.module_from_spec(spec)\n    sys.modules[file_path.stem] = module\n    spec.loader.exec_module(module)\n    return module\n\n\n@contextmanager\ndef _delete_file_on_completion(file_path: Path):\n    try:\n        yield\n    finally:\n        file_path.unlink(missing_ok=True)\n\ndef replace_last_match(text, pattern, repl):\n    # 使用正则表达式查找所有匹配的子字符串\n    matches = list(re.finditer(pattern, text))\n    \n    # 如果没有找到匹配的子字符串，直接返回原始文本\n    if not matches:\n        return text\n    \n    # 找到最后一个匹配的子字符串的位置和长度\n    last_match = matches[-1]\n    start, end = last_match.span()\n    \n    # 替换最后一个匹配的子字符串\n    before = text[:start]\n    after = text[end:]\n    new_text = before + repl + after\n    \n    return new_text\n\ndef sed_pydantic_str(pydantic_models_as_str:str, title: str):\n    # 在 \"from pydantic import BaseModel, Field\" 这行后，添加 \"from pydantic import RootModel\"\n    new_pydantic_models_as_str = re.sub(r'from pydantic import BaseModel, Field',\n                                        'from pydantic import BaseModel; from pydantic import Field, RootModel',\n                                        pydantic_models_as_str)\n    # 判断字符串中是否存在\"__root__\"\n    has_root = \"__root__\" in new_pydantic_models_as_str\n    if has_root:\n        # 把最后一个的BaseModel替换为RootModel\n        new_pydantic_models_as_str = replace_last_match(new_pydantic_models_as_str, \"BaseModel\", \"RootModel\")\n\n        # 替换 __root__ 为 root\n        new_pydantic_models_as_str = re.sub(r'\\b__root__\\b', r'root', new_pydantic_models_as_str)\n    return new_pydantic_models_as_str\n\n\ndef json_schema_to_pydantic_model(json_schema: dict, name_override: str) -> BaseModel:\n    json_schema_as_str = json.dumps(json_schema)\n    pydantic_models_as_str: str = JsonSchemaParser(json_schema_as_str).parse()\n\n    class_title = json_schema[\"title\"]\n    pydantic_models_as_str = sed_pydantic_str(pydantic_models_as_str, class_title)\n    pydantic_models_as_str = pydantic_models_as_str.replace(\"unique_items\", \"Set\")\n    \n    with NamedTemporaryFile(suffix=\".py\", delete=False) as temp_file:\n        temp_file_path = Path(temp_file.name).resolve()\n        temp_file.write(pydantic_models_as_str.encode())\n\n    with _delete_file_on_completion(file_path=temp_file_path):\n        module = _load_module_from_file(file_path=temp_file_path)\n\n    main_model_name = _to_camel_case(name=class_title)\n    pydantic_model: BaseModel = module.__dict__[main_model_name]\n    # Override the pydantic model/parser name for nicer ValidationError messaging and logging\n    pydantic_model.__name__ = name_override\n    pydantic_model.parse_obj.__func__.__name__ = name_override\n    return pydantic_model\n\nif __name__ == '__main__':\n    manifests = [\n        {\n            \"name\": \"general_ocr\",\n            \"description\": \"提供更高精度的通用文字识别能力，能够识别图片中的文字，不支持html后缀文件的输入\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"img_url\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的url,根据该url能够获取图片\"\n                    },\n                    \"img_name\": {\n                        \"type\": \"string\",\n                        \"description\": \"待识别图片的文件名,用于生成图片url\"\n                    },\n                    \"files\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"string\",\n                        },\n                        \"uniqueItems\": True\n                    }\n                    \n                },\n                \"anyOf\": [\n                    {\n                        \"required\": [\n                            \"img_url\"\n                        ]\n                    },\n                    {\n                        \"required\": [\n                            \"img_name\"\n                        ]\n                    }\n                ]\n            }\n        }\n    ]\n    schema = copy.deepcopy(manifests[0]['parameters'])\n    schema['title'] = \"general_ocr\"\n    model = json_schema_to_pydantic_model(json_schema=schema, name_override=\"GeneralOcr\")\n    print(model)\n    print(model.schema_json())"
  },
  {
    "path": "python/utils/logger_file_headler.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport time\nimport glob\nimport logging\nfrom datetime import datetime, timedelta\n\nclass SizeAndTimeRotatingFileHandler(logging.Handler):\n    def __init__(self, \n                 file_name, \n                 rotate_frequency='MIDNIGHT', \n                 rotate_interval=1, \n                 max_file_size=0, \n                 max_log_files=0, \n                 total_log_size=0\n                 ):\n        super().__init__()\n        self.file_name = file_name\n        self.rotate_frequency = rotate_frequency.upper()\n        self.rotate_interval = rotate_interval\n        self.max_file_size = max_file_size\n        self.max_log_files = max_log_files\n        self.total_log_size = total_log_size\n        self.current_time = datetime.now()\n        self.current_file = self.file_name\n        self.stream = open(self.current_file, 'a')\n        self.last_rollover = time.time()\n\n    def _get_new_filename(self):\n        suffix = self.current_time.strftime(\"%Y-%m-%d_%H-%M-%S\")\n        return f\"{self.file_name}.{suffix}\"\n\n    def emit(self, record):\n        if self.shouldRollover(record):\n            self.doRollover()\n        self.stream.write(self.format(record) + '\\n')\n        self.stream.flush()\n\n    def shouldRollover(self, record):\n        current_time = time.time()\n        current_size = os.path.getsize(self.current_file)\n\n        time_rollover = False\n        if self.rotate_frequency == 'S':\n            time_rollover = current_time >= self.last_rollover + self.rotate_interval\n        elif self.rotate_frequency == 'M':\n            time_rollover = current_time >= self.last_rollover + self.rotate_interval * 60\n        elif self.rotate_frequency == 'H':\n            time_rollover = current_time >= self.last_rollover + self.rotate_interval * 3600\n        elif self.rotate_frequency == 'D':\n            time_rollover = current_time >= self.last_rollover + self.rotate_interval * 86400\n        elif self.rotate_frequency == 'MIDNIGHT':\n            time_rollover = datetime.fromtimestamp(current_time).date() != datetime.fromtimestamp(self.last_rollover).date()\n\n        size_rollover = current_size >= self.max_file_size if self.max_file_size > 0 else False\n\n        return time_rollover or size_rollover\n\n    def doRollover(self):\n        self.stream.close()\n        self.current_time = datetime.now()\n        new_filename = self._get_new_filename()\n        os.rename(self.current_file, new_filename)  # Rename current file to new name\n        self.current_file = self.file_name\n        self.stream = open(self.current_file, 'a')\n        self.last_rollover = time.time()\n        self.manage_log_files()\n\n    def manage_log_files(self):\n        log_files = sorted(glob.glob(f\"{self.file_name}.*\"), key=os.path.getmtime)\n\n        while len(log_files) > self.max_log_files:\n            oldest_log = log_files.pop(0)\n            os.remove(oldest_log)\n\n        while self._total_size(log_files) > self.total_log_size:\n            if log_files:\n                oldest_log = log_files.pop(0)\n                os.remove(oldest_log)\n\n    def _total_size(self, files):\n        return sum(os.path.getsize(f) for f in files if os.path.exists(f))\n\n    def close(self):\n        self.stream.close()\n        super().close()"
  },
  {
    "path": "python/utils/logger_util.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"\n日志\n\"\"\"\nimport os\nimport sys\nimport uuid\nimport logging\nimport logging.handlers\nimport logging.config\nfrom threading import current_thread\nfrom typing import Optional\n\nLOGGING_CONFIG = {\n    \"version\": 1,\n    \"disable_existing_loggers\": False,\n    \"formatters\": {\n        \"standard\": {\n            \"format\": \"[%(asctime)s.%(msecs)03d] %(filename)s [line:%(lineno)d] %(levelname)s [%(logid)s] %(message)s\",\n        },\n    },\n    \"handlers\": {},\n    \"loggers\": {\n        \"appbuilder\": {\n            \"handlers\": [],\n            \"level\": \"INFO\",\n            \"propagate\": True,\n        },\n    },\n}\n\nCONSOLE_HEADER = {\n    \"level\": \"INFO\",\n    \"class\": \"logging.StreamHandler\",\n    \"formatter\": \"standard\",\n    \"stream\": \"ext://sys.stdout\",  # Use standard output\n}\n\nERROR_FILE_HEADER = {\n    \"level\": \"ERROR\",\n    \"class\": \"logging.FileHandler\",\n    \"filename\": \"tmp.error.log\",\n    \"formatter\": \"standard\",\n}\n\nFILE_HEADER = {\n    \"level\": \"DEBUG\",\n    \"class\": \"logging.FileHandler\",\n    \"filename\": \"tmp.info.log\",\n    \"formatter\": \"standard\",\n}\n\nERROR_SET_CONFIG_HEADER = {\n    'level': 'ERROR',\n    'formatter': 'standard',\n    'class': 'appbuilder.SizeAndTimeRotatingFileHandler',\n    'file_name': 'tmp.error.log',\n    'rotate_frequency': 'MIDDNIGHT',\n    'rotate_interval': 1,\n    'max_file_size': 5*1024*1024,\n    'max_log_files': 20,\n    'total_log_size': 100*1024*1024\n}\n\nSET_CONFIG_HEADER = {\n    'level': 'DEBUG',\n    'formatter': 'standard',\n    'class': 'appbuilder.SizeAndTimeRotatingFileHandler',\n    'file_name': 'tmp.info.log',\n    'rotate_frequency': 'MIDDNIGHT',\n    'rotate_interval': 1,\n    'max_file_size': 5*1024*1024,\n    'max_log_files': 20,\n    'total_log_size': 100*1024*1024\n}\n\nclass LoggerWithLoggerId(logging.LoggerAdapter):\n    \"\"\"\n    logger with logid\n    \"\"\"\n    def __init__(self, logger, extra, loglevel):\n        \"\"\"\n        init\n        \"\"\"\n        LOGGING_CONFIG[\"handlers\"] = {}\n        LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"] = []\n        log_file = os.environ.get(\"APPBUILDER_LOGFILE\", \"\")\n        log_path = os.environ.get(\"APPBUILDER_LOGPATH\", \"\")\n        loglevel = loglevel.strip().lower()\n        if loglevel not in [\"debug\", \"info\", \"warning\", \"error\"]:\n            raise ValueError(\"expected APPBUILDER_LOGLEVEL in [debug, info, warning, error], but got %s\" % loglevel)\n        loglevel = loglevel.upper()\n\n        if log_path:\n            current_pid = str(os.getpid())\n            full_log_path = os.path.join(log_path, \"log\")\n            if not os.path.exists(full_log_path):\n                os.makedirs(full_log_path)\n            info_log_file = os.path.join(log_path, \"log\", current_pid + \".info.log\")\n            error_log_file = os.path.join(log_path, \"log\", current_pid + \".error.log\")\n            FILE_HEADER[\"filename\"] = info_log_file\n            ERROR_FILE_HEADER[\"filename\"] = error_log_file\n            FILE_HEADER[\"level\"] = loglevel\n            LOGGING_CONFIG[\"handlers\"][\"file\"] = FILE_HEADER\n            LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].append(\"file\")\n            if loglevel in (\"DEBUG\", \"INFO\", \"WARNING\"):\n                LOGGING_CONFIG[\"handlers\"][\"error_file\"] = ERROR_FILE_HEADER\n                LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].append(\"error_file\")\n        elif log_file:\n            ERROR_FILE_HEADER[\"filename\"] = self._add_error_to_file_name(log_file)\n            FILE_HEADER[\"filename\"] = log_file\n            FILE_HEADER[\"level\"] = loglevel\n            LOGGING_CONFIG[\"handlers\"][\"file\"] = FILE_HEADER\n            LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].append(\"file\")\n            if loglevel in (\"DEBUG\", \"INFO\", \"WARNING\"):\n                LOGGING_CONFIG[\"handlers\"][\"error_file\"] = ERROR_FILE_HEADER\n                LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].append(\"error_file\")\n\n        CONSOLE_HEADER[\"level\"] = loglevel\n        LOGGING_CONFIG[\"handlers\"][\"console\"] = CONSOLE_HEADER\n        LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].append(\"console\")\n        LOGGING_CONFIG['loggers']['appbuilder']['level'] = loglevel\n        logging.config.dictConfig(LOGGING_CONFIG)\n        logging.LoggerAdapter.__init__(self, logger, extra)\n        self.logid_dict = {}\n\n    def set_auto_logid(self):\n        \"\"\"\n        set auto log_id\n        \"\"\"\n        self.logid_dict[current_thread().ident] = str(uuid.uuid4().int & (1 << 64) - 1)\n\n    def set_logid(self, logid):\n        \"\"\"\n        set log_id\n        \"\"\"\n        self.logid_dict[current_thread().ident] = logid\n\n    def get_logid(self):\n        \"\"\"\n        get log_id\n        \"\"\"\n        if current_thread().ident in self.logid_dict:\n            return self.logid_dict[current_thread().ident]\n        else:\n            return None\n\n    @property\n    def level(self):\n        \"\"\"\n        level\n        \"\"\"\n        return self.logger.level\n\n    @staticmethod\n    def _add_error_to_file_name(filename):\n        prefix = \"error.\"\n        dir_name, base_name = os.path.split(filename)\n        new_base_name = f\"{prefix}{base_name}\"\n        return os.path.join(dir_name, new_base_name)\n\n    def setFilename(self, filename):\n        \"\"\"\n        set filename\n        \"\"\"\n        if \"file\" not in LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"]:\n            FILE_HEADER[\"filename\"] = filename\n            LOGGING_CONFIG[\"handlers\"][\"file\"] = FILE_HEADER\n            LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].append(\"file\")\n        if \"error_file\" not in LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"]:\n            ERROR_FILE_HEADER[\"filename\"] = self._add_error_to_file_name(filename)\n            LOGGING_CONFIG[\"handlers\"][\"error_file\"] = ERROR_FILE_HEADER\n            LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].append(\"error_file\")\n        FILE_HEADER[\"filename\"] = filename\n        ERROR_FILE_HEADER[\"filename\"] = self._add_error_to_file_name(filename)\n        LOGGING_CONFIG[\"handlers\"][\"file\"] = FILE_HEADER\n        LOGGING_CONFIG[\"handlers\"][\"error_file\"] = ERROR_FILE_HEADER\n        logging.config.dictConfig(LOGGING_CONFIG)\n\n    def setLoglevel(self, level):\n        \"\"\"\n        set log level\n        \"\"\"\n        log_level = level.strip().lower()\n        if log_level not in [\"debug\", \"info\", \"warning\", \"error\"]:\n            raise ValueError(\"expected APPBUILDER_LOGLEVEL in [debug, info, warning, error], but got %s\" % log_level)\n        log_level = log_level.upper()\n        if \"file\" in LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"]:\n            FILE_HEADER[\"level\"] = log_level\n            LOGGING_CONFIG[\"handlers\"][\"file\"] = FILE_HEADER\n        if \"console\" in LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"] or not LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"]:\n            CONSOLE_HEADER[\"level\"] = log_level\n            LOGGING_CONFIG[\"handlers\"][\"console\"] = CONSOLE_HEADER\n        LOGGING_CONFIG['loggers']['appbuilder']['level'] = log_level\n        logging.config.dictConfig(LOGGING_CONFIG)\n\n    def setLogConfig(self,\n                    console_output: bool = True,\n                    loglevel: str = \"DEBUG\",\n                    log_path: str = \"/tmp\",\n                    rotate_frequency: str = \"MIDNIGHT\",\n                    rotate_interval: int = 1,\n                    max_file_size: Optional[int] = None, # 以B为单位\n                    total_log_size: Optional[int] = None, # 以B为单位\n                    max_log_files: Optional[int] = None,\n                    file_name: Optional[str] = None\n                    ):\n        LOGGING_CONFIG[\"handlers\"] = {}\n        LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"] = []\n\n        # log_level 数据校验\n        log_level = loglevel.strip().lower()\n        if log_level not in [\"debug\", \"info\", \"warning\", \"error\"]:\n            raise ValueError(\"expected APPBUILDER_LOGLEVEL in [debug, info, warning, error], but got %s\" % log_level)\n        log_level = log_level.upper()\n\n        # 设置console输出日志\n        if console_output:\n            CONSOLE_HEADER['level'] = loglevel\n            LOGGING_CONFIG[\"handlers\"][\"console\"] = CONSOLE_HEADER\n            LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].append(\"console\")\n        else:\n            LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"propagate\"] = False\n\n        # 参数验证\n        if not max_file_size or max_file_size <= 0:\n            max_file_size = sys.maxsize\n        if not total_log_size or total_log_size <= 0:\n            total_log_size = sys.maxsize\n        if not max_log_files or max_log_files <= 0:\n            max_log_files = sys.maxsize\n        if rotate_interval < 1:\n            rotate_interval = 1\n        rotate_frequency = rotate_frequency.strip().lower()\n        if rotate_frequency not in [\"s\", \"m\", \"h\", \"d\", \"midnight\"]:\n            raise ValueError(\"expected rotate_frequency in [S, M, H, D, MIDNIGHT], but got %s\" % rotate_frequency)\n\n        # 设置文件输出日志\n        # 设置日志级别\n        SET_CONFIG_HEADER['level'] = loglevel\n\n        # 设置文件名称\n        if not file_name:\n            current_pid = str(os.getpid())\n        else:\n            current_pid = file_name\n        full_log_path = os.path.join(log_path, \"log\")\n        if not os.path.exists(full_log_path):\n            os.makedirs(full_log_path)\n        info_log_file = os.path.join(log_path, \"log\", current_pid + \".info.log\")\n        error_log_file = os.path.join(log_path, \"log\", current_pid + \".error.log\")\n        SET_CONFIG_HEADER[\"file_name\"] = info_log_file\n        ERROR_SET_CONFIG_HEADER[\"file_name\"] = error_log_file\n\n        # 设置滚动时间\n        SET_CONFIG_HEADER['rotate_frequency'] = rotate_frequency\n        ERROR_SET_CONFIG_HEADER['rotate_frequency'] = rotate_frequency\n        SET_CONFIG_HEADER['rotate_interval'] = rotate_interval\n        ERROR_SET_CONFIG_HEADER['rotate_interval'] = rotate_interval\n\n        # 设置最大文件大小\n\n        SET_CONFIG_HEADER['max_file_size'] = max_file_size\n        ERROR_SET_CONFIG_HEADER['max_file_size'] = max_file_size\n\n        # 设置总大小限制\n        SET_CONFIG_HEADER['total_log_size'] = total_log_size\n        ERROR_SET_CONFIG_HEADER['total_log_size'] = total_log_size\n\n        # 设置备份数量\n        SET_CONFIG_HEADER['max_log_files'] = max_log_files\n        ERROR_SET_CONFIG_HEADER['max_log_files'] = max_log_files\n\n        LOGGING_CONFIG[\"handlers\"][\"file\"] = SET_CONFIG_HEADER\n        LOGGING_CONFIG[\"handlers\"][\"error_file\"] = ERROR_SET_CONFIG_HEADER\n        LOGGING_CONFIG[\"loggers\"][\"appbuilder\"][\"handlers\"].extend([\"file\", \"error_file\"])\n        LOGGING_CONFIG['loggers']['appbuilder']['level'] = loglevel\n        logging.config.dictConfig(LOGGING_CONFIG)\n\n    def process(self, msg, kwargs):\n        \"\"\"\n        processing\n        \"\"\"\n        if current_thread().ident in self.logid_dict:\n            # in process thread\n            if 'extra' not in kwargs:\n                kwargs['extra'] = {'logid': self.logid_dict[current_thread().ident]}\n            else:\n                kwargs['extra']['logid'] = self.logid_dict[current_thread().ident]\n        else:\n            # in main thread\n            if 'extra' not in kwargs:\n                kwargs['extra'] = {'logid': 'main-' + str(uuid.uuid4().int & (1 << 64) - 1)}\n            else:\n                kwargs['extra']['logid'] = 'main-' + str(uuid.uuid4().int & (1 << 64) - 1)\n\n        return msg, kwargs\n\n\ndef _setup_logging():\n    log_level = os.environ.get(\"APPBUILDER_LOGLEVEL\", \"INFO\")\n    log_level = log_level.strip().lower()\n\n    if log_level not in [\"debug\", \"info\", \"warning\", \"error\"]:\n        raise ValueError(\"expected APPBUILDER_LOGLEVEL in [debug, info, warning, error], but got %s\" % log_level)\n    return LoggerWithLoggerId(logging.getLogger('appbuilder'), {'logid': ''}, log_level.upper())\n\n\ndef get_logger(name, level=logging.INFO):\n    \"\"\"\n    Get logger from logging with given name, level and format without\n    setting logging basicConfig.\n\n    Args:\n        name (str): The logger name.\n        level (logging.LEVEL): The base level of the logger\n        fmt (str): Format of logger output\n\n    Returns:\n        logging.Logger: logging logger with given settings\n\n    Examples:\n        .. code-block:: python\n\n            logger = log_helper.get_logger(__name__, logging.INFO,\n                            fmt='%(asctime)s-%(levelname)s: %(message)s')\n    \"\"\"\n\n    logger = logging.getLogger(name)\n    logger.setLevel(level)\n    handler = logging.StreamHandler(sys.stdout)\n\n    formatter = logging.Formatter(\n        fmt='%(asctime)s: %(filename)s:%(lineno)d %(message)s', datefmt='%Y-%m-%d %H:%M:%S')\n    handler.setFormatter(formatter)\n\n    logger.addHandler(handler)\n\n    # stop propagate for propagating may print\n    # log multiple times\n    logger.propagate = False\n    return logger\n\n\nlogger = _setup_logging()\n"
  },
  {
    "path": "python/utils/model_util.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport json\nimport proto\nfrom typing import Optional, MutableSequence\nfrom pydantic import BaseModel, Field\nfrom appbuilder.utils.func_utils import deprecated\nimport appbuilder\nfrom appbuilder.core._client import HTTPClient\nfrom appbuilder.utils.trace.tracer_wrapper import list_trace\n\nr\"\"\"模型名称到简称的映射.\n\"\"\"\n# Note(chengmo): 模型名称到简称的映射，是一个1:n的映射关系，之前的假设是模型与简称一一对应\n# 实际上，模型名称和简称之间存在多对一的关系，因此这里不能仅使用一个字典来存储名称映射信息\nmodel_name_mapping = [\n    (\"ERNIE-Bot 4.0\", \"eb-4\"),\n    (\"ERNIE-Bot\", \"eb\"),\n    (\"ERNIE-Bot-turbo\", \"eb-turbo\"),\n    (\"EB-turbo-AppBuilder专用版\", \"eb-turbo-appbuilder\"),\n    (\"EB-turbo-AppBuilder专用版\", \"ernie_speed_appbuilder\"),\n]\n\nclass RemoteModel(object):\n    r\"\"\"远程模型类，用于封装远程模型的名称信息.\n         参数:\n            name(str):\n                模型名称。\n            short_name(str):\n                模型简称, 可能存在多个\n         \"\"\"\n    def __init__(self, remote_name: str):\n        self.remote_name = remote_name\n        self.short_names = []\n    \n    def register_short_name(self, short_name: str):\n        r\"\"\"注册模型简称.\n         参数:\n            short_name(str):\n                模型简称。\n         \"\"\"\n        if short_name not in self.short_names:\n            self.short_names.append(short_name)\n\n    def get_remote_name_by_short_name(self, short_name: str) -> Optional[str]:\n        r\"\"\"根据模型简称获取模型名称.\n         参数:\n            short_name(str):\n                模型简称。\n         \"\"\"\n        # TODO(chengmo): 使用logging 替换 print，解决print多次的问题\n        if short_name == \"eb-turbo-appbuilder\":\n            print(\"Deprecate warning: model [eb-turbo-appbuilder] is deprecated, please use [DeepSeek-V3.1]\")\n\n        if short_name in self.short_names:\n            return self.remote_name\n        return None\n\nclass RemoteModelCollector():\n    r\"\"\"远程模型收集器，用于收集远程模型信息. 是一个全局单例\n    有两个核心功能：\n    1、注册远程模型名和本地short_name\n    2、根据short_name获取远程模型名\n    \"\"\"\n    _instance = None\n    _initialized = False\n\n    def __init__(self):\n        if self._initialized:\n            return\n        self._initialized = True\n        self.remote_models = {}\n\n    def __new__(cls, *args, **kwargs):\n        \"\"\"\n        单例模式\n        \"\"\"\n        if cls._instance is None:\n            cls._instance = object.__new__(cls)\n        return cls._instance\n    \n    def register_remote_model_name(self, remote_name: str, short_name: str):\n        r\"\"\"注册远程模型名和本地short_name.\n         参数:\n            remote_name(str):\n                远程模型名称。\n            short_name(str):\n                模型简称。\n         \"\"\"\n        if remote_name not in self.remote_models:\n            self.remote_models[remote_name] = RemoteModel(remote_name)\n        \n        self.remote_models[remote_name].register_short_name(short_name)\n    \n    def get_remote_name_by_short_name(self, short_name: str) -> Optional[str]:\n        r\"\"\"根据short_name获取远程模型名.\n         参数:\n            short_name(str):\n                模型简称。\n         \"\"\"\n        for remote_model in self.remote_models.values():\n            remote_name = remote_model.get_remote_name_by_short_name(short_name)\n            if remote_name is not None:\n                return remote_name\n        \n        return None\n\n\nremote_model_collector = RemoteModelCollector()\nfor remote_name, short_name in model_name_mapping:\n    remote_model_collector.register_remote_model_name(remote_name, short_name)\n\nclass GetModelListRequest(proto.Message):\n    r\"\"\"获取模型列表请求体\n         参数:\n            apiTypefilter(str):\n                根据apiType过滤，[\"chat\", \"completions\", \"embeddings\", \"text2image\"]，不填包括所有的。\n         \"\"\"\n    apiTypefilter: MutableSequence[str] = proto.RepeatedField(\n        proto.STRING,\n        number=1\n    )\n\n\nclass GetModelListResponse(proto.Message):\n    r\"\"\"获取模型列表返回体\n         参数:\n            request_id(str):\n                网关层的请求ID.\n            log_id(str):\n                请求ID。\n            success(bool):\n                是否成功的返回。\n            error_code(int):\n                错误码。\n            error_msg(str):\n                错误信息。\n            result(ModelListResult):\n                模型列表。\n         \"\"\"\n    request_id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n\n    log_id: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n\n    success: bool = proto.Field(\n        proto.BOOL,\n        number=3,\n    )\n\n    error_code: int = proto.Field(\n        proto.INT32,\n        number=4,\n    )\n\n    error_msg: str = proto.Field(\n        proto.STRING,\n        number=5,\n    )\n    result: \"ModelListResult\" = proto.Field(\n        proto.MESSAGE,\n        number=6,\n        message=\"ModelListResult\",\n    )\n\n\nclass ModelListResult(proto.Message):\n    r\"\"\"模型列表\n         参数:\n            common(ModelData):\n                预置服务模型信息。\n            custom(ModelData):\n                自定义服务模型信息。\n         \"\"\"\n    common: MutableSequence[\"ModelData\"] = proto.RepeatedField(\n        proto.MESSAGE,\n        number=1,\n        message=\"ModelData\",\n    )\n\n    custom: MutableSequence[\"ModelData\"] = proto.RepeatedField(\n        proto.MESSAGE,\n        number=2,\n        message=\"ModelData\",\n    )\n\n\nclass ModelData(proto.Message):\n    r\"\"\"模型基本信息\n         参数:\n            name(str):\n                服务名称。\n            url(int):\n                服务endpoint。\n            apiType(str):\n                服务类型：chat、completions、embeddings、text2image。\n            chargeStatus(int):\n                付费状态。\n            versionList(int):\n                服务版本列表。\n         \"\"\"\n    name: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n\n    url: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n\n    apiType: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    chargeStatus: str = proto.Field(\n        proto.STRING,\n        number=4,\n    )\n\n    versionList: MutableSequence[\"Version\"] = proto.RepeatedField(\n        proto.MESSAGE,\n        number=5,\n        message=\"Version\",\n    )\n\n\nclass Version(proto.Message):\n    r\"\"\"服务版本\n         参数:\n            id(str):\n                服务版本id，仅自定义服务有该字段。\n            aiModelId(str):\n                发布该服务版本的模型id，仅自定义服务有该字段。\n            aiModelVersionId(str):\n                发布该服务版本的模型版本id，仅自定义服务有该字段。\n            trainType(str):\n                服务基础模型类型。\n            serviceStatus(str):\n                服务状态。\n         \"\"\"\n    id: str = proto.Field(\n        proto.STRING,\n        number=1,\n    )\n    aiModelId: str = proto.Field(\n        proto.STRING,\n        number=2,\n    )\n    aiModelVersionId: str = proto.Field(\n        proto.STRING,\n        number=3,\n    )\n    trainType: str = proto.Field(\n        proto.STRING,\n        number=4,\n    )\n    serviceStatus: str = proto.Field(\n        proto.STRING,\n        number=5,\n    )\n\n\nclass GetModelListRequestV2(BaseModel):\n    \"\"\"\n    获取模型列表v2请求体\n    参数：\n        refresh_type(str):\n            获取模型列表的方式：[\"tolerant\", \"original\"]\n        force_refresh(bool):\n            是否强制刷新缓存\n    \"\"\"\n    refresh_type: str = Field(default=\"tolerant\")\n    force_refresh: bool = Field(default=False)\n\n\nclass BaseModelInfo(BaseModel):\n    serviceId: str = Field()\n    name: str = Field()\n    url: str = Field()\n    serviceType: str = Field()\n    chargeStatus: str = Field()\n    protocolVersion: int = Field()\n    supportedProtocolVersions: Optional[list] = Field(default=[2])\n    marker: Optional[str] = None\n    maxContextTokens: Optional[int] = None\n    maxInputTokens: Optional[int] = None\n    maxOutputTokens: Optional[int] = None\n    reasoningModel: Optional[bool] = Field()\n    supportsSearch: Optional[bool] = Field()\n\n\nclass CommonModelV2(BaseModelInfo, extra='allow'):\n    \"\"\"\n    预置模型信息\n    \"\"\"\n    isPublic: bool = Field()\n    chargeType: str = Field()\n    modelCallName: Optional[str] = None\n\n\nclass CustomModelV2(BaseModelInfo, extra='allow'):\n    \"\"\"\n    定制模型信息\n    \"\"\"\n\n    runStatus: str = Field()\n    baseModel: str = Field()\n    modelId: str = Field()\n    modelCallName: Optional[str] = None\n\n\nclass GetModelListResponseResult(BaseModel):\n    \"\"\"\n    获取模型列表v2返回的result字段\n    参数：\n        common(list): 预置模型\n        custom(list): 定制模型\n    \"\"\"\n    common: list[CommonModelV2] = Field(default=[])\n    custom: list[CustomModelV2] = Field(default=[])\n\n\nclass GetModelListResponseV2(BaseModel):\n    \"\"\"\n    获取模型列表的响应\n    参数：\n        code: int\n        message: str\n        result: dict, 响应结果，包含预置模型和定制模型\n    \"\"\"\n    code: int = Field(default=0)\n    message: str = Field(default=\"\")\n    result: GetModelListResponseResult = Field(default={})\n\n\nclass Models:\n    r\"\"\"\n    模型工具类，提供模型列表接口。\n     \"\"\"\n\n    def __init__(self,\n                 client: HTTPClient = None,\n                 secret_key: Optional[str] = None,\n                 gateway: str = \"\"\n                 ):\n        r\"\"\"Models初始化方法.\n\n            参数:\n                client(obj:`HTTPClient`): 客户端实例，用于发送请求。\n                secret_key(str,可选): 用户鉴权token, 默认从环境变量中获取: os.getenv(\"APPBUILDER_TOKEN\", \"\").\n                gateway(str, 可选): 后端网关服务地址，默认从环境变量中获取: os.getenv(\"GATEWAY_URL\", \"\")\n            返回：\n                无\n        \"\"\"\n        self.http_client = client or HTTPClient(secret_key, gateway)\n\n    @list_trace\n    @deprecated(version=\"1.1.0\")\n    def list(self, request: GetModelListRequest = None, timeout: float = None,\n             retry: int = 0) -> GetModelListResponse:\n        \"\"\"\n        返回用户的模型列表信息。\n\n        参数:\n            request (obj:`GetModelListRequest`):模型列表查询请求体。\n            timeout (float, 可选): 请求的超时时间。\n            retry (int, 可选): 请求的重试次数。\n\n        返回:\n            obj:`GetModelListResponse`: 模型列表返回体。\n        \"\"\"\n        url = self.http_client.service_url(\"/v1/bce/wenxinworkshop/service/list\")\n        if request is None:\n            request = GetModelListRequest()\n        data = GetModelListRequest.to_json(request)\n        headers = self.http_client.auth_header()\n        headers['content-type'] = 'application/json'\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        response = self.http_client.session.post(url, data=data, headers=headers, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        response = GetModelListResponse.from_json(payload=json.dumps(data),  ignore_unknown_fields=True)\n        response.request_id = request_id\n        return response\n\n    def list_v2(self, request: GetModelListRequestV2 = None, timeout: float = None,\n             retry: int = 0) -> GetModelListResponseV2:\n        \"\"\"\n        返回用户的模型列表信息。\n        参数:\n            request (obj:`GetModelListRequest`):模型列表查询请求体。\n            timeout (float, 可选): 请求的超时时间。\n            retry (int, 可选): 请求的重试次数。\n\n        返回:\n            obj:`GetModelListResponseV2`: 模型列表返回体。\n        \"\"\"\n        url = self.http_client.service_url(\n            prefix = \"/api/v1/ai_engine/copilot_engine\", \n            sub_path= \"/v1/api/workspace/qianfan_models_v2/user\"\n        )\n        if request is None:\n            request = GetModelListRequestV2()\n        data = GetModelListRequestV2.model_validate(request)\n        headers = self.http_client.auth_header()\n        headers['content-type'] = 'application/json'\n        if retry != self.http_client.retry.total:\n            self.http_client.retry.total = retry\n        response = self.http_client.session.post(url, data=data.model_dump_json(), headers=headers, timeout=timeout)\n        self.http_client.check_response_header(response)\n        data = response.json()\n        self.http_client.check_response_json(data)\n        request_id = self.http_client.response_request_id(response)\n        self.__class__._check_service_error(request_id, data)\n        response = GetModelListResponseV2.model_validate(data)\n        return response\n\n    @staticmethod\n    def _check_service_error(request_id: str, data: dict):\n        r\"\"\"服务response参数检查\n\n            参数:\n                data (dict) : body返回\n            返回：\n                无\n        \"\"\"\n        if \"error_code\" in data and \"error_msg\" in data:\n            if data[\"error_code\"] != 0:\n                raise appbuilder.AppBuilderServerException(\n                    request_id=request_id,\n                    service_err_code=data[\"error_code\"],\n                    service_err_message=data[\"error_msg\"])\n"
  },
  {
    "path": "python/utils/sse_util.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"\nSSE Client util\n\"\"\"\nfrom appbuilder.utils.logger_util import logger\nimport logging\nimport aiohttp\n\n\nclass SSEClient:\n    \"\"\"\n    一个简易的SSE Client，用于接收服务端发送的SSE事件。\n    \"\"\"\n\n    def __init__(self, event_source, char_enc=\"utf-8\"):\n        \"\"\"\n        通过现有的事件源初始化 SSE 客户端。\n        事件源应为二进制流，并具有 close() 方法。\n        这通常是实现 io.BinaryIOBase 的东西，比如 httplib 或 urllib3HTTPResponse 对象。\n        \"\"\"\n        logger.debug(f\"Initialized SSE client from event source {event_source}\")\n        self._event_source = event_source\n        self._char_enc = char_enc\n\n    def _read(self):\n        \"\"\"\n        读取传入的事件源流并生成事件块。\n        不幸的是，有些服务器可能会决定在响应中将事件分解为多个HTTP块。\n        因此，有必要正确地将连续的响应块缝合在一起，并找到SSE分隔符（空的新行），以生成完整、正确的事件块。\n        \"\"\"\n        data = b\"\"\n        for chunk in self._event_source:\n            for line in chunk.splitlines(True):\n                data += line\n                if data.endswith((b\"\\r\\r\", b\"\\n\\n\", b\"\\r\\n\\r\\n\")):\n                    yield data\n                    data = b\"\"\n        if data:\n            yield data\n\n    def events(self):\n        \"\"\"\n        从给定的输入流中读取 Server-Side-Event (SSE) 数据，并生成解析后的 Event 对象。\n\n        Args:\n            无\n\n        Returns:\n            generator: 解析后的 Event 对象的生成器。\n        \"\"\"\n        for chunk in self._read():\n            event = Event()\n            # Split before decoding so splitlines() only uses \\r and \\n\n            for line in chunk.splitlines():\n                # Decode the line.\n                line = line.decode(self._char_enc)\n                # Lines starting with a separator are comments and are to be\n                # ignored.\n                if not line.strip() or line.startswith(\":\"):\n                    continue\n                logger.debug(f\"raw line: {line}\")\n                data = line.split(\":\", 1)\n                field = data[0]\n                # Ignore unknown fields.\n                if field not in event.__dict__:\n                    event.raw += line\n                    logger.debug(\n                        f\"Saw invalid field {field} while parsing Server Side Event\"\n                    )\n                    continue\n\n                if len(data) > 1:\n                    # From the spec:\n                    # \"If value starts with a single U+0020 SPACE character,\n                    # remove it from value.\"\n                    if data[1].startswith(\" \"):\n                        value = data[1][1:]\n                    else:\n                        value = data[1]\n                else:\n                    # If no value is present after the separator,\n                    # assume an empty value.\n                    value = \"\"\n                # The data field may come over multiple lines and their values\n                # are concatenated with each other.\n                if field == \"data\":\n                    event.__dict__[field] += value + \"\\n\"\n                    event.raw += value + \"\\n\"\n                else:\n                    event.__dict__[field] = value\n                    event.raw += value\n\n            # Events with no data are not dispatched.\n            if not event.data:\n                if event.raw:\n                    # unknown error\n                    pass\n                else:\n                    continue\n            else:\n                # If the data field ends with a newline, remove it.\n                if event.data.endswith(\"\\n\"):\n                    event.data = event.data[0:-1]\n            # Empty event names default to 'message'\n            event.event = event.event or \"message\"\n            # Dispatch the event\n            if logger.getEffectiveLevel() == logging.DEBUG:\n                logger.debug(f\"Dispatching {event.debug_str}...\")\n            else:\n                logger.debug(f\"Dispatching {event}...\")\n            yield event\n\n    def close(self):\n        \"\"\"\n        手动关闭事件源流。\n        \"\"\"\n        self._event_source.close()\n\n\nclass AsyncSSEClient:\n    \"\"\"\n    一个简易的SSE Client，用于接收服务端发送的SSE事件。\n    \"\"\"\n    def __init__(self, response, char_enc='utf-8'):\n        \"\"\"\n        通过现有的事件源response初始化 SSE 客户端。\n        response应为aiohttp.ClientResponse实例\n        \"\"\"\n        self._response = response\n        self._char_enc = char_enc\n\n    async def _read(self):\n        \"\"\"\n        读取传入的事件源流并生成事件块。\n        \"\"\"\n        data = b''\n        async for chunk in self._response.content.iter_any():\n            for line in chunk.splitlines(True):\n                data += line\n                if data.endswith((b'\\r\\r', b'\\n\\n', b'\\r\\n\\r\\n')):\n                    yield data\n                    data = b''\n        if data:\n            yield data\n\n    async def events(self):\n        \"\"\"\n        从给定的输入流中读取 Server-Side-Event (SSE) 数据，并生成解析后的 Event 对象。\n        Returns:\n            generator: 解析后的 Event 对象的生成器。\n        \"\"\"\n        async for chunk in self._read():\n            event = Event()\n            # Split before decoding so splitlines() only uses \\r and \\n\n            for line in chunk.splitlines():\n                # Decode the line.\n                line = line.decode(self._char_enc)\n                # Lines starting with a separator are comments and are to be ignored.\n                if not line.strip() or line.startswith(':'):\n                    continue\n\n                data = line.split(':', 1)\n                field = data[0]\n                # Ignore unknown fields.\n                if field not in event.__dict__:\n                    event.raw += line\n                    continue\n\n                if len(data) > 1:\n                    # From the spec:\n                    # \"If value starts with a single U+0020 SPACE character,\n                    # remove it from value.\"\n                    if data[1].startswith(' '):\n                        value = data[1][1:]\n                    else:\n                        value = data[1]\n                else:\n                    # If no value is present after the separator,\n                    # assume an empty value.\n                    value = ''\n\n                # The data field may come over multiple lines and their values are concatenated with each other.\n                if field == 'data':\n                    event.__dict__[field] += value + '\\n'\n                    event.raw += value + '\\n'\n                else:\n                    event.__dict__[field] = value\n                    event.raw += value\n\n            # Events with no data are not dispatched.\n            if not event.data:\n                continue\n\n            # If the data field ends with a newline, remove it.\n            if event.data.endswith('\\n'):\n                event.data = event.data[0:-1]\n\n            # Empty event names default to 'message'\n            event.event = event.event or 'message'\n            \n            yield event\n\n\nclass Event(object):\n    \"\"\"\n    事件流中的事件。\n    \"\"\"\n\n    def __init__(self, id=None, event=\"message\", data=\"\", retry=None):\n        self.id = id\n        self.event = event\n        self.data = data\n        self.retry = retry\n        self.raw = \"\"\n\n    def __str__(self):\n        s = f\"{self.event} event\"\n        if self.id:\n            s += f\" #{self.id}\"\n        if self.data:\n            s += f\", {len(self.data)} byte\"\n        else:\n            s += \", no data\"\n        if self.retry:\n            s += f\", retry in {self.retry} ms\"\n        return s\n\n    @property\n    def debug_str(self):\n        s = f\"{self.event} event\"\n        if self.id:\n            s += f\" #{self.id}\"\n        if self.data:\n            s += f\", {len(self.data)} byte, DATA<<{self.data}>>\"\n        else:\n            s += \", no data\"\n        if self.raw:\n            s += f\", RAW<<{self.raw}>>\"\n        else:\n            s += \", no raw\"\n        if self.retry:\n            s += f\", retry in {self.retry} ms\"\n        return s\n"
  },
  {
    "path": "python/utils/trace/__init__.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License."
  },
  {
    "path": "python/utils/trace/_function.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport time\nimport json\nimport inspect\nfrom opentelemetry import trace\nfrom pydantic import BaseModel\nfrom appbuilder import Message\n\nfrom appbuilder import AppbuilderTraceException\nfrom appbuilder.core.component import ComponentOutput\n\nimport logging\nlogging.basicConfig(level=logging.INFO)\n\ndef _time(start_time,end_time,span):\n    \"\"\"\n    设置时间跨度属性为两个时间点的差值（秒）。\n    \n    Args:\n        start_time (float): 开始时间的时间戳（秒为单位）。\n        end_time (float): 结束时间的时间戳（秒为单位）。\n        span (object): OpenTelemetry的Span对象，用于设置时间跨度属性。\n    \n    Returns:\n        None: 该函数不返回任何值，直接在传入的span对象上设置属性。\n    \n    \"\"\"\n    span.set_attribute('time.cost-time',str(end_time-start_time)+'s')\n\ndef _build_curl_from_post(url, headers, json_body, timeout) -> str:\n        \"\"\"\n        从 POST 请求参数生成 cURL 命令。\n        \n        Args:\n            url (str): 请求的 URL 地址。\n            headers (dict): 请求头信息，以字典形式传入。\n            json_body (dict): JSON 格式的请求体数据，以字典形式传入。\n            timeout (int, optional): 请求的超时时间（秒）。默认为 None，表示不设置超时时间。\n        \n        Returns:\n            str: 生成的 cURL 命令字符串。\n        \n        \"\"\"\n        curl = f\"curl -L '{url}' \\\\\\n\"\n        header_lines = [f\"-H '{k}: {v}' \\\\\" for k, v in headers.items() if k != 'Content-Length']\n        if header_lines:\n            header_lines[-1] = header_lines[-1].rstrip(\" \\\\\")\n        curl += \"\\n\".join(header_lines)\n        \n        if json_body:\n            body = f\"'{json.dumps(json_body, ensure_ascii=False)}'\"\n            curl += f\" \\\\\\n-d {body}\"\n        \n        if timeout is not None:\n            curl += f\" \\\\\\n--max-time {timeout}\"\n            \n        return curl\n\n\ndef _post_input(args,kwargs,span):\n    \"\"\"\n    使用 POST 请求发送数据并记录相关属性到 span 中。\n    \n    Args:\n        args (tuple): 元组，其中最后一个元素是发送 POST 请求的 URL。\n        kwargs (dict): 字典，包含以下可选参数：\n            - headers (dict): HTTP 请求头，以字典形式表示。\n            - json (dict, optional): 发送的 JSON 数据体，默认为 None。\n            - timeout (int, optional): 请求超时时间（秒），默认为 None。\n        span (object): OpenTelemetry 的 span 对象，用于记录相关属性。\n    \n    Returns:\n        None: 该函数没有返回值，主要用于发送 POST 请求并记录相关信息。\n    \n    \"\"\"\n    url = kwargs.get('url',None)\n    if not url:        \n        url = args[-1]\n    curl=_build_curl_from_post(\n        url=url, \n        headers=kwargs['headers'], \n        json_body=kwargs.get('json',None), \n        timeout=kwargs.get('timeout',None), \n        )\n    span.set_attribute(\"input.value\",\"{}\".format(curl))\n\n\ndef _input(args,kwargs,span):\n    \"\"\"\n    将函数参数转化为字符串形式并存储在字典中，然后将字典转化为JSON字符串并设置为span的属性。\n    \n    Args:\n        args (tuple): 函数的位置参数元组。\n        kwargs (dict): 函数的关键字参数字典。\n        span (opentracing.Span): 用于记录日志的OpenTracing span对象。\n    \n    Returns:\n        None: 此函数没有返回值，主要用于设置span的属性。\n    \n    Raises:\n        无特定异常抛出，但如果在处理参数或设置span属性时发生异常，将打印异常信息。\n    \n    \"\"\"\n    input_dict={}\n    type_name = (bool,str,bytes,int,float,list,dict)\n    sig = inspect.signature(args[0])\n    params = sig.parameters\n    try:\n        if args:\n            for idx, value in enumerate(list(args)):\n                if isinstance(value, type_name):\n                    input_dict[list(params)[idx-1]] = str(value)\n                elif isinstance(value, Message):\n                    input_dict[list(params)[idx-1]] = str(value)\n            for key, value in dict(kwargs).items():\n                if isinstance(value, type_name):\n                    input_dict[key] = value\n                elif isinstance(value, Message):\n                    input_dict[key] = str(value)\n        if input_dict:\n            if os.environ.get('OPENINFERENCE_TRACE','true') == 'true' and os.environ.get('SENTRY_DSN', None):\n                span.set_data(\"input-value\",json.dumps(input_dict, ensure_ascii=False))\n            else:\n                span.set_attribute(\"input.value\",json.dumps(input_dict, ensure_ascii=False))\n    except Exception as e:\n        raise AppbuilderTraceException(e)\n\ndef _client_tool_trace_output_deep_iterate(output,span):\n    \"\"\"\n    对输出进行深度遍历，并将结果以JSON格式记录到span的属性中\n    \n    Args:\n        output (dict, bool, str, bytes, int, float, list): 需要遍历的输出对象\n        span (Span): 用于记录输出结果的span对象\n    \n    Returns:\n        None\n    \n    \"\"\"\n    input_dict={}\n    type_name = (bool,str,bytes,int,float,list)\n   \n    if isinstance(output, dict):\n        for key, value in output.items():\n            if isinstance(value, type_name):\n                input_dict[key] = str(value)\n        span.set_attribute(\"output.value\",json.dumps(input_dict, ensure_ascii=False))\n    else:\n        if isinstance(output, type_name):\n            span.set_attribute(\"output.value\",str(output))\n\ndef _client_trace_generator(generator, tracer, parent_context):\n    \"\"\"\n    用于生成客户端跟踪信息的生成器函数。\n    \n    Args:\n        generator (Iterator): 消息生成器。\n        tracer (Tracer): OpenTelemetry 追踪器实例。\n        parent_context (SpanContext): 父级上下文。\n    \n    Returns:\n        Generator: 带有跟踪信息的消息生成器。\n    \n    \"\"\"\n    with tracer.start_as_current_span('AppBuilderClient-Stream-RUN', context = parent_context) as span:\n        span.set_attribute(\"openinference.span.kind\", 'agent')\n        result_str = ''\n        prompt_tokens = 0\n        completion_tokens = 0\n        total_tokens = 0\n        run_list = []\n        try:\n            new_span = tracer.start_span('Client-Stream')\n            for message in generator:\n                new_span.set_attribute(\"openinference.span.kind\", 'agent')\n                context_message_str = \"\"\n                has_reference = False\n\n                context_message_list = None\n                if hasattr(message, 'events') and message.events and hasattr(message.events[0], 'detail') and message.events[0].detail:\n                    context_message_list = message.events[0].detail.get('references', None)\n\n                if context_message_list:\n                    for context_message in context_message_list:\n                        for context_message_key, context_message_value in context_message.items():\n                            context_message_str += '{}: {}\\n'.format(context_message_key, context_message_value)\n                            has_reference = True\n                        context_message_str += '\\n'\n\n                if has_reference:\n                    new_span.set_attribute(\"input.value\", 'Context(上下文) For RAG:\\n{}'.format(context_message_str))\n\n                new_span.set_attribute(\"output.value\", \"{}\".format(message.model_dump_json(indent=4)))\n\n                result_str += str(message.answer)\n\n                if hasattr(message, 'events') and message.events and hasattr(message.events[0], 'event_type') and hasattr(message.events[0], 'status'):\n                    run_list.append('{}[status:{}]'.format(message.events[0].event_type, message.events[0].status))\n\n                if hasattr(message, 'events') and message.events and hasattr(message.events[0], 'usage') and message.events[0].usage:\n                    prompt_tokens = message.events[0].usage.prompt_tokens\n                    completion_tokens = message.events[0].usage.completion_tokens\n                    total_tokens = message.events[0].usage.total_tokens\n                new_span.end()\n                new_span = tracer.start_span('Client-Stream')\n                yield message\n        except Exception as e:\n            raise AppbuilderTraceException(str(e))  \n        finally:\n            span.set_attribute(\"output.value\", result_str)\n            span.set_attribute(\"llm.token_count.prompt\", prompt_tokens)\n            span.set_attribute(\"llm.token_count.completion\", completion_tokens)\n            span.set_attribute(\"llm.token_count.total\", total_tokens)\n            span.set_attribute(\"Agent-Running-Process\", '==>'.join(run_list))\n        \n        \ndef _client_run_trace_stream(tracer, func, *args, **kwargs):\n    \"\"\"\n    跟踪客户端运行流处理函数，并记录相关的跟踪信息。\n    \n    Args:\n        tracer (Tracer): OpenTelemetry Tracer 实例，用于生成和设置 span。\n        func (Callable[..., Any]): 客户端运行的函数，通常是一个返回流处理结果的函数。\n        *args: 可变位置参数，传递给 func 的参数。\n        **kwargs: 可变关键字参数，传递给 func 的参数。\n    \n    Returns:\n        Any: 函数的返回值，通常是一个包含流处理结果的响应对象。\n    \n    \"\"\"\n    with tracer.start_as_current_span('AppBuilderClient-Stream-RUN', context=None) as parent_span:\n        parent_context = trace.set_span_in_context(parent_span)\n        parent_span.set_attribute(\"openinference.span.kind\", 'Agent')\n        start_time = time.time()\n        result = func(*args, **kwargs)\n        \n        _input(args=args, kwargs=kwargs, span=parent_span)\n        \n        generator = result.content\n        result.content = _client_trace_generator(generator=generator, tracer=tracer, parent_context=parent_context)\n        \n        end_time = time.time()\n        _time(start_time=start_time, end_time=end_time, span=parent_span)\n    return result\n\ndef _client_run_trace_un_stream(tracer, func, *args, **kwargs):\n    \"\"\"\n    执行函数func，并追踪其运行过程，同时记录相关性能指标和事件信息。\n    \n    Args:\n        tracer (Any): 追踪器对象，用于开始、结束和设置span属性。\n        func (Callable[..., Any]): 要执行的函数。\n        *args: 可变位置参数，传递给func的参数。\n        **kwargs: 可变关键字参数，传递给func的参数。\n    \n    Returns:\n        Any: 函数func的返回值。\n    \n    \"\"\"\n    with tracer.start_as_current_span('AppBuilderClient-RUN') as span:\n        start_time = time.time()\n        result = func(*args, **kwargs)\n        span.set_attribute(\"openinference.span.kind\", 'Agent')\n        _input(args=args, kwargs=kwargs, span=span)\n        run_list = []\n        prompt_tokens = 0\n        completion_tokens = 0\n        total_tokens = 0\n\n        span.set_attribute(\"output.value\", result.content.answer)\n        events = result.content.events\n        for event in events:\n            run_list.append('{}[status:{}]'.format(event.event_type, event.status))\n            if hasattr(event, 'usage') and event.usage and hasattr(event.usage, 'prompt_tokens'):\n                prompt_tokens = event.usage.prompt_tokens\n                completion_tokens = event.usage.completion_tokens\n                total_tokens = event.usage.total_tokens\n\n        if total_tokens:\n            span.set_attribute(\"llm.token_count.prompt\", prompt_tokens)\n            span.set_attribute(\"llm.token_count.completion\", completion_tokens)\n            span.set_attribute(\"llm.token_count.total\", total_tokens)\n        span.set_attribute(\"Agent-Running-Process\", '==>'.join(run_list))\n\n        end_time = time.time()\n        _time(start_time=start_time, end_time=end_time, span=span)\n\n        return result\n\n\n\ndef _output(output, span):\n    \"\"\"\n    将输出值转换为字符串并设置到span的属性中\n    \n    Args:\n        output (Any): 待输出的值，可以是任意类型，但如果是BaseModel或其子类或类对象，将使用model_dump_json方法进行序列化\n        span (Span): Jaeger的Span对象，用于记录跟踪信息\n    \n    Returns:\n        None: 此函数不返回任何值，但会将输出值转换为字符串并设置到span的属性中\n    \n    Raises:\n        无: 此函数不引发任何异常\n    \n    \"\"\"\n    type_name = (bool,str,bytes,int,float,list,dict)\n    if isinstance(output, BaseModel) or inspect.isclass(output):\n        span.set_attribute(\"output.value\", \"{}\".format(output.model_dump_json(indent=4)))\n    elif isinstance(output, type_name):\n        _client_tool_trace_output_deep_iterate(output=output,span=span)\n\n\ndef _tool_name(args):\n    \"\"\"\n    根据传入的函数或方法对象，返回其工具名称。\n    \n    Args:\n        args (tuple): 包含单个元素的元组，该元素为函数或方法对象。\n    \n    Returns:\n        str: 返回字符串，表示函数或方法的工具名称。\n    \n            - 如果函数或方法是类的实例方法，则返回形如\"类名-方法名\"的字符串。\n            - 如果函数或方法不是类的实例方法，则直接返回函数或方法名。\n    \n    \"\"\"\n\n    class_name = args[0].__qualname__.split('.')[0]\n    function_name = args[0].__name__\n    if class_name == function_name:\n        return \"{}\".format(function_name) \n    else:\n        return \"{}-{}\".format(class_name,function_name)\n    \n\ndef _assistant_output(output, span):\n    \"\"\"\n    设置span的属性，将output的模型转储为JSON格式的字符串并赋值给span的output.value属性。\n    \n    Args:\n        output (Any): 任意类型的数据，预期是包含模型转储功能的对象。\n        span (Span): 用于设置属性的span对象。\n    \n    Returns:\n        None: 该函数不返回任何值，而是通过修改span对象来实现功能。\n    \n    \"\"\"\n    span.set_attribute(\"output.value\", \"{}\".format(output.model_dump_json(indent=4)))\n\ndef _assistant_stream_run_with_handler_output(generator , tracer, parent_context):\n    \"\"\"\n    执行带有处理函数输出的辅助流。\n    \n    Args:\n        generator (Generator): 一个生成器，用于产生消息。\n        tracer (Tracer): OpenTelemetry 追踪器实例。\n        parent_context (Context): 父级上下文，用于追踪的上下文。\n    \n    Returns:\n        Generator: 一个生成器，产生消息并可能包含额外的输出信息。\n    \n    \"\"\"\n    with tracer.start_as_current_span(\"Assistant-stream_run_with_handler\", context=parent_context) as span:\n        span.set_attribute(\"openinference.span.kind\",'Agent')\n        result = ''\n        output_list = []\n        try:\n            new_span = tracer.start_span('Assistant-Stream_run_with_handler')\n            for message in generator:\n                new_span.set_attribute(\"openinference.span.kind\",'agent')\n                if isinstance(message, BaseModel):\n                    new_span.set_attribute(\"output.value\", \"{}\".format(message.model_dump_json(indent=4)))\n                else:\n                    new_span.set_attribute(\"output.value\", \"{}\".format(json.dumps(message, ensure_ascii=False)))\n                if hasattr(message, 'content') and message.content and message.content[0]:\n                    if hasattr(message.content[0], 'text') and message.content[0].text:\n                        if hasattr(message.content[0].text, 'value') and message.content[0].text.value: \n                            output_list.append(message.content[0].text.value)\n                new_span.end()\n                new_span = tracer.start_span('Assistant-Stream_run_with_handler')\n                yield message\n        except Exception as e:\n            raise AppbuilderTraceException(str(e))\n        finally:\n            new_span.set_attribute(\"output.value\",'流式运行结束')\n            new_span.set_attribute(\"openinference.span.kind\",'agent')   \n            new_span.end()\n            for item in output_list:\n                result += str(item)\n            span.set_attribute(\"output.value\", result)\n\ndef _assistant_stream_output(output, span, tracer):\n    \"\"\"\n    处理流式输出，并生成追踪信息。\n    \n    Args:\n        output (Iterator[Any]): 流式输出数据的迭代器。\n        span (Span): 追踪信息的Span对象。\n        tracer (Tracer): 追踪信息的Tracer对象。\n    \n    Returns:\n        List[Any]: 存储所有输出消息的列表。\n    \n    \"\"\"\n    result = ''\n    run_list = []\n    generator_list = []\n    if output:\n        new_span = tracer.start_span('Assistant-Stream_run')\n        for message in output:\n            generator_list.append(message)\n            new_span.set_attribute(\"openinference.span.kind\",'agent')\n            if message.event == \"status\":\n                new_span.set_attribute(\"output.value\", \"{}\".format(message.model_dump_json(indent=4)))\n            elif message.event == \"message\":\n                new_span.set_attribute(\"output.value\", \"{}\".format(message.model_dump_json(indent=4)))\n                if hasattr(message, 'content') and message.content and hasattr(message.content[0], 'text') and message.content[0].text and hasattr(message.content[0].text, 'value'):\n                    run_list.append(message.content[0].text.value)\n            new_span.end()\n            new_span = tracer.start_span('Assistant-Stream_run')\n        for item in run_list:\n            result += str(item) \n        new_span.set_attribute(\"output.value\",'流式输出结束\\n输出结果为:{}'.format(result))\n        new_span.set_attribute(\"openinference.span.kind\",'agent')\n        new_span.end()\n        span.set_attribute(\"output.value\",result)\n    return generator_list\n\ndef _components_run_output(output, span):\n    \"\"\"\n    设置span的属性以记录输出信息。\n    \n    Args:\n        output (Any): 运行组件后得到的输出对象，需要包含 `token_usage` 属性（如果存在）。\n        span (Span): Jaeger中的span对象，用于记录追踪信息。\n    \n    Returns:\n        None: 此函数不返回任何值，而是直接修改span对象的属性。\n    \n    \"\"\"\n    if hasattr(output, 'token_usage') and output.token_usage:\n        span.set_attribute(\"llm.token_count.prompt\", output.token_usage.get('prompt_tokens', 0))\n        span.set_attribute(\"llm.token_count.completion\", output.token_usage.get('completion_tokens', 0))\n        span.set_attribute(\"llm.token_count.total\", output.token_usage.get('total_tokens', 0)) \n    span.set_attribute(\"output.value\", \"{}\".format(output.model_dump_json(indent=4)))    \n\n\ndef _post_trace(tracer, func, *args, **kwargs):\n    \"\"\"\n    对指定的HTTP POST请求函数进行追踪，并生成追踪信息。\n    \n    Args:\n        tracer (Any): 追踪器实例，用于开始和结束追踪。\n        func (Callable[..., Any]): 需要被追踪的HTTP POST请求函数。\n        *args: 可变位置参数，用于传递给func函数。\n        **kwargs: 可变关键字参数，用于传递给func函数。\n    \n    Returns:\n        Any: func函数的返回值。\n    \n    \"\"\"\n    url = args[-1]\n    if not isinstance(url, str):\n        url = kwargs.get('url','')\n    method = url.split('/')[-1]\n    with tracer.start_as_current_span(\"HTTP-POST: {}\".format(method)) as new_span:\n        start_time = time.time()\n        result=func(*args, **kwargs)\n        end_time = time.time()\n        new_span.set_attribute(\"openinference.span.kind\",'tool')\n        _time(start_time = start_time,end_time = end_time,span = new_span)\n        _post_input(args = args, kwargs = kwargs,span = new_span)\n    return result\n\ndef _client_run_trace(tracer, func, *args, **kwargs):\n    \"\"\"\n    在客户端运行跟踪函数，根据参数决定是否以流模式执行\n    \n    Args:\n        tracer (Any): 跟踪器实例\n        func (Callable): 需要跟踪的函数\n        *args (tuple): 函数的可变位置参数\n        **kwargs (dict): 函数的可变关键字参数\n    \n    Returns:\n        Any: 跟踪函数的执行结果，根据stream参数的值，返回_client_run_trace_stream或_client_run_trace_un_stream的返回值\n    \n    Raises:\n        无特定异常，但可能抛出在执行函数时发生的任何异常\n    \n    \"\"\"\n    sig = inspect.signature(args[0])\n    params = sig.parameters\n    stream = False\n    if args:\n        for idx, value in enumerate(list(args)):\n            if list(params)[idx-1] == 'stream':\n                stream = value\n    if kwargs:\n        for key, value in dict(kwargs).items():\n            if key == 'stream':\n                stream = value\n    if stream:\n        return _client_run_trace_stream(tracer, func, *args, **kwargs)\n    if not stream:\n        return _client_run_trace_un_stream(tracer, func, *args, **kwargs)\n\n    \ndef _client_tool_trace(tracer, func, *args, **kwargs):\n    \"\"\"\n    追踪客户端工具函数的调用，记录相关信息到追踪器。\n    \n    Args:\n        tracer (Any): 追踪器实例，用于创建和记录追踪信息。\n        func (Callable[..., Any]): 要追踪的客户端工具函数。\n        *args (Any): 传递给func的位置参数。\n        **kwargs (Any): 传递给func的关键字参数。\n    \n    Returns:\n        Any: func函数执行后的返回值。\n    \n    \"\"\"\n    with tracer.start_as_current_span(_tool_name(args=args)) as new_span:\n        start_time = time.time()\n        result=func(*args, **kwargs)\n        end_time = time.time()\n        _time(start_time = start_time,end_time = end_time,span = new_span)\n        new_span.set_attribute(\"openinference.span.kind\",'tool')\n        _output(output=result, span = new_span)\n    return result\n\ndef _assistant_tool_trace(tracer, func, *args, **kwargs):\n    \"\"\"\n    对给定的函数进行追踪，记录其执行的时间、输入和输出。\n    \n    Args:\n        tracer: OpenTelemetry的Tracer实例，用于创建span。\n        func: 需要追踪的函数。\n        *args: 传递给func的位置参数。\n        **kwargs: 传递给func的关键字参数。\n    \n    Returns:\n        func的返回值。\n    \n    \"\"\"\n    span_name = _tool_name(args=args)\n    with tracer.start_as_current_span(span_name) as new_span:\n        start_time = time.time()\n        result=func(*args, **kwargs)\n        end_time = time.time()\n        _time(start_time = start_time,end_time = end_time,span = new_span)\n        _input(args = args, kwargs = kwargs, span=new_span)\n        new_span.set_attribute(\"openinference.span.kind\",'tool')\n        if result:\n            _output(output=result, span = new_span)\n    return result\n\ndef _assistant_run_trace(tracer, func, *args, **kwargs):\n    \"\"\"\n    使用给定的追踪器(tracer)对函数(func)的执行进行追踪。\n    \n    Args:\n        tracer (object): 追踪器对象，用于创建和操作追踪的span。\n        func (callable): 需要被追踪的函数。\n        *args (tuple): 传递给func的位置参数。\n        **kwargs (dict): 传递给func的关键字参数。\n    \n    Returns:\n        Any: 被追踪函数func的返回值。\n    \n    \"\"\"\n    with tracer.start_as_current_span(\"Assistant-RUN\") as new_span:\n        start_time = time.time()\n        result=func(*args, **kwargs)\n        end_time = time.time()\n        _time(start_time = start_time,end_time = end_time,span = new_span)\n        new_span.set_attribute(\"openinference.span.kind\",'Agent')\n        _input(args = args, kwargs = kwargs, span=new_span)\n        _assistant_output(output=result, span = new_span)\n    return result\n\ndef _assistant_stream_trace(tracer, func, *args, **kwargs):\n    \"\"\"\n    为辅助流跟踪的函数提供跟踪功能。\n    \n    Args:\n        tracer (Tracer): OpenTelemetry 的 Tracer 实例，用于生成和操作跟踪数据。\n        func (Callable): 需要进行流跟踪的函数。\n        *args: 传递给 func 的位置参数。\n        **kwargs: 传递给 func 的关键字参数。\n    \n    Returns:\n        Generator[Any, None, None]: 一个生成器，生成 func 函数的执行结果。\n    \n    \"\"\"\n    with tracer.start_as_current_span(\"Assistant-stream_run\") as span:\n        start_time = time.time()\n        result=func(*args, **kwargs)\n        span.set_attribute(\"openinference.span.kind\",'Agent')\n        _input(args = args, kwargs = kwargs, span=span)\n        run_list = []\n        new_span = tracer.start_span(\"Assistant-stream_run\")\n        for message in result:\n            new_span.set_attribute(\"openinference.span.kind\",'agent')\n            if message.event == \"status\":\n                new_span.set_attribute(\"output.value\", \"{}\".format(message.model_dump_json(indent=4)))\n            elif message.event == \"message\":\n                new_span.set_attribute(\"output.value\", \"{}\".format(message.model_dump_json(indent=4)))\n                if hasattr(message, 'content') and message.content and hasattr(message.content[0], 'text') and message.content[0].text and hasattr(message.content[0].text, 'value'):\n                    run_list.append(message.content[0].text.value)\n            new_span.end()\n            new_span = tracer.start_span('Assistant-Stream_run')\n            yield message\n        end_time = time.time()  \n        _time(start_time = start_time,end_time = end_time,span = span)\n        result_str = ''.join(str(res) for res in run_list)\n        span.set_attribute(\"output.value\",result_str)\n\n\ndef _assistant_stream_run_with_handler_trace(tracer, func, *args, **kwargs):\n    \"\"\"\n    在带有追踪器的上下文中运行函数，并捕获函数执行过程中的输入和输出，以及耗时。\n    \n    Args:\n        tracer (Tracer): Jaeger等追踪器实例，用于追踪函数调用过程中的事件。\n        func (Callable): 要执行的函数。\n        *args: 可变位置参数，传递给func的参数。\n        **kwargs: 可变关键字参数，传递给func的参数。\n    \n    Returns:\n        Any: 函数func的返回值。\n    \n    \"\"\"\n    with tracer.start_as_current_span(\"Assistant-stream_run_with_handler\", context=None) as span:\n        parent_context = trace.set_span_in_context(span)\n        span.set_attribute(\"openinference.span.kind\",'Agent')\n        start_time = time.time()\n        result=func(*args, **kwargs)\n        _input(args = args, kwargs = kwargs, span=span)\n        if result:\n            if hasattr(result, '_event_handler') and result._event_handler:\n                event_handler = result._event_handler\n                if hasattr(event_handler, '_iterator') and event_handler._iterator:\n                    generator = event_handler._iterator\n                    event_handler._iterator = _assistant_stream_run_with_handler_output(generator = generator, tracer = tracer, parent_context=parent_context)\n            \n        end_time = time.time()\n        _time(start_time = start_time,end_time = end_time,span = span)\n        return result\n\ndef _components_run_trace_with_opentelemetry(tracer, func, *args, **kwargs):\n    \"\"\"\n    使用opentelemetry追踪组件运行过程\n    \n    Args:\n        tracer (opentelemetry.trace.Tracer): OpenTelemetry追踪器对象\n        func (callable): 需要追踪的函数\n        *args: 任意数量的位置参数，用于调用func\n        **kwargs: 任意数量的关键字参数，用于调用func\n    \n    Returns:\n        Any: func函数的返回值\n    \n    \"\"\"\n    with tracer.start_as_current_span(_tool_name(args=args)) as new_span:\n        start_time = time.time()\n        result=func(*args, **kwargs)\n        end_time = time.time()\n        _time(start_time = start_time,end_time = end_time,span = new_span)\n        new_span.set_attribute(\"openinference.span.kind\",'tool')\n        _input(args = args, kwargs = kwargs, span=new_span)\n        _components_run_output(output=result, span = new_span)\n        return result\n\ndef _components_run_trace_with_sentry(func, *args, **kwargs):\n    \"\"\"\n    使用 Sentry SDK 进行跟踪的函数装饰器。\n    \n    Args:\n        func: 被装饰的函数对象。\n        *args: 被装饰函数的参数，可变长度。\n        **kwargs: 被装饰函数的命名参数，可变长度。\n    \n    Returns:\n        函数 func 的执行结果。\n    \n    \"\"\"\n    try:\n        import sentry_sdk\n    except:\n        raise ImportError(\"sentry-sdk is not installed.\")\n    \n    with sentry_sdk.start_span(op=_tool_name(args=args), description=_tool_name(args=args)) as new_span:\n        new_span.set_data(\"Span-kind\", \"Components-RUN\")\n        result=func(*args, **kwargs)\n        _input(args = args, kwargs = kwargs, span=new_span)\n        return result\n\ndef _components_stream_run_trace_with_opentelemetry(tracer, func, *args, **kwargs):\n    \"\"\"\n    使用OpenTelemetry跟踪器追踪组件流运行过程\n    \n    Args:\n        tracer (opentelemetry.trace.Tracer): OpenTelemetry跟踪器实例\n        func (callable): 组件流函数\n        *args: 组件流函数所需位置参数\n        **kwargs: 组件流函数所需关键字参数\n    \n    Returns:\n        Generator: 组件流函数返回值的生成器\n    \n    \"\"\"\n    with tracer.start_as_current_span(_tool_name(args = args)) as span:\n        start_time = time.time()\n        span.set_attribute(\"openinference.span.kind\",'tool')\n        _input(args = args, kwargs = kwargs, span=span)\n        run_list = [] \n        for item in func(*args, **kwargs):  \n            with tracer.start_as_current_span('Component-Stream') as new_span:  \n                new_span.set_attribute(\"openinference.span.kind\",'tool')\n                if isinstance(item, ComponentOutput):\n                    new_span.set_attribute(\"output.value\", \"{}\".format(item.model_dump_json(indent=4)))\n                else:\n                    new_span.set_attribute(\"output.value\", \"{}\".format(json.dumps(item, ensure_ascii=False)))\n                    if isinstance(item, dict):\n                        run_list.append(item.get('text', None))\n                    else:\n                        run_list.append(str(item))\n                yield item\n        end_time = time.time()  \n        _time(start_time = start_time,end_time = end_time,span = span)\n        if run_list:\n            result_str = ''.join(str(res) for res in run_list)\n            span.set_attribute(\"output.value\",result_str)\n        else:\n            span.set_attribute(\"output.value\",\"流式运行结束\")\n\ndef _components_stream_run_trace_with_sentry(func, *args, **kwargs):\n     \"\"\"\n     通过sentry追踪函数运行时的信息。\n     \n     Args:\n         func (callable): 要执行的函数。\n         *args: 可变位置参数，传入func的参数。\n         **kwargs: 可变关键字参数，传入func的参数。\n     \n     Returns:\n         Generator: 返回一个生成器，每次迭代返回func的一个返回值。\n     \n     \"\"\"\n     try:\n         import sentry_sdk\n     except:\n         raise ImportError(\"sentry-sdk is not installed.\")\n     with sentry_sdk.start_span(op=_tool_name(args=args), description=_tool_name(args=args)) as span:\n        span.set_data(\"Span-kind\", \"Components-Tool-Eval\")\n        _input(args = args, kwargs = kwargs, span=span)\n        run_list = []\n        for item in func(*args, **kwargs):  \n            with sentry_sdk.start_span(op=_tool_name(args=args), description=_tool_name(args=args)) as new_span:  \n                new_span.set_data(\"Span-kind\",'tool')\n                if isinstance(item, ComponentOutput):\n                    new_span.set_data(\"output.value\", \"{}\".format(item.model_dump_json(indent=4)))\n                else:\n                    new_span.set_data(\"output-value\", \"{}\".format(json.dumps(item, ensure_ascii=False)))\n                    if isinstance(item, dict):\n                        text = item.get('text', None)\n                        run_list.append(text)\n                    else:\n                        run_list.append(str(item))\n                yield item\n        if run_list: \n            result_str = ''.join(str(res) for res in run_list)\n            span.set_data(\"output-value\",result_str)\n        else:\n            span.set_data(\"output-value\",\"流式运行结束\")\n                \n\ndef _list_trace(tracer, func, *args, **kwargs):\n    \"\"\"\n    使用给定的tracer对函数func进行追踪，并记录相关信息到span中。\n    \n    Args:\n        tracer (OpenTelemetryTracer): 用于追踪的tracer对象。\n        func (Callable[..., Any]): 需要被追踪的函数。\n        *args: 传递给func的位置参数。\n        **kwargs: 传递给func的关键字参数。\n    \n    Returns:\n        Any: 调用func的返回结果。\n    \n    \"\"\"\n    with tracer.start_as_current_span(_tool_name(args = args)) as new_span:      \n        result=func(*args, **kwargs)\n        new_span.set_attribute(\"openinference.span.kind\",'tool')\n        new_span.set_attribute(\"input.value\",_tool_name(args = args))\n        new_span.set_attribute(\"output.value\",str(result))\n    return result"
  },
  {
    "path": "python/utils/trace/phoenix_wrapper.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport argparse\nimport time\nfrom typing import Optional\n\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--host\",  type=str, default=\"127.0.0.1\", help=\"phoenix服务的url地址\")\nparser.add_argument(\"--port\", type=int, default=8080, help=\"phoenix服务的端口号\")\nparser.add_argument(\"--timeout\", type=float, default=None, help=\"phoenix服务的运行时间，不填写则为常驻服务，单位为秒\")\n\n\ndef launch_phoenix(host: Optional[str] = \"127.0.0.1\", port: Optional[int] = 8080, **kwargs):\n    \"\"\"\n    启动Phoenix\n    Launch Phoenix\n    \"\"\"\n    try:\n        import phoenix\n    except ModuleNotFoundError:\n        raise ImportError(\n            \"尚未安装phoenix组件，尝试使用 python3 -m pip install arize-phoenix==4.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple 安装该组件\")\n    session = phoenix.launch_app(**kwargs)\n    return session\n\ndef stop_phoenix(delete_data:bool=False):\n    \"\"\"\n    停止Phoenix\n    Stop Phoenix\n    \"\"\"\n    try:\n        import phoenix\n    except ModuleNotFoundError:\n        raise ImportError(\n            \"尚未安装phoenix组件，尝试使用 python3 -m pip install arize-phoenix==4.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple 安装该组件\")\n    phoenix.stop_app(delete_data)\n\ndef runtime_main():\n    \"\"\"\n    运行主程序\n    Run main program\n    \"\"\" \n    args = parser.parse_args()\n    os.environ['PHOENIX_PORT'] = str(args.port)\n    os.environ['PHOENIX_HOST'] = args.host\n    timeout = args.timeout\n    print(\" Launching AppBuilder Tracer Server By Phoenix... \")\n    print(\" Arguments: \", args)\n    session = launch_phoenix()\n    while True:\n        if timeout is not None:\n            time.sleep(timeout)\n            break\n        time.sleep(1)\n    stop_phoenix()\n\n\nif __name__ == \"__main__\":\n    runtime_main()\n"
  },
  {
    "path": "python/utils/trace/tracer.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nfrom importlib import import_module\n\nfrom opentelemetry import trace\nfrom opentelemetry.instrumentation.instrumentor import BaseInstrumentor\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nfrom opentelemetry.sdk.trace.export import (\n    SpanExporter,\n    SimpleSpanProcessor,\n    ConsoleSpanExporter\n)\nfrom wrapt import wrap_function_wrapper\n\nfrom appbuilder.utils.trace._function import( \n    _post_trace, \n    _client_run_trace, \n    _client_tool_trace, \n    _assistant_tool_trace, \n    _assistant_run_trace,\n    _assistant_stream_trace,\n    _assistant_stream_run_with_handler_trace,\n    _components_run_trace_with_opentelemetry,\n    _components_run_trace_with_sentry,\n    _components_stream_run_trace_with_opentelemetry,\n    _components_stream_run_trace_with_sentry,\n    _list_trace,\n    )\nfrom appbuilder import logger\n\n_MODULE_1 = 'appbuilder'\n_MODULE_2 = 'appbuilder-sdk-ext'\n\n\nclass AppbuilderInstrumentor(BaseInstrumentor):\n    \"\"\"\n    Instrumentor for appbuilder and appbuilder-sdk-ext.\n    \"\"\"\n\n    _instance = None\n    _instrumented = False\n\n    def __new__(cls, *args, **kwargs):\n        if cls._instance is None:\n            cls._instance = super().__new__(cls)\n        return cls._instance\n\n    __slots__ = (\n        \"_original_session_post\",\n        '_original_client_run',\n        '_original_client_tool',\n        '_original_assistant_tool',\n        '_original_assistant_run',\n        '_original_assistant_stream_run',\n        '_original_assistant_stream_run_with_handler',\n        '_orignal_components_run',\n        '_original_components_stream_run',\n        '_original_list',\n    )\n    def instrumentation_dependencies(self):\n        pass\n\n    def _instrument(self, **kwargs):\n        \"\"\"\n        为指定模块的函数添加跟踪功能。\n        \n        Args:\n            **kwargs: 可选参数，用于提供跟踪器提供程序。\n        \n        Returns:\n            None\n        \n        Raises:\n            ImportError: 如果从文件中缺少`run_trace`、`tool_eval_streaming_trace`和`assistant_trace`方法，则引发此异常。\n            Exception: 如果未找到`appbuilder`和`appbuilder-sdk-ext`模块，则引发此异常。\n        \n        \"\"\"\n        if self._instrumented:\n            return\n        self._instrumented = True\n        \n        # 判断是否启用Sentry跟踪，如果启用，则创建虚拟的的Tracer,仅对Components组件生效\n        if os.environ.get('ENABLE_SENTRY_TRACE', None) == 'true' and os.environ.get('SENTRY_DSN', None):\n            try:\n                import sentry_sdk\n            except:\n                raise ImportError(\"sentry-sdk is not installed.\")\n            self.sentry_trace = True\n        else:\n            self.sentry_trace = False\n\n        if self.sentry_trace:\n            tracer = None\n        else:\n            if not (tracer_provider := kwargs.get(\"tracer_provider\")):\n                tracer_provider = trace.get_tracer_provider()\n\n            tracer = trace.get_tracer(\n                instrumenting_module_name=__name__,\n                tracer_provider=tracer_provider,\n            )\n\n        # 保存原始函数的引用\n\n        try:\n            from .tracer_wrapper import  (\n                session_post_func, \n                client_run_trace_func,\n                client_tool_trace_func, \n                assistent_tool_trace_func, \n                assistant_run_trace_func,\n                assistent_stream_run_trace_func,\n                assistant_stream_run_with_handler_trace_func,\n                components_run_trace_func,\n                components_run_stream_trace_func,\n                list_trace_func,\n                )\n            self._original_session_post = session_post_func\n            self._original_client_run = client_run_trace_func\n            self._original_client_tool =  client_tool_trace_func\n            self._original_assistant_tool = assistent_tool_trace_func\n            self._original_assistant_run = assistant_run_trace_func\n            self._original_assistant_stream_run = assistent_stream_run_trace_func\n            self._original_assistant_stream_run_with_handler = assistant_stream_run_with_handler_trace_func\n            self._orignal_components_run = components_run_trace_func\n            self._original_components_stream_run = components_run_stream_trace_func\n            self._original_list = list_trace_func\n        except:\n            raise ImportError(\n                \"Please check if the run_trace, tool_eval_streaming_trace, and assistant_trace methods are missing from the file.\")\n\n        # 保证trace对appbuilder与appbuilder-sdk-ext的兼容性\n        try:\n            appbuilder = import_module(_MODULE_1)\n        except:\n            appbuilder = None\n\n        \n        def _appbuilder_session_post(wrapped, instance, args, kwargs):\n            return _post_trace(tracer, self._original_session_post, *args, **kwargs)\n        \n        def _appbuilder_client_run_trace(wrapped, instance, args, kwargs):\n            return _client_run_trace(tracer, self._original_client_run, *args, **kwargs)\n        \n        def _appbuilder_client_tool_trace(wrapped, instance, args, kwargs):\n            return _client_tool_trace(tracer, self._original_client_tool, *args, **kwargs)\n        \n        def _appbuilder_assistant_tool_trace(wrapped, instance, args, kwargs):\n            return _assistant_tool_trace(tracer, self._original_assistant_tool, *args, **kwargs)\n        \n        def _appbuilder_assistant_run_trace(wrapped, instance, args, kwargs):\n            return _assistant_run_trace(tracer, self._original_assistant_run, *args, **kwargs)\n        \n        def _appbuilder_assistant_stream_run_trace(wrapped, instance, args, kwargs):\n            return _assistant_stream_trace(tracer, self._original_assistant_stream_run, *args, **kwargs)\n        \n        def _appbuilder_assistant_stream_run_with_handler_trace(wrapped, instance, args, kwargs):\n            return _assistant_stream_run_with_handler_trace(tracer, self._original_assistant_stream_run_with_handler, *args, **kwargs)\n        \n        def _appbuilder_components_run_trace(wrapped, instance, args, kwargs):\n            return _components_run_trace_with_opentelemetry(tracer, self._orignal_components_run, *args, **kwargs)\n\n        def _appbuilder_components_run_trace_with_sentry(wrapped, instance, args, kwargs):\n            return _components_run_trace_with_sentry(self._orignal_components_run, *args, **kwargs)\n        \n        def _appbuilder_components_run_stream_trace(wrapped, instance, args, kwargs):\n            return _components_stream_run_trace_with_opentelemetry(tracer, self._original_components_stream_run, *args, **kwargs)\n        \n        def _appbuilder_components_run_stream_trace_with_sentry(wrapped, instance, args, kwargs):\n            return _components_stream_run_trace_with_sentry(self._original_components_stream_run, *args, **kwargs)\n        \n        def _appbuilder_list_trace(wrapped, instance, args, kwargs):\n            return _list_trace(tracer, self._original_list, *args, **kwargs)\n\n        # 引用相关函数并替换\n        if appbuilder:\n            if not self.sentry_trace:\n                wrap_function_wrapper(\n                    module = _MODULE_1,\n                    name='utils.trace.tracer_wrapper.session_post_func',\n                    wrapper=_appbuilder_session_post\n                )\n\n                wrap_function_wrapper(\n                    module = _MODULE_1,\n                    name = 'utils.trace.tracer_wrapper.client_run_trace_func',\n                    wrapper= _appbuilder_client_run_trace\n                )\n\n                wrap_function_wrapper(\n                    module = _MODULE_1,\n                    name = 'utils.trace.tracer_wrapper.client_tool_trace_func',\n                    wrapper = _appbuilder_client_tool_trace\n                )\n\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.assistent_tool_trace_func',\n                    wrapper= _appbuilder_assistant_tool_trace\n                )\n\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.assistant_run_trace_func',\n                    wrapper= _appbuilder_assistant_run_trace\n                )\n\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.assistent_stream_run_trace_func',\n                    wrapper= _appbuilder_assistant_stream_run_trace\n                )\n\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.assistant_stream_run_with_handler_trace_func',\n                    wrapper= _appbuilder_assistant_stream_run_with_handler_trace\n                )\n\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.list_trace_func',\n                    wrapper= _appbuilder_list_trace\n                )\n\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.components_run_trace_func',\n                    wrapper= _appbuilder_components_run_trace\n                )\n\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.components_run_stream_trace_func',\n                    wrapper= _appbuilder_components_run_stream_trace\n                )\n            else:\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.components_run_trace_func',\n                    wrapper= _appbuilder_components_run_trace_with_sentry\n                )\n\n                wrap_function_wrapper(\n                    module= _MODULE_1, \n                    name = 'utils.trace.tracer_wrapper.components_run_stream_trace_func',\n                    wrapper= _appbuilder_components_run_stream_trace_with_sentry\n                )\n\n        if not appbuilder:\n            raise Exception(\"appbuilder not found\")\n\n    def _uninstrument(self):\n        \"\"\"\n        恢复原始函数，移除之前添加的追踪代码。\n        \n        Args:\n            无参数。\n        \n        Returns:\n            无返回值。\n        \n        Raises:\n            无异常抛出，但如果在尝试恢复原始函数时遇到任何问题，将打印一条错误消息\"appbuilder not found\"。\n        \n        \"\"\"\n        # 恢复原始函数\n        try:\n            from appbuilder.utils.trace.tracer_wrapper import (\n                session_post_func, \n                client_run_trace_func, \n                client_tool_trace_func, \n                assistent_tool_trace_func, \n                assistant_run_trace_func,\n                assistant_stream_run_with_handler_trace_func,\n                components_run_trace_func,\n                components_run_stream_trace_func,\n                list_trace_func,\n                )\n            \n            session_post_func = self._original_session_post\n            client_run_trace_func = self._original_client_run\n            client_tool_trace_func = self._original_client_tool\n            assistent_tool_trace_func = self._original_assistant_tool\n            assistant_run_trace_func = self._original_assistant_run\n            assistant_stream_run_with_handler_trace_func = self._original_assistant_stream_run_with_handler\n            components_run_trace_func = self._orignal_components_run\n            components_run_stream_trace_func = self._original_components_stream_run\n            list_trace_func = self._original_list\n        except:\n            print(\"appbuilder not found\")\n            \n\ndef create_tracer_provider(enable_phoenix: bool = True, enable_console: bool = False, host: str = \"127.0.0.1\", port: int = 8080, method: str = \"/v1/traces\"):\n    \"\"\"\n    创建一个用于跟踪的TracerProvider对象，并可选择性地添加span处理器，以便将跟踪数据发送到指定的端点或控制台。\n    \n    Args:\n        enable_phoenix (bool, optional): 是否启用Phoenix，以在本地可视化界面展示trace数据。默认为True。\n        enable_console (bool, optional): 是否启用控制台输出，以在控制台展示trace数据。默认为False。\n        host (str, optional): Phoenix可视化界面的主机地址。默认为\"127.0.0.1\"。\n        port (int, optional): Phoenix可视化界面的端口号。默认为8080。\n        method (str, optional): Phoenix可视化界面的请求路径。默认为\"/v1/traces\"。\n    \n    Returns:\n        TracerProvider: 创建的TracerProvider对象，可用于创建跟踪的Span对象。\n    \n    \"\"\"\n    tracer_provider = TracerProvider()\n\n    if enable_phoenix:  # 将trace数据在本地可视化界面展示\n        endpoint = f\"{host}:{port}{method}\"\n        logger.info(\"OTLPSpanExporter endpoint: {}\".format(endpoint))\n        tracer_provider.add_span_processor(\n            SimpleSpanProcessor(OTLPSpanExporter(endpoint)))\n\n    if enable_console:  # 将trace数据在控制台展示\n        tracer_provider.add_span_processor(\n            SimpleSpanProcessor(ConsoleSpanExporter()))\n\n    return tracer_provider\n\n\nclass AppBuilderTracer():\n    _instance = None\n    _trace_start = False\n\n    def __new__(cls, *args, **kwargs):\n        if cls._instance is None:\n            cls._instance = super().__new__(cls)\n        return cls._instance\n\n    def __init__(self, enable_phoenix: bool = True, enable_console: bool = False, host: str = \"http://localhost\", port: int = 8080, method=\"/v1/traces\") -> None:\n        \"\"\"\n        初始化函数，用于设置追踪系统相关参数。\n        \n        Args:\n            enable_phoenix (bool, optional): 是否启用Phoenix服务。默认为True。\n            enable_console (bool, optional): 是否启用控制台输出。默认为False。\n            host (str, optional): 可视化追踪系统服务的地址。默认为\"http://localhost\"。\n            port (int, optional): 可视化追踪系统服务的端口号。默认为8080。\n            method (str, optional): 可视化追踪系统服务的方法路径。默认为\"/v1/traces\"。\n        \n        Returns:\n            None: 无返回值。\n        \n        \"\"\"\n        self._tracer_provider = create_tracer_provider(\n            enable_phoenix=enable_phoenix,\n            enable_console=enable_console,\n            host=host,\n            port=port,\n            method=method\n        )\n        self._instrumentor = AppbuilderInstrumentor()\n\n    @property\n    def tracer_provider(self):\n        return self._tracer_provider\n    \n    @property\n    def instrumentor(self):\n        return self._instrumentor\n\n    def add_custom_processor(self, processor):\n        self._tracer_provider.add_span_processor(processor)\n\n    def start_trace(self):\n        if self._trace_start:\n            return\n        logger.info(\"AppBuilder Starting trace...\")\n        os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"] = \"true\"\n        self._instrumentor._instrument(tracer_provider=self._tracer_provider)\n\n    def end_trace(self):\n        logger.info(\"AppBuilder Ending trace...\")\n        del os.environ[\"APPBUILDER_SDK_TRACE_ENABLE\"]\n        self._instrumentor._uninstrument()\n\n    def __enter__(self):\n        self.start_trace()\n        return self\n\n    def __exit__(self, exc_type, exc_val, exc_tb):\n        self.end_trace()\n"
  },
  {
    "path": "python/utils/trace/tracer_wrapper.py",
    "content": "# Copyright (c) 2024 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nimport os\nimport sys\nimport traceback\n#import _testcapi\nfrom functools import wraps\n\ndef _whether_enable_trace():\n    if os.environ.get('ENABLE_SENTRY_TRACE', None) == 'true' and os.environ.get('SENTRY_DSN', None):\n        return True\n    elif os.environ.get('APPBUILDER_SDK_TRACE_ENABLE', None) == 'true':\n        return True\n    else:\n        return False\n\ndef session_post_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\n\ndef client_run_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\n\ndef client_tool_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\ndef assistent_tool_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\ndef assistant_run_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\ndef assistant_stream_run_with_handler_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\ndef assistent_stream_run_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\ndef components_run_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\ndef components_run_stream_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\ndef list_trace_func(func, *args, **kwargs):\n    return func(*args, **kwargs)\n\ndef session_post(func):\n    \"\"\"\n    将指定的函数装饰为使用 session_post_func 发送 POST 请求的函数。\n    \n    Args:\n        func (Callable): 被装饰的函数。\n    \n    Returns:\n        Callable: 返回一个新的函数，该函数会在被调用时通过 session_post_func 发送 POST 请求。\n    \n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():  \n            try:\n                return session_post_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        #_testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                #_testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n                \n    return wrapper \n\n\ndef client_run_trace(func):\n    \"\"\"\n    对传入的函数进行装饰，添加客户端运行跟踪功能。\n    \n    Args:\n        func (callable): 需要被装饰的函数。\n    \n    Returns:\n        callable: 返回一个包装后的函数，该函数在执行时会调用 client_run_trace_func 函数，\n                  并传入原始函数及其参数。\n    \n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():\n            try:\n                return client_run_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n\n    return wrapper \n\n\ndef client_tool_trace(func):\n    \"\"\"\n    装饰器函数，用于跟踪客户端工具函数的调用情况。\n    \n    Args:\n        func (callable): 需要被跟踪的函数。\n    \n    Returns:\n        callable: 返回一个装饰器函数，该函数会调用原函数并记录相关信息。\n    \n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():\n            try:\n                return client_tool_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n    return wrapper \n\n\ndef assistent_tool_trace(func):\n    \"\"\"\n    用于辅助追踪函数执行情况的装饰器。\n    \n    Args:\n        func (Callable[..., Any]): 需要被装饰的函数，接受任意数量和类型的参数。\n    \n    Returns:\n        Callable[..., Any]: 返回一个函数，该函数会在调用原函数前后记录一些信息，\n        然后将原函数的返回值返回。\n    \n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():\n            try:\n                return assistent_tool_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n    \n    return wrapper\n\n\ndef assistant_run_trace(func):\n    \"\"\"\n    对函数进行装饰，用于在函数执行前后进行日志跟踪。\n    \n    Args:\n        func (Callable): 需要进行日志跟踪的函数。\n    \n    Returns:\n        Callable: 经过装饰后，带有日志跟踪功能的函数。\n\n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():\n            try:\n                return assistant_run_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n    \n    return wrapper \n\ndef assistent_stream_run_trace(func):\n    \"\"\"\n    对目标函数进行包装，以启用辅助流执行追踪功能。\n    \n    Args:\n        func (Callable): 需要包装的目标函数，必须是一个可调用的对象。\n    \n    Returns:\n        Callable: 包装后的函数对象，调用时将执行辅助流执行追踪，并返回目标函数的执行结果。\n\n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():\n            try:\n                return assistent_stream_run_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n        \n    return wrapper \n\ndef assistent_stream_run_with_handler_trace(func):\n    \"\"\"\n    为函数添加助手流运行和处理器跟踪的装饰器。\n    \n    Args:\n        func (Callable): 需要被装饰的函数，即助手流运行的入口函数。\n    \n    Returns:\n        Callable: 返回一个包装后的函数，该函数在调用时会执行assistant_stream_run_with_handler_trace_func函数，\n                   并将原始函数func及其参数传递给它。\n\n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():\n            try:\n                return assistant_stream_run_with_handler_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n    \n    return wrapper \n\ndef components_run_trace(func):\n    \"\"\"\n    为函数添加组件运行跟踪的装饰器。\n    \n    Args:\n        func (Callable[..., Any]): 需要添加跟踪的函数。\n    \n    Returns:\n        Callable[..., Any]: 装饰后的函数，当被调用时，会调用 components_run_trace_func 并传入原始函数和参数。\n\n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():    \n            try:\n                return components_run_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n                \n    return wrapper\n\ndef components_run_stream_trace(func):\n    \"\"\"\n    为给定的函数添加流追踪功能，用于追踪函数内部组件的运行情况。\n    \n    Args:\n        func (callable): 需要添加流追踪功能的函数。\n    \n    Returns:\n        callable: 返回一个装饰器函数，当被装饰的函数被调用时，会执行流追踪功能。\n\n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():\n            try:\n                return components_run_stream_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n  \n    \n    return wrapper\n\ndef list_trace(func):\n    \"\"\"\n    为函数添加列表追踪的装饰器。\n    \n    Args:\n        func (Callable[..., Any]): 需要被装饰的函数，接受任意数量和类型的参数。\n\n    Returns:\n        Callable[..., Any]: 返回一个装饰器函数，该函数在被调用时会执行原始函数并记录相关信息。\n    \n    Raises:\n        Exception: 如果在发送 POST 请求时发生异常，并且环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则直接抛出异常；\n                  否则，尝试捕获异常并生成自定义的异常信息后抛出。\n    \n    Note:\n        如果环境变量 APPBUILDER_TRACE_DEBUG 被设置为 \"true\"，则在发生异常时将直接抛出原始异常。\n        否则，会尝试过滤掉与 \"appbuilder/utils/trace\" 相关的堆栈跟踪，并生成自定义的异常信息后抛出。\n        如果在生成自定义异常信息的过程中发生异常，则会直接抛出原始异常。\n    \"\"\"\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        if _whether_enable_trace():\n            try:\n                return list_trace_func(func, *args, **kwargs)\n            except Exception as e:\n                if os.getenv(\"APPBUILDER_TRACE_DEBUG\", \"None\").lower() == \"true\":\n                    raise\n                else:\n                    exc_type, exc_value, exc_traceback = sys.exc_info()\n                    tb = traceback.extract_tb(exc_traceback)\n                    filtered_tb = [frame for frame in tb if \"appbuilder/utils/trace\" not in frame.filename]\n                    formatted_lines = traceback.format_list(filtered_tb)\n                    formatted_lines += traceback.format_exception_only(exc_type, exc_value)\n                    custom_traceback = ''.join(formatted_lines)\n                    exception_type = type(e)\n                    try:\n                        try:\n                            exception_type('\\n'+custom_traceback)\n                        except Exception:\n                            raise e from None\n                        raise exception_type('\\n'+custom_traceback) from None\n                    except:\n                        tp, exc, tb = sys.exc_info()\n                        # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                        del tp, exc, tb\n                        raise\n        else:\n            try:\n                return func(*args, **kwargs)\n            except:\n                tp, exc, tb = sys.exc_info()\n                # _testcapi.set_exc_info(tp, exc, tb.tb_next)\n                del tp, exc, tb\n                raise\n    \n    return wrapper\n\n"
  },
  {
    "path": "requirements.txt",
    "content": "requests\nproto-plus>=1.22.3\npydantic>=2.6.4\nnumpy\nopenpyxl\npymochow>=1.1.2\nPyYAML\nbce-python-sdk\npycryptodome\nopentelemetry-exporter-otlp>=1.23.0\nopentelemetry-instrumentation>=0.44b0\nopentelemetry-sdk>=1.23.0\nopentelemetry-api>=1.23.0\npydub>=0.10.0\nffmpeg\naiohttp\nurllib3<2.0.0\nmcp==1.3.0"
  },
  {
    "path": "setup.py",
    "content": "# Copyright (c) 2023 Baidu, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"\nSetup script.\n\nAuthors: dongdaxiang(dongdaxiang@baidu.com)\nDate:    2023/12/01 11:19:24\n\"\"\"\n\nimport os\nimport shutil\nimport datetime\nfrom setuptools import setup, find_packages\n\nwith open('requirements.txt') as f:\n    requirements = f.read().splitlines()\n\n\nnow = datetime.datetime.now()\ntimestamp_str = now.strftime(\"%Y%m%d_%H%M%S\")\npackage_dir = f\"appbuilder_sdk_{timestamp_str}\"\nif not os.path.exists(package_dir):\n    os.makedirs(package_dir)\n\nshutil.copytree(\"python\", os.path.join(package_dir, \"appbuilder\"))\nshutil.copy(\"requirements.txt\", package_dir)\n\npackages = find_packages(where=package_dir)\npackage_data = {}\nprint(packages)\nfor package in packages:\n    if package.startswith('appbuilder.utils'):\n        package_data[package] = [\"*.md\"]\n\nserve_require = [\"chainlit~=1.0.200\", \"flask~=2.3.2\", \"flask-restful==0.3.9\", \"arize-phoenix==4.5.0\"]\ntrace_require = [\"SQLAlchemy==2.0.31\"]\ntest_require = [\"python-dotenv\"]\nlangchain_require = [\"langchain==0.3.0\", \"datamodel-code-generator==0.25.8\"]\nmcp_require = [\"mcp>=1.2.1\"]\nall_require = serve_require + trace_require + test_require + langchain_require + mcp_require\n\nsetup(\n    name=\"appbuilder-sdk\",\n    # NOTE(chengmo): 修改此版本号时，请注意同时修改 __init__.py 中的 __version__\n    version=\"1.1.5\",\n    author=\"dongdaxiang\",\n    author_email=\"dongdaxiang@baidu.com\",\n    packages=packages,\n    package_data=package_data,\n    package_dir={'': package_dir}, \n    install_requires=requirements,\n    python_requires=\">=3.9\",\n    extras_require={\n        \"serve\": serve_require,\n        \"trace\": trace_require,\n        \"test\": test_require,\n        \"langchain\": langchain_require,\n        \"mcp\": mcp_require,\n        \"all\": all_require\n    },\n    entry_points={\n        \"console_scripts\": [\n            \"appbuilder_bce_deploy=appbuilder.utils.bce_deploy:deploy\",\n            \"appbuilder_trace_server=appbuilder.utils.trace.phoenix_wrapper:runtime_main\"\n        ]\n    },\n    description=\"百度智能云千帆AppBuilder-SDK\",\n    long_description=\"百度智能云千帆AppBuilder, 开箱即用的组件与框架, 高效开发你的AI原生应用, 更多信息请登录: https://appbuilder.cloud.baidu.com/\",\n    url=\"https://github.com/baidubce/app-builder\",\n)\n\nshutil.rmtree(package_dir)\n"
  }
]